@vallift/ngl 0.0.23 → 0.0.25

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,11 +1,18 @@
1
- import { Type } from '@angular/core';
1
+ import { EventEmitter, Type, OnDestroy } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- export declare class OpenFloatingMenuDirective {
3
+ export declare class OpenFloatingMenuDirective implements OnDestroy {
4
4
  private elementRef;
5
5
  private overlayService;
6
6
  component: Type<unknown>;
7
7
  floatingMenuPositionPreference: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
8
+ floatingMenuData: any;
9
+ onFloatingMenuActionPerformed: EventEmitter<{
10
+ actionKey: string;
11
+ data: any;
12
+ }>;
13
+ private overlaySub?;
14
+ ngOnDestroy(): void;
8
15
  onClick(): void;
9
16
  static ɵfac: i0.ɵɵFactoryDeclaration<OpenFloatingMenuDirective, never>;
10
- static ɵdir: i0.ɵɵDirectiveDeclaration<OpenFloatingMenuDirective, "[libOpenFloatingMenu]", never, { "component": { "alias": "libOpenFloatingMenu"; "required": false; }; "floatingMenuPositionPreference": { "alias": "floatingMenuPositionPreference"; "required": false; }; }, {}, never, never, true, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<OpenFloatingMenuDirective, "[libOpenFloatingMenu]", never, { "component": { "alias": "libOpenFloatingMenu"; "required": false; }; "floatingMenuPositionPreference": { "alias": "floatingMenuPositionPreference"; "required": false; }; "floatingMenuData": { "alias": "floatingMenuData"; "required": false; }; }, { "onFloatingMenuActionPerformed": "onFloatingMenuActionPerformed"; }, never, never, true, never>;
11
18
  }
@@ -14,7 +14,6 @@ import { NgClass, DOCUMENT, NgStyle, CommonModule, DatePipe } from '@angular/com
14
14
  import { SvgIconComponent } from 'angular-svg-icon';
15
15
  import { CdkPortal, ComponentPortal } from '@angular/cdk/portal';
16
16
  import { NgxMaskDirective } from 'ngx-mask';
17
- import { OverlayService as OverlayService$1 } from '@ngl';
18
17
  import { InfiniteScrollDirective } from 'ngx-infinite-scroll';
19
18
  import * as i2 from '@angular/platform-browser';
20
19
  import { isValidDate } from 'rxjs/internal/util/isDate';
@@ -3149,18 +3148,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
3149
3148
 
3150
3149
  class OpenFloatingMenuDirective {
3151
3150
  elementRef = inject((ElementRef));
3152
- overlayService = inject(OverlayService$1);
3151
+ overlayService = inject(OverlayService);
3153
3152
  component;
3154
3153
  floatingMenuPositionPreference = 'bottomCenter';
3154
+ floatingMenuData;
3155
+ onFloatingMenuActionPerformed = new EventEmitter();
3156
+ overlaySub;
3157
+ ngOnDestroy() {
3158
+ this.overlaySub?.unsubscribe();
3159
+ }
3155
3160
  onClick() {
3156
3161
  if (!this.component)
3157
3162
  return;
3158
- this.overlayService.openNearElement(this.component, this.elementRef.nativeElement, {
3163
+ const overlayRef = this.overlayService.openNearElement(this.component, this.elementRef.nativeElement, {
3159
3164
  positionPreference: this.floatingMenuPositionPreference,
3165
+ data: this.floatingMenuData,
3160
3166
  });
3167
+ if (this.overlaySub) {
3168
+ this.overlaySub.unsubscribe();
3169
+ }
3170
+ if (overlayRef?.closed) {
3171
+ this.overlaySub = overlayRef.closed.subscribe((result) => {
3172
+ this.onFloatingMenuActionPerformed.emit(result);
3173
+ });
3174
+ }
3161
3175
  }
3162
3176
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: OpenFloatingMenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3163
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.7", type: OpenFloatingMenuDirective, isStandalone: true, selector: "[libOpenFloatingMenu]", inputs: { component: ["libOpenFloatingMenu", "component"], floatingMenuPositionPreference: "floatingMenuPositionPreference" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
3177
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.7", type: OpenFloatingMenuDirective, isStandalone: true, selector: "[libOpenFloatingMenu]", inputs: { component: ["libOpenFloatingMenu", "component"], floatingMenuPositionPreference: "floatingMenuPositionPreference", floatingMenuData: "floatingMenuData" }, outputs: { onFloatingMenuActionPerformed: "onFloatingMenuActionPerformed" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
3164
3178
  }
3165
3179
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: OpenFloatingMenuDirective, decorators: [{
3166
3180
  type: Directive,
@@ -3173,6 +3187,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
3173
3187
  args: ['libOpenFloatingMenu']
3174
3188
  }], floatingMenuPositionPreference: [{
3175
3189
  type: Input
3190
+ }], floatingMenuData: [{
3191
+ type: Input
3192
+ }], onFloatingMenuActionPerformed: [{
3193
+ type: Output
3176
3194
  }], onClick: [{
3177
3195
  type: HostListener,
3178
3196
  args: ['click']