@angular-generic-table/core 5.0.0-alpha.1 → 5.0.0-rc.10

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 (260) hide show
  1. package/README.md +13 -134
  2. package/angular-generic-table-core.d.ts +2 -19
  3. package/esm2020/angular-generic-table-core.mjs +5 -0
  4. package/esm2020/lib/core.component.mjs +122 -0
  5. package/esm2020/lib/core.module.mjs +23 -0
  6. package/esm2020/lib/core.service.mjs +14 -0
  7. package/esm2020/lib/enums/order.enum.mjs +6 -0
  8. package/esm2020/lib/models/table-column.interface.mjs +2 -0
  9. package/esm2020/lib/models/table-config.interface.mjs +2 -0
  10. package/esm2020/lib/models/table-info.interface.mjs +2 -0
  11. package/esm2020/lib/models/table-meta.interface.mjs +2 -0
  12. package/esm2020/lib/models/table-row.interface.mjs +2 -0
  13. package/esm2020/lib/models/table-sort.interface.mjs +2 -0
  14. package/esm2020/lib/pagination/pagination.component.mjs +63 -0
  15. package/esm2020/lib/pagination/pagination.module.mjs +18 -0
  16. package/esm2020/lib/pipes/capital-case.pipe.mjs +17 -0
  17. package/esm2020/lib/pipes/dash-case.pipe.mjs +17 -0
  18. package/esm2020/lib/pipes/dynamic.pipe.mjs +25 -0
  19. package/esm2020/lib/pipes/highlight.pipe.mjs +48 -0
  20. package/esm2020/lib/pipes/sort-class.pipe.mjs +16 -0
  21. package/esm2020/lib/utilities/utilities.mjs +39 -0
  22. package/esm2020/public-api.mjs +15 -0
  23. package/fesm2015/angular-generic-table-core.mjs +384 -0
  24. package/fesm2015/angular-generic-table-core.mjs.map +1 -0
  25. package/fesm2020/angular-generic-table-core.mjs +381 -0
  26. package/fesm2020/angular-generic-table-core.mjs.map +1 -0
  27. package/lib/core.component.d.ts +33 -0
  28. package/lib/core.module.d.ts +12 -1
  29. package/lib/core.service.d.ts +6 -0
  30. package/lib/enums/order.enum.d.ts +4 -0
  31. package/lib/models/table-column.interface.d.ts +15 -0
  32. package/lib/models/table-config.interface.d.ts +15 -0
  33. package/lib/models/table-info.interface.d.ts +4 -0
  34. package/lib/models/table-meta.interface.d.ts +8 -0
  35. package/lib/models/table-row.interface.d.ts +4 -0
  36. package/lib/models/table-sort.interface.d.ts +5 -0
  37. package/lib/pagination/pagination.component.d.ts +14 -0
  38. package/lib/pagination/pagination.module.d.ts +8 -0
  39. package/lib/pipes/capital-case.pipe.d.ts +7 -0
  40. package/lib/pipes/dash-case.pipe.d.ts +4 -1
  41. package/lib/pipes/dynamic.pipe.d.ts +9 -0
  42. package/lib/pipes/highlight.pipe.d.ts +7 -0
  43. package/lib/pipes/sort-class.pipe.d.ts +11 -0
  44. package/lib/utilities/utilities.d.ts +6 -0
  45. package/package.json +26 -24
  46. package/public-api.d.ts +11 -0
  47. package/scss/index.scss +102 -0
  48. package/CHANGELOG.md +0 -461
  49. package/LICENSE.md +0 -201
  50. package/angular-generic-table-core.metadata.json +0 -1
  51. package/bundles/angular-generic-table-core.umd.js +0 -3675
  52. package/bundles/angular-generic-table-core.umd.js.map +0 -1
  53. package/bundles/angular-generic-table-core.umd.min.js +0 -2
  54. package/bundles/angular-generic-table-core.umd.min.js.map +0 -1
  55. package/css/generic-table.css +0 -168
  56. package/css/generic-table.css.map +0 -9
  57. package/css/generic-table.min.css +0 -2
  58. package/css/generic-table.min.css.map +0 -1
  59. package/esm2015/angular-generic-table-core.js +0 -28
  60. package/esm2015/angular-generic-table-core.metadata.json +0 -1
  61. package/esm2015/lib/components/generic-table/generic-table.component.js +0 -1738
  62. package/esm2015/lib/components/generic-table/generic-table.component.metadata.json +0 -1
  63. package/esm2015/lib/components/gt-checkbox/gt-checkbox.component.js +0 -88
  64. package/esm2015/lib/components/gt-checkbox/gt-checkbox.component.metadata.json +0 -1
  65. package/esm2015/lib/components/gt-custom-component-factory/gt-custom-component-factory.component.js +0 -112
  66. package/esm2015/lib/components/gt-custom-component-factory/gt-custom-component-factory.component.metadata.json +0 -1
  67. package/esm2015/lib/components/gt-drilldown/gt-drilldown.component.js +0 -53
  68. package/esm2015/lib/components/gt-drilldown/gt-drilldown.component.metadata.json +0 -1
  69. package/esm2015/lib/components/gt-dropdown/gt-dropdown.component.js +0 -176
  70. package/esm2015/lib/components/gt-dropdown/gt-dropdown.component.metadata.json +0 -1
  71. package/esm2015/lib/components/gt-expanding-row/gt-expanding-row.component.js +0 -147
  72. package/esm2015/lib/components/gt-expanding-row/gt-expanding-row.component.metadata.json +0 -1
  73. package/esm2015/lib/components/gt-pagination/gt-pagination.component.js +0 -141
  74. package/esm2015/lib/components/gt-pagination/gt-pagination.component.metadata.json +0 -1
  75. package/esm2015/lib/components/gt-table-info/gt-table-info.component.js +0 -103
  76. package/esm2015/lib/components/gt-table-info/gt-table-info.component.metadata.json +0 -1
  77. package/esm2015/lib/core.module.js +0 -96
  78. package/esm2015/lib/core.module.metadata.json +0 -1
  79. package/esm2015/lib/directives/component-anchor.directive.js +0 -65
  80. package/esm2015/lib/directives/component-anchor.directive.metadata.json +0 -1
  81. package/esm2015/lib/directives/gt-column-width.directive.js +0 -73
  82. package/esm2015/lib/directives/gt-column-width.directive.metadata.json +0 -1
  83. package/esm2015/lib/interfaces/gt-config-field.js +0 -96
  84. package/esm2015/lib/interfaces/gt-config-field.metadata.json +0 -1
  85. package/esm2015/lib/interfaces/gt-config-setting.js +0 -41
  86. package/esm2015/lib/interfaces/gt-config-setting.metadata.json +0 -1
  87. package/esm2015/lib/interfaces/gt-config-total.js +0 -20
  88. package/esm2015/lib/interfaces/gt-config-total.metadata.json +0 -1
  89. package/esm2015/lib/interfaces/gt-config.js +0 -24
  90. package/esm2015/lib/interfaces/gt-config.metadata.json +0 -1
  91. package/esm2015/lib/interfaces/gt-event.js +0 -16
  92. package/esm2015/lib/interfaces/gt-event.metadata.json +0 -1
  93. package/esm2015/lib/interfaces/gt-information.js +0 -38
  94. package/esm2015/lib/interfaces/gt-information.metadata.json +0 -1
  95. package/esm2015/lib/interfaces/gt-options.js +0 -55
  96. package/esm2015/lib/interfaces/gt-options.metadata.json +0 -1
  97. package/esm2015/lib/interfaces/gt-render-field.js +0 -29
  98. package/esm2015/lib/interfaces/gt-render-field.metadata.json +0 -1
  99. package/esm2015/lib/interfaces/gt-row-meta.js +0 -18
  100. package/esm2015/lib/interfaces/gt-row-meta.metadata.json +0 -1
  101. package/esm2015/lib/interfaces/gt-row.js +0 -20
  102. package/esm2015/lib/interfaces/gt-row.metadata.json +0 -1
  103. package/esm2015/lib/interfaces/gt-texts.js +0 -36
  104. package/esm2015/lib/interfaces/gt-texts.metadata.json +0 -1
  105. package/esm2015/lib/pipes/dash-case.pipe.js +0 -30
  106. package/esm2015/lib/pipes/dash-case.pipe.metadata.json +0 -1
  107. package/esm2015/lib/pipes/gt-chunk.pipe.js +0 -52
  108. package/esm2015/lib/pipes/gt-chunk.pipe.metadata.json +0 -1
  109. package/esm2015/lib/pipes/gt-column-class.pipe.js +0 -51
  110. package/esm2015/lib/pipes/gt-column-class.pipe.metadata.json +0 -1
  111. package/esm2015/lib/pipes/gt-filter.pipe.js +0 -60
  112. package/esm2015/lib/pipes/gt-filter.pipe.metadata.json +0 -1
  113. package/esm2015/lib/pipes/gt-highlight.pipe.js +0 -72
  114. package/esm2015/lib/pipes/gt-highlight.pipe.metadata.json +0 -1
  115. package/esm2015/lib/pipes/gt-is-editable.pipe.js +0 -37
  116. package/esm2015/lib/pipes/gt-is-editable.pipe.metadata.json +0 -1
  117. package/esm2015/lib/pipes/gt-is-observable.pipe.js +0 -31
  118. package/esm2015/lib/pipes/gt-is-observable.pipe.metadata.json +0 -1
  119. package/esm2015/lib/pipes/gt-meta.pipe.js +0 -54
  120. package/esm2015/lib/pipes/gt-meta.pipe.metadata.json +0 -1
  121. package/esm2015/lib/pipes/gt-order-by.pipe.js +0 -202
  122. package/esm2015/lib/pipes/gt-order-by.pipe.metadata.json +0 -1
  123. package/esm2015/lib/pipes/gt-property.pipe.js +0 -52
  124. package/esm2015/lib/pipes/gt-property.pipe.metadata.json +0 -1
  125. package/esm2015/lib/pipes/gt-render.pipe.js +0 -173
  126. package/esm2015/lib/pipes/gt-render.pipe.metadata.json +0 -1
  127. package/esm2015/lib/pipes/gt-row-class.pipe.js +0 -66
  128. package/esm2015/lib/pipes/gt-row-class.pipe.metadata.json +0 -1
  129. package/esm2015/lib/pipes/gt-search.pipe.js +0 -114
  130. package/esm2015/lib/pipes/gt-search.pipe.metadata.json +0 -1
  131. package/esm2015/lib/pipes/gt-totals-position.pipe.js +0 -35
  132. package/esm2015/lib/pipes/gt-totals-position.pipe.metadata.json +0 -1
  133. package/esm2015/lib/pipes/gt-totals.pipe.js +0 -46
  134. package/esm2015/lib/pipes/gt-totals.pipe.metadata.json +0 -1
  135. package/esm2015/lib/pipes/gt-visible.pipe.js +0 -71
  136. package/esm2015/lib/pipes/gt-visible.pipe.metadata.json +0 -1
  137. package/esm2015/public_api.js +0 -18
  138. package/esm2015/public_api.metadata.json +0 -1
  139. package/esm5/angular-generic-table-core.js +0 -28
  140. package/esm5/angular-generic-table-core.metadata.json +0 -1
  141. package/esm5/lib/components/generic-table/generic-table.component.js +0 -1813
  142. package/esm5/lib/components/generic-table/generic-table.component.metadata.json +0 -1
  143. package/esm5/lib/components/gt-checkbox/gt-checkbox.component.js +0 -100
  144. package/esm5/lib/components/gt-checkbox/gt-checkbox.component.metadata.json +0 -1
  145. package/esm5/lib/components/gt-custom-component-factory/gt-custom-component-factory.component.js +0 -136
  146. package/esm5/lib/components/gt-custom-component-factory/gt-custom-component-factory.component.metadata.json +0 -1
  147. package/esm5/lib/components/gt-drilldown/gt-drilldown.component.js +0 -41
  148. package/esm5/lib/components/gt-drilldown/gt-drilldown.component.metadata.json +0 -1
  149. package/esm5/lib/components/gt-dropdown/gt-dropdown.component.js +0 -179
  150. package/esm5/lib/components/gt-dropdown/gt-dropdown.component.metadata.json +0 -1
  151. package/esm5/lib/components/gt-expanding-row/gt-expanding-row.component.js +0 -173
  152. package/esm5/lib/components/gt-expanding-row/gt-expanding-row.component.metadata.json +0 -1
  153. package/esm5/lib/components/gt-pagination/gt-pagination.component.js +0 -149
  154. package/esm5/lib/components/gt-pagination/gt-pagination.component.metadata.json +0 -1
  155. package/esm5/lib/components/gt-table-info/gt-table-info.component.js +0 -111
  156. package/esm5/lib/components/gt-table-info/gt-table-info.component.metadata.json +0 -1
  157. package/esm5/lib/core.module.js +0 -100
  158. package/esm5/lib/core.module.metadata.json +0 -1
  159. package/esm5/lib/directives/component-anchor.directive.js +0 -66
  160. package/esm5/lib/directives/component-anchor.directive.metadata.json +0 -1
  161. package/esm5/lib/directives/gt-column-width.directive.js +0 -81
  162. package/esm5/lib/directives/gt-column-width.directive.metadata.json +0 -1
  163. package/esm5/lib/interfaces/gt-config-field.js +0 -96
  164. package/esm5/lib/interfaces/gt-config-field.metadata.json +0 -1
  165. package/esm5/lib/interfaces/gt-config-setting.js +0 -41
  166. package/esm5/lib/interfaces/gt-config-setting.metadata.json +0 -1
  167. package/esm5/lib/interfaces/gt-config-total.js +0 -20
  168. package/esm5/lib/interfaces/gt-config-total.metadata.json +0 -1
  169. package/esm5/lib/interfaces/gt-config.js +0 -24
  170. package/esm5/lib/interfaces/gt-config.metadata.json +0 -1
  171. package/esm5/lib/interfaces/gt-event.js +0 -16
  172. package/esm5/lib/interfaces/gt-event.metadata.json +0 -1
  173. package/esm5/lib/interfaces/gt-information.js +0 -38
  174. package/esm5/lib/interfaces/gt-information.metadata.json +0 -1
  175. package/esm5/lib/interfaces/gt-options.js +0 -55
  176. package/esm5/lib/interfaces/gt-options.metadata.json +0 -1
  177. package/esm5/lib/interfaces/gt-render-field.js +0 -29
  178. package/esm5/lib/interfaces/gt-render-field.metadata.json +0 -1
  179. package/esm5/lib/interfaces/gt-row-meta.js +0 -18
  180. package/esm5/lib/interfaces/gt-row-meta.metadata.json +0 -1
  181. package/esm5/lib/interfaces/gt-row.js +0 -20
  182. package/esm5/lib/interfaces/gt-row.metadata.json +0 -1
  183. package/esm5/lib/interfaces/gt-texts.js +0 -36
  184. package/esm5/lib/interfaces/gt-texts.metadata.json +0 -1
  185. package/esm5/lib/pipes/dash-case.pipe.js +0 -38
  186. package/esm5/lib/pipes/dash-case.pipe.metadata.json +0 -1
  187. package/esm5/lib/pipes/gt-chunk.pipe.js +0 -70
  188. package/esm5/lib/pipes/gt-chunk.pipe.metadata.json +0 -1
  189. package/esm5/lib/pipes/gt-column-class.pipe.js +0 -61
  190. package/esm5/lib/pipes/gt-column-class.pipe.metadata.json +0 -1
  191. package/esm5/lib/pipes/gt-filter.pipe.js +0 -73
  192. package/esm5/lib/pipes/gt-filter.pipe.metadata.json +0 -1
  193. package/esm5/lib/pipes/gt-highlight.pipe.js +0 -77
  194. package/esm5/lib/pipes/gt-highlight.pipe.metadata.json +0 -1
  195. package/esm5/lib/pipes/gt-is-editable.pipe.js +0 -47
  196. package/esm5/lib/pipes/gt-is-editable.pipe.metadata.json +0 -1
  197. package/esm5/lib/pipes/gt-is-observable.pipe.js +0 -39
  198. package/esm5/lib/pipes/gt-is-observable.pipe.metadata.json +0 -1
  199. package/esm5/lib/pipes/gt-meta.pipe.js +0 -65
  200. package/esm5/lib/pipes/gt-meta.pipe.metadata.json +0 -1
  201. package/esm5/lib/pipes/gt-order-by.pipe.js +0 -223
  202. package/esm5/lib/pipes/gt-order-by.pipe.metadata.json +0 -1
  203. package/esm5/lib/pipes/gt-property.pipe.js +0 -63
  204. package/esm5/lib/pipes/gt-property.pipe.metadata.json +0 -1
  205. package/esm5/lib/pipes/gt-render.pipe.js +0 -182
  206. package/esm5/lib/pipes/gt-render.pipe.metadata.json +0 -1
  207. package/esm5/lib/pipes/gt-row-class.pipe.js +0 -75
  208. package/esm5/lib/pipes/gt-row-class.pipe.metadata.json +0 -1
  209. package/esm5/lib/pipes/gt-search.pipe.js +0 -125
  210. package/esm5/lib/pipes/gt-search.pipe.metadata.json +0 -1
  211. package/esm5/lib/pipes/gt-totals-position.pipe.js +0 -45
  212. package/esm5/lib/pipes/gt-totals-position.pipe.metadata.json +0 -1
  213. package/esm5/lib/pipes/gt-totals.pipe.js +0 -57
  214. package/esm5/lib/pipes/gt-totals.pipe.metadata.json +0 -1
  215. package/esm5/lib/pipes/gt-visible.pipe.js +0 -79
  216. package/esm5/lib/pipes/gt-visible.pipe.metadata.json +0 -1
  217. package/esm5/public_api.js +0 -18
  218. package/esm5/public_api.metadata.json +0 -1
  219. package/fesm2015/angular-generic-table-core.js +0 -3285
  220. package/fesm2015/angular-generic-table-core.js.map +0 -1
  221. package/fesm5/angular-generic-table-core.js +0 -3574
  222. package/fesm5/angular-generic-table-core.js.map +0 -1
  223. package/lib/components/generic-table/generic-table.component.d.ts +0 -282
  224. package/lib/components/gt-checkbox/gt-checkbox.component.d.ts +0 -12
  225. package/lib/components/gt-custom-component-factory/gt-custom-component-factory.component.d.ts +0 -27
  226. package/lib/components/gt-drilldown/gt-drilldown.component.d.ts +0 -6
  227. package/lib/components/gt-dropdown/gt-dropdown.component.d.ts +0 -21
  228. package/lib/components/gt-expanding-row/gt-expanding-row.component.d.ts +0 -34
  229. package/lib/components/gt-pagination/gt-pagination.component.d.ts +0 -11
  230. package/lib/components/gt-table-info/gt-table-info.component.d.ts +0 -15
  231. package/lib/directives/component-anchor.directive.d.ts +0 -10
  232. package/lib/directives/gt-column-width.directive.d.ts +0 -11
  233. package/lib/interfaces/gt-config-field.d.ts +0 -87
  234. package/lib/interfaces/gt-config-setting.d.ts +0 -21
  235. package/lib/interfaces/gt-config-total.d.ts +0 -8
  236. package/lib/interfaces/gt-config.d.ts +0 -12
  237. package/lib/interfaces/gt-event.d.ts +0 -4
  238. package/lib/interfaces/gt-information.d.ts +0 -15
  239. package/lib/interfaces/gt-options.d.ts +0 -27
  240. package/lib/interfaces/gt-render-field.d.ts +0 -19
  241. package/lib/interfaces/gt-row-meta.d.ts +0 -5
  242. package/lib/interfaces/gt-row.d.ts +0 -6
  243. package/lib/interfaces/gt-texts.d.ts +0 -14
  244. package/lib/pipes/gt-chunk.pipe.d.ts +0 -8
  245. package/lib/pipes/gt-column-class.pipe.d.ts +0 -6
  246. package/lib/pipes/gt-filter.pipe.d.ts +0 -5
  247. package/lib/pipes/gt-highlight.pipe.d.ts +0 -7
  248. package/lib/pipes/gt-is-editable.pipe.d.ts +0 -4
  249. package/lib/pipes/gt-is-observable.pipe.d.ts +0 -4
  250. package/lib/pipes/gt-meta.pipe.d.ts +0 -5
  251. package/lib/pipes/gt-order-by.pipe.d.ts +0 -11
  252. package/lib/pipes/gt-property.pipe.d.ts +0 -7
  253. package/lib/pipes/gt-render.pipe.d.ts +0 -19
  254. package/lib/pipes/gt-row-class.pipe.d.ts +0 -5
  255. package/lib/pipes/gt-search.pipe.d.ts +0 -10
  256. package/lib/pipes/gt-totals-position.pipe.d.ts +0 -5
  257. package/lib/pipes/gt-totals.pipe.d.ts +0 -4
  258. package/lib/pipes/gt-visible.pipe.d.ts +0 -9
  259. package/public_api.d.ts +0 -18
  260. package/scss/generic-table.scss +0 -246
@@ -0,0 +1,25 @@
1
+ import { Injector, Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class DynamicPipe {
4
+ constructor(injector) {
5
+ this.injector = injector;
6
+ }
7
+ transform(value, requiredPipe, pipeArgs) {
8
+ const injector = Injector.create({
9
+ name: 'DynamicPipe',
10
+ parent: this.injector,
11
+ providers: [{ provide: requiredPipe }],
12
+ });
13
+ const pipe = injector.get(requiredPipe);
14
+ return pipe.transform(value, ...(pipeArgs || []));
15
+ }
16
+ }
17
+ DynamicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
18
+ DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicPipe, decorators: [{
20
+ type: Pipe,
21
+ args: [{
22
+ name: 'dynamicPipe',
23
+ }]
24
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZS9zcmMvbGliL3BpcGVzL2R5bmFtaWMucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLElBQUksRUFBdUIsTUFBTSxlQUFlLENBQUM7O0FBS3BFLE1BQU0sT0FBTyxXQUFXO0lBQ3RCLFlBQW9CLFFBQWtCO1FBQWxCLGFBQVEsR0FBUixRQUFRLENBQVU7SUFBRyxDQUFDO0lBRTFDLFNBQVMsQ0FBQyxLQUFVLEVBQUUsWUFBdUIsRUFBRSxRQUFlO1FBQzVELE1BQU0sUUFBUSxHQUFHLFFBQVEsQ0FBQyxNQUFNLENBQUM7WUFDL0IsSUFBSSxFQUFFLGFBQWE7WUFDbkIsTUFBTSxFQUFFLElBQUksQ0FBQyxRQUFRO1lBQ3JCLFNBQVMsRUFBRSxDQUFDLEVBQUUsT0FBTyxFQUFFLFlBQVksRUFBRSxDQUFDO1NBQ3ZDLENBQUMsQ0FBQztRQUNILE1BQU0sSUFBSSxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLENBQUM7UUFDeEMsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLEtBQUssRUFBRSxHQUFHLENBQUMsUUFBUSxJQUFJLEVBQUUsQ0FBQyxDQUFDLENBQUM7SUFDcEQsQ0FBQzs7d0dBWFUsV0FBVztzR0FBWCxXQUFXOzJGQUFYLFdBQVc7a0JBSHZCLElBQUk7bUJBQUM7b0JBQ0osSUFBSSxFQUFFLGFBQWE7aUJBQ3BCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0b3IsIFBpcGUsIFBpcGVUcmFuc2Zvcm0sIFR5cGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuQFBpcGUoe1xuICBuYW1lOiAnZHluYW1pY1BpcGUnLFxufSlcbmV4cG9ydCBjbGFzcyBEeW5hbWljUGlwZSBpbXBsZW1lbnRzIFBpcGVUcmFuc2Zvcm0ge1xuICBjb25zdHJ1Y3Rvcihwcml2YXRlIGluamVjdG9yOiBJbmplY3Rvcikge31cblxuICB0cmFuc2Zvcm0odmFsdWU6IGFueSwgcmVxdWlyZWRQaXBlOiBUeXBlPGFueT4sIHBpcGVBcmdzOiBhbnlbXSk6IGFueSB7XG4gICAgY29uc3QgaW5qZWN0b3IgPSBJbmplY3Rvci5jcmVhdGUoe1xuICAgICAgbmFtZTogJ0R5bmFtaWNQaXBlJyxcbiAgICAgIHBhcmVudDogdGhpcy5pbmplY3RvcixcbiAgICAgIHByb3ZpZGVyczogW3sgcHJvdmlkZTogcmVxdWlyZWRQaXBlIH1dLFxuICAgIH0pO1xuICAgIGNvbnN0IHBpcGUgPSBpbmplY3Rvci5nZXQocmVxdWlyZWRQaXBlKTtcbiAgICByZXR1cm4gcGlwZS50cmFuc2Zvcm0odmFsdWUsIC4uLihwaXBlQXJncyB8fCBbXSkpO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,48 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class HighlightPipe {
4
+ transform(text, searchTerm) {
5
+ if (!searchTerm) {
6
+ return text;
7
+ }
8
+ const haystackAlwaysString = text + '';
9
+ let highlightedText = haystackAlwaysString; // fallback
10
+ let searchPattern;
11
+ try {
12
+ searchPattern = new RegExp('(' +
13
+ // @ts-ignore
14
+ searchTerm
15
+ .toLowerCase()
16
+ .match(/".*?"|[^ ]+/g) // extract words
17
+ .map(needle => needle.replace(/"(.*?)"/, '$1') // strip away '"'
18
+ )
19
+ .join('|') + // combine words
20
+ ')', 'ig');
21
+ }
22
+ catch (error) {
23
+ return highlightedText;
24
+ }
25
+ const containsTagPattern = /(<.*?>)(.*)(<\/.*?>)/gi;
26
+ const containsTagMatches = containsTagPattern.exec(haystackAlwaysString);
27
+ if (containsTagMatches) {
28
+ // tag exists in haystack
29
+ highlightedText =
30
+ containsTagMatches[1] +
31
+ containsTagMatches[2].replace(searchPattern, '<span class="gt-highlight-search">$1</span>') +
32
+ containsTagMatches[3];
33
+ }
34
+ else {
35
+ highlightedText = haystackAlwaysString.replace(searchPattern, '<span class="gt-highlight-search">$1</span>');
36
+ }
37
+ return highlightedText;
38
+ }
39
+ }
40
+ HighlightPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
41
+ HighlightPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HighlightPipe, name: "highlight" });
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HighlightPipe, decorators: [{
43
+ type: Pipe,
44
+ args: [{
45
+ name: 'highlight'
46
+ }]
47
+ }] });
48
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGlnaGxpZ2h0LnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb3JlL3NyYy9saWIvcGlwZXMvaGlnaGxpZ2h0LnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBaUIsTUFBTSxlQUFlLENBQUM7O0FBS3BELE1BQU0sT0FBTyxhQUFhO0lBQ3hCLFNBQVMsQ0FBQyxJQUFTLEVBQUUsVUFBeUI7UUFDNUMsSUFBSSxDQ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import * as i0 from "@angular/core";
3
+ export class SortClassPipe {
4
+ transform(selection, property) {
5
+ return selection?.sortBy === property ? 'sort-' + selection.sortByOrder : '';
6
+ }
7
+ }
8
+ SortClassPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SortClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
9
+ SortClassPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SortClassPipe, name: "sortClass" });
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SortClassPipe, decorators: [{
11
+ type: Pipe,
12
+ args: [{
13
+ name: 'sortClass',
14
+ }]
15
+ }] });
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ydC1jbGFzcy5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZS9zcmMvbGliL3BpcGVzL3NvcnQtY2xhc3MucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQzs7QUFNcEQsTUFBTSxPQUFPLGFBQWE7SUFDeEIsU0FBUyxDQUFDLFNBQXVELEVBQUUsUUFBZ0I7UUFDakYsT0FBTyxTQUFTLEVBQUUsTUFBTSxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsT0FBTyxHQUFHLFNBQVMsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQztJQUMvRSxDQUFDOzswR0FIVSxhQUFhO3dHQUFiLGFBQWE7MkZBQWIsYUFBYTtrQkFIekIsSUFBSTttQkFBQztvQkFDSixJQUFJLEVBQUUsV0FBVztpQkFDbEIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQaXBlLCBQaXBlVHJhbnNmb3JtIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBPcmRlciB9IGZyb20gJy4uL2VudW1zL29yZGVyLmVudW0nO1xuXG5AUGlwZSh7XG4gIG5hbWU6ICdzb3J0Q2xhc3MnLFxufSlcbmV4cG9ydCBjbGFzcyBTb3J0Q2xhc3NQaXBlIGltcGxlbWVudHMgUGlwZVRyYW5zZm9ybSB7XG4gIHRyYW5zZm9ybShzZWxlY3Rpb246IHsgc29ydEJ5OiBzdHJpbmc7IHNvcnRCeU9yZGVyOiBPcmRlciB9IHwgYW55LCBwcm9wZXJ0eTogc3RyaW5nKTogc3RyaW5nIHtcbiAgICByZXR1cm4gc2VsZWN0aW9uPy5zb3J0QnkgPT09IHByb3BlcnR5ID8gJ3NvcnQtJyArIHNlbGVjdGlvbi5zb3J0QnlPcmRlciA6ICcnO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,39 @@
1
+ export let dashed;
2
+ dashed = (s) => s.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());
3
+ export let capitalize;
4
+ capitalize = (s) => (s.charAt(0).toUpperCase() + s.slice(1))
5
+ .replace(/_/g, ' ')
6
+ .replace(/([A-Z][a-z]+)/g, ' $1')
7
+ .replace(/([A-Z]{2,})/g, ' $1')
8
+ .replace(/\s{2,}/g, ' ')
9
+ .trim();
10
+ export let chunk;
11
+ chunk = (array, chunkSize) => {
12
+ if (chunkSize < 0) {
13
+ throw new Error('Invalid chunk size');
14
+ }
15
+ if (chunkSize === 0 && !chunkSize) {
16
+ return [array];
17
+ }
18
+ const CHUNK = [];
19
+ for (let i = 0, len = array.length; i < len; i += chunkSize) {
20
+ CHUNK.push(array.slice(i, i + chunkSize));
21
+ }
22
+ return CHUNK;
23
+ };
24
+ export let search;
25
+ search = (text, caseSensitive, data, config) => {
26
+ if (config.columns) {
27
+ const searchColumns = Object.keys(config.columns).filter(
28
+ // @ts-ignore
29
+ (key) => !config.columns[key].hidden && config.columns[key].search !== false);
30
+ return data.filter((row) => Object.entries(row)
31
+ .filter(([key, value]) => searchColumns.indexOf(key) !== -1)
32
+ .reduce((prev, [key, value]) => prev + (prev === '' ? '' : ' & ') + (caseSensitive ? value + '' : (value + '').toLowerCase()), '')
33
+ .indexOf(text) !== -1);
34
+ }
35
+ else {
36
+ return data;
37
+ }
38
+ };
39
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbGl0aWVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZS9zcmMvbGliL3V0aWxpdGllcy91dGlsaXRpZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsTUFBTSxDQUFDLElBQUksTUFBNkIsQ0FBQztBQUN6QyxNQUFNLEdBQUcsQ0FBQyxDQUFTLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxHQUFHLEdBQUcsQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDLENBQUM7QUFFMUUsTUFBTSxDQUFDLElBQUksVUFBaUMsQ0FBQztBQUM3QyxVQUFVLEdBQUcsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUNqQixDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsV0FBVyxFQUFFLEdBQUcsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQztLQUNyQyxPQUFPLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQztLQUNsQixPQUFPLENBQUMsZ0JBQWdCLEVBQUUsS0FBSyxDQUFDO0tBQ2hDLE9BQU8sQ0FBQyxjQUFjLEVBQUUsS0FBSyxDQUFDO0tBQzlCLE9BQU8sQ0FBQ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XRhO1xuICB9XG59O1xuIl19
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Public API Surface of core
3
+ */
4
+ export * from './lib/core.service';
5
+ export * from './lib/core.component';
6
+ export * from './lib/core.module';
7
+ export * from './lib/pagination/pagination.component';
8
+ export * from './lib/pagination/pagination.module';
9
+ export * from './lib/models/table-config.interface';
10
+ export * from './lib/models/table-column.interface';
11
+ export * from './lib/models/table-info.interface';
12
+ export * from './lib/models/table-row.interface';
13
+ export * from './lib/models/table-sort.interface';
14
+ export * from './lib/models/table-meta.interface';
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2NvcmUvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLHVDQUF1QyxDQUFDO0FBQ3RELGNBQWMsb0NBQW9DLENBQUM7QUFDbkQsY0FBYyxxQ0FBcUMsQ0FBQztBQUNwRCxjQUFjLHFDQUFxQyxDQUFDO0FBQ3BELGNBQWMsbUNBQW1DLENBQUM7QUFDbEQsY0FBYyxrQ0FBa0MsQ0FBQztBQUNqRCxjQUFjLG1DQUFtQyxDQUFDO0FBQ2xELGNBQWMsbUNBQW1DLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIGNvcmVcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvcGFnaW5hdGlvbi9wYWdpbmF0aW9uLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9wYWdpbmF0aW9uL3BhZ2luYXRpb24ubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL21vZGVscy90YWJsZS1jb25maWcuaW50ZXJmYWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL21vZGVscy90YWJsZS1jb2x1bW4uaW50ZXJmYWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL21vZGVscy90YWJsZS1pbmZvLmludGVyZmFjZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbHMvdGFibGUtcm93LmludGVyZmFjZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbHMvdGFibGUtc29ydC5pbnRlcmZhY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvbW9kZWxzL3RhYmxlLW1ldGEuaW50ZXJmYWNlJztcbiJdfQ==
@@ -0,0 +1,384 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Pipe, Injector, Component, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
3
+ import { ReplaySubject, Subject, isObservable, of, combineLatest, EMPTY, BehaviorSubject } from 'rxjs';
4
+ import { startWith, map, switchMap, shareReplay, withLatestFrom, pluck } from 'rxjs/operators';
5
+ import * as i1 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+
8
+ class CoreService {
9
+ constructor() { }
10
+ }
11
+ CoreService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12
+ CoreService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CoreService, providedIn: 'root' });
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CoreService, decorators: [{
14
+ type: Injectable,
15
+ args: [{
16
+ providedIn: 'root'
17
+ }]
18
+ }], ctorParameters: function () { return []; } });
19
+
20
+ var Order;
21
+ (function (Order) {
22
+ Order["ASC"] = "asc";
23
+ Order["DESC"] = "desc";
24
+ })(Order || (Order = {}));
25
+
26
+ let dashed;
27
+ dashed = (s) => s.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());
28
+ let capitalize;
29
+ capitalize = (s) => (s.charAt(0).toUpperCase() + s.slice(1))
30
+ .replace(/_/g, ' ')
31
+ .replace(/([A-Z][a-z]+)/g, ' $1')
32
+ .replace(/([A-Z]{2,})/g, ' $1')
33
+ .replace(/\s{2,}/g, ' ')
34
+ .trim();
35
+ let chunk;
36
+ chunk = (array, chunkSize) => {
37
+ if (chunkSize < 0) {
38
+ throw new Error('Invalid chunk size');
39
+ }
40
+ if (chunkSize === 0 && !chunkSize) {
41
+ return [array];
42
+ }
43
+ const CHUNK = [];
44
+ for (let i = 0, len = array.length; i < len; i += chunkSize) {
45
+ CHUNK.push(array.slice(i, i + chunkSize));
46
+ }
47
+ return CHUNK;
48
+ };
49
+ let search;
50
+ search = (text, caseSensitive, data, config) => {
51
+ if (config.columns) {
52
+ const searchColumns = Object.keys(config.columns).filter(
53
+ // @ts-ignore
54
+ (key) => !config.columns[key].hidden && config.columns[key].search !== false);
55
+ return data.filter((row) => Object.entries(row)
56
+ .filter(([key, value]) => searchColumns.indexOf(key) !== -1)
57
+ .reduce((prev, [key, value]) => prev + (prev === '' ? '' : ' & ') + (caseSensitive ? value + '' : (value + '').toLowerCase()), '')
58
+ .indexOf(text) !== -1);
59
+ }
60
+ else {
61
+ return data;
62
+ }
63
+ };
64
+
65
+ class SortClassPipe {
66
+ transform(selection, property) {
67
+ return (selection === null || selection === void 0 ? void 0 : selection.sortBy) === property ? 'sort-' + selection.sortByOrder : '';
68
+ }
69
+ }
70
+ SortClassPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SortClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
71
+ SortClassPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SortClassPipe, name: "sortClass" });
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: SortClassPipe, decorators: [{
73
+ type: Pipe,
74
+ args: [{
75
+ name: 'sortClass',
76
+ }]
77
+ }] });
78
+
79
+ class DashCasePipe {
80
+ transform(s) {
81
+ return dashed(s);
82
+ }
83
+ }
84
+ DashCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DashCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
85
+ DashCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DashCasePipe, name: "dashCase" });
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DashCasePipe, decorators: [{
87
+ type: Pipe,
88
+ args: [{
89
+ name: 'dashCase'
90
+ }]
91
+ }] });
92
+
93
+ class CapitalCasePipe {
94
+ transform(s) {
95
+ return capitalize(s);
96
+ }
97
+ }
98
+ CapitalCasePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CapitalCasePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
99
+ CapitalCasePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CapitalCasePipe, name: "capitalCase" });
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CapitalCasePipe, decorators: [{
101
+ type: Pipe,
102
+ args: [{
103
+ name: 'capitalCase',
104
+ }]
105
+ }] });
106
+
107
+ class HighlightPipe {
108
+ transform(text, searchTerm) {
109
+ if (!searchTerm) {
110
+ return text;
111
+ }
112
+ const haystackAlwaysString = text + '';
113
+ let highlightedText = haystackAlwaysString; // fallback
114
+ let searchPattern;
115
+ try {
116
+ searchPattern = new RegExp('(' +
117
+ // @ts-ignore
118
+ searchTerm
119
+ .toLowerCase()
120
+ .match(/".*?"|[^ ]+/g) // extract words
121
+ .map(needle => needle.replace(/"(.*?)"/, '$1') // strip away '"'
122
+ )
123
+ .join('|') + // combine words
124
+ ')', 'ig');
125
+ }
126
+ catch (error) {
127
+ return highlightedText;
128
+ }
129
+ const containsTagPattern = /(<.*?>)(.*)(<\/.*?>)/gi;
130
+ const containsTagMatches = containsTagPattern.exec(haystackAlwaysString);
131
+ if (containsTagMatches) {
132
+ // tag exists in haystack
133
+ highlightedText =
134
+ containsTagMatches[1] +
135
+ containsTagMatches[2].replace(searchPattern, '<span class="gt-highlight-search">$1</span>') +
136
+ containsTagMatches[3];
137
+ }
138
+ else {
139
+ highlightedText = haystackAlwaysString.replace(searchPattern, '<span class="gt-highlight-search">$1</span>');
140
+ }
141
+ return highlightedText;
142
+ }
143
+ }
144
+ HighlightPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
145
+ HighlightPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HighlightPipe, name: "highlight" });
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: HighlightPipe, decorators: [{
147
+ type: Pipe,
148
+ args: [{
149
+ name: 'highlight'
150
+ }]
151
+ }] });
152
+
153
+ class DynamicPipe {
154
+ constructor(injector) {
155
+ this.injector = injector;
156
+ }
157
+ transform(value, requiredPipe, pipeArgs) {
158
+ const injector = Injector.create({
159
+ name: 'DynamicPipe',
160
+ parent: this.injector,
161
+ providers: [{ provide: requiredPipe }],
162
+ });
163
+ const pipe = injector.get(requiredPipe);
164
+ return pipe.transform(value, ...(pipeArgs || []));
165
+ }
166
+ }
167
+ DynamicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
168
+ DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DynamicPipe, decorators: [{
170
+ type: Pipe,
171
+ args: [{
172
+ name: 'dynamicPipe',
173
+ }]
174
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
175
+
176
+ class CoreComponent {
177
+ constructor() {
178
+ this._loading$ = new ReplaySubject(1);
179
+ this.sortBy$ = new Subject();
180
+ // tslint:disable-next-line:variable-name
181
+ this._searchBy$ = new ReplaySubject(1);
182
+ this.searchBy$ = this._searchBy$.pipe(startWith(''), map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => obs), shareReplay(1));
183
+ // tslint:disable-next-line:variable-name
184
+ this._tableConfig$ = new ReplaySubject(1);
185
+ this.tableConfig$ = this._tableConfig$.pipe(map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => obs), shareReplay(1));
186
+ // tslint:disable-next-line:variable-name
187
+ this._data$ = new ReplaySubject(1);
188
+ this.data$ = this._data$.pipe(map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => combineLatest([obs, this.sortBy$.pipe(startWith(EMPTY)), this.searchBy$])), withLatestFrom(this.tableConfig$), map(([[data, sortBy, searchBy], config]) => {
189
+ var _a;
190
+ // create a new array reference and sort new array (prevent mutating existing state)
191
+ data = [...data];
192
+ return !sortBy
193
+ ? searchBy
194
+ ? search(searchBy, false, data, config)
195
+ : data
196
+ : (_a = (searchBy ? search(searchBy, false, data, config) : data)) === null || _a === void 0 ? void 0 : _a.sort((a, b) => {
197
+ // TODO: improve logic
198
+ const typed = sortBy;
199
+ return a[typed.sortBy] > b[typed.sortBy]
200
+ ? typed.sortByOrder === Order.ASC
201
+ ? 1
202
+ : -1
203
+ : b[typed.sortBy] > a[typed.sortBy]
204
+ ? typed.sortByOrder === Order.ASC
205
+ ? -1
206
+ : 1
207
+ : 0;
208
+ });
209
+ }), shareReplay(1));
210
+ this.table$ = combineLatest([this.data$, this.tableConfig$]).pipe(map(([sorted, config]) => {
211
+ // if pagination is disabled...
212
+ if (!config.pagination || config.pagination.length === 0) {
213
+ // ...return unaltered array
214
+ return { data: [sorted], config, info: { records: sorted.length, pageTotal: 1 } };
215
+ }
216
+ // return record set
217
+ return {
218
+ data: chunk(sorted, +(config.pagination.length || 0)),
219
+ config,
220
+ info: {
221
+ records: sorted.length,
222
+ pageTotal: Math.ceil(sorted.length / +(config.pagination.length || 0)),
223
+ },
224
+ };
225
+ }), shareReplay(1));
226
+ this._currentPage$ = new BehaviorSubject(0);
227
+ this.currentPage$ = combineLatest([this._currentPage$, this.table$]).pipe(map(([page, table]) => {
228
+ var _a, _b;
229
+ // determine last page
230
+ const lastPage = Math.ceil(table.info.records / (((_b = (_a = table.config) === null || _a === void 0 ? void 0 : _a.pagination) === null || _b === void 0 ? void 0 : _b.length) || table.info.records)) - 1;
231
+ // determine max/min position
232
+ return +page < 0 ? 0 : +page > lastPage ? lastPage : +page;
233
+ }), shareReplay(1));
234
+ this.colspan$ = this.tableConfig$.pipe(switchMap((config) => config.columns
235
+ ? of(Object.values(config.columns || config.rows || {}).filter((value) => value.hidden !== true).length)
236
+ : this.data$.pipe(map((data) => data.length + 1))));
237
+ this.columnOrder = (a, b) => {
238
+ return (a.value.order || 0) - (b.value.order || 0);
239
+ };
240
+ }
241
+ set loading(value) {
242
+ this._loading$.next(value);
243
+ }
244
+ set page(value) {
245
+ this._currentPage$.next(value);
246
+ }
247
+ set search(value) {
248
+ this._searchBy$.next(value);
249
+ }
250
+ set config(value) {
251
+ this._tableConfig$.next(value);
252
+ }
253
+ set data(value) {
254
+ this._data$.next(value);
255
+ }
256
+ get loading$() {
257
+ return this._loading$.pipe(startWith(false), map((value) => (isObservable(value) ? value : of(value))), switchMap((obs) => obs), shareReplay(1));
258
+ }
259
+ sort(property) {
260
+ var _a, _b;
261
+ const newSortOrder = ((_a = this._sortBy) === null || _a === void 0 ? void 0 : _a.sortBy) !== property || ((_b = this._sortBy) === null || _b === void 0 ? void 0 : _b.sortByOrder) === Order.DESC || !this._sortBy.sortByOrder
262
+ ? Order.ASC
263
+ : Order.DESC;
264
+ const newSortBy = {
265
+ sortBy: property,
266
+ sortByOrder: newSortOrder,
267
+ };
268
+ this.sortBy$.next(newSortBy);
269
+ this._sortBy = newSortBy;
270
+ }
271
+ }
272
+ CoreComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
273
+ CoreComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: CoreComponent, selector: "angular-generic-table", inputs: { loading: "loading", page: "page", search: "search", config: "config", data: "data" }, ngImport: i0, template: "<table [ngClass]=\"(tableConfig$ | async)?.class || 'table'\" [class.table-mobile]=\"(tableConfig$ | async)?.mobileLayout\">\n <thead>\n <tr *ngIf=\"{\n config:(tableConfig$ | async)!,\n loading: loading$ | async\n } as table\">\n <ng-container *ngFor=\"let column of table?.config?.columns | keyvalue: columnOrder\">\n <th\n *ngIf=\"!column.value?.hidden\"\n ngClass=\"{{ column.value?.sortable ? 'sort ' : '' }} {{ sortBy$ | async | sortClass: column.key }} {{\n (column.key | dashCase) + '-column'\n }} {{column.value.class}}\"\n [class.disabled]=\"table.loading\"\n (click)=\"table.loading || !column.value?.sortable || sort(column.key)\"\n >\n <span *ngIf=\"column.value?.header !== false\">{{ column.value?.header || column.key | capitalCase }}</span>\n </th>\n </ng-container>\n <ng-container *ngIf=\"((table?.config?.rows | keyvalue: columnOrder)||[])[0] as headerRow\">\n <th class=\"row-header\"\n ngClass=\"{{ headerRow.value?.sortable ? 'sort ' : '' }} {{ sortBy$ | async | sortClass: headerRow.key }} {{\n (headerRow.key | dashCase) + '-column'\n }}\"\n (click)=\"table.loading || !headerRow.value?.sortable || sort(headerRow.key)\">\n <ng-container *ngIf=\"headerRow?.value?.header !== false\">{{headerRow?.value?.header || headerRow.key | capitalCase }}</ng-container>\n </th>\n <th *ngFor=\"let column of ((table$ | async)?.data || [])[0]\" ngClass=\"{{headerRow.value?.class}}\">\n <ng-container [ngTemplateOutlet]=\"(table.config?.rows || {})[headerRow.key].templateRef ? templateRef : (table.config?.rows || {})[headerRow.key].transform ? transformData:\n rawData\" [ngTemplateOutletContext]=\"{row: column, column: headerRow, transform: (table.config?.rows || {})[headerRow.key].transform, templateRef: (table.config?.rows || {})[headerRow.key].templateRef, index: 0}\">\n </ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n <tbody *ngIf=\"loading$ | async; else tableContent\">\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-loading\"></ng-content>\n </td>\n </tr>\n </tbody>\n</table>\n<ng-template #tableContent>\n <ng-container\n *ngIf=\"(table$ | async)! as table\"\n >\n <tbody *ngIf=\"(table!.data![0] || table!.data!).length > 0; else noData\">\n <ng-container *ngIf=\"table.config.columns\">\n <tr *ngFor=\"let row of table!.data![(currentPage$ | async) || 0]; let i = index\" [attr.id]=\"'tableRow_' + i\">\n <ng-container *ngFor=\"let column of table.config?.columns | keyvalue: columnOrder\">\n <td *ngIf=\"!column.value?.hidden\" ngClass=\"{{(column.key | dashCase) + '-column'}} {{column.value?.class}}\">\n <span *ngIf=\"column.value?.mobileHeader && table.config?.mobileLayout\" class=\"mobile-header\">{{ column.value?.mobileHeader !== true ? column.value?.mobileHeader : column.value?.header || column.key | capitalCase }}</span>\n <ng-container [ngTemplateOutlet]=\"(searchBy$ | async) && !(table.config?.columns || {})[column.key].templateRef ? highlighted:\n (table.config?.columns || {})[column.key].templateRef ? templateRef : (table.config?.columns || {})[column.key].transform ? transformData:\n rawData\" [ngTemplateOutletContext]=\"{row: row, column: column, search: (searchBy$ | async), transform: (table.config?.columns || {})[column.key].transform, templateRef: (table.config?.columns || {})[column.key].templateRef, index: i}\"></ng-container></td>\n </ng-container>\n </tr>\n </ng-container>\n <ng-container *ngIf=\"table.config.rows\">\n <ng-container *ngFor=\"let row of table?.config?.rows | keyvalue: columnOrder | slice:1; let i = index\">\n <tr *ngIf=\"!row.value?.hidden\" [attr.id]=\"'tableRow_' + i\" ngClass=\"{{(row.key | dashCase) + '-row'}}\">\n <th class=\"row-header\">\n <span *ngIf=\"row.value.mobileHeader\" class=\"mobile-header\">{{ row.value?.mobileHeader !== true ? row.value?.mobileHeader : row.value?.header || row.key | capitalCase }}</span>\n {{row.value?.header || row.key | capitalCase}}\n </th>\n <td *ngFor=\"let column of (table?.data || [])[0]\" ngClass=\"{{row.value?.class}}\">\n <ng-container [ngTemplateOutlet]=\"(table.config?.rows || {})[row.key].templateRef ? templateRef : (table.config?.rows || {})[row.key].transform ? transformData:\n rawData\" [ngTemplateOutletContext]=\"{row: column, column: row, transform: (table.config?.rows || {})[row.key].transform, templateRef: (table.config?.rows || {})[row.key].templateRef, index: i}\">\n </ng-container>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </ng-container>\n</ng-template>\n<ng-template #noData>\n <tbody>\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-no-data\"></ng-content>\n </td>\n </tr>\n </tbody>\n</ng-template>\n<ng-template #highlighted let-row=\"row\" let-column=\"column\" let-search=\"search\">\n <div [innerHTML]=\"(row[column.key] | highlight: search)\"></div>\n</ng-template>\n<ng-template #rawData let-row=\"row\" let-column=\"column\">\n {{row[column.key]}}\n</ng-template>\n<ng-template #transformData let-row=\"row\" let-column=\"column\" let-transform=\"transform\">\n {{row[column.key] | dynamicPipe:transform.pipe:transform?.args}}\n</ng-template>\n<ng-template #templateRef let-row=\"row\" let-column=\"column\" let-index=\"index\" let-templateRef=\"templateRef\">\n <ng-container [ngTemplateOutlet]=\"templateRef\" [ngTemplateOutletContext]=\"{row: row, col: column, index: index}\"></ng-container>\n</ng-template>\n", directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1.AsyncPipe, "keyvalue": i1.KeyValuePipe, "sortClass": SortClassPipe, "dashCase": DashCasePipe, "capitalCase": CapitalCasePipe, "slice": i1.SlicePipe, "highlight": HighlightPipe, "dynamicPipe": DynamicPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CoreComponent, decorators: [{
275
+ type: Component,
276
+ args: [{ selector: 'angular-generic-table', styles: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<table [ngClass]=\"(tableConfig$ | async)?.class || 'table'\" [class.table-mobile]=\"(tableConfig$ | async)?.mobileLayout\">\n <thead>\n <tr *ngIf=\"{\n config:(tableConfig$ | async)!,\n loading: loading$ | async\n } as table\">\n <ng-container *ngFor=\"let column of table?.config?.columns | keyvalue: columnOrder\">\n <th\n *ngIf=\"!column.value?.hidden\"\n ngClass=\"{{ column.value?.sortable ? 'sort ' : '' }} {{ sortBy$ | async | sortClass: column.key }} {{\n (column.key | dashCase) + '-column'\n }} {{column.value.class}}\"\n [class.disabled]=\"table.loading\"\n (click)=\"table.loading || !column.value?.sortable || sort(column.key)\"\n >\n <span *ngIf=\"column.value?.header !== false\">{{ column.value?.header || column.key | capitalCase }}</span>\n </th>\n </ng-container>\n <ng-container *ngIf=\"((table?.config?.rows | keyvalue: columnOrder)||[])[0] as headerRow\">\n <th class=\"row-header\"\n ngClass=\"{{ headerRow.value?.sortable ? 'sort ' : '' }} {{ sortBy$ | async | sortClass: headerRow.key }} {{\n (headerRow.key | dashCase) + '-column'\n }}\"\n (click)=\"table.loading || !headerRow.value?.sortable || sort(headerRow.key)\">\n <ng-container *ngIf=\"headerRow?.value?.header !== false\">{{headerRow?.value?.header || headerRow.key | capitalCase }}</ng-container>\n </th>\n <th *ngFor=\"let column of ((table$ | async)?.data || [])[0]\" ngClass=\"{{headerRow.value?.class}}\">\n <ng-container [ngTemplateOutlet]=\"(table.config?.rows || {})[headerRow.key].templateRef ? templateRef : (table.config?.rows || {})[headerRow.key].transform ? transformData:\n rawData\" [ngTemplateOutletContext]=\"{row: column, column: headerRow, transform: (table.config?.rows || {})[headerRow.key].transform, templateRef: (table.config?.rows || {})[headerRow.key].templateRef, index: 0}\">\n </ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n <tbody *ngIf=\"loading$ | async; else tableContent\">\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-loading\"></ng-content>\n </td>\n </tr>\n </tbody>\n</table>\n<ng-template #tableContent>\n <ng-container\n *ngIf=\"(table$ | async)! as table\"\n >\n <tbody *ngIf=\"(table!.data![0] || table!.data!).length > 0; else noData\">\n <ng-container *ngIf=\"table.config.columns\">\n <tr *ngFor=\"let row of table!.data![(currentPage$ | async) || 0]; let i = index\" [attr.id]=\"'tableRow_' + i\">\n <ng-container *ngFor=\"let column of table.config?.columns | keyvalue: columnOrder\">\n <td *ngIf=\"!column.value?.hidden\" ngClass=\"{{(column.key | dashCase) + '-column'}} {{column.value?.class}}\">\n <span *ngIf=\"column.value?.mobileHeader && table.config?.mobileLayout\" class=\"mobile-header\">{{ column.value?.mobileHeader !== true ? column.value?.mobileHeader : column.value?.header || column.key | capitalCase }}</span>\n <ng-container [ngTemplateOutlet]=\"(searchBy$ | async) && !(table.config?.columns || {})[column.key].templateRef ? highlighted:\n (table.config?.columns || {})[column.key].templateRef ? templateRef : (table.config?.columns || {})[column.key].transform ? transformData:\n rawData\" [ngTemplateOutletContext]=\"{row: row, column: column, search: (searchBy$ | async), transform: (table.config?.columns || {})[column.key].transform, templateRef: (table.config?.columns || {})[column.key].templateRef, index: i}\"></ng-container></td>\n </ng-container>\n </tr>\n </ng-container>\n <ng-container *ngIf=\"table.config.rows\">\n <ng-container *ngFor=\"let row of table?.config?.rows | keyvalue: columnOrder | slice:1; let i = index\">\n <tr *ngIf=\"!row.value?.hidden\" [attr.id]=\"'tableRow_' + i\" ngClass=\"{{(row.key | dashCase) + '-row'}}\">\n <th class=\"row-header\">\n <span *ngIf=\"row.value.mobileHeader\" class=\"mobile-header\">{{ row.value?.mobileHeader !== true ? row.value?.mobileHeader : row.value?.header || row.key | capitalCase }}</span>\n {{row.value?.header || row.key | capitalCase}}\n </th>\n <td *ngFor=\"let column of (table?.data || [])[0]\" ngClass=\"{{row.value?.class}}\">\n <ng-container [ngTemplateOutlet]=\"(table.config?.rows || {})[row.key].templateRef ? templateRef : (table.config?.rows || {})[row.key].transform ? transformData:\n rawData\" [ngTemplateOutletContext]=\"{row: column, column: row, transform: (table.config?.rows || {})[row.key].transform, templateRef: (table.config?.rows || {})[row.key].templateRef, index: i}\">\n </ng-container>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </ng-container>\n</ng-template>\n<ng-template #noData>\n <tbody>\n <tr>\n <td class=\"p-0\" [colSpan]=\"colspan$ | async\">\n <ng-content select=\".table-no-data\"></ng-content>\n </td>\n </tr>\n </tbody>\n</ng-template>\n<ng-template #highlighted let-row=\"row\" let-column=\"column\" let-search=\"search\">\n <div [innerHTML]=\"(row[column.key] | highlight: search)\"></div>\n</ng-template>\n<ng-template #rawData let-row=\"row\" let-column=\"column\">\n {{row[column.key]}}\n</ng-template>\n<ng-template #transformData let-row=\"row\" let-column=\"column\" let-transform=\"transform\">\n {{row[column.key] | dynamicPipe:transform.pipe:transform?.args}}\n</ng-template>\n<ng-template #templateRef let-row=\"row\" let-column=\"column\" let-index=\"index\" let-templateRef=\"templateRef\">\n <ng-container [ngTemplateOutlet]=\"templateRef\" [ngTemplateOutletContext]=\"{row: row, col: column, index: index}\"></ng-container>\n</ng-template>\n" }]
277
+ }], propDecorators: { loading: [{
278
+ type: Input
279
+ }], page: [{
280
+ type: Input
281
+ }], search: [{
282
+ type: Input
283
+ }], config: [{
284
+ type: Input
285
+ }], data: [{
286
+ type: Input
287
+ }] } });
288
+
289
+ class GenericTableCoreModule {
290
+ }
291
+ GenericTableCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTableCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
292
+ GenericTableCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTableCoreModule, declarations: [CoreComponent, SortClassPipe, DashCasePipe, HighlightPipe, CapitalCasePipe, CapitalCasePipe, DynamicPipe], imports: [CommonModule], exports: [CoreComponent] });
293
+ GenericTableCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTableCoreModule, imports: [[CommonModule]] });
294
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTableCoreModule, decorators: [{
295
+ type: NgModule,
296
+ args: [{
297
+ declarations: [CoreComponent, SortClassPipe, DashCasePipe, HighlightPipe, CapitalCasePipe, CapitalCasePipe, DynamicPipe],
298
+ imports: [CommonModule],
299
+ exports: [CoreComponent],
300
+ }]
301
+ }] });
302
+
303
+ class PaginationComponent {
304
+ constructor() {
305
+ this.table$ = new ReplaySubject(1);
306
+ this.pagination$ = this.table$.pipe(switchMap((core) => combineLatest([core === null || core === void 0 ? void 0 : core.table$.pipe(pluck('info')), core === null || core === void 0 ? void 0 : core.currentPage$])), map(([info, currentPage]) => this.generateList(info.pageTotal, currentPage)));
307
+ }
308
+ get table() {
309
+ return this._table;
310
+ }
311
+ set table(value) {
312
+ this._table = value;
313
+ this.table$.next(value);
314
+ }
315
+ generateList(pages, currentPosition) {
316
+ const paginationLength = 5;
317
+ const middle = Math.floor(paginationLength / 2);
318
+ const length = pages < paginationLength ? pages : paginationLength;
319
+ return Array.from({ length }, (_, i) => {
320
+ if (i === 0) {
321
+ return 1;
322
+ }
323
+ else if (pages < paginationLength) {
324
+ return i + 1;
325
+ }
326
+ else if (i + 1 === length) {
327
+ return pages;
328
+ }
329
+ else if (currentPosition > middle && currentPosition < pages - middle) {
330
+ return i + currentPosition - (middle - 1);
331
+ }
332
+ else if (currentPosition > middle && currentPosition < pages - (middle - 1)) {
333
+ return i + currentPosition - middle;
334
+ }
335
+ else if (currentPosition > middle && currentPosition === pages - (middle - 1)) {
336
+ return i + currentPosition - (middle + 1);
337
+ }
338
+ else if (currentPosition > middle && currentPosition === pages - 1) {
339
+ return i + currentPosition - (middle + 2);
340
+ }
341
+ else {
342
+ return i + 1;
343
+ }
344
+ });
345
+ }
346
+ goto(page) {
347
+ if (this.table) {
348
+ this.table.page = page - 1;
349
+ }
350
+ }
351
+ }
352
+ PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
353
+ PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: PaginationComponent, selector: "angular-generic-table-pagination", inputs: { table: "table" }, ngImport: i0, template: "<ng-container *ngIf=\"{\n links: pagination$ | async,\n currentPosition: table?.currentPage$ | async\n } as pagination\">\n <nav *ngIf=\"pagination.links && pagination.links.length > 1\" role=\"navigation\" aria-label=\"Table Pagination Navigation\" class=\"gt-pagination\">\n <ul>\n <li *ngFor=\"let position of pagination!.links; let i = index; let last = last\"\n [class.ellipsis]=\"position + 1 !== pagination!.links![i+1] && !last\"\n [class.active]=\"position === (pagination!.currentPosition || 0) + 1\"\n >\n <button class=\"btn btn-link\" [attr.aria-label]=\"'Goto Page ' + position\" (click)=\"goto(position)\">{{position}}</button>\n </li>\n </ul>\n</nav>\n</ng-container>\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: PaginationComponent, decorators: [{
355
+ type: Component,
356
+ args: [{ selector: 'angular-generic-table-pagination', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n links: pagination$ | async,\n currentPosition: table?.currentPage$ | async\n } as pagination\">\n <nav *ngIf=\"pagination.links && pagination.links.length > 1\" role=\"navigation\" aria-label=\"Table Pagination Navigation\" class=\"gt-pagination\">\n <ul>\n <li *ngFor=\"let position of pagination!.links; let i = index; let last = last\"\n [class.ellipsis]=\"position + 1 !== pagination!.links![i+1] && !last\"\n [class.active]=\"position === (pagination!.currentPosition || 0) + 1\"\n >\n <button class=\"btn btn-link\" [attr.aria-label]=\"'Goto Page ' + position\" (click)=\"goto(position)\">{{position}}</button>\n </li>\n </ul>\n</nav>\n</ng-container>\n" }]
357
+ }], propDecorators: { table: [{
358
+ type: Input
359
+ }] } });
360
+
361
+ class GenericTablePaginationModule {
362
+ }
363
+ GenericTablePaginationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTablePaginationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
364
+ GenericTablePaginationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTablePaginationModule, declarations: [PaginationComponent], imports: [CommonModule], exports: [PaginationComponent] });
365
+ GenericTablePaginationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTablePaginationModule, imports: [[CommonModule]] });
366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: GenericTablePaginationModule, decorators: [{
367
+ type: NgModule,
368
+ args: [{
369
+ declarations: [PaginationComponent],
370
+ imports: [CommonModule],
371
+ exports: [PaginationComponent],
372
+ }]
373
+ }] });
374
+
375
+ /*
376
+ * Public API Surface of core
377
+ */
378
+
379
+ /**
380
+ * Generated bundle index. Do not edit.
381
+ */
382
+
383
+ export { CoreComponent, CoreService, GenericTableCoreModule, GenericTablePaginationModule, PaginationComponent };
384
+ //# sourceMappingURL=angular-generic-table-core.mjs.map