@wizishop/angular-components 15.1.76 → 15.1.77

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,7 +1,7 @@
1
1
  import * as i3 from '@wizishop/ng-wizi-bulma';
2
2
  import { NwbAllModule, NwbFilterGroup } from '@wizishop/ng-wizi-bulma';
3
3
  import * as i0 from '@angular/core';
4
- import { Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostListener, Injectable, InjectionToken, HostBinding, ContentChildren, NgModule, Inject, Pipe, ChangeDetectionStrategy, Attribute, Optional, ViewChild, ContentChild } from '@angular/core';
4
+ import { Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostListener, Injectable, InjectionToken, HostBinding, ContentChildren, NgModule, Inject, Pipe, TemplateRef, ChangeDetectionStrategy, ContentChild, ViewChild, forwardRef, Attribute, Optional } from '@angular/core';
5
5
  import * as i1 from '@angular/common';
6
6
  import { CommonModule, DOCUMENT, DatePipe } from '@angular/common';
7
7
  import * as i2 from '@angular/forms';
@@ -17,6 +17,7 @@ import { TranslateModule } from '@ngx-translate/core';
17
17
  import { CdkTableModule } from '@angular/cdk/table';
18
18
  import { trigger, transition, style, animate, state, animation, query, stagger } from '@angular/animations';
19
19
  import { TagInputModule } from 'ngx-chips';
20
+ import { TemplatePortal, CdkPortalOutlet } from '@angular/cdk/portal';
20
21
  import * as i3$1 from 'ngx-autosize';
21
22
  import { AutosizeModule } from 'ngx-autosize';
22
23
  import * as i1$3 from '@angular/router';
@@ -1979,23 +1980,90 @@ class TabComponent {
1979
1980
  get selected() {
1980
1981
  return this._selected;
1981
1982
  }
1982
- constructor(changeDetectorRef) {
1983
+ get content() {
1984
+ return this.contentPortal;
1985
+ }
1986
+ constructor(changeDetectorRef, viewContainerRef) {
1983
1987
  this.changeDetectorRef = changeDetectorRef;
1988
+ this.viewContainerRef = viewContainerRef;
1984
1989
  this._selected = false;
1990
+ this.contentPortal = null;
1991
+ this._explicitContent = undefined;
1992
+ }
1993
+ ngOnInit() {
1994
+ this.contentPortal = new TemplatePortal(this._explicitContent || this._implicitContent, this.viewContainerRef);
1985
1995
  }
1986
1996
  }
1987
- TabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1988
- TabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TabComponent, isStandalone: true, selector: "wac-tab", inputs: { label: "label", selected: "selected" }, ngImport: i0, template: "<div class=\"wac-tab\">\n <ng-content *ngIf=\"selected\"></ng-content>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1997
+ TabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
1998
+ TabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TabComponent, isStandalone: true, selector: "wac-tab", inputs: { label: "label", selected: "selected" }, queries: [{ propertyName: "_explicitContent", first: true, predicate: TabComponent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "_implicitContent", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0, template: "<ng-template><ng-content></ng-content></ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1989
1999
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabComponent, decorators: [{
1990
2000
  type: Component,
1991
- args: [{ selector: 'wac-tab', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"wac-tab\">\n <ng-content *ngIf=\"selected\"></ng-content>\n</div>" }]
1992
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
2001
+ args: [{ selector: 'wac-tab', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template><ng-content></ng-content></ng-template>" }]
2002
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { label: [{
1993
2003
  type: Input
1994
2004
  }], selected: [{
1995
2005
  type: Input
2006
+ }], _explicitContent: [{
2007
+ type: ContentChild,
2008
+ args: [TabComponent, { read: TemplateRef, static: true }]
2009
+ }], _implicitContent: [{
2010
+ type: ViewChild,
2011
+ args: [TemplateRef, { static: true }]
2012
+ }] } });
2013
+
2014
+ class TabBodyDirective extends CdkPortalOutlet {
2015
+ constructor(componentFactoryResolver, viewContainerRef, document, host) {
2016
+ super(componentFactoryResolver, viewContainerRef, document);
2017
+ this.componentFactoryResolver = componentFactoryResolver;
2018
+ this.viewContainerRef = viewContainerRef;
2019
+ this.document = document;
2020
+ this.host = host;
2021
+ }
2022
+ ngOnInit() {
2023
+ super.ngOnInit();
2024
+ this.attach(this.host.content);
2025
+ }
2026
+ }
2027
+ TabBodyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabBodyDirective, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ViewContainerRef }, { token: DOCUMENT }, { token: forwardRef(() => TabBodyComponent) }], target: i0.ɵɵFactoryTarget.Directive });
2028
+ TabBodyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: TabBodyDirective, isStandalone: true, selector: "[wacTabBody]", exportAs: ["wacTabBody"], usesInheritance: true, ngImport: i0 });
2029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabBodyDirective, decorators: [{
2030
+ type: Directive,
2031
+ args: [{
2032
+ selector: '[wacTabBody]',
2033
+ exportAs: 'wacTabBody',
2034
+ standalone: true,
2035
+ }]
2036
+ }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
2037
+ type: Inject,
2038
+ args: [DOCUMENT]
2039
+ }] }, { type: TabBodyComponent, decorators: [{
2040
+ type: Inject,
2041
+ args: [forwardRef(() => TabBodyComponent)]
2042
+ }] }]; } });
2043
+
2044
+ class TabBodyComponent {
2045
+ get display() {
2046
+ return (this.active ? 'initial' : 'none');
2047
+ }
2048
+ }
2049
+ TabBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2050
+ TabBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TabBodyComponent, isStandalone: true, selector: "wac-tab-body", inputs: { content: "content", active: "active" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<div class=\"wac-tab-body\" #content>\n <ng-template wacTabBody></ng-template>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TabBodyDirective, selector: "[wacTabBody]", exportAs: ["wacTabBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2051
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabBodyComponent, decorators: [{
2052
+ type: Component,
2053
+ args: [{ selector: 'wac-tab-body', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule, TabBodyDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"wac-tab-body\" #content>\n <ng-template wacTabBody></ng-template>\n</div>" }]
2054
+ }], propDecorators: { content: [{
2055
+ type: Input
2056
+ }], active: [{
2057
+ type: Input
2058
+ }], display: [{
2059
+ type: HostBinding,
2060
+ args: ['style.display']
1996
2061
  }] } });
1997
2062
 
1998
2063
  class TabsComponent {
2064
+ get defaultViewModel() {
2065
+ return { index: 0, tabList: [], listIsOpen: false, selected: null };
2066
+ }
1999
2067
  constructor(changeDetectorRef) {
2000
2068
  this.changeDetectorRef = changeDetectorRef;
2001
2069
  this.disabled = false;
@@ -2062,12 +2130,12 @@ class TabsComponent {
2062
2130
  TabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2063
2131
  TabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TabsComponent, isStandalone: true, selector: "wac-tabs", inputs: { underline: "underline", button: "button", right: "right", marginBottom: "marginBottom" }, providers: [
2064
2132
  { provide: NG_VALUE_ACCESSOR, useExisting: TabsComponent, multi: true },
2065
- ], queries: [{ propertyName: "tabList", predicate: TabComponent }], ngImport: i0, template: "<div class=\"wac-tabs\"\n *ngIf=\"viewModel$ | async as viewModel\"\n [ngClass]=\"{'wac-tabs--underline': underline, 'wac-tabs--button' : button, 'wac-tabs--right' : right}\"\n wzAutoHide\n (clickOutside)=\"listIsOpen$.next(false)\"\n [triggerElement]=\"'wac-select__header__selection'\"\n> \n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__mobile\" (click)=\"openList($event)\">\n <div>{{ viewModel.selected?.label }}</div><i [class]=\"'fa-solid fa-caret-' + (viewModel.listIsOpen ? 'up' : 'down')\"></i>\n </div>\n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__wrapper\" [ngClass]=\"{ 'open' : viewModel.listIsOpen }\" [ngStyle]=\"{'margin-bottom': marginBottom}\">\n <a\n *ngFor=\"let tab of tabList; let i = index\"\n class=\"wac-tabs__wrapper__tab\"\n [ngClass]=\"{'wac-tabs__wrapper__tab--selected': i === viewModel.index}\"\n (click)=\"index$.next(i); listIsOpen$.next(false)\"\n >\n {{ tab.label }}\n </a>\n </div>\n</div>\n<ng-content></ng-content>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: SharedDirectives }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2133
+ ], queries: [{ propertyName: "tabList", predicate: TabComponent }], ngImport: i0, template: "<div class=\"wac-tabs\"\n *ngIf=\"((viewModel$ | async) || defaultViewModel ) as viewModel\"\n [ngClass]=\"{'wac-tabs--underline': underline, 'wac-tabs--button' : button, 'wac-tabs--right' : right}\"\n wzAutoHide\n (clickOutside)=\"listIsOpen$.next(false)\"\n [triggerElement]=\"'wac-select__header__selection'\"\n> \n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__mobile\" (click)=\"openList($event)\">\n <div>{{ viewModel.selected?.label }}</div><i [class]=\"'fa-solid fa-caret-' + (viewModel.listIsOpen ? 'up' : 'down')\"></i>\n </div>\n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__wrapper\" [ngClass]=\"{ 'open' : viewModel.listIsOpen }\" [ngStyle]=\"{'margin-bottom': marginBottom}\">\n <a\n *ngFor=\"let tab of tabList; let i = index\"\n class=\"wac-tabs__wrapper__tab\"\n [ngClass]=\"{'wac-tabs__wrapper__tab--selected': i === viewModel.index}\"\n (click)=\"index$.next(i); listIsOpen$.next(false)\"\n >\n {{ tab.label }}\n </a>\n </div>\n <wac-tab-body\n *ngFor=\"let tab of tabList; let i = index\"\n [content]=\"tab.content\"\n [active]=\"i === viewModel.index\"\n ></wac-tab-body>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: SharedDirectives }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "component", type: TabBodyComponent, selector: "wac-tab-body", inputs: ["content", "active"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2066
2134
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabsComponent, decorators: [{
2067
2135
  type: Component,
2068
- args: [{ selector: 'wac-tabs', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule, FormsModule, TabComponent, SharedDirectives], providers: [
2136
+ args: [{ selector: 'wac-tabs', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule, FormsModule, TabComponent, SharedDirectives, TabBodyComponent], providers: [
2069
2137
  { provide: NG_VALUE_ACCESSOR, useExisting: TabsComponent, multi: true },
2070
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"wac-tabs\"\n *ngIf=\"viewModel$ | async as viewModel\"\n [ngClass]=\"{'wac-tabs--underline': underline, 'wac-tabs--button' : button, 'wac-tabs--right' : right}\"\n wzAutoHide\n (clickOutside)=\"listIsOpen$.next(false)\"\n [triggerElement]=\"'wac-select__header__selection'\"\n> \n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__mobile\" (click)=\"openList($event)\">\n <div>{{ viewModel.selected?.label }}</div><i [class]=\"'fa-solid fa-caret-' + (viewModel.listIsOpen ? 'up' : 'down')\"></i>\n </div>\n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__wrapper\" [ngClass]=\"{ 'open' : viewModel.listIsOpen }\" [ngStyle]=\"{'margin-bottom': marginBottom}\">\n <a\n *ngFor=\"let tab of tabList; let i = index\"\n class=\"wac-tabs__wrapper__tab\"\n [ngClass]=\"{'wac-tabs__wrapper__tab--selected': i === viewModel.index}\"\n (click)=\"index$.next(i); listIsOpen$.next(false)\"\n >\n {{ tab.label }}\n </a>\n </div>\n</div>\n<ng-content></ng-content>" }]
2138
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"wac-tabs\"\n *ngIf=\"((viewModel$ | async) || defaultViewModel ) as viewModel\"\n [ngClass]=\"{'wac-tabs--underline': underline, 'wac-tabs--button' : button, 'wac-tabs--right' : right}\"\n wzAutoHide\n (clickOutside)=\"listIsOpen$.next(false)\"\n [triggerElement]=\"'wac-select__header__selection'\"\n> \n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__mobile\" (click)=\"openList($event)\">\n <div>{{ viewModel.selected?.label }}</div><i [class]=\"'fa-solid fa-caret-' + (viewModel.listIsOpen ? 'up' : 'down')\"></i>\n </div>\n <div *ngIf=\"tabList.length > 1\" class=\"wac-tabs__wrapper\" [ngClass]=\"{ 'open' : viewModel.listIsOpen }\" [ngStyle]=\"{'margin-bottom': marginBottom}\">\n <a\n *ngFor=\"let tab of tabList; let i = index\"\n class=\"wac-tabs__wrapper__tab\"\n [ngClass]=\"{'wac-tabs__wrapper__tab--selected': i === viewModel.index}\"\n (click)=\"index$.next(i); listIsOpen$.next(false)\"\n >\n {{ tab.label }}\n </a>\n </div>\n <wac-tab-body\n *ngFor=\"let tab of tabList; let i = index\"\n [content]=\"tab.content\"\n [active]=\"i === viewModel.index\"\n ></wac-tab-body>\n</div>" }]
2071
2139
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { tabList: [{
2072
2140
  type: ContentChildren,
2073
2141
  args: [TabComponent]