mn-angular-lib 1.0.62 → 1.0.63
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Optional, Inject, HostBinding, Input, Component, inject, ChangeDetectionStrategy, signal, APP_INITIALIZER, DestroyRef, SkipSelf, Attribute, Directive, Pipe, ElementRef, Self, EventEmitter, Output, HostListener, ViewChild, forwardRef, Renderer2, ChangeDetectorRef, TemplateRef, ViewContainerRef, ViewChildren, ApplicationRef, EnvironmentInjector, createComponent } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, HostBinding, Input, Component, inject, ChangeDetectionStrategy, signal, APP_INITIALIZER, DestroyRef, SkipSelf, Attribute, Directive, Pipe, ElementRef, Self, EventEmitter, Output, HostListener, ViewChild, forwardRef, Renderer2, ChangeDetectorRef, TemplateRef, ViewContainerRef, ViewChildren, ApplicationRef, EnvironmentInjector, createComponent, isSignal } from '@angular/core';
|
|
3
3
|
export { TemplateRef, Type } from '@angular/core';
|
|
4
4
|
import { BehaviorSubject, firstValueFrom, skip, Subject, debounceTime, of, takeUntil, map, catchError } from 'rxjs';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
@@ -7722,6 +7722,15 @@ class MnTabComponent {
|
|
|
7722
7722
|
this.currentActive = this.dataSource.items[this.dataSource.defaultActive];
|
|
7723
7723
|
}
|
|
7724
7724
|
}
|
|
7725
|
+
/**
|
|
7726
|
+
* Returns the resolved badge value for a tab item, supporting both plain numbers and Signal<number>.
|
|
7727
|
+
* @param item - The tab item whose badge to resolve.
|
|
7728
|
+
*/
|
|
7729
|
+
getBadge(item) {
|
|
7730
|
+
if (isSignal(item.badge))
|
|
7731
|
+
return item.badge();
|
|
7732
|
+
return item.badge;
|
|
7733
|
+
}
|
|
7725
7734
|
/**
|
|
7726
7735
|
* Sets the given tab item as active, invoking deactivate/activate callbacks.
|
|
7727
7736
|
* @param item - The tab item to activate.
|
|
@@ -7735,11 +7744,11 @@ class MnTabComponent {
|
|
|
7735
7744
|
}
|
|
7736
7745
|
}
|
|
7737
7746
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7738
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MnTabComponent, isStandalone: true, selector: "mn-tab", inputs: { dataSource: "dataSource", scrollable: "scrollable", justified: "justified" }, outputs: { activeChange: "activeChange" }, ngImport: i0, template: "<div class=\"mb-10\">\n <div\n class=\"flex justify-start scrollbar-hide\"\n [class.overflow-x-auto]=\"scrollable\"\n [class.overflow-y-hidden]=\"scrollable\"\n >\n <div\n role=\"tablist\"\n class=\"tabs flex flex-nowrap -mb-[1px] border-b border-base-300\"\n [class.w-full]=\"justified\"\n >\n @for (item of dataSource.items; track item.label) {\n <div\n role=\"tab\"\n class=\"tab px-4 py-2 border-b-2 cursor-pointer select-none transition-colors whitespace-nowrap text-center\"\n [class.flex-1]=\"justified\"\n [class.text-primary]=\"currentActive === item\"\n [class.font-bold]=\"currentActive === item\"\n [class.border-primary]=\"currentActive === item\"\n [class.border-transparent]=\"currentActive !== item\"\n [class.text-base-content]=\"currentActive !== item\"\n [attr.aria-selected]=\"currentActive === item\"\n (click)=\"setActive(item)\"\n >\n {{ item.label | mnTranslate }}\n @if (
|
|
7747
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MnTabComponent, isStandalone: true, selector: "mn-tab", inputs: { dataSource: "dataSource", scrollable: "scrollable", justified: "justified" }, outputs: { activeChange: "activeChange" }, ngImport: i0, template: "<div class=\"mb-10\">\n <div\n class=\"flex justify-start scrollbar-hide\"\n [class.overflow-x-auto]=\"scrollable\"\n [class.overflow-y-hidden]=\"scrollable\"\n >\n <div\n role=\"tablist\"\n class=\"tabs flex flex-nowrap -mb-[1px] border-b border-base-300\"\n [class.w-full]=\"justified\"\n >\n @for (item of dataSource.items; track item.label) {\n <div\n role=\"tab\"\n class=\"tab px-4 py-2 border-b-2 cursor-pointer select-none transition-colors whitespace-nowrap text-center\"\n [class.flex-1]=\"justified\"\n [class.text-primary]=\"currentActive === item\"\n [class.font-bold]=\"currentActive === item\"\n [class.border-primary]=\"currentActive === item\"\n [class.border-transparent]=\"currentActive !== item\"\n [class.text-base-content]=\"currentActive !== item\"\n [attr.aria-selected]=\"currentActive === item\"\n (click)=\"setActive(item)\"\n >\n {{ item.label | mnTranslate }}\n @let badge = getBadge(item);\n @if (badge && badge > 0) {\n <span [data]=\"{ size: 'sm', color: 'accent', variant: 'fill' }\" mnBadge>{{ badge }}</span>\n }\n </div>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: MnBadge, selector: "span[mnBadge]", inputs: ["data"] }, { kind: "pipe", type: MnTranslatePipe, name: "mnTranslate" }] });
|
|
7739
7748
|
}
|
|
7740
7749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MnTabComponent, decorators: [{
|
|
7741
7750
|
type: Component,
|
|
7742
|
-
args: [{ selector: 'mn-tab', standalone: true, imports: [MnTranslatePipe, CommonModule], template: "<div class=\"mb-10\">\n <div\n class=\"flex justify-start scrollbar-hide\"\n [class.overflow-x-auto]=\"scrollable\"\n [class.overflow-y-hidden]=\"scrollable\"\n >\n <div\n role=\"tablist\"\n class=\"tabs flex flex-nowrap -mb-[1px] border-b border-base-300\"\n [class.w-full]=\"justified\"\n >\n @for (item of dataSource.items; track item.label) {\n <div\n role=\"tab\"\n class=\"tab px-4 py-2 border-b-2 cursor-pointer select-none transition-colors whitespace-nowrap text-center\"\n [class.flex-1]=\"justified\"\n [class.text-primary]=\"currentActive === item\"\n [class.font-bold]=\"currentActive === item\"\n [class.border-primary]=\"currentActive === item\"\n [class.border-transparent]=\"currentActive !== item\"\n [class.text-base-content]=\"currentActive !== item\"\n [attr.aria-selected]=\"currentActive === item\"\n (click)=\"setActive(item)\"\n >\n {{ item.label | mnTranslate }}\n @if (
|
|
7751
|
+
args: [{ selector: 'mn-tab', standalone: true, imports: [MnTranslatePipe, CommonModule, MnBadge], template: "<div class=\"mb-10\">\n <div\n class=\"flex justify-start scrollbar-hide\"\n [class.overflow-x-auto]=\"scrollable\"\n [class.overflow-y-hidden]=\"scrollable\"\n >\n <div\n role=\"tablist\"\n class=\"tabs flex flex-nowrap -mb-[1px] border-b border-base-300\"\n [class.w-full]=\"justified\"\n >\n @for (item of dataSource.items; track item.label) {\n <div\n role=\"tab\"\n class=\"tab px-4 py-2 border-b-2 cursor-pointer select-none transition-colors whitespace-nowrap text-center\"\n [class.flex-1]=\"justified\"\n [class.text-primary]=\"currentActive === item\"\n [class.font-bold]=\"currentActive === item\"\n [class.border-primary]=\"currentActive === item\"\n [class.border-transparent]=\"currentActive !== item\"\n [class.text-base-content]=\"currentActive !== item\"\n [attr.aria-selected]=\"currentActive === item\"\n (click)=\"setActive(item)\"\n >\n {{ item.label | mnTranslate }}\n @let badge = getBadge(item);\n @if (badge && badge > 0) {\n <span [data]=\"{ size: 'sm', color: 'accent', variant: 'fill' }\" mnBadge>{{ badge }}</span>\n }\n </div>\n }\n </div>\n </div>\n</div>\n" }]
|
|
7743
7752
|
}], propDecorators: { dataSource: [{
|
|
7744
7753
|
type: Input
|
|
7745
7754
|
}], scrollable: [{
|