@bizy/core 19.0.9 → 19.0.11

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 i1 from '@angular/common';
2
2
  import { CommonModule, DOCUMENT, registerLocaleData, DatePipe } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, ChangeDetectorRef, Output, Input, Inject, ChangeDetectionStrategy, Component, ElementRef, Renderer2, Injectable, Directive, ViewChild, ContentChildren, inject, Pipe, ContentChild, ViewContainerRef, TemplateRef, RendererFactory2, NgModule, HostListener, Host } from '@angular/core';
4
+ import { EventEmitter, ChangeDetectorRef, Output, Input, Inject, ChangeDetectionStrategy, Component, ElementRef, Renderer2, Injectable, Directive, ViewChild, ContentChildren, inject, Pipe, ContentChild, ViewContainerRef, TemplateRef, signal, effect, RendererFactory2, NgModule, HostListener, Host } from '@angular/core';
5
5
  import * as echarts from 'echarts';
6
6
  import html2canvas from 'html2canvas';
7
7
  import { Subscription, BehaviorSubject, Subject, filter, take, skip, auditTime, throttleTime, debounceTime, interval, fromEvent, merge, timer, of } from 'rxjs';
@@ -2582,20 +2582,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
2582
2582
  }] } });
2583
2583
 
2584
2584
  class BizyGridForDirective {
2585
- viewContainerRef;
2586
- templateRef;
2587
- #items = new BehaviorSubject([]);
2588
- get items$() {
2589
- return this.#items.asObservable();
2590
- }
2585
+ viewContainerRef = inject(ViewContainerRef);
2586
+ templateRef = inject(TemplateRef);
2587
+ items = signal([]);
2591
2588
  set gridForOf(items) {
2592
- this.#items.next(items);
2589
+ this.items.set(items);
2593
2590
  }
2594
- constructor(viewContainerRef, templateRef) {
2595
- this.viewContainerRef = viewContainerRef;
2596
- this.templateRef = templateRef;
2597
- }
2598
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyGridForDirective, deps: [{ token: ViewContainerRef }, { token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
2591
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyGridForDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2599
2592
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: BizyGridForDirective, isStandalone: true, selector: "[gridFor]", inputs: { gridForOf: "gridForOf" }, ngImport: i0 });
2600
2593
  }
2601
2594
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyGridForDirective, decorators: [{
@@ -2603,13 +2596,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
2603
2596
  args: [{
2604
2597
  selector: '[gridFor]',
2605
2598
  }]
2606
- }], ctorParameters: () => [{ type: i0.ViewContainerRef, decorators: [{
2607
- type: Inject,
2608
- args: [ViewContainerRef]
2609
- }] }, { type: i0.TemplateRef, decorators: [{
2610
- type: Inject,
2611
- args: [TemplateRef]
2612
- }] }], propDecorators: { gridForOf: [{
2599
+ }], propDecorators: { gridForOf: [{
2613
2600
  type: Input,
2614
2601
  args: ['gridForOf']
2615
2602
  }] } });
@@ -2629,31 +2616,28 @@ class BizyGridComponent {
2629
2616
  notifier$ = new Subject();
2630
2617
  rowHeight = 100;
2631
2618
  itemRows = [];
2632
- items = [];
2633
2619
  itemTemplate;
2634
2620
  itemsPerRow = 1;
2621
+ items = signal([]);
2635
2622
  constructor(ref, document, renderer, elementRef) {
2636
2623
  this.ref = ref;
2637
2624
  this.document = document;
2638
2625
  this.renderer = renderer;
2639
2626
  this.elementRef = elementRef;
2627
+ this.items = this.gridDirective.items;
2640
2628
  }
2641
2629
  ngAfterContentInit() {
2642
2630
  this.#rowScrollingMutationObserver = new MutationObserver(() => {
2643
2631
  if (!this.gridDirective) {
2644
2632
  return;
2645
2633
  }
2646
- this.#subscription.add(this.gridDirective.items$.subscribe(items => {
2647
- if (this.items.length === 0 && items.length === 0) {
2648
- return;
2649
- }
2650
- this.items = items;
2634
+ effect(() => {
2651
2635
  this.#updateView();
2652
2636
  if (!this.#view) {
2653
2637
  this.#view = this.gridDirective.viewContainerRef;
2654
2638
  this.#view.createEmbeddedView(this.content);
2655
2639
  }
2656
- }));
2640
+ });
2657
2641
  this.#rowScrollingMutationObserver.disconnect();
2658
2642
  this.ref.detectChanges();
2659
2643
  });
@@ -2701,8 +2685,8 @@ class BizyGridComponent {
2701
2685
  this.itemsPerRow = (count - 1) <= 0 ? 1 : count - 1;
2702
2686
  }
2703
2687
  const itemRows = [];
2704
- for (let i = 0; i < this.items.length; i += this.itemsPerRow) {
2705
- const row = this.items.slice(i, i + this.itemsPerRow);
2688
+ for (let i = 0; i < this.items().length; i += this.itemsPerRow) {
2689
+ const row = this.items().slice(i, i + this.itemsPerRow);
2706
2690
  itemRows.push(row);
2707
2691
  }
2708
2692
  this.itemRows = itemRows;
@@ -2721,11 +2705,11 @@ class BizyGridComponent {
2721
2705
  }
2722
2706
  }
2723
2707
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyGridComponent, deps: [{ token: ChangeDetectorRef }, { token: DOCUMENT }, { token: Renderer2 }, { token: ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2724
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyGridComponent, isStandalone: true, selector: "bizy-grid", inputs: { resizeRef: "resizeRef" }, queries: [{ propertyName: "gridDirective", first: true, predicate: BizyGridForDirective, descendants: true }], viewQueries: [{ propertyName: "content", first: true, predicate: ["gridScrollingContent"], descendants: true }], ngImport: i0, template: "<div class=\"bizy-grid\" [ngClass]=\"{'bizy-grid--empty': items && items.length === 0}\">\n\n <cdk-virtual-scroll-viewport\n class=\"bizy-grid__rows\"\n [itemSize]=\"rowHeight\"\n [minBufferPx]=\"rowHeight + (rowHeight * 5)\"\n [maxBufferPx]=\"rowHeight + (rowHeight * 10)\">\n\n <ng-content></ng-content>\n \n <ng-template #gridScrollingContent>\n <ng-template let-item cdkVirtualFor [cdkVirtualForOf]=\"itemRows\">\n <bizy-grid-row [rowHeight]=\"rowHeight\" [itemsPerRow]=\"itemsPerRow\">\n <ng-container *ngFor=\"let it of item; trackBy: trackById\">\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: it }\"></ng-template>\n </ng-container>\n </bizy-grid-row>\n </ng-template>\n </ng-template>\n </cdk-virtual-scroll-viewport>\n\n</div>\n", styles: [":host{display:inline-block!important;min-height:var(--bizy-grid-min-height);max-height:var(--bizy-grid-max-height);height:var(--bizy-grid-height);width:var(--bizy-grid-width);flex:1;overflow-x:auto;overflow-y:hidden;font-size:1rem}:host:has(.bizy-grid--empty){height:0!important;min-height:0!important;max-height:0!important}.bizy-grid{width:inherit;height:inherit;min-width:fit-content;display:flex;flex-direction:column;row-gap:.3rem;overflow-x:clip;background-color:var(--bizy-grid-background-color)}.bizy-grid__rows{width:100%;display:flex;flex-direction:column;min-width:fit-content;overflow-x:hidden}::ng-deep .cdk-virtual-scrollable{height:100%;width:100%;overflow-y:auto!important;overflow-x:hidden!important;contain:inline-size!important}::ng-deep .cdk-virtual-scroll-content-wrapper{min-width:100%;max-width:100%}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar{width:.5rem;height:.5rem}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb{border-radius:1rem;background-color:var(--bizy-grid-scroll-bar-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb:hover{background-color:var(--bizy-grid-scroll-bar-hover-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-button{height:1rem}\n"], 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.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2$3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: BizyGridRowComponent, selector: "bizy-grid-row", inputs: ["rowHeight", "itemsPerRow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2708
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: BizyGridComponent, isStandalone: true, selector: "bizy-grid", inputs: { resizeRef: "resizeRef" }, queries: [{ propertyName: "gridDirective", first: true, predicate: BizyGridForDirective, descendants: true }], viewQueries: [{ propertyName: "content", first: true, predicate: ["gridScrollingContent"], descendants: true }], ngImport: i0, template: "<div class=\"bizy-grid\" [ngClass]=\"{'bizy-grid--empty': items() && items().length === 0}\">\n\n <cdk-virtual-scroll-viewport\n class=\"bizy-grid__rows\"\n [itemSize]=\"rowHeight\"\n [minBufferPx]=\"rowHeight + (rowHeight * 5)\"\n [maxBufferPx]=\"rowHeight + (rowHeight * 10)\">\n\n <ng-content></ng-content>\n \n <ng-template #gridScrollingContent>\n <ng-template let-item cdkVirtualFor [cdkVirtualForOf]=\"itemRows\">\n <bizy-grid-row [rowHeight]=\"rowHeight\" [itemsPerRow]=\"itemsPerRow\">\n <ng-container *ngFor=\"let it of item; trackBy: trackById\">\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: it }\"></ng-template>\n </ng-container>\n </bizy-grid-row>\n </ng-template>\n </ng-template>\n </cdk-virtual-scroll-viewport>\n\n</div>\n", styles: [":host{display:inline-block!important;min-height:var(--bizy-grid-min-height);max-height:var(--bizy-grid-max-height);height:var(--bizy-grid-height);width:var(--bizy-grid-width);flex:1;overflow-x:auto;overflow-y:hidden;font-size:1rem}:host:has(.bizy-grid--empty){height:0!important;min-height:0!important;max-height:0!important}.bizy-grid{width:inherit;height:inherit;min-width:fit-content;display:flex;flex-direction:column;row-gap:.3rem;overflow-x:clip;background-color:var(--bizy-grid-background-color)}.bizy-grid__rows{width:100%;display:flex;flex-direction:column;min-width:fit-content;overflow-x:hidden}::ng-deep .cdk-virtual-scrollable{height:100%;width:100%;overflow-y:auto!important;overflow-x:hidden!important;contain:inline-size!important}::ng-deep .cdk-virtual-scroll-content-wrapper{min-width:100%;max-width:100%}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar{width:.5rem;height:.5rem}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb{border-radius:1rem;background-color:var(--bizy-grid-scroll-bar-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb:hover{background-color:var(--bizy-grid-scroll-bar-hover-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-button{height:1rem}\n"], 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.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2$3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: BizyGridRowComponent, selector: "bizy-grid-row", inputs: ["rowHeight", "itemsPerRow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2725
2709
  }
2726
2710
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BizyGridComponent, decorators: [{
2727
2711
  type: Component,
2728
- args: [{ selector: 'bizy-grid', imports: [CommonModule, ScrollingModule, BizyGridRowComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bizy-grid\" [ngClass]=\"{'bizy-grid--empty': items && items.length === 0}\">\n\n <cdk-virtual-scroll-viewport\n class=\"bizy-grid__rows\"\n [itemSize]=\"rowHeight\"\n [minBufferPx]=\"rowHeight + (rowHeight * 5)\"\n [maxBufferPx]=\"rowHeight + (rowHeight * 10)\">\n\n <ng-content></ng-content>\n \n <ng-template #gridScrollingContent>\n <ng-template let-item cdkVirtualFor [cdkVirtualForOf]=\"itemRows\">\n <bizy-grid-row [rowHeight]=\"rowHeight\" [itemsPerRow]=\"itemsPerRow\">\n <ng-container *ngFor=\"let it of item; trackBy: trackById\">\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: it }\"></ng-template>\n </ng-container>\n </bizy-grid-row>\n </ng-template>\n </ng-template>\n </cdk-virtual-scroll-viewport>\n\n</div>\n", styles: [":host{display:inline-block!important;min-height:var(--bizy-grid-min-height);max-height:var(--bizy-grid-max-height);height:var(--bizy-grid-height);width:var(--bizy-grid-width);flex:1;overflow-x:auto;overflow-y:hidden;font-size:1rem}:host:has(.bizy-grid--empty){height:0!important;min-height:0!important;max-height:0!important}.bizy-grid{width:inherit;height:inherit;min-width:fit-content;display:flex;flex-direction:column;row-gap:.3rem;overflow-x:clip;background-color:var(--bizy-grid-background-color)}.bizy-grid__rows{width:100%;display:flex;flex-direction:column;min-width:fit-content;overflow-x:hidden}::ng-deep .cdk-virtual-scrollable{height:100%;width:100%;overflow-y:auto!important;overflow-x:hidden!important;contain:inline-size!important}::ng-deep .cdk-virtual-scroll-content-wrapper{min-width:100%;max-width:100%}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar{width:.5rem;height:.5rem}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb{border-radius:1rem;background-color:var(--bizy-grid-scroll-bar-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb:hover{background-color:var(--bizy-grid-scroll-bar-hover-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-button{height:1rem}\n"] }]
2712
+ args: [{ selector: 'bizy-grid', imports: [CommonModule, ScrollingModule, BizyGridRowComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"bizy-grid\" [ngClass]=\"{'bizy-grid--empty': items() && items().length === 0}\">\n\n <cdk-virtual-scroll-viewport\n class=\"bizy-grid__rows\"\n [itemSize]=\"rowHeight\"\n [minBufferPx]=\"rowHeight + (rowHeight * 5)\"\n [maxBufferPx]=\"rowHeight + (rowHeight * 10)\">\n\n <ng-content></ng-content>\n \n <ng-template #gridScrollingContent>\n <ng-template let-item cdkVirtualFor [cdkVirtualForOf]=\"itemRows\">\n <bizy-grid-row [rowHeight]=\"rowHeight\" [itemsPerRow]=\"itemsPerRow\">\n <ng-container *ngFor=\"let it of item; trackBy: trackById\">\n <ng-template *ngTemplateOutlet=\"itemTemplate; context: { $implicit: it }\"></ng-template>\n </ng-container>\n </bizy-grid-row>\n </ng-template>\n </ng-template>\n </cdk-virtual-scroll-viewport>\n\n</div>\n", styles: [":host{display:inline-block!important;min-height:var(--bizy-grid-min-height);max-height:var(--bizy-grid-max-height);height:var(--bizy-grid-height);width:var(--bizy-grid-width);flex:1;overflow-x:auto;overflow-y:hidden;font-size:1rem}:host:has(.bizy-grid--empty){height:0!important;min-height:0!important;max-height:0!important}.bizy-grid{width:inherit;height:inherit;min-width:fit-content;display:flex;flex-direction:column;row-gap:.3rem;overflow-x:clip;background-color:var(--bizy-grid-background-color)}.bizy-grid__rows{width:100%;display:flex;flex-direction:column;min-width:fit-content;overflow-x:hidden}::ng-deep .cdk-virtual-scrollable{height:100%;width:100%;overflow-y:auto!important;overflow-x:hidden!important;contain:inline-size!important}::ng-deep .cdk-virtual-scroll-content-wrapper{min-width:100%;max-width:100%}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar{width:.5rem;height:.5rem}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb{border-radius:1rem;background-color:var(--bizy-grid-scroll-bar-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-thumb:hover{background-color:var(--bizy-grid-scroll-bar-hover-color)}::ng-deep .cdk-virtual-scrollable::-webkit-scrollbar-button{height:1rem}\n"] }]
2729
2713
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef, decorators: [{
2730
2714
  type: Inject,
2731
2715
  args: [ChangeDetectorRef]