@vsn-ux/ngx-gaia 0.12.3 → 0.12.4

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.
@@ -2372,6 +2372,7 @@ class GaTooltipDirective {
2372
2372
  _placement = 'right-center';
2373
2373
  _offset = GA_TOOLTIP_DEFAULT_OFFSET;
2374
2374
  mouseOver = false;
2375
+ focused = false;
2375
2376
  ariaDescribedBy = signal(null, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : []));
2376
2377
  _showControlMode = null;
2377
2378
  _hideControlMode = null;
@@ -2509,31 +2510,47 @@ class GaTooltipDirective {
2509
2510
  this.toggle();
2510
2511
  }
2511
2512
  handleMouseEnter() {
2513
+ this.scheduleShow(() => (this.mouseOver = true));
2514
+ }
2515
+ handleMouseLeave() {
2516
+ this.scheduleHide(() => (this.mouseOver = false));
2517
+ }
2518
+ handleFocusIn() {
2519
+ this.scheduleShow(() => (this.focused = true));
2520
+ }
2521
+ handleFocusOut() {
2522
+ this.scheduleHide(() => (this.focused = false));
2523
+ }
2524
+ scheduleShow(setFlag) {
2512
2525
  if (this.showControlMode !== 'hover' || this.disabled || !this._content) {
2513
2526
  return;
2514
2527
  }
2515
- this.mouseOver = true;
2528
+ setFlag();
2516
2529
  this.clearShowTimeout();
2517
- if (this.showDelay() > 0) {
2518
- this.showTimeoutId = setTimeout(() => this.show(), this.showDelay());
2530
+ const delay = this.showDelay();
2531
+ if (delay > 0) {
2532
+ this.showTimeoutId = setTimeout(() => this.show(), delay);
2519
2533
  }
2520
2534
  else {
2521
2535
  this.show();
2522
2536
  }
2523
2537
  }
2524
- handleMouseLeave() {
2538
+ scheduleHide(clearFlag) {
2525
2539
  this.clearShowTimeout();
2526
2540
  if (this.hideControlMode !== 'hover' || this.disabled) {
2527
2541
  return;
2528
2542
  }
2529
- this.mouseOver = false;
2543
+ clearFlag();
2530
2544
  setTimeout(() => this.softHide());
2531
2545
  }
2532
2546
  /**
2533
- * hides only if mouse is not over the host element nor the tooltip itself
2547
+ * Hides only if mouse is not over the host element, element is not focused,
2548
+ * and mouse is not over the tooltip itself.
2534
2549
  */
2535
2550
  softHide() {
2536
- if (!this.mouseOver && !this.tooltipInstance?.mouseOver()) {
2551
+ if (!this.mouseOver &&
2552
+ !this.focused &&
2553
+ !this.tooltipInstance?.mouseOver()) {
2537
2554
  this.hide();
2538
2555
  }
2539
2556
  }
@@ -2652,7 +2669,7 @@ class GaTooltipDirective {
2652
2669
  }
2653
2670
  }
2654
2671
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GaTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2655
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: GaTooltipDirective, isStandalone: true, selector: "[gaTooltip]", inputs: { content: { classPropertyName: "content", publicName: "gaTooltip", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "gaTooltipDisabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, controlMode: { classPropertyName: "controlMode", publicName: "gaTooltipControlMode", isSignal: false, isRequired: false, transformFunction: null }, showControlMode: { classPropertyName: "showControlMode", publicName: "gaTooltipShowControlMode", isSignal: false, isRequired: false, transformFunction: null }, hideControlMode: { classPropertyName: "hideControlMode", publicName: "gaTooltipHideControlMode", isSignal: false, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "gaTooltipOffsetSize", isSignal: false, isRequired: false, transformFunction: numberAttribute }, showDelay: { classPropertyName: "showDelay", publicName: "gaTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "gaTooltipPlacement", isSignal: false, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "handleMouseClick()", "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()" }, properties: { "attr.aria-describedby": "ariaDescribedBy()" } }, exportAs: ["gaTooltip"], ngImport: i0 });
2672
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: GaTooltipDirective, isStandalone: true, selector: "[gaTooltip]", inputs: { content: { classPropertyName: "content", publicName: "gaTooltip", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "gaTooltipDisabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, controlMode: { classPropertyName: "controlMode", publicName: "gaTooltipControlMode", isSignal: false, isRequired: false, transformFunction: null }, showControlMode: { classPropertyName: "showControlMode", publicName: "gaTooltipShowControlMode", isSignal: false, isRequired: false, transformFunction: null }, hideControlMode: { classPropertyName: "hideControlMode", publicName: "gaTooltipHideControlMode", isSignal: false, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "gaTooltipOffsetSize", isSignal: false, isRequired: false, transformFunction: numberAttribute }, showDelay: { classPropertyName: "showDelay", publicName: "gaTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "gaTooltipPlacement", isSignal: false, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "handleMouseClick()", "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()", "focusin": "handleFocusIn()", "focusout": "handleFocusOut()" }, properties: { "attr.aria-describedby": "ariaDescribedBy()" } }, exportAs: ["gaTooltip"], ngImport: i0 });
2656
2673
  }
2657
2674
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GaTooltipDirective, decorators: [{
2658
2675
  type: Directive,
@@ -2661,6 +2678,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
2661
2678
  exportAs: 'gaTooltip',
2662
2679
  host: {
2663
2680
  '[attr.aria-describedby]': 'ariaDescribedBy()',
2681
+ '(click)': 'handleMouseClick()',
2682
+ '(mouseenter)': 'handleMouseEnter()',
2683
+ '(mouseleave)': 'handleMouseLeave()',
2684
+ '(focusin)': 'handleFocusIn()',
2685
+ '(focusout)': 'handleFocusOut()',
2664
2686
  },
2665
2687
  }]
2666
2688
  }], propDecorators: { content: [{
@@ -2684,15 +2706,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
2684
2706
  }], showDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaTooltipShowDelay", required: false }] }], placement: [{
2685
2707
  type: Input,
2686
2708
  args: [{ alias: 'gaTooltipPlacement' }]
2687
- }], handleMouseClick: [{
2688
- type: HostListener,
2689
- args: ['click']
2690
- }], handleMouseEnter: [{
2691
- type: HostListener,
2692
- args: ['mouseenter']
2693
- }], handleMouseLeave: [{
2694
- type: HostListener,
2695
- args: ['mouseleave']
2696
2709
  }] } });
2697
2710
 
2698
2711
  class GaTooltipTitleComponent {
@@ -2760,13 +2773,13 @@ class GaFieldLabelComponent {
2760
2773
  }
2761
2774
  }
2762
2775
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GaFieldLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2763
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: GaFieldLabelComponent, isStandalone: true, selector: "ga-label", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null }, definition: { classPropertyName: "definition", publicName: "definition", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "null" } }, ngImport: i0, template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n<label\n [attr.id]=\"id()\"\n [attr.for]=\"controlId()\"\n class=\"ga-form-field__label\"\n [class.ga-form-field__label--defined]=\"!!definition()\"\n [class.ga-form-field__label--disabled]=\"formField.disabled()\"\n (click)=\"focusControl()\"\n [attr.tabindex]=\"definition() ? 0 : -1\"\n>\n <span\n class=\"ga-form-field__label-text\"\n [gaTooltip]=\"definition()\"\n gaTooltipPlacement=\"top-start\"\n gaTooltipShowDelay=\"200\"\n ><ng-content\n /></span>\n @if (state()) {\n <span class=\"ga-form-field__label-state\">{{ state() }}</span>\n }\n</label>\n", dependencies: [{ kind: "ngmodule", type: GaTooltipModule }, { kind: "directive", type: GaTooltipDirective, selector: "[gaTooltip]", inputs: ["gaTooltip", "gaTooltipDisabled", "gaTooltipControlMode", "gaTooltipShowControlMode", "gaTooltipHideControlMode", "gaTooltipOffsetSize", "gaTooltipShowDelay", "gaTooltipPlacement"], exportAs: ["gaTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2776
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: GaFieldLabelComponent, isStandalone: true, selector: "ga-label", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null }, definition: { classPropertyName: "definition", publicName: "definition", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "null" } }, ngImport: i0, template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n<label\n [attr.id]=\"id()\"\n [attr.for]=\"controlId()\"\n class=\"ga-form-field__label\"\n [class.ga-form-field__label--defined]=\"!!definition()\"\n [class.ga-form-field__label--disabled]=\"formField.disabled()\"\n [gaTooltip]=\"definition()\"\n [attr.tabindex]=\"definition() ? 0 : -1\"\n gaTooltipPlacement=\"top-start\"\n gaTooltipShowDelay=\"200\"\n (click)=\"focusControl()\"\n>\n <span class=\"ga-form-field__label-text\"><ng-content /></span>\n @if (state()) {\n <span class=\"ga-form-field__label-state\">{{ state() }}</span>\n }\n</label>\n", dependencies: [{ kind: "ngmodule", type: GaTooltipModule }, { kind: "directive", type: GaTooltipDirective, selector: "[gaTooltip]", inputs: ["gaTooltip", "gaTooltipDisabled", "gaTooltipControlMode", "gaTooltipShowControlMode", "gaTooltipHideControlMode", "gaTooltipOffsetSize", "gaTooltipShowDelay", "gaTooltipPlacement"], exportAs: ["gaTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2764
2777
  }
2765
2778
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GaFieldLabelComponent, decorators: [{
2766
2779
  type: Component,
2767
2780
  args: [{ selector: 'ga-label', imports: [GaTooltipModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2768
2781
  '[attr.id]': 'null',
2769
- }, template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n<label\n [attr.id]=\"id()\"\n [attr.for]=\"controlId()\"\n class=\"ga-form-field__label\"\n [class.ga-form-field__label--defined]=\"!!definition()\"\n [class.ga-form-field__label--disabled]=\"formField.disabled()\"\n (click)=\"focusControl()\"\n [attr.tabindex]=\"definition() ? 0 : -1\"\n>\n <span\n class=\"ga-form-field__label-text\"\n [gaTooltip]=\"definition()\"\n gaTooltipPlacement=\"top-start\"\n gaTooltipShowDelay=\"200\"\n ><ng-content\n /></span>\n @if (state()) {\n <span class=\"ga-form-field__label-state\">{{ state() }}</span>\n }\n</label>\n" }]
2782
+ }, template: "<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n<label\n [attr.id]=\"id()\"\n [attr.for]=\"controlId()\"\n class=\"ga-form-field__label\"\n [class.ga-form-field__label--defined]=\"!!definition()\"\n [class.ga-form-field__label--disabled]=\"formField.disabled()\"\n [gaTooltip]=\"definition()\"\n [attr.tabindex]=\"definition() ? 0 : -1\"\n gaTooltipPlacement=\"top-start\"\n gaTooltipShowDelay=\"200\"\n (click)=\"focusControl()\"\n>\n <span class=\"ga-form-field__label-text\"><ng-content /></span>\n @if (state()) {\n <span class=\"ga-form-field__label-state\">{{ state() }}</span>\n }\n</label>\n" }]
2770
2783
  }], ctorParameters: () => [], propDecorators: { for: [{ type: i0.Input, args: [{ isSignal: true, alias: "for", required: false }] }], definition: [{ type: i0.Input, args: [{ isSignal: true, alias: "definition", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], idInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
2771
2784
 
2772
2785
  class GaFormControlDirective {