@one-paragon/angular-utilities 1.2.18 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-state/action-state-spinner/action-state-spinner.component.d.ts +12 -0
- package/action-state/action-state-ui/action-state-ui.module.d.ts +7 -0
- package/{src/action-state/index.ts → action-state/index.d.ts} +4 -8
- package/action-state/ngrx-ext/ngrx-ext.module.d.ts +8 -0
- package/action-state/ngrx.d.ts +31 -0
- package/fesm2022/one-paragon-angular-utilities.mjs +5760 -0
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -0
- package/http-request-state/HttpRequestStateFactory.d.ts +17 -0
- package/http-request-state/HttpRequestStateStore.d.ts +58 -0
- package/http-request-state/directives/HttpStateDirectiveBase.d.ts +14 -0
- package/http-request-state/directives/http-error-state-directive.d.ts +9 -0
- package/http-request-state/directives/http-inProgress-state-directive.d.ts +9 -0
- package/http-request-state/directives/http-notStarted-state-directive.d.ts +9 -0
- package/http-request-state/directives/http-success-state-directive.d.ts +16 -0
- package/{src/http-request-state/directives/index.ts → http-request-state/directives/index.d.ts} +5 -5
- package/http-request-state/directives/request-state-directive.d.ts +34 -0
- package/http-request-state/helpers.d.ts +9 -0
- package/http-request-state/http-request-state.d.ts +12 -0
- package/http-request-state/http-state-module.d.ts +11 -0
- package/{src/http-request-state/index.ts → http-request-state/index.d.ts} +6 -6
- package/http-request-state/rxjs/getRequestorBody.d.ts +3 -0
- package/http-request-state/rxjs/getRequestorState.d.ts +3 -0
- package/{src/http-request-state/rxjs/index.ts → http-request-state/rxjs/index.d.ts} +4 -4
- package/http-request-state/rxjs/tapError.d.ts +3 -0
- package/http-request-state/rxjs/tapSuccess.d.ts +3 -0
- package/http-request-state/types.d.ts +41 -0
- package/index.d.ts +5 -0
- package/ngrx/actionable-selector.d.ts +31 -0
- package/ngrx/index.d.ts +1 -0
- package/package.json +28 -16
- package/{src/public-api.ts → public-api.d.ts} +16 -35
- package/rxjs/defaultShareReplay.d.ts +2 -0
- package/{src/rxjs/index.ts → rxjs/index.d.ts} +5 -5
- package/rxjs/mapError.d.ts +2 -0
- package/rxjs/rxjs-operators.d.ts +13 -0
- package/rxjs/subjectifier.d.ts +8 -0
- package/rxjs/subscriber.directive.d.ts +14 -0
- package/table-builder/classes/DefaultSettings.d.ts +9 -0
- package/table-builder/classes/MatTableObservableDataSource.d.ts +9 -0
- package/table-builder/classes/TableBuilderConfig.d.ts +23 -0
- package/table-builder/classes/TableBuilderDataSource.d.ts +12 -0
- package/table-builder/classes/TableState.d.ts +66 -0
- package/table-builder/classes/data-store.d.ts +8 -0
- package/{src/table-builder/classes/display-col.ts → table-builder/classes/display-col.d.ts} +5 -5
- package/table-builder/classes/filter-info.d.ts +35 -0
- package/table-builder/classes/table-builder-general-settings.d.ts +85 -0
- package/table-builder/classes/table-builder.d.ts +18 -0
- package/table-builder/classes/table-store.d.ts +138 -0
- package/table-builder/components/array-column.component.d.ts +15 -0
- package/table-builder/components/column-builder/column-builder.component.d.ts +50 -0
- package/table-builder/components/column-builder/column-helpers.d.ts +36 -0
- package/table-builder/components/date-filter/date-filter.component.d.ts +37 -0
- package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +37 -0
- package/table-builder/components/filter/filter.component.d.ts +46 -0
- package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +24 -0
- package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +17 -0
- package/table-builder/components/generic-table/generic-table.component.d.ts +84 -0
- package/table-builder/components/generic-table/paginator.component.d.ts +30 -0
- package/table-builder/components/group-by-list/group-by-list.component.d.ts +7 -0
- package/table-builder/components/header-menu/header-menu.component.d.ts +51 -0
- package/table-builder/components/in-filter/in-filter.component.d.ts +20 -0
- package/{src/table-builder/components/index.ts → table-builder/components/index.d.ts} +9 -9
- package/table-builder/components/initialization-component/initialization-component.d.ts +13 -0
- package/table-builder/components/link-column.component.d.ts +25 -0
- package/table-builder/components/number-filter/number-filter.component.d.ts +39 -0
- package/table-builder/components/profiles-menu/profiles-menu.component.d.ts +32 -0
- package/table-builder/components/scroll-strategy.d.ts +22 -0
- package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +24 -0
- package/table-builder/components/sort-menu/sort-menu.component.d.ts +24 -0
- package/{src/table-builder/components/table-container/table-container-imports.ts → table-builder/components/table-container/table-container-imports.d.ts} +14 -32
- package/table-builder/components/table-container/table-container.d.ts +81 -0
- package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +6 -0
- package/table-builder/components/table-container/table-container.helpers/filter-state.helpers.d.ts +17 -0
- package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +17 -0
- package/table-builder/components/table-container/table-container.helpers/sort-state.helpers.d.ts +8 -0
- package/table-builder/components/table-container/tableProps.d.ts +12 -0
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +36 -0
- package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +15 -0
- package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +12 -0
- package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +14 -0
- package/table-builder/directives/custom-cell-directive.d.ts +33 -0
- package/{src/table-builder/directives/index.ts → table-builder/directives/index.d.ts} +5 -6
- package/table-builder/directives/multi-sort.directive.d.ts +10 -0
- package/table-builder/directives/resize-column.directive.d.ts +43 -0
- package/table-builder/directives/table-wrapper.directive.d.ts +8 -0
- package/table-builder/directives/tb-filter.directive.d.ts +115 -0
- package/table-builder/enums/filterTypes.d.ts +36 -0
- package/table-builder/functions/boolean-filter-function.d.ts +3 -0
- package/table-builder/functions/date-filter-function.d.ts +4 -0
- package/table-builder/functions/download-data.d.ts +1 -0
- package/table-builder/functions/null-filter-function.d.ts +2 -0
- package/table-builder/functions/number-filter-function.d.ts +4 -0
- package/table-builder/functions/sort-data-function.d.ts +6 -0
- package/table-builder/functions/string-filter-function.d.ts +5 -0
- package/{src/table-builder/interfaces/ColumnInfo.ts → table-builder/interfaces/ColumnInfo.d.ts} +6 -7
- package/{src/table-builder/interfaces/dictionary.ts → table-builder/interfaces/dictionary.d.ts} +3 -3
- package/table-builder/interfaces/report-def.d.ts +147 -0
- package/table-builder/ngrx/tableBuilderStateStore.d.ts +70 -0
- package/table-builder/pipes/column-total.pipe.d.ts +8 -0
- package/table-builder/pipes/format-filter-type.pipe.d.ts +8 -0
- package/table-builder/pipes/format-filter-value.pipe.d.ts +12 -0
- package/table-builder/pipes/key-display.d.ts +10 -0
- package/table-builder/services/export-to-csv.service.d.ts +14 -0
- package/table-builder/services/link-creator.service.d.ts +16 -0
- package/table-builder/services/table-template-service.d.ts +14 -0
- package/table-builder/services/transform-creator.d.ts +16 -0
- package/table-builder/table-builder.module.d.ts +21 -0
- package/utilities/array-helpers.d.ts +1 -0
- package/utilities/directives/auto-focus.directive.d.ts +9 -0
- package/utilities/directives/clickEmitterDirective.d.ts +7 -0
- package/utilities/directives/clickSubject.d.ts +9 -0
- package/utilities/directives/conditional-classes.directive.d.ts +13 -0
- package/utilities/directives/dialog-service.d.ts +10 -0
- package/utilities/directives/dialog.d.ts +44 -0
- package/utilities/directives/mat-toggle-group-directive.d.ts +21 -0
- package/utilities/directives/prevent-enter.directive.d.ts +6 -0
- package/utilities/directives/stop-propagation.directive.d.ts +7 -0
- package/utilities/directives/styler.d.ts +15 -0
- package/utilities/directives/trim-whitespace.directive.d.ts +7 -0
- package/{src/utilities/index.ts → utilities/index.d.ts} +15 -22
- package/utilities/module.d.ts +19 -0
- package/utilities/pipes/function.pipe.d.ts +7 -0
- package/utilities/pipes/phone.pipe.d.ts +7 -0
- package/utilities/pipes/space-case.pipes.d.ts +17 -0
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -7
- package/src/action-state/action-state-spinner/action-state-spinner.component.css +0 -16
- package/src/action-state/action-state-spinner/action-state-spinner.component.html +0 -6
- package/src/action-state/action-state-spinner/action-state-spinner.component.spec.ts +0 -25
- package/src/action-state/action-state-spinner/action-state-spinner.component.ts +0 -26
- package/src/action-state/action-state-ui/action-state-ui.module.ts +0 -13
- package/src/action-state/ngrx-ext/ngrx-ext.module.ts +0 -15
- package/src/action-state/ngrx.ts +0 -69
- package/src/http-request-state/HttpRequestStateFactory.ts +0 -66
- package/src/http-request-state/HttpRequestStateStore.ts +0 -191
- package/src/http-request-state/directives/HttpStateDirectiveBase.ts +0 -29
- package/src/http-request-state/directives/http-error-state-directive.ts +0 -21
- package/src/http-request-state/directives/http-inProgress-state-directive.ts +0 -19
- package/src/http-request-state/directives/http-notStarted-state-directive.ts +0 -19
- package/src/http-request-state/directives/http-success-state-directive.ts +0 -29
- package/src/http-request-state/directives/request-state-directive.spec.ts +0 -72
- package/src/http-request-state/directives/request-state-directive.ts +0 -78
- package/src/http-request-state/helpers.ts +0 -30
- package/src/http-request-state/http-request-state.ts +0 -69
- package/src/http-request-state/http-state-module.ts +0 -23
- package/src/http-request-state/observable.spec.ts +0 -43
- package/src/http-request-state/rxjs/getRequestorBody.ts +0 -10
- package/src/http-request-state/rxjs/getRequestorState.ts +0 -8
- package/src/http-request-state/rxjs/tapError.ts +0 -16
- package/src/http-request-state/rxjs/tapSuccess.ts +0 -16
- package/src/http-request-state/strategies.spec.ts +0 -42
- package/src/http-request-state/types.ts +0 -55
- package/src/ngrx/actionable-selector.ts +0 -152
- package/src/ngrx/index.ts +0 -1
- package/src/rxjs/defaultShareReplay.ts +0 -8
- package/src/rxjs/mapError.ts +0 -8
- package/src/rxjs/rxjs-operators.ts +0 -132
- package/src/rxjs/subjectifier.ts +0 -17
- package/src/rxjs/subscriber.directive.ts +0 -57
- package/src/specs/clickSubject.spec.ts +0 -95
- package/src/specs/dialog.spec.ts +0 -101
- package/src/specs/toggleGroupDirective.spec.ts +0 -229
- package/src/table-builder/classes/DefaultSettings.ts +0 -11
- package/src/table-builder/classes/MatTableObservableDataSource.ts +0 -23
- package/src/table-builder/classes/TableBuilderConfig.ts +0 -36
- package/src/table-builder/classes/TableBuilderDataSource.ts +0 -61
- package/src/table-builder/classes/TableState.ts +0 -93
- package/src/table-builder/classes/data-store.ts +0 -10
- package/src/table-builder/classes/filter-info.ts +0 -108
- package/src/table-builder/classes/table-builder-general-settings.ts +0 -141
- package/src/table-builder/classes/table-builder.ts +0 -95
- package/src/table-builder/classes/table-store.ts +0 -476
- package/src/table-builder/components/array-column.component.ts +0 -36
- package/src/table-builder/components/column-builder/column-builder.component.html +0 -61
- package/src/table-builder/components/column-builder/column-builder.component.scss +0 -43
- package/src/table-builder/components/column-builder/column-builder.component.spec.ts +0 -49
- package/src/table-builder/components/column-builder/column-builder.component.ts +0 -146
- package/src/table-builder/components/column-builder/column-helpers.ts +0 -52
- package/src/table-builder/components/date-filter/date-filter.component.html +0 -23
- package/src/table-builder/components/date-filter/date-filter.component.ts +0 -24
- package/src/table-builder/components/date-time-filter/date-time-filter.component.html +0 -9
- package/src/table-builder/components/date-time-filter/date-time-filter.component.ts +0 -22
- package/src/table-builder/components/filter/filter.component.html +0 -91
- package/src/table-builder/components/filter/filter.component.scss +0 -60
- package/src/table-builder/components/filter/filter.component.spec.ts +0 -87
- package/src/table-builder/components/filter/filter.component.ts +0 -60
- package/src/table-builder/components/filter/in-list/in-list-filter.component.ts +0 -93
- package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.html +0 -55
- package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.scss +0 -57
- package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.ts +0 -46
- package/src/table-builder/components/generic-table/generic-table.component.html +0 -77
- package/src/table-builder/components/generic-table/generic-table.component.scss +0 -38
- package/src/table-builder/components/generic-table/generic-table.component.ts +0 -325
- package/src/table-builder/components/generic-table/paginator.component.ts +0 -99
- package/src/table-builder/components/group-by-list/group-by-list.component.css +0 -8
- package/src/table-builder/components/group-by-list/group-by-list.component.html +0 -12
- package/src/table-builder/components/group-by-list/group-by-list.component.spec.ts +0 -23
- package/src/table-builder/components/group-by-list/group-by-list.component.ts +0 -21
- package/src/table-builder/components/header-menu/header-menu.component.html +0 -104
- package/src/table-builder/components/header-menu/header-menu.component.scss +0 -96
- package/src/table-builder/components/header-menu/header-menu.component.ts +0 -99
- package/src/table-builder/components/in-filter/in-filter.component.css +0 -3
- package/src/table-builder/components/in-filter/in-filter.component.html +0 -20
- package/src/table-builder/components/in-filter/in-filter.component.ts +0 -66
- package/src/table-builder/components/initialization-component/initialization-component.html +0 -29
- package/src/table-builder/components/initialization-component/initialization-component.ts +0 -24
- package/src/table-builder/components/link-column.component.ts +0 -47
- package/src/table-builder/components/number-filter/number-filter.component.css +0 -10
- package/src/table-builder/components/number-filter/number-filter.component.html +0 -19
- package/src/table-builder/components/number-filter/number-filter.component.spec.ts +0 -30
- package/src/table-builder/components/number-filter/number-filter.component.ts +0 -25
- package/src/table-builder/components/profiles-menu/profiles-menu.component.html +0 -78
- package/src/table-builder/components/profiles-menu/profiles-menu.component.scss +0 -126
- package/src/table-builder/components/profiles-menu/profiles-menu.component.spec.ts +0 -23
- package/src/table-builder/components/profiles-menu/profiles-menu.component.ts +0 -65
- package/src/table-builder/components/scroll-strategy.ts +0 -76
- package/src/table-builder/components/sort-menu/sort-menu.component-store.ts +0 -66
- package/src/table-builder/components/sort-menu/sort-menu.component.html +0 -111
- package/src/table-builder/components/sort-menu/sort-menu.component.scss +0 -119
- package/src/table-builder/components/sort-menu/sort-menu.component.ts +0 -98
- package/src/table-builder/components/table-container/table-container.helpers/data-state.helpers.ts +0 -141
- package/src/table-builder/components/table-container/table-container.helpers/filter-state.helpers.ts +0 -106
- package/src/table-builder/components/table-container/table-container.helpers/groupBy.helpers.ts +0 -86
- package/src/table-builder/components/table-container/table-container.helpers/sort-state.helpers.ts +0 -45
- package/src/table-builder/components/table-container/table-container.html +0 -94
- package/src/table-builder/components/table-container/table-container.scss +0 -47
- package/src/table-builder/components/table-container/table-container.spec.ts +0 -154
- package/src/table-builder/components/table-container/table-container.ts +0 -356
- package/src/table-builder/components/table-container/tableProps.ts +0 -20
- package/src/table-builder/components/table-container/virtual-scroll-container.ts +0 -156
- package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.html +0 -31
- package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.ts +0 -46
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.css +0 -42
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.html +0 -10
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.spec.ts +0 -85
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.ts +0 -33
- package/src/table-builder/components/table-container-filter/table-wrapper-filter-store.ts +0 -23
- package/src/table-builder/directives/custom-cell-directive.ts +0 -58
- package/src/table-builder/directives/multi-sort.directive.spec.ts +0 -124
- package/src/table-builder/directives/multi-sort.directive.ts +0 -51
- package/src/table-builder/directives/resize-column.directive.ts +0 -108
- package/src/table-builder/directives/table-wrapper.directive.ts +0 -14
- package/src/table-builder/directives/tb-filter.directive.ts +0 -382
- package/src/table-builder/enums/filterTypes.ts +0 -40
- package/src/table-builder/functions/boolean-filter-function.ts +0 -12
- package/src/table-builder/functions/date-filter-function.ts +0 -68
- package/src/table-builder/functions/download-data.ts +0 -11
- package/src/table-builder/functions/null-filter-function.ts +0 -9
- package/src/table-builder/functions/number-filter-function.ts +0 -41
- package/src/table-builder/functions/sort-data-function.ts +0 -23
- package/src/table-builder/functions/string-filter-function.ts +0 -51
- package/src/table-builder/interfaces/column-template.ts +0 -9
- package/src/table-builder/interfaces/report-def.ts +0 -155
- package/src/table-builder/ngrx/tableBuilderStateStore.ts +0 -199
- package/src/table-builder/pipes/column-total.pipe.ts +0 -17
- package/src/table-builder/pipes/format-filter-type.pipe.ts +0 -12
- package/src/table-builder/pipes/format-filter-value.pipe.ts +0 -42
- package/src/table-builder/pipes/key-display.ts +0 -16
- package/src/table-builder/services/export-to-csv.service.ts +0 -78
- package/src/table-builder/services/link-creator.service.ts +0 -67
- package/src/table-builder/services/table-template-service.ts +0 -59
- package/src/table-builder/services/transform-creator.ts +0 -95
- package/src/table-builder/specs/table-custom-filters.spec.ts +0 -262
- package/src/table-builder/styles/collapser.styles.scss +0 -16
- package/src/table-builder/table-builder.module.ts +0 -73
- package/src/test.ts +0 -17
- package/src/utilities/array-helpers.ts +0 -13
- package/src/utilities/directives/auto-focus.directive.ts +0 -21
- package/src/utilities/directives/clickEmitterDirective.ts +0 -16
- package/src/utilities/directives/clickSubject.ts +0 -20
- package/src/utilities/directives/conditional-classes.directive.ts +0 -36
- package/src/utilities/directives/dialog-service.ts +0 -19
- package/src/utilities/directives/dialog.ts +0 -144
- package/src/utilities/directives/mat-toggle-group-directive.ts +0 -61
- package/src/utilities/directives/prevent-enter.directive.ts +0 -13
- package/src/utilities/directives/stop-propagation.directive.ts +0 -20
- package/src/utilities/directives/styler.ts +0 -40
- package/src/utilities/directives/trim-whitespace.directive.ts +0 -21
- package/src/utilities/module.ts +0 -55
- package/src/utilities/pipes/function.pipe.ts +0 -16
- package/src/utilities/pipes/phone.pipe.ts +0 -15
- package/src/utilities/pipes/space-case.pipes.spec.ts +0 -47
- package/src/utilities/pipes/space-case.pipes.ts +0 -23
- package/tsconfig.lib.json +0 -19
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, ElementRef, computed, inject, viewChild, input, effect, untracked } from '@angular/core';
|
|
2
|
-
import { MatPaginator, MatPaginatorModule, PageEvent } from '@angular/material/paginator';
|
|
3
|
-
import { switchMap } from 'rxjs/operators';
|
|
4
|
-
import { TableStore } from '../../classes/table-store';
|
|
5
|
-
import { NgClass } from '@angular/common';
|
|
6
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
-
import { DataStore } from '../../classes/data-store';
|
|
8
|
-
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
9
|
-
import { notNull } from '../../../rxjs';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'tb-paginator',
|
|
13
|
-
standalone: true,
|
|
14
|
-
imports: [MatPaginatorModule, MatButtonModule],
|
|
15
|
-
template: `
|
|
16
|
-
<div class="paginator-row">
|
|
17
|
-
@if($currentPageData(); as pageData){
|
|
18
|
-
<div [class]="{ 'hide' : ! $collapseFooter(), 'page-amounts':true}">
|
|
19
|
-
@if(!$showAll()){ {{pageData.currentStart}} - {{pageData.currentEnd}} of }{{pageData.total}}
|
|
20
|
-
</div>
|
|
21
|
-
}
|
|
22
|
-
<mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
|
|
23
|
-
[class]="{ 'hide' : $collapseFooter() }">
|
|
24
|
-
</mat-paginator>
|
|
25
|
-
@if ($showAllOption()) {<button mat-button (click)="updatePaginator()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
|
|
26
|
-
</div>
|
|
27
|
-
`,
|
|
28
|
-
styleUrls: ['./generic-table.component.scss','../../styles/collapser.styles.scss'],
|
|
29
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
|
-
})
|
|
31
|
-
export class PaginatorComponent {
|
|
32
|
-
private state = inject(TableStore);
|
|
33
|
-
private data = inject(DataStore);
|
|
34
|
-
$paginator = viewChild(MatPaginator);
|
|
35
|
-
$tableElRef = input.required<ElementRef<HTMLDivElement>>({alias: 'tableElRef'});
|
|
36
|
-
|
|
37
|
-
$dataLength = this.data.selectSignal(d => d.dataLen);
|
|
38
|
-
pageEvent$ = toObservable(this.$paginator).pipe(notNull(), switchMap(p => p.page));
|
|
39
|
-
$pageEvent = toSignal(this.pageEvent$);
|
|
40
|
-
$pageIndexChangeEvent = computed(() => this.$pageEvent()?.pageIndex);
|
|
41
|
-
$pageSizeChangeEvent = computed(() => this.$pageEvent()?.pageSize);
|
|
42
|
-
$currentPageData = computed(() => {
|
|
43
|
-
const pageEvent = this.$pageEvent();
|
|
44
|
-
if(!pageEvent) return;
|
|
45
|
-
const paginator = this.$paginator()!;
|
|
46
|
-
// Reset because initial page event does not have page length
|
|
47
|
-
pageEvent.pageIndex = paginator.pageIndex;
|
|
48
|
-
pageEvent.pageSize = paginator.pageSize;
|
|
49
|
-
pageEvent.length = paginator.length;
|
|
50
|
-
const pageDetails = mapPaginationEventToCurrentPageDetails(pageEvent);
|
|
51
|
-
const dataLength = this.$dataLength();
|
|
52
|
-
return ({...pageDetails, total: dataLength})
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
onPageIndexEffect = effect(() => {
|
|
56
|
-
const index = this.$pageIndexChangeEvent();
|
|
57
|
-
untracked(() => this.state.updateState({currentPage: index}))
|
|
58
|
-
});
|
|
59
|
-
onPageSizeEffect = effect(() => {
|
|
60
|
-
const size = this.$pageSizeChangeEvent();
|
|
61
|
-
if(!size) return;
|
|
62
|
-
untracked(() => this.state.setPageSize(size));
|
|
63
|
-
});
|
|
64
|
-
onMetaPageSizeEffect = effect(() => {
|
|
65
|
-
const paginator = this.$paginator();
|
|
66
|
-
if(!paginator) return;
|
|
67
|
-
const metaPageSize = this.state.$pageSize();
|
|
68
|
-
untracked(() => paginator._changePageSize(metaPageSize));
|
|
69
|
-
});
|
|
70
|
-
onDataLengthEffect = effect(() => {
|
|
71
|
-
const paginator = this.$paginator();
|
|
72
|
-
const dataLength = this.$dataLength();
|
|
73
|
-
untracked(() => {
|
|
74
|
-
if(paginator){
|
|
75
|
-
paginator.length = dataLength;
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
$collapseFooter = computed(() => this.state.selectSignal(state => state.persistedTableSettings.collapseFooter)() || this.$showAll());
|
|
80
|
-
$showAllOption = this.state.selectSignal(s => s.notPersistedTableSettings?.includeAllInPaginatorOptions);
|
|
81
|
-
$showAll = this.state.selectSignal(s => s.showAll);
|
|
82
|
-
updatePaginator = this.state.updater(state => ({ ...state, showAll: !state.showAll }));
|
|
83
|
-
showAll(){
|
|
84
|
-
this.updatePaginator();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const mapPaginationEventToCurrentPageDetails = (pageData: PageEvent):CurrentPageDetails => ({
|
|
89
|
-
currentStart : (pageData.pageIndex * pageData.pageSize) + 1,
|
|
90
|
-
currentEnd : Math.min(pageData.length , ((pageData.pageIndex + 1) * pageData.pageSize)),
|
|
91
|
-
total : pageData.length
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
interface CurrentPageDetails {
|
|
96
|
-
currentStart:number,
|
|
97
|
-
currentEnd:number,
|
|
98
|
-
total:number
|
|
99
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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>
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<button mat-icon-button class="open-menu-icon-button" disableRipple [matMenuTriggerFor]="menu" [matMenuTriggerRestoreFocus]="false">
|
|
2
|
-
<mat-icon class="menu-icon">more_vert</mat-icon>
|
|
3
|
-
</button>
|
|
4
|
-
<mat-menu #menu="matMenu" >
|
|
5
|
-
@if (!(metaData.fieldType === FieldType.NotMapped))
|
|
6
|
-
{
|
|
7
|
-
<button mat-menu-item (click)="tableState.addGroupByKey(metaData.key)">
|
|
8
|
-
<mat-icon color="primary">group</mat-icon>
|
|
9
|
-
<span>Group By</span>
|
|
10
|
-
</button>
|
|
11
|
-
}
|
|
12
|
-
<button mat-menu-item (click)=hideField(metaData.key)>
|
|
13
|
-
<mat-icon color="primary">visibility_off</mat-icon>
|
|
14
|
-
<span>Hide Column</span>
|
|
15
|
-
</button>
|
|
16
|
-
@if (!(metaData.fieldType === FieldType.NotMapped))
|
|
17
|
-
{
|
|
18
|
-
<ng-form #myForm="ngForm" (keydown.enter)="onEnter(myForm.value)" class="tb-header-filter">
|
|
19
|
-
<input type="hidden" name="filterId" [ngModel]="'header-column-' + metaData.key" />
|
|
20
|
-
<input type="hidden" name="filterType" [ngModel]="myFilterType" />
|
|
21
|
-
<input type="hidden" name="key" [ngModel]="metaData.key" />
|
|
22
|
-
<input type="hidden" name="fieldType" [ngModel]="metaData.fieldType" />
|
|
23
|
-
|
|
24
|
-
@if(myFilterType === FilterType.Or || myFilterType === FilterType.In){
|
|
25
|
-
<tb-in-list-filter name='filterValue' [key]='metaData.key' [(ngModel)]='myFilterValue'/>
|
|
26
|
-
}
|
|
27
|
-
@else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {
|
|
28
|
-
<mat-form-field stop-propagation class="font auto-width">
|
|
29
|
-
<mat-icon matPrefix class="search-icon">search</mat-icon>
|
|
30
|
-
<mat-label>{{myFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>
|
|
31
|
-
<input matInput name="filterValue" [ngModel]="filter.filterValue" />
|
|
32
|
-
<span matSuffix [matTooltip]="myFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'">
|
|
33
|
-
<button mat-icon-button color="primary" (click)="setStringFilterType()" class="header-filter-icon-button">
|
|
34
|
-
<mat-icon [ngClass]="{'chosen-icon': myFilterType === FilterType.StringDoesNotContain }">
|
|
35
|
-
block
|
|
36
|
-
</mat-icon>
|
|
37
|
-
</button>
|
|
38
|
-
</span>
|
|
39
|
-
</mat-form-field>
|
|
40
|
-
}
|
|
41
|
-
@else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {
|
|
42
|
-
<mat-form-field class="auto-width" stop-propagation>
|
|
43
|
-
<mat-label>{{myFilterType === FilterType.NumberEquals ? 'Equals...' : myFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>
|
|
44
|
-
<input matInput type='number' name="filterValue" [ngModel]="filter.filterValue" />
|
|
45
|
-
<span matPrefix class="tb-header-prefix">
|
|
46
|
-
<button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.NumberLessThan)"
|
|
47
|
-
[ngClass]="{'chosen-icon': myFilterType === FilterType.NumberLessThan }">
|
|
48
|
-
<mat-icon class="suffix-icons"
|
|
49
|
-
>
|
|
50
|
-
arrow_back_ios</mat-icon>
|
|
51
|
-
</button>
|
|
52
|
-
<button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.NumberGreaterThan)"
|
|
53
|
-
[ngClass]="{'chosen-icon': myFilterType === FilterType.NumberGreaterThan }" >
|
|
54
|
-
<mat-icon class="suffix-icons">arrow_forward_ios</mat-icon>
|
|
55
|
-
</button>
|
|
56
|
-
<button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.NumberEquals)"
|
|
57
|
-
[ngClass]="{'chosen-icon': myFilterType === FilterType.NumberEquals }">
|
|
58
|
-
<span class="suffix-icons">=</span>
|
|
59
|
-
</button>
|
|
60
|
-
</span>
|
|
61
|
-
</mat-form-field>
|
|
62
|
-
}
|
|
63
|
-
@else if (metaData.fieldType === FieldType.Boolean) {
|
|
64
|
-
<div>
|
|
65
|
-
<label>
|
|
66
|
-
<mat-icon class="search-icon">filter_list</mat-icon>
|
|
67
|
-
</label>
|
|
68
|
-
<mat-radio-group stop-propagation #ctrl="matRadioGroup" #boolField='ngModel' class="font" name="filterValue" [ngModel]="myFilterValue" >
|
|
69
|
-
<mat-radio-button class="filter-radio-button" (click)="myFilterValue = true;" [value]="true">True</mat-radio-button><br/>
|
|
70
|
-
<mat-radio-button class="filter-radio-button" (click)="myFilterValue = false" [value]="false">False</mat-radio-button><br/>
|
|
71
|
-
</mat-radio-group>
|
|
72
|
-
</div>
|
|
73
|
-
}
|
|
74
|
-
@else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {
|
|
75
|
-
<mat-form-field class="font auto-width" stop-propagation >
|
|
76
|
-
<span matPrefix class="tb-header-prefix">
|
|
77
|
-
<button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.DateOnOrAfter)"
|
|
78
|
-
[ngClass]="{'chosen-icon': myFilterType === FilterType.DateOnOrAfter }">
|
|
79
|
-
<mat-icon class="suffix-icons underline">arrow_forward_ios</mat-icon>
|
|
80
|
-
</button>
|
|
81
|
-
<button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.DateOnOrBefore)"
|
|
82
|
-
[ngClass]="{'chosen-icon': myFilterType === FilterType.DateOnOrBefore }">
|
|
83
|
-
<mat-icon class="suffix-icons underline">arrow_back_ios</mat-icon>
|
|
84
|
-
</button>
|
|
85
|
-
<button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.DateIsOn)"
|
|
86
|
-
[ngClass]="{'chosen-icon': myFilterType === FilterType.DateIsOn }">
|
|
87
|
-
<span class="suffix-icons underline"> =</span>
|
|
88
|
-
</button>
|
|
89
|
-
</span>
|
|
90
|
-
<mat-label>{{myFilterType === FilterType.DateIsOn ? 'On...' :
|
|
91
|
-
myFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>
|
|
92
|
-
<input matInput name="filterValue" [ngModel]="filter.filterValue" [matDatepicker]="calendar"
|
|
93
|
-
(click)="calendar.open()"/>
|
|
94
|
-
<mat-datepicker-toggle class="date-toggle header-filter-icon-button" matSuffix [for]="calendar" preventEnter></mat-datepicker-toggle>
|
|
95
|
-
<mat-datepicker #calendar></mat-datepicker>
|
|
96
|
-
</mat-form-field>
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
<button mat-button (click)="onEnter(myForm.value)" [disabled]="myForm.value.filterValue == undefined" disableRipple>
|
|
100
|
-
Apply
|
|
101
|
-
</button>
|
|
102
|
-
</ng-form>
|
|
103
|
-
}
|
|
104
|
-
</mat-menu>
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
@use '@angular/material' as mat;
|
|
2
|
-
:host{
|
|
3
|
-
@include mat.button-density(-3);
|
|
4
|
-
@include mat.icon-density(-3);
|
|
5
|
-
}
|
|
6
|
-
input[type=number]::-webkit-inner-spin-button,
|
|
7
|
-
input[type=number]::-webkit-outer-spin-button {
|
|
8
|
-
-webkit-appearance: none;
|
|
9
|
-
margin: 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.menu-icon{
|
|
13
|
-
font-size: 16px;
|
|
14
|
-
line-height: 16px;
|
|
15
|
-
vertical-align: top;
|
|
16
|
-
height: 16px;
|
|
17
|
-
width: 16px;
|
|
18
|
-
}
|
|
19
|
-
.search-icon{
|
|
20
|
-
margin-right: 16px;
|
|
21
|
-
vertical-align: middle;
|
|
22
|
-
height: 24px;
|
|
23
|
-
color: rgba(0,0,0,.54);
|
|
24
|
-
font-size: 21px;
|
|
25
|
-
line-height: 1.125
|
|
26
|
-
}
|
|
27
|
-
.font{
|
|
28
|
-
font-size: 14px;
|
|
29
|
-
}
|
|
30
|
-
.filter-radio-button:first-of-type{
|
|
31
|
-
padding-left: 0;
|
|
32
|
-
}
|
|
33
|
-
.filter-radio-button{
|
|
34
|
-
padding: 10px 40px;
|
|
35
|
-
min-width: 110px;
|
|
36
|
-
}
|
|
37
|
-
.auto-width {
|
|
38
|
-
width: 260px;
|
|
39
|
-
margin: 5px;
|
|
40
|
-
display: block;
|
|
41
|
-
height: 55px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.open-menu-icon-button{
|
|
46
|
-
height: 28px;
|
|
47
|
-
width: 28px;
|
|
48
|
-
padding: 6px;
|
|
49
|
-
}
|
|
50
|
-
.header-filter-icon-button {
|
|
51
|
-
height: 18px;
|
|
52
|
-
width: 18px;
|
|
53
|
-
font-size: 18px;
|
|
54
|
-
padding: 0;
|
|
55
|
-
margin: 0 2px;
|
|
56
|
-
|
|
57
|
-
::ng-deep * {
|
|
58
|
-
line-height: initial;
|
|
59
|
-
font-size: initial;
|
|
60
|
-
height: 18px;
|
|
61
|
-
width: 18px;
|
|
62
|
-
font-size: 18px;
|
|
63
|
-
bottom: initial;
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&.chosen-icon,
|
|
68
|
-
&.chosen-icon ::ng-deep * {
|
|
69
|
-
height: 22px;
|
|
70
|
-
width: 22px;
|
|
71
|
-
font-size: 22px;
|
|
72
|
-
color: green;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
mat-icon.mat-icon.suffix-icons.underline{
|
|
76
|
-
height: 20px;
|
|
77
|
-
text-decoration: underline 0.1px solid;
|
|
78
|
-
.chosen-icon &{
|
|
79
|
-
height: 24px;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
::ng-deep.mat-mdc-form-field-icon-prefix:has(.tb-header-prefix), .tb-header-prefix{
|
|
83
|
-
padding: 0;
|
|
84
|
-
flex-basis: 36%;
|
|
85
|
-
}
|
|
86
|
-
.tb-header-filter ::ng-deep.mat-mdc-form-field-subscript-wrapper{
|
|
87
|
-
line-height: 0;
|
|
88
|
-
&::before{
|
|
89
|
-
height: 0;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
.date-toggle ::ng-deep svg{
|
|
93
|
-
position: absolute;
|
|
94
|
-
left: 0;
|
|
95
|
-
top: 0;
|
|
96
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input, ViewChild, inject } from '@angular/core';
|
|
2
|
-
import { FieldType, MetaData } from '../../interfaces/report-def';
|
|
3
|
-
import { FilterType, FilterTypes } from '../../enums/filterTypes';
|
|
4
|
-
import { FilterInfo } from '../../classes/filter-info';
|
|
5
|
-
import { TableStore } from '../../classes/table-store';
|
|
6
|
-
import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
|
|
7
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
8
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
-
import { FormsModule } from '@angular/forms';
|
|
10
|
-
import { NgClass } from '@angular/common';
|
|
11
|
-
import { InListFilterComponent } from '../filter/in-list/in-list-filter.component';
|
|
12
|
-
import { MatInputModule } from '@angular/material/input';
|
|
13
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
14
|
-
import { StopPropagationDirective } from '../../../utilities';
|
|
15
|
-
import { MatRadioModule } from '@angular/material/radio';
|
|
16
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
17
|
-
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'tb-header-menu',
|
|
20
|
-
templateUrl: './header-menu.component.html',
|
|
21
|
-
styleUrls: ['./header-menu.component.scss'],
|
|
22
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
-
standalone: true,
|
|
24
|
-
imports: [
|
|
25
|
-
MatMenuModule, MatIconModule, MatButtonModule, FormsModule, InListFilterComponent,
|
|
26
|
-
MatInputModule, MatTooltipModule, NgClass, StopPropagationDirective, MatRadioModule, MatDatepickerModule
|
|
27
|
-
]
|
|
28
|
-
})
|
|
29
|
-
export class HeaderMenuComponent {
|
|
30
|
-
protected tableState = inject(TableStore);
|
|
31
|
-
|
|
32
|
-
FieldType = FieldType;
|
|
33
|
-
FilterType = FilterTypes;
|
|
34
|
-
myFilterType!: FilterType;
|
|
35
|
-
myFilterValue: any;
|
|
36
|
-
|
|
37
|
-
filter!: Partial<FilterInfo>;
|
|
38
|
-
|
|
39
|
-
@Input() metaData!: MetaData;
|
|
40
|
-
@ViewChild(MatMenuTrigger) trigger!: MatMenuTrigger;
|
|
41
|
-
|
|
42
|
-
hideField(key: string) {
|
|
43
|
-
this.tableState.hideColumn(key);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
ngOnInit() {
|
|
47
|
-
this.filter = { key: this.metaData.key, fieldType: this.metaData.fieldType };
|
|
48
|
-
this.resetFilterType();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
resetFilterType() {
|
|
52
|
-
if(this.metaData.additional?.filterOptions?.filterableValues) {
|
|
53
|
-
this.myFilterType = FilterTypes.In;
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
switch (this.metaData.fieldType) {
|
|
57
|
-
case FieldType.String:
|
|
58
|
-
case FieldType.Link:
|
|
59
|
-
case FieldType.PhoneNumber:
|
|
60
|
-
case FieldType.Array:
|
|
61
|
-
case FieldType.Unknown:
|
|
62
|
-
this.myFilterType = FilterTypes.StringContains;
|
|
63
|
-
break;
|
|
64
|
-
case FieldType.Currency:
|
|
65
|
-
case FieldType.Number:
|
|
66
|
-
this.myFilterType = FilterTypes.NumberEquals;
|
|
67
|
-
break;
|
|
68
|
-
case FieldType.Boolean:
|
|
69
|
-
this.myFilterType = FilterTypes.BooleanEquals;
|
|
70
|
-
break;
|
|
71
|
-
case FieldType.Date:
|
|
72
|
-
case FieldType.DateTime:
|
|
73
|
-
this.myFilterType = FilterTypes.DateIsOn;
|
|
74
|
-
break;
|
|
75
|
-
case FieldType.Enum:
|
|
76
|
-
this.myFilterType = FilterTypes.In;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
setStringFilterType() {
|
|
82
|
-
this.myFilterType = this.myFilterType === FilterTypes.StringContains ? FilterTypes.StringDoesNotContain : FilterTypes.StringContains;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
setFilterType(filterType: FilterType) {
|
|
86
|
-
if (filterType === this.myFilterType) {
|
|
87
|
-
this.resetFilterType();
|
|
88
|
-
} else {
|
|
89
|
-
this.myFilterType = filterType;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
onEnter(filter: FilterInfo) {
|
|
94
|
-
if (filter.filterValue != undefined && filter.filterType) {
|
|
95
|
-
this.tableState.addFilter(filter);
|
|
96
|
-
this.trigger.closeMenu();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<div class=inline>
|
|
2
|
-
@for (val of value; track $index) {
|
|
3
|
-
<div>
|
|
4
|
-
@if(type === FieldType.Number || type === FieldType.Currency){
|
|
5
|
-
<input [ngModel]="val" (ngModelChange)="onValueChange($index, $event)"
|
|
6
|
-
[readonly]="$index + 1 < value.length" type="number" [ngModelOptions]="{standalone:true}" [autoFocus]="$index === value.length - 1"/>
|
|
7
|
-
}
|
|
8
|
-
@else {
|
|
9
|
-
<input [ngModel]="val" (ngModelChange)="onValueChange($index ,$event)"
|
|
10
|
-
[readonly]="$index + 1 < value.length" type="string" [ngModelOptions]="{standalone:true}"
|
|
11
|
-
#input [autoFocus]="$index === value.length - 1" />
|
|
12
|
-
}
|
|
13
|
-
</div>
|
|
14
|
-
<button [disabled]="value.length <= 1" (click)="removeInput($index)">-</button>
|
|
15
|
-
@if ($index === value.length - 1) {
|
|
16
|
-
<button [disabled]="val == undefined || val === ''" (click)="addInput()">+</button>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
</div>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input, ChangeDetectorRef, inject } from '@angular/core';
|
|
2
|
-
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
import { FieldType } from '../../interfaces/report-def';
|
|
4
|
-
import { AutoFocusDirective } from '../../../utilities';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'lib-in-filter',
|
|
8
|
-
templateUrl: './in-filter.component.html',
|
|
9
|
-
styleUrls: ['./in-filter.component.css'],
|
|
10
|
-
changeDetection:ChangeDetectionStrategy.OnPush,
|
|
11
|
-
providers: [{
|
|
12
|
-
provide: NG_VALUE_ACCESSOR,
|
|
13
|
-
useExisting: InFilterComponent,
|
|
14
|
-
multi: true
|
|
15
|
-
}],
|
|
16
|
-
standalone: true,
|
|
17
|
-
imports: [
|
|
18
|
-
FormsModule, AutoFocusDirective
|
|
19
|
-
]
|
|
20
|
-
})
|
|
21
|
-
export class InFilterComponent implements ControlValueAccessor {
|
|
22
|
-
private ref = inject(ChangeDetectorRef);
|
|
23
|
-
|
|
24
|
-
FieldType = FieldType;
|
|
25
|
-
@Input() type! : FieldType;
|
|
26
|
-
value: (string | number | undefined)[] = [undefined];
|
|
27
|
-
|
|
28
|
-
constructor() {
|
|
29
|
-
this.value = [undefined];
|
|
30
|
-
}
|
|
31
|
-
writeValue(obj: any[]): void {
|
|
32
|
-
if(!obj?.length) obj = [undefined];
|
|
33
|
-
this.value = obj;
|
|
34
|
-
this.ref.markForCheck();
|
|
35
|
-
}
|
|
36
|
-
onChange = (_: any) => { };
|
|
37
|
-
|
|
38
|
-
registerOnChange(fn: any): void {
|
|
39
|
-
this.onChange = fn;
|
|
40
|
-
}
|
|
41
|
-
onTouched = () => { };
|
|
42
|
-
registerOnTouched(fn: any): void {
|
|
43
|
-
this.onTouched = fn;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
addInput(){
|
|
47
|
-
this.value = [...this.value, undefined];
|
|
48
|
-
this.ref.markForCheck();
|
|
49
|
-
this.onChange(this.value);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
removeInput(index: number){
|
|
53
|
-
this.value = [...this.value];
|
|
54
|
-
this.value.splice(index,1);
|
|
55
|
-
this.ref.markForCheck();
|
|
56
|
-
this.onChange(this.value);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
onValueChange(i:number,value: number | string){
|
|
60
|
-
this.value = [...this.value];
|
|
61
|
-
this.value[i] = value;
|
|
62
|
-
this.ref.markForCheck();
|
|
63
|
-
this.onChange(this.value);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<ng-template #link let-value='value' let-element='element' let-additional="additional">
|
|
2
|
-
<tb-link-column [element]="element" [value]="value" [additional]="additional" />
|
|
3
|
-
</ng-template>
|
|
4
|
-
|
|
5
|
-
<ng-template #routerLink let-value='value' let-element='element' let-additional="additional">
|
|
6
|
-
<tb-router-link-column [element]="element" [value]="value" [additional]="additional"/>
|
|
7
|
-
</ng-template>
|
|
8
|
-
|
|
9
|
-
<ng-template #imageUrl let-value='value'>
|
|
10
|
-
<span>
|
|
11
|
-
<img src="{{value}}" height="75px" width="75px" />
|
|
12
|
-
</span>
|
|
13
|
-
</ng-template>
|
|
14
|
-
|
|
15
|
-
<ng-template #arrayNewLine let-value='value' let-element='element' let-additional="additional">
|
|
16
|
-
<tb-new-line-array-column [value]='value' [additional]='additional'/>
|
|
17
|
-
</ng-template>
|
|
18
|
-
|
|
19
|
-
<ng-template #arrayComma let-value='value' let-element='element' let-additional="additional">
|
|
20
|
-
<tb-comma-array-column [value]='value' [additional]='additional'/>
|
|
21
|
-
</ng-template>
|
|
22
|
-
|
|
23
|
-
<ng-template #default let-value='value'>
|
|
24
|
-
<span>{{ value }}</span>
|
|
25
|
-
</ng-template>
|
|
26
|
-
|
|
27
|
-
<ng-template #defaultWithIcon let-value='value'>
|
|
28
|
-
<mat-icon>{{ value}}</mat-icon>
|
|
29
|
-
</ng-template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Component, TemplateRef, ViewChild } from "@angular/core";
|
|
2
|
-
import { LinkColumnComponent, RouterLinkColumnComponent } from "../link-column.component";
|
|
3
|
-
import { ArrayCommaColumnComponent, ArrayNewLineColumnComponent } from "../array-column.component";
|
|
4
|
-
import { MatIconModule } from "@angular/material/icon";
|
|
5
|
-
import { FunctionPipe } from "../../../utilities";
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'initialization',
|
|
9
|
-
templateUrl: './initialization-component.html',
|
|
10
|
-
standalone: true,
|
|
11
|
-
imports: [
|
|
12
|
-
LinkColumnComponent, ArrayCommaColumnComponent, MatIconModule, FunctionPipe,
|
|
13
|
-
RouterLinkColumnComponent, ArrayNewLineColumnComponent
|
|
14
|
-
]
|
|
15
|
-
})
|
|
16
|
-
export class InitializationComponent {
|
|
17
|
-
@ViewChild('link', {static: true}) linkTemplate! : TemplateRef<any>;
|
|
18
|
-
@ViewChild('routerLink', {static: true}) routerLinkTemplate! : TemplateRef<any>;
|
|
19
|
-
@ViewChild('imageUrl', {static: true}) imageUrlTemplate! : TemplateRef<any>;
|
|
20
|
-
@ViewChild('arrayNewLine', {static: true}) arrayNewLineTemplate! : TemplateRef<any>;
|
|
21
|
-
@ViewChild('arrayComma', {static: true}) arrayCommaTemplate! : TemplateRef<any>;
|
|
22
|
-
@ViewChild('default', {static: true}) defaultTemplate! : TemplateRef<any>;
|
|
23
|
-
@ViewChild('defaultWithIcon', {static: true}) defaultWithIcon! : TemplateRef<any>;
|
|
24
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input } from "@angular/core";
|
|
2
|
-
import { RouterModule } from "@angular/router";
|
|
3
|
-
import { LinkInfo } from "../services/link-creator.service";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: "tb-router-link-column",
|
|
7
|
-
standalone: true,
|
|
8
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
imports: [
|
|
10
|
-
RouterModule
|
|
11
|
-
],
|
|
12
|
-
template: `
|
|
13
|
-
<a target="{{additional().target}}"
|
|
14
|
-
[routerLink]=" [link()]"
|
|
15
|
-
[queryParams]="queryParams()"
|
|
16
|
-
[fragment]="routerLinkOptions().fragment"
|
|
17
|
-
[preserveFragment]="routerLinkOptions().preserveFragment"
|
|
18
|
-
[queryParamsHandling]="routerLinkOptions().queryParamsHandling"
|
|
19
|
-
>
|
|
20
|
-
{{value()}}
|
|
21
|
-
</a>
|
|
22
|
-
`
|
|
23
|
-
})export class RouterLinkColumnComponent {
|
|
24
|
-
additional = input.required<LinkInfo>();
|
|
25
|
-
element = input.required<any>();
|
|
26
|
-
value = input.required<string>();
|
|
27
|
-
link = computed(() => this.additional().link(this.element()));
|
|
28
|
-
queryParams = computed(() => this.additional().routerLinkOptions!.queryParams(this.element()));
|
|
29
|
-
routerLinkOptions = computed(() => this.additional().routerLinkOptions!);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Component({
|
|
33
|
-
selector: "tb-link-column",
|
|
34
|
-
standalone: true,
|
|
35
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
36
|
-
template: `
|
|
37
|
-
<a target="{{additional().target}}"
|
|
38
|
-
href="{{link()}}">
|
|
39
|
-
{{value()}}
|
|
40
|
-
</a>
|
|
41
|
-
`
|
|
42
|
-
})export class LinkColumnComponent {
|
|
43
|
-
value = input.required<string>();
|
|
44
|
-
element = input.required<any>();
|
|
45
|
-
additional = input.required<LinkInfo>();
|
|
46
|
-
link = computed(() => this.additional().link(this.element()));
|
|
47
|
-
}
|