codexly-ui 0.10.67 → 0.10.69
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.
- package/fesm2022/codexly-ui.mjs +44 -3
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +21 -0
package/package.json
CHANGED
package/types/codexly-ui.d.ts
CHANGED
|
@@ -2997,12 +2997,28 @@ declare class ClxProductDetailComponent {
|
|
|
2997
2997
|
readonly _carousel: _angular_core.Signal<ClxCarouselComponent | undefined>;
|
|
2998
2998
|
readonly quantity: _angular_core.WritableSignal<number>;
|
|
2999
2999
|
readonly activeTab: _angular_core.WritableSignal<string>;
|
|
3000
|
+
/** Only holds specs the visitor has explicitly clicked — starts empty, not pre-filled with the
|
|
3001
|
+
* initial variation's specs, so a spec option can be toggled off (click again to deselect)
|
|
3002
|
+
* without fighting a "fully selected" starting state that never lets go of its last value. */
|
|
3000
3003
|
readonly selectedSpecs: _angular_core.WritableSignal<Record<string, string>>;
|
|
3004
|
+
private readonly _initialVariation;
|
|
3001
3005
|
/** Same card treatment as clx-product (bg-clx-surface + shadow-sm) — keeps the gallery/info
|
|
3002
3006
|
* panels visually consistent with the rest of the e-commerce card set. */
|
|
3003
3007
|
protected readonly _panelClass = "bg-clx-surface rounded-2xl shadow-sm p-4";
|
|
3004
3008
|
readonly tabItems: ClxTabItem[];
|
|
3009
|
+
/** Tracks which product the spec selection was initialized for — the init effect below must run
|
|
3010
|
+
* once per actual product change, not every time initialVariationId() changes. A host app that
|
|
3011
|
+
* syncs its own ?variant= URL param from the (variationChange) output (see codexly-store's
|
|
3012
|
+
* product-detail page) feeds that id back into this same input; without this guard, every spec
|
|
3013
|
+
* click would round-trip through the host and re-trigger initialization, silently overwriting
|
|
3014
|
+
* the visitor's in-progress selection with the just-resolved variation's full spec set. */
|
|
3015
|
+
private _initializedForProductId;
|
|
3005
3016
|
constructor();
|
|
3017
|
+
/** With no specs selected (fresh load, or every spec toggled back off) this is the variation
|
|
3018
|
+
* the visitor originally landed on. Otherwise, resolves the variation matching every currently
|
|
3019
|
+
* selected spec — with a partial selection (some spec types still untouched), any variation
|
|
3020
|
+
* whose specs are a superset of the selection counts as a match, since the visitor hasn't
|
|
3021
|
+
* narrowed those other spec types down to one value yet. */
|
|
3006
3022
|
readonly activeVariation: _angular_core.Signal<ClxVariation | null>;
|
|
3007
3023
|
readonly finalPrice: _angular_core.Signal<number>;
|
|
3008
3024
|
readonly discount: _angular_core.Signal<number>;
|
|
@@ -3017,6 +3033,11 @@ declare class ClxProductDetailComponent {
|
|
|
3017
3033
|
* hide each other's only selected value and the whole panel would render empty, even though
|
|
3018
3034
|
* other in-stock combinations (Azul L, Gris M, …) exist. */
|
|
3019
3035
|
isOptionAvailable(specTypeId: string, specOptionId: string): boolean;
|
|
3036
|
+
/** Clicking an already-selected option deselects it (toggle) instead of being a no-op — the only
|
|
3037
|
+
* way to escape a narrowed-down selection and see all options again, per the "hide unavailable
|
|
3038
|
+
* options" design: there's no separate disabled state to click through, so toggling off is the
|
|
3039
|
+
* sole path back. Once every spec is toggled off, activeVariation() falls back to the variation
|
|
3040
|
+
* the visitor originally landed on (see _initialVariation). */
|
|
3020
3041
|
selectSpec(specTypeId: string, specOptionId: string): void;
|
|
3021
3042
|
isSpecSelected(specTypeId: string, specOptionId: string): boolean;
|
|
3022
3043
|
selectedOptionLabel(specType: ClxSpecType): string;
|