From ea2d5fc69b114ee9a8d117f55865a34e2efc0303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 2 Dec 2021 01:51:53 +0200 Subject: [PATCH] Some fixes, bulk actions WIP --- src/assets/styles/common-components.scss | 1 + src/lib/buttons/circle-button/circle-button.component.scss | 7 +++++-- src/lib/listing/services/listing.service.ts | 7 +++++-- .../workflow/column-header/column-header.component.html | 2 ++ .../workflow/column-header/column-header.component.ts | 3 ++- src/lib/listing/workflow/workflow.component.html | 2 +- src/lib/listing/workflow/workflow.component.ts | 1 + 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/assets/styles/common-components.scss b/src/assets/styles/common-components.scss index 7733b63..5c57d45 100644 --- a/src/assets/styles/common-components.scss +++ b/src/assets/styles/common-components.scss @@ -131,6 +131,7 @@ .all-caps-label { margin: 0 16px 0 8px; opacity: 1; + min-width: fit-content; } } } diff --git a/src/lib/buttons/circle-button/circle-button.component.scss b/src/lib/buttons/circle-button/circle-button.component.scss index 94bf11c..393f5aa 100644 --- a/src/lib/buttons/circle-button/circle-button.component.scss +++ b/src/lib/buttons/circle-button/circle-button.component.scss @@ -21,11 +21,14 @@ &.mat-button-disabled { cursor: not-allowed; + + &:not(.primary):not(.warn):not(.dark-bg):hover { + background-color: var(--iqser-btn-bg); + } } &.primary.mat-button-disabled { - background-color: var(--iqser-btn-bg); - color: var(--iqser-white) !important; + color: #ffffff80; } &.warn:not([disabled]) { diff --git a/src/lib/listing/services/listing.service.ts b/src/lib/listing/services/listing.service.ts index 083bf21..099f6dd 100644 --- a/src/lib/listing/services/listing.service.ts +++ b/src/lib/listing/services/listing.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; -import { map, mapTo, tap } from 'rxjs/operators'; +import { map, tap } from 'rxjs/operators'; import { FilterService, getFilteredEntities } from '../../filtering'; import { SearchService } from '../../search'; import { IListable } from '../models'; @@ -29,7 +29,10 @@ export class ListingService { this.displayedLength$ = this.displayed$.pipe(getLength, shareDistinctLast()); this.selected$ = this._selected$.asObservable().pipe(shareDistinctLast()); - this.selectedEntities$ = this._selected$.asObservable().pipe(mapTo(this.selected), shareLast()); + this.selectedEntities$ = this._selected$.asObservable().pipe( + map(() => this.selected), + shareLast(), + ); this.selectedLength$ = this._selected$.pipe(getLength, shareDistinctLast()); this.areAllSelected$ = this._areAllSelected$; diff --git a/src/lib/listing/workflow/column-header/column-header.component.html b/src/lib/listing/workflow/column-header/column-header.component.html index 4702c24..dd53d60 100644 --- a/src/lib/listing/workflow/column-header/column-header.component.html +++ b/src/lib/listing/workflow/column-header/column-header.component.html @@ -25,6 +25,8 @@ class="all-caps-label"> + + extend @Input() @Required() column!: WorkflowColumn; @Input() @Required() selectionColumn?: WorkflowColumn; + @Input() bulkActions?: TemplateRef; @Output() @Required() readonly selectionColumnChange = new EventEmitter | undefined>(); allSelected$!: Observable; diff --git a/src/lib/listing/workflow/workflow.component.html b/src/lib/listing/workflow/workflow.component.html index d88babb..4914550 100644 --- a/src/lib/listing/workflow/workflow.component.html +++ b/src/lib/listing/workflow/workflow.component.html @@ -23,7 +23,7 @@ [class.list-source]="isSource(column)" [style.--color]="column.color" class="column"> - +
extends Au @Input() noDataButtonIcon?: string; @Input() noDataButtonLabel?: string; @Input() showNoDataButton = false; + @Input() bulkActions?: TemplateRef; @Output() readonly noDataAction = new EventEmitter(); @Output() readonly addElement = new EventEmitter();