matcha-components 20.24.0 → 20.25.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/fesm2022/matcha-components.mjs +44 -11
- package/fesm2022/matcha-components.mjs.map +1 -1
- package/index.d.ts +15 -5
- package/package.json +1 -1
|
@@ -3192,13 +3192,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
3192
3192
|
|
|
3193
3193
|
class MatchaTabsComponent {
|
|
3194
3194
|
constructor() {
|
|
3195
|
-
this.
|
|
3195
|
+
this.selectedIndex = 0;
|
|
3196
|
+
this.selectedIndexChange = new EventEmitter();
|
|
3197
|
+
this.selectedTabChange = new EventEmitter();
|
|
3196
3198
|
this.tabSelected = new EventEmitter();
|
|
3197
3199
|
}
|
|
3200
|
+
get activeTabIndex() {
|
|
3201
|
+
return this.selectedIndex;
|
|
3202
|
+
}
|
|
3203
|
+
set activeTabIndex(value) {
|
|
3204
|
+
this.selectedIndex = value;
|
|
3205
|
+
}
|
|
3206
|
+
ngOnChanges(changes) {
|
|
3207
|
+
if (changes['selectedIndex'] && !changes['selectedIndex'].firstChange) {
|
|
3208
|
+
this.selectTabByIndex(this.selectedIndex);
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3198
3211
|
ngAfterContentInit() {
|
|
3212
|
+
this.tabs.changes.subscribe(() => {
|
|
3213
|
+
this.handleTabsChange();
|
|
3214
|
+
});
|
|
3215
|
+
this.handleTabsChange();
|
|
3216
|
+
}
|
|
3217
|
+
handleTabsChange() {
|
|
3199
3218
|
const activeTabs = this.tabs.filter(tab => tab.active);
|
|
3200
3219
|
if (activeTabs.length === 0 && this.tabs.first) {
|
|
3201
|
-
this.selectTabByIndex(this.
|
|
3220
|
+
this.selectTabByIndex(this.selectedIndex);
|
|
3202
3221
|
}
|
|
3203
3222
|
}
|
|
3204
3223
|
selectTab(tab) {
|
|
@@ -3208,6 +3227,9 @@ class MatchaTabsComponent {
|
|
|
3208
3227
|
tabsArray.forEach(t => t.active = false);
|
|
3209
3228
|
tab.active = true;
|
|
3210
3229
|
const index = tabsArray.indexOf(tab);
|
|
3230
|
+
this.selectedIndex = index;
|
|
3231
|
+
this.selectedIndexChange.emit(index);
|
|
3232
|
+
this.selectedTabChange.emit({ index, tab });
|
|
3211
3233
|
this.tabSelected.emit(index);
|
|
3212
3234
|
}
|
|
3213
3235
|
selectTabByIndex(index) {
|
|
@@ -3235,7 +3257,7 @@ class MatchaTabsComponent {
|
|
|
3235
3257
|
}
|
|
3236
3258
|
}
|
|
3237
3259
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MatchaTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3238
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: MatchaTabsComponent, isStandalone: false, selector: "matcha-tabs", inputs: { activeTabIndex: "activeTabIndex" }, outputs: { tabSelected: "tabSelected" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)" } }, queries: [{ propertyName: "tabs", predicate: MatchaTabItemComponent }], ngImport: i0, template: "<div class=\"flex-column gap-24 w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0 pb-4\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"'tab-content-' + i\"\n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p min-w-88 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"color-fg fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }], animations: [...createAnimations] }); }
|
|
3260
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: MatchaTabsComponent, isStandalone: false, selector: "matcha-tabs", inputs: { selectedIndex: "selectedIndex", activeTabIndex: "activeTabIndex" }, outputs: { selectedIndexChange: "selectedIndexChange", selectedTabChange: "selectedTabChange", tabSelected: "tabSelected" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)" } }, queries: [{ propertyName: "tabs", predicate: MatchaTabItemComponent }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex-column gap-24 w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0 pb-4\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"'tab-content-' + i\"\n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p min-w-88 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"color-fg fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }], animations: [...createAnimations] }); }
|
|
3239
3261
|
}
|
|
3240
3262
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MatchaTabsComponent, decorators: [{
|
|
3241
3263
|
type: Component,
|
|
@@ -3243,6 +3265,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
3243
3265
|
}], propDecorators: { tabs: [{
|
|
3244
3266
|
type: ContentChildren,
|
|
3245
3267
|
args: [MatchaTabItemComponent]
|
|
3268
|
+
}], selectedIndex: [{
|
|
3269
|
+
type: Input
|
|
3270
|
+
}], selectedIndexChange: [{
|
|
3271
|
+
type: Output
|
|
3272
|
+
}], selectedTabChange: [{
|
|
3273
|
+
type: Output
|
|
3246
3274
|
}], activeTabIndex: [{
|
|
3247
3275
|
type: Input
|
|
3248
3276
|
}], tabSelected: [{
|
|
@@ -7502,23 +7530,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
7502
7530
|
|
|
7503
7531
|
class MatchaTabsModule {
|
|
7504
7532
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MatchaTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
7505
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: MatchaTabsModule, declarations: [MatchaTabsComponent,
|
|
7506
|
-
|
|
7507
|
-
MatchaIconModule], exports: [MatchaTabsComponent,
|
|
7533
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: MatchaTabsModule, declarations: [MatchaTabsComponent,
|
|
7534
|
+
MatchaTabItemComponent], imports: [CommonModule,
|
|
7535
|
+
MatchaIconModule], exports: [MatchaTabsComponent,
|
|
7536
|
+
MatchaTabItemComponent] }); }
|
|
7508
7537
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MatchaTabsModule, imports: [CommonModule,
|
|
7509
|
-
MatchaTooltipModule,
|
|
7510
7538
|
MatchaIconModule] }); }
|
|
7511
7539
|
}
|
|
7512
7540
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MatchaTabsModule, decorators: [{
|
|
7513
7541
|
type: NgModule,
|
|
7514
7542
|
args: [{
|
|
7515
|
-
declarations: [
|
|
7543
|
+
declarations: [
|
|
7544
|
+
MatchaTabsComponent,
|
|
7545
|
+
MatchaTabItemComponent
|
|
7546
|
+
],
|
|
7516
7547
|
imports: [
|
|
7517
7548
|
CommonModule,
|
|
7518
|
-
|
|
7519
|
-
MatchaIconModule,
|
|
7549
|
+
MatchaIconModule
|
|
7520
7550
|
],
|
|
7521
|
-
exports: [
|
|
7551
|
+
exports: [
|
|
7552
|
+
MatchaTabsComponent,
|
|
7553
|
+
MatchaTabItemComponent
|
|
7554
|
+
]
|
|
7522
7555
|
}]
|
|
7523
7556
|
}] });
|
|
7524
7557
|
|