-
+
+
-
+
-
+
-
+
{{ subOption.name }}
@@ -73,14 +46,11 @@
-
+
diff --git a/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.scss b/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.scss
index b0f555fea..36adc7be4 100644
--- a/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.scss
+++ b/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.scss
@@ -28,23 +28,20 @@ $tablet-height: 283px;
.options {
position: absolute;
- margin-top: 2px;
- z-index: 999;
+ top: 35px;
background-color: white;
-moz-box-shadow: 0 0 20px 1px #dde5ec;
-webkit-box-shadow: 0 0 20px 1px #dde5ec;
box-shadow: 0 0 20px 1px #dde5ec;
border-radius: 4px;
+ padding-bottom: 10px;
width: 307px;
overflow: hidden;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
+ z-index: 10;
&__container {
- position: relative;
- flex-grow: 1;
- overflow: scroll;
+ max-height: 305px;
+ overflow: auto;
}
.option {
display: flex;
@@ -89,10 +86,5 @@ $tablet-height: 283px;
.action {
display: flex;
justify-content: center;
- flex-shrink: 0;
-
- app-button {
- display: block;
- margin: 10px 0;
- }
+ padding-top: 10px;
}
diff --git a/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.ts b/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.ts
index 848f4c9b6..32b023afe 100644
--- a/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.ts
+++ b/apps/sales/src/app/modules/remission/components/remission-filter-item/remission-filter-item.component.ts
@@ -1,15 +1,4 @@
-import {
- Component,
- OnInit,
- Input,
- Output,
- EventEmitter,
- OnDestroy,
- ChangeDetectorRef,
- ViewChild,
- ElementRef,
- HostListener, AfterViewInit, Renderer2
-} from '@angular/core';
+import { Component, OnInit, Input, Output, EventEmitter, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { Filter, FilterOption } from '@isa/remission';
import { fadeInAnimation } from '../../animations/fadeIn.animation';
import { growShrinkAnimation } from '../../animations/grow-shrink.animation';
@@ -28,18 +17,15 @@ import isEqual from 'lodash/isEqual';
styleUrls: ['./remission-filter-item.component.scss'],
animations: [fadeInAnimation, growShrinkAnimation]
})
-export class RemissionFilterItemComponent implements OnInit, OnDestroy, AfterViewInit {
+export class RemissionFilterItemComponent implements OnInit, OnDestroy {
@Input() filter: Filter;
-
@Input()
get remissionResourceType(): RemissionResourceType {
return this._remissionResourceType;
}
-
set remissionResourceType(value: RemissionResourceType) {
this._remissionResourceType = value;
}
-
@Output() closeOtherFilters = new EventEmitter
();
@Output() toggleChange = new EventEmitter();
@@ -56,21 +42,7 @@ export class RemissionFilterItemComponent implements OnInit, OnDestroy, AfterVie
private previousSelectedOptions: FilterOption[] = [];
private _remissionResourceType: RemissionResourceType;
- private windowHeight;
- @ViewChild('filterItem') filterItem: ElementRef;
- @ViewChild('filterList') filterList: ElementRef;
-
- @HostListener('window:resize', [])
- public onResize() {
- this.windowHeight = window.innerHeight;
- }
-
- constructor(
- private store: Store,
- private remissionHelper: RemissionHelperService,
- private cdrf: ChangeDetectorRef,
- private renderer: Renderer2
- ) {}
+ constructor(private store: Store, private remissionHelper: RemissionHelperService, private cdrf: ChangeDetectorRef) {}
ngOnInit() {
this.areFilterOptionsGoups(this.filter);
@@ -80,10 +52,6 @@ export class RemissionFilterItemComponent implements OnInit, OnDestroy, AfterVie
}
}
- public ngAfterViewInit() {
- this.windowHeight = window.innerHeight;
- }
-
ngOnDestroy() {
this.destroy$.next();
}
@@ -98,7 +66,7 @@ export class RemissionFilterItemComponent implements OnInit, OnDestroy, AfterVie
)
.subscribe(filterOptions => {
const flatFilterOptions = [];
- this.filter.options.forEach(({options}) => flatFilterOptions.push(...options));
+ this.filter.options.forEach(({ options }) => flatFilterOptions.push(...options));
this.selectedOptions = flatFilterOptions.filter(item => filterOptions.includes(item.id));
this.selectedGroups = this.filter.options.filter(groupOptions => {
@@ -153,17 +121,6 @@ export class RemissionFilterItemComponent implements OnInit, OnDestroy, AfterVie
this.remissionHelper.closeFilters$.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.updateFilters();
});
- this.remissionHelper.closeDropdowns$.pipe(takeUntil(this.destroy$)).subscribe(() => {
- if (!this.expanded) {
- return;
- }
- this.expanded = false;
- this.previousSelectedGroups = [...this.selectedGroups];
- this.previousSelectedOptions = [...this.selectedOptions];
- this.toggleChange.emit(this.expanded);
- this.setFilterHeight(this.expanded);
- this.setFilterListHeight();
- });
}
updateFilters() {
@@ -389,7 +346,6 @@ export class RemissionFilterItemComponent implements OnInit, OnDestroy, AfterVie
}
this.toggleChange.emit(this.expanded);
this.setFilterHeight(this.expanded);
- this.setFilterListHeight();
}
setFilterHeight(expanded: boolean) {
@@ -398,28 +354,17 @@ export class RemissionFilterItemComponent implements OnInit, OnDestroy, AfterVie
if (expanded) {
const options = document.getElementById('options');
if (options) {
- const h = options.getBoundingClientRect().height;
- this.remissionHelper.setFilterHeight(h);
- return;
+ const height = options.getBoundingClientRect().height;
+ this.remissionHelper.setFilterHeight(height);
+ } else {
+ this.remissionHelper.setFilterHeight(0);
}
+ } else {
+ this.remissionHelper.setFilterHeight(0);
}
- this.remissionHelper.setFilterHeight(0);
});
}
- setFilterListHeight() {
- if (!this.filterList) {
- return;
- }
- if (this.expanded && this.windowHeight && this.filterItem) {
- const b = this.filterItem.nativeElement.getBoundingClientRect().bottom;
- const h = this.windowHeight - b - 85;
- this.renderer.setStyle(this.filterList.nativeElement, 'max-height', `${h}px`);
- return;
- }
- this.renderer.removeStyle(this.filterList.nativeElement, 'max-height');
- }
-
public closeNotCurrentFilters(id: string) {
if (this.filter.id !== id) {
this.updateFilters();
diff --git a/apps/sales/src/app/modules/remission/pages/remission-list-create/remission-list-create.component.html b/apps/sales/src/app/modules/remission/pages/remission-list-create/remission-list-create.component.html
index 0b2548d5d..f33bf0cff 100644
--- a/apps/sales/src/app/modules/remission/pages/remission-list-create/remission-list-create.component.html
+++ b/apps/sales/src/app/modules/remission/pages/remission-list-create/remission-list-create.component.html
@@ -2,9 +2,7 @@
#remissionListContainer
id="remission-list-container"
class="remission-list-container"
- [perfectScrollbar]="{minScrollbarLength: 20}"
- [disabled]="filtersExpanded"
- (scroll)="onScroll()">
+>