codexly-ui 0.13.1 → 0.13.3

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.
@@ -1349,13 +1349,28 @@ class ClxAvatarComponent {
1349
1349
  shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
1350
1350
  alt = input('Avatar', ...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
1351
1351
  _color = computed(() => this.color() ?? this._themeSvc.config().primaryColor, ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
1352
+ /** Set by (error) on the <img> when src() fails to load (404, expired/broken URL, CORS, wrong
1353
+ * host, ...) — without this, _contentType() would keep returning 'image' forever since it only
1354
+ * checks whether src() is truthy, never whether it actually loaded, and the browser renders the
1355
+ * alt() text raw inside the small circular avatar container ("Avatar" clipped into "Avata").
1356
+ * Reset by the effect below whenever src() itself changes, so a later successful URL (e.g. after
1357
+ * uploading a new profile photo) gets a fresh chance to load instead of staying stuck on the
1358
+ * fallback from a previous broken one. */
1359
+ _imgFailed = signal(false, ...(ngDevMode ? [{ debugName: "_imgFailed" }] : /* istanbul ignore next */ []));
1360
+ _resetImgFailedOnSrcChange = effect(() => {
1361
+ this.src();
1362
+ this._imgFailed.set(false);
1363
+ }, ...(ngDevMode ? [{ debugName: "_resetImgFailedOnSrcChange" }] : /* istanbul ignore next */ []));
1352
1364
  _contentType = computed(() => {
1353
- if (this.src())
1365
+ if (this.src() && !this._imgFailed())
1354
1366
  return 'image';
1355
1367
  if (this.initials())
1356
1368
  return 'text';
1357
1369
  return 'icon';
1358
1370
  }, ...(ngDevMode ? [{ debugName: "_contentType" }] : /* istanbul ignore next */ []));
1371
+ _onImgError() {
1372
+ this._imgFailed.set(true);
1373
+ }
1359
1374
  _initials = computed(() => (this.initials() ?? '').slice(0, 3).toUpperCase(), ...(ngDevMode ? [{ debugName: "_initials" }] : /* istanbul ignore next */ []));
1360
1375
  _iconSize = computed(() => AVATAR_ICON_SIZE_MAP[this.size()], ...(ngDevMode ? [{ debugName: "_iconSize" }] : /* istanbul ignore next */ []));
1361
1376
  _shapeClass = computed(() => {
@@ -1386,7 +1401,7 @@ class ClxAvatarComponent {
1386
1401
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxAvatarComponent, isStandalone: true, selector: "clx-avatar", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, iconName: { classPropertyName: "iconName", publicName: "iconName", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "class": "_hostClass()", "attr.aria-label": "alt()" } }, ngImport: i0, template: `
1387
1402
  @switch (_contentType()) {
1388
1403
  @case ('image') {
1389
- <img [src]="src()" [alt]="alt()" class="w-full h-full object-cover" />
1404
+ <img [src]="src()" [alt]="alt()" class="w-full h-full object-cover" (error)="_onImgError()" />
1390
1405
  }
1391
1406
  @case ('text') {
1392
1407
  <span [class]="_textClass()">{{ _initials() }}</span>
@@ -1406,7 +1421,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
1406
1421
  template: `
1407
1422
  @switch (_contentType()) {
1408
1423
  @case ('image') {
1409
- <img [src]="src()" [alt]="alt()" class="w-full h-full object-cover" />
1424
+ <img [src]="src()" [alt]="alt()" class="w-full h-full object-cover" (error)="_onImgError()" />
1410
1425
  }
1411
1426
  @case ('text') {
1412
1427
  <span [class]="_textClass()">{{ _initials() }}</span>
@@ -10446,23 +10461,6 @@ class ClxWizardComponent {
10446
10461
  prevLabel = input('Anterior', ...(ngDevMode ? [{ debugName: "prevLabel" }] : /* istanbul ignore next */ []));
10447
10462
  nextLabel = input('Siguiente', ...(ngDevMode ? [{ debugName: "nextLabel" }] : /* istanbul ignore next */ []));
10448
10463
  finishLabel = input('Finalizar', ...(ngDevMode ? [{ debugName: "finishLabel" }] : /* istanbul ignore next */ []));
10449
- /** Which step to land on when the wizard first renders — for restoring an in-progress flow (e.g.
10450
- * a saved draft, or state re-hydrated after an external redirect) rather than always starting
10451
- * fresh at step 0. Applied once, in ngAfterContentInit, and clamped to a valid index; deliberately
10452
- * bypasses the `linear` guard that goTo()/next() enforce for user-driven navigation — that guard
10453
- * exists to stop a customer from skipping ahead of steps they haven't filled in yet, which doesn't
10454
- * apply here: the caller is asserting those earlier steps are ALREADY valid (e.g. their own
10455
- * signals were just re-prefilled from a backend order), not trying to skip past them. Consumers
10456
- * are responsible for that guarantee — this input trusts it rather than re-validating each
10457
- * skipped step, since isValid() reflects the CURRENT signal state, which the caller controls. */
10458
- initialStep = input(undefined, ...(ngDevMode ? [{ debugName: "initialStep" }] : /* istanbul ignore next */ []));
10459
- /** Hides the built-in "Finalizar" button on the LAST step only (every other step's own "Siguiente"
10460
- * button is unaffected) — for a caller that needs its own custom action there instead (e.g. a
10461
- * payment gateway's own branded button rendered inside that step's own projected content, which
10462
- * must trigger the exact same submit logic the wizard's own (finish) output would have, so the
10463
- * step's own isValid still gates whether that custom button is meaningful to show/enable — this
10464
- * input only removes the wizard's OWN redundant generic button, nothing about validation). */
10465
- hideFinishButton = input(false, ...(ngDevMode ? [{ debugName: "hideFinishButton" }] : /* istanbul ignore next */ []));
10466
10464
  // ── Outputs ────────────────────────────────────────────────────────────────
10467
10465
  stepChange = output();
10468
10466
  finish = output();
@@ -10475,20 +10473,12 @@ class ClxWizardComponent {
10475
10473
  // ── Lifecycle ──────────────────────────────────────────────────────────────
10476
10474
  ngAfterContentInit() {
10477
10475
  this._steps = this._stepQuery.toArray();
10478
- this._applyInitialStep();
10479
10476
  this._syncActiveAttrs();
10480
10477
  this._stepQuery.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
10481
10478
  this._steps = this._stepQuery.toArray();
10482
10479
  this._syncActiveAttrs();
10483
10480
  });
10484
10481
  }
10485
- _applyInitialStep() {
10486
- const requested = this.initialStep();
10487
- if (requested == null)
10488
- return;
10489
- const clamped = Math.min(Math.max(requested, 0), this._lastIndex());
10490
- this._currentIndex.set(clamped);
10491
- }
10492
10482
  _syncActiveAttrs() {
10493
10483
  this._steps.forEach((step, i) => {
10494
10484
  step.nativeEl.setAttribute('data-active', String(i === this._currentIndex()));
@@ -10579,7 +10569,7 @@ class ClxWizardComponent {
10579
10569
  return `${base} border-2 border-clx-border text-clx-text-subtle bg-clx-surface ${ptr}`;
10580
10570
  }
10581
10571
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
10582
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxWizardComponent, isStandalone: true, selector: "clx-wizard", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, activeTextColor: { classPropertyName: "activeTextColor", publicName: "activeTextColor", isSignal: true, isRequired: false, transformFunction: null }, underlineColor: { classPropertyName: "underlineColor", publicName: "underlineColor", isSignal: true, isRequired: false, transformFunction: null }, stepColor: { classPropertyName: "stepColor", publicName: "stepColor", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, prevLabel: { classPropertyName: "prevLabel", publicName: "prevLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, finishLabel: { classPropertyName: "finishLabel", publicName: "finishLabel", isSignal: true, isRequired: false, transformFunction: null }, initialStep: { classPropertyName: "initialStep", publicName: "initialStep", isSignal: true, isRequired: false, transformFunction: null }, hideFinishButton: { classPropertyName: "hideFinishButton", publicName: "hideFinishButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepChange: "stepChange", finish: "finish" }, queries: [{ propertyName: "_stepQuery", predicate: ClxStepComponent }], ngImport: i0, template: `
10572
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxWizardComponent, isStandalone: true, selector: "clx-wizard", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, activeTextColor: { classPropertyName: "activeTextColor", publicName: "activeTextColor", isSignal: true, isRequired: false, transformFunction: null }, underlineColor: { classPropertyName: "underlineColor", publicName: "underlineColor", isSignal: true, isRequired: false, transformFunction: null }, stepColor: { classPropertyName: "stepColor", publicName: "stepColor", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, prevLabel: { classPropertyName: "prevLabel", publicName: "prevLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, finishLabel: { classPropertyName: "finishLabel", publicName: "finishLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepChange: "stepChange", finish: "finish" }, queries: [{ propertyName: "_stepQuery", predicate: ClxStepComponent }], ngImport: i0, template: `
10583
10573
  <div [class]="_rootClass()">
10584
10574
 
10585
10575
  <!-- ══ HORIZONTAL: clx-tabs indicator ═══════════════════════════════ -->
@@ -10668,7 +10658,7 @@ class ClxWizardComponent {
10668
10658
  [disabled]="!_currentStepValid()"
10669
10659
  (click)="next()"
10670
10660
  >{{ nextLabel() }}</button>
10671
- } @else if (!hideFinishButton()) {
10661
+ } @else {
10672
10662
  <button
10673
10663
  clx-button
10674
10664
  type="button"
@@ -10777,7 +10767,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
10777
10767
  [disabled]="!_currentStepValid()"
10778
10768
  (click)="next()"
10779
10769
  >{{ nextLabel() }}</button>
10780
- } @else if (!hideFinishButton()) {
10770
+ } @else {
10781
10771
  <button
10782
10772
  clx-button
10783
10773
  type="button"
@@ -10794,7 +10784,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
10794
10784
  </div>
10795
10785
  </div>
10796
10786
  `, styles: ["@keyframes clx-wizard-fade-slide{0%{opacity:0;transform:translate(10px)}to{opacity:1;transform:translate(0)}}.clx-wizard-step-enter{animation:clx-wizard-fade-slide .22s cubic-bezier(.4,0,.2,1) both}@keyframes clx-wizard-fill{0%{width:0%}to{width:100%}}.clx-wizard-connector-fill{animation:clx-wizard-fill .3s ease both}clx-step[data-active=false]{display:none}\n"] }]
10797
- }], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], activeTextColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTextColor", required: false }] }], underlineColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "underlineColor", required: false }] }], stepColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepColor", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], linear: [{ type: i0.Input, args: [{ isSignal: true, alias: "linear", required: false }] }], prevLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "prevLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], finishLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "finishLabel", required: false }] }], initialStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialStep", required: false }] }], hideFinishButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideFinishButton", required: false }] }], stepChange: [{ type: i0.Output, args: ["stepChange"] }], finish: [{ type: i0.Output, args: ["finish"] }], _stepQuery: [{
10787
+ }], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], activeTextColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTextColor", required: false }] }], underlineColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "underlineColor", required: false }] }], stepColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepColor", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], linear: [{ type: i0.Input, args: [{ isSignal: true, alias: "linear", required: false }] }], prevLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "prevLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], finishLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "finishLabel", required: false }] }], stepChange: [{ type: i0.Output, args: ["stepChange"] }], finish: [{ type: i0.Output, args: ["finish"] }], _stepQuery: [{
10798
10788
  type: ContentChildren,
10799
10789
  args: [ClxStepComponent]
10800
10790
  }] } });