@memberjunction/ng-tabstrip 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/module.d.ts +11 -0
- package/dist/lib/module.js +39 -0
- package/dist/lib/tab/tab.component.d.ts +36 -0
- package/dist/lib/tab/tab.component.js +85 -0
- package/dist/lib/tab-body/tab-body.component.d.ts +10 -0
- package/dist/lib/tab-body/tab-body.component.js +31 -0
- package/dist/lib/tab-strip/tab-strip.component.d.ts +84 -0
- package/dist/lib/tab-strip/tab-strip.component.js +294 -0
- package/dist/lib/tab-strip.component.d.ts +5 -0
- package/dist/lib/tab-strip.component.js +11 -0
- package/dist/lib/tab.base.d.ts +3 -0
- package/dist/lib/tab.base.js +2 -0
- package/dist/public-api.d.ts +5 -0
- package/dist/public-api.js +8 -0
- package/package.json +30 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./tab-strip/tab-strip.component";
|
|
3
|
+
import * as i2 from "./tab-body/tab-body.component";
|
|
4
|
+
import * as i3 from "./tab/tab.component";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@memberjunction/ng-container-directives";
|
|
7
|
+
export declare class MJTabStripModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MJTabStripModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MJTabStripModule, [typeof i1.MJTabStripComponent, typeof i2.MJTabBodyComponent, typeof i3.MJTabComponent], [typeof i4.CommonModule, typeof i5.ContainerDirectivesModule], [typeof i1.MJTabStripComponent, typeof i2.MJTabBodyComponent, typeof i3.MJTabComponent]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MJTabStripModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
// LOCAL
|
|
4
|
+
import { MJTabStripComponent } from './tab-strip/tab-strip.component';
|
|
5
|
+
import { MJTabBodyComponent } from './tab-body/tab-body.component';
|
|
6
|
+
import { MJTabComponent } from './tab/tab.component';
|
|
7
|
+
import { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export class MJTabStripModule {
|
|
10
|
+
}
|
|
11
|
+
MJTabStripModule.ɵfac = function MJTabStripModule_Factory(t) { return new (t || MJTabStripModule)(); };
|
|
12
|
+
MJTabStripModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: MJTabStripModule });
|
|
13
|
+
MJTabStripModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
14
|
+
ContainerDirectivesModule] });
|
|
15
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJTabStripModule, [{
|
|
16
|
+
type: NgModule,
|
|
17
|
+
args: [{
|
|
18
|
+
declarations: [
|
|
19
|
+
MJTabStripComponent,
|
|
20
|
+
MJTabBodyComponent,
|
|
21
|
+
MJTabComponent
|
|
22
|
+
],
|
|
23
|
+
imports: [
|
|
24
|
+
CommonModule,
|
|
25
|
+
ContainerDirectivesModule
|
|
26
|
+
],
|
|
27
|
+
exports: [
|
|
28
|
+
MJTabStripComponent,
|
|
29
|
+
MJTabBodyComponent,
|
|
30
|
+
MJTabComponent
|
|
31
|
+
]
|
|
32
|
+
}]
|
|
33
|
+
}], null, null); })();
|
|
34
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MJTabStripModule, { declarations: [MJTabStripComponent,
|
|
35
|
+
MJTabBodyComponent,
|
|
36
|
+
MJTabComponent], imports: [CommonModule,
|
|
37
|
+
ContainerDirectivesModule], exports: [MJTabStripComponent,
|
|
38
|
+
MJTabBodyComponent,
|
|
39
|
+
MJTabComponent] }); })();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MJTabBase } from '../tab.base';
|
|
2
|
+
import { MJTabStripComponent } from '../tab-strip/tab-strip.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Represents the tab in the header of a given tab strip
|
|
6
|
+
*/
|
|
7
|
+
export declare class MJTabComponent extends MJTabBase {
|
|
8
|
+
private tabstrip;
|
|
9
|
+
private _tabSelected;
|
|
10
|
+
/**
|
|
11
|
+
* Determines if the tab is currently selected or not. This is set by the TabStrip component automatically when the SelectedTabIndex is set, do not set this directly.
|
|
12
|
+
*/
|
|
13
|
+
get TabSelected(): boolean;
|
|
14
|
+
set TabSelected(value: boolean);
|
|
15
|
+
/**
|
|
16
|
+
* Determines if the tab can be closed by a user, or not. Defaults to false.
|
|
17
|
+
*/
|
|
18
|
+
TabCloseable: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Returns a reference to the tab strip that this tab belongs to.
|
|
21
|
+
*/
|
|
22
|
+
get TabStrip(): MJTabStripComponent;
|
|
23
|
+
constructor(tabstrip: MJTabStripComponent);
|
|
24
|
+
/**
|
|
25
|
+
* Event handler for when this tab is clicked to select it, generally not a great idea to call this directly, but it is possible to call directly to simulate a click.
|
|
26
|
+
* The preferred approach is to set the SelectedTabIndex property on the TabStrip component directly.
|
|
27
|
+
*/
|
|
28
|
+
selectTab(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Event handler for when the close button is clicked on the tab. This will fire the BeforeTabClosed event on the TabStrip component, and if it is not cancelled, will then fire the AfterTabClosed event.
|
|
31
|
+
*/
|
|
32
|
+
closeTab($event: MouseEvent): void;
|
|
33
|
+
handleContextMenu($event: MouseEvent): void;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MJTabComponent, [{ host: true; }]>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MJTabComponent, "mj-tab", never, { "TabSelected": { "alias": "TabSelected"; "required": false; }; "TabCloseable": { "alias": "TabCloseable"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Component, Input, Host } from '@angular/core';
|
|
2
|
+
import { MJTabBase } from '../tab.base';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../tab-strip/tab-strip.component";
|
|
5
|
+
import * as i2 from "@angular/common";
|
|
6
|
+
function MJTabComponent_span_2_Template(rf, ctx) { if (rf & 1) {
|
|
7
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
8
|
+
i0.ɵɵelementStart(0, "span", 2);
|
|
9
|
+
i0.ɵɵlistener("click", function MJTabComponent_span_2_Template_span_click_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeTab($event)); });
|
|
10
|
+
i0.ɵɵtext(1, "\u2716");
|
|
11
|
+
i0.ɵɵelementEnd();
|
|
12
|
+
} }
|
|
13
|
+
const _c0 = a0 => ({ "single-tab-selected": a0 });
|
|
14
|
+
const _c1 = ["*"];
|
|
15
|
+
/**
|
|
16
|
+
* Represents the tab in the header of a given tab strip
|
|
17
|
+
*/
|
|
18
|
+
export class MJTabComponent extends MJTabBase {
|
|
19
|
+
/**
|
|
20
|
+
* Determines if the tab is currently selected or not. This is set by the TabStrip component automatically when the SelectedTabIndex is set, do not set this directly.
|
|
21
|
+
*/
|
|
22
|
+
get TabSelected() {
|
|
23
|
+
return this._tabSelected;
|
|
24
|
+
}
|
|
25
|
+
set TabSelected(value) {
|
|
26
|
+
this._tabSelected = value;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns a reference to the tab strip that this tab belongs to.
|
|
30
|
+
*/
|
|
31
|
+
get TabStrip() {
|
|
32
|
+
return this.tabstrip;
|
|
33
|
+
}
|
|
34
|
+
constructor(tabstrip) {
|
|
35
|
+
super();
|
|
36
|
+
this.tabstrip = tabstrip;
|
|
37
|
+
this._tabSelected = false;
|
|
38
|
+
/**
|
|
39
|
+
* Determines if the tab can be closed by a user, or not. Defaults to false.
|
|
40
|
+
*/
|
|
41
|
+
this.TabCloseable = false;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Event handler for when this tab is clicked to select it, generally not a great idea to call this directly, but it is possible to call directly to simulate a click.
|
|
45
|
+
* The preferred approach is to set the SelectedTabIndex property on the TabStrip component directly.
|
|
46
|
+
*/
|
|
47
|
+
selectTab() {
|
|
48
|
+
this.tabstrip.SelectedTabIndex = this.index;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Event handler for when the close button is clicked on the tab. This will fire the BeforeTabClosed event on the TabStrip component, and if it is not cancelled, will then fire the AfterTabClosed event.
|
|
52
|
+
*/
|
|
53
|
+
closeTab($event) {
|
|
54
|
+
$event.stopPropagation(); // prevent click from going to the tab
|
|
55
|
+
this.tabstrip.CloseTab(this.index);
|
|
56
|
+
}
|
|
57
|
+
handleContextMenu($event) {
|
|
58
|
+
$event.preventDefault();
|
|
59
|
+
this.tabstrip.handleTabContextMenu($event, this);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
MJTabComponent.ɵfac = function MJTabComponent_Factory(t) { return new (t || MJTabComponent)(i0.ɵɵdirectiveInject(i1.MJTabStripComponent, 1)); };
|
|
63
|
+
MJTabComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJTabComponent, selectors: [["mj-tab"]], inputs: { TabSelected: "TabSelected", TabCloseable: "TabCloseable" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c1, decls: 3, vars: 4, consts: [[1, "single-tab", 3, "ngClass", "click", "contextmenu"], ["class", "tab-close-button", 3, "click", 4, "ngIf"], [1, "tab-close-button", 3, "click"]], template: function MJTabComponent_Template(rf, ctx) { if (rf & 1) {
|
|
64
|
+
i0.ɵɵprojectionDef();
|
|
65
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
66
|
+
i0.ɵɵlistener("click", function MJTabComponent_Template_div_click_0_listener() { return ctx.selectTab(); })("contextmenu", function MJTabComponent_Template_div_contextmenu_0_listener($event) { return ctx.handleContextMenu($event); });
|
|
67
|
+
i0.ɵɵprojection(1);
|
|
68
|
+
i0.ɵɵtemplate(2, MJTabComponent_span_2_Template, 2, 0, "span", 1);
|
|
69
|
+
i0.ɵɵelementEnd();
|
|
70
|
+
} if (rf & 2) {
|
|
71
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0, ctx.TabSelected));
|
|
72
|
+
i0.ɵɵadvance(2);
|
|
73
|
+
i0.ɵɵproperty("ngIf", ctx.TabCloseable);
|
|
74
|
+
} }, dependencies: [i2.NgClass, i2.NgIf], styles: [".single-tab[_ngcontent-%COMP%] {\r\n flex: 0 0 auto; \n\r\n cursor: pointer;\r\n height: 26px;\r\n margin-right: 1px;\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n padding-top: 5px;\r\n border-radius: 8px 8px 0 0;\r\n border-top: solid 1px #D5D8E5;;\r\n border-left: solid 1px #D5D8E5;;\r\n border-right: solid 1px #D5D8E5;;\r\n border-bottom: 0;\r\n background-color: #D5D8E5;\r\n font-size: 14px;\r\n }\r\n .single-tab[_ngcontent-%COMP%]:hover {\r\n color: #bb443c;\r\n }\r\n .single-tab-selected[_ngcontent-%COMP%] {\r\n background-color: #F5F6FA;\r\n font-weight: bold;\r\n }\r\n \r\n .tab-close-button[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n margin-left: 10px;\r\n padding: 2px;\r\n font-size: 12px;\r\n border-radius: 10px;\r\n color: black;\r\n }\r\n .tab-close-button[_ngcontent-%COMP%]:hover {\r\n background-color: lightgray;\r\n }"] });
|
|
75
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJTabComponent, [{
|
|
76
|
+
type: Component,
|
|
77
|
+
args: [{ selector: 'mj-tab', template: "<div class=\"single-tab\" [ngClass]=\"{'single-tab-selected': TabSelected}\" (click)=\"selectTab()\" (contextmenu)=\"handleContextMenu($event)\">\r\n <ng-content><!--CONTENT PROJECTION GOES HERE--></ng-content>\r\n <span *ngIf=\"TabCloseable\" class=\"tab-close-button\" (click)=\"closeTab($event)\" >\u2716</span>\r\n</div>", styles: ["\r\n .single-tab {\r\n flex: 0 0 auto; /* Prevent tabs from shrinking */\r\n cursor: pointer;\r\n height: 26px;\r\n margin-right: 1px;\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n padding-top: 5px;\r\n border-radius: 8px 8px 0 0;\r\n border-top: solid 1px #D5D8E5;;\r\n border-left: solid 1px #D5D8E5;;\r\n border-right: solid 1px #D5D8E5;;\r\n border-bottom: 0;\r\n background-color: #D5D8E5;\r\n font-size: 14px;\r\n }\r\n .single-tab:hover {\r\n color: #bb443c;\r\n }\r\n .single-tab-selected {\r\n background-color: #F5F6FA;\r\n font-weight: bold;\r\n }\r\n \r\n .tab-close-button {\r\n cursor: pointer;\r\n margin-left: 10px;\r\n padding: 2px;\r\n font-size: 12px;\r\n border-radius: 10px;\r\n color: black;\r\n }\r\n .tab-close-button:hover {\r\n background-color: lightgray;\r\n }\r\n "] }]
|
|
78
|
+
}], () => [{ type: i1.MJTabStripComponent, decorators: [{
|
|
79
|
+
type: Host
|
|
80
|
+
}] }], { TabSelected: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}], TabCloseable: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}] }); })();
|
|
85
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJTabComponent, { className: "MJTabComponent", filePath: "src\\lib\\tab\\tab.component.ts", lineNumber: 13 }); })();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MJTabBase } from '../tab.base';
|
|
2
|
+
import { MJTabStripComponent } from '../tab-strip/tab-strip.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MJTabBodyComponent extends MJTabBase {
|
|
5
|
+
private tabstrip;
|
|
6
|
+
TabVisible: boolean;
|
|
7
|
+
constructor(tabstrip: MJTabStripComponent);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MJTabBodyComponent, [{ host: true; }]>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MJTabBodyComponent, "mj-tab-body", never, { "TabVisible": { "alias": "TabVisible"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, Input, Host } from '@angular/core';
|
|
2
|
+
import { MJTabBase } from '../tab.base';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../tab-strip/tab-strip.component";
|
|
5
|
+
import * as i2 from "@memberjunction/ng-container-directives";
|
|
6
|
+
const _c0 = ["*"];
|
|
7
|
+
export class MJTabBodyComponent extends MJTabBase {
|
|
8
|
+
constructor(tabstrip) {
|
|
9
|
+
super();
|
|
10
|
+
this.tabstrip = tabstrip;
|
|
11
|
+
this.TabVisible = false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
MJTabBodyComponent.ɵfac = function MJTabBodyComponent_Factory(t) { return new (t || MJTabBodyComponent)(i0.ɵɵdirectiveInject(i1.MJTabStripComponent, 1)); };
|
|
15
|
+
MJTabBodyComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJTabBodyComponent, selectors: [["mj-tab-body"]], inputs: { TabVisible: "TabVisible" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0, decls: 2, vars: 1, consts: [["mjFillContainer", "", 3, "hidden"]], template: function MJTabBodyComponent_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵprojectionDef();
|
|
17
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
18
|
+
i0.ɵɵprojection(1);
|
|
19
|
+
i0.ɵɵelementEnd();
|
|
20
|
+
} if (rf & 2) {
|
|
21
|
+
i0.ɵɵproperty("hidden", !ctx.TabVisible);
|
|
22
|
+
} }, dependencies: [i2.FillContainer] });
|
|
23
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJTabBodyComponent, [{
|
|
24
|
+
type: Component,
|
|
25
|
+
args: [{ selector: 'mj-tab-body', template: "<div [hidden]=\"!TabVisible\" mjFillContainer>\r\n <ng-content><!--CONTENT PROJECTION GOES HERE--></ng-content>\r\n</div>" }]
|
|
26
|
+
}], () => [{ type: i1.MJTabStripComponent, decorators: [{
|
|
27
|
+
type: Host
|
|
28
|
+
}] }], { TabVisible: [{
|
|
29
|
+
type: Input
|
|
30
|
+
}] }); })();
|
|
31
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJTabBodyComponent, { className: "MJTabBodyComponent", filePath: "src\\lib\\tab-body\\tab-body.component.ts", lineNumber: 11 }); })();
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { EventEmitter, QueryList, ElementRef, AfterContentInit, AfterContentChecked, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { MJTabComponent } from '../tab/tab.component';
|
|
3
|
+
import { MJTabBodyComponent } from '../tab-body/tab-body.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TabEvent {
|
|
6
|
+
index: number;
|
|
7
|
+
tab: MJTabComponent | null;
|
|
8
|
+
body: MJTabBodyComponent | null;
|
|
9
|
+
}
|
|
10
|
+
export declare class TabCancelableEvent extends TabEvent {
|
|
11
|
+
cancel: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class TabClosedEvent extends TabEvent {
|
|
14
|
+
/**
|
|
15
|
+
* This property provides the default calculation for what the new tab index will be and can be overriden by the container component to set a different value.
|
|
16
|
+
*/
|
|
17
|
+
newTabIndex: number;
|
|
18
|
+
/**
|
|
19
|
+
* Whenever the container is done processing, it MUST call this done method to signal that it is done.
|
|
20
|
+
*/
|
|
21
|
+
done: (error?: any) => {};
|
|
22
|
+
}
|
|
23
|
+
export declare class TabContextMenuEvent extends TabEvent {
|
|
24
|
+
mouseEvent: MouseEvent;
|
|
25
|
+
}
|
|
26
|
+
export declare class MJTabStripComponent implements AfterContentInit, AfterContentChecked, AfterViewInit {
|
|
27
|
+
protected _selectedTabIndex: number;
|
|
28
|
+
/**
|
|
29
|
+
* The index of the selected tab. You can get/set this value and it will change the displayed tab.
|
|
30
|
+
*/
|
|
31
|
+
get SelectedTabIndex(): number;
|
|
32
|
+
set SelectedTabIndex(index: number);
|
|
33
|
+
protected innerRefreshTabVisibility(index: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* This event is fired before a tab is selected. If you set cancel to true, the tab will not be selected.
|
|
36
|
+
*/
|
|
37
|
+
BeforeTabSelected: EventEmitter<TabCancelableEvent>;
|
|
38
|
+
/**
|
|
39
|
+
* This event is fired when a tab is selected.
|
|
40
|
+
*/
|
|
41
|
+
TabSelected: EventEmitter<TabEvent>;
|
|
42
|
+
/**
|
|
43
|
+
* This event is fired before a tab is closed. If you set cancel to true, the tab will not be closed.
|
|
44
|
+
*/
|
|
45
|
+
BeforeTabClosed: EventEmitter<TabCancelableEvent>;
|
|
46
|
+
/**
|
|
47
|
+
* This event is fired after a tab is closed.
|
|
48
|
+
*/
|
|
49
|
+
TabClosed: EventEmitter<TabClosedEvent>;
|
|
50
|
+
/**
|
|
51
|
+
* This event is fired when a tab is right-clicked and the context menu event from the tab header fires.
|
|
52
|
+
*/
|
|
53
|
+
TabContextMenu: EventEmitter<TabContextMenuEvent>;
|
|
54
|
+
tabs: QueryList<MJTabComponent>;
|
|
55
|
+
tabBodies: QueryList<MJTabBodyComponent>;
|
|
56
|
+
private _viewInitialized;
|
|
57
|
+
ngAfterViewInit(): void;
|
|
58
|
+
ngAfterContentInit(): void;
|
|
59
|
+
ngAfterContentChecked(): void;
|
|
60
|
+
protected syncTabIndexes(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Returns a read-only (copy) of the tabs in this tab strip.
|
|
63
|
+
*/
|
|
64
|
+
get Tabs(): MJTabComponent[];
|
|
65
|
+
/**
|
|
66
|
+
* Returns a read-only (copy) of the tab bodies in this tab strip.
|
|
67
|
+
*/
|
|
68
|
+
get TabBodies(): MJTabBodyComponent[];
|
|
69
|
+
/**
|
|
70
|
+
* Method will close the specified tab number. It is automatically called by a tab that has TabCloseable set to true, if the user clicks the close button, and can be called programatically as well.
|
|
71
|
+
*/
|
|
72
|
+
CloseTab(tabIndex: number): Promise<void>;
|
|
73
|
+
handleTabContextMenu($event: MouseEvent, tab: MJTabComponent): void;
|
|
74
|
+
tabInnerContainer: ElementRef;
|
|
75
|
+
showLeftButton: boolean;
|
|
76
|
+
showRightButton: boolean;
|
|
77
|
+
onResize(event: any): void;
|
|
78
|
+
checkTabScrollButtons(): void;
|
|
79
|
+
scrollTabHeader(scrollAmount: number): void;
|
|
80
|
+
scrollLeft(): void;
|
|
81
|
+
scrollRight(): void;
|
|
82
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MJTabStripComponent, never>;
|
|
83
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MJTabStripComponent, "mj-tabstrip", never, { "SelectedTabIndex": { "alias": "SelectedTabIndex"; "required": false; }; }, { "BeforeTabSelected": "BeforeTabSelected"; "TabSelected": "TabSelected"; "BeforeTabClosed": "BeforeTabClosed"; "TabClosed": "TabClosed"; "TabContextMenu": "TabContextMenu"; }, ["tabs", "tabBodies"], ["mj-tab", "mj-tab-body"], false, never>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Component, Input, EventEmitter, Output, ContentChildren, ViewChild, HostListener } from '@angular/core';
|
|
11
|
+
import { MJTabComponent } from '../tab/tab.component';
|
|
12
|
+
import { MJTabBodyComponent } from '../tab-body/tab-body.component';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@angular/common";
|
|
15
|
+
import * as i2 from "@memberjunction/ng-container-directives";
|
|
16
|
+
const _c0 = ["tabInnerContainer"];
|
|
17
|
+
function MJTabStripComponent_button_2_Template(rf, ctx) { if (rf & 1) {
|
|
18
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
19
|
+
i0.ɵɵelementStart(0, "button", 7);
|
|
20
|
+
i0.ɵɵlistener("click", function MJTabStripComponent_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.scrollLeft()); });
|
|
21
|
+
i0.ɵɵtext(1, "\u21E6");
|
|
22
|
+
i0.ɵɵelementEnd();
|
|
23
|
+
} }
|
|
24
|
+
function MJTabStripComponent_button_6_Template(rf, ctx) { if (rf & 1) {
|
|
25
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
26
|
+
i0.ɵɵelementStart(0, "button", 8);
|
|
27
|
+
i0.ɵɵlistener("click", function MJTabStripComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.scrollRight()); });
|
|
28
|
+
i0.ɵɵtext(1, "\u21E8");
|
|
29
|
+
i0.ɵɵelementEnd();
|
|
30
|
+
} }
|
|
31
|
+
const _c1 = [[["mj-tab"]], [["mj-tab-body"]]];
|
|
32
|
+
const _c2 = ["mj-tab", "mj-tab-body"];
|
|
33
|
+
export class TabEvent {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.tab = null;
|
|
36
|
+
this.body = null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class TabCancelableEvent extends TabEvent {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
this.cancel = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export class TabClosedEvent extends TabEvent {
|
|
46
|
+
}
|
|
47
|
+
export class TabContextMenuEvent extends TabEvent {
|
|
48
|
+
}
|
|
49
|
+
export class MJTabStripComponent {
|
|
50
|
+
constructor() {
|
|
51
|
+
this._selectedTabIndex = -1; // default to negative 1 so any valid value of 0+ will invoke a state change internally later
|
|
52
|
+
/**
|
|
53
|
+
* This event is fired before a tab is selected. If you set cancel to true, the tab will not be selected.
|
|
54
|
+
*/
|
|
55
|
+
this.BeforeTabSelected = new EventEmitter();
|
|
56
|
+
/**
|
|
57
|
+
* This event is fired when a tab is selected.
|
|
58
|
+
*/
|
|
59
|
+
this.TabSelected = new EventEmitter();
|
|
60
|
+
/**
|
|
61
|
+
* This event is fired before a tab is closed. If you set cancel to true, the tab will not be closed.
|
|
62
|
+
*/
|
|
63
|
+
this.BeforeTabClosed = new EventEmitter();
|
|
64
|
+
/**
|
|
65
|
+
* This event is fired after a tab is closed.
|
|
66
|
+
*/
|
|
67
|
+
this.TabClosed = new EventEmitter(true);
|
|
68
|
+
/**
|
|
69
|
+
* This event is fired when a tab is right-clicked and the context menu event from the tab header fires.
|
|
70
|
+
*/
|
|
71
|
+
this.TabContextMenu = new EventEmitter();
|
|
72
|
+
this._viewInitialized = false;
|
|
73
|
+
this.showLeftButton = false;
|
|
74
|
+
this.showRightButton = false;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The index of the selected tab. You can get/set this value and it will change the displayed tab.
|
|
78
|
+
*/
|
|
79
|
+
get SelectedTabIndex() {
|
|
80
|
+
return this._selectedTabIndex;
|
|
81
|
+
}
|
|
82
|
+
set SelectedTabIndex(index) {
|
|
83
|
+
// check to make sure that the new index is different from the current index and only do the work here if it is different
|
|
84
|
+
if (index !== this._selectedTabIndex) {
|
|
85
|
+
const props = {
|
|
86
|
+
index: index,
|
|
87
|
+
tab: index !== null && this.tabs ? this.tabs.toArray()[index] : null,
|
|
88
|
+
body: index !== null && this.tabBodies ? this.tabBodies.toArray()[index] : null,
|
|
89
|
+
cancel: false
|
|
90
|
+
};
|
|
91
|
+
this.BeforeTabSelected.emit(props);
|
|
92
|
+
if (!props.cancel) {
|
|
93
|
+
this._selectedTabIndex = index;
|
|
94
|
+
this.innerRefreshTabVisibility(index);
|
|
95
|
+
const afterProps = {
|
|
96
|
+
index: index,
|
|
97
|
+
tab: props.tab,
|
|
98
|
+
body: props.body
|
|
99
|
+
};
|
|
100
|
+
this.TabSelected.emit(afterProps);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// always do this even if we're not firing event since we're already on the right tab
|
|
105
|
+
this.innerRefreshTabVisibility(index);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
innerRefreshTabVisibility(index) {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
// now, we have to tell each of our tabs they have been selected or not, and also to tell the bodies if they are visible or not
|
|
111
|
+
(_a = this.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab, i) => tab.TabSelected = i === index);
|
|
112
|
+
(_b = this.tabBodies) === null || _b === void 0 ? void 0 : _b.forEach((body, i) => body.TabVisible = i === index);
|
|
113
|
+
}
|
|
114
|
+
ngAfterViewInit() {
|
|
115
|
+
this._viewInitialized = true;
|
|
116
|
+
this.syncTabIndexes();
|
|
117
|
+
}
|
|
118
|
+
ngAfterContentInit() {
|
|
119
|
+
this.syncTabIndexes();
|
|
120
|
+
}
|
|
121
|
+
ngAfterContentChecked() {
|
|
122
|
+
this.syncTabIndexes();
|
|
123
|
+
}
|
|
124
|
+
syncTabIndexes() {
|
|
125
|
+
if (!this._viewInitialized)
|
|
126
|
+
return; // don't do anything until the view is initialized
|
|
127
|
+
// Automatically assign indices to tabs and tab bodies
|
|
128
|
+
this.tabs.forEach((tab, index) => tab.index = index);
|
|
129
|
+
this.tabBodies.forEach((body, index) => body.index = index);
|
|
130
|
+
if (this.SelectedTabIndex === null && this.tabs.length > 0) {
|
|
131
|
+
this.SelectedTabIndex = 0;
|
|
132
|
+
}
|
|
133
|
+
else if (this.tabs.length === 0)
|
|
134
|
+
this.SelectedTabIndex = -1;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns a read-only (copy) of the tabs in this tab strip.
|
|
138
|
+
*/
|
|
139
|
+
get Tabs() {
|
|
140
|
+
return this.tabs.toArray();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns a read-only (copy) of the tab bodies in this tab strip.
|
|
144
|
+
*/
|
|
145
|
+
get TabBodies() {
|
|
146
|
+
return this.tabBodies.toArray();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Method will close the specified tab number. It is automatically called by a tab that has TabCloseable set to true, if the user clicks the close button, and can be called programatically as well.
|
|
150
|
+
*/
|
|
151
|
+
CloseTab(tabIndex) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
if (tabIndex >= 0 && tabIndex < this.tabs.length) {
|
|
154
|
+
// figure out what the new tab index will be so we can share with our container component
|
|
155
|
+
let newTabIndex;
|
|
156
|
+
if (this.tabs.length === 1) {
|
|
157
|
+
// deleting the only tab we have, shouldn't happen but if so, set to -1
|
|
158
|
+
newTabIndex = -1;
|
|
159
|
+
}
|
|
160
|
+
else if (this.SelectedTabIndex >= this.tabs.length - 1) {
|
|
161
|
+
// we are ABOUT to delete the last tab, so select what will be the new last tab
|
|
162
|
+
newTabIndex = this.tabs.length - 2; // substract 2 becuase subtracting 1 would be the last tab, but we are about to delete it
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
// deleting a tab that is not the last one, so we don't need to do anything special, just set the index to what it was before
|
|
166
|
+
newTabIndex = this.SelectedTabIndex;
|
|
167
|
+
}
|
|
168
|
+
const props = {
|
|
169
|
+
index: tabIndex,
|
|
170
|
+
tab: this.tabs.toArray()[tabIndex],
|
|
171
|
+
body: this.tabBodies.toArray()[tabIndex],
|
|
172
|
+
cancel: false,
|
|
173
|
+
};
|
|
174
|
+
this.BeforeTabClosed.emit(props);
|
|
175
|
+
if (!props.cancel) {
|
|
176
|
+
// Convert callback to a promise
|
|
177
|
+
const waitForCompletion = new Promise((resolve, reject) => {
|
|
178
|
+
props.done = (error) => {
|
|
179
|
+
if (error) {
|
|
180
|
+
reject(error);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
resolve(true);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
props.newTabIndex = newTabIndex;
|
|
188
|
+
// fire off the event to the container component
|
|
189
|
+
this.TabClosed.emit(props);
|
|
190
|
+
// wait for callback to occur from the event handler
|
|
191
|
+
yield waitForCompletion;
|
|
192
|
+
// finally, set the tab index to the props.newTabIndex value which allows the container to override our default calculation for new tab index
|
|
193
|
+
this.SelectedTabIndex = props.newTabIndex;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else
|
|
197
|
+
throw new Error("Invalid tab index: " + tabIndex);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
handleTabContextMenu($event, tab) {
|
|
201
|
+
this.TabContextMenu.emit({ index: tab.index, tab: tab, body: this.tabBodies.toArray()[tab.index], mouseEvent: $event });
|
|
202
|
+
}
|
|
203
|
+
onResize(event) {
|
|
204
|
+
this.checkTabScrollButtons();
|
|
205
|
+
}
|
|
206
|
+
checkTabScrollButtons() {
|
|
207
|
+
if (this.tabInnerContainer && this.tabInnerContainer.nativeElement && this.tabInnerContainer.nativeElement.parentElement) {
|
|
208
|
+
const container = this.tabInnerContainer.nativeElement;
|
|
209
|
+
const parent = container.parentElement;
|
|
210
|
+
const currentLeft = container.style.left ? parseInt(container.style.left) : 0;
|
|
211
|
+
// show the right button if the container is wider than the parent AND the left position(which is zero or negative) + the container width is greater than the parent width
|
|
212
|
+
this.showRightButton = container.clientWidth > parent.clientWidth &&
|
|
213
|
+
currentLeft + container.clientWidth > parent.clientWidth;
|
|
214
|
+
// Show left button if left position is less than 0, meaning some of the left side of the container is off screen
|
|
215
|
+
this.showLeftButton = currentLeft < 0;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
scrollTabHeader(scrollAmount) {
|
|
219
|
+
const style = this.tabInnerContainer.nativeElement.style;
|
|
220
|
+
if (style) {
|
|
221
|
+
const curLeft = style.left ? parseInt(style.left) : 0;
|
|
222
|
+
style.left = (curLeft + scrollAmount) + 'px';
|
|
223
|
+
this.checkTabScrollButtons(); // can do immediately because the above is direct DOM manipulation so the effect is immediate
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
scrollLeft() {
|
|
227
|
+
this.scrollTabHeader(150);
|
|
228
|
+
}
|
|
229
|
+
scrollRight() {
|
|
230
|
+
this.scrollTabHeader(-150);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
MJTabStripComponent.ɵfac = function MJTabStripComponent_Factory(t) { return new (t || MJTabStripComponent)(); };
|
|
234
|
+
MJTabStripComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJTabStripComponent, selectors: [["mj-tabstrip"]], contentQueries: function MJTabStripComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
|
|
235
|
+
i0.ɵɵcontentQuery(dirIndex, MJTabComponent, 4);
|
|
236
|
+
i0.ɵɵcontentQuery(dirIndex, MJTabBodyComponent, 4);
|
|
237
|
+
} if (rf & 2) {
|
|
238
|
+
let _t;
|
|
239
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabs = _t);
|
|
240
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabBodies = _t);
|
|
241
|
+
} }, viewQuery: function MJTabStripComponent_Query(rf, ctx) { if (rf & 1) {
|
|
242
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
243
|
+
} if (rf & 2) {
|
|
244
|
+
let _t;
|
|
245
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabInnerContainer = _t.first);
|
|
246
|
+
} }, hostBindings: function MJTabStripComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
247
|
+
i0.ɵɵlistener("resize", function MJTabStripComponent_resize_HostBindingHandler($event) { return ctx.onResize($event); }, false, i0.ɵɵresolveWindow);
|
|
248
|
+
} }, inputs: { SelectedTabIndex: "SelectedTabIndex" }, outputs: { BeforeTabSelected: "BeforeTabSelected", TabSelected: "TabSelected", BeforeTabClosed: "BeforeTabClosed", TabClosed: "TabClosed", TabContextMenu: "TabContextMenu" }, ngContentSelectors: _c2, decls: 9, vars: 2, consts: [["mjFillContainer", "", 1, "tabstrip-container"], [1, "tab-header-outer"], ["kendoButton", "", "class", "tab-scroll-button-left", 3, "click", 4, "ngIf"], [1, "tab-header-inner"], ["tabInnerContainer", ""], ["kendoButton", "", "class", "tab-scroll-button-right", 3, "click", 4, "ngIf"], ["mjFillContainer", "", 1, "tab-body"], ["kendoButton", "", 1, "tab-scroll-button-left", 3, "click"], ["kendoButton", "", 1, "tab-scroll-button-right", 3, "click"]], template: function MJTabStripComponent_Template(rf, ctx) { if (rf & 1) {
|
|
249
|
+
i0.ɵɵprojectionDef(_c1);
|
|
250
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
251
|
+
i0.ɵɵtemplate(2, MJTabStripComponent_button_2_Template, 2, 0, "button", 2);
|
|
252
|
+
i0.ɵɵelementStart(3, "div", 3, 4);
|
|
253
|
+
i0.ɵɵprojection(5);
|
|
254
|
+
i0.ɵɵelementEnd();
|
|
255
|
+
i0.ɵɵtemplate(6, MJTabStripComponent_button_6_Template, 2, 0, "button", 5);
|
|
256
|
+
i0.ɵɵelementEnd();
|
|
257
|
+
i0.ɵɵelementStart(7, "div", 6);
|
|
258
|
+
i0.ɵɵprojection(8, 1);
|
|
259
|
+
i0.ɵɵelementEnd()();
|
|
260
|
+
} if (rf & 2) {
|
|
261
|
+
i0.ɵɵadvance(2);
|
|
262
|
+
i0.ɵɵproperty("ngIf", ctx.showLeftButton);
|
|
263
|
+
i0.ɵɵadvance(4);
|
|
264
|
+
i0.ɵɵproperty("ngIf", ctx.showRightButton);
|
|
265
|
+
} }, dependencies: [i1.NgIf, i2.FillContainer], styles: [".tab-header-outer[_ngcontent-%COMP%] {\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n overflow: hidden; \n\r\n background-color: #D5D8E5;\r\n}\r\n\r\n.tab-header-inner[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-direction: row;\r\n white-space: nowrap; \n\r\n position: relative; \n\r\n z-index: 1; \n\r\n\r\n padding-left: 5px;\r\n padding-top: 5px;\r\n background-color: #D5D8E5;\r\n border-bottom: #F5F6FA;\r\n}\r\n\r\n.tab-scroll-button-left[_ngcontent-%COMP%], .tab-scroll-button-right[_ngcontent-%COMP%] {\r\n position: absolute;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n z-index: 2; \n\r\n}\r\n\r\n.tab-scroll-button-left[_ngcontent-%COMP%] {\r\n left: 0;\r\n}\r\n\r\n.tab-scroll-button-right[_ngcontent-%COMP%] {\r\n right: 0;\r\n}\r\n\r\n \r\n\r\n.tab-body[_ngcontent-%COMP%] {\r\n border-top: 0;\r\n background-color: #F5F6FA; \r\n width: 100%;\r\n height: 200px;\r\n}"] });
|
|
266
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJTabStripComponent, [{
|
|
267
|
+
type: Component,
|
|
268
|
+
args: [{ selector: 'mj-tabstrip', template: "<!-- mj-tabstrip.component.html -->\r\n<div class=\"tabstrip-container\" mjFillContainer>\r\n <!-- Tab Headers -->\r\n <div class=\"tab-header-outer\">\r\n <button kendoButton *ngIf=\"showLeftButton\" class=\"tab-scroll-button-left\" (click)=\"scrollLeft()\">\u21E6</button>\r\n <div class=\"tab-header-inner\" #tabInnerContainer>\r\n <ng-content select=\"mj-tab\"></ng-content> <!-- Where <mj-tab> components are projected -->\r\n </div>\r\n <button kendoButton *ngIf=\"showRightButton\" class=\"tab-scroll-button-right\" (click)=\"scrollRight()\">\u21E8</button>\r\n </div>\r\n <!-- Tab Content -->\r\n <div class=\"tab-body\" mjFillContainer>\r\n <ng-content select=\"mj-tab-body\"></ng-content> <!-- Where <mj-tab-body> components are projected -->\r\n </div>\r\n</div>", styles: [".tab-header-outer {\r\n position: relative;\r\n display: flex;\r\n align-items: center;\r\n overflow: hidden; /* Hide the overflow */\r\n background-color: #D5D8E5;\r\n}\r\n\r\n.tab-header-inner {\r\n display: flex;\r\n flex-direction: row;\r\n white-space: nowrap; /* Prevent wrapping of tabs */\r\n position: relative; /* Needed for z-index to work */\r\n z-index: 1; /* Place tabs above the content */\r\n\r\n padding-left: 5px;\r\n padding-top: 5px;\r\n background-color: #D5D8E5;\r\n border-bottom: #F5F6FA;\r\n}\r\n\r\n.tab-scroll-button-left, .tab-scroll-button-right {\r\n position: absolute;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n z-index: 2; /* Ensure buttons are above the content */\r\n}\r\n\r\n.tab-scroll-button-left {\r\n left: 0;\r\n}\r\n\r\n.tab-scroll-button-right {\r\n right: 0;\r\n}\r\n\r\n \r\n\r\n.tab-body {\r\n border-top: 0;\r\n background-color: #F5F6FA; \r\n width: 100%;\r\n height: 200px;\r\n} "] }]
|
|
269
|
+
}], null, { SelectedTabIndex: [{
|
|
270
|
+
type: Input
|
|
271
|
+
}], BeforeTabSelected: [{
|
|
272
|
+
type: Output
|
|
273
|
+
}], TabSelected: [{
|
|
274
|
+
type: Output
|
|
275
|
+
}], BeforeTabClosed: [{
|
|
276
|
+
type: Output
|
|
277
|
+
}], TabClosed: [{
|
|
278
|
+
type: Output
|
|
279
|
+
}], TabContextMenu: [{
|
|
280
|
+
type: Output
|
|
281
|
+
}], tabs: [{
|
|
282
|
+
type: ContentChildren,
|
|
283
|
+
args: [MJTabComponent]
|
|
284
|
+
}], tabBodies: [{
|
|
285
|
+
type: ContentChildren,
|
|
286
|
+
args: [MJTabBodyComponent]
|
|
287
|
+
}], tabInnerContainer: [{
|
|
288
|
+
type: ViewChild,
|
|
289
|
+
args: ['tabInnerContainer']
|
|
290
|
+
}], onResize: [{
|
|
291
|
+
type: HostListener,
|
|
292
|
+
args: ['window:resize', ['$event']]
|
|
293
|
+
}] }); })();
|
|
294
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJTabStripComponent, { className: "MJTabStripComponent", filePath: "src\\lib\\tab-strip\\tab-strip.component.ts", lineNumber: 33 }); })();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class TabStripComponent {
|
|
4
|
+
}
|
|
5
|
+
TabStripComponent.ɵfac = function TabStripComponent_Factory(t) { return new (t || TabStripComponent)(); };
|
|
6
|
+
TabStripComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TabStripComponent, selectors: [["mj-tabstrip"]], decls: 0, vars: 0, template: function TabStripComponent_Template(rf, ctx) { } });
|
|
7
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TabStripComponent, [{
|
|
8
|
+
type: Component,
|
|
9
|
+
args: [{ selector: 'mj-tabstrip', template: "" }]
|
|
10
|
+
}], null, null); })();
|
|
11
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TabStripComponent, { className: "TabStripComponent", filePath: "src\\lib\\tab-strip.component.ts", lineNumber: 9 }); })();
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@memberjunction/ng-tabstrip",
|
|
3
|
+
"version": "0.9.2",
|
|
4
|
+
"description": "MemberJunction: Very simple tab strip component used in the MJ Explorer app and reusable anywhere else in an Angular project.",
|
|
5
|
+
"main": "./dist/public-api.js",
|
|
6
|
+
"typings": "./dist/public-api.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"/dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
+
"build": "ngc"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@angular/compiler": "~17.2.2",
|
|
19
|
+
"@angular/compiler-cli": "~17.2.2"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@angular/common": "~17.2.2",
|
|
23
|
+
"@angular/core": "~17.2.2"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@memberjunction/ng-container-directives": "^0.9.147",
|
|
27
|
+
"tslib": "^2.3.0"
|
|
28
|
+
},
|
|
29
|
+
"sideEffects": false
|
|
30
|
+
}
|