@tetacom/ng-components 1.2.6 → 1.2.7
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/component/tabs/tabs/tabs.component.d.ts +10 -1
- package/docs/badgeDocs.mdx +17 -22
- package/docs/chipDocs.mdx +13 -15
- package/docs/tabsDocs.mdx +107 -89
- package/esm2022/component/table/head-cell-dropdown/head-cell-dropdown.component.mjs +2 -2
- package/esm2022/component/tabs/tab/tab.component.mjs +2 -2
- package/esm2022/component/tabs/tabs/tabs.component.mjs +23 -11
- package/fesm2022/tetacom-ng-components.mjs +23 -11
- package/fesm2022/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
- package/style/badge.scss +11 -12
- package/style/chips.scss +102 -14
- package/style/presets/font-presets.scss +8 -0
- package/style/tabs.scss +42 -18
|
@@ -9500,8 +9500,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
|
9500
9500
|
}] } });
|
|
9501
9501
|
|
|
9502
9502
|
class TabsComponent {
|
|
9503
|
+
get verticalClassTabs() {
|
|
9504
|
+
return this.direction === 'vertical';
|
|
9505
|
+
}
|
|
9503
9506
|
constructor() {
|
|
9504
9507
|
this.classTabs = true;
|
|
9508
|
+
/**
|
|
9509
|
+
* Tabs direction
|
|
9510
|
+
*/
|
|
9511
|
+
this.direction = 'horizontal';
|
|
9512
|
+
/**
|
|
9513
|
+
* Tabs size
|
|
9514
|
+
*/
|
|
9515
|
+
this.size = 'm';
|
|
9505
9516
|
/**
|
|
9506
9517
|
* Whether the closed tabs should be hidden without destroying them
|
|
9507
9518
|
*/
|
|
@@ -9517,9 +9528,7 @@ class TabsComponent {
|
|
|
9517
9528
|
*/
|
|
9518
9529
|
select(tabId) {
|
|
9519
9530
|
const selectedTab = this._getTabById(tabId);
|
|
9520
|
-
if (selectedTab &&
|
|
9521
|
-
!selectedTab.disabled &&
|
|
9522
|
-
this.activeId !== selectedTab.id) {
|
|
9531
|
+
if (selectedTab && !selectedTab.disabled && this.activeId !== selectedTab.id) {
|
|
9523
9532
|
let defaultPrevented = false;
|
|
9524
9533
|
this.tabChange.emit({
|
|
9525
9534
|
activeId: this.activeId,
|
|
@@ -9535,27 +9544,30 @@ class TabsComponent {
|
|
|
9535
9544
|
}
|
|
9536
9545
|
ngAfterContentChecked() {
|
|
9537
9546
|
const activeTab = this._getTabById(this.activeId);
|
|
9538
|
-
this.activeId = activeTab
|
|
9539
|
-
? activeTab.id
|
|
9540
|
-
: this.tabs.length
|
|
9541
|
-
? this.tabs.first.id
|
|
9542
|
-
: null;
|
|
9547
|
+
this.activeId = activeTab ? activeTab.id : this.tabs.length ? this.tabs.first.id : null;
|
|
9543
9548
|
}
|
|
9544
9549
|
_getTabById(id) {
|
|
9545
9550
|
const tabsWithId = this.tabs.filter((tab) => tab.id === id);
|
|
9546
9551
|
return tabsWithId.length ? tabsWithId[0] : null;
|
|
9547
9552
|
}
|
|
9548
9553
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9549
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: TabsComponent, isStandalone: true, selector: "teta-tabs", inputs: { activeId: "activeId", destroyOnHide: "destroyOnHide" }, outputs: { tabChange: "tabChange" }, host: { properties: { "class.tabs": "this.classTabs" } }, queries: [{ propertyName: "tabs", predicate: TabComponent }], ngImport: i0, template: "<div class=\"tabs-head\"
|
|
9554
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: TabsComponent, isStandalone: true, selector: "teta-tabs", inputs: { activeId: "activeId", direction: "direction", size: "size", destroyOnHide: "destroyOnHide" }, outputs: { tabChange: "tabChange" }, host: { properties: { "class.tabs": "this.classTabs", "class.tabs_vertical": "this.verticalClassTabs" } }, queries: [{ propertyName: "tabs", predicate: TabComponent }], ngImport: i0, template: "<div role=\"tablist\" class=\"tabs-head\" [class.tabs-head_small]=\"size === 's'\">\n @for (tab of tabs; track tab) {\n <button\n type=\"button\"\n class=\"tabs-head-item\"\n (click)=\"select(tab.id)\"\n [class.tabs-head-item_active]=\"tab.id === activeId\"\n [disabled]=\"tab.disabled\"\n >\n <span\n [id]=\"tab.id\"\n class=\"tabs-title\"\n role=\"tab\"\n [attr.tabindex]=\"tab.disabled ? '-1' : undefined\"\n [attr.aria-controls]=\"!destroyOnHide || tab.id === activeId ? tab.id + '-panel' : null\"\n [attr.aria-expanded]=\"tab.id === activeId\"\n [attr.aria-disabled]=\"tab.disabled\"\n >\n {{ tab.title }}\n <ng-template [ngTemplateOutlet]=\"tab.titleTpl?.template\"></ng-template>\n </span>\n </button>\n }\n</div>\n<div class=\"tabs-content\">\n @for (tab of tabs; track tab) { @if (!destroyOnHide || tab.id === activeId) {\n <ng-template [ngTemplateOutlet]=\"tab.contentTpl?.template\"></ng-template>\n } }\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
9550
9555
|
}
|
|
9551
9556
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: TabsComponent, decorators: [{
|
|
9552
9557
|
type: Component,
|
|
9553
|
-
args: [{ selector: 'teta-tabs', standalone: true, imports: [NgTemplateOutlet], template: "<div class=\"tabs-head\"
|
|
9558
|
+
args: [{ selector: 'teta-tabs', standalone: true, imports: [NgTemplateOutlet], template: "<div role=\"tablist\" class=\"tabs-head\" [class.tabs-head_small]=\"size === 's'\">\n @for (tab of tabs; track tab) {\n <button\n type=\"button\"\n class=\"tabs-head-item\"\n (click)=\"select(tab.id)\"\n [class.tabs-head-item_active]=\"tab.id === activeId\"\n [disabled]=\"tab.disabled\"\n >\n <span\n [id]=\"tab.id\"\n class=\"tabs-title\"\n role=\"tab\"\n [attr.tabindex]=\"tab.disabled ? '-1' : undefined\"\n [attr.aria-controls]=\"!destroyOnHide || tab.id === activeId ? tab.id + '-panel' : null\"\n [attr.aria-expanded]=\"tab.id === activeId\"\n [attr.aria-disabled]=\"tab.disabled\"\n >\n {{ tab.title }}\n <ng-template [ngTemplateOutlet]=\"tab.titleTpl?.template\"></ng-template>\n </span>\n </button>\n }\n</div>\n<div class=\"tabs-content\">\n @for (tab of tabs; track tab) { @if (!destroyOnHide || tab.id === activeId) {\n <ng-template [ngTemplateOutlet]=\"tab.contentTpl?.template\"></ng-template>\n } }\n</div>\n" }]
|
|
9554
9559
|
}], ctorParameters: () => [], propDecorators: { classTabs: [{
|
|
9555
9560
|
type: HostBinding,
|
|
9556
9561
|
args: ['class.tabs']
|
|
9562
|
+
}], verticalClassTabs: [{
|
|
9563
|
+
type: HostBinding,
|
|
9564
|
+
args: ['class.tabs_vertical']
|
|
9557
9565
|
}], activeId: [{
|
|
9558
9566
|
type: Input
|
|
9567
|
+
}], direction: [{
|
|
9568
|
+
type: Input
|
|
9569
|
+
}], size: [{
|
|
9570
|
+
type: Input
|
|
9559
9571
|
}], destroyOnHide: [{
|
|
9560
9572
|
type: Input
|
|
9561
9573
|
}], tabChange: [{
|
|
@@ -9580,7 +9592,7 @@ class HeadCellDropdownComponent {
|
|
|
9580
9592
|
return index;
|
|
9581
9593
|
}
|
|
9582
9594
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: HeadCellDropdownComponent, deps: [{ token: TableService }, { token: TetaConfigService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9583
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: HeadCellDropdownComponent, isStandalone: true, selector: "teta-head-cell-dropdown", inputs: { columns: "columns", column: "column", state: "state", data: "data", tabTemplates: "tabTemplates", dropDownOpen: "dropDownOpen" }, outputs: { dropDownOpenChange: "dropDownOpenChange" }, ngImport: i0, template: "@if (dropDownOpen) {\n <teta-tabs class=\"column_auto\">\n @for (tab of tabTemplates; track trackIndex($index)) {\n @if (tab.showTab(column)) {\n <teta-tab>\n <ng-template tetaTabTitle>\n @if (tab.icon) {\n <teta-icon [name]=\"tab.icon\" [palette]=\"'text'\"></teta-icon>\n }\n </ng-template>\n <ng-template tetaTabContent>\n <ng-container\n *ngTemplateOutlet=\"tab.template; context: {\n column: column,\n columns: columns,\n data: data,\n state: state,\n close: closeDropdown\n }\"></ng-container>\n </ng-template>\n </teta-tab>\n }\n }\n </teta-tabs>\n}\n", styles: [":host{display:flex;flex-grow:1;min-height:0;min-width:250px}\n"], dependencies: [{ kind: "component", type: TabsComponent, selector: "teta-tabs", inputs: ["activeId", "destroyOnHide"], outputs: ["tabChange"] }, { kind: "component", type: TabComponent, selector: "teta-tab", inputs: ["id", "title", "disabled"] }, { kind: "directive", type: TabTitleDirective, selector: "[tetaTabTitle]" }, { kind: "component", type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }, { kind: "directive", type: TabContentDirective, selector: "[tetaTabContent]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9595
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: HeadCellDropdownComponent, isStandalone: true, selector: "teta-head-cell-dropdown", inputs: { columns: "columns", column: "column", state: "state", data: "data", tabTemplates: "tabTemplates", dropDownOpen: "dropDownOpen" }, outputs: { dropDownOpenChange: "dropDownOpenChange" }, ngImport: i0, template: "@if (dropDownOpen) {\n <teta-tabs class=\"column_auto\">\n @for (tab of tabTemplates; track trackIndex($index)) {\n @if (tab.showTab(column)) {\n <teta-tab>\n <ng-template tetaTabTitle>\n @if (tab.icon) {\n <teta-icon [name]=\"tab.icon\" [palette]=\"'text'\"></teta-icon>\n }\n </ng-template>\n <ng-template tetaTabContent>\n <ng-container\n *ngTemplateOutlet=\"tab.template; context: {\n column: column,\n columns: columns,\n data: data,\n state: state,\n close: closeDropdown\n }\"></ng-container>\n </ng-template>\n </teta-tab>\n }\n }\n </teta-tabs>\n}\n", styles: [":host{display:flex;flex-grow:1;min-height:0;min-width:250px}\n"], dependencies: [{ kind: "component", type: TabsComponent, selector: "teta-tabs", inputs: ["activeId", "direction", "size", "destroyOnHide"], outputs: ["tabChange"] }, { kind: "component", type: TabComponent, selector: "teta-tab", inputs: ["id", "title", "disabled"] }, { kind: "directive", type: TabTitleDirective, selector: "[tetaTabTitle]" }, { kind: "component", type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }, { kind: "directive", type: TabContentDirective, selector: "[tetaTabContent]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9584
9596
|
}
|
|
9585
9597
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: HeadCellDropdownComponent, decorators: [{
|
|
9586
9598
|
type: Component,
|