@one-paragon/angular-utilities 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +15 -27
- 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 +7 -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 +25 -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 +14 -0
- package/src/action-state/ngrx.ts +69 -0
- package/src/http-request-state/RequestStateFactory.ts +56 -0
- package/src/http-request-state/RequestStateStore.ts +284 -0
- package/{http-request-state/deprecated.d.ts → src/http-request-state/deprecated.ts} +20 -20
- package/src/http-request-state/directives/HttpStateDirectiveBase.ts +29 -0
- package/src/http-request-state/directives/http-error-state-directive.ts +21 -0
- package/src/http-request-state/directives/http-inProgress-state-directive.ts +19 -0
- package/src/http-request-state/directives/http-notStarted-state-directive.ts +19 -0
- package/src/http-request-state/directives/http-success-state-directive.ts +29 -0
- package/{http-request-state/directives/index.d.ts → src/http-request-state/directives/index.ts} +5 -5
- package/src/http-request-state/directives/request-state-directive.spec.ts +73 -0
- package/src/http-request-state/directives/request-state-directive.ts +78 -0
- package/src/http-request-state/helpers.ts +30 -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} +7 -7
- package/src/http-request-state/models/view-context.ts +18 -0
- package/src/http-request-state/observable.spec.ts +43 -0
- package/src/http-request-state/request-state.ts +66 -0
- package/src/http-request-state/rxjs/getRequestorBody.ts +10 -0
- package/src/http-request-state/rxjs/getRequestorState.ts +8 -0
- package/{http-request-state/rxjs/index.d.ts → src/http-request-state/rxjs/index.ts} +4 -4
- 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 +54 -0
- package/src/ngrx/actionable-selector.ts +160 -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} +5 -5
- package/src/rxjs/mapError.ts +8 -0
- package/src/rxjs/rxjs-operators.ts +130 -0
- package/src/rxjs/subjectifier.ts +17 -0
- package/src/rxjs/subscriber.directive.ts +57 -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 +50 -0
- package/src/table-builder/classes/TableBuilderDataSource.ts +64 -0
- package/src/table-builder/classes/TableState.ts +125 -0
- package/src/table-builder/classes/data-store.ts +10 -0
- package/{table-builder/classes/display-col.d.ts → src/table-builder/classes/display-col.ts} +5 -5
- package/src/table-builder/classes/filter-info.ts +125 -0
- package/src/table-builder/classes/table-builder-general-settings.ts +205 -0
- package/src/table-builder/classes/table-builder.ts +105 -0
- package/src/table-builder/classes/table-store.helpers.ts +104 -0
- package/src/table-builder/classes/table-store.ts +440 -0
- package/src/table-builder/components/array-column.component.ts +34 -0
- package/src/table-builder/components/column-builder/column-builder.component.html +87 -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 +129 -0
- package/src/table-builder/components/column-builder/column-helpers.ts +54 -0
- package/src/table-builder/components/column-header-menu/column-header-menu.component.html +110 -0
- package/src/table-builder/components/column-header-menu/column-header-menu.component.scss +97 -0
- package/src/table-builder/components/column-header-menu/column-header-menu.component.ts +94 -0
- package/src/table-builder/components/date-filter/date-filter.component.html +25 -0
- package/src/table-builder/components/date-filter/date-filter.component.ts +22 -0
- package/src/table-builder/components/date-time-filter/date-time-filter.component.html +11 -0
- package/src/table-builder/components/date-time-filter/date-time-filter.component.ts +20 -0
- package/src/table-builder/components/filter/filter.component.html +109 -0
- package/src/table-builder/components/filter/filter.component.scss +60 -0
- package/src/table-builder/components/filter/filter.component.spec.ts +86 -0
- package/src/table-builder/components/filter/filter.component.ts +64 -0
- package/src/table-builder/components/filter/in-list/in-list-filter.component.ts +102 -0
- package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.html +60 -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 +44 -0
- package/src/table-builder/components/generic-table/generic-table.component.html +97 -0
- package/src/table-builder/components/generic-table/generic-table.component.scss +38 -0
- package/src/table-builder/components/generic-table/generic-table.component.ts +403 -0
- package/src/table-builder/components/generic-table/paginator.component.ts +112 -0
- package/src/table-builder/components/group-by-list/group-by-list.component.css +17 -0
- package/src/table-builder/components/group-by-list/group-by-list.component.html +14 -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 +25 -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 +23 -0
- package/src/table-builder/components/in-filter/in-filter.component.ts +65 -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 +78 -0
- package/src/table-builder/components/initialization-component/initialization.component.ts +27 -0
- package/src/table-builder/components/link-column.component.ts +42 -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 +25 -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/profiles-menu/profiles-menu.component.html +77 -0
- package/src/table-builder/components/profiles-menu/profiles-menu.component.scss +126 -0
- package/src/table-builder/components/profiles-menu/profiles-menu.component.spec.ts +23 -0
- package/src/table-builder/components/profiles-menu/profiles-menu.component.ts +63 -0
- package/src/table-builder/components/reset-menu/reset-menu.component.css +3 -0
- package/src/table-builder/components/reset-menu/reset-menu.component.html +10 -0
- package/src/table-builder/components/reset-menu/reset-menu.component.ts +87 -0
- package/src/table-builder/components/scroll-strategy.ts +139 -0
- package/src/table-builder/components/sort-menu/sort-menu.component-store.ts +57 -0
- package/src/table-builder/components/sort-menu/sort-menu.component.html +115 -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 +88 -0
- package/src/table-builder/components/table-container/table-container.component.html +81 -0
- package/src/table-builder/components/table-container/table-container.component.ts +403 -0
- package/src/table-builder/components/table-container/table-container.helpers/data-state.helpers.ts +113 -0
- package/src/table-builder/components/table-container/table-container.helpers/filter-state.helpers.ts +125 -0
- package/src/table-builder/components/table-container/table-container.helpers/groupBy.helpers.ts +122 -0
- package/src/table-builder/components/table-container/table-container.helpers/meta-data.helpers.ts +16 -0
- package/src/table-builder/components/table-container/table-container.helpers/sort-state.helpers.ts +47 -0
- package/src/table-builder/components/table-container/table-container.scss +47 -0
- package/src/table-builder/components/table-container/tableProps.ts +18 -0
- package/src/table-builder/components/table-container/virtual-scroll-container.ts +216 -0
- package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.html +35 -0
- package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.ts +44 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.css +40 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.html +11 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.spec.ts +85 -0
- package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.ts +36 -0
- package/src/table-builder/components/table-container-filter/table-wrapper-filter-store.ts +23 -0
- package/src/table-builder/components/table-header-menu/table-header-menu.component.css +21 -0
- package/src/table-builder/components/table-header-menu/table-header-menu.component.html +50 -0
- package/src/table-builder/components/table-header-menu/table-header-menu.component.ts +35 -0
- package/src/table-builder/directives/custom-cell-directive.ts +57 -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 +50 -0
- package/src/table-builder/directives/resize-column.directive.ts +107 -0
- package/src/table-builder/directives/table-wrapper.directive.ts +13 -0
- package/src/table-builder/directives/tb-filter.directive.ts +376 -0
- package/src/table-builder/enums/filterTypes.ts +40 -0
- package/src/table-builder/functions/boolean-filter-function.ts +12 -0
- package/src/table-builder/functions/date-filter-function.ts +78 -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 +41 -0
- package/src/table-builder/functions/sort-data-function.ts +80 -0
- package/src/table-builder/functions/string-filter-function.ts +53 -0
- package/{table-builder/interfaces/ColumnInfo.d.ts → src/table-builder/interfaces/ColumnInfo.ts} +7 -6
- package/{table-builder/interfaces/dictionary.d.ts → src/table-builder/interfaces/dictionary.ts} +3 -3
- package/src/table-builder/interfaces/report-def.ts +254 -0
- package/src/table-builder/ngrx/tableBuilderStateStore.ts +197 -0
- package/src/table-builder/pipes/column-total.pipe.ts +16 -0
- package/src/table-builder/pipes/format-filter-type.pipe.ts +12 -0
- package/src/table-builder/pipes/format-filter-value.pipe.ts +67 -0
- package/src/table-builder/pipes/key-display.ts +13 -0
- package/src/table-builder/services/export-to-csv.service.ts +113 -0
- package/src/table-builder/services/link-creator.service.ts +98 -0
- package/src/table-builder/services/table-template-service.ts +47 -0
- package/src/table-builder/services/transform-creator.ts +96 -0
- package/src/table-builder/specs/table-custom-filters.spec.ts +262 -0
- package/src/table-builder/styles/collapser.styles.scss +16 -0
- package/src/table-builder/table-builder.module.ts +38 -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 +15 -0
- package/src/utilities/directives/clickSubject.ts +19 -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 +144 -0
- package/src/utilities/directives/mat-toggle-group-directive.ts +60 -0
- package/src/utilities/directives/prevent-enter.directive.ts +12 -0
- package/src/utilities/directives/stop-propagation.directive.ts +19 -0
- package/src/utilities/directives/styler.ts +44 -0
- package/src/utilities/directives/trim-whitespace.directive.ts +20 -0
- package/{utilities/index.d.ts → src/utilities/index.ts} +22 -15
- package/src/utilities/module.ts +53 -0
- package/src/utilities/pipes/function.pipe.ts +21 -0
- package/src/utilities/pipes/phone.pipe.ts +20 -0
- package/src/utilities/pipes/space-case.pipes.spec.ts +47 -0
- package/src/utilities/pipes/space-case.pipes.ts +26 -0
- package/tsconfig.lib.json +20 -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/fesm2022/one-paragon-angular-utilities.mjs +0 -6531
- package/fesm2022/one-paragon-angular-utilities.mjs.map +0 -1
- package/http-request-state/RequestStateFactory.d.ts +0 -17
- package/http-request-state/RequestStateStore.d.ts +0 -101
- package/http-request-state/directives/HttpStateDirectiveBase.d.ts +0 -14
- package/http-request-state/directives/http-error-state-directive.d.ts +0 -10
- package/http-request-state/directives/http-inProgress-state-directive.d.ts +0 -10
- package/http-request-state/directives/http-notStarted-state-directive.d.ts +0 -10
- package/http-request-state/directives/http-success-state-directive.d.ts +0 -17
- package/http-request-state/directives/request-state-directive.d.ts +0 -34
- package/http-request-state/helpers.d.ts +0 -9
- package/http-request-state/http-state-module.d.ts +0 -11
- package/http-request-state/request-state.d.ts +0 -12
- 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 -41
- package/index.d.ts +0 -5
- package/ngrx/actionable-selector.d.ts +0 -32
- 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 -10
- package/rxjs/subscriber.directive.d.ts +0 -14
- 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 -23
- package/table-builder/classes/TableBuilderDataSource.d.ts +0 -18
- package/table-builder/classes/TableState.d.ts +0 -81
- package/table-builder/classes/data-store.d.ts +0 -8
- package/table-builder/classes/filter-info.d.ts +0 -39
- package/table-builder/classes/table-builder-general-settings.d.ts +0 -119
- package/table-builder/classes/table-builder.d.ts +0 -22
- package/table-builder/classes/table-store.d.ts +0 -146
- package/table-builder/classes/table-store.helpers.d.ts +0 -31
- package/table-builder/components/array-column.component.d.ts +0 -15
- package/table-builder/components/column-builder/column-builder.component.d.ts +0 -41
- package/table-builder/components/column-builder/column-helpers.d.ts +0 -38
- package/table-builder/components/column-header-menu/column-header-menu.component.d.ts +0 -50
- package/table-builder/components/date-filter/date-filter.component.d.ts +0 -37
- package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +0 -37
- package/table-builder/components/filter/filter.component.d.ts +0 -48
- package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +0 -22
- package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +0 -17
- package/table-builder/components/generic-table/generic-table.component.d.ts +0 -85
- package/table-builder/components/generic-table/paginator.component.d.ts +0 -26
- package/table-builder/components/group-by-list/group-by-list.component.d.ts +0 -11
- package/table-builder/components/in-filter/in-filter.component.d.ts +0 -20
- package/table-builder/components/initialization-component/initialization.component.d.ts +0 -15
- package/table-builder/components/link-column.component.d.ts +0 -23
- package/table-builder/components/number-filter/number-filter.component.d.ts +0 -39
- package/table-builder/components/profiles-menu/profiles-menu.component.d.ts +0 -33
- package/table-builder/components/reset-menu/reset-menu.component.d.ts +0 -25
- package/table-builder/components/scroll-strategy.d.ts +0 -45
- 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 -19
- package/table-builder/components/table-container/table-container.component.d.ts +0 -104
- package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +0 -7
- package/table-builder/components/table-container/table-container.helpers/filter-state.helpers.d.ts +0 -19
- package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +0 -19
- package/table-builder/components/table-container/table-container.helpers/meta-data.helpers.d.ts +0 -2
- package/table-builder/components/table-container/table-container.helpers/sort-state.helpers.d.ts +0 -12
- package/table-builder/components/table-container/tableProps.d.ts +0 -10
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +0 -40
- package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +0 -15
- package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +0 -12
- package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +0 -14
- package/table-builder/components/table-header-menu/table-header-menu.component.d.ts +0 -15
- package/table-builder/directives/custom-cell-directive.d.ts +0 -34
- package/table-builder/directives/multi-sort.directive.d.ts +0 -10
- 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 -116
- package/table-builder/enums/filterTypes.d.ts +0 -36
- 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 -5
- package/table-builder/interfaces/report-def.d.ts +0 -223
- package/table-builder/ngrx/tableBuilderStateStore.d.ts +0 -69
- 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 -11
- package/table-builder/pipes/key-display.d.ts +0 -9
- package/table-builder/services/export-to-csv.service.d.ts +0 -14
- package/table-builder/services/link-creator.service.d.ts +0 -16
- package/table-builder/services/table-template-service.d.ts +0 -14
- package/table-builder/services/transform-creator.d.ts +0 -9
- package/table-builder/table-builder.module.d.ts +0 -14
- package/utilities/array-helpers.d.ts +0 -1
- package/utilities/directives/auto-focus.directive.d.ts +0 -9
- 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 -12
- package/utilities/directives/dialog-service.d.ts +0 -10
- package/utilities/directives/dialog.d.ts +0 -45
- 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 -7
- package/utilities/module.d.ts +0 -19
- package/utilities/pipes/function.pipe.d.ts +0 -11
- package/utilities/pipes/phone.pipe.d.ts +0 -8
- package/utilities/pipes/space-case.pipes.d.ts +0 -17
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ChangeDetectorRef, inject, input } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { FieldType } from '../../interfaces/report-def';
|
|
4
|
+
import { AutoFocusDirective } from '../../../utilities';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'lib-in-filter',
|
|
8
|
+
templateUrl: './in-filter.component.html',
|
|
9
|
+
styleUrls: ['./in-filter.component.css'],
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
providers: [{
|
|
12
|
+
provide: NG_VALUE_ACCESSOR,
|
|
13
|
+
useExisting: InFilterComponent,
|
|
14
|
+
multi: true
|
|
15
|
+
}],
|
|
16
|
+
imports: [
|
|
17
|
+
FormsModule, AutoFocusDirective
|
|
18
|
+
]
|
|
19
|
+
})
|
|
20
|
+
export class InFilterComponent implements ControlValueAccessor {
|
|
21
|
+
private ref = inject(ChangeDetectorRef);
|
|
22
|
+
|
|
23
|
+
FieldType = FieldType;
|
|
24
|
+
$type = input.required<FieldType>({ alias: 'type' })
|
|
25
|
+
value: (string | number | undefined)[] = [undefined];
|
|
26
|
+
|
|
27
|
+
constructor() {
|
|
28
|
+
this.value = [undefined];
|
|
29
|
+
}
|
|
30
|
+
writeValue(obj: any[]): void {
|
|
31
|
+
if(!obj?.length) obj = [undefined];
|
|
32
|
+
this.value = obj;
|
|
33
|
+
this.ref.markForCheck();
|
|
34
|
+
}
|
|
35
|
+
onChange = (_: any) => { };
|
|
36
|
+
|
|
37
|
+
registerOnChange(fn: any): void {
|
|
38
|
+
this.onChange = fn;
|
|
39
|
+
}
|
|
40
|
+
onTouched = () => { };
|
|
41
|
+
registerOnTouched(fn: any): void {
|
|
42
|
+
this.onTouched = fn;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
addInput(){
|
|
46
|
+
this.value = [...this.value, undefined];
|
|
47
|
+
this.ref.markForCheck();
|
|
48
|
+
this.onChange(this.value);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
removeInput(index: number){
|
|
52
|
+
this.value = [...this.value];
|
|
53
|
+
this.value.splice(index, 1);
|
|
54
|
+
this.ref.markForCheck();
|
|
55
|
+
this.onChange(this.value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
onValueChange(i:number, value: number | string){
|
|
59
|
+
this.value = [...this.value];
|
|
60
|
+
this.value[i] = value;
|
|
61
|
+
this.ref.markForCheck();
|
|
62
|
+
this.onChange(this.value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './date-filter/date-filter.component';
|
|
2
|
-
export * from './filter/filter.component';
|
|
3
|
-
export * from './gen-col-displayer/gen-col-displayer.component';
|
|
4
|
-
export * from './table-container-filter/gen-filter-displayer/gen-filter-displayer.component';
|
|
5
|
-
export * from './table-container-filter/filter-list/filter-list.component';
|
|
6
|
-
export * from './generic-table/generic-table.component';
|
|
7
|
-
export * from './table-container/table-container.component';
|
|
8
|
-
export * from './generic-table/paginator.component';
|
|
9
|
-
export * from './group-by-list/group-by-list.component';
|
|
1
|
+
export * from './date-filter/date-filter.component';
|
|
2
|
+
export * from './filter/filter.component';
|
|
3
|
+
export * from './gen-col-displayer/gen-col-displayer.component';
|
|
4
|
+
export * from './table-container-filter/gen-filter-displayer/gen-filter-displayer.component';
|
|
5
|
+
export * from './table-container-filter/filter-list/filter-list.component';
|
|
6
|
+
export * from './generic-table/generic-table.component';
|
|
7
|
+
export * from './table-container/table-container.component';
|
|
8
|
+
export * from './generic-table/paginator.component';
|
|
9
|
+
export * from './group-by-list/group-by-list.component';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<ng-template #link let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
|
|
2
|
+
@let link = additional.link | func : element;
|
|
3
|
+
@if(link)
|
|
4
|
+
{
|
|
5
|
+
<tb-link-column [element]="element" [additional]="additional" [link]="$any(link)">
|
|
6
|
+
<span [styler]="styles" [element]="element">{{value}}</span>
|
|
7
|
+
</tb-link-column>
|
|
8
|
+
}
|
|
9
|
+
@else
|
|
10
|
+
{
|
|
11
|
+
<span [styler]="styles" [element]="element">{{value}}</span>
|
|
12
|
+
}
|
|
13
|
+
</ng-template>
|
|
14
|
+
|
|
15
|
+
<ng-template #routerLink let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
|
|
16
|
+
@let link = additional.link | func : element;
|
|
17
|
+
@if(link)
|
|
18
|
+
{
|
|
19
|
+
<tb-router-link-column [element]="element" [additional]="additional" [link]="$any(link)">
|
|
20
|
+
<span [styler]="styles" [element]="element">{{value}}</span>
|
|
21
|
+
</tb-router-link-column>
|
|
22
|
+
}
|
|
23
|
+
@else
|
|
24
|
+
{
|
|
25
|
+
<span [styler]="styles" [element]="element">{{value}}</span>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
</ng-template>
|
|
29
|
+
|
|
30
|
+
<ng-template #linkWithIcon let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
|
|
31
|
+
@let link = additional.link | func : element;
|
|
32
|
+
@if(link)
|
|
33
|
+
{
|
|
34
|
+
<tb-link-column [element]="element" [additional]="additional" [link]="$any(link)">
|
|
35
|
+
<mat-icon [styler]="styles" [element]="element">{{ value}}</mat-icon>
|
|
36
|
+
</tb-link-column>
|
|
37
|
+
}
|
|
38
|
+
@else
|
|
39
|
+
{
|
|
40
|
+
<span [styler]="styles" [element]="element">{{value}}</span>
|
|
41
|
+
}
|
|
42
|
+
</ng-template>
|
|
43
|
+
|
|
44
|
+
<ng-template #routerLinkWithIcon let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
|
|
45
|
+
@let link = additional.link | func : element;
|
|
46
|
+
@if(link)
|
|
47
|
+
{
|
|
48
|
+
<tb-link-column [element]="element" [additional]="additional" [link]="$any(link)">
|
|
49
|
+
<mat-icon [styler]="styles" [element]="element">{{ value}}</mat-icon>
|
|
50
|
+
</tb-link-column>
|
|
51
|
+
}
|
|
52
|
+
@else
|
|
53
|
+
{
|
|
54
|
+
<mat-icon [styler]="styles" [element]="element">{{ value}}</mat-icon>
|
|
55
|
+
}
|
|
56
|
+
</ng-template>
|
|
57
|
+
|
|
58
|
+
<ng-template #imageUrl let-value='value'>
|
|
59
|
+
<span>
|
|
60
|
+
<img height="75px" width="75px" [src]="value" />
|
|
61
|
+
</span>
|
|
62
|
+
</ng-template>
|
|
63
|
+
|
|
64
|
+
<ng-template #arrayNewLine let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
|
|
65
|
+
<tb-new-line-array-column [value]='value' [additional]='additional' [styler]="styles" [element]="element"/>
|
|
66
|
+
</ng-template>
|
|
67
|
+
|
|
68
|
+
<ng-template #arrayComma let-value='value' let-element='element' let-additional="additional" let-styles="innerStyles">
|
|
69
|
+
<tb-comma-array-column [value]='value' [additional]='additional' [styler]="styles" [element]="element"/>
|
|
70
|
+
</ng-template>
|
|
71
|
+
|
|
72
|
+
<ng-template #default let-value='value' let-element='element' let-styles="innerStyles">
|
|
73
|
+
<span [styler]="styles" [element]="element">{{value}}</span>
|
|
74
|
+
</ng-template>
|
|
75
|
+
|
|
76
|
+
<ng-template #defaultWithIcon let-value='value' let-element='element' let-styles="innerStyles">
|
|
77
|
+
<mat-icon [styler]="styles" [element]="element">{{value}}</mat-icon>
|
|
78
|
+
</ng-template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component, TemplateRef, viewChild } from "@angular/core";
|
|
2
|
+
import { LinkColumnComponent, RouterLinkColumnComponent } from "../link-column.component";
|
|
3
|
+
import { ArrayCommaColumnComponent, ArrayNewLineColumnComponent } from "../array-column.component";
|
|
4
|
+
import { MatIcon } from "@angular/material/icon";
|
|
5
|
+
import { StylerDirective } from "../../../utilities/directives/styler";
|
|
6
|
+
import { FunctionPipe } from "../../../utilities";
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'initialization',
|
|
10
|
+
templateUrl: './initialization.component.html',
|
|
11
|
+
imports: [
|
|
12
|
+
LinkColumnComponent, ArrayCommaColumnComponent, MatIcon,
|
|
13
|
+
RouterLinkColumnComponent, ArrayNewLineColumnComponent,
|
|
14
|
+
StylerDirective, FunctionPipe
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
export class InitializationComponent {
|
|
18
|
+
$linkTemplate = viewChild.required<TemplateRef<any>>('link');
|
|
19
|
+
$routerLinkTemplate = viewChild.required<TemplateRef<any>>('routerLink');
|
|
20
|
+
$linkWithIconTemplate = viewChild.required<TemplateRef<any>>('linkWithIcon');
|
|
21
|
+
$routerLinkWithIconTemplate = viewChild.required<TemplateRef<any>>('routerLinkWithIcon');
|
|
22
|
+
$imageUrlTemplate = viewChild.required<TemplateRef<any>>('imageUrl');
|
|
23
|
+
$arrayNewLineTemplate = viewChild.required<TemplateRef<any>>('arrayNewLine');
|
|
24
|
+
$arrayCommaTemplate = viewChild.required<TemplateRef<any>>('arrayComma');
|
|
25
|
+
$defaultTemplate = viewChild.required<TemplateRef<any>>('default');
|
|
26
|
+
$defaultWithIcon = viewChild.required<TemplateRef<any>>('defaultWithIcon');
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, input } from "@angular/core";
|
|
2
|
+
import { RouterModule } from "@angular/router";
|
|
3
|
+
import { LinkInfo } from "../services/link-creator.service";
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: "tb-router-link-column",
|
|
7
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8
|
+
imports: [
|
|
9
|
+
RouterModule
|
|
10
|
+
],
|
|
11
|
+
template: `
|
|
12
|
+
<a target="{{additional().target}}"
|
|
13
|
+
[routerLink]=" [link()]"
|
|
14
|
+
[queryParams]="queryParams()"
|
|
15
|
+
[fragment]="routerLinkOptions().fragment"
|
|
16
|
+
[preserveFragment]="routerLinkOptions().preserveFragment"
|
|
17
|
+
[queryParamsHandling]="routerLinkOptions().queryParamsHandling"
|
|
18
|
+
>
|
|
19
|
+
<ng-content></ng-content>
|
|
20
|
+
</a>
|
|
21
|
+
`
|
|
22
|
+
}) export class RouterLinkColumnComponent {
|
|
23
|
+
additional = input.required<LinkInfo>();
|
|
24
|
+
element = input.required<any>();
|
|
25
|
+
queryParams = computed(() => this.additional().routerLinkOptions!.queryParams(this.element()));
|
|
26
|
+
routerLinkOptions = computed(() => this.additional().routerLinkOptions!);
|
|
27
|
+
link = input.required<string>();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Component({
|
|
31
|
+
selector: "tb-link-column",
|
|
32
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
33
|
+
template: `
|
|
34
|
+
<a target="{{additional().target}}" href="{{link()}}">
|
|
35
|
+
<ng-content></ng-content>
|
|
36
|
+
</a>
|
|
37
|
+
`
|
|
38
|
+
}) export class LinkColumnComponent {
|
|
39
|
+
element = input.required<any>();
|
|
40
|
+
additional = input.required<LinkInfo>();
|
|
41
|
+
link = input.required<string>();
|
|
42
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@let CurrentFilterType = $currentFilterType();
|
|
2
|
+
@let info = $info();
|
|
3
|
+
|
|
4
|
+
@if(CurrentFilterType !== FilterType.NumberBetween && CurrentFilterType !== FilterType.IsNull && CurrentFilterType !== FilterType.In)
|
|
5
|
+
{
|
|
6
|
+
<mat-form-field class="my-filter">
|
|
7
|
+
<input matInput name="filterValue" type="number" [ngModel]="info.filterValue"/>
|
|
8
|
+
</mat-form-field>
|
|
9
|
+
}
|
|
10
|
+
@if(CurrentFilterType === FilterType.NumberBetween)
|
|
11
|
+
{
|
|
12
|
+
<ng-container ngModelGroup="filterValue" >
|
|
13
|
+
<mat-form-field class="my-filter">
|
|
14
|
+
<input matInput name="Start" placeholder="Start" type="number" [ngModel]="info.filterValue?.Start"/>
|
|
15
|
+
</mat-form-field>
|
|
16
|
+
<mat-form-field class="my-filter">
|
|
17
|
+
<input matInput name="End" placeholder="End" type="number" [ngModel]="info.filterValue?.End"/>
|
|
18
|
+
</mat-form-field>
|
|
19
|
+
</ng-container>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@if (CurrentFilterType === FilterType.In)
|
|
23
|
+
{
|
|
24
|
+
<lib-in-filter name='filterValue' [type]="FieldType.Number" [(ngModel)]='info.filterValue' />
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
import { FieldType } from 'projects/angular-utilities/src/public-api';
|
|
3
|
+
|
|
4
|
+
import { NumberFilterComponent } from './number-filter.component';
|
|
5
|
+
|
|
6
|
+
describe('NumberFilterComponent', () => {
|
|
7
|
+
let component: NumberFilterComponent;
|
|
8
|
+
let fixture: ComponentFixture<NumberFilterComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(waitForAsync(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [NumberFilterComponent]
|
|
13
|
+
})
|
|
14
|
+
.compileComponents();
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
fixture = TestBed.createComponent(NumberFilterComponent);
|
|
19
|
+
component = fixture.componentInstance;
|
|
20
|
+
component.info = {
|
|
21
|
+
key: '',
|
|
22
|
+
fieldType: FieldType.Unknown
|
|
23
|
+
};
|
|
24
|
+
fixture.detectChanges();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should create', () => {
|
|
28
|
+
expect(component).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, input } from '@angular/core';
|
|
2
|
+
import { FilterType } from '../../enums/filterTypes';
|
|
3
|
+
import { ControlContainer, FormsModule, NgForm } from '@angular/forms';
|
|
4
|
+
import { PartialFilter } from '../../classes/filter-info';
|
|
5
|
+
import { FieldType } from '../../interfaces/report-def';
|
|
6
|
+
import { MatInputModule } from '@angular/material/input';
|
|
7
|
+
import { InFilterComponent } from '../in-filter/in-filter.component';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'tb-number-filter',
|
|
12
|
+
templateUrl: './number-filter.component.html',
|
|
13
|
+
styleUrls: ['./number-filter.component.css'],
|
|
14
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
|
|
16
|
+
imports: [
|
|
17
|
+
MatInputModule, FormsModule, InFilterComponent
|
|
18
|
+
]
|
|
19
|
+
})
|
|
20
|
+
export class NumberFilterComponent {
|
|
21
|
+
FilterType = FilterType;
|
|
22
|
+
FieldType = FieldType;
|
|
23
|
+
$currentFilterType = input.required<FilterType>({ alias: 'CurrentFilterType' });
|
|
24
|
+
$info = input.required<PartialFilter>({ alias: 'info' })
|
|
25
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@if(!$isMatMenuChild())
|
|
2
|
+
{
|
|
3
|
+
<button #trigger="matMenuTrigger" color="primary" mat-icon-button [matMenuTriggerFor]="menu" [matTooltip]="'Profiles'">
|
|
4
|
+
<mat-icon color="primary">people</mat-icon>
|
|
5
|
+
</button>
|
|
6
|
+
}
|
|
7
|
+
<mat-menu #menu="matMenu" (closed)="addedKey.value = null; allProfilesPanelOpened.set(false); newProfilePanelOpened.set(false)">
|
|
8
|
+
@if(!!$currentProfile())
|
|
9
|
+
{
|
|
10
|
+
<div mat-menu-item mat-stroked-button [matTooltip]="'Save Profile'" (click)="saveState($currentProfile()!)">
|
|
11
|
+
<mat-icon color="primary">save</mat-icon>
|
|
12
|
+
<span>{{$currentProfile()}}</span>
|
|
13
|
+
</div>
|
|
14
|
+
}
|
|
15
|
+
@else
|
|
16
|
+
{
|
|
17
|
+
<div class="profile-line">
|
|
18
|
+
<button color="primary" class="first-in-line first-button" mat-stroked-button (click)="addState(defaultName, m.checked);">
|
|
19
|
+
<mat-icon class="save-for-default-icon button-save-icon" color="primary">save</mat-icon>
|
|
20
|
+
<span>Save as <span class="current-name">{{defaultName}}</span> </span>
|
|
21
|
+
</button>
|
|
22
|
+
<button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Created As Default'" (click)="m.toggle()" >
|
|
23
|
+
<mat-icon style="color: green;">{{m.checked ? 'star' : 'star_border'}}</mat-icon>
|
|
24
|
+
</button>
|
|
25
|
+
<mat-checkbox #m class="display-none" [checked]="true" />
|
|
26
|
+
</div>
|
|
27
|
+
}
|
|
28
|
+
@if (allProfilesPanelOpened()) {<hr class="divider"/>}
|
|
29
|
+
<div mat-menu-item stop-propagation [class]="{ hide: !$keys().length, 'all-profile-row': true }" (click)="allProfilesPanelOpened.set(!allProfilesPanelOpened())">
|
|
30
|
+
<div class="all-profiles">
|
|
31
|
+
<span>All Profiles</span>
|
|
32
|
+
<span class="arrow" [class]="`${(allProfilesPanelOpened() ? 'all-profile-arrow-close' : 'all-profile-arrow-open')} all-profile-arrow`"></span>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div [class]="{ hide: !allProfilesPanelOpened(), panel: true }">
|
|
36
|
+
@for (key of $keys() ; track key)
|
|
37
|
+
{
|
|
38
|
+
<div class="profile-line" [class]="key === $currentProfile() ? 'current-in-list' : 'not-current-in-list'">
|
|
39
|
+
<button class="menu-item first-in-line" mat-stroked-button [matTooltip]="'Select Profile'" (click)='stateService.setLocalCurrentState({ tableId: $tableId(), currentStateKey: key})'>
|
|
40
|
+
<span>{{key}}</span>
|
|
41
|
+
</button>
|
|
42
|
+
@if(key !== $defaultProfile())
|
|
43
|
+
{
|
|
44
|
+
<button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Default'" (click)="setDefault(key)">
|
|
45
|
+
<mat-icon style="color: green;">star_border</mat-icon>
|
|
46
|
+
</button>
|
|
47
|
+
}
|
|
48
|
+
@else
|
|
49
|
+
{
|
|
50
|
+
<button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Default'" (click)="unsetDefault()">
|
|
51
|
+
<mat-icon style="color: green;">star</mat-icon>
|
|
52
|
+
</button>
|
|
53
|
+
}
|
|
54
|
+
<button color="warn" class="last-in-line" stop-propagation mat-icon-button [matTooltip]="'Delete Profile'" (click)='stateService.deleteProfileFromLocalAndStorage($tableId(), key)'>
|
|
55
|
+
<mat-icon color='warn'>delete_forever</mat-icon>
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
}
|
|
59
|
+
<hr class="divider"/>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="add-new-profile-row" mat-menu-item stop-propagation (click)="newProfilePanelOpened.set(!newProfilePanelOpened()); addedKey.focus()">Add New Profile</div>
|
|
62
|
+
<div [class]="{ hide: !newProfilePanelOpened(), panel: true }" >
|
|
63
|
+
<div class="profile-line" stop-propagation>
|
|
64
|
+
<div class="new-name-input">
|
|
65
|
+
<i class="input-hint">Enter New Name</i>
|
|
66
|
+
<input #addedKey="matInput" matInput [name]="'key'" />
|
|
67
|
+
</div>
|
|
68
|
+
<button stop-propagation mat-icon-button [matTooltip]="'Toggle Profile Being Created As Default'" (click)="m2.toggle()" >
|
|
69
|
+
<mat-icon style="color: green;">{{m2.checked ? 'star' : 'star_border'}}</mat-icon>
|
|
70
|
+
</button>
|
|
71
|
+
<mat-checkbox #m2 class="display-none" [ngModel]="!$defaultProfile()" />
|
|
72
|
+
</div>
|
|
73
|
+
<button class="add-button" color="primary" mat-raised-button [matTooltip]="'Create New Profile'" [disabled]="!addedKey.value" (click)="addState(addedKey.value, m2.checked); addedKey.value = null">
|
|
74
|
+
Add
|
|
75
|
+
</button>
|
|
76
|
+
</div>
|
|
77
|
+
</mat-menu>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
|
|
2
|
+
:host ::ng-deep .mat-expansion-panel-header{
|
|
3
|
+
padding: 0;
|
|
4
|
+
}
|
|
5
|
+
.current-name{
|
|
6
|
+
color: var(tb-current-profile, blue);
|
|
7
|
+
}
|
|
8
|
+
.menu-item{
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
width: initial;
|
|
11
|
+
flex-grow: 1;
|
|
12
|
+
}
|
|
13
|
+
.profile-line{
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
.first-in-line{
|
|
19
|
+
--f-b: 2rem;
|
|
20
|
+
margin-left: var(--mat-menu-item-with-icon-leading-spacing);
|
|
21
|
+
&.first-button{
|
|
22
|
+
height: var(--f-b);
|
|
23
|
+
margin: .2rem;
|
|
24
|
+
}
|
|
25
|
+
.button-save-icon{
|
|
26
|
+
height: var(--f-b);
|
|
27
|
+
width: var(--f-b);
|
|
28
|
+
font-size: var(--f-b);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.main-save-button{
|
|
32
|
+
height: 4rem;
|
|
33
|
+
width: 4rem;
|
|
34
|
+
padding: .5rem;
|
|
35
|
+
mat-icon{
|
|
36
|
+
height: 3rem;
|
|
37
|
+
width: 3rem;
|
|
38
|
+
font-size: 3rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.save-for-default-icon{
|
|
42
|
+
margin: 0;
|
|
43
|
+
}
|
|
44
|
+
.display-none{
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
.last-in-line{
|
|
48
|
+
padding-right: var(--mat-menu-item-with-icon-trailing-spacing);
|
|
49
|
+
}
|
|
50
|
+
.default-cursor{
|
|
51
|
+
cursor: default;
|
|
52
|
+
}
|
|
53
|
+
.as-def{
|
|
54
|
+
padding-left: var(--mat-menu-item-with-icon-leading-spacing);
|
|
55
|
+
}
|
|
56
|
+
.divider{
|
|
57
|
+
margin: .2px 0;
|
|
58
|
+
}
|
|
59
|
+
.add-key{
|
|
60
|
+
max-width: 8.5rem;
|
|
61
|
+
margin-left: 2px;
|
|
62
|
+
::ng-deep{
|
|
63
|
+
.mdc-text-field{
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.panel{
|
|
69
|
+
transition: height .1s
|
|
70
|
+
}
|
|
71
|
+
.hide{
|
|
72
|
+
height: 0;
|
|
73
|
+
min-height: 0;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
}
|
|
76
|
+
.open-panel-button{
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 2.5rem;
|
|
79
|
+
}
|
|
80
|
+
.current-in-list{
|
|
81
|
+
border-left: 3px solid blue;
|
|
82
|
+
background-color: #0000ff0d;
|
|
83
|
+
}
|
|
84
|
+
.not-current-in-list{
|
|
85
|
+
border-left: 3px solid rgba(255, 255, 255, 0);
|
|
86
|
+
}
|
|
87
|
+
.add-new-profile-row, .all-profile-row{
|
|
88
|
+
border-top: rgb(128 128 128 / 25%) solid 1px;
|
|
89
|
+
}
|
|
90
|
+
.all-profiles{
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
&:has(.all-profile-arrow-close){
|
|
94
|
+
align-items: center;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
.all-profile-arrow{
|
|
98
|
+
display: inline-block;
|
|
99
|
+
height: .7rem;
|
|
100
|
+
width: .7rem;
|
|
101
|
+
border-color: black;
|
|
102
|
+
transform: rotate(-45deg);
|
|
103
|
+
&-open{
|
|
104
|
+
border-left: solid 2px;
|
|
105
|
+
border-bottom: solid 2px;
|
|
106
|
+
}
|
|
107
|
+
&-close{
|
|
108
|
+
border-right: solid 2px;
|
|
109
|
+
border-top: solid 2px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
.new-name-input{
|
|
113
|
+
margin-left: 3px;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
.input-hint{
|
|
117
|
+
font-size: smaller;
|
|
118
|
+
font-weight: 200;
|
|
119
|
+
color: gray;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
.add-button{
|
|
123
|
+
height: 20px;
|
|
124
|
+
line-height: 20px;
|
|
125
|
+
margin: 3px 0 0 3px;
|
|
126
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ProfilesMenuComponent } from './profiles-menu.component';
|
|
4
|
+
|
|
5
|
+
describe('ProfilesMenuComponent', () => {
|
|
6
|
+
let component: ProfilesMenuComponent;
|
|
7
|
+
let fixture: ComponentFixture<ProfilesMenuComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ProfilesMenuComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ProfilesMenuComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Component, computed, inject, input, output, signal, viewChild } from '@angular/core';
|
|
2
|
+
import { TableBuilderStateStore } from '../../ngrx/tableBuilderStateStore';
|
|
3
|
+
import { MatMenu, MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
|
|
4
|
+
import { MatIcon } from '@angular/material/icon';
|
|
5
|
+
import { TableStore } from '../../classes/table-store';
|
|
6
|
+
import { MatTooltip } from '@angular/material/tooltip';
|
|
7
|
+
import { MatButton, MatIconButton } from '@angular/material/button';
|
|
8
|
+
import { StopPropagationDirective } from '../../../utilities';
|
|
9
|
+
import { MatInput, MatInputModule } from '@angular/material/input';
|
|
10
|
+
import { MatCheckbox } from '@angular/material/checkbox';
|
|
11
|
+
import { Subject } from 'rxjs';
|
|
12
|
+
import { FormsModule } from '@angular/forms';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'tb-profiles-menu',
|
|
16
|
+
imports: [MatIcon, MatTooltip, MatIconButton, MatMenuModule, MatButton, MatInput,
|
|
17
|
+
MatCheckbox, StopPropagationDirective, MatInputModule, FormsModule
|
|
18
|
+
],
|
|
19
|
+
templateUrl: './profiles-menu.component.html',
|
|
20
|
+
styleUrl: './profiles-menu.component.scss'
|
|
21
|
+
})
|
|
22
|
+
export class ProfilesMenuComponent {
|
|
23
|
+
stateService = inject(TableBuilderStateStore);
|
|
24
|
+
tableStore = inject(TableStore);
|
|
25
|
+
$tableId = input.required<string>({ alias: 'tableId' });
|
|
26
|
+
$isMatMenuChild = input<boolean>(false, { alias: 'isMatMenuChild' });
|
|
27
|
+
trigger = viewChild<MatMenuTrigger>('trigger');
|
|
28
|
+
menu = viewChild.required(MatMenu)
|
|
29
|
+
allProfilesPanelOpened = signal(false);
|
|
30
|
+
newProfilePanelOpened = signal(false);
|
|
31
|
+
$currentProfile = computed(() => this.stateService.$selectLocalProfileCurrentKey(this.$tableId())());
|
|
32
|
+
$defaultProfile = computed(() => this.stateService.$selectLocalProfileDefaultKey(this.$tableId())());
|
|
33
|
+
$keys = computed(() => this.stateService.$selectLocalProfileKeys(this.$tableId())());
|
|
34
|
+
saveState(key: string) {
|
|
35
|
+
const tableState = this.tableStore.$savableState();
|
|
36
|
+
this.stateService.saveTableSettingsToLocalAndStorage(this.$tableId(), key, tableState);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
addState(key: string, asDefault: boolean){
|
|
40
|
+
const tableState = this.tableStore.$savableState();
|
|
41
|
+
this.stateService.addNewStateToLocalAndStorage(this.$tableId(), key, tableState, asDefault);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
setDefault(key: string){
|
|
45
|
+
this.stateService.setDefaultInLocalAndStorage(this.$tableId(), key);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
unsetDefault(){
|
|
49
|
+
this.stateService.unsetDefaultFromLocalAndStorage(this.$tableId());
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
defaultName = 'My Profile';
|
|
53
|
+
position$ = new Subject<{ top: string, right: string} | undefined>();
|
|
54
|
+
setPosition = (e: HTMLElement) => {
|
|
55
|
+
const rect = e.getBoundingClientRect();
|
|
56
|
+
if(rect.top === 0) return;
|
|
57
|
+
const a = {
|
|
58
|
+
right: `${(window.innerWidth - rect.right)}px`,
|
|
59
|
+
top: `${rect.top}px`,
|
|
60
|
+
}
|
|
61
|
+
return a;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<mat-menu #menu2="matMenu">
|
|
2
|
+
@if($set().length > 1)
|
|
3
|
+
{
|
|
4
|
+
<button mat-menu-item (click)="state.resetState()">All</button>
|
|
5
|
+
}
|
|
6
|
+
@for (item of $set(); track $index)
|
|
7
|
+
{
|
|
8
|
+
<button mat-menu-item (click)="state.resetPart(item)">Reset {{item}}</button>
|
|
9
|
+
}
|
|
10
|
+
</mat-menu>
|