@one-paragon/angular-utilities 2.2.4 → 2.2.6

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 (297) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +15 -27
  4. package/src/action-state/action-state-spinner/action-state-spinner.component.css +16 -0
  5. package/src/action-state/action-state-spinner/action-state-spinner.component.html +7 -0
  6. package/src/action-state/action-state-spinner/action-state-spinner.component.spec.ts +25 -0
  7. package/src/action-state/action-state-spinner/action-state-spinner.component.ts +25 -0
  8. package/src/action-state/action-state-ui/action-state-ui.module.ts +13 -0
  9. package/{action-state/index.d.ts → src/action-state/index.ts} +8 -4
  10. package/src/action-state/ngrx-ext/ngrx-ext.module.ts +14 -0
  11. package/src/action-state/ngrx.ts +69 -0
  12. package/src/http-request-state/RequestStateFactory.ts +56 -0
  13. package/src/http-request-state/RequestStateStore.ts +284 -0
  14. package/{http-request-state/deprecated.d.ts → src/http-request-state/deprecated.ts} +20 -20
  15. package/src/http-request-state/directives/HttpStateDirectiveBase.ts +29 -0
  16. package/src/http-request-state/directives/http-error-state-directive.ts +21 -0
  17. package/src/http-request-state/directives/http-inProgress-state-directive.ts +19 -0
  18. package/src/http-request-state/directives/http-notStarted-state-directive.ts +19 -0
  19. package/src/http-request-state/directives/http-success-state-directive.ts +29 -0
  20. package/{http-request-state/directives/index.d.ts → src/http-request-state/directives/index.ts} +5 -5
  21. package/src/http-request-state/directives/request-state-directive.spec.ts +73 -0
  22. package/src/http-request-state/directives/request-state-directive.ts +78 -0
  23. package/src/http-request-state/helpers.ts +30 -0
  24. package/src/http-request-state/http-state-module.ts +23 -0
  25. package/{http-request-state/index.d.ts → src/http-request-state/index.ts} +7 -7
  26. package/src/http-request-state/models/view-context.ts +18 -0
  27. package/src/http-request-state/observable.spec.ts +43 -0
  28. package/src/http-request-state/request-state.ts +66 -0
  29. package/src/http-request-state/rxjs/getRequestorBody.ts +10 -0
  30. package/src/http-request-state/rxjs/getRequestorState.ts +8 -0
  31. package/{http-request-state/rxjs/index.d.ts → src/http-request-state/rxjs/index.ts} +4 -4
  32. package/src/http-request-state/rxjs/tapError.ts +16 -0
  33. package/src/http-request-state/rxjs/tapSuccess.ts +16 -0
  34. package/src/http-request-state/strategies.spec.ts +42 -0
  35. package/src/http-request-state/types.ts +54 -0
  36. package/src/ngrx/actionable-selector.ts +160 -0
  37. package/src/ngrx/index.ts +1 -0
  38. package/{public-api.d.ts → src/public-api.ts} +35 -16
  39. package/src/rxjs/defaultShareReplay.ts +8 -0
  40. package/{rxjs/index.d.ts → src/rxjs/index.ts} +5 -5
  41. package/src/rxjs/mapError.ts +8 -0
  42. package/src/rxjs/rxjs-operators.ts +130 -0
  43. package/src/rxjs/subjectifier.ts +17 -0
  44. package/src/rxjs/subscriber.directive.ts +57 -0
  45. package/src/specs/clickSubject.spec.ts +95 -0
  46. package/src/specs/dialog.spec.ts +101 -0
  47. package/src/specs/toggleGroupDirective.spec.ts +229 -0
  48. package/src/table-builder/classes/DefaultSettings.ts +11 -0
  49. package/src/table-builder/classes/MatTableObservableDataSource.ts +23 -0
  50. package/src/table-builder/classes/TableBuilderConfig.ts +50 -0
  51. package/src/table-builder/classes/TableBuilderDataSource.ts +64 -0
  52. package/src/table-builder/classes/TableState.ts +125 -0
  53. package/src/table-builder/classes/data-store.ts +10 -0
  54. package/{table-builder/classes/display-col.d.ts → src/table-builder/classes/display-col.ts} +5 -5
  55. package/src/table-builder/classes/filter-info.ts +125 -0
  56. package/src/table-builder/classes/table-builder-general-settings.ts +205 -0
  57. package/src/table-builder/classes/table-builder.ts +105 -0
  58. package/src/table-builder/classes/table-store.helpers.ts +104 -0
  59. package/src/table-builder/classes/table-store.ts +440 -0
  60. package/src/table-builder/components/array-column.component.ts +34 -0
  61. package/src/table-builder/components/column-builder/column-builder.component.html +87 -0
  62. package/src/table-builder/components/column-builder/column-builder.component.scss +43 -0
  63. package/src/table-builder/components/column-builder/column-builder.component.spec.ts +49 -0
  64. package/src/table-builder/components/column-builder/column-builder.component.ts +129 -0
  65. package/src/table-builder/components/column-builder/column-helpers.ts +54 -0
  66. package/src/table-builder/components/column-header-menu/column-header-menu.component.html +110 -0
  67. package/src/table-builder/components/column-header-menu/column-header-menu.component.scss +97 -0
  68. package/src/table-builder/components/column-header-menu/column-header-menu.component.ts +94 -0
  69. package/src/table-builder/components/date-filter/date-filter.component.html +25 -0
  70. package/src/table-builder/components/date-filter/date-filter.component.ts +22 -0
  71. package/src/table-builder/components/date-time-filter/date-time-filter.component.html +11 -0
  72. package/src/table-builder/components/date-time-filter/date-time-filter.component.ts +20 -0
  73. package/src/table-builder/components/filter/filter.component.html +109 -0
  74. package/src/table-builder/components/filter/filter.component.scss +60 -0
  75. package/src/table-builder/components/filter/filter.component.spec.ts +86 -0
  76. package/src/table-builder/components/filter/filter.component.ts +64 -0
  77. package/src/table-builder/components/filter/in-list/in-list-filter.component.ts +102 -0
  78. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.html +60 -0
  79. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.scss +57 -0
  80. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.ts +44 -0
  81. package/src/table-builder/components/generic-table/generic-table.component.html +97 -0
  82. package/src/table-builder/components/generic-table/generic-table.component.scss +38 -0
  83. package/src/table-builder/components/generic-table/generic-table.component.ts +403 -0
  84. package/src/table-builder/components/generic-table/paginator.component.ts +112 -0
  85. package/src/table-builder/components/group-by-list/group-by-list.component.css +17 -0
  86. package/src/table-builder/components/group-by-list/group-by-list.component.html +14 -0
  87. package/src/table-builder/components/group-by-list/group-by-list.component.spec.ts +23 -0
  88. package/src/table-builder/components/group-by-list/group-by-list.component.ts +25 -0
  89. package/src/table-builder/components/in-filter/in-filter.component.css +3 -0
  90. package/src/table-builder/components/in-filter/in-filter.component.html +23 -0
  91. package/src/table-builder/components/in-filter/in-filter.component.ts +65 -0
  92. package/{table-builder/components/index.d.ts → src/table-builder/components/index.ts} +9 -9
  93. package/src/table-builder/components/initialization-component/initialization.component.html +78 -0
  94. package/src/table-builder/components/initialization-component/initialization.component.ts +27 -0
  95. package/src/table-builder/components/link-column.component.ts +42 -0
  96. package/src/table-builder/components/number-filter/number-filter.component.css +10 -0
  97. package/src/table-builder/components/number-filter/number-filter.component.html +25 -0
  98. package/src/table-builder/components/number-filter/number-filter.component.spec.ts +30 -0
  99. package/src/table-builder/components/number-filter/number-filter.component.ts +25 -0
  100. package/src/table-builder/components/profiles-menu/profiles-menu.component.html +77 -0
  101. package/src/table-builder/components/profiles-menu/profiles-menu.component.scss +126 -0
  102. package/src/table-builder/components/profiles-menu/profiles-menu.component.spec.ts +23 -0
  103. package/src/table-builder/components/profiles-menu/profiles-menu.component.ts +63 -0
  104. package/src/table-builder/components/reset-menu/reset-menu.component.css +3 -0
  105. package/src/table-builder/components/reset-menu/reset-menu.component.html +10 -0
  106. package/src/table-builder/components/reset-menu/reset-menu.component.ts +87 -0
  107. package/src/table-builder/components/scroll-strategy.ts +139 -0
  108. package/src/table-builder/components/sort-menu/sort-menu.component-store.ts +57 -0
  109. package/src/table-builder/components/sort-menu/sort-menu.component.html +115 -0
  110. package/src/table-builder/components/sort-menu/sort-menu.component.scss +119 -0
  111. package/src/table-builder/components/sort-menu/sort-menu.component.ts +88 -0
  112. package/src/table-builder/components/table-container/table-container.component.html +81 -0
  113. package/src/table-builder/components/table-container/table-container.component.ts +403 -0
  114. package/src/table-builder/components/table-container/table-container.helpers/data-state.helpers.ts +113 -0
  115. package/src/table-builder/components/table-container/table-container.helpers/filter-state.helpers.ts +125 -0
  116. package/src/table-builder/components/table-container/table-container.helpers/groupBy.helpers.ts +122 -0
  117. package/src/table-builder/components/table-container/table-container.helpers/meta-data.helpers.ts +16 -0
  118. package/src/table-builder/components/table-container/table-container.helpers/sort-state.helpers.ts +47 -0
  119. package/src/table-builder/components/table-container/table-container.scss +47 -0
  120. package/src/table-builder/components/table-container/tableProps.ts +18 -0
  121. package/src/table-builder/components/table-container/virtual-scroll-container.ts +216 -0
  122. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.html +35 -0
  123. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.ts +44 -0
  124. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.css +40 -0
  125. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.html +11 -0
  126. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.spec.ts +85 -0
  127. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.ts +36 -0
  128. package/src/table-builder/components/table-container-filter/table-wrapper-filter-store.ts +23 -0
  129. package/src/table-builder/components/table-header-menu/table-header-menu.component.css +21 -0
  130. package/src/table-builder/components/table-header-menu/table-header-menu.component.html +50 -0
  131. package/src/table-builder/components/table-header-menu/table-header-menu.component.ts +35 -0
  132. package/src/table-builder/directives/custom-cell-directive.ts +57 -0
  133. package/{table-builder/directives/index.d.ts → src/table-builder/directives/index.ts} +6 -5
  134. package/src/table-builder/directives/multi-sort.directive.spec.ts +124 -0
  135. package/src/table-builder/directives/multi-sort.directive.ts +50 -0
  136. package/src/table-builder/directives/resize-column.directive.ts +107 -0
  137. package/src/table-builder/directives/table-wrapper.directive.ts +13 -0
  138. package/src/table-builder/directives/tb-filter.directive.ts +376 -0
  139. package/src/table-builder/enums/filterTypes.ts +40 -0
  140. package/src/table-builder/functions/boolean-filter-function.ts +12 -0
  141. package/src/table-builder/functions/date-filter-function.ts +78 -0
  142. package/src/table-builder/functions/download-data.ts +11 -0
  143. package/src/table-builder/functions/null-filter-function.ts +9 -0
  144. package/src/table-builder/functions/number-filter-function.ts +41 -0
  145. package/src/table-builder/functions/sort-data-function.ts +80 -0
  146. package/src/table-builder/functions/string-filter-function.ts +53 -0
  147. package/{table-builder/interfaces/ColumnInfo.d.ts → src/table-builder/interfaces/ColumnInfo.ts} +7 -6
  148. package/{table-builder/interfaces/dictionary.d.ts → src/table-builder/interfaces/dictionary.ts} +3 -3
  149. package/src/table-builder/interfaces/report-def.ts +254 -0
  150. package/src/table-builder/ngrx/tableBuilderStateStore.ts +197 -0
  151. package/src/table-builder/pipes/column-total.pipe.ts +16 -0
  152. package/src/table-builder/pipes/format-filter-type.pipe.ts +12 -0
  153. package/src/table-builder/pipes/format-filter-value.pipe.ts +67 -0
  154. package/src/table-builder/pipes/key-display.ts +13 -0
  155. package/src/table-builder/services/export-to-csv.service.ts +113 -0
  156. package/src/table-builder/services/link-creator.service.ts +98 -0
  157. package/src/table-builder/services/table-template-service.ts +47 -0
  158. package/src/table-builder/services/transform-creator.ts +96 -0
  159. package/src/table-builder/specs/table-custom-filters.spec.ts +262 -0
  160. package/src/table-builder/styles/collapser.styles.scss +16 -0
  161. package/src/table-builder/table-builder.module.ts +38 -0
  162. package/src/test.ts +17 -0
  163. package/src/utilities/array-helpers.ts +13 -0
  164. package/src/utilities/directives/auto-focus.directive.ts +20 -0
  165. package/src/utilities/directives/clickEmitterDirective.ts +15 -0
  166. package/src/utilities/directives/clickSubject.ts +19 -0
  167. package/src/utilities/directives/conditional-classes.directive.ts +36 -0
  168. package/src/utilities/directives/dialog-service.ts +19 -0
  169. package/src/utilities/directives/dialog.ts +144 -0
  170. package/src/utilities/directives/mat-toggle-group-directive.ts +60 -0
  171. package/src/utilities/directives/prevent-enter.directive.ts +12 -0
  172. package/src/utilities/directives/stop-propagation.directive.ts +19 -0
  173. package/src/utilities/directives/styler.ts +44 -0
  174. package/src/utilities/directives/trim-whitespace.directive.ts +20 -0
  175. package/{utilities/index.d.ts → src/utilities/index.ts} +22 -15
  176. package/src/utilities/module.ts +53 -0
  177. package/src/utilities/pipes/function.pipe.ts +21 -0
  178. package/src/utilities/pipes/phone.pipe.ts +20 -0
  179. package/src/utilities/pipes/space-case.pipes.spec.ts +47 -0
  180. package/src/utilities/pipes/space-case.pipes.ts +26 -0
  181. package/tsconfig.lib.json +20 -0
  182. package/tsconfig.lib.prod.json +10 -0
  183. package/tsconfig.spec.json +17 -0
  184. package/action-state/action-state-spinner/action-state-spinner.component.d.ts +0 -12
  185. package/action-state/action-state-ui/action-state-ui.module.d.ts +0 -7
  186. package/action-state/ngrx-ext/ngrx-ext.module.d.ts +0 -8
  187. package/action-state/ngrx.d.ts +0 -31
  188. package/fesm2022/one-paragon-angular-utilities.mjs +0 -6531
  189. package/fesm2022/one-paragon-angular-utilities.mjs.map +0 -1
  190. package/http-request-state/RequestStateFactory.d.ts +0 -17
  191. package/http-request-state/RequestStateStore.d.ts +0 -101
  192. package/http-request-state/directives/HttpStateDirectiveBase.d.ts +0 -14
  193. package/http-request-state/directives/http-error-state-directive.d.ts +0 -10
  194. package/http-request-state/directives/http-inProgress-state-directive.d.ts +0 -10
  195. package/http-request-state/directives/http-notStarted-state-directive.d.ts +0 -10
  196. package/http-request-state/directives/http-success-state-directive.d.ts +0 -17
  197. package/http-request-state/directives/request-state-directive.d.ts +0 -34
  198. package/http-request-state/helpers.d.ts +0 -9
  199. package/http-request-state/http-state-module.d.ts +0 -11
  200. package/http-request-state/request-state.d.ts +0 -12
  201. package/http-request-state/rxjs/getRequestorBody.d.ts +0 -3
  202. package/http-request-state/rxjs/getRequestorState.d.ts +0 -3
  203. package/http-request-state/rxjs/tapError.d.ts +0 -3
  204. package/http-request-state/rxjs/tapSuccess.d.ts +0 -3
  205. package/http-request-state/types.d.ts +0 -41
  206. package/index.d.ts +0 -5
  207. package/ngrx/actionable-selector.d.ts +0 -32
  208. package/ngrx/index.d.ts +0 -1
  209. package/rxjs/defaultShareReplay.d.ts +0 -2
  210. package/rxjs/mapError.d.ts +0 -2
  211. package/rxjs/rxjs-operators.d.ts +0 -13
  212. package/rxjs/subjectifier.d.ts +0 -10
  213. package/rxjs/subscriber.directive.d.ts +0 -14
  214. package/table-builder/classes/DefaultSettings.d.ts +0 -9
  215. package/table-builder/classes/MatTableObservableDataSource.d.ts +0 -9
  216. package/table-builder/classes/TableBuilderConfig.d.ts +0 -23
  217. package/table-builder/classes/TableBuilderDataSource.d.ts +0 -18
  218. package/table-builder/classes/TableState.d.ts +0 -81
  219. package/table-builder/classes/data-store.d.ts +0 -8
  220. package/table-builder/classes/filter-info.d.ts +0 -39
  221. package/table-builder/classes/table-builder-general-settings.d.ts +0 -119
  222. package/table-builder/classes/table-builder.d.ts +0 -22
  223. package/table-builder/classes/table-store.d.ts +0 -146
  224. package/table-builder/classes/table-store.helpers.d.ts +0 -31
  225. package/table-builder/components/array-column.component.d.ts +0 -15
  226. package/table-builder/components/column-builder/column-builder.component.d.ts +0 -41
  227. package/table-builder/components/column-builder/column-helpers.d.ts +0 -38
  228. package/table-builder/components/column-header-menu/column-header-menu.component.d.ts +0 -50
  229. package/table-builder/components/date-filter/date-filter.component.d.ts +0 -37
  230. package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +0 -37
  231. package/table-builder/components/filter/filter.component.d.ts +0 -48
  232. package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +0 -22
  233. package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +0 -17
  234. package/table-builder/components/generic-table/generic-table.component.d.ts +0 -85
  235. package/table-builder/components/generic-table/paginator.component.d.ts +0 -26
  236. package/table-builder/components/group-by-list/group-by-list.component.d.ts +0 -11
  237. package/table-builder/components/in-filter/in-filter.component.d.ts +0 -20
  238. package/table-builder/components/initialization-component/initialization.component.d.ts +0 -15
  239. package/table-builder/components/link-column.component.d.ts +0 -23
  240. package/table-builder/components/number-filter/number-filter.component.d.ts +0 -39
  241. package/table-builder/components/profiles-menu/profiles-menu.component.d.ts +0 -33
  242. package/table-builder/components/reset-menu/reset-menu.component.d.ts +0 -25
  243. package/table-builder/components/scroll-strategy.d.ts +0 -45
  244. package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +0 -24
  245. package/table-builder/components/sort-menu/sort-menu.component.d.ts +0 -19
  246. package/table-builder/components/table-container/table-container.component.d.ts +0 -104
  247. package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +0 -7
  248. package/table-builder/components/table-container/table-container.helpers/filter-state.helpers.d.ts +0 -19
  249. package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +0 -19
  250. package/table-builder/components/table-container/table-container.helpers/meta-data.helpers.d.ts +0 -2
  251. package/table-builder/components/table-container/table-container.helpers/sort-state.helpers.d.ts +0 -12
  252. package/table-builder/components/table-container/tableProps.d.ts +0 -10
  253. package/table-builder/components/table-container/virtual-scroll-container.d.ts +0 -40
  254. package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +0 -15
  255. package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +0 -12
  256. package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +0 -14
  257. package/table-builder/components/table-header-menu/table-header-menu.component.d.ts +0 -15
  258. package/table-builder/directives/custom-cell-directive.d.ts +0 -34
  259. package/table-builder/directives/multi-sort.directive.d.ts +0 -10
  260. package/table-builder/directives/resize-column.directive.d.ts +0 -43
  261. package/table-builder/directives/table-wrapper.directive.d.ts +0 -8
  262. package/table-builder/directives/tb-filter.directive.d.ts +0 -116
  263. package/table-builder/enums/filterTypes.d.ts +0 -36
  264. package/table-builder/functions/boolean-filter-function.d.ts +0 -3
  265. package/table-builder/functions/date-filter-function.d.ts +0 -4
  266. package/table-builder/functions/download-data.d.ts +0 -1
  267. package/table-builder/functions/null-filter-function.d.ts +0 -2
  268. package/table-builder/functions/number-filter-function.d.ts +0 -4
  269. package/table-builder/functions/sort-data-function.d.ts +0 -6
  270. package/table-builder/functions/string-filter-function.d.ts +0 -5
  271. package/table-builder/interfaces/report-def.d.ts +0 -223
  272. package/table-builder/ngrx/tableBuilderStateStore.d.ts +0 -69
  273. package/table-builder/pipes/column-total.pipe.d.ts +0 -8
  274. package/table-builder/pipes/format-filter-type.pipe.d.ts +0 -8
  275. package/table-builder/pipes/format-filter-value.pipe.d.ts +0 -11
  276. package/table-builder/pipes/key-display.d.ts +0 -9
  277. package/table-builder/services/export-to-csv.service.d.ts +0 -14
  278. package/table-builder/services/link-creator.service.d.ts +0 -16
  279. package/table-builder/services/table-template-service.d.ts +0 -14
  280. package/table-builder/services/transform-creator.d.ts +0 -9
  281. package/table-builder/table-builder.module.d.ts +0 -14
  282. package/utilities/array-helpers.d.ts +0 -1
  283. package/utilities/directives/auto-focus.directive.d.ts +0 -9
  284. package/utilities/directives/clickEmitterDirective.d.ts +0 -7
  285. package/utilities/directives/clickSubject.d.ts +0 -9
  286. package/utilities/directives/conditional-classes.directive.d.ts +0 -12
  287. package/utilities/directives/dialog-service.d.ts +0 -10
  288. package/utilities/directives/dialog.d.ts +0 -45
  289. package/utilities/directives/mat-toggle-group-directive.d.ts +0 -21
  290. package/utilities/directives/prevent-enter.directive.d.ts +0 -6
  291. package/utilities/directives/stop-propagation.directive.d.ts +0 -7
  292. package/utilities/directives/styler.d.ts +0 -16
  293. package/utilities/directives/trim-whitespace.directive.d.ts +0 -7
  294. package/utilities/module.d.ts +0 -19
  295. package/utilities/pipes/function.pipe.d.ts +0 -11
  296. package/utilities/pipes/phone.pipe.d.ts +0 -8
  297. package/utilities/pipes/space-case.pipes.d.ts +0 -17
@@ -0,0 +1,65 @@
1
+ import { ChangeDetectionStrategy, Component, ChangeDetectorRef, inject, input } from '@angular/core';
2
+ import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import { FieldType } from '../../interfaces/report-def';
4
+ import { AutoFocusDirective } from '../../../utilities';
5
+
6
+ @Component({
7
+ selector: 'lib-in-filter',
8
+ templateUrl: './in-filter.component.html',
9
+ styleUrls: ['./in-filter.component.css'],
10
+ changeDetection: ChangeDetectionStrategy.OnPush,
11
+ providers: [{
12
+ provide: NG_VALUE_ACCESSOR,
13
+ useExisting: InFilterComponent,
14
+ multi: true
15
+ }],
16
+ imports: [
17
+ FormsModule, AutoFocusDirective
18
+ ]
19
+ })
20
+ export class InFilterComponent implements ControlValueAccessor {
21
+ private ref = inject(ChangeDetectorRef);
22
+
23
+ FieldType = FieldType;
24
+ $type = input.required<FieldType>({ alias: 'type' })
25
+ value: (string | number | undefined)[] = [undefined];
26
+
27
+ constructor() {
28
+ this.value = [undefined];
29
+ }
30
+ writeValue(obj: any[]): void {
31
+ if(!obj?.length) obj = [undefined];
32
+ this.value = obj;
33
+ this.ref.markForCheck();
34
+ }
35
+ onChange = (_: any) => { };
36
+
37
+ registerOnChange(fn: any): void {
38
+ this.onChange = fn;
39
+ }
40
+ onTouched = () => { };
41
+ registerOnTouched(fn: any): void {
42
+ this.onTouched = fn;
43
+ }
44
+
45
+ addInput(){
46
+ this.value = [...this.value, undefined];
47
+ this.ref.markForCheck();
48
+ this.onChange(this.value);
49
+ }
50
+
51
+ removeInput(index: number){
52
+ this.value = [...this.value];
53
+ this.value.splice(index, 1);
54
+ this.ref.markForCheck();
55
+ this.onChange(this.value);
56
+ }
57
+
58
+ onValueChange(i:number, value: number | string){
59
+ this.value = [...this.value];
60
+ this.value[i] = value;
61
+ this.ref.markForCheck();
62
+ this.onChange(this.value);
63
+ }
64
+
65
+ }
@@ -1,9 +1,9 @@
1
- export * from './date-filter/date-filter.component';
2
- export * from './filter/filter.component';
3
- export * from './gen-col-displayer/gen-col-displayer.component';
4
- export * from './table-container-filter/gen-filter-displayer/gen-filter-displayer.component';
5
- export * from './table-container-filter/filter-list/filter-list.component';
6
- export * from './generic-table/generic-table.component';
7
- export * from './table-container/table-container.component';
8
- export * from './generic-table/paginator.component';
9
- export * from './group-by-list/group-by-list.component';
1
+ export * from './date-filter/date-filter.component';
2
+ export * from './filter/filter.component';
3
+ export * from './gen-col-displayer/gen-col-displayer.component';
4
+ export * from './table-container-filter/gen-filter-displayer/gen-filter-displayer.component';
5
+ export * from './table-container-filter/filter-list/filter-list.component';
6
+ export * from './generic-table/generic-table.component';
7
+ export * from './table-container/table-container.component';
8
+ export * from './generic-table/paginator.component';
9
+ export * from './group-by-list/group-by-list.component';
@@ -0,0 +1,78 @@
1
+ <ng-template #link let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
2
+ @let link = additional.link | func : element;
3
+ @if(link)
4
+ {
5
+ <tb-link-column [element]="element" [additional]="additional" [link]="$any(link)">
6
+ <span [styler]="styles" [element]="element">{{value}}</span>
7
+ </tb-link-column>
8
+ }
9
+ @else
10
+ {
11
+ <span [styler]="styles" [element]="element">{{value}}</span>
12
+ }
13
+ </ng-template>
14
+
15
+ <ng-template #routerLink let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
16
+ @let link = additional.link | func : element;
17
+ @if(link)
18
+ {
19
+ <tb-router-link-column [element]="element" [additional]="additional" [link]="$any(link)">
20
+ <span [styler]="styles" [element]="element">{{value}}</span>
21
+ </tb-router-link-column>
22
+ }
23
+ @else
24
+ {
25
+ <span [styler]="styles" [element]="element">{{value}}</span>
26
+ }
27
+
28
+ </ng-template>
29
+
30
+ <ng-template #linkWithIcon let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
31
+ @let link = additional.link | func : element;
32
+ @if(link)
33
+ {
34
+ <tb-link-column [element]="element" [additional]="additional" [link]="$any(link)">
35
+ <mat-icon [styler]="styles" [element]="element">{{ value}}</mat-icon>
36
+ </tb-link-column>
37
+ }
38
+ @else
39
+ {
40
+ <span [styler]="styles" [element]="element">{{value}}</span>
41
+ }
42
+ </ng-template>
43
+
44
+ <ng-template #routerLinkWithIcon let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
45
+ @let link = additional.link | func : element;
46
+ @if(link)
47
+ {
48
+ <tb-link-column [element]="element" [additional]="additional" [link]="$any(link)">
49
+ <mat-icon [styler]="styles" [element]="element">{{ value}}</mat-icon>
50
+ </tb-link-column>
51
+ }
52
+ @else
53
+ {
54
+ <mat-icon [styler]="styles" [element]="element">{{ value}}</mat-icon>
55
+ }
56
+ </ng-template>
57
+
58
+ <ng-template #imageUrl let-value='value'>
59
+ <span>
60
+ <img height="75px" width="75px" [src]="value" />
61
+ </span>
62
+ </ng-template>
63
+
64
+ <ng-template #arrayNewLine let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
65
+ <tb-new-line-array-column [value]='value' [additional]='additional' [styler]="styles" [element]="element"/>
66
+ </ng-template>
67
+
68
+ <ng-template #arrayComma let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
69
+ <tb-comma-array-column [value]='value' [additional]='additional' [styler]="styles" [element]="element"/>
70
+ </ng-template>
71
+
72
+ <ng-template #default let-value='value' let-element='element' let-styles="innerStyles">
73
+ <span [styler]="styles" [element]="element">{{value}}</span>
74
+ </ng-template>
75
+
76
+ <ng-template #defaultWithIcon let-value='value' let-element='element' let-styles="innerStyles">
77
+ <mat-icon [styler]="styles" [element]="element">{{value}}</mat-icon>
78
+ </ng-template>
@@ -0,0 +1,27 @@
1
+ import { Component, TemplateRef, viewChild } from "@angular/core";
2
+ import { LinkColumnComponent, RouterLinkColumnComponent } from "../link-column.component";
3
+ import { ArrayCommaColumnComponent, ArrayNewLineColumnComponent } from "../array-column.component";
4
+ import { MatIcon } from "@angular/material/icon";
5
+ import { StylerDirective } from "../../../utilities/directives/styler";
6
+ import { FunctionPipe } from "../../../utilities";
7
+
8
+ @Component({
9
+ selector: 'initialization',
10
+ templateUrl: './initialization.component.html',
11
+ imports: [
12
+ LinkColumnComponent, ArrayCommaColumnComponent, MatIcon,
13
+ RouterLinkColumnComponent, ArrayNewLineColumnComponent,
14
+ StylerDirective, FunctionPipe
15
+ ]
16
+ })
17
+ export class InitializationComponent {
18
+ $linkTemplate = viewChild.required<TemplateRef<any>>('link');
19
+ $routerLinkTemplate = viewChild.required<TemplateRef<any>>('routerLink');
20
+ $linkWithIconTemplate = viewChild.required<TemplateRef<any>>('linkWithIcon');
21
+ $routerLinkWithIconTemplate = viewChild.required<TemplateRef<any>>('routerLinkWithIcon');
22
+ $imageUrlTemplate = viewChild.required<TemplateRef<any>>('imageUrl');
23
+ $arrayNewLineTemplate = viewChild.required<TemplateRef<any>>('arrayNewLine');
24
+ $arrayCommaTemplate = viewChild.required<TemplateRef<any>>('arrayComma');
25
+ $defaultTemplate = viewChild.required<TemplateRef<any>>('default');
26
+ $defaultWithIcon = viewChild.required<TemplateRef<any>>('defaultWithIcon');
27
+ }
@@ -0,0 +1,42 @@
1
+ import { ChangeDetectionStrategy, Component, computed, input } from "@angular/core";
2
+ import { RouterModule } from "@angular/router";
3
+ import { LinkInfo } from "../services/link-creator.service";
4
+
5
+ @Component({
6
+ selector: "tb-router-link-column",
7
+ changeDetection: ChangeDetectionStrategy.OnPush,
8
+ imports: [
9
+ RouterModule
10
+ ],
11
+ template: `
12
+ <a target="{{additional().target}}"
13
+ [routerLink]=" [link()]"
14
+ [queryParams]="queryParams()"
15
+ [fragment]="routerLinkOptions().fragment"
16
+ [preserveFragment]="routerLinkOptions().preserveFragment"
17
+ [queryParamsHandling]="routerLinkOptions().queryParamsHandling"
18
+ >
19
+ <ng-content></ng-content>
20
+ </a>
21
+ `
22
+ }) export class RouterLinkColumnComponent {
23
+ additional = input.required<LinkInfo>();
24
+ element = input.required<any>();
25
+ queryParams = computed(() => this.additional().routerLinkOptions!.queryParams(this.element()));
26
+ routerLinkOptions = computed(() => this.additional().routerLinkOptions!);
27
+ link = input.required<string>();
28
+ }
29
+
30
+ @Component({
31
+ selector: "tb-link-column",
32
+ changeDetection: ChangeDetectionStrategy.OnPush,
33
+ template: `
34
+ <a target="{{additional().target}}" href="{{link()}}">
35
+ <ng-content></ng-content>
36
+ </a>
37
+ `
38
+ }) export class LinkColumnComponent {
39
+ element = input.required<any>();
40
+ additional = input.required<LinkInfo>();
41
+ link = input.required<string>();
42
+ }
@@ -0,0 +1,10 @@
1
+ .switch {
2
+ display: inline-block;
3
+ }
4
+
5
+ .my-filter {
6
+ margin-right: 15px;
7
+ }
8
+ .inline{
9
+ display: inline-block;
10
+ }
@@ -0,0 +1,25 @@
1
+ @let CurrentFilterType = $currentFilterType();
2
+ @let info = $info();
3
+
4
+ @if(CurrentFilterType !== FilterType.NumberBetween && CurrentFilterType !== FilterType.IsNull && CurrentFilterType !== FilterType.In)
5
+ {
6
+ <mat-form-field class="my-filter">
7
+ <input matInput name="filterValue" type="number" [ngModel]="info.filterValue"/>
8
+ </mat-form-field>
9
+ }
10
+ @if(CurrentFilterType === FilterType.NumberBetween)
11
+ {
12
+ <ng-container ngModelGroup="filterValue" >
13
+ <mat-form-field class="my-filter">
14
+ <input matInput name="Start" placeholder="Start" type="number" [ngModel]="info.filterValue?.Start"/>
15
+ </mat-form-field>
16
+ <mat-form-field class="my-filter">
17
+ <input matInput name="End" placeholder="End" type="number" [ngModel]="info.filterValue?.End"/>
18
+ </mat-form-field>
19
+ </ng-container>
20
+ }
21
+
22
+ @if (CurrentFilterType === FilterType.In)
23
+ {
24
+ <lib-in-filter name='filterValue' [type]="FieldType.Number" [(ngModel)]='info.filterValue' />
25
+ }
@@ -0,0 +1,30 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { FieldType } from 'projects/angular-utilities/src/public-api';
3
+
4
+ import { NumberFilterComponent } from './number-filter.component';
5
+
6
+ describe('NumberFilterComponent', () => {
7
+ let component: NumberFilterComponent;
8
+ let fixture: ComponentFixture<NumberFilterComponent>;
9
+
10
+ beforeEach(waitForAsync(() => {
11
+ TestBed.configureTestingModule({
12
+ declarations: [NumberFilterComponent]
13
+ })
14
+ .compileComponents();
15
+ }));
16
+
17
+ beforeEach(() => {
18
+ fixture = TestBed.createComponent(NumberFilterComponent);
19
+ component = fixture.componentInstance;
20
+ component.info = {
21
+ key: '',
22
+ fieldType: FieldType.Unknown
23
+ };
24
+ fixture.detectChanges();
25
+ });
26
+
27
+ it('should create', () => {
28
+ expect(component).toBeTruthy();
29
+ });
30
+ });
@@ -0,0 +1,25 @@
1
+ import { Component, ChangeDetectionStrategy, input } from '@angular/core';
2
+ import { FilterType } from '../../enums/filterTypes';
3
+ import { ControlContainer, FormsModule, NgForm } from '@angular/forms';
4
+ import { PartialFilter } from '../../classes/filter-info';
5
+ import { FieldType } from '../../interfaces/report-def';
6
+ import { MatInputModule } from '@angular/material/input';
7
+ import { InFilterComponent } from '../in-filter/in-filter.component';
8
+
9
+
10
+ @Component({
11
+ selector: 'tb-number-filter',
12
+ templateUrl: './number-filter.component.html',
13
+ styleUrls: ['./number-filter.component.css'],
14
+ changeDetection: ChangeDetectionStrategy.OnPush,
15
+ viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
16
+ imports: [
17
+ MatInputModule, FormsModule, InFilterComponent
18
+ ]
19
+ })
20
+ export class NumberFilterComponent {
21
+ FilterType = FilterType;
22
+ FieldType = FieldType;
23
+ $currentFilterType = input.required<FilterType>({ alias: 'CurrentFilterType' });
24
+ $info = input.required<PartialFilter>({ alias: 'info' })
25
+ }
@@ -0,0 +1,77 @@
1
+ @if(!$isMatMenuChild())
2
+ {
3
+ <button #trigger="matMenuTrigger" color="primary" mat-icon-button [matMenuTriggerFor]="menu" [matTooltip]="'Profiles'">
4
+ <mat-icon color="primary">people</mat-icon>
5
+ </button>
6
+ }
7
+ <mat-menu #menu="matMenu" (closed)="addedKey.value = null; allProfilesPanelOpened.set(false); newProfilePanelOpened.set(false)">
8
+ @if(!!$currentProfile())
9
+ {
10
+ <div mat-menu-item mat-stroked-button [matTooltip]="'Save Profile'" (click)="saveState($currentProfile()!)">
11
+ <mat-icon color="primary">save</mat-icon>
12
+ <span>{{$currentProfile()}}</span>
13
+ </div>
14
+ }
15
+ @else
16
+ {
17
+ <div class="profile-line">
18
+ <button color="primary" class="first-in-line first-button" mat-stroked-button (click)="addState(defaultName, m.checked);">
19
+ <mat-icon class="save-for-default-icon button-save-icon" color="primary">save</mat-icon>
20
+ <span>Save as <span class="current-name">{{defaultName}}</span> </span>
21
+ </button>
22
+ <button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Created As Default'" (click)="m.toggle()" >
23
+ <mat-icon style="color: green;">{{m.checked ? 'star' : 'star_border'}}</mat-icon>
24
+ </button>
25
+ <mat-checkbox #m class="display-none" [checked]="true" />
26
+ </div>
27
+ }
28
+ @if (allProfilesPanelOpened()) {<hr class="divider"/>}
29
+ <div mat-menu-item stop-propagation [class]="{ hide: !$keys().length, 'all-profile-row': true }" (click)="allProfilesPanelOpened.set(!allProfilesPanelOpened())">
30
+ <div class="all-profiles">
31
+ <span>All Profiles</span>
32
+ <span class="arrow" [class]="`${(allProfilesPanelOpened() ? 'all-profile-arrow-close' : 'all-profile-arrow-open')} all-profile-arrow`"></span>
33
+ </div>
34
+ </div>
35
+ <div [class]="{ hide: !allProfilesPanelOpened(), panel: true }">
36
+ @for (key of $keys() ; track key)
37
+ {
38
+ <div class="profile-line" [class]="key === $currentProfile() ? 'current-in-list' : 'not-current-in-list'">
39
+ <button class="menu-item first-in-line" mat-stroked-button [matTooltip]="'Select Profile'" (click)='stateService.setLocalCurrentState({ tableId: $tableId(), currentStateKey: key})'>
40
+ <span>{{key}}</span>
41
+ </button>
42
+ @if(key !== $defaultProfile())
43
+ {
44
+ <button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Default'" (click)="setDefault(key)">
45
+ <mat-icon style="color: green;">star_border</mat-icon>
46
+ </button>
47
+ }
48
+ @else
49
+ {
50
+ <button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Default'" (click)="unsetDefault()">
51
+ <mat-icon style="color: green;">star</mat-icon>
52
+ </button>
53
+ }
54
+ <button color="warn" class="last-in-line" stop-propagation mat-icon-button [matTooltip]="'Delete Profile'" (click)='stateService.deleteProfileFromLocalAndStorage($tableId(), key)'>
55
+ <mat-icon color='warn'>delete_forever</mat-icon>
56
+ </button>
57
+ </div>
58
+ }
59
+ <hr class="divider"/>
60
+ </div>
61
+ <div class="add-new-profile-row" mat-menu-item stop-propagation (click)="newProfilePanelOpened.set(!newProfilePanelOpened()); addedKey.focus()">Add New Profile</div>
62
+ <div [class]="{ hide: !newProfilePanelOpened(), panel: true }" >
63
+ <div class="profile-line" stop-propagation>
64
+ <div class="new-name-input">
65
+ <i class="input-hint">Enter New Name</i>
66
+ <input #addedKey="matInput" matInput [name]="'key'" />
67
+ </div>
68
+ <button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Created As Default'" (click)="m2.toggle()" >
69
+ <mat-icon style="color: green;">{{m2.checked ? 'star' : 'star_border'}}</mat-icon>
70
+ </button>
71
+ <mat-checkbox #m2 class="display-none" [ngModel]="!$defaultProfile()" />
72
+ </div>
73
+ <button class="add-button" color="primary" mat-raised-button [matTooltip]="'Create New Profile'" [disabled]="!addedKey.value" (click)="addState(addedKey.value, m2.checked); addedKey.value = null">
74
+ Add
75
+ </button>
76
+ </div>
77
+ </mat-menu>
@@ -0,0 +1,126 @@
1
+
2
+ :host ::ng-deep .mat-expansion-panel-header{
3
+ padding: 0;
4
+ }
5
+ .current-name{
6
+ color: var(tb-current-profile, blue);
7
+ }
8
+ .menu-item{
9
+ display: inline-flex;
10
+ width: initial;
11
+ flex-grow: 1;
12
+ }
13
+ .profile-line{
14
+ display: flex;
15
+ justify-content: space-between;
16
+ align-items: center;
17
+ }
18
+ .first-in-line{
19
+ --f-b: 2rem;
20
+ margin-left: var(--mat-menu-item-with-icon-leading-spacing);
21
+ &.first-button{
22
+ height: var(--f-b);
23
+ margin: .2rem;
24
+ }
25
+ .button-save-icon{
26
+ height: var(--f-b);
27
+ width: var(--f-b);
28
+ font-size: var(--f-b);
29
+ }
30
+ }
31
+ .main-save-button{
32
+ height: 4rem;
33
+ width: 4rem;
34
+ padding: .5rem;
35
+ mat-icon{
36
+ height: 3rem;
37
+ width: 3rem;
38
+ font-size: 3rem;
39
+ }
40
+ }
41
+ .save-for-default-icon{
42
+ margin: 0;
43
+ }
44
+ .display-none{
45
+ display: none;
46
+ }
47
+ .last-in-line{
48
+ padding-right: var(--mat-menu-item-with-icon-trailing-spacing);
49
+ }
50
+ .default-cursor{
51
+ cursor: default;
52
+ }
53
+ .as-def{
54
+ padding-left: var(--mat-menu-item-with-icon-leading-spacing);
55
+ }
56
+ .divider{
57
+ margin: .2px 0;
58
+ }
59
+ .add-key{
60
+ max-width: 8.5rem;
61
+ margin-left: 2px;
62
+ ::ng-deep{
63
+ .mdc-text-field{
64
+ padding: 0;
65
+ }
66
+ }
67
+ }
68
+ .panel{
69
+ transition: height .1s
70
+ }
71
+ .hide{
72
+ height: 0;
73
+ min-height: 0;
74
+ overflow: hidden;
75
+ }
76
+ .open-panel-button{
77
+ width: 100%;
78
+ height: 2.5rem;
79
+ }
80
+ .current-in-list{
81
+ border-left: 3px solid blue;
82
+ background-color: #0000ff0d;
83
+ }
84
+ .not-current-in-list{
85
+ border-left: 3px solid rgba(255, 255, 255, 0);
86
+ }
87
+ .add-new-profile-row, .all-profile-row{
88
+ border-top: rgb(128 128 128 / 25%) solid 1px;
89
+ }
90
+ .all-profiles{
91
+ display: flex;
92
+ justify-content: space-between;
93
+ &:has(.all-profile-arrow-close){
94
+ align-items: center;
95
+ }
96
+ }
97
+ .all-profile-arrow{
98
+ display: inline-block;
99
+ height: .7rem;
100
+ width: .7rem;
101
+ border-color: black;
102
+ transform: rotate(-45deg);
103
+ &-open{
104
+ border-left: solid 2px;
105
+ border-bottom: solid 2px;
106
+ }
107
+ &-close{
108
+ border-right: solid 2px;
109
+ border-top: solid 2px;
110
+ }
111
+ }
112
+ .new-name-input{
113
+ margin-left: 3px;
114
+ display: flex;
115
+ flex-direction: column;
116
+ .input-hint{
117
+ font-size: smaller;
118
+ font-weight: 200;
119
+ color: gray;
120
+ }
121
+ }
122
+ .add-button{
123
+ height: 20px;
124
+ line-height: 20px;
125
+ margin: 3px 0 0 3px;
126
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ProfilesMenuComponent } from './profiles-menu.component';
4
+
5
+ describe('ProfilesMenuComponent', () => {
6
+ let component: ProfilesMenuComponent;
7
+ let fixture: ComponentFixture<ProfilesMenuComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [ProfilesMenuComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ProfilesMenuComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,63 @@
1
+ import { Component, computed, inject, input, output, signal, viewChild } from '@angular/core';
2
+ import { TableBuilderStateStore } from '../../ngrx/tableBuilderStateStore';
3
+ import { MatMenu, MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
4
+ import { MatIcon } from '@angular/material/icon';
5
+ import { TableStore } from '../../classes/table-store';
6
+ import { MatTooltip } from '@angular/material/tooltip';
7
+ import { MatButton, MatIconButton } from '@angular/material/button';
8
+ import { StopPropagationDirective } from '../../../utilities';
9
+ import { MatInput, MatInputModule } from '@angular/material/input';
10
+ import { MatCheckbox } from '@angular/material/checkbox';
11
+ import { Subject } from 'rxjs';
12
+ import { FormsModule } from '@angular/forms';
13
+
14
+ @Component({
15
+ selector: 'tb-profiles-menu',
16
+ imports: [MatIcon, MatTooltip, MatIconButton, MatMenuModule, MatButton, MatInput,
17
+ MatCheckbox, StopPropagationDirective, MatInputModule, FormsModule
18
+ ],
19
+ templateUrl: './profiles-menu.component.html',
20
+ styleUrl: './profiles-menu.component.scss'
21
+ })
22
+ export class ProfilesMenuComponent {
23
+ stateService = inject(TableBuilderStateStore);
24
+ tableStore = inject(TableStore);
25
+ $tableId = input.required<string>({ alias: 'tableId' });
26
+ $isMatMenuChild = input<boolean>(false, { alias: 'isMatMenuChild' });
27
+ trigger = viewChild<MatMenuTrigger>('trigger');
28
+ menu = viewChild.required(MatMenu)
29
+ allProfilesPanelOpened = signal(false);
30
+ newProfilePanelOpened = signal(false);
31
+ $currentProfile = computed(() => this.stateService.$selectLocalProfileCurrentKey(this.$tableId())());
32
+ $defaultProfile = computed(() => this.stateService.$selectLocalProfileDefaultKey(this.$tableId())());
33
+ $keys = computed(() => this.stateService.$selectLocalProfileKeys(this.$tableId())());
34
+ saveState(key: string) {
35
+ const tableState = this.tableStore.$savableState();
36
+ this.stateService.saveTableSettingsToLocalAndStorage(this.$tableId(), key, tableState);
37
+ }
38
+
39
+ addState(key: string, asDefault: boolean){
40
+ const tableState = this.tableStore.$savableState();
41
+ this.stateService.addNewStateToLocalAndStorage(this.$tableId(), key, tableState, asDefault);
42
+ }
43
+
44
+ setDefault(key: string){
45
+ this.stateService.setDefaultInLocalAndStorage(this.$tableId(), key);
46
+ }
47
+
48
+ unsetDefault(){
49
+ this.stateService.unsetDefaultFromLocalAndStorage(this.$tableId());
50
+ }
51
+
52
+ defaultName = 'My Profile';
53
+ position$ = new Subject<{ top: string, right: string} | undefined>();
54
+ setPosition = (e: HTMLElement) => {
55
+ const rect = e.getBoundingClientRect();
56
+ if(rect.top === 0) return;
57
+ const a = {
58
+ right: `${(window.innerWidth - rect.right)}px`,
59
+ top: `${rect.top}px`,
60
+ }
61
+ return a;
62
+ }
63
+ }
@@ -0,0 +1,3 @@
1
+ :host{
2
+ display: contents;
3
+ }
@@ -0,0 +1,10 @@
1
+ <mat-menu #menu2="matMenu">
2
+ @if($set().length > 1)
3
+ {
4
+ <button mat-menu-item (click)="state.resetState()">All</button>
5
+ }
6
+ @for (item of $set(); track $index)
7
+ {
8
+ <button mat-menu-item (click)="state.resetPart(item)">Reset {{item}}</button>
9
+ }
10
+ </mat-menu>