Skip to content

Commit 71bf9e0

Browse files
committed
Merge branch 'v5.9' of https://github.com/meta-magic/amexio.github.io into v5.9
2 parents 47b0793 + b9ad3bc commit 71bf9e0

File tree

3 files changed

+70
-12
lines changed

3 files changed

+70
-12
lines changed

src/module/forms/chip/chip.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="chips" id="{{index}}" attr.aria-label="{{label}}" style="cursor: pointer;" [ngStyle]="{'background-color': color,'filter': selected ? 'contrast(70%)':''}">
22
<amexio-c-icon [customclass]="icon"></amexio-c-icon>
33
<amexio-label (click)="onLabelClick($event)">
4-
<span [style.color]="fontcolor" style="cursor: pointer;padding-left:10px;">
4+
<span [style.color]="fontcolor" style="cursor: pointer;"[ngStyle]="{'padding-left': icon ? '10px':'0px'}">
55
{{item[displayfield]}}
66
</span>
77
</amexio-label>

src/module/panes/tab/tab.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727

2828

2929
<div>
30-
<div *ngFor="let tabnode of tabCollection, let index = index" class="tablink {{tabnode.amexiocolor+ ' '+tabnode.tabPillClass}}" [style.width.px]="singleTabWidth" (contextmenu)="loadContextMenu($event,tabnode, tab)">
31-
<div class="table1" id="{{tabnode.tablk}}" tabindex="1" attr.aria-controls="{{tabnode.tabId}}" role="tab" (click)="onTabClick(tabnode, index)"
30+
<div *ngFor="let tabnode of tabCollection, let index = index" class="tablink {{tabnode.amexiocolor+ ' '+tabnode.tabPillClass}}"
31+
[style.width.px]="singleTabWidth" (contextmenu)="loadContextMenu($event,tabnode, tab)">
32+
<div class="table1" id="{{tabnode.tablk}}" tabindex="1" attr.aria-controls="{{tabnode.tabId}}" role="tab" (click)="onTabClick(tabnode, index)" [ngStyle]="{'display': tabnode.showflag ? 'none':'table-cell'}"
3233
(keyup.arrowright)="onArrowRight()" (keyup.arrowleft)="onArrowLeft()" (keyup.enter)="onTabClick(tabnode, index)" (keyup.home)="onHomeClick()"
3334
(keyup.end)="onEndClick()">
3435
<div class="tablerow">

src/module/panes/tab/tab.component.ts

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ export class AmexioTabComponent extends LifeCycleBaseComponent implements AfterC
158158
*/
159159
@Input('default-context-menu') defaultContextMenu: boolean;
160160

161-
/*
162-
Properties
163-
name : active-bg-color
164-
datatype : boolean
165-
version : 5.9.3 onwards
166-
default : false
167-
description : sets background color for active tab
168-
*/
169-
@Input('active-bg-color') activeBGColor: boolean;
161+
/*
162+
Properties
163+
name : active-bg-color
164+
datatype : boolean
165+
version : 5.9.3 onwards
166+
default : false
167+
description : sets background color for active tab
168+
*/
169+
@Input('active-bg-color') activeBGColor: boolean;
170170

171171
/*
172172
Events
@@ -839,4 +839,61 @@ export class AmexioTabComponent extends LifeCycleBaseComponent implements AfterC
839839
this.removeListner();
840840
super.ngOnDestroy();
841841
}
842+
showTab(input: any) {
843+
if (typeof input === 'string') {
844+
this.tabCollection.forEach((tabs: any) => {
845+
if (input.trim().toLowerCase() !== tabs.title.trim().toLowerCase()) {
846+
tabs.hide = true;
847+
tabs['showflag'] = true;
848+
tabs.active = false;
849+
} else {
850+
tabs.hide = false;
851+
tabs['showflag'] = false;
852+
tabs.active = true;
853+
}
854+
this.asignTabPillClass(tabs);
855+
});
856+
}else if (typeof input === 'number') {
857+
this.tabCollection.forEach((tabs: any, index: any) => {
858+
if (index !== input) {
859+
tabs.hide = true;
860+
tabs['showflag'] = true;
861+
tabs.active = false;
862+
} else {
863+
tabs.hide = false;
864+
tabs['showflag'] = false;
865+
tabs.active = true;
866+
}
867+
});
868+
}
869+
}
870+
// Method to hide tab
871+
hideTab(input: any) {
872+
if (typeof input === 'string') {
873+
this.tabCollection.forEach((tabs: any, index: any) => {
874+
if (input.trim().toLowerCase() === tabs.title.trim().toLowerCase() && tabs.active) {
875+
const i = index + 1;
876+
tabs.hide = false;
877+
this.tabCollection[i].active = true;
878+
const newTab = this.tabCollection[i];
879+
tabs.active = false;
880+
tabs['showflag'] = true;
881+
this.asignTabPillClass(newTab);
882+
} else if (input.trim().toLowerCase() === tabs.title.trim().toLowerCase() && !tabs.active) {
883+
tabs.hide = true;
884+
tabs['showflag'] = true;
885+
}
886+
});
887+
}else if (typeof input === 'number') {
888+
this.tabCollection.forEach((tabs: any, index: any) => {
889+
if (index !== input) {
890+
tabs.hide = true;
891+
tabs['showflag'] = false;
892+
} else {
893+
tabs.hide = false;
894+
tabs['showflag'] = true;
895+
}
896+
});
897+
}
898+
}
842899
}

0 commit comments

Comments
 (0)