From 3c5d7d681d18a786f2ddbdea783ac6157315286a Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 30 Jul 2021 15:38:31 +0300 Subject: [PATCH] move round checkbox to common lib --- .../downloads-list-screen.component.html | 2 +- .../active-fields-listing.component.html | 8 ++--- .../dictionary-listing-screen.component.html | 6 ++-- ...r-attributes-listing-screen.component.html | 6 ++-- ...er-templates-listing-screen.component.html | 6 ++-- ...e-attributes-listing-screen.component.html | 8 ++--- ...e-attributes-listing-screen.component.scss | 2 +- .../screens/trash/trash-screen.component.html | 6 ++-- .../user-listing-screen.component.html | 6 ++-- .../file-workload.component.html | 10 +++--- .../file-workload.component.scss | 2 +- .../team-members-manager.component.html | 2 +- .../dossier-overview-screen.component.html | 6 ++-- .../checkbox/round-checkbox.component.html | 4 --- .../checkbox/round-checkbox.component.scss | 34 ------------------- .../checkbox/round-checkbox.component.ts | 29 ---------------- .../table-header/table-header.component.html | 4 +-- .../src/app/modules/shared/shared.module.ts | 2 -- apps/red-ui/src/assets/styles/red-tables.scss | 4 +-- libs/common-ui | 2 +- 20 files changed, 40 insertions(+), 109 deletions(-) delete mode 100644 apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html delete mode 100644 apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.scss delete mode 100644 apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html index 55d72061f..f41353146 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html @@ -22,7 +22,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html index 4420bd36b..e036c7165 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html @@ -1,9 +1,9 @@
- + > {{ 'file-attributes-csv-import.table-header.title' | translate: { length: (screenStateService.allEntitiesLength$ | async) } }} @@ -93,7 +93,7 @@ class="table-item" >
- +
@@ -142,7 +142,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index 99ad87dec..972b7fc2b 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -21,11 +21,11 @@
- + > {{ 'dictionary-listing.table-header.title' | translate: { length: (screenStateService.displayedLength$ | async) } }} @@ -102,7 +102,7 @@ class="table-item pointer" >
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index 982a46c10..cfad15a4d 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -21,11 +21,11 @@
- + > {{ @@ -102,7 +102,7 @@ class="table-item pointer" >
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html index e6f7b74fd..ed7af38bd 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html @@ -12,11 +12,11 @@
- + > {{ @@ -94,7 +94,7 @@ class="table-item pointer" >
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index 12ac3ee38..69db731d0 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -21,11 +21,11 @@
- + > {{ @@ -121,7 +121,7 @@
- +
@@ -142,7 +142,7 @@ {{ attribute.csvColumnHeader }}
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss index 239036305..b4d8ef8d5 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss @@ -67,6 +67,6 @@ redaction-table-col-name::ng-deep { visibility: hidden; } -.table-item > div:not(.selection-column) redaction-round-checkbox { +.table-item > div:not(.selection-column) iqser-round-checkbox { cursor: default; } diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html index 7641ba564..8e07e620f 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html @@ -6,11 +6,11 @@
- + > {{ 'trash.table-header.title' | translate: { length: (screenStateService.displayedLength$ | async) } }} @@ -69,7 +69,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html index 5b7b3d9da..b486f7966 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html @@ -34,11 +34,11 @@
- + > {{ 'user-listing.table-header.title' | translate: { length: (screenStateService.displayedLength$ | async) } }} @@ -83,7 +83,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html index 33acd987b..a2919dc27 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html @@ -38,11 +38,11 @@
- + type="with-bg" + > {{ selectedAnnotations?.length || 0 }} selected
- + >
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss index 010a90774..85ecf735e 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.scss @@ -59,7 +59,7 @@ display: flex; align-items: center; - redaction-round-checkbox.inactive { + iqser-round-checkbox .wrapper.inactive { cursor: default; } diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html index 7a057fa9c..8e0bd8f9e 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.html @@ -52,7 +52,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html index baf2573b4..ccefdea92 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html @@ -37,11 +37,11 @@
- + > {{ 'dossier-overview.table-header.title' | translate: { length: (screenStateService.displayedLength$ | async) || 0 } }} @@ -113,7 +113,7 @@ class="table-item" >
- +
diff --git a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html b/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html deleted file mode 100644 index 6f8249aac..000000000 --- a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
diff --git a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.scss b/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.scss deleted file mode 100644 index 4993062b2..000000000 --- a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.scss +++ /dev/null @@ -1,34 +0,0 @@ -@import '../../../../../assets/styles/variables'; - -:host { - cursor: pointer; -} - -.wrapper { - width: var(--size); - height: var(--size); - box-sizing: border-box; - border-radius: 50%; - - &.inactive { - border: 1px solid $grey-5; - background-color: $white; - } - - .mat-icon { - color: $primary; - width: var(--size); - height: var(--size); - } - - &.red-bg { - .mat-icon { - color: $white; - } - - &.inactive { - border: 1px solid $grey-2; - background-color: transparent; - } - } -} diff --git a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts b/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts deleted file mode 100644 index 1371ac55e..000000000 --- a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Component, ElementRef, HostBinding, Input, OnChanges, OnInit, ViewChild } from '@angular/core'; - -@Component({ - selector: 'redaction-round-checkbox', - templateUrl: './round-checkbox.component.html', - styleUrls: ['./round-checkbox.component.scss'] -}) -export class RoundCheckboxComponent implements OnInit, OnChanges { - @Input() size = 20; - @Input() active: boolean; - @Input() indeterminate: boolean; - @Input() type: 'default' | 'red-bg'; - - @ViewChild('wrapper', { static: true }) private readonly _wrapper: ElementRef; - - @HostBinding('class.active') private _activeClass: boolean; - @HostBinding('class.inactive') private _inactiveClass: boolean; - @HostBinding('class.indeterminate') private _indeterminateClass: boolean; - - ngOnInit(): void { - this._wrapper.nativeElement.style.setProperty('--size', this.size + 'px'); - } - - ngOnChanges(): void { - this._activeClass = this.active && !this.indeterminate; - this._inactiveClass = !this.active && !this.indeterminate; - this._indeterminateClass = this.indeterminate; - } -} diff --git a/apps/red-ui/src/app/modules/shared/components/table-header/table-header.component.html b/apps/red-ui/src/app/modules/shared/components/table-header/table-header.component.html index 3b0b92d8f..689a69a0d 100644 --- a/apps/red-ui/src/app/modules/shared/components/table-header/table-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/table-header/table-header.component.html @@ -1,10 +1,10 @@
- + > {{ tableHeaderLabel | translate: { length: (screenStateService.displayedLength$ | async) } }} diff --git a/apps/red-ui/src/app/modules/shared/shared.module.ts b/apps/red-ui/src/app/modules/shared/shared.module.ts index b0ea64e18..4062c0c0f 100644 --- a/apps/red-ui/src/app/modules/shared/shared.module.ts +++ b/apps/red-ui/src/app/modules/shared/shared.module.ts @@ -22,7 +22,6 @@ import { HiddenActionComponent } from './components/hidden-action/hidden-action. import { ConfirmationDialogComponent } from './dialogs/confirmation-dialog/confirmation-dialog.component'; import { EmptyStateComponent } from './components/empty-state/empty-state.component'; import { SortByPipe } from './pipes/sort-by.pipe'; -import { RoundCheckboxComponent } from './components/checkbox/round-checkbox.component'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; import { MomentDateAdapter } from '@angular/material-moment-adapter'; import { SelectComponent } from './components/select/select.component'; @@ -56,7 +55,6 @@ const components = [ ConfirmationDialogComponent, EmptyStateComponent, SortByPipe, - RoundCheckboxComponent, SelectComponent, SideNavComponent, DictionaryManagerComponent, diff --git a/apps/red-ui/src/assets/styles/red-tables.scss b/apps/red-ui/src/assets/styles/red-tables.scss index e2badc255..f0ec2d474 100644 --- a/apps/red-ui/src/assets/styles/red-tables.scss +++ b/apps/red-ui/src/assets/styles/red-tables.scss @@ -58,7 +58,7 @@ cdk-virtual-scroll-viewport { &.selection-column { padding-right: 0 !important; - redaction-round-checkbox { + iqser-round-checkbox .wrapper { opacity: 0; transition: opacity 0.2s; @@ -112,7 +112,7 @@ cdk-virtual-scroll-viewport { > div { background-color: $grey-8; - &.selection-column redaction-round-checkbox { + &.selection-column iqser-round-checkbox .wrapper { opacity: 1; } } diff --git a/libs/common-ui b/libs/common-ui index 1b81fa715..1633911e1 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 1b81fa7153792f40d9810707884f889c449972d5 +Subproject commit 1633911e1339b39f96f243885defec4a92b6e6eb