@one-paragon/angular-utilities 0.3.10 → 0.3.11-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +16 -30
- package/src/action-state/action-state-spinner/action-state-spinner.component.css +16 -0
- package/src/action-state/action-state-spinner/action-state-spinner.component.html +6 -0
- package/src/action-state/action-state-spinner/action-state-spinner.component.spec.ts +25 -0
- package/src/action-state/action-state-spinner/action-state-spinner.component.ts +26 -0
- package/src/action-state/action-state-ui/action-state-ui.module.ts +13 -0
- package/{action-state/index.d.ts → src/action-state/index.ts} +8 -4
- package/src/action-state/ngrx-ext/ngrx-ext.module.ts +15 -0
- package/src/action-state/ngrx.ts +69 -0
- package/src/http-request-state/HttpRequestStateFactory.ts +29 -0
- package/src/http-request-state/HttpRequestStateStore.ts +147 -0
- package/src/http-request-state/directives/HttpStateDirectiveBase.ts +38 -0
- package/src/http-request-state/directives/http-error-state-directive.ts +32 -0
- package/src/http-request-state/directives/http-inProgress-state-directive.ts +32 -0
- package/src/http-request-state/directives/http-notStarted-state-directive.ts +31 -0
- package/src/http-request-state/directives/http-success-state-directive.ts +40 -0
- package/src/http-request-state/directives/request-state-directive.spec.ts +72 -0
- package/src/http-request-state/directives/request-state-directive.ts +79 -0
- package/src/http-request-state/helpers.ts +30 -0
- package/src/http-request-state/http-request-state.ts +69 -0
- package/src/http-request-state/http-state-module.ts +23 -0
- package/{http-request-state/index.d.ts → src/http-request-state/index.ts} +1 -1
- package/src/http-request-state/observable.spec.ts +43 -0
- package/src/http-request-state/rxjs/getRequestorBody.ts +10 -0
- package/src/http-request-state/rxjs/getRequestorState.ts +8 -0
- package/src/http-request-state/rxjs/tapError.ts +16 -0
- package/src/http-request-state/rxjs/tapSuccess.ts +16 -0
- package/src/http-request-state/strategies.spec.ts +42 -0
- package/src/http-request-state/types.ts +50 -0
- package/src/ngrx/actionable-selector.ts +95 -0
- package/src/ngrx/index.ts +1 -0
- package/{public-api.d.ts → src/public-api.ts} +35 -16
- package/src/rxjs/defaultShareReplay.ts +8 -0
- package/{rxjs/index.d.ts → src/rxjs/index.ts} +4 -4
- package/src/rxjs/mapError.ts +8 -0
- package/src/rxjs/rxjs-operators.ts +132 -0
- package/src/rxjs/subjectifier.ts +15 -0
- package/src/specs/clickSubject.spec.ts +95 -0
- package/src/specs/dialog.spec.ts +101 -0
- package/src/specs/toggleGroupDirective.spec.ts +229 -0
- package/src/table-builder/classes/DefaultSettings.ts +11 -0
- package/src/table-builder/classes/MatTableObservableDataSource.ts +23 -0
- package/src/table-builder/classes/TableBuilderConfig.ts +35 -0
- package/src/table-builder/classes/TableBuilderDataSource.ts +57 -0
- package/src/table-builder/classes/TableState.ts +83 -0
- package/src/table-builder/classes/filter-info.ts +131 -0
- package/src/table-builder/classes/table-builder-general-settings.ts +90 -0
- package/src/table-builder/classes/table-builder.ts +52 -0
- package/src/table-builder/classes/table-store.ts +394 -0
- package/src/table-builder/components/array-column.component.ts +36 -0
- package/src/table-builder/components/column-builder/column-builder.component.html +58 -0
- package/src/table-builder/components/column-builder/column-builder.component.scss +43 -0
- package/src/table-builder/components/column-builder/column-builder.component.spec.ts +49 -0
- package/src/table-builder/components/column-builder/column-builder.component.ts +117 -0
- package/src/table-builder/components/column-builder/column-helpers.ts +38 -0
- package/src/table-builder/components/date-filter/date-filter.component.html +23 -0
- package/src/table-builder/components/date-filter/date-filter.component.ts +24 -0
- package/src/table-builder/components/date-time-filter/date-time-filter.component.html +9 -0
- package/src/table-builder/components/date-time-filter/date-time-filter.component.ts +22 -0
- package/src/table-builder/components/filter/filter.component.html +88 -0
- package/src/table-builder/components/filter/filter.component.scss +64 -0
- package/src/table-builder/components/filter/filter.component.spec.ts +87 -0
- package/src/table-builder/components/filter/filter.component.ts +55 -0
- package/src/table-builder/components/filter/in-list/in-list-filter.component.ts +92 -0
- package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.html +55 -0
- package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.scss +57 -0
- package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.ts +55 -0
- package/src/table-builder/components/generic-table/generic-table.component.html +71 -0
- package/src/table-builder/components/generic-table/generic-table.component.scss +51 -0
- package/src/table-builder/components/generic-table/generic-table.component.ts +220 -0
- package/src/table-builder/components/generic-table/paginator.component.ts +94 -0
- package/src/table-builder/components/group-by-list/group-by-list.component.css +8 -0
- package/src/table-builder/components/group-by-list/group-by-list.component.html +12 -0
- package/src/table-builder/components/group-by-list/group-by-list.component.spec.ts +23 -0
- package/src/table-builder/components/group-by-list/group-by-list.component.ts +21 -0
- package/src/table-builder/components/header-menu/header-menu.component.html +98 -0
- package/src/table-builder/components/header-menu/header-menu.component.scss +96 -0
- package/src/table-builder/components/header-menu/header-menu.component.ts +98 -0
- package/src/table-builder/components/in-filter/in-filter.component.css +3 -0
- package/src/table-builder/components/in-filter/in-filter.component.html +20 -0
- package/src/table-builder/components/in-filter/in-filter.component.ts +64 -0
- package/{table-builder/components/index.d.ts → src/table-builder/components/index.ts} +9 -9
- package/src/table-builder/components/initialization-component/initialization-component.html +29 -0
- package/src/table-builder/components/initialization-component/initialization-component.ts +24 -0
- package/src/table-builder/components/link-column.component.ts +47 -0
- package/src/table-builder/components/number-filter/number-filter.component.css +10 -0
- package/src/table-builder/components/number-filter/number-filter.component.html +19 -0
- package/src/table-builder/components/number-filter/number-filter.component.spec.ts +30 -0
- package/src/table-builder/components/number-filter/number-filter.component.ts +25 -0
- package/src/table-builder/components/scroll-strategy.ts +82 -0
- package/src/table-builder/components/sort-menu/sort-menu.component-store.ts +62 -0
- package/src/table-builder/components/sort-menu/sort-menu.component.html +111 -0
- package/src/table-builder/components/sort-menu/sort-menu.component.scss +119 -0
- package/src/table-builder/components/sort-menu/sort-menu.component.ts +95 -0
- package/{table-builder/components/table-container/table-container-imports.d.ts → src/table-builder/components/table-container/table-container-imports.ts} +30 -14
- package/src/table-builder/components/table-container/table-container.css +45 -0
- package/src/table-builder/components/table-container/table-container.helpers/data-state.helpers.ts +141 -0
- package/src/table-builder/components/table-container/table-container.helpers/filter-state.helpers.ts +106 -0
- package/src/table-builder/components/table-container/table-container.helpers/groupBy.helpers.ts +69 -0
- package/src/table-builder/components/table-container/table-container.helpers/sort-state.helpers.ts +45 -0
- package/src/table-builder/components/table-container/table-container.html +117 -0
- package/src/table-builder/components/table-container/table-container.spec.ts +154 -0
- package/src/table-builder/components/table-container/table-container.ts +325 -0
- package/src/table-builder/components/table-container/tableProps.ts +18 -0
- package/src/table-builder/components/table-container/virtual-scroll-container.ts +126 -0
- package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.html +31 -0
- package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.ts +52 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.css +42 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.html +10 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.spec.ts +86 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.ts +38 -0
- package/src/table-builder/components/table-container-filter/table-wrapper-filter-store.ts +23 -0
- package/src/table-builder/directives/custom-cell-directive.ts +46 -0
- package/{table-builder/directives/index.d.ts → src/table-builder/directives/index.ts} +6 -5
- package/src/table-builder/directives/multi-sort.directive.spec.ts +124 -0
- package/src/table-builder/directives/multi-sort.directive.ts +49 -0
- package/src/table-builder/directives/resize-column.directive.ts +105 -0
- package/src/table-builder/directives/table-wrapper.directive.ts +14 -0
- package/src/table-builder/directives/tb-filter.directive.ts +370 -0
- package/src/table-builder/enums/filterTypes.ts +79 -0
- package/src/table-builder/functions/boolean-filter-function.ts +13 -0
- package/src/table-builder/functions/date-filter-function.ts +69 -0
- package/src/table-builder/functions/download-data.ts +11 -0
- package/src/table-builder/functions/null-filter-function.ts +9 -0
- package/src/table-builder/functions/number-filter-function.ts +42 -0
- package/src/table-builder/functions/sort-data-function.ts +23 -0
- package/src/table-builder/functions/string-filter-function.ts +52 -0
- package/{table-builder/interfaces/ColumnInfo.d.ts → src/table-builder/interfaces/ColumnInfo.ts} +3 -2
- package/src/table-builder/interfaces/column-template.ts +9 -0
- package/{table-builder/interfaces/dictionary.d.ts → src/table-builder/interfaces/dictionary.ts} +3 -3
- package/src/table-builder/interfaces/report-def.ts +153 -0
- package/src/table-builder/ngrx/tableBuilderStateStore.ts +143 -0
- package/src/table-builder/pipes/column-total.pipe.ts +17 -0
- package/src/table-builder/pipes/format-filter-type.pipe.ts +12 -0
- package/src/table-builder/pipes/format-filter-value.pipe.ts +41 -0
- package/src/table-builder/pipes/key-display.ts +16 -0
- package/src/table-builder/services/export-to-csv.service.ts +96 -0
- package/src/table-builder/services/link-creator.service.ts +68 -0
- package/src/table-builder/services/table-template-service.ts +55 -0
- package/src/table-builder/services/transform-creator.ts +92 -0
- package/src/table-builder/specs/table-custom-filters.spec.ts +262 -0
- package/src/table-builder/styles/collapser.styles.scss +15 -0
- package/src/table-builder/table-builder.module.ts +73 -0
- package/src/test.ts +17 -0
- package/src/utilities/array-helpers.ts +13 -0
- package/src/utilities/directives/auto-focus.directive.ts +20 -0
- package/src/utilities/directives/clickEmitterDirective.ts +16 -0
- package/src/utilities/directives/clickSubject.ts +20 -0
- package/src/utilities/directives/conditional-classes.directive.ts +36 -0
- package/src/utilities/directives/dialog-service.ts +19 -0
- package/src/utilities/directives/dialog.ts +142 -0
- package/src/utilities/directives/mat-toggle-group-directive.ts +61 -0
- package/src/utilities/directives/prevent-enter.directive.ts +13 -0
- package/src/utilities/directives/stop-propagation.directive.ts +20 -0
- package/src/utilities/directives/styler.ts +39 -0
- package/src/utilities/directives/trim-whitespace.directive.ts +21 -0
- package/{utilities/index.d.ts → src/utilities/index.ts} +22 -15
- package/src/utilities/module.ts +55 -0
- package/src/utilities/pipes/function.pipe.ts +16 -0
- package/src/utilities/pipes/phone.pipe.ts +15 -0
- package/src/utilities/pipes/space-case.pipes.spec.ts +47 -0
- package/src/utilities/pipes/space-case.pipes.ts +23 -0
- package/tsconfig.lib.json +19 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/action-state/action-state-spinner/action-state-spinner.component.d.ts +0 -12
- package/action-state/action-state-ui/action-state-ui.module.d.ts +0 -7
- package/action-state/ngrx-ext/ngrx-ext.module.d.ts +0 -8
- package/action-state/ngrx.d.ts +0 -31
- package/esm2022/action-state/action-state-spinner/action-state-spinner.component.mjs +0 -24
- package/esm2022/action-state/action-state-ui/action-state-ui.module.mjs +0 -20
- package/esm2022/action-state/index.mjs +0 -8
- package/esm2022/action-state/ngrx-ext/ngrx-ext.module.mjs +0 -23
- package/esm2022/action-state/ngrx.mjs +0 -42
- package/esm2022/http-request-state/HttpRequestStateFactory.mjs +0 -27
- package/esm2022/http-request-state/HttpRequestStateStore.mjs +0 -98
- package/esm2022/http-request-state/directives/HttpStateDirectiveBase.mjs +0 -34
- package/esm2022/http-request-state/directives/http-error-state-directive.mjs +0 -29
- package/esm2022/http-request-state/directives/http-inProgress-state-directive.mjs +0 -29
- package/esm2022/http-request-state/directives/http-notStarted-state-directive.mjs +0 -29
- package/esm2022/http-request-state/directives/http-success-state-directive.mjs +0 -34
- package/esm2022/http-request-state/directives/index.mjs +0 -6
- package/esm2022/http-request-state/directives/request-state-directive.mjs +0 -60
- package/esm2022/http-request-state/helpers.mjs +0 -22
- package/esm2022/http-request-state/http-request-state.mjs +0 -39
- package/esm2022/http-request-state/http-state-module.mjs +0 -40
- package/esm2022/http-request-state/index.mjs +0 -7
- package/esm2022/http-request-state/rxjs/getRequestorBody.mjs +0 -4
- package/esm2022/http-request-state/rxjs/getRequestorState.mjs +0 -3
- package/esm2022/http-request-state/rxjs/index.mjs +0 -5
- package/esm2022/http-request-state/rxjs/tapError.mjs +0 -12
- package/esm2022/http-request-state/rxjs/tapSuccess.mjs +0 -12
- package/esm2022/http-request-state/types.mjs +0 -16
- package/esm2022/ngrx/actionable-selector.mjs +0 -73
- package/esm2022/ngrx/index.mjs +0 -2
- package/esm2022/one-paragon-angular-utilities.mjs +0 -5
- package/esm2022/public-api.mjs +0 -20
- package/esm2022/rxjs/defaultShareReplay.mjs +0 -7
- package/esm2022/rxjs/index.mjs +0 -5
- package/esm2022/rxjs/mapError.mjs +0 -8
- package/esm2022/rxjs/rxjs-operators.mjs +0 -92
- package/esm2022/rxjs/subjectifier.mjs +0 -15
- package/esm2022/table-builder/classes/DefaultSettings.mjs +0 -6
- package/esm2022/table-builder/classes/MatTableObservableDataSource.mjs +0 -21
- package/esm2022/table-builder/classes/TableBuilderConfig.mjs +0 -18
- package/esm2022/table-builder/classes/TableBuilderDataSource.mjs +0 -50
- package/esm2022/table-builder/classes/TableState.mjs +0 -42
- package/esm2022/table-builder/classes/display-col.mjs +0 -2
- package/esm2022/table-builder/classes/filter-info.mjs +0 -73
- package/esm2022/table-builder/classes/table-builder-general-settings.mjs +0 -68
- package/esm2022/table-builder/classes/table-builder.mjs +0 -82
- package/esm2022/table-builder/classes/table-store.mjs +0 -314
- package/esm2022/table-builder/components/array-column.component.mjs +0 -78
- package/esm2022/table-builder/components/column-builder/column-builder.component.mjs +0 -118
- package/esm2022/table-builder/components/date-filter/date-filter.component.mjs +0 -29
- package/esm2022/table-builder/components/date-time-filter/date-time-filter.component.mjs +0 -24
- package/esm2022/table-builder/components/filter/filter.component.mjs +0 -66
- package/esm2022/table-builder/components/filter/in-list/in-list-filter.component.mjs +0 -101
- package/esm2022/table-builder/components/gen-col-displayer/gen-col-displayer.component.mjs +0 -52
- package/esm2022/table-builder/components/generic-table/generic-table.component.mjs +0 -205
- package/esm2022/table-builder/components/generic-table/paginator.component.mjs +0 -79
- package/esm2022/table-builder/components/group-by-list/group-by-list.component.mjs +0 -23
- package/esm2022/table-builder/components/header-menu/header-menu.component.mjs +0 -101
- package/esm2022/table-builder/components/in-filter/in-filter.component.mjs +0 -64
- package/esm2022/table-builder/components/index.mjs +0 -10
- package/esm2022/table-builder/components/initialization-component/initialization-component.mjs +0 -36
- package/esm2022/table-builder/components/link-column.component.mjs +0 -73
- package/esm2022/table-builder/components/number-filter/number-filter.component.mjs +0 -29
- package/esm2022/table-builder/components/scroll-strategy.mjs +0 -63
- package/esm2022/table-builder/components/sort-menu/sort-menu.component-store.mjs +0 -43
- package/esm2022/table-builder/components/sort-menu/sort-menu.component.mjs +0 -81
- package/esm2022/table-builder/components/table-container/table-container-imports.mjs +0 -26
- package/esm2022/table-builder/components/table-container/table-container.helpers/data-state.helpers.mjs +0 -2
- package/esm2022/table-builder/components/table-container/table-container.helpers/filter-state.helpers.mjs +0 -62
- package/esm2022/table-builder/components/table-container/table-container.helpers/groupBy.helpers.mjs +0 -56
- package/esm2022/table-builder/components/table-container/table-container.helpers/sort-state.helpers.mjs +0 -36
- package/esm2022/table-builder/components/table-container/table-container.mjs +0 -337
- package/esm2022/table-builder/components/table-container/tableProps.mjs +0 -9
- package/esm2022/table-builder/components/table-container/virtual-scroll-container.mjs +0 -101
- package/esm2022/table-builder/components/table-container-filter/filter-list/filter-list.component.mjs +0 -47
- package/esm2022/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.mjs +0 -36
- package/esm2022/table-builder/components/table-container-filter/table-wrapper-filter-store.mjs +0 -25
- package/esm2022/table-builder/components/table-context.mjs +0 -2
- package/esm2022/table-builder/directives/custom-cell-directive.mjs +0 -60
- package/esm2022/table-builder/directives/index.mjs +0 -6
- package/esm2022/table-builder/directives/multi-sort.directive.mjs +0 -50
- package/esm2022/table-builder/directives/resize-column.directive.mjs +0 -87
- package/esm2022/table-builder/directives/table-wrapper.directive.mjs +0 -20
- package/esm2022/table-builder/directives/tb-filter.directive.mjs +0 -410
- package/esm2022/table-builder/enums/filterTypes.mjs +0 -72
- package/esm2022/table-builder/functions/boolean-filter-function.mjs +0 -10
- package/esm2022/table-builder/functions/date-filter-function.mjs +0 -58
- package/esm2022/table-builder/functions/download-data.mjs +0 -12
- package/esm2022/table-builder/functions/null-filter-function.mjs +0 -8
- package/esm2022/table-builder/functions/number-filter-function.mjs +0 -32
- package/esm2022/table-builder/functions/sort-data-function.mjs +0 -17
- package/esm2022/table-builder/functions/string-filter-function.mjs +0 -41
- package/esm2022/table-builder/interfaces/ColumnInfo.mjs +0 -2
- package/esm2022/table-builder/interfaces/dictionary.mjs +0 -2
- package/esm2022/table-builder/interfaces/report-def.mjs +0 -35
- package/esm2022/table-builder/ngrx/tableBuilderStateStore.mjs +0 -115
- package/esm2022/table-builder/pipes/column-total.pipe.mjs +0 -22
- package/esm2022/table-builder/pipes/format-filter-type.pipe.mjs +0 -18
- package/esm2022/table-builder/pipes/format-filter-value.pipe.mjs +0 -45
- package/esm2022/table-builder/pipes/key-display.mjs +0 -20
- package/esm2022/table-builder/services/export-to-csv.service.mjs +0 -88
- package/esm2022/table-builder/services/link-creator.service.mjs +0 -42
- package/esm2022/table-builder/services/table-template-service.mjs +0 -44
- package/esm2022/table-builder/services/transform-creator.mjs +0 -78
- package/esm2022/table-builder/table-builder.module.mjs +0 -124
- package/esm2022/utilities/array-helpers.mjs +0 -14
- package/esm2022/utilities/directives/auto-focus.directive.mjs +0 -27
- package/esm2022/utilities/directives/clickEmitterDirective.mjs +0 -22
- package/esm2022/utilities/directives/clickSubject.mjs +0 -28
- package/esm2022/utilities/directives/conditional-classes.directive.mjs +0 -36
- package/esm2022/utilities/directives/dialog-service.mjs +0 -23
- package/esm2022/utilities/directives/dialog.mjs +0 -138
- package/esm2022/utilities/directives/mat-toggle-group-directive.mjs +0 -60
- package/esm2022/utilities/directives/prevent-enter.directive.mjs +0 -20
- package/esm2022/utilities/directives/stop-propagation.directive.mjs +0 -26
- package/esm2022/utilities/directives/styler.mjs +0 -42
- package/esm2022/utilities/directives/trim-whitespace.directive.mjs +0 -30
- package/esm2022/utilities/index.mjs +0 -16
- package/esm2022/utilities/module.mjs +0 -90
- package/esm2022/utilities/pipes/function.pipe.mjs +0 -22
- package/esm2022/utilities/pipes/phone.pipe.mjs +0 -20
- package/esm2022/utilities/pipes/space-case.pipes.mjs +0 -28
- package/fesm2022/one-paragon-angular-utilities.mjs +0 -5045
- package/fesm2022/one-paragon-angular-utilities.mjs.map +0 -1
- package/http-request-state/HttpRequestStateFactory.d.ts +0 -15
- package/http-request-state/HttpRequestStateStore.d.ts +0 -49
- package/http-request-state/directives/HttpStateDirectiveBase.d.ts +0 -16
- package/http-request-state/directives/http-error-state-directive.d.ts +0 -12
- package/http-request-state/directives/http-inProgress-state-directive.d.ts +0 -12
- package/http-request-state/directives/http-notStarted-state-directive.d.ts +0 -12
- package/http-request-state/directives/http-success-state-directive.d.ts +0 -21
- package/http-request-state/directives/request-state-directive.d.ts +0 -35
- package/http-request-state/helpers.d.ts +0 -9
- package/http-request-state/http-request-state.d.ts +0 -12
- package/http-request-state/http-state-module.d.ts +0 -11
- package/http-request-state/rxjs/getRequestorBody.d.ts +0 -3
- package/http-request-state/rxjs/getRequestorState.d.ts +0 -3
- package/http-request-state/rxjs/tapError.d.ts +0 -3
- package/http-request-state/rxjs/tapSuccess.d.ts +0 -3
- package/http-request-state/types.d.ts +0 -36
- package/index.d.ts +0 -5
- package/ngrx/actionable-selector.d.ts +0 -17
- package/ngrx/index.d.ts +0 -1
- package/rxjs/defaultShareReplay.d.ts +0 -2
- package/rxjs/mapError.d.ts +0 -2
- package/rxjs/rxjs-operators.d.ts +0 -13
- package/rxjs/subjectifier.d.ts +0 -9
- package/table-builder/classes/DefaultSettings.d.ts +0 -9
- package/table-builder/classes/MatTableObservableDataSource.d.ts +0 -9
- package/table-builder/classes/TableBuilderConfig.d.ts +0 -21
- package/table-builder/classes/TableBuilderDataSource.d.ts +0 -13
- package/table-builder/classes/TableState.d.ts +0 -55
- package/table-builder/classes/filter-info.d.ts +0 -127
- package/table-builder/classes/table-builder-general-settings.d.ts +0 -43
- package/table-builder/classes/table-builder.d.ts +0 -14
- package/table-builder/classes/table-store.d.ts +0 -124
- package/table-builder/components/array-column.component.d.ts +0 -14
- package/table-builder/components/column-builder/column-builder.component.d.ts +0 -54
- package/table-builder/components/date-filter/date-filter.component.d.ts +0 -10
- package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +0 -10
- package/table-builder/components/filter/filter.component.d.ts +0 -112
- package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +0 -27
- package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +0 -16
- package/table-builder/components/generic-table/generic-table.component.d.ts +0 -69
- package/table-builder/components/generic-table/paginator.component.d.ts +0 -27
- package/table-builder/components/group-by-list/group-by-list.component.d.ts +0 -7
- package/table-builder/components/header-menu/header-menu.component.d.ts +0 -25
- package/table-builder/components/in-filter/in-filter.component.d.ts +0 -21
- package/table-builder/components/initialization-component/initialization-component.d.ts +0 -12
- package/table-builder/components/link-column.component.d.ts +0 -17
- package/table-builder/components/number-filter/number-filter.component.d.ts +0 -12
- package/table-builder/components/scroll-strategy.d.ts +0 -23
- package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +0 -24
- package/table-builder/components/sort-menu/sort-menu.component.d.ts +0 -25
- package/table-builder/components/table-container/table-container.d.ts +0 -75
- package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +0 -5
- package/table-builder/components/table-container/table-container.helpers/filter-state.helpers.d.ts +0 -15
- package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +0 -15
- package/table-builder/components/table-container/table-container.helpers/sort-state.helpers.d.ts +0 -9
- package/table-builder/components/table-container/tableProps.d.ts +0 -11
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +0 -17
- package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +0 -16
- package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +0 -14
- package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +0 -14
- package/table-builder/components/table-context.d.ts +0 -10
- package/table-builder/directives/custom-cell-directive.d.ts +0 -19
- package/table-builder/directives/multi-sort.directive.d.ts +0 -11
- package/table-builder/directives/resize-column.directive.d.ts +0 -43
- package/table-builder/directives/table-wrapper.directive.d.ts +0 -8
- package/table-builder/directives/tb-filter.directive.d.ts +0 -120
- package/table-builder/enums/filterTypes.d.ts +0 -77
- package/table-builder/functions/boolean-filter-function.d.ts +0 -3
- package/table-builder/functions/date-filter-function.d.ts +0 -4
- package/table-builder/functions/download-data.d.ts +0 -1
- package/table-builder/functions/null-filter-function.d.ts +0 -2
- package/table-builder/functions/number-filter-function.d.ts +0 -4
- package/table-builder/functions/sort-data-function.d.ts +0 -6
- package/table-builder/functions/string-filter-function.d.ts +0 -7
- package/table-builder/interfaces/report-def.d.ts +0 -147
- package/table-builder/ngrx/tableBuilderStateStore.d.ts +0 -62
- package/table-builder/pipes/column-total.pipe.d.ts +0 -8
- package/table-builder/pipes/format-filter-type.pipe.d.ts +0 -8
- package/table-builder/pipes/format-filter-value.pipe.d.ts +0 -14
- package/table-builder/pipes/key-display.d.ts +0 -11
- package/table-builder/services/export-to-csv.service.d.ts +0 -22
- package/table-builder/services/link-creator.service.d.ts +0 -12
- package/table-builder/services/table-template-service.d.ts +0 -14
- package/table-builder/services/transform-creator.d.ts +0 -19
- package/table-builder/table-builder.module.d.ts +0 -21
- package/utilities/array-helpers.d.ts +0 -1
- package/utilities/directives/auto-focus.directive.d.ts +0 -10
- package/utilities/directives/clickEmitterDirective.d.ts +0 -7
- package/utilities/directives/clickSubject.d.ts +0 -9
- package/utilities/directives/conditional-classes.directive.d.ts +0 -14
- package/utilities/directives/dialog-service.d.ts +0 -10
- package/utilities/directives/dialog.d.ts +0 -46
- package/utilities/directives/mat-toggle-group-directive.d.ts +0 -21
- package/utilities/directives/prevent-enter.directive.d.ts +0 -6
- package/utilities/directives/stop-propagation.directive.d.ts +0 -7
- package/utilities/directives/styler.d.ts +0 -16
- package/utilities/directives/trim-whitespace.directive.d.ts +0 -9
- package/utilities/module.d.ts +0 -19
- package/utilities/pipes/function.pipe.d.ts +0 -7
- package/utilities/pipes/phone.pipe.d.ts +0 -7
- package/utilities/pipes/space-case.pipes.d.ts +0 -17
- /package/{http-request-state/directives/index.d.ts → src/http-request-state/directives/index.ts} +0 -0
- /package/{http-request-state/rxjs/index.d.ts → src/http-request-state/rxjs/index.ts} +0 -0
- /package/{table-builder/classes/display-col.d.ts → src/table-builder/classes/display-col.ts} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@if(columns$ | async; as displayCols){
|
|
2
|
+
<span matTooltip="Show/hide columns">
|
|
3
|
+
<button mat-icon-button [matMenuTriggerFor]="menu">
|
|
4
|
+
<mat-icon color="primary">visibility_off</mat-icon>
|
|
5
|
+
</button>
|
|
6
|
+
</span>
|
|
7
|
+
<mat-menu #menu="matMenu" class="my-mat-menu">
|
|
8
|
+
|
|
9
|
+
<button mat-menu-item>
|
|
10
|
+
<span matTooltip="Close">
|
|
11
|
+
<button class="filter-button" mat-icon-button>
|
|
12
|
+
<mat-icon>close</mat-icon>
|
|
13
|
+
</button>
|
|
14
|
+
</span>
|
|
15
|
+
</button>
|
|
16
|
+
|
|
17
|
+
<button mat-menu-item stop-propagation>
|
|
18
|
+
<span matTooltip="Show all columns">
|
|
19
|
+
<button mat-icon-button (click)="reset(displayCols)">
|
|
20
|
+
<mat-icon color="primary">done_all</mat-icon>
|
|
21
|
+
</button>
|
|
22
|
+
</span>
|
|
23
|
+
|
|
24
|
+
<span matTooltip="Hide all columns">
|
|
25
|
+
<button mat-icon-button (click)="unset(displayCols)">
|
|
26
|
+
<mat-icon color="primary">cancel</mat-icon>
|
|
27
|
+
</button>
|
|
28
|
+
</span>
|
|
29
|
+
</button>
|
|
30
|
+
|
|
31
|
+
<div cdkDropList (cdkDropListDropped)="drop($event)" stop-propagation [cdkDropListLockAxis]="'y'">
|
|
32
|
+
@for (col of displayCols; track col.key) {
|
|
33
|
+
<button [class.isHidden]="!col.isVisible" stop-propagation mat-menu-item cdkDrag [cdkDragData]="col">
|
|
34
|
+
<div (click)="col.isVisible = !col.isVisible; emit(displayCols)" style="display: flex; align-items: center;">
|
|
35
|
+
@if(col.isVisible){
|
|
36
|
+
<button mat-icon-button matTooltip="Hide Column" class="show-hide">
|
|
37
|
+
<mat-icon color="primary">check_box</mat-icon>
|
|
38
|
+
</button>
|
|
39
|
+
} @else {
|
|
40
|
+
<button mat-icon-button matTooltip="Show Column" class="show-hide">
|
|
41
|
+
<mat-icon>indeterminate_check_box</mat-icon>
|
|
42
|
+
</button>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
<p class="label">
|
|
46
|
+
{{col.displayName || (col.key | spaceCase) }}
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
</button>
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
</mat-menu>
|
|
55
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.show-hide {
|
|
2
|
+
margin-right: 15px;
|
|
3
|
+
height: 24px;
|
|
4
|
+
width: 24px;
|
|
5
|
+
padding: 4px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.label {
|
|
9
|
+
color: cornflowerblue;
|
|
10
|
+
text-overflow: ellipsis;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
text-align: left;
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-size: 17px;
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
width: 66%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.row {
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.isHidden {
|
|
27
|
+
background-color: lightgrey;
|
|
28
|
+
color: darkgray;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
font-size: 17px;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.filter-button {
|
|
35
|
+
margin-top: 10px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cdk-drag-preview {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
border-radius: 4px;
|
|
41
|
+
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
|
|
42
|
+
0 8px 10px 1px rgba(0, 0, 0, 0.14),
|
|
43
|
+
0 3px 14px 2px rgba(0, 0, 0, 0.12);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.cdk-drag-placeholder {
|
|
47
|
+
opacity: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.cdk-drag-animating {
|
|
51
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
52
|
+
}
|
|
53
|
+
.mdc-list-item__primary-text{
|
|
54
|
+
display: inline-block;
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy} from '@angular/core';
|
|
2
|
+
import { DisplayCol } from '../../classes/display-col';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { map } from 'rxjs/operators';
|
|
5
|
+
import { orderViewableMetaData, TableStore } from '../../classes/table-store';
|
|
6
|
+
import {CdkDragDrop, DragDropModule} from '@angular/cdk/drag-drop';
|
|
7
|
+
import { AsyncPipe } from '@angular/common';
|
|
8
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
9
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
11
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
12
|
+
import { SpaceCasePipe, StopPropagationDirective } from '../../../utilities';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'tb-col-displayer',
|
|
16
|
+
templateUrl: './gen-col-displayer.component.html',
|
|
17
|
+
styleUrls: ['./gen-col-displayer.component.scss'],
|
|
18
|
+
changeDetection: ChangeDetectionStrategy.OnPush ,
|
|
19
|
+
standalone: true,
|
|
20
|
+
imports: [
|
|
21
|
+
AsyncPipe, MatTooltipModule, MatIconModule, MatButtonModule, MatMenuModule, StopPropagationDirective,
|
|
22
|
+
DragDropModule, SpaceCasePipe
|
|
23
|
+
]
|
|
24
|
+
})
|
|
25
|
+
export class GenColDisplayerComponent {
|
|
26
|
+
columns$: Observable< DisplayCol[]>;
|
|
27
|
+
constructor( private tableState: TableStore ) {
|
|
28
|
+
this.columns$ = this.tableState.state$.pipe(
|
|
29
|
+
map( state =>
|
|
30
|
+
orderViewableMetaData(state)
|
|
31
|
+
.map( md => ({
|
|
32
|
+
key: md.key,
|
|
33
|
+
displayName: md.displayName,
|
|
34
|
+
isVisible: !state.hiddenKeys.includes(md.key)
|
|
35
|
+
}))
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
reset(displayCols: DisplayCol[]) {
|
|
41
|
+
displayCols.forEach(c => c.isVisible = true);
|
|
42
|
+
this.emit(displayCols);
|
|
43
|
+
}
|
|
44
|
+
drop(event: CdkDragDrop<string[]>) {
|
|
45
|
+
this.tableState.setUserDefinedOrder({newOrder:event.currentIndex,oldOrder:event.previousIndex})
|
|
46
|
+
}
|
|
47
|
+
unset(displayCols: DisplayCol[]) {
|
|
48
|
+
displayCols.forEach(c => c.isVisible = false);
|
|
49
|
+
this.emit(displayCols);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
emit(displayCols: DisplayCol[]) {
|
|
53
|
+
this.tableState.setHiddenColumns(displayCols.map( c => ({key: c.key, visible: c.isVisible})));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<mat-table
|
|
2
|
+
cdkDropList
|
|
3
|
+
cdkDropListLockAxis='x'
|
|
4
|
+
cdkDropListOrientation="horizontal"
|
|
5
|
+
(cdkDropListDropped)="drop($event)"
|
|
6
|
+
class="table-drag-list"
|
|
7
|
+
[class]="(showFooterRow$ | async)"
|
|
8
|
+
#table
|
|
9
|
+
[dataSource]="state.props().dataSource!"
|
|
10
|
+
[trackBy]="trackByFunction"
|
|
11
|
+
[style]="tableWidth | async"
|
|
12
|
+
>
|
|
13
|
+
|
|
14
|
+
<!-- select column -->
|
|
15
|
+
<ng-container matColumnDef="select">
|
|
16
|
+
|
|
17
|
+
<mat-header-cell *matHeaderCellDef class="f-mat-header-cell">
|
|
18
|
+
<mat-checkbox (change)="$event ? masterToggle() : null"
|
|
19
|
+
[checked]="!!(masterToggleChecked$ | async)"
|
|
20
|
+
[indeterminate]="masterToggleIndeterminate$ | async">
|
|
21
|
+
</mat-checkbox>
|
|
22
|
+
</mat-header-cell>
|
|
23
|
+
|
|
24
|
+
<mat-cell *matCellDef="let row">
|
|
25
|
+
<mat-checkbox
|
|
26
|
+
(click)="$event.stopPropagation()"
|
|
27
|
+
(change)="$event ? selection.toggle(row) : null"
|
|
28
|
+
[checked]="selection.isSelected(row)"/>
|
|
29
|
+
</mat-cell>
|
|
30
|
+
|
|
31
|
+
<mat-footer-cell *matFooterCellDef>
|
|
32
|
+
{{ selection.selected.length }}
|
|
33
|
+
</mat-footer-cell>
|
|
34
|
+
</ng-container>
|
|
35
|
+
|
|
36
|
+
<!-- index column -->
|
|
37
|
+
<ng-container matColumnDef="index">
|
|
38
|
+
<mat-header-cell *matHeaderCellDef class="f-mat-header-cell" >#</mat-header-cell>
|
|
39
|
+
<mat-cell *matCellDef="let i = index;">
|
|
40
|
+
{{ 1 + i + offsetIndex}}
|
|
41
|
+
</mat-cell>
|
|
42
|
+
<mat-footer-cell *matFooterCellDef></mat-footer-cell>
|
|
43
|
+
</ng-container>
|
|
44
|
+
|
|
45
|
+
<!-- Grouping -->
|
|
46
|
+
<ng-container matColumnDef="groupHeader">
|
|
47
|
+
<mat-cell *matCellDef="let row">
|
|
48
|
+
<div [style.paddingLeft]="row.padding + 'px !important'" *ngrxLet="(state.getIsExpanded | func : row.key : row.groupName ) as expanded">
|
|
49
|
+
<button mat-icon-button (click)="setExpanded(row.key, row.groupName, !expanded);">
|
|
50
|
+
@if(!expanded){
|
|
51
|
+
<mat-icon>chevron_right</mat-icon>
|
|
52
|
+
} @else {
|
|
53
|
+
<mat-icon>expand_more</mat-icon>
|
|
54
|
+
}
|
|
55
|
+
</button>
|
|
56
|
+
{{getTransform | func : row.key : row.groupHeaderDisplay}} ({{row.length}})
|
|
57
|
+
</div>
|
|
58
|
+
<div style="flex-grow: 1">
|
|
59
|
+
<ng-container *ngTemplateOutlet="state.props().groupHeaderTemplate!; context: { element: row }"></ng-container>
|
|
60
|
+
</div>
|
|
61
|
+
</mat-cell>
|
|
62
|
+
</ng-container>
|
|
63
|
+
|
|
64
|
+
@if(showHeader$ | async){
|
|
65
|
+
<mat-header-row *matHeaderRowDef="keys; sticky: state.props().isSticky" [style.top.px]="((offset$ | async)! * -1)" />
|
|
66
|
+
}
|
|
67
|
+
<mat-row *matRowDef="let row; columns: keys; let i = index" />
|
|
68
|
+
<mat-row *matRowDef="let row; columns: ['groupHeader']; when: isGroupHeader" style="background-color: white;" />
|
|
69
|
+
<mat-footer-row *matFooterRowDef="(showFooterRow$ | async) === 'regular-footer' ? keys : []; sticky: state.props().stickyFooter " [style.bottom.px]="state.props().stickyFooter ? (offset$ | async) : undefined" />
|
|
70
|
+
|
|
71
|
+
</mat-table>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
.mat-mdc-row:nth-child(odd) {
|
|
3
|
+
background-color: #cdeefe
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.page-amounts{
|
|
7
|
+
color: rgba(0, 0, 0, 0.54);
|
|
8
|
+
font-family: Roboto, "Helvetica Neue", sans-serif;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
margin-right: .2rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
:host::ng-deep.mat-mdc-paginator-container {
|
|
16
|
+
min-height: initial !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.group-header {
|
|
20
|
+
display: flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder) {
|
|
24
|
+
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
|
|
25
|
+
}
|
|
26
|
+
:host::ng-deep{
|
|
27
|
+
& .mdc-data-table__cell, .mdc-data-table__header-cell, .mdc-data-table__cell, .mdc-data-table__header-cell{
|
|
28
|
+
padding: 0 0 0 .2rem;
|
|
29
|
+
line-height: normal;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
::ng-deep .op-date-time-input{
|
|
33
|
+
line-height: 3rem;
|
|
34
|
+
font-size: .9rem;
|
|
35
|
+
font-family: Roboto, "Helvetica Neue", sans-serif;
|
|
36
|
+
padding-left: 0.2rem;
|
|
37
|
+
width: 12rem;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.small-footer{
|
|
42
|
+
mat-footer-row{
|
|
43
|
+
min-height: 1rem;
|
|
44
|
+
height: 1rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.no-footer{
|
|
48
|
+
mat-footer-row{
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ViewChild,
|
|
4
|
+
Input,
|
|
5
|
+
ChangeDetectionStrategy,
|
|
6
|
+
Output,
|
|
7
|
+
SimpleChanges,
|
|
8
|
+
OnInit,
|
|
9
|
+
QueryList,
|
|
10
|
+
ViewContainerRef,
|
|
11
|
+
Injector,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { MatRowDef, MatTable, MatTableModule } from '@angular/material/table';
|
|
14
|
+
import { Observable, combineLatest } from 'rxjs';
|
|
15
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
16
|
+
import { TableStore } from '../../classes/table-store';
|
|
17
|
+
import { map, distinctUntilChanged } from 'rxjs/operators';
|
|
18
|
+
import { ColumnBuilderComponent } from '../column-builder/column-builder.component';
|
|
19
|
+
import { Dictionary } from '../../interfaces/dictionary';
|
|
20
|
+
import { FieldType } from '../../interfaces/report-def';
|
|
21
|
+
import { previousAndCurrent } from '../../../rxjs/rxjs-operators';
|
|
22
|
+
import { ColumnInfo } from '../../interfaces/ColumnInfo';
|
|
23
|
+
import { CdkDragDrop, CdkDropList, DragDropModule } from '@angular/cdk/drag-drop';
|
|
24
|
+
import { FunctionPipe } from '../../../utilities';
|
|
25
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
26
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
27
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
28
|
+
import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
|
|
29
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
30
|
+
import { LetDirective } from '@ngrx/component';
|
|
31
|
+
import { TransformCreator } from '../../services/transform-creator';
|
|
32
|
+
import { initIndexSymbol } from '../table-container/table-container.helpers/sort-state.helpers';
|
|
33
|
+
|
|
34
|
+
@Component({
|
|
35
|
+
selector: 'tb-generic-table',
|
|
36
|
+
templateUrl: './generic-table.component.html',
|
|
37
|
+
styleUrls: ['./generic-table.component.scss'],
|
|
38
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
39
|
+
standalone: true,
|
|
40
|
+
imports: [
|
|
41
|
+
MatTableModule, DragDropModule, MatCheckboxModule, MatButtonModule, MatIconModule, NgTemplateOutlet,
|
|
42
|
+
MatTooltipModule, AsyncPipe, LetDirective, FunctionPipe,
|
|
43
|
+
],
|
|
44
|
+
})
|
|
45
|
+
export class GenericTableComponent implements OnInit {
|
|
46
|
+
|
|
47
|
+
drop(event: CdkDragDrop<string[]>) {
|
|
48
|
+
this.state.setUserDefinedOrder({newOrder:event.currentIndex,oldOrder:event.previousIndex})
|
|
49
|
+
}
|
|
50
|
+
@Input() set trackBy(trackBy: string){
|
|
51
|
+
if(trackBy){
|
|
52
|
+
this.trackByFunction = (index:number, item: any) => item[trackBy];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@Input() displayData$!: Observable<any[]>;
|
|
56
|
+
@Input() data$!: Observable<any[]>;
|
|
57
|
+
@Input() rows!: QueryList<MatRowDef<any>>;
|
|
58
|
+
@Input() columnBuilders!: ColumnBuilderComponent[];
|
|
59
|
+
@Input() columnInfos!: Observable<ColumnInfo[]>;
|
|
60
|
+
|
|
61
|
+
@ViewChild(MatTable, { static: true }) table!: MatTable<any>;
|
|
62
|
+
@ViewChild(CdkDropList, { static: true }) dropList!: CdkDropList;
|
|
63
|
+
|
|
64
|
+
currentColumns!: string[];
|
|
65
|
+
keys: string [] = [];
|
|
66
|
+
injector: Injector;
|
|
67
|
+
rowDefArr :MatRowDef<any>[] = [];
|
|
68
|
+
columns:string [] = [];
|
|
69
|
+
myColumns: Dictionary<ColumnBuilderComponent> = {};
|
|
70
|
+
showHeader$!: Observable<boolean>;
|
|
71
|
+
offset$! : Observable<number>;
|
|
72
|
+
offsetIndex = 0;
|
|
73
|
+
dataView!: Observable<any[]>;
|
|
74
|
+
|
|
75
|
+
constructor(
|
|
76
|
+
public state: TableStore,
|
|
77
|
+
private viewContainer: ViewContainerRef,
|
|
78
|
+
private transformCreator: TransformCreator,
|
|
79
|
+
injector: Injector,
|
|
80
|
+
) {
|
|
81
|
+
this.injector = Injector.create({
|
|
82
|
+
providers: [
|
|
83
|
+
{provide: MatTable, useFactory: ()=> this.table },
|
|
84
|
+
{provide: CdkDropList, useFactory: ()=> this.dropList },
|
|
85
|
+
],
|
|
86
|
+
parent: injector
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
this.offset$ = this.state.select( s => s.virtualScrollOffset );
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
defaultTrackBy = (index:number, item: any) => item[initIndexSymbol];
|
|
93
|
+
trackByFunction = this.defaultTrackBy;
|
|
94
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
95
|
+
if (changes.rows && this.rows && this.myColumns.length) {
|
|
96
|
+
this.initializeRowDefs([...this.rows]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
ngOnInit() {
|
|
101
|
+
if (this.state.props().selectionColumn) {
|
|
102
|
+
this.columns.push('select');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (this.state.props().indexColumn) {
|
|
106
|
+
this.columns.push('index');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this.state.on(this.columnInfos, columns => {
|
|
110
|
+
columns.forEach(ci => this.addMetaData(ci))
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
this.initializeRowDefs([...this.rows]);
|
|
114
|
+
|
|
115
|
+
this.state.on(this.state.displayedColumns$, keys => {
|
|
116
|
+
this.keys = [...this.columns, ...keys];
|
|
117
|
+
this.rowDefArr?.forEach(row => row.columns = this.keys)
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
this.showHeader$ = this.state.tableSettings$.pipe(map(settings => !(settings.hideColumnHeader)));
|
|
121
|
+
|
|
122
|
+
this.showFooterRow$ = combineLatest([
|
|
123
|
+
this.displayData$.pipe(map(d => !!d.length), distinctUntilChanged()),
|
|
124
|
+
this.state.metaDataArray$.pipe(map(metaData => metaData.some(md => !!md.additional?.footer)), distinctUntilChanged()),
|
|
125
|
+
this.columnInfos.pipe(map(columnInfos => columnInfos.some(ci => !!ci.customCell?.columnDef?.footerCell)), distinctUntilChanged()),
|
|
126
|
+
]).pipe(map(([hasData, hasFooterDef, hasCustomFooter]) => {
|
|
127
|
+
const hasSelectionColumn = this.state.props().selectionColumn;
|
|
128
|
+
return hasCustomFooter || (hasData && (hasFooterDef || hasSelectionColumn)) ? 'regular-footer' : hasData ? 'no-footer' : 'small-footer';
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
if(this.state.tableSettings().usePaginator || this.state.tableSettings().useVirtualScroll) {
|
|
132
|
+
this.state.on(this.state.state$, (state) => {
|
|
133
|
+
this.offsetIndex = state.virtualStart;
|
|
134
|
+
if(this.state.tableSettings().usePaginator) {
|
|
135
|
+
this.offsetIndex += (state.pageSize * state.currentPage);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
isGroupHeader(_: number, row: { isGroupHeader: boolean }) {
|
|
143
|
+
return row.isGroupHeader;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
setExpanded(key: string, groupKey: string, isExpanded: boolean): void {
|
|
147
|
+
this.state.updateExpandedGroups({ key , isExpanded, groupKey });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
addMetaData(column: ColumnInfo) {
|
|
151
|
+
const columnBuilder = this.myColumns[column.metaData.key];
|
|
152
|
+
if(columnBuilder) {
|
|
153
|
+
columnBuilder.metaData = column.metaData;
|
|
154
|
+
} else {
|
|
155
|
+
const component = this.viewContainer.createComponent(ColumnBuilderComponent, {
|
|
156
|
+
index: 0,
|
|
157
|
+
injector: this.injector
|
|
158
|
+
});
|
|
159
|
+
component.instance.customCell = column.customCell;
|
|
160
|
+
component.instance.metaData = column.metaData;
|
|
161
|
+
component.instance.data$ = this.data$;
|
|
162
|
+
this.myColumns[column.metaData.key] = component.instance;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
initializeRowDefs = (defs:MatRowDef<any>[])=>{
|
|
167
|
+
this.rowDefArr.forEach(r=>this.table.removeRowDef(r));
|
|
168
|
+
this.rowDefArr = defs;
|
|
169
|
+
defs.forEach(r => {
|
|
170
|
+
r.columns = this.columns.concat(Object.values(this.myColumns).filter(c => c.metaData.fieldType !== FieldType.Hidden).map(c => c.metaData.key));
|
|
171
|
+
if (this.table) {
|
|
172
|
+
this.table.addRowDef(r);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
selection : SelectionModel<any> = new SelectionModel<any>(true, []);
|
|
178
|
+
@Output() selection$: Observable<any> = this.selection.changed;
|
|
179
|
+
masterToggleChecked$ = this.selection$.pipe(map(()=>this.selection.hasValue() && this.isAllSelected()));
|
|
180
|
+
masterToggleIndeterminate$ = this.selection$.pipe(map(()=>this.selection.hasValue() && !this.isAllSelected()));
|
|
181
|
+
|
|
182
|
+
isAllSelected() {
|
|
183
|
+
const numSelected = this.selection.selected.length;
|
|
184
|
+
const numRows = this.state.props().dataSource?.data.length;
|
|
185
|
+
return numSelected === numRows;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Selects all rows if they are not all selected; otherwise clear selection. */
|
|
189
|
+
masterToggle() {
|
|
190
|
+
this.isAllSelected() ?
|
|
191
|
+
this.selection.clear() :
|
|
192
|
+
this.selection.select(...this.state.props().dataSource!.data);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
tableWidth = this.state.getUserDefinedTableSize$.pipe(
|
|
196
|
+
previousAndCurrent<number | undefined>(0),
|
|
197
|
+
map(([previousUserDefinedWidth, currentUserDefinedWidth]) => {
|
|
198
|
+
if( currentUserDefinedWidth){
|
|
199
|
+
return ({width:`${currentUserDefinedWidth}px`});
|
|
200
|
+
} if( wasReset() ){
|
|
201
|
+
return ({width:'initial'});
|
|
202
|
+
}
|
|
203
|
+
return ({});
|
|
204
|
+
|
|
205
|
+
function wasReset(){
|
|
206
|
+
return (previousUserDefinedWidth ?? 0) >=0 && currentUserDefinedWidth == null;
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
showFooterRow$!: Observable<'regular-footer' | 'no-footer' | 'small-footer'>;
|
|
212
|
+
getTransform = (key: string, val: string) => {
|
|
213
|
+
if(val == undefined || val === 'null') return '';
|
|
214
|
+
try {
|
|
215
|
+
return this.transformCreator.createTransformer(this.myColumns[key].metaData, true)({ [key]: val});
|
|
216
|
+
} catch (error) {
|
|
217
|
+
return val;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
ViewChild,
|
|
5
|
+
Input,
|
|
6
|
+
AfterViewInit,
|
|
7
|
+
OnInit,
|
|
8
|
+
ElementRef,
|
|
9
|
+
} from '@angular/core';
|
|
10
|
+
import { MatPaginator, MatPaginatorModule, PageEvent } from '@angular/material/paginator';
|
|
11
|
+
import { asyncScheduler, merge, Observable } from 'rxjs';
|
|
12
|
+
import { delay, distinctUntilChanged, distinctUntilKeyChanged, map } from 'rxjs/operators';
|
|
13
|
+
import { TableStore } from '../../classes/table-store';
|
|
14
|
+
import { AsyncPipe, NgClass } from '@angular/common';
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'tb-paginator',
|
|
17
|
+
standalone: true,
|
|
18
|
+
imports: [AsyncPipe, MatPaginatorModule, NgClass],
|
|
19
|
+
template: `
|
|
20
|
+
@if(currentPageData$ | async; as pageData){
|
|
21
|
+
<div [ngClass]="{'hide' : !(collapseFooter$ | async), 'page-amounts':true}">
|
|
22
|
+
{{pageData.currentStart}} - {{pageData.currentEnd}} of {{pageData.total}}
|
|
23
|
+
</div>
|
|
24
|
+
}
|
|
25
|
+
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons (page)="paginatorChange()"
|
|
26
|
+
[ngClass]="{'hide' : (collapseFooter$ | async)}">
|
|
27
|
+
</mat-paginator>
|
|
28
|
+
`,
|
|
29
|
+
styleUrls: ['./generic-table.component.scss','../../styles/collapser.styles.scss'],
|
|
30
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
31
|
+
})
|
|
32
|
+
export class PaginatorComponent implements OnInit, AfterViewInit{
|
|
33
|
+
@ViewChild(MatPaginator, { static: true }) paginator!: MatPaginator;
|
|
34
|
+
currentPageData$!: Observable<CurrentPageDetails>;
|
|
35
|
+
collapseFooter$!:Observable<boolean>;
|
|
36
|
+
@Input() data$!: Observable<any[]>;
|
|
37
|
+
@Input({ required: true }) tableElRef! : ElementRef
|
|
38
|
+
constructor(private state : TableStore){}
|
|
39
|
+
ngOnInit(){
|
|
40
|
+
this.ourPageEvent = true;
|
|
41
|
+
this.state.on(metaDataPageSizeChange(this.state), setPaginatorPageSize(this.paginator));
|
|
42
|
+
this.collapseFooter$ = this.state.state$.pipe(map(state => state.persistedTableSettings.collapseFooter));
|
|
43
|
+
this.state.on(this.paginator.page, (pageEvent) => {
|
|
44
|
+
this.state.updateState({currentPage: pageEvent.pageIndex} );
|
|
45
|
+
});
|
|
46
|
+
this.state.setPageSize(onPaginatorPageSizeChange(this.paginator))
|
|
47
|
+
|
|
48
|
+
this.state.on( this.state.select( s => s.dataLen), (len) => this.paginator.length = len);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
ngAfterViewInit() {
|
|
52
|
+
this.currentPageData$ = merge(
|
|
53
|
+
this.paginator.page.pipe(map(mapPaginationEventToCurrentPageDetails)),
|
|
54
|
+
this.data$.pipe(
|
|
55
|
+
distinctUntilKeyChanged("length"),
|
|
56
|
+
delayToAllowForProperUpdate,
|
|
57
|
+
map(updateCurrentPageDetailsOnDataLengthChange(this.paginator)))
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
paginatorChange() : void {
|
|
62
|
+
if(!this.ourPageEvent){
|
|
63
|
+
setTimeout(() => this.tableElRef?.nativeElement?.scrollIntoView(), 0);
|
|
64
|
+
} else {
|
|
65
|
+
this.ourPageEvent = false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
ourPageEvent = false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const mapPaginationEventToCurrentPageDetails = (pageData: PageEvent):CurrentPageDetails => ({
|
|
72
|
+
currentStart : (pageData.pageIndex * pageData.pageSize) + 1,
|
|
73
|
+
currentEnd : Math.min(pageData.length , ((pageData.pageIndex + 1) * pageData.pageSize)),
|
|
74
|
+
total : pageData.length
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const updateCurrentPageDetailsOnDataLengthChange = (paginator:MatPaginator) => () => ({currentStart:(paginator.pageIndex * paginator.pageSize) + 1,
|
|
78
|
+
currentEnd: Math.min(paginator.length , ((paginator.pageIndex + 1) * paginator.pageSize)),
|
|
79
|
+
total:paginator.length})
|
|
80
|
+
|
|
81
|
+
const delayToAllowForProperUpdate = delay<any[]>(0,asyncScheduler);
|
|
82
|
+
|
|
83
|
+
interface CurrentPageDetails {
|
|
84
|
+
currentStart:number,
|
|
85
|
+
currentEnd:number,
|
|
86
|
+
total:number
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const metaDataPageSizeChange = (state:TableStore) => state.state$.pipe(map(state => state.userDefined.pageSize || state.pageSize), distinctUntilChanged());
|
|
90
|
+
|
|
91
|
+
const setPaginatorPageSize = (paginator:MatPaginator) => (pageSize: number) =>
|
|
92
|
+
paginator._changePageSize(pageSize);
|
|
93
|
+
|
|
94
|
+
const onPaginatorPageSizeChange = (paginator: MatPaginator) => paginator.page.pipe(map( e => e.pageSize ), distinctUntilChanged());
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<mat-chip-set *ngrxLet="tableStore.groupByKeys$ as groupByKeys">
|
|
2
|
+
<span class="tb-group-label">Group By:</span>
|
|
3
|
+
@for (groupByKey of groupByKeys; track groupByKey) {
|
|
4
|
+
@if($index > 0){
|
|
5
|
+
<mat-icon class="nested-arrow">arrow_right</mat-icon>
|
|
6
|
+
}
|
|
7
|
+
<mat-chip (removed)="tableStore.removeGroupByKey(groupByKey)">
|
|
8
|
+
{{groupByKey | spaceCase}}
|
|
9
|
+
<mat-icon matChipRemove>cancel</mat-icon>
|
|
10
|
+
</mat-chip>
|
|
11
|
+
}
|
|
12
|
+
</mat-chip-set>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { GroupByListComponent } from './group-by-list.component';
|
|
4
|
+
|
|
5
|
+
describe('GroupByListComponent', () => {
|
|
6
|
+
let component: GroupByListComponent;
|
|
7
|
+
let fixture: ComponentFixture<GroupByListComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ GroupByListComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(GroupByListComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
2
|
+
import { TableStore } from '../../classes/table-store';
|
|
3
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
4
|
+
import { LetDirective } from '@ngrx/component';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { SpaceCasePipe } from '../../../utilities';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'group-by-list',
|
|
10
|
+
templateUrl: './group-by-list.component.html',
|
|
11
|
+
styleUrls: ['./group-by-list.component.css'],
|
|
12
|
+
standalone: true,
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
imports: [
|
|
15
|
+
MatChipsModule, LetDirective, MatIconModule, SpaceCasePipe
|
|
16
|
+
]
|
|
17
|
+
})
|
|
18
|
+
export class GroupByListComponent {
|
|
19
|
+
|
|
20
|
+
tableStore = inject(TableStore);
|
|
21
|
+
}
|