@webilix/ngx-helper-m3 0.0.39 → 0.0.40

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.
@@ -2644,6 +2644,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
2644
2644
  args: [{ required: true }]
2645
2645
  }] } });
2646
2646
 
2647
+ class NgxHelperShowInDirective {
2648
+ elementRef;
2649
+ config;
2650
+ ngxHelperShowIn;
2651
+ mobileWidth;
2652
+ constructor(elementRef, config) {
2653
+ this.elementRef = elementRef;
2654
+ this.config = config;
2655
+ }
2656
+ ngOnInit() {
2657
+ this.mobileWidth = this.config?.mobileWidth || 600;
2658
+ this.onResize();
2659
+ }
2660
+ onResize() {
2661
+ if (!this.elementRef)
2662
+ return;
2663
+ const element = this.elementRef.nativeElement;
2664
+ const isMobile = window.innerWidth <= this.mobileWidth;
2665
+ switch (this.ngxHelperShowIn) {
2666
+ case 'DESKTOP':
2667
+ element.style.display = isMobile ? 'none' : '';
2668
+ break;
2669
+ case 'MOBILE':
2670
+ element.style.display = isMobile ? '' : 'none';
2671
+ break;
2672
+ }
2673
+ }
2674
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: NgxHelperShowInDirective, deps: [{ token: i0.ElementRef }, { token: NGX_HELPER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
2675
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.4", type: NgxHelperShowInDirective, isStandalone: true, selector: "[ngxHelperShowIn]", inputs: { ngxHelperShowIn: "ngxHelperShowIn" }, host: { listeners: { "window:resize": "onResize($event)" } }, ngImport: i0 });
2676
+ }
2677
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: NgxHelperShowInDirective, decorators: [{
2678
+ type: Directive,
2679
+ args: [{ selector: '[ngxHelperShowIn]', host: { '(window:resize)': 'onResize($event)' } }]
2680
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
2681
+ type: Optional
2682
+ }, {
2683
+ type: Inject,
2684
+ args: [NGX_HELPER_CONFIG]
2685
+ }] }], propDecorators: { ngxHelperShowIn: [{
2686
+ type: Input,
2687
+ args: [{ required: true }]
2688
+ }] } });
2689
+
2647
2690
  class NgxHelperStickyDirective {
2648
2691
  elementRef;
2649
2692
  config;
@@ -2763,5 +2806,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
2763
2806
  * Generated bundle index. Do not edit.
2764
2807
  */
2765
2808
 
2766
- export { NGX_HELPER_BOX_DATA, NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_DATA_CHANGE, NGX_HELPER_PAGE_GROUP_ITEM, NgxHelperBankCardPipe, NgxHelperBoxComponent, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperCoordinatesService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperHttpService, NgxHelperImageService, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMobileViewDirective, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperProgressComponent, NgxHelperRouteService, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperStickyDirective, NgxHelperToastService, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
2809
+ export { NGX_HELPER_BOX_DATA, NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_DATA_CHANGE, NGX_HELPER_PAGE_GROUP_ITEM, NgxHelperBankCardPipe, NgxHelperBoxComponent, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperCoordinatesService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperHttpService, NgxHelperImageService, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMobileViewDirective, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperProgressComponent, NgxHelperRouteService, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperShowInDirective, NgxHelperStickyDirective, NgxHelperToastService, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
2767
2810
  //# sourceMappingURL=webilix-ngx-helper-m3.mjs.map