@ship-ui/core 0.17.8 → 0.17.10

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, computed, ElementRef, Renderer2, input, ChangeDetectionStrategy, Component, viewChild, effect, HostListener, NgModule, signal, Injectable, DOCUMENT, model, output, ApplicationRef, createComponent, isSignal, OutputEmitterRef, DestroyRef, PLATFORM_ID, ViewChild, contentChild, contentChildren, afterNextRender, Injector, HostBinding, TemplateRef, runInInjectionContext, Directive, ChangeDetectorRef, viewChildren, ViewContainerRef, EnvironmentInjector } from '@angular/core';
2
+ import { InjectionToken, inject, computed, ElementRef, Renderer2, input, ChangeDetectionStrategy, Component, viewChild, effect, HostListener, NgModule, signal, Injectable, DOCUMENT, model, output, ApplicationRef, createComponent, isSignal, OutputEmitterRef, DestroyRef, PLATFORM_ID, ViewChild, contentChild, contentChildren, afterNextRender, Injector, HostBinding, TemplateRef, runInInjectionContext, Directive, ChangeDetectorRef, viewChildren, untracked, ViewContainerRef, EnvironmentInjector } from '@angular/core';
3
3
  import { isPlatformBrowser, JsonPipe, DatePipe, isPlatformServer, NgTemplateOutlet } from '@angular/common';
4
4
  import { NgModel } from '@angular/forms';
5
5
  import { SIGNAL } from '@angular/core/primitives/signals';
@@ -6453,7 +6453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
6453
6453
  class ShipToggleCard {
6454
6454
  constructor() {
6455
6455
  this.isActive = model(false, ...(ngDevMode ? [{ debugName: "isActive" }] : []));
6456
- this.disallowToggle = input(false, ...(ngDevMode ? [{ debugName: "disallowToggle" }] : []));
6456
+ this.disableToggle = input(false, ...(ngDevMode ? [{ debugName: "disableToggle" }] : []));
6457
6457
  this.color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : []));
6458
6458
  this.variant = input(null, ...(ngDevMode ? [{ debugName: "variant" }] : []));
6459
6459
  this.hostClasses = shipComponentClasses('card', {
@@ -6461,20 +6461,15 @@ class ShipToggleCard {
6461
6461
  variant: this.variant,
6462
6462
  });
6463
6463
  }
6464
- ngOnInit() {
6465
- if (this.disallowToggle()) {
6466
- this.isActive.set(true);
6467
- }
6468
- }
6469
6464
  toggle() {
6470
6465
  this.isActive.set(!this.isActive());
6471
6466
  }
6472
6467
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ShipToggleCard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6473
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: ShipToggleCard, isStandalone: true, selector: "sh-toggle-card", inputs: { isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, disallowToggle: { classPropertyName: "disallowToggle", publicName: "disallowToggle", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isActive: "isActiveChange" }, host: { properties: { "class.active": "isActive()", "class": "hostClasses()" } }, ngImport: i0, template: `
6474
- <h3 (click)="disallowToggle() || toggle()">
6468
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: ShipToggleCard, isStandalone: true, selector: "sh-toggle-card", inputs: { isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, disableToggle: { classPropertyName: "disableToggle", publicName: "disableToggle", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isActive: "isActiveChange" }, host: { properties: { "class.active": "isActive()", "class": "hostClasses()" } }, ngImport: i0, template: `
6469
+ <h3 (click)="!disableToggle() && toggle()">
6475
6470
  <ng-content select="[title]">Title</ng-content>
6476
6471
 
6477
- @if (!disallowToggle()) {
6472
+ @if (!disableToggle()) {
6478
6473
  <sh-icon class="toggle-icon">caret-down</sh-icon>
6479
6474
  }
6480
6475
  </h3>
@@ -6492,10 +6487,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
6492
6487
  selector: 'sh-toggle-card',
6493
6488
  imports: [ShipIcon],
6494
6489
  template: `
6495
- <h3 (click)="disallowToggle() || toggle()">
6490
+ <h3 (click)="!disableToggle() && toggle()">
6496
6491
  <ng-content select="[title]">Title</ng-content>
6497
6492
 
6498
- @if (!disallowToggle()) {
6493
+ @if (!disableToggle()) {
6499
6494
  <sh-icon class="toggle-icon">caret-down</sh-icon>
6500
6495
  }
6501
6496
  </h3>
@@ -6512,7 +6507,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
6512
6507
  '[class]': 'hostClasses()',
6513
6508
  },
6514
6509
  }]
6515
- }], propDecorators: { isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }, { type: i0.Output, args: ["isActiveChange"] }], disallowToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "disallowToggle", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
6510
+ }], propDecorators: { isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }, { type: i0.Output, args: ["isActiveChange"] }], disableToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableToggle", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
6516
6511
 
6517
6512
  class ShipToggle {
6518
6513
  constructor() {
@@ -6900,7 +6895,6 @@ class ShipTooltipWrapper {
6900
6895
  this.#selfRef = inject((ElementRef));
6901
6896
  this.#renderer = inject(Renderer2);
6902
6897
  this.#positionAbort = null;
6903
- // readonly BASE_SPACE = 8;
6904
6898
  this.SUPPORTS_ANCHOR = typeof CSS !== 'undefined' && CSS.supports('position-anchor', '--abc');
6905
6899
  this.isBelow = signal(false, ...(ngDevMode ? [{ debugName: "isBelow" }] : []));
6906
6900
  this.openEffect = effect(() => {
@@ -6985,6 +6979,15 @@ let openRef = null;
6985
6979
  class ShipTooltip {
6986
6980
  constructor() {
6987
6981
  this.shTooltip = input.required(...(ngDevMode ? [{ debugName: "shTooltip" }] : []));
6982
+ this.#contentReplacedEffect = effect(() => {
6983
+ this.shTooltip();
6984
+ untracked(() => {
6985
+ if (this.isOpen()) {
6986
+ this.cleanupTooltip();
6987
+ this.showTooltip();
6988
+ }
6989
+ });
6990
+ }, ...(ngDevMode ? [{ debugName: "#contentReplacedEffect" }] : []));
6988
6991
  this.#elementRef = inject((ElementRef));
6989
6992
  this.#viewContainerRef = inject(ViewContainerRef);
6990
6993
  this.#environmentInjector = inject(EnvironmentInjector);
@@ -6994,6 +6997,7 @@ class ShipTooltip {
6994
6997
  this.anchorName = `--${generateUniqueId()}`;
6995
6998
  this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
6996
6999
  }
7000
+ #contentReplacedEffect;
6997
7001
  #elementRef;
6998
7002
  #viewContainerRef;
6999
7003
  #environmentInjector;