@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';
@@ -1986,23 +1987,92 @@ class TabComponent {
1986
1987
  get selected() {
1987
1988
  return this._selected;
1988
1989
  }
1989
- constructor(changeDetectorRef) {
1990
+ get content() {
1991
+ return this.contentPortal;
1992
+ }
1993
+ constructor(changeDetectorRef, viewContainerRef) {
1990
1994
  this.changeDetectorRef = changeDetectorRef;
1995
+ this.viewContainerRef = viewContainerRef;
1991
1996
  this._selected = false;
1997
+ this.contentPortal = null;
1998
+ this._explicitContent = undefined;
1999
+ }
2000
+ ngOnInit() {
2001
+ this.contentPortal = new TemplatePortal(this._explicitContent || this._implicitContent, this.viewContainerRef);
1992
2002
  }
1993
2003
  }
1994
- TabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1995
- 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 });
2004
+ 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 });
2005
+ 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 });
1996
2006
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabComponent, decorators: [{
1997
2007
  type: Component,
1998
- 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>" }]
1999
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
2008
+ args: [{ selector: 'wac-tab', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template><ng-content></ng-content></ng-template>" }]
2009
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { label: [{
2000
2010
  type: Input
2001
2011
  }], selected: [{
2002
2012
  type: Input
2013
+ }], _explicitContent: [{
2014
+ type: ContentChild,
2015
+ args: [TabComponent, { read: TemplateRef, static: true }]
2016
+ }], _implicitContent: [{
2017
+ type: ViewChild,
2018
+ args: [TemplateRef, { static: true }]
2019
+ }] } });
2020
+
2021
+ class TabBodyDirective extends CdkPortalOutlet {
2022
+ constructor(componentFactoryResolver, viewContainerRef, document, host) {
2023
+ super(componentFactoryResolver, viewContainerRef, document);
2024
+ this.componentFactoryResolver = componentFactoryResolver;
2025
+ this.viewContainerRef = viewContainerRef;
2026
+ this.document = document;
2027
+ this.host = host;
2028
+ }
2029
+ ngOnInit() {
2030
+ super.ngOnInit();
2031
+ this.attach(this.host.content);
2032
+ }
2033
+ }
2034
+ 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 });
2035
+ TabBodyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: TabBodyDirective, isStandalone: true, selector: "[wacTabBody]", exportAs: ["wacTabBody"], usesInheritance: true, ngImport: i0 });
2036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabBodyDirective, decorators: [{
2037
+ type: Directive,
2038
+ args: [{
2039
+ selector: '[wacTabBody]',
2040
+ exportAs: 'wacTabBody',
2041
+ standalone: true,
2042
+ }]
2043
+ }], ctorParameters: function () {
2044
+ return [{ type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
2045
+ type: Inject,
2046
+ args: [DOCUMENT]
2047
+ }] }, { type: TabBodyComponent, decorators: [{
2048
+ type: Inject,
2049
+ args: [forwardRef(() => TabBodyComponent)]
2050
+ }] }];
2051
+ } });
2052
+
2053
+ class TabBodyComponent {
2054
+ get display() {
2055
+ return (this.active ? 'initial' : 'none');
2056
+ }
2057
+ }
2058
+ TabBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2059
+ 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 });
2060
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabBodyComponent, decorators: [{
2061
+ type: Component,
2062
+ 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>" }]
2063
+ }], propDecorators: { content: [{
2064
+ type: Input
2065
+ }], active: [{
2066
+ type: Input
2067
+ }], display: [{
2068
+ type: HostBinding,
2069
+ args: ['style.display']
2003
2070
  }] } });
2004
2071
 
2005
2072
  class TabsComponent {
2073
+ get defaultViewModel() {
2074
+ return { index: 0, tabList: [], listIsOpen: false, selected: null };
2075
+ }
2006
2076
  constructor(changeDetectorRef) {
2007
2077
  this.changeDetectorRef = changeDetectorRef;
2008
2078
  this.disabled = false;
@@ -2069,12 +2139,12 @@ class TabsComponent {
2069
2139
  TabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2070
2140
  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: [
2071
2141
  { provide: NG_VALUE_ACCESSOR, useExisting: TabsComponent, multi: true },
2072
- ], 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 });
2142
+ ], 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 });
2073
2143
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TabsComponent, decorators: [{
2074
2144
  type: Component,
2075
- args: [{ selector: 'wac-tabs', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule, FormsModule, TabComponent, SharedDirectives], providers: [
2145
+ args: [{ selector: 'wac-tabs', encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule, FormsModule, TabComponent, SharedDirectives, TabBodyComponent], providers: [
2076
2146
  { provide: NG_VALUE_ACCESSOR, useExisting: TabsComponent, multi: true },
2077
- ], 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>" }]
2147
+ ], 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>" }]
2078
2148
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { tabList: [{
2079
2149
  type: ContentChildren,
2080
2150
  args: [TabComponent]