[HIMA-751] Perfect scrollbar package introduced in order to properly display scrollbar on ios devices

This commit is contained in:
Mikuta Aleksandras
2020-04-03 09:09:28 +02:00
parent f7804645c8
commit 0e8b095973
18 changed files with 60 additions and 45 deletions

View File

@@ -4,7 +4,6 @@ import { LogInComponent } from './components/log-in/log-in.component';
import { DashboardComponent } from './modules/dashboard/pages/dashboard.component'; import { DashboardComponent } from './modules/dashboard/pages/dashboard.component';
const routes: Routes = [ const routes: Routes = [
// { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ {
path: 'login', path: 'login',
children: [ children: [
@@ -12,7 +11,6 @@ const routes: Routes = [
{ path: ':token', component: LogInComponent } { path: ':token', component: LogInComponent }
] ]
}, },
//{ path: '', component: DashboardComponent },
{ path: 'dashboard', component: DashboardComponent }, { path: 'dashboard', component: DashboardComponent },
{ path: 'product', loadChildren: './modules/product/product.module#ProductModule' }, { path: 'product', loadChildren: './modules/product/product.module#ProductModule' },
{ path: 'customer', loadChildren: './modules/customer/customer.module#CustomerModule' }, { path: 'customer', loadChildren: './modules/customer/customer.module#CustomerModule' },

View File

@@ -3,7 +3,8 @@
<span>Bestellungen</span> <span>Bestellungen</span>
</div> </div>
<div class="fixed-card-container order-container scrollbar-visible"> <div class="fixed-card-container order-container"
[perfectScrollbar]="{minScrollbarLength: 20}">
<div class="fixed-header-description"> <div class="fixed-header-description">
<span>Übersicht aller offenen und früheren Bestellungen</span> <span>Übersicht aller offenen und früheren Bestellungen</span>
</div> </div>

View File

@@ -39,6 +39,7 @@ import { ShelfModule } from '../shelf/shelf.module';
import { COMPONENTS, EXPORT_COMPONENTS } from './components'; import { COMPONENTS, EXPORT_COMPONENTS } from './components';
import { CustomerSearchEmptyModalComponent } from './components/customer-search-empty-modal/customer-search-empty-modal.component'; import { CustomerSearchEmptyModalComponent } from './components/customer-search-empty-modal/customer-search-empty-modal.component';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
@NgModule({ @NgModule({
imports: [ imports: [
@@ -59,6 +60,7 @@ import { CustomerSearchEmptyModalComponent } from './components/customer-search-
CheckboxModule, CheckboxModule,
DropdownModule, DropdownModule,
DeleteDropdownFixedModule, DeleteDropdownFixedModule,
PerfectScrollbarModule,
IconModule, IconModule,
CustomerRoutingModule, CustomerRoutingModule,
SelectModule, SelectModule,

View File

@@ -39,7 +39,8 @@
<app-button (action)="redirectToCustomerCreate()">Neue Kundendaten erfassen</app-button> <app-button (action)="redirectToCustomerCreate()">Neue Kundendaten erfassen</app-button>
</div> </div>
</div> </div>
<cdk-virtual-scroll-viewport itemSize="144" class="scrollbar-visible" #viewport> <cdk-virtual-scroll-viewport itemSize="144" #viewport
[perfectScrollbar]="{minScrollbarLength: 20}">
<div *cdkVirtualFor="let customer of ds; let i = index; let last = last" class="virtual-item"> <div *cdkVirtualFor="let customer of ds; let i = index; let last = last" class="virtual-item">
<div class="user"> <div class="user">
<div class="user-info-container" *ngIf="customer != null; else loadingComponent" (click)="details(customer, i)"> <div class="user-info-container" *ngIf="customer != null; else loadingComponent" (click)="details(customer, i)">

View File

@@ -21,6 +21,7 @@ import { SharedModule } from '../../shared/shared.module';
import { GoodsInOrderTagComponent } from './components/goods-in-order-tag/goods-in-order-tag.component'; import { GoodsInOrderTagComponent } from './components/goods-in-order-tag/goods-in-order-tag.component';
import { GoodsInArticleDetailsComponent } from './components/goods-in-article-details/goods-in-article-details.component'; import { GoodsInArticleDetailsComponent } from './components/goods-in-article-details/goods-in-article-details.component';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
@NgModule({ @NgModule({
declarations: [ declarations: [
@@ -37,6 +38,7 @@ import { FormsModule } from '@angular/forms';
GoodsInRoutingModule, GoodsInRoutingModule,
SearchInputModule, SearchInputModule,
ScrollingModule, ScrollingModule,
PerfectScrollbarModule,
LoadingModule, LoadingModule,
SharedModule, SharedModule,
IconModule, IconModule,

View File

@@ -1,6 +1,7 @@
<div class="result-container"> <div class="result-container">
<ng-container> <ng-container>
<cdk-virtual-scroll-viewport itemSize="190" class="scrollbar-visible" #scroller> <cdk-virtual-scroll-viewport itemSize="190" #scroller
[perfectScrollbar]="{minScrollbarLength: 20}">
<div *cdkVirtualFor="let order of ds; let first = first; let last = last; let index = index"> <div *cdkVirtualFor="let order of ds; let first = first; let last = last; let index = index">
<ng-container *ngIf="order != null; else loadingComponent"> <ng-container *ngIf="order != null; else loadingComponent">
<app-goods-in-order-card <app-goods-in-order-card

View File

@@ -25,8 +25,8 @@
<cdk-virtual-scroll-viewport <cdk-virtual-scroll-viewport
autosize autosize
#scroller #scroller
class="scrollbar-visible" [ngClass]="{ 'cdk-stop-scrolling': scrollDisabled }"
[ngClass]="{ 'cdk-stop-scrolling': scrollDisabled }"> [perfectScrollbar]="{minScrollbarLength: 20}">
<ng-container *cdkVirtualFor="let product of ds; let i = index; let last = last"> <ng-container *cdkVirtualFor="let product of ds; let i = index; let last = last">
<div class="product-item"> <div class="product-item">
<app-product-card <app-product-card

View File

@@ -6,7 +6,7 @@ import { CommonModule } from '@angular/common';
import { ProductCardComponent } from './components/product-card/product-card.component'; import { ProductCardComponent } from './components/product-card/product-card.component';
import { ScrollingModule } from '@angular/cdk/scrolling'; import { ScrollingModule } from '@angular/cdk/scrolling';
import { ScrollingModule as ExperimentalScrollingModule } from '@angular/cdk-experimental/scrolling'; import { ScrollingModule as ExperimentalScrollingModule } from '@angular/cdk-experimental/scrolling';
// import { ScrollingModule as ExperimentalScrollingModule } from '@angular/cdk-experimental/scrolling'; import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { LoadingModule, PhotoGalleryModule, CardModule, SearchInputModule, DeleteDropdownModule } from '@libs/ui'; import { LoadingModule, PhotoGalleryModule, CardModule, SearchInputModule, DeleteDropdownModule } from '@libs/ui';
import { SharedModule } from './../../shared/shared.module'; import { SharedModule } from './../../shared/shared.module';
import { ModalModule, ButtonModule, InputModule, DropdownModule, IconModule } from '@libs/ui'; import { ModalModule, ButtonModule, InputModule, DropdownModule, IconModule } from '@libs/ui';
@@ -45,6 +45,7 @@ import { SmallDoubleChoiceSwitchModule } from '@libs/ui/lib/small-double-choice-
CommonModule, CommonModule,
ScrollingModule, ScrollingModule,
ExperimentalScrollingModule, ExperimentalScrollingModule,
PerfectScrollbarModule,
LoadingModule, LoadingModule,
ModalModule, ModalModule,
ButtonModule, ButtonModule,

View File

@@ -1,7 +1,8 @@
<div <div
#remissionListContainer #remissionListContainer
id="remission-list-container" id="remission-list-container"
class="remission-list-container scrollbar-visible" class="remission-list-container"
[perfectScrollbar]="{minScrollbarLength: 20}"
(scroll)="onScroll()" (scroll)="onScroll()"
> >
<div class="headers" *ngIf="resourceTypeSwitch"> <div class="headers" *ngIf="resourceTypeSwitch">

View File

@@ -1,4 +1,5 @@
.remission-list-container { .remission-list-container {
position: relative;
height: calc(100% - 30px); height: calc(100% - 30px);
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;

View File

@@ -25,6 +25,7 @@
id="remission-list-container" id="remission-list-container"
#remissionListContainer #remissionListContainer
class="remission-list-container" class="remission-list-container"
[perfectScrollbar]="{minScrollbarLength: 20}"
(scroll)="scrollHandler($event)" (scroll)="scrollHandler($event)"
*ngIf="!shippingDocumentCreationPage && loaded" *ngIf="!shippingDocumentCreationPage && loaded"
> >
@@ -127,7 +128,7 @@
[fetchLastProducts$]="fetchLastProducts$" [fetchLastProducts$]="fetchLastProducts$"
[hits]="remissionListHits" [hits]="remissionListHits"
started="true" started="true"
(fullListLoaded)="fullListLoaded(true)" (fullListLoaded)="fullListLoaded()"
#remissionList #remissionList
></app-remission-list> ></app-remission-list>
</div> </div>

View File

@@ -1,4 +1,5 @@
.remission-list-container { .remission-list-container {
position: relative;
height: calc(100% - 20px); height: calc(100% - 20px);
overflow: scroll; overflow: scroll;
padding-bottom: 10px; padding-bottom: 10px;

View File

@@ -67,6 +67,7 @@ import { RemissionsOverviewCardContentComponent } from './components/remissions-
import { RemissionDetailsComponent } from './pages/remission-details/remission-details.component'; import { RemissionDetailsComponent } from './pages/remission-details/remission-details.component';
import { RemissionDetailsProductComponent } from './components/remission-details-product/remission-details-product.component'; import { RemissionDetailsProductComponent } from './components/remission-details-product/remission-details-product.component';
import { RemissionDetailsPrimaryCtaComponent } from './components/remission-details-primary-cta/remission-details-primary-cta.component'; import { RemissionDetailsPrimaryCtaComponent } from './components/remission-details-primary-cta/remission-details-primary-cta.component';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
@NgModule({ @NgModule({
declarations: [ declarations: [
@@ -109,6 +110,7 @@ import { RemissionDetailsPrimaryCtaComponent } from './components/remission-deta
RemissionClientRoutingModule, RemissionClientRoutingModule,
DoubleChoiceSwitchModule, DoubleChoiceSwitchModule,
ProgressBarModule, ProgressBarModule,
PerfectScrollbarModule,
SmallDoubleChoiceSwitchModule, SmallDoubleChoiceSwitchModule,
IconModule, IconModule,
ButtonModule, ButtonModule,

View File

@@ -1,6 +1,7 @@
<div class="result-container"> <div class="result-container">
<ng-container> <ng-container>
<cdk-virtual-scroll-viewport itemSize="180" class="scrollbar-visible" #scroller> <cdk-virtual-scroll-viewport itemSize="300" #scroller
[perfectScrollbar]="{minScrollbarLength: 20}">
<div *cdkVirtualFor="let order of ds; let last = last; let index = index"> <div *cdkVirtualFor="let order of ds; let last = last; let index = index">
<app-shelf-customer-order <app-shelf-customer-order
*ngIf="order != null; else loadingComponent" *ngIf="order != null; else loadingComponent"

View File

@@ -27,6 +27,7 @@ import { OrderLoadingComponent } from './components/order-loading/order-loading.
import { ShelfEditOrderComponent } from './pages/shelf-edit-order/shelf-edit-order.component'; import { ShelfEditOrderComponent } from './pages/shelf-edit-order/shelf-edit-order.component';
import { OrderItemEditComponent } from './components/order-item-edit/order-item-edit.component'; import { OrderItemEditComponent } from './components/order-item-edit/order-item-edit.component';
import { OrderOverviewEditComponent } from './components/order-overview-edit/order-overview-edit.component'; import { OrderOverviewEditComponent } from './components/order-overview-edit/order-overview-edit.component';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
@NgModule({ @NgModule({
declarations: [ declarations: [
@@ -56,6 +57,7 @@ import { OrderOverviewEditComponent } from './components/order-overview-edit/ord
CollectingShelfScannerModule, CollectingShelfScannerModule,
SharedModule, SharedModule,
ScrollingModule, ScrollingModule,
PerfectScrollbarModule,
CardModule, CardModule,
DropdownModule, DropdownModule,
SearchInputModule, SearchInputModule,

View File

@@ -1,10 +1,9 @@
:not(.scrollbar-visible)::-webkit-scrollbar { @import '~perfect-scrollbar/css/perfect-scrollbar.css';
::-webkit-scrollbar {
width: 0; // remove scrollbar space width: 0; // remove scrollbar space
background: transparent; // optional: just make scrollbar invisible */ background: transparent; // optional: just make scrollbar invisible */
} }
.scrollbar-visible {
-webkit-overflow-scrolling: touch;
}
body { body {
font-family: 'Open Sans'; font-family: 'Open Sans';

60
package-lock.json generated
View File

@@ -4473,8 +4473,7 @@
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@@ -4492,13 +4491,11 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@@ -4511,18 +4508,15 @@
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@@ -4625,8 +4619,7 @@
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@@ -4636,7 +4629,6 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@@ -4649,20 +4641,17 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@@ -4679,7 +4668,6 @@
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@@ -4752,8 +4740,7 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@@ -4763,7 +4750,6 @@
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@@ -4839,8 +4825,7 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@@ -4870,7 +4855,6 @@
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@@ -4888,7 +4872,6 @@
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@@ -4927,13 +4910,11 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true
"optional": true
} }
} }
}, },
@@ -7548,6 +7529,15 @@
"opencollective-postinstall": "^2.0.2" "opencollective-postinstall": "^2.0.2"
} }
}, },
"ngx-perfect-scrollbar": {
"version": "7.2.1",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-7.2.1.tgz",
"integrity": "sha1-csu7prx1tINvoDAHYNLWntQdJBw=",
"requires": {
"perfect-scrollbar": "^1.4.0",
"resize-observer-polyfill": "^1.5.0"
}
},
"ngx-toggle-switch": { "ngx-toggle-switch": {
"version": "2.0.5", "version": "2.0.5",
"resolved": "https://registry.npmjs.org/ngx-toggle-switch/-/ngx-toggle-switch-2.0.5.tgz", "resolved": "https://registry.npmjs.org/ngx-toggle-switch/-/ngx-toggle-switch-2.0.5.tgz",
@@ -8407,6 +8397,11 @@
"sha.js": "^2.4.8" "sha.js": "^2.4.8"
} }
}, },
"perfect-scrollbar": {
"version": "1.5.0",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/perfect-scrollbar/-/perfect-scrollbar-1.5.0.tgz",
"integrity": "sha1-gh0iTtj/YZkMI/JttjBIzcdba4M="
},
"performance-now": { "performance-now": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@@ -9206,6 +9201,11 @@
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
"dev": true "dev": true
}, },
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ="
},
"resolve": { "resolve": {
"version": "1.1.7", "version": "1.1.7",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",

View File

@@ -52,6 +52,7 @@
"ng-circle-progress": "^1.4.0", "ng-circle-progress": "^1.4.0",
"ng-connection-service": "^1.0.4", "ng-connection-service": "^1.0.4",
"ngx-infinite-scroll": "^7.2.0", "ngx-infinite-scroll": "^7.2.0",
"ngx-perfect-scrollbar": "^7.2.1",
"ngx-toggle-switch": "^2.0.5", "ngx-toggle-switch": "^2.0.5",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"rxjs": "~6.4.0", "rxjs": "~6.4.0",