@memberjunction/ng-tabstrip 4.0.0 → 4.1.0
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/README.md +92 -354
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @memberjunction/ng-tabstrip
|
|
2
2
|
|
|
3
|
-
A lightweight
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Simple API**: Easy to use and customize
|
|
8
|
-
- **Closeable Tabs**: Option to enable tab closing
|
|
9
|
-
- **Scrollable Tabs**: Automatically handles overflow with scrolling buttons
|
|
10
|
-
- **Event-driven**: Rich event system for tab selection and management
|
|
11
|
-
- **Context Menu Support**: Handle right-click events on tabs
|
|
12
|
-
- **Responsive Design**: Adapts to different screen sizes
|
|
13
|
-
- **Tab Navigation**: Methods for tab selection, scrolling, and visibility
|
|
14
|
-
- **Dynamic Content**: Support for dynamically changing tab content
|
|
15
|
-
- **Customizable**: Configure tab appearance and behavior
|
|
16
|
-
- **Lightweight**: Minimal dependencies and overhead
|
|
17
|
-
- **Tab Visibility**: Hide/show tabs dynamically
|
|
18
|
-
- **Fill Container**: Optional width/height fill of parent container
|
|
3
|
+
A lightweight, zero-dependency Angular tab strip component for MemberJunction applications. Provides dynamic tab management with closeable tabs, scroll overflow handling, context menus, and programmatic tab control.
|
|
19
4
|
|
|
20
5
|
## Installation
|
|
21
6
|
|
|
@@ -23,384 +8,137 @@ A lightweight and flexible Angular tab strip component for MemberJunction applic
|
|
|
23
8
|
npm install @memberjunction/ng-tabstrip
|
|
24
9
|
```
|
|
25
10
|
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
The tab strip renders a row of tab headers with corresponding body panels. It handles overflow with horizontal scroll buttons, supports closeable tabs with cancelable close events, and provides a rich event system for tab lifecycle management. Unlike Kendo UI tabs, this component has no external dependencies beyond Angular.
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
flowchart TD
|
|
17
|
+
subgraph TabStrip["MJTabStripComponent"]
|
|
18
|
+
A["Tab Headers (scrollable)"]
|
|
19
|
+
A --> B["MJTabComponent 1"]
|
|
20
|
+
A --> C["MJTabComponent 2"]
|
|
21
|
+
A --> D["MJTabComponent N"]
|
|
22
|
+
end
|
|
23
|
+
subgraph Bodies["Tab Bodies"]
|
|
24
|
+
E["MJTabBodyComponent 1"]
|
|
25
|
+
F["MJTabBodyComponent 2"]
|
|
26
|
+
G["MJTabBodyComponent N"]
|
|
27
|
+
end
|
|
28
|
+
subgraph Events["Event System"]
|
|
29
|
+
H["BeforeTabSelected (cancelable)"]
|
|
30
|
+
I["TabSelected"]
|
|
31
|
+
J["BeforeTabClosed (cancelable)"]
|
|
32
|
+
K["TabClosed (with done callback)"]
|
|
33
|
+
L["TabContextMenu"]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
B --> E
|
|
37
|
+
C --> F
|
|
38
|
+
D --> G
|
|
39
|
+
TabStrip --> Events
|
|
40
|
+
|
|
41
|
+
style TabStrip fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
42
|
+
style Bodies fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
43
|
+
style Events fill:#7c5295,stroke:#563a6b,color:#fff
|
|
44
|
+
```
|
|
45
|
+
|
|
26
46
|
## Usage
|
|
27
47
|
|
|
28
|
-
### Import
|
|
48
|
+
### Module Import
|
|
29
49
|
|
|
30
50
|
```typescript
|
|
31
51
|
import { MJTabStripModule } from '@memberjunction/ng-tabstrip';
|
|
32
52
|
|
|
33
53
|
@NgModule({
|
|
34
|
-
imports: [
|
|
35
|
-
MJTabStripModule,
|
|
36
|
-
// other imports
|
|
37
|
-
],
|
|
38
|
-
// ...
|
|
54
|
+
imports: [MJTabStripModule]
|
|
39
55
|
})
|
|
40
|
-
export class YourModule {
|
|
56
|
+
export class YourModule {}
|
|
41
57
|
```
|
|
42
58
|
|
|
43
|
-
### Basic
|
|
59
|
+
### Basic Usage
|
|
44
60
|
|
|
45
61
|
```html
|
|
46
62
|
<mj-tabstrip
|
|
47
63
|
[SelectedTabIndex]="selectedTab"
|
|
48
64
|
(TabSelected)="onTabSelected($event)"
|
|
49
65
|
(BeforeTabClosed)="onBeforeTabClosed($event)">
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<mj-tab [Name]="'
|
|
53
|
-
<mj-tab [Name]="'
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<!-- Tab bodies -->
|
|
66
|
+
|
|
67
|
+
<mj-tab [Name]="'overview'" [TabCloseable]="false">Overview</mj-tab>
|
|
68
|
+
<mj-tab [Name]="'details'" [TabCloseable]="true">Details</mj-tab>
|
|
69
|
+
<mj-tab [Name]="'settings'" [TabCloseable]="true">Settings</mj-tab>
|
|
70
|
+
|
|
57
71
|
<mj-tab-body>
|
|
58
72
|
<h2>Overview Content</h2>
|
|
59
|
-
<p>This is the overview tab content...</p>
|
|
60
73
|
</mj-tab-body>
|
|
61
|
-
|
|
62
74
|
<mj-tab-body>
|
|
63
75
|
<h2>Details Content</h2>
|
|
64
|
-
<p>This is the details tab content...</p>
|
|
65
76
|
</mj-tab-body>
|
|
66
|
-
|
|
67
77
|
<mj-tab-body>
|
|
68
78
|
<h2>Settings Content</h2>
|
|
69
|
-
<p>This is the settings tab content...</p>
|
|
70
79
|
</mj-tab-body>
|
|
71
80
|
</mj-tabstrip>
|
|
72
81
|
```
|
|
73
82
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
import { Component } from '@angular/core';
|
|
78
|
-
import { TabEvent, TabCancelableEvent, TabClosedEvent } from '@memberjunction/ng-tabstrip';
|
|
79
|
-
|
|
80
|
-
@Component({
|
|
81
|
-
selector: 'app-dynamic-tabs',
|
|
82
|
-
template: `
|
|
83
|
-
<div class="tab-container">
|
|
84
|
-
<button (click)="addNewTab()">Add Tab</button>
|
|
85
|
-
|
|
86
|
-
<mj-tabstrip
|
|
87
|
-
[SelectedTabIndex]="selectedTabIndex"
|
|
88
|
-
(TabSelected)="onTabSelected($event)"
|
|
89
|
-
(BeforeTabClosed)="onBeforeTabClosed($event)"
|
|
90
|
-
(TabClosed)="onTabClosed($event)"
|
|
91
|
-
#tabStrip>
|
|
92
|
-
|
|
93
|
-
<mj-tab
|
|
94
|
-
*ngFor="let tab of tabs"
|
|
95
|
-
[Name]="tab.name"
|
|
96
|
-
[TabCloseable]="tab.closeable"
|
|
97
|
-
[Visible]="tab.visible"
|
|
98
|
-
[ID]="tab.id">
|
|
99
|
-
{{tab.title}}
|
|
100
|
-
</mj-tab>
|
|
101
|
-
|
|
102
|
-
<mj-tab-body *ngFor="let tab of tabs">
|
|
103
|
-
<div class="tab-content">
|
|
104
|
-
<h3>{{tab.title}} Content</h3>
|
|
105
|
-
<p>{{tab.content}}</p>
|
|
106
|
-
<button (click)="updateTabContent(tab.id)">Update Content</button>
|
|
107
|
-
</div>
|
|
108
|
-
</mj-tab-body>
|
|
109
|
-
</mj-tabstrip>
|
|
110
|
-
</div>
|
|
111
|
-
`,
|
|
112
|
-
styles: [`
|
|
113
|
-
.tab-container {
|
|
114
|
-
height: 500px;
|
|
115
|
-
border: 1px solid #ccc;
|
|
116
|
-
padding: 10px;
|
|
117
|
-
}
|
|
118
|
-
.tab-content {
|
|
119
|
-
padding: 20px;
|
|
120
|
-
}
|
|
121
|
-
`]
|
|
122
|
-
})
|
|
123
|
-
export class DynamicTabsComponent {
|
|
124
|
-
selectedTabIndex = 0;
|
|
125
|
-
|
|
126
|
-
tabs = [
|
|
127
|
-
{
|
|
128
|
-
id: 1,
|
|
129
|
-
name: 'home',
|
|
130
|
-
title: 'Home',
|
|
131
|
-
content: 'Welcome to the home tab',
|
|
132
|
-
closeable: false,
|
|
133
|
-
visible: true
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 2,
|
|
137
|
-
name: 'reports',
|
|
138
|
-
title: 'Reports',
|
|
139
|
-
content: 'View your reports here',
|
|
140
|
-
closeable: true,
|
|
141
|
-
visible: true
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 3,
|
|
145
|
-
name: 'settings',
|
|
146
|
-
title: 'Settings',
|
|
147
|
-
content: 'Configure your settings',
|
|
148
|
-
closeable: true,
|
|
149
|
-
visible: true
|
|
150
|
-
}
|
|
151
|
-
];
|
|
152
|
-
|
|
153
|
-
nextTabId = 4;
|
|
154
|
-
|
|
155
|
-
addNewTab() {
|
|
156
|
-
const newTab = {
|
|
157
|
-
id: this.nextTabId++,
|
|
158
|
-
name: `tab-${Date.now()}`,
|
|
159
|
-
title: `New Tab ${this.nextTabId-1}`,
|
|
160
|
-
content: `This is the content for new tab ${this.nextTabId-1}`,
|
|
161
|
-
closeable: true,
|
|
162
|
-
visible: true
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
this.tabs.push(newTab);
|
|
166
|
-
// Need to wait for next tick to select the new tab
|
|
167
|
-
setTimeout(() => {
|
|
168
|
-
this.selectedTabIndex = this.tabs.length - 1;
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
updateTabContent(tabId: number) {
|
|
173
|
-
const tab = this.tabs.find(t => t.id === tabId);
|
|
174
|
-
if (tab) {
|
|
175
|
-
tab.content = `Updated content at ${new Date().toLocaleTimeString()}`;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
onTabSelected(event: TabEvent) {
|
|
180
|
-
console.log('Tab selected:', event.index, event.tab?.Name);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
onBeforeTabClosed(event: TabCancelableEvent) {
|
|
184
|
-
// Optionally prevent closing specific tabs
|
|
185
|
-
if (event.tab?.Name === 'important-tab') {
|
|
186
|
-
event.cancel = true;
|
|
187
|
-
alert('This tab cannot be closed!');
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
onTabClosed(event: TabClosedEvent) {
|
|
192
|
-
// Remove the tab from our array
|
|
193
|
-
const index = this.tabs.findIndex(t => t.id === event.tab?.ID);
|
|
194
|
-
if (index >= 0) {
|
|
195
|
-
this.tabs.splice(index, 1);
|
|
196
|
-
// Signal that we're done processing
|
|
197
|
-
event.done();
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## API Reference
|
|
204
|
-
|
|
205
|
-
### MJTabStripComponent
|
|
206
|
-
|
|
207
|
-
The main component that contains and manages the tabs.
|
|
208
|
-
|
|
209
|
-
#### Inputs
|
|
210
|
-
|
|
211
|
-
- `SelectedTabIndex`: number - The index of the selected tab
|
|
212
|
-
- `FillWidth`: boolean - Whether the tab strip should fill its container width (default: true)
|
|
213
|
-
- `FillHeight`: boolean - Whether the tab strip should fill its container height (default: true)
|
|
214
|
-
- `ScrollAmount`: number - Pixels to scroll when using scroll buttons (default: 150)
|
|
215
|
-
|
|
216
|
-
#### Outputs
|
|
217
|
-
|
|
218
|
-
- `BeforeTabSelected`: EventEmitter<TabCancelableEvent> - Fires before a tab is selected
|
|
219
|
-
- `TabSelected`: EventEmitter<TabEvent> - Fires when a tab is selected
|
|
220
|
-
- `BeforeTabClosed`: EventEmitter<TabCancelableEvent> - Fires before a tab is closed
|
|
221
|
-
- `TabClosed`: EventEmitter<TabClosedEvent> - Fires when a tab is closed
|
|
222
|
-
- `TabContextMenu`: EventEmitter<TabContextMenuEvent> - Fires when a tab is right-clicked
|
|
223
|
-
- `TabScrolled`: EventEmitter<void> - Fires when the tab strip is scrolled
|
|
224
|
-
- `ResizeContainer`: EventEmitter<void> - Fires when the tab strip suggests a container resize
|
|
225
|
-
|
|
226
|
-
#### Methods
|
|
227
|
-
|
|
228
|
-
- `SelectTabByName(tabName: string): MJTabComponent | undefined` - Selects a tab by its name and returns the tab if found
|
|
229
|
-
- `GetTabByName(tabName: string): MJTabComponent | undefined` - Gets a tab component by its name
|
|
230
|
-
- `CloseTab(tabIndex: number): Promise<void>` - Closes a tab by its index (async)
|
|
231
|
-
- `scrollLeft(): void` - Scrolls the tab strip to the left by 150 pixels (note: currently ignores ScrollAmount input)
|
|
232
|
-
- `scrollRight(): void` - Scrolls the tab strip to the right by 150 pixels (note: currently ignores ScrollAmount input)
|
|
233
|
-
- `scrollIntoView(tabIndex: number): void` - Scrolls to make a specific tab visible
|
|
234
|
-
- `RefreshTabs(): void` - Refreshes the tab strip after dynamic changes
|
|
235
|
-
|
|
236
|
-
#### Properties
|
|
237
|
-
|
|
238
|
-
- `Tabs`: MJTabComponent[] - Array of tab components
|
|
239
|
-
- `TabBodies`: MJTabBodyComponent[] - Array of tab body components
|
|
240
|
-
|
|
241
|
-
### MJTabComponent
|
|
242
|
-
|
|
243
|
-
Represents a tab header in the tab strip.
|
|
244
|
-
|
|
245
|
-
#### Inputs
|
|
246
|
-
|
|
247
|
-
- `Name`: string - The name of the tab (used for finding tabs by name)
|
|
248
|
-
- `ID`: any - Custom identifier for the tab
|
|
249
|
-
- `Props`: any - Additional properties to associate with the tab
|
|
250
|
-
- `TabCloseable`: boolean - Whether the tab can be closed (default: false)
|
|
251
|
-
- `Visible`: boolean - Whether the tab is visible (default: true)
|
|
252
|
-
- `TabSelected`: boolean - Whether the tab is selected (managed by the tab strip)
|
|
253
|
-
|
|
254
|
-
#### Methods
|
|
255
|
-
|
|
256
|
-
- `selectTab(): void` - Selects this tab
|
|
257
|
-
- `closeTab(event: MouseEvent): void` - Closes this tab
|
|
258
|
-
- `handleContextMenu(event: MouseEvent): void` - Handles context menu events
|
|
259
|
-
|
|
260
|
-
#### Properties
|
|
261
|
-
|
|
262
|
-
- `TabStrip`: MJTabStripComponent - Reference to the parent tab strip component
|
|
263
|
-
|
|
264
|
-
### MJTabBodyComponent
|
|
265
|
-
|
|
266
|
-
Represents the content area for a tab.
|
|
267
|
-
|
|
268
|
-
#### Inputs
|
|
269
|
-
|
|
270
|
-
- `TabVisible`: boolean - Whether the tab body is visible (managed by the tab strip)
|
|
271
|
-
- `FillWidth`: boolean - Whether the tab body should fill its container width (default: true)
|
|
272
|
-
- `FillHeight`: boolean - Whether the tab body should fill its container height (default: true)
|
|
273
|
-
|
|
274
|
-
### Event Types
|
|
275
|
-
|
|
276
|
-
#### TabEvent
|
|
277
|
-
|
|
278
|
-
Base event type for tab operations.
|
|
279
|
-
|
|
280
|
-
- `index`: number - The index of the tab
|
|
281
|
-
- `tab`: MJTabComponent - Reference to the tab component
|
|
282
|
-
- `body`: MJTabBodyComponent - Reference to the tab body component
|
|
283
|
-
|
|
284
|
-
#### TabCancelableEvent
|
|
285
|
-
|
|
286
|
-
Event type that allows cancellation of an operation.
|
|
287
|
-
|
|
288
|
-
- All properties from TabEvent
|
|
289
|
-
- `cancel`: boolean - Set to true to cancel the operation
|
|
290
|
-
|
|
291
|
-
#### TabClosedEvent
|
|
292
|
-
|
|
293
|
-
Event type for tab closure.
|
|
294
|
-
|
|
295
|
-
- All properties from TabEvent
|
|
296
|
-
- `newTabIndex`: number - The suggested new tab index after closing
|
|
297
|
-
- `done`: (error?: any) => {} - Callback that must be called when processing is complete
|
|
298
|
-
|
|
299
|
-
#### TabContextMenuEvent
|
|
300
|
-
|
|
301
|
-
Event type for context menu events.
|
|
302
|
-
|
|
303
|
-
- All properties from TabEvent
|
|
304
|
-
- `mouseEvent`: MouseEvent - The original mouse event
|
|
305
|
-
|
|
306
|
-
## Advanced Usage
|
|
307
|
-
|
|
308
|
-
### Tab Visibility Management
|
|
309
|
-
|
|
310
|
-
You can dynamically hide/show tabs while maintaining their state:
|
|
311
|
-
|
|
312
|
-
```typescript
|
|
313
|
-
// Hide a tab
|
|
314
|
-
const tab = this.tabStrip.GetTabByName('settings');
|
|
315
|
-
if (tab) {
|
|
316
|
-
tab.Visible = false; // Tab will be hidden but not removed
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
// Show it again
|
|
320
|
-
tab.Visible = true;
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
Note: Hidden tabs cannot be selected. If a selected tab is hidden, the tab strip will automatically select the first visible tab.
|
|
83
|
+
## Components
|
|
324
84
|
|
|
325
|
-
|
|
85
|
+
| Component | Selector | Purpose |
|
|
86
|
+
|-----------|----------|---------|
|
|
87
|
+
| `MJTabStripComponent` | `mj-tabstrip` | Container managing tab selection and scroll |
|
|
88
|
+
| `MJTabComponent` | `mj-tab` | Individual tab header |
|
|
89
|
+
| `MJTabBodyComponent` | `mj-tab-body` | Content panel for a tab |
|
|
326
90
|
|
|
327
|
-
|
|
328
|
-
@ViewChild('tabStrip') tabStrip!: MJTabStripComponent;
|
|
329
|
-
|
|
330
|
-
// Select a specific tab
|
|
331
|
-
this.tabStrip.SelectedTabIndex = 2;
|
|
91
|
+
## MJTabStripComponent
|
|
332
92
|
|
|
333
|
-
|
|
334
|
-
this.tabStrip.SelectTabByName('reports');
|
|
93
|
+
### Inputs
|
|
335
94
|
|
|
336
|
-
|
|
337
|
-
|
|
95
|
+
| Property | Type | Default | Description |
|
|
96
|
+
|----------|------|---------|-------------|
|
|
97
|
+
| `SelectedTabIndex` | `number` | `0` | Index of the selected tab |
|
|
98
|
+
| `FillWidth` | `boolean` | `true` | Fill container width |
|
|
99
|
+
| `FillHeight` | `boolean` | `true` | Fill container height |
|
|
100
|
+
| `ScrollAmount` | `number` | `150` | Pixels to scroll per click |
|
|
338
101
|
|
|
339
|
-
|
|
340
|
-
this.tabStrip.scrollIntoView(5);
|
|
341
|
-
```
|
|
102
|
+
### Outputs
|
|
342
103
|
|
|
343
|
-
|
|
104
|
+
| Event | Type | Description |
|
|
105
|
+
|-------|------|-------------|
|
|
106
|
+
| `BeforeTabSelected` | `EventEmitter<TabCancelableEvent>` | Before tab selection (cancelable) |
|
|
107
|
+
| `TabSelected` | `EventEmitter<TabEvent>` | After tab selection |
|
|
108
|
+
| `BeforeTabClosed` | `EventEmitter<TabCancelableEvent>` | Before tab close (cancelable) |
|
|
109
|
+
| `TabClosed` | `EventEmitter<TabClosedEvent>` | After tab close (call `done()` when finished) |
|
|
110
|
+
| `TabContextMenu` | `EventEmitter<TabContextMenuEvent>` | Tab right-click |
|
|
111
|
+
| `TabScrolled` | `EventEmitter<void>` | Tab strip scrolled |
|
|
344
112
|
|
|
345
|
-
|
|
113
|
+
### Methods
|
|
346
114
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
115
|
+
| Method | Returns | Description |
|
|
116
|
+
|--------|---------|-------------|
|
|
117
|
+
| `SelectTabByName(name)` | `MJTabComponent \| undefined` | Select a tab by name |
|
|
118
|
+
| `GetTabByName(name)` | `MJTabComponent \| undefined` | Find a tab by name |
|
|
119
|
+
| `CloseTab(index)` | `Promise<void>` | Close a tab programmatically |
|
|
120
|
+
| `scrollIntoView(index)` | `void` | Scroll to make a tab visible |
|
|
121
|
+
| `RefreshTabs()` | `void` | Refresh after dynamic changes |
|
|
350
122
|
|
|
351
|
-
|
|
123
|
+
## MJTabComponent
|
|
352
124
|
|
|
353
|
-
|
|
354
|
-
const tab = this.tabStrip.SelectTabByName('dynamicTab');
|
|
355
|
-
if (!tab) {
|
|
356
|
-
console.error('Tab not found');
|
|
357
|
-
}
|
|
358
|
-
```
|
|
125
|
+
### Inputs
|
|
359
126
|
|
|
360
|
-
|
|
127
|
+
| Property | Type | Default | Description |
|
|
128
|
+
|----------|------|---------|-------------|
|
|
129
|
+
| `Name` | `string` | `''` | Tab identifier |
|
|
130
|
+
| `ID` | `string \| number` | -- | Custom identifier |
|
|
131
|
+
| `TabCloseable` | `boolean` | `false` | Show close button |
|
|
132
|
+
| `Visible` | `boolean` | `true` | Tab visibility |
|
|
361
133
|
|
|
362
|
-
|
|
134
|
+
## Event Types
|
|
363
135
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
- `.tab-header-inner` - Inner scrollable container for tabs
|
|
369
|
-
- `.tab-scroll-button` - Base class for scroll buttons
|
|
370
|
-
- `.tab-scroll-button-left` - Left scroll button
|
|
371
|
-
- `.tab-scroll-button-right` - Right scroll button
|
|
372
|
-
- `.tab-bodies` - Container for tab content
|
|
136
|
+
- **`TabEvent`** -- `{ index, tab, body }`
|
|
137
|
+
- **`TabCancelableEvent`** -- Extends TabEvent with `cancel: boolean`
|
|
138
|
+
- **`TabClosedEvent`** -- Extends TabEvent with `newTabIndex` and `done()` callback
|
|
139
|
+
- **`TabContextMenuEvent`** -- Extends TabEvent with `mouseEvent`
|
|
373
140
|
|
|
374
141
|
## Dependencies
|
|
375
142
|
|
|
376
|
-
- `@angular/common
|
|
377
|
-
-
|
|
378
|
-
- `@memberjunction/ng-container-directives`: For container directives
|
|
379
|
-
- `tslib`: ^2.3.0
|
|
380
|
-
|
|
381
|
-
## Build and Development
|
|
382
|
-
|
|
383
|
-
This package uses Angular CLI for building:
|
|
384
|
-
|
|
385
|
-
```bash
|
|
386
|
-
npm run build
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
The package is configured with:
|
|
390
|
-
- TypeScript compilation via `ngc`
|
|
391
|
-
- No side effects for better tree-shaking
|
|
392
|
-
- Proper peer dependencies for Angular 21+
|
|
393
|
-
|
|
394
|
-
## Integration with MemberJunction
|
|
395
|
-
|
|
396
|
-
This tab strip component is designed to work seamlessly with other MemberJunction packages and follows the same patterns and conventions used throughout the MJ ecosystem. It's particularly useful in:
|
|
397
|
-
|
|
398
|
-
- MJ Explorer application
|
|
399
|
-
- Dashboard interfaces
|
|
400
|
-
- Multi-view forms
|
|
401
|
-
- Configuration screens
|
|
402
|
-
- Any interface requiring tabbed navigation
|
|
403
|
-
|
|
404
|
-
## License
|
|
405
|
-
|
|
406
|
-
ISC
|
|
143
|
+
- `@angular/common` / `@angular/core`
|
|
144
|
+
- [@memberjunction/ng-container-directives](../container-directives/README.md) -- Container directives
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-tabstrip",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "MemberJunction: Very simple tab strip component used in the MJ Explorer app and reusable anywhere else in an Angular project.",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@angular/core": "21.1.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@memberjunction/ng-container-directives": "4.
|
|
26
|
+
"@memberjunction/ng-container-directives": "4.1.0",
|
|
27
27
|
"tslib": "^2.8.1"
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|