@klippa/ngx-enhancy-forms 14.22.5 → 14.22.6

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.
@@ -2447,6 +2447,7 @@ class WithTooltipDirective {
2447
2447
  this.el = el;
2448
2448
  this.appRef = appRef;
2449
2449
  this.klpWithTooltip = 'orange';
2450
+ this.position = 'top';
2450
2451
  el.nativeElement.addEventListener('mouseenter', () => {
2451
2452
  let textToDisplay;
2452
2453
  if (!this.templateInstance) {
@@ -2479,8 +2480,14 @@ class WithTooltipDirective {
2479
2480
  this.div.style.color = `${colors[this.klpWithTooltip].noAlpha}`;
2480
2481
  this.div.style.position = 'fixed';
2481
2482
  this.div.style.left = `${el.nativeElement.getBoundingClientRect().x}px`;
2482
- this.div.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
2483
- this.div.style.transform = `translate(calc(-100% + ${el.nativeElement.getBoundingClientRect().width}px), calc(-100% - 0.3rem))`;
2483
+ if (this.position === 'top') {
2484
+ this.div.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
2485
+ this.div.style.transform = `translate(calc(-100% + ${el.nativeElement.getBoundingClientRect().width}px), calc(-100% - 0.3rem))`;
2486
+ }
2487
+ else if (this.position === 'bottom') {
2488
+ this.div.style.top = `${el.nativeElement.getBoundingClientRect().y + el.nativeElement.getBoundingClientRect().height}px`;
2489
+ this.div.style.transform = `translate(calc(-100% + ${el.nativeElement.getBoundingClientRect().width}px), calc(0% + 0.3rem))`;
2490
+ }
2484
2491
  this.div.style.maxWidth = '200px';
2485
2492
  this.div.style.whiteSpace = 'break-spaces';
2486
2493
  this.div.style.backgroundColor = 'white';
@@ -2507,8 +2514,14 @@ class WithTooltipDirective {
2507
2514
  this.triangle.style.zIndex = `${zIndexStart + 1}`;
2508
2515
  this.triangle.style.position = 'fixed';
2509
2516
  this.triangle.style.left = `calc(${el.nativeElement.getBoundingClientRect().x + el.nativeElement.getBoundingClientRect().width}px - 2rem)`;
2510
- this.triangle.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
2511
- this.triangle.style.transform = `translate(-50%, calc(-100% + 0.1rem))`;
2517
+ if (this.position === 'top') {
2518
+ this.triangle.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
2519
+ this.triangle.style.transform = `translate(-50%, calc(-100% + 0.1rem))`;
2520
+ }
2521
+ else if (this.position === 'bottom') {
2522
+ this.triangle.style.top = `${el.nativeElement.getBoundingClientRect().y + el.nativeElement.getBoundingClientRect().height}px`;
2523
+ this.triangle.style.transform = `translate(-50%, 0rem) rotate(180deg)`;
2524
+ }
2512
2525
  this.triangle.style.width = '0';
2513
2526
  this.triangle.style.height = '0';
2514
2527
  this.triangle.style.borderLeft = `${triangleSize} solid transparent`;
@@ -2519,8 +2532,14 @@ class WithTooltipDirective {
2519
2532
  this.triangleWhite.style.zIndex = `${zIndexStart + 3}`;
2520
2533
  this.triangleWhite.style.position = 'fixed';
2521
2534
  this.triangleWhite.style.left = `calc(${el.nativeElement.getBoundingClientRect().x + el.nativeElement.getBoundingClientRect().width}px - 2rem)`;
2522
- this.triangleWhite.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
2523
- this.triangleWhite.style.transform = `translate(-50%, calc(-100% + 0.1rem - 2px))`;
2535
+ if (this.position === 'top') {
2536
+ this.triangleWhite.style.top = `${el.nativeElement.getBoundingClientRect().y}px`;
2537
+ this.triangleWhite.style.transform = `translate(-50%, calc(-100% + 0.1rem - 2px))`;
2538
+ }
2539
+ else if (this.position === 'bottom') {
2540
+ this.triangleWhite.style.top = `${el.nativeElement.getBoundingClientRect().y + el.nativeElement.getBoundingClientRect().height}px`;
2541
+ this.triangleWhite.style.transform = `translate(-50%, -2px) rotate(180deg)`;
2542
+ }
2524
2543
  this.triangleWhite.style.width = '0';
2525
2544
  this.triangleWhite.style.height = '0';
2526
2545
  this.triangleWhite.style.borderLeft = `${triangleSize} solid transparent`;
@@ -2562,7 +2581,7 @@ class WithTooltipDirective {
2562
2581
  }
2563
2582
  }
2564
2583
  WithTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WithTooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Directive });
2565
- WithTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: WithTooltipDirective, selector: "[klpWithTooltip]", inputs: { klpWithTooltip: "klpWithTooltip", tooltipText: "tooltipText", tooltipTemplate: "tooltipTemplate" }, usesOnChanges: true, ngImport: i0 });
2584
+ WithTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: WithTooltipDirective, selector: "[klpWithTooltip]", inputs: { klpWithTooltip: "klpWithTooltip", tooltipText: "tooltipText", tooltipTemplate: "tooltipTemplate", position: "position" }, usesOnChanges: true, ngImport: i0 });
2566
2585
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: WithTooltipDirective, decorators: [{
2567
2586
  type: Directive,
2568
2587
  args: [{
@@ -2574,6 +2593,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
2574
2593
  type: Input
2575
2594
  }], tooltipTemplate: [{
2576
2595
  type: Input
2596
+ }], position: [{
2597
+ type: Input
2577
2598
  }] } });
2578
2599
 
2579
2600
  class NgxEnhancyFormsModule {