Merge branch 'angular-14' into explore-redesign
This commit is contained in:
commit
6551fc73d3
|
@ -1,18 +1,16 @@
|
||||||
<aside id="sidebar_main">
|
<aside id="sidebar_main">
|
||||||
<div sidebar-content>
|
<div sidebar-content>
|
||||||
<div *ngIf="items.length > 0" class="menu_section uk-margin-large-top" style="min-height: 30vh">
|
<div *ngIf="items.length > 0" class="menu_section mobile uk-margin-large-top" style="min-height: 30vh">
|
||||||
<ul #nav class="uk-list uk-nav uk-nav-default uk-nav-parent-icon" uk-nav="duration: 400">
|
<ul #nav class="uk-list uk-nav uk-nav-default uk-nav-parent-icon" uk-nav="duration: 400">
|
||||||
<ng-template ngFor [ngForOf]="items" let-item>
|
<ng-template ngFor [ngForOf]="items" let-item>
|
||||||
<li [class.uk-active]="isTheActiveMenuItem(item)"
|
<li [class.uk-active]="isTheActiveMenuItem(item)"
|
||||||
[class.uk-parent]="item.items.length > 0">
|
[class.uk-parent]="item.items.length > 0">
|
||||||
<a [routerLink]="getItemRoute(item)" [title]="item.title"
|
<a [routerLink]="getItemRoute(item)" [title]="item.title"
|
||||||
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null">
|
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle">
|
||||||
<div class="uk-flex uk-flex-middle">
|
|
||||||
<div *ngIf="item.icon && (item.icon.svg || item.icon.name)" class="uk-width-auto">
|
<div *ngIf="item.icon && (item.icon.svg || item.icon.name)" class="uk-width-auto">
|
||||||
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" ratio="0.9" [svg]="item.icon.svg" [flex]="true"></icon>
|
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" ratio="0.9" [svg]="item.icon.svg" [flex]="true"></icon>
|
||||||
</div>
|
</div>
|
||||||
<span [class.hide-on-close]="item.icon" class="uk-width-expand uk-text-truncate uk-margin-small-left">{{item.title}}</span>
|
<span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span>
|
||||||
</div>
|
|
||||||
</a>
|
</a>
|
||||||
<ul *ngIf="item.items?.length > 0 && (isBrowser || isTheActiveMenuItem(item))" class="uk-nav-sub">
|
<ul *ngIf="item.items?.length > 0 && (isBrowser || isTheActiveMenuItem(item))" class="uk-nav-sub">
|
||||||
<li *ngFor="let subItem of item.items"
|
<li *ngFor="let subItem of item.items"
|
||||||
|
|
|
@ -13,4 +13,6 @@ export class SliderTabComponent {
|
||||||
public active: boolean = false;
|
public active: boolean = false;
|
||||||
@Input()
|
@Input()
|
||||||
public disabled: boolean = false;
|
public disabled: boolean = false;
|
||||||
|
@Input()
|
||||||
|
public align: 'left' | 'right' = 'left';
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,13 +27,23 @@ declare var UIkit;
|
||||||
[attr.uk-tab]="type === 'static'?('connect:' + connect):null"
|
[attr.uk-tab]="type === 'static'?('connect:' + connect):null"
|
||||||
[ngClass]="'uk-flex-' + flexPosition">
|
[ngClass]="'uk-flex-' + flexPosition">
|
||||||
<ng-container *ngIf="type === 'static'">
|
<ng-container *ngIf="type === 'static'">
|
||||||
<li *ngFor="let tab of tabs.toArray()" class="uk-text-capitalize">
|
<li *ngFor="let tab of leftTabs" class="uk-text-capitalize">
|
||||||
|
<a>{{tab.title}}</a>
|
||||||
|
</li>
|
||||||
|
<li *ngFor="let tab of rightTabs; let i=index;"
|
||||||
|
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
|
||||||
|
class="uk-text-capitalize">
|
||||||
<a>{{tab.title}}</a>
|
<a>{{tab.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="type === 'scrollable'">
|
<ng-container *ngIf="type === 'scrollable'">
|
||||||
<li *ngFor="let tab of tabs.toArray()" class="uk-text-capitalize" [class.uk-active]="tab.active">
|
<li *ngFor="let tab of leftTabs" class="uk-text-capitalize" [class.uk-active]="tab.active">
|
||||||
<a routerLink="./" [fragment]="tab.id">{{tab.title}}</a>
|
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge">{{tab.title}}</a>
|
||||||
|
</li>
|
||||||
|
<li *ngFor="let tab of rightTabs; let i=index;" class="uk-text-capitalize"
|
||||||
|
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
|
||||||
|
[class.uk-active]="tab.active">
|
||||||
|
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge">{{tab.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -126,7 +136,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
||||||
let index = event.detail[0].index();
|
let index = event.detail[0].index();
|
||||||
if (index !== this.activeIndex) {
|
if (index !== this.activeIndex) {
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
this.router.navigate(['./'], {relativeTo: this.route, fragment: this.connect.replace('#', '')});
|
this.router.navigate(['./'], {relativeTo: this.route, fragment: this.connect.replace('#', ''), queryParamsHandling: "merge"});
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -153,7 +163,8 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
||||||
this.router.navigate(['./'], {
|
this.router.navigate(['./'], {
|
||||||
fragment: entry.target.id,
|
fragment: entry.target.id,
|
||||||
relativeTo: this.route,
|
relativeTo: this.route,
|
||||||
state: {disableScroll: true}
|
state: {disableScroll: true},
|
||||||
|
queryParamsHandling: 'merge'
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
@ -186,6 +197,14 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get leftTabs(): SliderTabComponent[] {
|
||||||
|
return this.tabs.toArray().filter(tab => tab.align === 'left');
|
||||||
|
}
|
||||||
|
|
||||||
|
get rightTabs(): SliderTabComponent[] {
|
||||||
|
return this.tabs.toArray().filter(tab => tab.align === 'right');
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscription) {
|
if (subscription instanceof Subscription) {
|
||||||
|
|
|
@ -107,14 +107,14 @@ export class ISVocabulariesService {
|
||||||
|
|
||||||
getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable<AutoCompleteValue[]> {
|
getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable<AutoCompleteValue[]> {
|
||||||
if(vocabularyName == "sdg"){
|
if(vocabularyName == "sdg"){
|
||||||
let url = properties.domain+"/assets/vocabulary/sdg.json";
|
let url = properties.domain+"/assets/common-assets/vocabulary/sdg.json";
|
||||||
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
//.map(res => <any> res.json())
|
//.map(res => <any> res.json())
|
||||||
.pipe(map(res => res['sdg']))
|
.pipe(map(res => res['sdg']))
|
||||||
.pipe(map(res => this.parseSDGs(res)))
|
.pipe(map(res => this.parseSDGs(res)))
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
}else if( vocabularyName == "fos"){
|
}else if( vocabularyName == "fos"){
|
||||||
let url = properties.domain+"/assets/vocabulary/fos.json";
|
let url = properties.domain+"/assets/common-assets/vocabulary/fos.json";
|
||||||
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
//.map(res => <any> res.json())
|
//.map(res => <any> res.json())
|
||||||
.pipe(map(res => res['fos']))
|
.pipe(map(res => res['fos']))
|
||||||
|
|
Loading…
Reference in New Issue