@ship-ui/core 0.17.11 → 0.17.12

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.
@@ -570,7 +570,7 @@
570
570
  "examples": [
571
571
  {
572
572
  "name": "toggle-card-disallowed",
573
- "html": "<sh-toggle-card [disableToggle]=\"true\" [isActive]=\"true\">\n <ng-container title>Advanced options</ng-container>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n</sh-toggle-card>\n",
573
+ "html": "<sh-toggle-card [disableToggle]=\"true\">\n <ng-container title>Advanced options</ng-container>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n</sh-toggle-card>\n",
574
574
  "ts": "import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { ShipToggleCard } from 'ship-ui';\n\n@Component({\n selector: 'app-toggle-card-disallowed-example',\n standalone: true,\n imports: [ShipToggleCard],\n templateUrl: './toggle-card-disallowed.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ToggleCardDisallowedExampleComponent {}\n"
575
575
  },
576
576
  {
@@ -1669,7 +1669,7 @@
1669
1669
  "name": "isActive",
1670
1670
  "type": "boolean",
1671
1671
  "description": "",
1672
- "defaultValue": "false"
1672
+ "defaultValue": ""
1673
1673
  }
1674
1674
  ],
1675
1675
  "outputs": [],
@@ -6452,8 +6452,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
6452
6452
 
6453
6453
  class ShipToggleCard {
6454
6454
  constructor() {
6455
- this.isActive = model(false, ...(ngDevMode ? [{ debugName: "isActive" }] : []));
6456
6455
  this.disableToggle = input(false, ...(ngDevMode ? [{ debugName: "disableToggle" }] : []));
6456
+ this.isActive = model(...(ngDevMode ? [undefined, { debugName: "isActive" }] : []));
6457
+ this.#disabledEffect = effect(() => {
6458
+ if (this.disableToggle()) {
6459
+ this.isActive.set(true);
6460
+ }
6461
+ }, ...(ngDevMode ? [{ debugName: "#disabledEffect" }] : []));
6457
6462
  this.color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : []));
6458
6463
  this.variant = input(null, ...(ngDevMode ? [{ debugName: "variant" }] : []));
6459
6464
  this.hostClasses = shipComponentClasses('card', {
@@ -6461,11 +6466,12 @@ class ShipToggleCard {
6461
6466
  variant: this.variant,
6462
6467
  });
6463
6468
  }
6469
+ #disabledEffect;
6464
6470
  toggle() {
6465
6471
  this.isActive.set(!this.isActive());
6466
6472
  }
6467
6473
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ShipToggleCard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
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: `
6474
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.0", type: ShipToggleCard, isStandalone: true, selector: "sh-toggle-card", inputs: { disableToggle: { classPropertyName: "disableToggle", publicName: "disableToggle", isSignal: true, isRequired: false, transformFunction: null }, isActive: { classPropertyName: "isActive", publicName: "isActive", 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
6475
  <h3 (click)="!disableToggle() && toggle()">
6470
6476
  <ng-content select="[title]">Title</ng-content>
6471
6477
 
@@ -6507,7 +6513,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
6507
6513
  '[class]': 'hostClasses()',
6508
6514
  },
6509
6515
  }]
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
+ }], propDecorators: { disableToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableToggle", required: false }] }], isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }, { type: i0.Output, args: ["isActiveChange"] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
6511
6517
 
6512
6518
  class ShipToggle {
6513
6519
  constructor() {