@magicx-eng/ai-autocomplete-angular 0.42.0 → 0.43.0
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/README.md +39 -5
- package/esm2020/lib/ai-autocomplete/ai-autocomplete.component.mjs +10 -5
- package/esm2020/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.mjs +9 -3
- package/esm2020/lib/controller/ai-autocomplete.controller.mjs +45 -6
- package/esm2020/lib/internal/product-strip/product-strip.component.mjs +97 -6
- package/esm2020/lib/shared/types.mjs +1 -1
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +158 -16
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +157 -16
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts +14 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts.map +1 -1
- package/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.d.ts +7 -0
- package/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.d.ts.map +1 -1
- package/lib/controller/ai-autocomplete.controller.d.ts +17 -1
- package/lib/controller/ai-autocomplete.controller.d.ts.map +1 -1
- package/lib/internal/product-strip/product-strip.component.d.ts +29 -2
- package/lib/internal/product-strip/product-strip.component.d.ts.map +1 -1
- package/lib/shared/types.d.ts +21 -0
- package/lib/shared/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { WEEKDAY_LABELS as WEEKDAY_LABELS$1, cellIso as cellIso$1, monthLabel as monthLabel$1, cellDay as cellDay$1, isoDate as isoDate$1, dateCellMarks as dateCellMarks$1, visibleDateRange as visibleDateRange$1, SMART_SUGGESTION_SPARKLE_SVG, isSmartSuggestion, isTraditionalAutocompleteSuggestion, uiStringsFor, productInitial, productImageSources as productImageSources$1, attachProductRowWheel, optionsGridTemplateColumns, highlightParts, optionLabel as optionLabel$1, optionImageSources as optionImageSources$1, formatOptionCount as formatOptionCount$1, sanitizeOptionIconSvg as sanitizeOptionIconSvg$1, planOptionsGrid, optionsShowLeadingVisuals as optionsShowLeadingVisuals$1, sameOptionRows, isOptionsGridMobileViewport, needsOptionsGridMeasurement, measureOptionsGrid, optionEnterDelayMs, buildAttributionUrl, containScroll, attachScrollArrow, attachViewportFit, hasSkippablePill, isCalendarFormat, labelTraditionalAutocomplete, getFooterHint, AIAutocomplete, withoutTraditionalAutocomplete, dateSelectionFor, identifiedParamLabel, renderEditableContent, chipIdFromTap, keepCaretOnChip, getCursorOffset, extractPlainText, plainTextLength, setCursorOffset, ModeController, buildSubmitResult as buildSubmitResult$1, withSkippedParams as withSkippedParams$1, formatDate as formatDate$1, parseDate as parseDate$1, parseLooseDate as parseLooseDate$1, DATE_RANGE_META_END as DATE_RANGE_META_END$1, DATE_RANGE_META_START as DATE_RANGE_META_START$1, formatDateRange as formatDateRange$1, parseLooseDateRange as parseLooseDateRange$1, selectedRangeFor as selectedRangeFor$1, DEFAULT_OPTION_COUNT_UNIT as DEFAULT_OPTION_COUNT_UNIT$1, optionCountLabel as optionCountLabel$1, optionHasImage as optionHasImage$1, optionImageSrc as optionImageSrc$1, PRODUCT_PATH_PREFIX as PRODUCT_PATH_PREFIX$1, productFromMatchedItem as productFromMatchedItem$1, productsFromCustomFields as productsFromCustomFields$1 } from '@magicx-eng/ai-autocomplete-vanilla';
|
|
1
|
+
import { WEEKDAY_LABELS as WEEKDAY_LABELS$1, cellIso as cellIso$1, monthLabel as monthLabel$1, cellDay as cellDay$1, isoDate as isoDate$1, dateCellMarks as dateCellMarks$1, visibleDateRange as visibleDateRange$1, SMART_SUGGESTION_SPARKLE_SVG, isSmartSuggestion, isTraditionalAutocompleteSuggestion, uiStringsFor, productInitial, productImageSources as productImageSources$1, productPhotoFill, attachProductRowWheel, optionsGridTemplateColumns, highlightParts, optionLabel as optionLabel$1, optionImageSources as optionImageSources$1, formatOptionCount as formatOptionCount$1, sanitizeOptionIconSvg as sanitizeOptionIconSvg$1, planOptionsGrid, optionsShowLeadingVisuals as optionsShowLeadingVisuals$1, sameOptionRows, isOptionsGridMobileViewport, needsOptionsGridMeasurement, measureOptionsGrid, optionEnterDelayMs, buildAttributionUrl, containScroll, attachScrollArrow, attachViewportFit, hasSkippablePill, isCalendarFormat, labelTraditionalAutocomplete, getFooterHint, AIAutocomplete, withoutTraditionalAutocomplete, dateSelectionFor, identifiedParamLabel, renderEditableContent, chipIdFromTap, keepCaretOnChip, getCursorOffset, extractPlainText, plainTextLength, setCursorOffset, ModeController, buildSubmitResult as buildSubmitResult$1, withSkippedParams as withSkippedParams$1, formatDate as formatDate$1, parseDate as parseDate$1, parseLooseDate as parseLooseDate$1, DATE_RANGE_META_END as DATE_RANGE_META_END$1, DATE_RANGE_META_START as DATE_RANGE_META_START$1, formatDateRange as formatDateRange$1, parseLooseDateRange as parseLooseDateRange$1, selectedRangeFor as selectedRangeFor$1, DEFAULT_OPTION_COUNT_UNIT as DEFAULT_OPTION_COUNT_UNIT$1, optionCountLabel as optionCountLabel$1, optionHasImage as optionHasImage$1, optionImageSrc as optionImageSrc$1, PRODUCT_PATH_PREFIX as PRODUCT_PATH_PREFIX$1, productFromMatchedItem as productFromMatchedItem$1, productsFromCustomFields as productsFromCustomFields$1 } from '@magicx-eng/ai-autocomplete-vanilla';
|
|
2
2
|
import * as i1 from '@angular/common';
|
|
3
3
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, inject,
|
|
5
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, inject, ChangeDetectorRef, ViewChild, HostListener, ElementRef, NgZone, Renderer2, Directive, PLATFORM_ID, forwardRef, NgModule } from '@angular/core';
|
|
6
6
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import { BehaviorSubject, combineLatest, map as map$1, distinctUntilChanged, shareReplay, Subject, takeUntil } from 'rxjs';
|
|
8
8
|
import { map } from 'rxjs/operators';
|
|
9
9
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
10
|
+
import { __rest } from 'tslib';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* The dropdown's calendar body, rendered in place of the options grid when the
|
|
@@ -288,6 +289,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
288
289
|
type: Output
|
|
289
290
|
}] } });
|
|
290
291
|
|
|
292
|
+
/** How long the cart button shows its check after an add resolves — vanilla's `CART_ADDED_MS`. */
|
|
293
|
+
const CART_ADDED_MS = 1500;
|
|
291
294
|
/**
|
|
292
295
|
* Internal product strip rendered below the dropdown's options grid. Mirrors
|
|
293
296
|
* `packages/react/src/components/ProductStrip.tsx` and the vanilla core's
|
|
@@ -324,6 +327,11 @@ class ProductStripComponent {
|
|
|
324
327
|
this.imageFallback = "image";
|
|
325
328
|
/** The words of the widget language. Default: English. */
|
|
326
329
|
this.strings = uiStringsFor();
|
|
330
|
+
/**
|
|
331
|
+
* Set when the integration adds to cart: each card that is not sold out
|
|
332
|
+
* draws a cart button, whose press calls this instead of emitting `select`.
|
|
333
|
+
*/
|
|
334
|
+
this.addToCart = null;
|
|
327
335
|
this.initial = productInitial;
|
|
328
336
|
/**
|
|
329
337
|
* Per product id, the `src`s that failed to load: a card moves on to the
|
|
@@ -333,6 +341,8 @@ class ProductStripComponent {
|
|
|
333
341
|
this.failedImages = new Map();
|
|
334
342
|
/** Per product id, the `src` that last finished loading; its tile drops the fill. */
|
|
335
343
|
this.loadedImages = new Map();
|
|
344
|
+
/** Per product id, how much of the tile the loaded photo fills (productPhotoFill). */
|
|
345
|
+
this.photoFills = new Map();
|
|
336
346
|
this.select = new EventEmitter();
|
|
337
347
|
/**
|
|
338
348
|
* Focus moved into / out of the strip. The panel closes on blur by default
|
|
@@ -342,6 +352,12 @@ class ProductStripComponent {
|
|
|
342
352
|
*/
|
|
343
353
|
this.focusChange = new EventEmitter();
|
|
344
354
|
this.detachWheel = null;
|
|
355
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
356
|
+
/** Per product id, the cart button's state while it isn't at rest. */
|
|
357
|
+
this.cartStates = new Map();
|
|
358
|
+
/** Per product id, the timer that puts an "added" button back at rest. */
|
|
359
|
+
this.cartTimers = new Map();
|
|
360
|
+
this.destroyed = false;
|
|
345
361
|
this.trackByProduct = (_, product) => product.id;
|
|
346
362
|
}
|
|
347
363
|
ngOnChanges() {
|
|
@@ -363,14 +379,36 @@ class ProductStripComponent {
|
|
|
363
379
|
const src = this.imageSource(product);
|
|
364
380
|
return src !== null && this.loadedImages.get(product.id) === src;
|
|
365
381
|
}
|
|
366
|
-
onImageLoad(product, src) {
|
|
382
|
+
onImageLoad(product, src, event) {
|
|
367
383
|
this.loadedImages.set(product.id, src);
|
|
384
|
+
const img = event === null || event === void 0 ? void 0 : event.target;
|
|
385
|
+
const fill = img ? productPhotoFill(img.naturalWidth, img.naturalHeight) : null;
|
|
386
|
+
if (fill)
|
|
387
|
+
this.photoFills.set(product.id, fill);
|
|
388
|
+
else
|
|
389
|
+
this.photoFills.delete(product.id);
|
|
368
390
|
}
|
|
369
391
|
onImageError(product) {
|
|
370
392
|
var _a;
|
|
371
393
|
const src = this.imageSource(product);
|
|
372
394
|
if (src)
|
|
373
395
|
this.failedImages.set(product.id, [...((_a = this.failedImages.get(product.id)) !== null && _a !== void 0 ? _a : []), src]);
|
|
396
|
+
// The next source, or the placeholder, fills the tile until it loads.
|
|
397
|
+
this.photoFills.delete(product.id);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* The card's photo-fill custom properties, which put the cart button inside
|
|
401
|
+
* the photo's own corner. Null until the photo loads.
|
|
402
|
+
*/
|
|
403
|
+
photoFillStyle(product) {
|
|
404
|
+
const fill = this.photoFills.get(product.id);
|
|
405
|
+
// Only the photo on screen counts: a changed or removed image drops it.
|
|
406
|
+
if (!fill || !this.imageLoaded(product))
|
|
407
|
+
return null;
|
|
408
|
+
return {
|
|
409
|
+
"--aia-product-photo-fill-x": String(fill.x),
|
|
410
|
+
"--aia-product-photo-fill-y": String(fill.y),
|
|
411
|
+
};
|
|
374
412
|
}
|
|
375
413
|
/**
|
|
376
414
|
* A mouse wheel over the row scrolls it sideways. The row sits inside the
|
|
@@ -384,8 +422,61 @@ class ProductStripComponent {
|
|
|
384
422
|
}
|
|
385
423
|
ngOnDestroy() {
|
|
386
424
|
var _a;
|
|
425
|
+
this.destroyed = true;
|
|
387
426
|
(_a = this.detachWheel) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
388
427
|
this.detachWheel = null;
|
|
428
|
+
for (const timer of this.cartTimers.values())
|
|
429
|
+
clearTimeout(timer);
|
|
430
|
+
this.cartTimers.clear();
|
|
431
|
+
}
|
|
432
|
+
/** A sold-out product can't be added, so its card has no button at all. */
|
|
433
|
+
hasCart(product) {
|
|
434
|
+
return this.addToCart !== null && product.available !== false;
|
|
435
|
+
}
|
|
436
|
+
cartState(product) {
|
|
437
|
+
var _a;
|
|
438
|
+
return (_a = this.cartStates.get(product.id)) !== null && _a !== void 0 ? _a : null;
|
|
439
|
+
}
|
|
440
|
+
onCartKeyDown(event, product) {
|
|
441
|
+
// Keys never reach the card, whose own Enter / Space would select it.
|
|
442
|
+
if (event.key !== "Enter" && event.key !== " ")
|
|
443
|
+
return;
|
|
444
|
+
this.onCartPress(event, product);
|
|
445
|
+
}
|
|
446
|
+
/** Mirrors vanilla's `buildCartButton` press: adding → added → rest, or rest on a rejection. */
|
|
447
|
+
onCartPress(event, product) {
|
|
448
|
+
event.preventDefault();
|
|
449
|
+
event.stopPropagation();
|
|
450
|
+
const handler = this.addToCart;
|
|
451
|
+
if (!handler || this.cartStates.get(product.id) === "adding")
|
|
452
|
+
return;
|
|
453
|
+
const id = product.id;
|
|
454
|
+
clearTimeout(this.cartTimers.get(id));
|
|
455
|
+
this.cartTimers.delete(id);
|
|
456
|
+
this.setCartState(id, "adding");
|
|
457
|
+
let pending;
|
|
458
|
+
try {
|
|
459
|
+
pending = Promise.resolve(handler(product));
|
|
460
|
+
}
|
|
461
|
+
catch (error) {
|
|
462
|
+
pending = Promise.reject(error);
|
|
463
|
+
}
|
|
464
|
+
pending.then(() => {
|
|
465
|
+
this.setCartState(id, "added");
|
|
466
|
+
this.cartTimers.set(id, setTimeout(() => {
|
|
467
|
+
this.cartTimers.delete(id);
|
|
468
|
+
this.setCartState(id, null);
|
|
469
|
+
}, CART_ADDED_MS));
|
|
470
|
+
}, () => this.setCartState(id, null));
|
|
471
|
+
}
|
|
472
|
+
setCartState(id, state) {
|
|
473
|
+
if (this.destroyed)
|
|
474
|
+
return;
|
|
475
|
+
if (state)
|
|
476
|
+
this.cartStates.set(id, state);
|
|
477
|
+
else
|
|
478
|
+
this.cartStates.delete(id);
|
|
479
|
+
this.cdr.markForCheck();
|
|
389
480
|
}
|
|
390
481
|
get labelId() {
|
|
391
482
|
return `${this.listboxId}-products-label`;
|
|
@@ -420,10 +511,10 @@ class ProductStripComponent {
|
|
|
420
511
|
}
|
|
421
512
|
}
|
|
422
513
|
ProductStripComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ProductStripComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
423
|
-
ProductStripComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ProductStripComponent, isStandalone: true, selector: "aia-product-strip", inputs: { products: "products", listboxId: "listboxId", focusable: "focusable", layout: "layout", imageFallback: "imageFallback", strings: "strings" }, outputs: { select: "select", focusChange: "focusChange" }, viewQueries: [{ propertyName: "row", first: true, predicate: ["row"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- `group` is the one role a listbox accepts around a set of options, so the\n strip stays inside the listbox without breaking its content model. -->\n<section\n *ngIf=\"products.length > 0\"\n class=\"aia-products\"\n data-aia-products=\"\"\n [attr.data-aia-products-layout]=\"layout\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <!-- data-aia-products-label: the scroll arrow centres itself on this row. -->\n <div class=\"aia-products-label\" [id]=\"labelId\" data-aia-products-label=\"\">{{ strings.products }}</div>\n\n <!-- #row: the component binds wheel-to-sideways scrolling on it. -->\n <div #row class=\"aia-products-row\" data-aia-products-row=\"\">\n <!-- A real <a href> rather than a <div>: it keeps the browser's own link\n affordances \u2014 cmd/ctrl-click for a new tab, middle-click, right-click \u2192\n \"copy link address\". role=\"option\" overrides how assistive tech\n announces it, which is correct inside a listbox; the deliberate trade\n is that AT no longer calls it a link. An attribute binding, so a\n product without a url gets no href at all rather than \"null\". -->\n <a\n *ngFor=\"let product of products; let i = index; trackBy: trackByProduct\"\n [id]=\"cardId(i)\"\n class=\"aia-product\"\n data-aia-product=\"\"\n [attr.data-aia-product-sold-out]=\"product.available === false ? '' : null\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [attr.href]=\"product.url ?? null\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n (click)=\"onClick($event, product)\"\n (keydown)=\"onKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <span\n class=\"aia-product-media\"\n aria-hidden=\"true\"\n [attr.data-aia-product-placeholder]=\"!imageSource(product) && imageFallback === 'image' ? '' : null\"\n [attr.data-aia-product-initial]=\"!imageSource(product) && imageFallback === 'initial' ? '' : null\"\n [attr.data-aia-image-loaded]=\"imageLoaded(product) ? '' : null\"\n >\n <!-- alt=\"\" on purpose: the title is already the card's accessible\n name, and repeating it would have a screen reader read it twice. -->\n <img\n *ngIf=\"imageSource(product) as src\"\n class=\"aia-product-image\"\n [src]=\"src\"\n (load)=\"onImageLoad(product, src)\"\n (error)=\"onImageError(product)\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n <ng-container *ngIf=\"!imageSource(product) && imageFallback === 'initial'\">{{ initial(product.title) }}</ng-container>\n </span>\n\n <!-- Every field but the title is optional, so absent ones render no\n element at all \u2014 the column gap can't leave a hole for a box that\n isn't there. -->\n <span class=\"aia-product-body\">\n <span *ngIf=\"product.vendor\" class=\"aia-product-vendor\">{{ product.vendor }}</span>\n <span class=\"aia-product-title\">{{ product.title }}</span>\n <span *ngIf=\"product.price\" class=\"aia-product-price\">{{ product.price }}</span>\n <!-- In the text column rather than the aria-hidden media tile, so the\n card's accessible name says it; the stylesheet lifts it over the\n image. -->\n <span *ngIf=\"product.available === false\" class=\"aia-product-badge\">{{ strings.soldOut }}</span>\n </span>\n </a>\n </div>\n</section>\n", styles: [".aia-products{display:flex;flex-direction:column;gap:6px;padding:0 10px;min-width:0}.aia-products-label{font-family:inherit;font-size:var(--aia-products-label-font-size, 11px);font-weight:500;line-height:18px;letter-spacing:.02em;color:var( --aia-products-label-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) )}.aia-products-row{display:flex;gap:var(--aia-product-gap, 8px);min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;padding-bottom:2px;margin-inline:-6px;scrollbar-width:none;-ms-overflow-style:none}.aia-products-row::-webkit-scrollbar{display:none}.aia-product{flex:0 0 auto;display:flex;flex-direction:column;gap:6px;width:var(--aia-product-card-width, 116px);padding:6px;border-radius:10px;background:var(--aia-product-bg, transparent);color:var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));text-decoration:none;cursor:pointer;transition:background-color .15s ease;position:relative}.aia-product:hover{background:var(--aia-product-bg-active, var(--aia-option-bg, transparent))}.aia-product:focus-visible{outline:2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));outline-offset:-2px}.aia-product-media{display:block;position:relative;width:100%;aspect-ratio:1 / 1;border-radius:8px;overflow:hidden;background:var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, .25)))}.aia-product-media[data-aia-image-loaded]{background:transparent}.aia-product-image{display:block;width:auto;max-width:100%;height:100%;margin:0 auto;border-radius:var(--aia-product-image-radius, 8px);object-fit:contain}.aia-product-media:where([data-aia-product-initial]){display:flex;align-items:center;justify-content:center;color:var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));font-size:24px;font-weight:600;line-height:1}.aia-product-media[data-aia-product-placeholder]:after{content:\"\";position:absolute;inset:22%;background:var( --aia-product-placeholder-image, url(\"data:image/svg+xml,%3Csvg viewBox='0 -0.5 32 32' fill-rule='evenodd' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='matrix(1,0,0,1,-384,-144)'%3E%3Cg transform='matrix(0.875,0,0,0.875,90.25,19.125)'%3E%3Cpath d='M340.924,147.74C341.224,146.789 342.107,146.143 343.104,146.143C347.705,146.143 360.491,146.143 364.985,146.143C365.965,146.143 366.836,146.768 367.15,147.697C368.119,150.386 370,155.73 370,157C370,159.208 368.208,161 366,161C363.792,161 362,159.208 362,157C362,159.208 360.208,161 358,161C355.792,161 354,159.208 354,157C354,159.208 352.208,161 350,161C347.792,161 346,159.208 346,157C346,159.208 344.208,161 342,161C340.53,161 339.244,160.205 338.549,159.022C338.057,158.185 337.944,157.179 338.236,156.254C338.787,154.507 340.172,150.121 340.924,147.74Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1.32454,48,-56.1457)'%3E%3Cpath d='M341.026,160.675C341.026,160.675 341.01,168.196 341.003,171.488C341.002,171.889 341.213,172.273 341.588,172.557C341.963,172.841 342.472,173 343.003,173C347.188,173 356.817,173 361,173C361.53,173 362.039,172.841 362.414,172.558C362.789,172.275 363,171.891 363,171.49C363,168.2 363,160.675 363,160.675' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1,48,0)'%3E%3Cpath d='M355,168C355,166.895 354.105,166 353,166C352.356,166 351.644,166 351,166C349.895,166 349,166.895 349,168C349,170.069 349,173 349,173L355,173L355,168Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1.11111,0,0,1.11111,-47.2678,-87.5361)'%3E%3Ccircle cx='411.5' cy='213.5' r='4.5' fill='%2390e0ef'%3E%3C/circle%3E%3C/g%3E%3Cpath d='M405.529,146C406.628,144.773 408.225,144 410,144C413.311,144 416,146.689 416,150C416,151.549 415.412,152.962 414.446,154.027C414.775,155.15 415,156.076 415,156.5C415,158.459 413.746,160.127 411.998,160.744L411.998,171C411.998,171.796 411.682,172.559 411.119,173.121C410.557,173.684 409.794,174 408.998,174L391.002,174C390.205,174 389.441,173.683 388.879,173.119C388.316,172.555 388,171.79 388.002,170.994L388.024,160.752C387.007,160.399 386.155,159.691 385.618,158.776L385.618,158.776C385.044,157.799 384.912,156.626 385.253,155.546L387.605,148.097C387.999,146.849 389.157,146 390.466,146L405.529,146ZM409.998,160.972C408.79,160.838 407.726,160.225 407,159.327C406.175,160.347 404.913,161 403.5,161C402.087,161 400.825,160.347 400,159.327C399.175,160.347 397.913,161 396.5,161C395.087,161 393.825,160.347 393,159.327C392.278,160.219 391.222,160.831 390.023,160.97L390.002,170.998C390.002,171.263 390.107,171.518 390.294,171.706C390.482,171.894 390.736,172 391.002,172L396,172L396,168C396,166.343 397.343,165 399,165L401,165C402.657,165 404,166.343 404,168L404,172L408.998,172C409.263,172 409.517,171.895 409.705,171.707C409.893,171.52 409.998,171.265 409.998,171L409.998,160.972ZM402,172L398,172L398,168C398,167.448 398.448,167 399,167C399,167 401,167 401,167C401.552,167 402,167.448 402,168L402,172ZM404.342,148L390.466,148C390.03,148 389.644,148.283 389.512,148.699L387.16,156.148C386.99,156.688 387.056,157.275 387.342,157.763C387.777,158.503 388.581,159 389.5,159C390.88,159 392,157.88 392,156.5C392,155.003 394,155.003 394,156.5C394,157.88 395.12,159 396.5,159C397.88,159 399,157.88 399,156.5C399,155.004 401,155.004 401,156.5C401,157.88 402.12,159 403.5,159C404.88,159 406,157.88 406,156.5C406,154.986 408,154.986 408,156.5C408,157.88 409.12,159 410.5,159C411.88,159 413,157.88 413,156.5C413,156.259 412.917,155.843 412.779,155.318C411.948,155.753 411.003,156 410,156C406.689,156 404,153.311 404,150C404,149.299 404.12,148.626 404.342,148ZM410,146C412.208,146 414,147.792 414,150C414,152.208 412.208,154 410,154C407.792,154 406,152.208 406,150C406,147.792 407.792,146 410,146ZM407.543,151.207L408.546,152.21C408.733,152.397 408.988,152.503 409.253,152.503C409.519,152.503 409.773,152.397 409.961,152.209L412.458,149.706C412.848,149.316 412.847,148.682 412.456,148.292C412.066,147.902 411.432,147.903 411.042,148.294L409.252,150.088C409.252,150.088 408.957,149.793 408.957,149.793C408.567,149.403 407.933,149.403 407.543,149.793C407.153,150.183 407.153,150.817 407.543,151.207Z' fill='%231990a7'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\") ) center / contain no-repeat}.aia-product-body{display:flex;flex-direction:column;gap:2px;min-width:0}.aia-product-vendor{font-family:inherit;font-size:var(--aia-product-vendor-font-size, 10px);line-height:14px;color:var( --aia-product-vendor-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );opacity:.8;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.aia-product-title{font-family:inherit;font-size:var(--aia-product-title-font-size, 12px);font-weight:400;line-height:16px;color:var( --aia-product-title-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.aia-product-price{font-family:inherit;font-size:var(--aia-product-price-font-size, 11px);font-weight:500;line-height:15px;color:var( --aia-product-price-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}.aia-product-badge{position:absolute;top:var(--aia-product-badge-inset, 12px);left:var(--aia-product-badge-inset, 12px);padding:3px 6px;border-radius:4px;background:var(--aia-product-badge-bg, rgba(255, 255, 255, .94));color:var(--aia-product-badge-color, #1f2328);box-shadow:0 0 0 1px #00000014,0 1px 2px #0000002e;font-family:inherit;font-size:var(--aia-product-badge-font-size, 9px);font-weight:600;line-height:1;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;pointer-events:none}.aia-product[data-aia-product-sold-out] .aia-product-image{filter:grayscale(.55)}.aia-products[data-aia-products-layout=list] .aia-products-row{flex-direction:column;gap:var(--aia-product-list-gap, 2px);max-height:var(--aia-product-list-max-height, 320px);overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.aia-products[data-aia-products-layout=list] .aia-product{flex-direction:row;align-items:center;gap:10px;width:auto;padding:6px 8px}.aia-products[data-aia-products-layout=list] .aia-product-media{flex:0 0 auto;width:var(--aia-product-list-media-size, 44px);height:var(--aia-product-list-media-size, 44px)}.aia-products[data-aia-products-layout=list] .aia-product-body{flex:1 1 auto}.aia-products[data-aia-products-layout=list] .aia-product-badge{top:calc(50% + var(--aia-product-list-media-size, 44px) / 2);left:8px;width:var(--aia-product-list-media-size, 44px);transform:translateY(-100%);padding:2px 0;border-radius:0 0 8px 8px;background:var(--aia-product-badge-list-bg, rgba(17, 17, 17, .72));color:var(--aia-product-badge-list-color, #fff);box-shadow:none;font-size:var(--aia-product-badge-list-font-size, 7px);letter-spacing:.02em;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
514
|
+
ProductStripComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ProductStripComponent, isStandalone: true, selector: "aia-product-strip", inputs: { products: "products", listboxId: "listboxId", focusable: "focusable", layout: "layout", imageFallback: "imageFallback", strings: "strings", addToCart: "addToCart" }, outputs: { select: "select", focusChange: "focusChange" }, viewQueries: [{ propertyName: "row", first: true, predicate: ["row"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- `group` is the one role a listbox accepts around a set of options, so the\n strip stays inside the listbox without breaking its content model. -->\n<section\n *ngIf=\"products.length > 0\"\n class=\"aia-products\"\n data-aia-products=\"\"\n [attr.data-aia-products-layout]=\"layout\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <!-- data-aia-products-label: the scroll arrow centres itself on this row. -->\n <div class=\"aia-products-label\" [id]=\"labelId\" data-aia-products-label=\"\">{{ strings.products }}</div>\n\n <!-- #row: the component binds wheel-to-sideways scrolling on it. -->\n <div #row class=\"aia-products-row\" data-aia-products-row=\"\">\n <!-- A real <a href> rather than a <div>: it keeps the browser's own link\n affordances \u2014 cmd/ctrl-click for a new tab, middle-click, right-click \u2192\n \"copy link address\". role=\"option\" overrides how assistive tech\n announces it, which is correct inside a listbox; the deliberate trade\n is that AT no longer calls it a link. An attribute binding, so a\n product without a url gets no href at all rather than \"null\". -->\n <a\n *ngFor=\"let product of products; let i = index; trackBy: trackByProduct\"\n [id]=\"cardId(i)\"\n class=\"aia-product\"\n data-aia-product=\"\"\n [attr.data-aia-product-sold-out]=\"product.available === false ? '' : null\"\n [attr.data-aia-product-has-cart]=\"hasCart(product) ? '' : null\"\n [style]=\"photoFillStyle(product)\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [attr.href]=\"product.url ?? null\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n (click)=\"onClick($event, product)\"\n (keydown)=\"onKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <span\n class=\"aia-product-media\"\n aria-hidden=\"true\"\n [attr.data-aia-product-placeholder]=\"!imageSource(product) && imageFallback === 'image' ? '' : null\"\n [attr.data-aia-product-initial]=\"!imageSource(product) && imageFallback === 'initial' ? '' : null\"\n [attr.data-aia-image-loaded]=\"imageLoaded(product) ? '' : null\"\n >\n <!-- alt=\"\" on purpose: the title is already the card's accessible\n name, and repeating it would have a screen reader read it twice. -->\n <img\n *ngIf=\"imageSource(product) as src\"\n class=\"aia-product-image\"\n [src]=\"src\"\n (load)=\"onImageLoad(product, src, $event)\"\n (error)=\"onImageError(product)\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n <ng-container *ngIf=\"!imageSource(product) && imageFallback === 'initial'\">{{ initial(product.title) }}</ng-container>\n </span>\n\n <!-- Every field but the title is optional, so absent ones render no\n element at all \u2014 the column gap can't leave a hole for a box that\n isn't there. -->\n <span class=\"aia-product-body\">\n <span *ngIf=\"product.vendor\" class=\"aia-product-vendor\">{{ product.vendor }}</span>\n <span class=\"aia-product-title\">{{ product.title }}</span>\n <span *ngIf=\"product.price\" class=\"aia-product-price\">{{ product.price }}</span>\n <!-- In the text column rather than the aria-hidden media tile, so the\n card's accessible name says it; the stylesheet lifts it over the\n image. -->\n <span *ngIf=\"product.available === false\" class=\"aia-product-badge\">{{ strings.soldOut }}</span>\n </span>\n\n <!-- The add-to-cart button: a child of the card rather than of the\n aria-hidden media tile; the stylesheet lifts it over the tile's\n bottom right corner. A role=\"button\" span, not a <button>:\n interactive content inside an <a> is invalid HTML. Its press never\n reaches the card, so it never selects. Sold-out cards have none. -->\n <span\n *ngIf=\"hasCart(product)\"\n class=\"aia-product-cart\"\n data-aia-product-cart=\"\"\n role=\"button\"\n [attr.aria-label]=\"strings.addToCart + ': ' + product.title\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n [attr.data-aia-cart-state]=\"cartState(product)\"\n [attr.aria-busy]=\"cartState(product) === 'adding' ? 'true' : null\"\n (click)=\"onCartPress($event, product)\"\n (keydown)=\"onCartKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path class=\"aia-product-cart-glyph\" d=\"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6\" />\n <path class=\"aia-product-cart-glyph\" d=\"M13.5 6.5v-4M11.5 4.5h4\" />\n <path class=\"aia-product-cart-check\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"9\" cy=\"20\" r=\"1.3\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"17.5\" cy=\"20\" r=\"1.3\" />\n </svg>\n </span>\n </a>\n </div>\n</section>\n", styles: [".aia-products{display:flex;flex-direction:column;gap:6px;padding:0 10px;min-width:0}.aia-products-label{font-family:inherit;font-size:var(--aia-products-label-font-size, 11px);font-weight:500;line-height:18px;letter-spacing:.02em;color:var( --aia-products-label-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) )}.aia-products-row{display:flex;gap:var(--aia-product-gap, 8px);min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;padding-bottom:2px;margin-inline:-6px;scrollbar-width:none;-ms-overflow-style:none}.aia-products-row::-webkit-scrollbar{display:none}.aia-product{flex:0 0 auto;display:flex;flex-direction:column;gap:6px;width:var(--aia-product-card-width, 116px);padding:6px;border-radius:10px;background:var(--aia-product-bg, transparent);color:var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));text-decoration:none;cursor:pointer;transition:background-color .15s ease;position:relative}.aia-product:hover{background:var(--aia-product-bg-active, var(--aia-option-bg, transparent))}.aia-product:focus-visible{outline:2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));outline-offset:-2px}.aia-product-media{display:block;position:relative;width:100%;aspect-ratio:1 / 1;border-radius:8px;overflow:hidden;background:var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, .25)))}.aia-product-media[data-aia-image-loaded]{background:transparent}.aia-product-image{display:block;width:auto;max-width:100%;height:100%;margin:0 auto;border-radius:var(--aia-product-image-radius, 8px);object-fit:contain}.aia-product-media:where([data-aia-product-initial]){display:flex;align-items:center;justify-content:center;color:var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));font-size:24px;font-weight:600;line-height:1}.aia-product-media[data-aia-product-placeholder]:after{content:\"\";position:absolute;inset:22%;background:var( --aia-product-placeholder-image, url(\"data:image/svg+xml,%3Csvg viewBox='0 -0.5 32 32' fill-rule='evenodd' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='matrix(1,0,0,1,-384,-144)'%3E%3Cg transform='matrix(0.875,0,0,0.875,90.25,19.125)'%3E%3Cpath d='M340.924,147.74C341.224,146.789 342.107,146.143 343.104,146.143C347.705,146.143 360.491,146.143 364.985,146.143C365.965,146.143 366.836,146.768 367.15,147.697C368.119,150.386 370,155.73 370,157C370,159.208 368.208,161 366,161C363.792,161 362,159.208 362,157C362,159.208 360.208,161 358,161C355.792,161 354,159.208 354,157C354,159.208 352.208,161 350,161C347.792,161 346,159.208 346,157C346,159.208 344.208,161 342,161C340.53,161 339.244,160.205 338.549,159.022C338.057,158.185 337.944,157.179 338.236,156.254C338.787,154.507 340.172,150.121 340.924,147.74Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1.32454,48,-56.1457)'%3E%3Cpath d='M341.026,160.675C341.026,160.675 341.01,168.196 341.003,171.488C341.002,171.889 341.213,172.273 341.588,172.557C341.963,172.841 342.472,173 343.003,173C347.188,173 356.817,173 361,173C361.53,173 362.039,172.841 362.414,172.558C362.789,172.275 363,171.891 363,171.49C363,168.2 363,160.675 363,160.675' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1,48,0)'%3E%3Cpath d='M355,168C355,166.895 354.105,166 353,166C352.356,166 351.644,166 351,166C349.895,166 349,166.895 349,168C349,170.069 349,173 349,173L355,173L355,168Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1.11111,0,0,1.11111,-47.2678,-87.5361)'%3E%3Ccircle cx='411.5' cy='213.5' r='4.5' fill='%2390e0ef'%3E%3C/circle%3E%3C/g%3E%3Cpath d='M405.529,146C406.628,144.773 408.225,144 410,144C413.311,144 416,146.689 416,150C416,151.549 415.412,152.962 414.446,154.027C414.775,155.15 415,156.076 415,156.5C415,158.459 413.746,160.127 411.998,160.744L411.998,171C411.998,171.796 411.682,172.559 411.119,173.121C410.557,173.684 409.794,174 408.998,174L391.002,174C390.205,174 389.441,173.683 388.879,173.119C388.316,172.555 388,171.79 388.002,170.994L388.024,160.752C387.007,160.399 386.155,159.691 385.618,158.776L385.618,158.776C385.044,157.799 384.912,156.626 385.253,155.546L387.605,148.097C387.999,146.849 389.157,146 390.466,146L405.529,146ZM409.998,160.972C408.79,160.838 407.726,160.225 407,159.327C406.175,160.347 404.913,161 403.5,161C402.087,161 400.825,160.347 400,159.327C399.175,160.347 397.913,161 396.5,161C395.087,161 393.825,160.347 393,159.327C392.278,160.219 391.222,160.831 390.023,160.97L390.002,170.998C390.002,171.263 390.107,171.518 390.294,171.706C390.482,171.894 390.736,172 391.002,172L396,172L396,168C396,166.343 397.343,165 399,165L401,165C402.657,165 404,166.343 404,168L404,172L408.998,172C409.263,172 409.517,171.895 409.705,171.707C409.893,171.52 409.998,171.265 409.998,171L409.998,160.972ZM402,172L398,172L398,168C398,167.448 398.448,167 399,167C399,167 401,167 401,167C401.552,167 402,167.448 402,168L402,172ZM404.342,148L390.466,148C390.03,148 389.644,148.283 389.512,148.699L387.16,156.148C386.99,156.688 387.056,157.275 387.342,157.763C387.777,158.503 388.581,159 389.5,159C390.88,159 392,157.88 392,156.5C392,155.003 394,155.003 394,156.5C394,157.88 395.12,159 396.5,159C397.88,159 399,157.88 399,156.5C399,155.004 401,155.004 401,156.5C401,157.88 402.12,159 403.5,159C404.88,159 406,157.88 406,156.5C406,154.986 408,154.986 408,156.5C408,157.88 409.12,159 410.5,159C411.88,159 413,157.88 413,156.5C413,156.259 412.917,155.843 412.779,155.318C411.948,155.753 411.003,156 410,156C406.689,156 404,153.311 404,150C404,149.299 404.12,148.626 404.342,148ZM410,146C412.208,146 414,147.792 414,150C414,152.208 412.208,154 410,154C407.792,154 406,152.208 406,150C406,147.792 407.792,146 410,146ZM407.543,151.207L408.546,152.21C408.733,152.397 408.988,152.503 409.253,152.503C409.519,152.503 409.773,152.397 409.961,152.209L412.458,149.706C412.848,149.316 412.847,148.682 412.456,148.292C412.066,147.902 411.432,147.903 411.042,148.294L409.252,150.088C409.252,150.088 408.957,149.793 408.957,149.793C408.567,149.403 407.933,149.403 407.543,149.793C407.153,150.183 407.153,150.817 407.543,151.207Z' fill='%231990a7'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\") ) center / contain no-repeat}.aia-product-body{display:flex;flex-direction:column;gap:2px;min-width:0}.aia-product-vendor{font-family:inherit;font-size:var(--aia-product-vendor-font-size, 10px);line-height:14px;color:var( --aia-product-vendor-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );opacity:.8;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.aia-product-title{font-family:inherit;font-size:var(--aia-product-title-font-size, 12px);font-weight:400;line-height:16px;color:var( --aia-product-title-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.aia-product-price{font-family:inherit;font-size:var(--aia-product-price-font-size, 11px);font-weight:500;line-height:15px;color:var( --aia-product-price-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}.aia-product-badge{position:absolute;top:var(--aia-product-badge-inset, 12px);left:var(--aia-product-badge-inset, 12px);padding:3px 6px;border-radius:4px;background:var(--aia-product-badge-bg, rgba(255, 255, 255, .94));color:var(--aia-product-badge-color, #1f2328);box-shadow:0 0 0 1px #00000014,0 1px 2px #0000002e;font-family:inherit;font-size:var(--aia-product-badge-font-size, 9px);font-weight:600;line-height:1;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;pointer-events:none}.aia-product-cart{position:absolute;top:calc(var(--aia-product-card-width, 116px) - 12px - var(--aia-product-cart-size, 28px) - (var(--aia-product-card-width, 116px) - 12px) * (1 - var(--aia-product-photo-fill-y, 1)) / 2);right:calc(12px + (var(--aia-product-card-width, 116px) - 12px) * (1 - var(--aia-product-photo-fill-x, 1)) / 2);display:flex;align-items:center;justify-content:center;width:var(--aia-product-cart-size, 28px);height:var(--aia-product-cart-size, 28px);border-radius:999px;background:var(--aia-product-cart-bg, rgba(255, 255, 255, .94));color:var(--aia-product-cart-color, #1f2328);box-shadow:0 0 0 1px #00000014,0 1px 3px #00000038;cursor:pointer;transition:transform .15s ease,opacity .15s ease}.aia-product-cart:hover{transform:scale(1.08)}.aia-product-cart:focus-visible{outline:2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));outline-offset:2px}.aia-product-cart svg{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.aia-product-cart svg path{fill:none;stroke:currentColor}.aia-product-cart svg circle{fill:none;stroke:currentColor}.aia-product-cart-check{display:none}.aia-product-cart[data-aia-cart-state=adding]{opacity:.6;cursor:progress}.aia-product-cart[data-aia-cart-state=added] .aia-product-cart-glyph{display:none}.aia-product-cart[data-aia-cart-state=added] .aia-product-cart-check{display:inline}.aia-product[data-aia-product-sold-out] .aia-product-image{filter:grayscale(.55)}.aia-products[data-aia-products-layout=list] .aia-products-row{flex-direction:column;gap:var(--aia-product-list-gap, 2px);max-height:var(--aia-product-list-max-height, 320px);overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.aia-products[data-aia-products-layout=list] .aia-product{flex-direction:row;align-items:center;gap:10px;width:auto;padding:6px 8px}.aia-products[data-aia-products-layout=list] .aia-product-media{flex:0 0 auto;width:var(--aia-product-list-media-size, 44px);height:var(--aia-product-list-media-size, 44px)}.aia-products[data-aia-products-layout=list] .aia-product-body{flex:1 1 auto}.aia-products[data-aia-products-layout=list] .aia-product-badge{top:calc(50% + var(--aia-product-list-media-size, 44px) / 2);left:8px;width:var(--aia-product-list-media-size, 44px);transform:translateY(-100%);padding:2px 0;border-radius:0 0 8px 8px;background:var(--aia-product-badge-list-bg, rgba(17, 17, 17, .72));color:var(--aia-product-badge-list-color, #fff);box-shadow:none;font-size:var(--aia-product-badge-list-font-size, 7px);letter-spacing:.02em;text-align:center}.aia-products[data-aia-products-layout=list] .aia-product-cart{top:50%;right:8px;transform:translateY(-50%)}.aia-products[data-aia-products-layout=list] .aia-product-cart:hover{transform:translateY(-50%) scale(1.08)}.aia-products[data-aia-products-layout=list] .aia-product[data-aia-product-has-cart]{padding-right:calc(var(--aia-product-cart-size, 28px) + 16px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
424
515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ProductStripComponent, decorators: [{
|
|
425
516
|
type: Component,
|
|
426
|
-
args: [{ selector: "aia-product-strip", standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<!-- `group` is the one role a listbox accepts around a set of options, so the\n strip stays inside the listbox without breaking its content model. -->\n<section\n *ngIf=\"products.length > 0\"\n class=\"aia-products\"\n data-aia-products=\"\"\n [attr.data-aia-products-layout]=\"layout\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <!-- data-aia-products-label: the scroll arrow centres itself on this row. -->\n <div class=\"aia-products-label\" [id]=\"labelId\" data-aia-products-label=\"\">{{ strings.products }}</div>\n\n <!-- #row: the component binds wheel-to-sideways scrolling on it. -->\n <div #row class=\"aia-products-row\" data-aia-products-row=\"\">\n <!-- A real <a href> rather than a <div>: it keeps the browser's own link\n affordances \u2014 cmd/ctrl-click for a new tab, middle-click, right-click \u2192\n \"copy link address\". role=\"option\" overrides how assistive tech\n announces it, which is correct inside a listbox; the deliberate trade\n is that AT no longer calls it a link. An attribute binding, so a\n product without a url gets no href at all rather than \"null\". -->\n <a\n *ngFor=\"let product of products; let i = index; trackBy: trackByProduct\"\n [id]=\"cardId(i)\"\n class=\"aia-product\"\n data-aia-product=\"\"\n [attr.data-aia-product-sold-out]=\"product.available === false ? '' : null\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [attr.href]=\"product.url ?? null\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n (click)=\"onClick($event, product)\"\n (keydown)=\"onKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <span\n class=\"aia-product-media\"\n aria-hidden=\"true\"\n [attr.data-aia-product-placeholder]=\"!imageSource(product) && imageFallback === 'image' ? '' : null\"\n [attr.data-aia-product-initial]=\"!imageSource(product) && imageFallback === 'initial' ? '' : null\"\n [attr.data-aia-image-loaded]=\"imageLoaded(product) ? '' : null\"\n >\n <!-- alt=\"\" on purpose: the title is already the card's accessible\n name, and repeating it would have a screen reader read it twice. -->\n <img\n *ngIf=\"imageSource(product) as src\"\n class=\"aia-product-image\"\n [src]=\"src\"\n (load)=\"onImageLoad(product, src)\"\n (error)=\"onImageError(product)\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n <ng-container *ngIf=\"!imageSource(product) && imageFallback === 'initial'\">{{ initial(product.title) }}</ng-container>\n </span>\n\n <!-- Every field but the title is optional, so absent ones render no\n element at all \u2014 the column gap can't leave a hole for a box that\n isn't there. -->\n <span class=\"aia-product-body\">\n <span *ngIf=\"product.vendor\" class=\"aia-product-vendor\">{{ product.vendor }}</span>\n <span class=\"aia-product-title\">{{ product.title }}</span>\n <span *ngIf=\"product.price\" class=\"aia-product-price\">{{ product.price }}</span>\n <!-- In the text column rather than the aria-hidden media tile, so the\n card's accessible name says it; the stylesheet lifts it over the\n image. -->\n <span *ngIf=\"product.available === false\" class=\"aia-product-badge\">{{ strings.soldOut }}</span>\n </span>\n </a>\n </div>\n</section>\n", styles: [".aia-products{display:flex;flex-direction:column;gap:6px;padding:0 10px;min-width:0}.aia-products-label{font-family:inherit;font-size:var(--aia-products-label-font-size, 11px);font-weight:500;line-height:18px;letter-spacing:.02em;color:var( --aia-products-label-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) )}.aia-products-row{display:flex;gap:var(--aia-product-gap, 8px);min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;padding-bottom:2px;margin-inline:-6px;scrollbar-width:none;-ms-overflow-style:none}.aia-products-row::-webkit-scrollbar{display:none}.aia-product{flex:0 0 auto;display:flex;flex-direction:column;gap:6px;width:var(--aia-product-card-width, 116px);padding:6px;border-radius:10px;background:var(--aia-product-bg, transparent);color:var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));text-decoration:none;cursor:pointer;transition:background-color .15s ease;position:relative}.aia-product:hover{background:var(--aia-product-bg-active, var(--aia-option-bg, transparent))}.aia-product:focus-visible{outline:2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));outline-offset:-2px}.aia-product-media{display:block;position:relative;width:100%;aspect-ratio:1 / 1;border-radius:8px;overflow:hidden;background:var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, .25)))}.aia-product-media[data-aia-image-loaded]{background:transparent}.aia-product-image{display:block;width:auto;max-width:100%;height:100%;margin:0 auto;border-radius:var(--aia-product-image-radius, 8px);object-fit:contain}.aia-product-media:where([data-aia-product-initial]){display:flex;align-items:center;justify-content:center;color:var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));font-size:24px;font-weight:600;line-height:1}.aia-product-media[data-aia-product-placeholder]:after{content:\"\";position:absolute;inset:22%;background:var( --aia-product-placeholder-image, url(\"data:image/svg+xml,%3Csvg viewBox='0 -0.5 32 32' fill-rule='evenodd' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='matrix(1,0,0,1,-384,-144)'%3E%3Cg transform='matrix(0.875,0,0,0.875,90.25,19.125)'%3E%3Cpath d='M340.924,147.74C341.224,146.789 342.107,146.143 343.104,146.143C347.705,146.143 360.491,146.143 364.985,146.143C365.965,146.143 366.836,146.768 367.15,147.697C368.119,150.386 370,155.73 370,157C370,159.208 368.208,161 366,161C363.792,161 362,159.208 362,157C362,159.208 360.208,161 358,161C355.792,161 354,159.208 354,157C354,159.208 352.208,161 350,161C347.792,161 346,159.208 346,157C346,159.208 344.208,161 342,161C340.53,161 339.244,160.205 338.549,159.022C338.057,158.185 337.944,157.179 338.236,156.254C338.787,154.507 340.172,150.121 340.924,147.74Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1.32454,48,-56.1457)'%3E%3Cpath d='M341.026,160.675C341.026,160.675 341.01,168.196 341.003,171.488C341.002,171.889 341.213,172.273 341.588,172.557C341.963,172.841 342.472,173 343.003,173C347.188,173 356.817,173 361,173C361.53,173 362.039,172.841 362.414,172.558C362.789,172.275 363,171.891 363,171.49C363,168.2 363,160.675 363,160.675' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1,48,0)'%3E%3Cpath d='M355,168C355,166.895 354.105,166 353,166C352.356,166 351.644,166 351,166C349.895,166 349,166.895 349,168C349,170.069 349,173 349,173L355,173L355,168Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1.11111,0,0,1.11111,-47.2678,-87.5361)'%3E%3Ccircle cx='411.5' cy='213.5' r='4.5' fill='%2390e0ef'%3E%3C/circle%3E%3C/g%3E%3Cpath d='M405.529,146C406.628,144.773 408.225,144 410,144C413.311,144 416,146.689 416,150C416,151.549 415.412,152.962 414.446,154.027C414.775,155.15 415,156.076 415,156.5C415,158.459 413.746,160.127 411.998,160.744L411.998,171C411.998,171.796 411.682,172.559 411.119,173.121C410.557,173.684 409.794,174 408.998,174L391.002,174C390.205,174 389.441,173.683 388.879,173.119C388.316,172.555 388,171.79 388.002,170.994L388.024,160.752C387.007,160.399 386.155,159.691 385.618,158.776L385.618,158.776C385.044,157.799 384.912,156.626 385.253,155.546L387.605,148.097C387.999,146.849 389.157,146 390.466,146L405.529,146ZM409.998,160.972C408.79,160.838 407.726,160.225 407,159.327C406.175,160.347 404.913,161 403.5,161C402.087,161 400.825,160.347 400,159.327C399.175,160.347 397.913,161 396.5,161C395.087,161 393.825,160.347 393,159.327C392.278,160.219 391.222,160.831 390.023,160.97L390.002,170.998C390.002,171.263 390.107,171.518 390.294,171.706C390.482,171.894 390.736,172 391.002,172L396,172L396,168C396,166.343 397.343,165 399,165L401,165C402.657,165 404,166.343 404,168L404,172L408.998,172C409.263,172 409.517,171.895 409.705,171.707C409.893,171.52 409.998,171.265 409.998,171L409.998,160.972ZM402,172L398,172L398,168C398,167.448 398.448,167 399,167C399,167 401,167 401,167C401.552,167 402,167.448 402,168L402,172ZM404.342,148L390.466,148C390.03,148 389.644,148.283 389.512,148.699L387.16,156.148C386.99,156.688 387.056,157.275 387.342,157.763C387.777,158.503 388.581,159 389.5,159C390.88,159 392,157.88 392,156.5C392,155.003 394,155.003 394,156.5C394,157.88 395.12,159 396.5,159C397.88,159 399,157.88 399,156.5C399,155.004 401,155.004 401,156.5C401,157.88 402.12,159 403.5,159C404.88,159 406,157.88 406,156.5C406,154.986 408,154.986 408,156.5C408,157.88 409.12,159 410.5,159C411.88,159 413,157.88 413,156.5C413,156.259 412.917,155.843 412.779,155.318C411.948,155.753 411.003,156 410,156C406.689,156 404,153.311 404,150C404,149.299 404.12,148.626 404.342,148ZM410,146C412.208,146 414,147.792 414,150C414,152.208 412.208,154 410,154C407.792,154 406,152.208 406,150C406,147.792 407.792,146 410,146ZM407.543,151.207L408.546,152.21C408.733,152.397 408.988,152.503 409.253,152.503C409.519,152.503 409.773,152.397 409.961,152.209L412.458,149.706C412.848,149.316 412.847,148.682 412.456,148.292C412.066,147.902 411.432,147.903 411.042,148.294L409.252,150.088C409.252,150.088 408.957,149.793 408.957,149.793C408.567,149.403 407.933,149.403 407.543,149.793C407.153,150.183 407.153,150.817 407.543,151.207Z' fill='%231990a7'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\") ) center / contain no-repeat}.aia-product-body{display:flex;flex-direction:column;gap:2px;min-width:0}.aia-product-vendor{font-family:inherit;font-size:var(--aia-product-vendor-font-size, 10px);line-height:14px;color:var( --aia-product-vendor-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );opacity:.8;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.aia-product-title{font-family:inherit;font-size:var(--aia-product-title-font-size, 12px);font-weight:400;line-height:16px;color:var( --aia-product-title-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.aia-product-price{font-family:inherit;font-size:var(--aia-product-price-font-size, 11px);font-weight:500;line-height:15px;color:var( --aia-product-price-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}.aia-product-badge{position:absolute;top:var(--aia-product-badge-inset, 12px);left:var(--aia-product-badge-inset, 12px);padding:3px 6px;border-radius:4px;background:var(--aia-product-badge-bg, rgba(255, 255, 255, .94));color:var(--aia-product-badge-color, #1f2328);box-shadow:0 0 0 1px #00000014,0 1px 2px #0000002e;font-family:inherit;font-size:var(--aia-product-badge-font-size, 9px);font-weight:600;line-height:1;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;pointer-events:none}.aia-product[data-aia-product-sold-out] .aia-product-image{filter:grayscale(.55)}.aia-products[data-aia-products-layout=list] .aia-products-row{flex-direction:column;gap:var(--aia-product-list-gap, 2px);max-height:var(--aia-product-list-max-height, 320px);overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.aia-products[data-aia-products-layout=list] .aia-product{flex-direction:row;align-items:center;gap:10px;width:auto;padding:6px 8px}.aia-products[data-aia-products-layout=list] .aia-product-media{flex:0 0 auto;width:var(--aia-product-list-media-size, 44px);height:var(--aia-product-list-media-size, 44px)}.aia-products[data-aia-products-layout=list] .aia-product-body{flex:1 1 auto}.aia-products[data-aia-products-layout=list] .aia-product-badge{top:calc(50% + var(--aia-product-list-media-size, 44px) / 2);left:8px;width:var(--aia-product-list-media-size, 44px);transform:translateY(-100%);padding:2px 0;border-radius:0 0 8px 8px;background:var(--aia-product-badge-list-bg, rgba(17, 17, 17, .72));color:var(--aia-product-badge-list-color, #fff);box-shadow:none;font-size:var(--aia-product-badge-list-font-size, 7px);letter-spacing:.02em;text-align:center}\n"] }]
|
|
517
|
+
args: [{ selector: "aia-product-strip", standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<!-- `group` is the one role a listbox accepts around a set of options, so the\n strip stays inside the listbox without breaking its content model. -->\n<section\n *ngIf=\"products.length > 0\"\n class=\"aia-products\"\n data-aia-products=\"\"\n [attr.data-aia-products-layout]=\"layout\"\n role=\"group\"\n [attr.aria-labelledby]=\"labelId\"\n>\n <!-- data-aia-products-label: the scroll arrow centres itself on this row. -->\n <div class=\"aia-products-label\" [id]=\"labelId\" data-aia-products-label=\"\">{{ strings.products }}</div>\n\n <!-- #row: the component binds wheel-to-sideways scrolling on it. -->\n <div #row class=\"aia-products-row\" data-aia-products-row=\"\">\n <!-- A real <a href> rather than a <div>: it keeps the browser's own link\n affordances \u2014 cmd/ctrl-click for a new tab, middle-click, right-click \u2192\n \"copy link address\". role=\"option\" overrides how assistive tech\n announces it, which is correct inside a listbox; the deliberate trade\n is that AT no longer calls it a link. An attribute binding, so a\n product without a url gets no href at all rather than \"null\". -->\n <a\n *ngFor=\"let product of products; let i = index; trackBy: trackByProduct\"\n [id]=\"cardId(i)\"\n class=\"aia-product\"\n data-aia-product=\"\"\n [attr.data-aia-product-sold-out]=\"product.available === false ? '' : null\"\n [attr.data-aia-product-has-cart]=\"hasCart(product) ? '' : null\"\n [style]=\"photoFillStyle(product)\"\n role=\"option\"\n [attr.aria-selected]=\"false\"\n [attr.href]=\"product.url ?? null\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n (click)=\"onClick($event, product)\"\n (keydown)=\"onKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <span\n class=\"aia-product-media\"\n aria-hidden=\"true\"\n [attr.data-aia-product-placeholder]=\"!imageSource(product) && imageFallback === 'image' ? '' : null\"\n [attr.data-aia-product-initial]=\"!imageSource(product) && imageFallback === 'initial' ? '' : null\"\n [attr.data-aia-image-loaded]=\"imageLoaded(product) ? '' : null\"\n >\n <!-- alt=\"\" on purpose: the title is already the card's accessible\n name, and repeating it would have a screen reader read it twice. -->\n <img\n *ngIf=\"imageSource(product) as src\"\n class=\"aia-product-image\"\n [src]=\"src\"\n (load)=\"onImageLoad(product, src, $event)\"\n (error)=\"onImageError(product)\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n <ng-container *ngIf=\"!imageSource(product) && imageFallback === 'initial'\">{{ initial(product.title) }}</ng-container>\n </span>\n\n <!-- Every field but the title is optional, so absent ones render no\n element at all \u2014 the column gap can't leave a hole for a box that\n isn't there. -->\n <span class=\"aia-product-body\">\n <span *ngIf=\"product.vendor\" class=\"aia-product-vendor\">{{ product.vendor }}</span>\n <span class=\"aia-product-title\">{{ product.title }}</span>\n <span *ngIf=\"product.price\" class=\"aia-product-price\">{{ product.price }}</span>\n <!-- In the text column rather than the aria-hidden media tile, so the\n card's accessible name says it; the stylesheet lifts it over the\n image. -->\n <span *ngIf=\"product.available === false\" class=\"aia-product-badge\">{{ strings.soldOut }}</span>\n </span>\n\n <!-- The add-to-cart button: a child of the card rather than of the\n aria-hidden media tile; the stylesheet lifts it over the tile's\n bottom right corner. A role=\"button\" span, not a <button>:\n interactive content inside an <a> is invalid HTML. Its press never\n reaches the card, so it never selects. Sold-out cards have none. -->\n <span\n *ngIf=\"hasCart(product)\"\n class=\"aia-product-cart\"\n data-aia-product-cart=\"\"\n role=\"button\"\n [attr.aria-label]=\"strings.addToCart + ': ' + product.title\"\n [attr.tabindex]=\"focusable ? 0 : -1\"\n [attr.data-aia-cart-state]=\"cartState(product)\"\n [attr.aria-busy]=\"cartState(product) === 'adding' ? 'true' : null\"\n (click)=\"onCartPress($event, product)\"\n (keydown)=\"onCartKeyDown($event, product)\"\n (focus)=\"onCardFocus()\"\n (blur)=\"onCardBlur($event)\"\n >\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <path class=\"aia-product-cart-glyph\" d=\"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6\" />\n <path class=\"aia-product-cart-glyph\" d=\"M13.5 6.5v-4M11.5 4.5h4\" />\n <path class=\"aia-product-cart-check\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"9\" cy=\"20\" r=\"1.3\" />\n <circle class=\"aia-product-cart-glyph\" cx=\"17.5\" cy=\"20\" r=\"1.3\" />\n </svg>\n </span>\n </a>\n </div>\n</section>\n", styles: [".aia-products{display:flex;flex-direction:column;gap:6px;padding:0 10px;min-width:0}.aia-products-label{font-family:inherit;font-size:var(--aia-products-label-font-size, 11px);font-weight:500;line-height:18px;letter-spacing:.02em;color:var( --aia-products-label-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) )}.aia-products-row{display:flex;gap:var(--aia-product-gap, 8px);min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;padding-bottom:2px;margin-inline:-6px;scrollbar-width:none;-ms-overflow-style:none}.aia-products-row::-webkit-scrollbar{display:none}.aia-product{flex:0 0 auto;display:flex;flex-direction:column;gap:6px;width:var(--aia-product-card-width, 116px);padding:6px;border-radius:10px;background:var(--aia-product-bg, transparent);color:var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));text-decoration:none;cursor:pointer;transition:background-color .15s ease;position:relative}.aia-product:hover{background:var(--aia-product-bg-active, var(--aia-option-bg, transparent))}.aia-product:focus-visible{outline:2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));outline-offset:-2px}.aia-product-media{display:block;position:relative;width:100%;aspect-ratio:1 / 1;border-radius:8px;overflow:hidden;background:var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, .25)))}.aia-product-media[data-aia-image-loaded]{background:transparent}.aia-product-image{display:block;width:auto;max-width:100%;height:100%;margin:0 auto;border-radius:var(--aia-product-image-radius, 8px);object-fit:contain}.aia-product-media:where([data-aia-product-initial]){display:flex;align-items:center;justify-content:center;color:var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));font-size:24px;font-weight:600;line-height:1}.aia-product-media[data-aia-product-placeholder]:after{content:\"\";position:absolute;inset:22%;background:var( --aia-product-placeholder-image, url(\"data:image/svg+xml,%3Csvg viewBox='0 -0.5 32 32' fill-rule='evenodd' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='matrix(1,0,0,1,-384,-144)'%3E%3Cg transform='matrix(0.875,0,0,0.875,90.25,19.125)'%3E%3Cpath d='M340.924,147.74C341.224,146.789 342.107,146.143 343.104,146.143C347.705,146.143 360.491,146.143 364.985,146.143C365.965,146.143 366.836,146.768 367.15,147.697C368.119,150.386 370,155.73 370,157C370,159.208 368.208,161 366,161C363.792,161 362,159.208 362,157C362,159.208 360.208,161 358,161C355.792,161 354,159.208 354,157C354,159.208 352.208,161 350,161C347.792,161 346,159.208 346,157C346,159.208 344.208,161 342,161C340.53,161 339.244,160.205 338.549,159.022C338.057,158.185 337.944,157.179 338.236,156.254C338.787,154.507 340.172,150.121 340.924,147.74Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1.32454,48,-56.1457)'%3E%3Cpath d='M341.026,160.675C341.026,160.675 341.01,168.196 341.003,171.488C341.002,171.889 341.213,172.273 341.588,172.557C341.963,172.841 342.472,173 343.003,173C347.188,173 356.817,173 361,173C361.53,173 362.039,172.841 362.414,172.558C362.789,172.275 363,171.891 363,171.49C363,168.2 363,160.675 363,160.675' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1,0,0,1,48,0)'%3E%3Cpath d='M355,168C355,166.895 354.105,166 353,166C352.356,166 351.644,166 351,166C349.895,166 349,166.895 349,168C349,170.069 349,173 349,173L355,173L355,168Z' fill='%2390e0ef'%3E%3C/path%3E%3C/g%3E%3Cg transform='matrix(1.11111,0,0,1.11111,-47.2678,-87.5361)'%3E%3Ccircle cx='411.5' cy='213.5' r='4.5' fill='%2390e0ef'%3E%3C/circle%3E%3C/g%3E%3Cpath d='M405.529,146C406.628,144.773 408.225,144 410,144C413.311,144 416,146.689 416,150C416,151.549 415.412,152.962 414.446,154.027C414.775,155.15 415,156.076 415,156.5C415,158.459 413.746,160.127 411.998,160.744L411.998,171C411.998,171.796 411.682,172.559 411.119,173.121C410.557,173.684 409.794,174 408.998,174L391.002,174C390.205,174 389.441,173.683 388.879,173.119C388.316,172.555 388,171.79 388.002,170.994L388.024,160.752C387.007,160.399 386.155,159.691 385.618,158.776L385.618,158.776C385.044,157.799 384.912,156.626 385.253,155.546L387.605,148.097C387.999,146.849 389.157,146 390.466,146L405.529,146ZM409.998,160.972C408.79,160.838 407.726,160.225 407,159.327C406.175,160.347 404.913,161 403.5,161C402.087,161 400.825,160.347 400,159.327C399.175,160.347 397.913,161 396.5,161C395.087,161 393.825,160.347 393,159.327C392.278,160.219 391.222,160.831 390.023,160.97L390.002,170.998C390.002,171.263 390.107,171.518 390.294,171.706C390.482,171.894 390.736,172 391.002,172L396,172L396,168C396,166.343 397.343,165 399,165L401,165C402.657,165 404,166.343 404,168L404,172L408.998,172C409.263,172 409.517,171.895 409.705,171.707C409.893,171.52 409.998,171.265 409.998,171L409.998,160.972ZM402,172L398,172L398,168C398,167.448 398.448,167 399,167C399,167 401,167 401,167C401.552,167 402,167.448 402,168L402,172ZM404.342,148L390.466,148C390.03,148 389.644,148.283 389.512,148.699L387.16,156.148C386.99,156.688 387.056,157.275 387.342,157.763C387.777,158.503 388.581,159 389.5,159C390.88,159 392,157.88 392,156.5C392,155.003 394,155.003 394,156.5C394,157.88 395.12,159 396.5,159C397.88,159 399,157.88 399,156.5C399,155.004 401,155.004 401,156.5C401,157.88 402.12,159 403.5,159C404.88,159 406,157.88 406,156.5C406,154.986 408,154.986 408,156.5C408,157.88 409.12,159 410.5,159C411.88,159 413,157.88 413,156.5C413,156.259 412.917,155.843 412.779,155.318C411.948,155.753 411.003,156 410,156C406.689,156 404,153.311 404,150C404,149.299 404.12,148.626 404.342,148ZM410,146C412.208,146 414,147.792 414,150C414,152.208 412.208,154 410,154C407.792,154 406,152.208 406,150C406,147.792 407.792,146 410,146ZM407.543,151.207L408.546,152.21C408.733,152.397 408.988,152.503 409.253,152.503C409.519,152.503 409.773,152.397 409.961,152.209L412.458,149.706C412.848,149.316 412.847,148.682 412.456,148.292C412.066,147.902 411.432,147.903 411.042,148.294L409.252,150.088C409.252,150.088 408.957,149.793 408.957,149.793C408.567,149.403 407.933,149.403 407.543,149.793C407.153,150.183 407.153,150.817 407.543,151.207Z' fill='%231990a7'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\") ) center / contain no-repeat}.aia-product-body{display:flex;flex-direction:column;gap:2px;min-width:0}.aia-product-vendor{font-family:inherit;font-size:var(--aia-product-vendor-font-size, 10px);line-height:14px;color:var( --aia-product-vendor-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );opacity:.8;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.aia-product-title{font-family:inherit;font-size:var(--aia-product-title-font-size, 12px);font-weight:400;line-height:16px;color:var( --aia-product-title-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.aia-product-price{font-family:inherit;font-size:var(--aia-product-price-font-size, 11px);font-weight:500;line-height:15px;color:var( --aia-product-price-color, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}.aia-product-badge{position:absolute;top:var(--aia-product-badge-inset, 12px);left:var(--aia-product-badge-inset, 12px);padding:3px 6px;border-radius:4px;background:var(--aia-product-badge-bg, rgba(255, 255, 255, .94));color:var(--aia-product-badge-color, #1f2328);box-shadow:0 0 0 1px #00000014,0 1px 2px #0000002e;font-family:inherit;font-size:var(--aia-product-badge-font-size, 9px);font-weight:600;line-height:1;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;pointer-events:none}.aia-product-cart{position:absolute;top:calc(var(--aia-product-card-width, 116px) - 12px - var(--aia-product-cart-size, 28px) - (var(--aia-product-card-width, 116px) - 12px) * (1 - var(--aia-product-photo-fill-y, 1)) / 2);right:calc(12px + (var(--aia-product-card-width, 116px) - 12px) * (1 - var(--aia-product-photo-fill-x, 1)) / 2);display:flex;align-items:center;justify-content:center;width:var(--aia-product-cart-size, 28px);height:var(--aia-product-cart-size, 28px);border-radius:999px;background:var(--aia-product-cart-bg, rgba(255, 255, 255, .94));color:var(--aia-product-cart-color, #1f2328);box-shadow:0 0 0 1px #00000014,0 1px 3px #00000038;cursor:pointer;transition:transform .15s ease,opacity .15s ease}.aia-product-cart:hover{transform:scale(1.08)}.aia-product-cart:focus-visible{outline:2px solid var(--aia-product-focus-ring, var(--aia-option-color-selected, currentColor));outline-offset:2px}.aia-product-cart svg{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.aia-product-cart svg path{fill:none;stroke:currentColor}.aia-product-cart svg circle{fill:none;stroke:currentColor}.aia-product-cart-check{display:none}.aia-product-cart[data-aia-cart-state=adding]{opacity:.6;cursor:progress}.aia-product-cart[data-aia-cart-state=added] .aia-product-cart-glyph{display:none}.aia-product-cart[data-aia-cart-state=added] .aia-product-cart-check{display:inline}.aia-product[data-aia-product-sold-out] .aia-product-image{filter:grayscale(.55)}.aia-products[data-aia-products-layout=list] .aia-products-row{flex-direction:column;gap:var(--aia-product-list-gap, 2px);max-height:var(--aia-product-list-max-height, 320px);overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.aia-products[data-aia-products-layout=list] .aia-product{flex-direction:row;align-items:center;gap:10px;width:auto;padding:6px 8px}.aia-products[data-aia-products-layout=list] .aia-product-media{flex:0 0 auto;width:var(--aia-product-list-media-size, 44px);height:var(--aia-product-list-media-size, 44px)}.aia-products[data-aia-products-layout=list] .aia-product-body{flex:1 1 auto}.aia-products[data-aia-products-layout=list] .aia-product-badge{top:calc(50% + var(--aia-product-list-media-size, 44px) / 2);left:8px;width:var(--aia-product-list-media-size, 44px);transform:translateY(-100%);padding:2px 0;border-radius:0 0 8px 8px;background:var(--aia-product-badge-list-bg, rgba(17, 17, 17, .72));color:var(--aia-product-badge-list-color, #fff);box-shadow:none;font-size:var(--aia-product-badge-list-font-size, 7px);letter-spacing:.02em;text-align:center}.aia-products[data-aia-products-layout=list] .aia-product-cart{top:50%;right:8px;transform:translateY(-50%)}.aia-products[data-aia-products-layout=list] .aia-product-cart:hover{transform:translateY(-50%) scale(1.08)}.aia-products[data-aia-products-layout=list] .aia-product[data-aia-product-has-cart]{padding-right:calc(var(--aia-product-cart-size, 28px) + 16px)}\n"] }]
|
|
427
518
|
}], propDecorators: { products: [{
|
|
428
519
|
type: Input
|
|
429
520
|
}], listboxId: [{
|
|
@@ -436,6 +527,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
436
527
|
type: Input
|
|
437
528
|
}], strings: [{
|
|
438
529
|
type: Input
|
|
530
|
+
}], addToCart: [{
|
|
531
|
+
type: Input
|
|
439
532
|
}], select: [{
|
|
440
533
|
type: Output
|
|
441
534
|
}], focusChange: [{
|
|
@@ -957,6 +1050,11 @@ class AIAutocompleteDropdownComponent {
|
|
|
957
1050
|
// close fade so the populated dropdown fades out as one — see initVm.
|
|
958
1051
|
this.lastVisibleContent = null;
|
|
959
1052
|
this.trackByWidth = (_, w) => w;
|
|
1053
|
+
/**
|
|
1054
|
+
* The strip's cart buttons. A stable arrow reading the current controller,
|
|
1055
|
+
* so the strip's input doesn't change on every pass.
|
|
1056
|
+
*/
|
|
1057
|
+
this.addProductToCart = (product) => this.controller.addProductToCart(product);
|
|
960
1058
|
}
|
|
961
1059
|
/** Root class list — adds `magicx-aia` only when self-scoping via `mode`. */
|
|
962
1060
|
get rootClass() {
|
|
@@ -1201,6 +1299,7 @@ class AIAutocompleteDropdownComponent {
|
|
|
1201
1299
|
},
|
|
1202
1300
|
showsFallbackSkeleton,
|
|
1203
1301
|
products: dd.products,
|
|
1302
|
+
hasProductAddToCart: Boolean(dd.hasProductAddToCart),
|
|
1204
1303
|
groupKey: activeSuggestion
|
|
1205
1304
|
? `${activeSuggestion.parameter} ${activeSuggestion.text}`
|
|
1206
1305
|
: "",
|
|
@@ -1255,7 +1354,7 @@ class AIAutocompleteDropdownComponent {
|
|
|
1255
1354
|
}
|
|
1256
1355
|
}
|
|
1257
1356
|
AIAutocompleteDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AIAutocompleteDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1258
|
-
AIAutocompleteDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AIAutocompleteDropdownComponent, isStandalone: true, selector: "ai-autocomplete-dropdown", inputs: { controller: "controller", showPills: "showPills", showSkipButton: "showSkipButton", showOptionIcons: "showOptionIcons", showOptionImages: "showOptionImages", showOptionCounts: "showOptionCounts", productsLayout: "productsLayout", productImageFallback: "productImageFallback", className: "className", mode: "mode", language: "language" }, viewQueries: [{ propertyName: "dropdownRootRef", first: true, predicate: ["dropdownRoot"], descendants: true }, { propertyName: "scrollArrowRef", first: true, predicate: ["scrollArrow"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"vm$ | async as vm\"\n #dropdownRoot\n [id]=\"controller.listboxId\"\n role=\"listbox\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-aia-skeleton-exiting]=\"vm.skeletonExiting ? '' : null\"\n [attr.data-mode]=\"resolvedMode\"\n [attr.data-options-position]=\"vm.optionsPosition\"\n [attr.data-aia-has-products]=\"vm.products.length > 0 ? '' : null\"\n [class]=\"rootClass\"\n [class.magicx-aia-dropdown-visible]=\"vm.isVisible\"\n (mousedown)=\"preventBlur($event)\"\n>\n <aia-stack space=\"8px\">\n <aia-cluster\n *ngIf=\"vm.showsPills || vm.showsSkip\"\n class=\"magicx-aia-dropdown-pillbar\"\n data-aia-pillbar=\"\"\n [noWrap]=\"true\"\n >\n <!-- The scroll + right-edge fade live on this wrapper (not the bar) so\n the skip button stays outside the masked region \u2014 pinned and fully\n opaque while overflowing pills fade under it. Absent in a skip-only\n row (pills rendered elsewhere via pillPlacement inline/hidden). -->\n <span *ngIf=\"vm.showsPills\" class=\"magicx-aia-pill-scroll\" data-aia-pill-scroll=\"\">\n <aia-pill-list\n [pills]=\"vm.pills\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"vm.isActivePillSelected\"\n [rounded]=\"true\"\n [loading]=\"vm.isLoading\"\n (selectPill)=\"onPillClick($event)\"\n ></aia-pill-list>\n </span>\n <button\n *ngIf=\"vm.showsSkip\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-skip\"\n data-aia-skip=\"\"\n [disabled]=\"vm.skipDisabled\"\n [attr.aria-label]=\"\n vm.activePillLabel ? vm.strings.skipLabel + ' ' + vm.activePillLabel : vm.strings.skipLabel\n \"\n (click)=\"onSkip()\"\n >\n {{ vm.strings.skip }}\n </button>\n </aia-cluster>\n\n <aia-suggestion-grid\n *ngIf=\"vm.showsOptions\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [loading]=\"vm.isLoading\"\n [groupKey]=\"vm.groupKey\"\n [optionsPosition]=\"vm.optionsPosition\"\n [showIcons]=\"vm.showOptionIcons\"\n [showImages]=\"vm.showOptionImages\"\n [showCounts]=\"vm.showOptionCounts\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n ></aia-suggestion-grid>\n\n <aia-date-grid\n *ngIf=\"vm.showsDateGrid\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [view]=\"vm.dateView\"\n [selection]=\"vm.dateSelection\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <div\n *ngIf=\"vm.showsFallbackSkeleton\"\n class=\"magicx-aia-dropdown-skeleton-bars\"\n data-aia-skeleton-bars=\"\"\n >\n <span\n *ngFor=\"let w of fallbackSkeletonBarWidths; trackBy: trackByWidth\"\n class=\"magicx-aia-dropdown-skeleton-bar\"\n [style.width.px]=\"w\"\n ></span>\n </div>\n\n <!-- *ngIf, not just the section's own guard inside the component: the host\n element is an in-flow child of .aia-stack (display:flex; gap:8px), so\n an always-instantiated zero-height host would add a SECOND 8px gap\n between the grid and the footer \u2014 in every dropdown, products or not.\n The grid's --aia-grid-overlap-bottom is tuned for exactly one gap, so\n the footer would land 8px below the band it is meant to cover. -->\n <aia-product-strip\n *ngIf=\"vm.products.length > 0\"\n [products]=\"vm.products\"\n [listboxId]=\"controller.listboxId\"\n [focusable]=\"vm.isVisible\"\n [layout]=\"productsLayout\"\n [imageFallback]=\"productImageFallback\"\n [strings]=\"vm.strings\"\n (select)=\"onProductSelect($event)\"\n (focusChange)=\"onProductFocusChange($event)\"\n ></aia-product-strip>\n\n <footer class=\"magicx-aia-footer\" data-aia-footer=\"\">\n <div class=\"magicx-aia-footer-row\">\n <span class=\"magicx-aia-footer-hint-group\">\n <kbd class=\"magicx-aia-footer-key\">{{ vm.footerKey }}</kbd>\n <span class=\"magicx-aia-footer-hint\">{{ vm.footerHint }}</span>\n </span>\n <a\n class=\"magicx-aia-footer-brand-link\"\n [href]=\"brandHref\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span class=\"magicx-aia-footer-brand\">AI</span>\n <span class=\"magicx-aia-footer-badge\">Autocomplete</span>\n </a>\n </div>\n </footer>\n </aia-stack>\n <!-- \"More below\" arrow \u2014 an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's scroll-arrow controller (see\n syncScrollArrow); markup mirrors vanilla's createScrollArrowButton. -->\n <button\n #scrollArrow\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-scroll-arrow\"\n data-aia-scroll-arrow=\"\"\n [attr.aria-label]=\"scrollArrowLabel\"\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M4 6.5 8 10.5l4-4\" />\n </svg>\n </button>\n</div>\n", styles: [":where(.magicx-aia){box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html),:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):before,:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):after{all:revert;box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-dropdown]):not(html):not(html):not(html):not(html):not(html){line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-align:start;text-shadow:none;font-style:normal;font-variant:normal;white-space:normal;visibility:visible;cursor:auto}:where([data-aia-input-wrapper] svg,[data-aia-dropdown] svg):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){display:revert;vertical-align:revert;position:revert;inset:revert;float:revert;margin:revert;padding:revert;border:revert;border-radius:revert;outline:revert;background:revert;box-shadow:revert;min-width:revert;max-width:revert;min-height:revert;max-height:revert;flex:revert;transition:revert;animation:revert;rotate:revert;scale:revert;translate:revert}:where([data-aia-input-wrapper] svg *,[data-aia-dropdown] svg *):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){transition:revert;animation:revert}:where(.magicx-aia){--aia-primitive-neutral-0: #000000;--aia-primitive-neutral-150: #1a1b1d;--aia-primitive-neutral-250: #323232;--aia-primitive-neutral-300: #333539;--aia-primitive-neutral-400: #4a4a4a;--aia-primitive-neutral-500: #505050;--aia-primitive-neutral-700: #b0b0b0;--aia-primitive-neutral-750: #bdbdbd;--aia-primitive-neutral-900: #e7e7e7;--aia-primitive-neutral-1000: #ffffff;--aia-primitive-blue-50: #eef2ff;--aia-primitive-neutral-750-a50: rgba(189, 189, 189, .51);--aia-primitive-neutral-750-a25: rgba(189, 189, 189, .25);--aia-primitive-neutral-750-a8: rgba(189, 189, 189, .083);--aia-primitive-neutral-750-a35: rgba(189, 189, 189, .35);--aia-primitive-neutral-750-a30: rgba(189, 189, 189, .3);--aia-primitive-neutral-750-a15: rgba(189, 189, 189, .15);--aia-primitive-neutral-750-a105: rgba(189, 189, 189, .105);--aia-primitive-neutral-700-a40: rgba(176, 176, 176, .4);--aia-primitive-neutral-900-a50: rgba(231, 231, 231, .5);--aia-primitive-neutral-400-a50: rgba(74, 74, 74, .5)}:where(.magicx-aia),:where(.magicx-aia[data-mode=\"light\"]){--aia-surface: var(--aia-primitive-neutral-1000);--aia-border: var(--aia-primitive-neutral-700);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-900-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-300);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #b84549;--aia-smart-suggestion-glint: #f3c4c5;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a105);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-0);--aia-option-bg: var(--aia-primitive-blue-50);--aia-option-color: var(--aia-primitive-neutral-150);--aia-option-color-selected: var(--aia-primitive-neutral-0);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-0);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #000000);--aia-submit-bg: var(--aia-primitive-neutral-0);--aia-submit-color: var(--aia-primitive-neutral-1000);--aia-color-text-muted: #6b7280;--aia-skeleton-bg: var(--aia-primitive-neutral-750-a8);--aia-streak-rgb: 99, 102, 241;--aia-footer-hint-color: var(--aia-primitive-neutral-500);--aia-footer-brand-color: var(--aia-primitive-neutral-700);--aia-footer-badge-border: var(--aia-primitive-neutral-750-a50)}:where(.magicx-aia[data-mode=\"dark\"]){--aia-surface: var(--aia-primitive-neutral-0);--aia-border: var(--aia-primitive-neutral-500);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-400-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-700);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #e0787b;--aia-smart-suggestion-glint: #ffe1e1;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a15);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-1000);--aia-option-bg: var(--aia-primitive-neutral-250);--aia-option-color: var(--aia-primitive-neutral-900);--aia-option-color-selected: var(--aia-primitive-neutral-1000);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-1000);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #ffffff);--aia-submit-bg: var(--aia-primitive-neutral-1000);--aia-submit-color: var(--aia-primitive-neutral-0);--aia-color-text-muted: #c1c4cb;--aia-skeleton-bg: var(--aia-primitive-neutral-150);--aia-streak-rgb: 255, 255, 255;--aia-footer-hint-color: var(--aia-primitive-neutral-700);--aia-footer-brand-color: var(--aia-primitive-neutral-500);--aia-footer-badge-border: var(--aia-primitive-neutral-500)}[data-aia-dropdown]{--aia-footer-row-height: 23px;--aia-footer-band: calc(var(--aia-footer-gap, 12px) + var(--aia-footer-row-height, 23px));--aia-grid-scroll-bottom: var(--aia-footer-band);--aia-grid-overlap-bottom: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-lead: 20px;--aia-footer-fade-inset: calc(-1 * var(--aia-footer-fade-lead)) 0 0}[data-aia-dropdown] [data-aia-pillbar] .aia-pill-list{padding-inline:10px}[data-aia-dropdown] [data-aia-pillbar] .aia-pill{justify-content:flex-start;border-inline-width:0;padding-inline:0}[data-aia-dropdown] .aia-grid[data-scroll]{padding-top:var(--aia-grid-scroll-top, 0);padding-bottom:var(--aia-grid-scroll-bottom, 0);margin-top:var(--aia-grid-overlap-top, 0);margin-bottom:var(--aia-grid-overlap-bottom, 0)}[data-aia-dropdown] [data-aia-footer]:before{content:\"\";position:absolute;inset:var(--aia-footer-fade-inset, -20px 0 0);z-index:-1;pointer-events:none;background:linear-gradient(to bottom,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}[data-aia-dropdown][data-aia-surface=glass]{--aia-footer-chip-bg: transparent}[data-aia-dropdown][data-aia-surface=glass] [data-aia-footer]:before{display:none}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown],[data-aia-dropdown][data-options-position=above]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: var(--aia-footer-band);--aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));transform-origin:50% 100%;top:auto;bottom:100%;margin-top:0;margin-bottom:6px}[data-aia-dropdown][data-aia-has-products]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .aia-stack,[data-aia-dropdown][data-options-position=above] .aia-stack{flex-direction:column-reverse}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer],[data-aia-dropdown][data-options-position=above] [data-aia-footer]{padding:0 0 var(--aia-footer-gap, 12px) 8px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before{background:linear-gradient(to top,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .magicx-aia-footer,[data-aia-dropdown][data-options-position=above] .magicx-aia-footer{flex-direction:column-reverse}@media (min-width: 769px){[data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before,:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before{inset:0;background:var(--aia-surface, #ffffff)}}[data-aia-dropdown][data-aia-fit]{max-height:var(--aia-dropdown-fit-height, none);--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}[data-aia-dropdown][data-aia-fit]>.aia-stack{flex:1 1 auto;min-height:0;margin-inline:-6px;padding-inline:6px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}[data-aia-dropdown][data-aia-fit]>.aia-stack::-webkit-scrollbar{display:none}[data-aia-dropdown][data-aia-fit]>.aia-stack>*{flex-shrink:0}[data-aia-dropdown][data-aia-fit] .aia-grid[data-scroll]{max-height:none;overflow:visible}\n", ".magicx-aia-dropdown{position:absolute;left:0;right:0;top:100%;max-width:544px;margin-top:6px;display:flex;flex-direction:column;box-sizing:border-box;padding:10px 8px 10px max(0px,calc(var(--aia-content-inset-left, 16px) - 10px));overflow:hidden;container-type:inline-size;z-index:10;opacity:0;pointer-events:none;transform-origin:50% 0;transform:scaleY(var(--aia-dropdown-reveal-scale, .02));transition:opacity .4s cubic-bezier(.4,0,.2,1),transform 0s .4s;background:var(--aia-surface, #ffffff);border:1px solid var(--aia-dropdown-border, rgba(231, 231, 231, .5));border-radius:9px;box-shadow:var(--aia-dropdown-shadow, none)}.magicx-aia-dropdown:has([data-aia-datepicker]){max-width:var(--aia-date-panel-width, 312px)}.magicx-aia-dropdown[data-aia-surface=glass]{background:transparent;border-color:transparent;box-shadow:#fff -3.2px -3.2px 3.2px -3.2px inset,#fff 6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) -6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) 6.4px -6.4px 1.6px -8px inset,#ffffff26 -1.6px 0 0 -1.6px inset,#ffffff26 0 -1.6px 0 -1.6px inset,#ffffff4d 0 1.6px inset,#ffffff4d 1.6px 0 inset,inset 0 0 30px 5px #0000000d;backdrop-filter:blur(30px)}.magicx-aia-dropdown-visible{opacity:1;pointer-events:auto;transform:scaleY(1);transition:opacity .1s cubic-bezier(.4,0,.2,1),transform .32s cubic-bezier(.22,1.28,.36,1)}.magicx-aia-scroll-arrow{position:absolute;left:50%;bottom:var(--aia-scroll-arrow-bottom, 8px);z-index:4;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0 0 0 -16px;padding:0;border:0;border-radius:0;background:transparent;color:var( --aia-scroll-arrow-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );box-shadow:none;cursor:pointer;pointer-events:none;opacity:0;transition:opacity 1s cubic-bezier(.4,0,.2,1);animation:magicx-aia-scroll-arrow-bob 2.6s ease-in-out infinite}@keyframes magicx-aia-scroll-arrow-bob{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}.magicx-aia-scroll-arrow[data-aia-visible]{pointer-events:auto;opacity:1}.magicx-aia-scroll-arrow:disabled{cursor:default}.magicx-aia-scroll-arrow svg{width:14px;height:14px;fill:none;stroke:currentColor}.magicx-aia-scroll-arrow svg path{fill:none;stroke:currentColor}.magicx-aia-scroll-arrow:hover{color:var( --aia-scroll-arrow-color-hover, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}@media (prefers-reduced-motion: reduce){.magicx-aia-scroll-arrow,.magicx-aia-dropdown{animation-duration:0s;animation-delay:0s;transition-duration:0s}}.magicx-aia-dropdown-pillbar{overflow:hidden}.magicx-aia-pill-scroll{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%);-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%)}.magicx-aia-pill-scroll::-webkit-scrollbar{display:none}.magicx-aia-skip{display:inline-flex;align-items:center;margin-inline-start:auto;flex-shrink:0;padding:5px 8px;border:none;border-radius:6px;background:transparent;font-family:inherit;font-size:var(--aia-skip-font-size, 10px);line-height:18px;color:var(--aia-skip-color, var(--aia-footer-hint-color, #505050));cursor:pointer;white-space:nowrap;transition:color .15s ease-out,background-color .15s ease-out}.magicx-aia-skip:hover{color:var(--aia-skip-color-hover, var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)));background:var(--aia-skip-hover-bg, var(--aia-option-bg, transparent))}.magicx-aia-skip:disabled{pointer-events:none;cursor:default;opacity:.5}.magicx-aia-footer{display:flex;flex-direction:column;gap:8px;padding:var(--aia-footer-gap, 12px) 0 0 8px;position:relative;z-index:3;pointer-events:none}.magicx-aia-footer-row{display:flex;align-items:center;justify-content:space-between;min-height:var(--aia-footer-row-min-height, var(--aia-footer-row-height, 23px))}.magicx-aia-footer-hint-group{display:inline-flex;align-items:center;gap:5px}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{pointer-events:auto}.magicx-aia-footer-brand-link{display:inline-flex;align-items:center;gap:2px;text-decoration:none;cursor:pointer;transition:opacity .15s ease-out}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{background:var( --aia-footer-chip-bg, color-mix(in srgb, var(--aia-surface, #ffffff) 65%, transparent) );padding-inline:4px;border-radius:6px}.magicx-aia-footer-brand-link{background:var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));border-radius:999px;padding:2px 4px;gap:4px}.magicx-aia-footer-brand-link:hover{opacity:.7}.magicx-aia-footer-key{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:22px;padding:2px 6px;border:.5px solid var(--aia-footer-hint-color, #505050);border-radius:5px;font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-hint{font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-brand{font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}.magicx-aia-footer-badge{display:inline-flex;align-items:center;height:var(--aia-footer-row-height, 23px);padding:2.5px 5.5px;border:.5px solid var(--aia-footer-badge-border, rgba(189, 189, 189, .51));border-radius:999px;font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}@media (max-width: 768px){.magicx-aia-footer-hint-group{display:none}.magicx-aia-footer-row{justify-content:flex-end}}.magicx-aia-dropdown-skeleton-bars{display:flex;flex-direction:column;gap:20px;padding:7px 8px;animation:aiaSkeletonBarsIn .1s ease-out}[data-aia-skeleton-exiting] .magicx-aia-dropdown-skeleton-bars{animation:aiaSkeletonBarsOut .1s ease-in forwards}@keyframes aiaSkeletonBarsOut{to{opacity:0}}@keyframes aiaSkeletonBarsIn{0%{opacity:0}}.magicx-aia-dropdown-skeleton-bar{display:block;height:14px;border-radius:999px;background:var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, .25)));opacity:.5;animation:aiaDropdownSkeletonPulse 1.4s ease-in-out infinite}.magicx-aia-dropdown-skeleton-bar:nth-child(2){animation-delay:.15s}.magicx-aia-dropdown-skeleton-bar:nth-child(3){animation-delay:.3s}@keyframes aiaDropdownSkeletonPulse{0%,to{opacity:.5}50%{opacity:.25}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: PillListComponent, selector: "aia-pill-list", inputs: ["pills", "activePillIndex", "rounded", "loading", "activeSelected"], outputs: ["selectPill"] }, { kind: "component", type: ProductStripComponent, selector: "aia-product-strip", inputs: ["products", "listboxId", "focusable", "layout", "imageFallback", "strings"], outputs: ["select", "focusChange"] }, { kind: "component", type: SuggestionGridComponent, selector: "aia-suggestion-grid", inputs: ["options", "activeIndex", "listboxId", "loading", "groupKey", "optionsPosition", "showIcons", "showImages", "showCounts"], outputs: ["select", "highlight", "unhighlight"] }, { kind: "component", type: DateGridComponent, selector: "aia-date-grid", inputs: ["options", "activeIndex", "listboxId", "view", "selection"], outputs: ["select", "highlight", "unhighlight", "previousMonth", "nextMonth"] }, { kind: "component", type: StackComponent, selector: "aia-stack", inputs: ["space", "align"] }, { kind: "component", type: ClusterComponent, selector: "aia-cluster", inputs: ["gap", "align", "justify", "noWrap", "inline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1357
|
+
AIAutocompleteDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AIAutocompleteDropdownComponent, isStandalone: true, selector: "ai-autocomplete-dropdown", inputs: { controller: "controller", showPills: "showPills", showSkipButton: "showSkipButton", showOptionIcons: "showOptionIcons", showOptionImages: "showOptionImages", showOptionCounts: "showOptionCounts", productsLayout: "productsLayout", productImageFallback: "productImageFallback", className: "className", mode: "mode", language: "language" }, viewQueries: [{ propertyName: "dropdownRootRef", first: true, predicate: ["dropdownRoot"], descendants: true }, { propertyName: "scrollArrowRef", first: true, predicate: ["scrollArrow"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"vm$ | async as vm\"\n #dropdownRoot\n [id]=\"controller.listboxId\"\n role=\"listbox\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-aia-skeleton-exiting]=\"vm.skeletonExiting ? '' : null\"\n [attr.data-mode]=\"resolvedMode\"\n [attr.data-options-position]=\"vm.optionsPosition\"\n [attr.data-aia-has-products]=\"vm.products.length > 0 ? '' : null\"\n [class]=\"rootClass\"\n [class.magicx-aia-dropdown-visible]=\"vm.isVisible\"\n (mousedown)=\"preventBlur($event)\"\n>\n <aia-stack space=\"8px\">\n <aia-cluster\n *ngIf=\"vm.showsPills || vm.showsSkip\"\n class=\"magicx-aia-dropdown-pillbar\"\n data-aia-pillbar=\"\"\n [noWrap]=\"true\"\n >\n <!-- The scroll + right-edge fade live on this wrapper (not the bar) so\n the skip button stays outside the masked region \u2014 pinned and fully\n opaque while overflowing pills fade under it. Absent in a skip-only\n row (pills rendered elsewhere via pillPlacement inline/hidden). -->\n <span *ngIf=\"vm.showsPills\" class=\"magicx-aia-pill-scroll\" data-aia-pill-scroll=\"\">\n <aia-pill-list\n [pills]=\"vm.pills\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"vm.isActivePillSelected\"\n [rounded]=\"true\"\n [loading]=\"vm.isLoading\"\n (selectPill)=\"onPillClick($event)\"\n ></aia-pill-list>\n </span>\n <button\n *ngIf=\"vm.showsSkip\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-skip\"\n data-aia-skip=\"\"\n [disabled]=\"vm.skipDisabled\"\n [attr.aria-label]=\"\n vm.activePillLabel ? vm.strings.skipLabel + ' ' + vm.activePillLabel : vm.strings.skipLabel\n \"\n (click)=\"onSkip()\"\n >\n {{ vm.strings.skip }}\n </button>\n </aia-cluster>\n\n <aia-suggestion-grid\n *ngIf=\"vm.showsOptions\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [loading]=\"vm.isLoading\"\n [groupKey]=\"vm.groupKey\"\n [optionsPosition]=\"vm.optionsPosition\"\n [showIcons]=\"vm.showOptionIcons\"\n [showImages]=\"vm.showOptionImages\"\n [showCounts]=\"vm.showOptionCounts\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n ></aia-suggestion-grid>\n\n <aia-date-grid\n *ngIf=\"vm.showsDateGrid\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [view]=\"vm.dateView\"\n [selection]=\"vm.dateSelection\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <div\n *ngIf=\"vm.showsFallbackSkeleton\"\n class=\"magicx-aia-dropdown-skeleton-bars\"\n data-aia-skeleton-bars=\"\"\n >\n <span\n *ngFor=\"let w of fallbackSkeletonBarWidths; trackBy: trackByWidth\"\n class=\"magicx-aia-dropdown-skeleton-bar\"\n [style.width.px]=\"w\"\n ></span>\n </div>\n\n <!-- *ngIf, not just the section's own guard inside the component: the host\n element is an in-flow child of .aia-stack (display:flex; gap:8px), so\n an always-instantiated zero-height host would add a SECOND 8px gap\n between the grid and the footer \u2014 in every dropdown, products or not.\n The grid's --aia-grid-overlap-bottom is tuned for exactly one gap, so\n the footer would land 8px below the band it is meant to cover. -->\n <aia-product-strip\n *ngIf=\"vm.products.length > 0\"\n [products]=\"vm.products\"\n [listboxId]=\"controller.listboxId\"\n [focusable]=\"vm.isVisible\"\n [layout]=\"productsLayout\"\n [imageFallback]=\"productImageFallback\"\n [strings]=\"vm.strings\"\n [addToCart]=\"vm.hasProductAddToCart ? addProductToCart : null\"\n (select)=\"onProductSelect($event)\"\n (focusChange)=\"onProductFocusChange($event)\"\n ></aia-product-strip>\n\n <footer class=\"magicx-aia-footer\" data-aia-footer=\"\">\n <div class=\"magicx-aia-footer-row\">\n <span class=\"magicx-aia-footer-hint-group\">\n <kbd class=\"magicx-aia-footer-key\">{{ vm.footerKey }}</kbd>\n <span class=\"magicx-aia-footer-hint\">{{ vm.footerHint }}</span>\n </span>\n <a\n class=\"magicx-aia-footer-brand-link\"\n [href]=\"brandHref\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span class=\"magicx-aia-footer-brand\">AI</span>\n <span class=\"magicx-aia-footer-badge\">Autocomplete</span>\n </a>\n </div>\n </footer>\n </aia-stack>\n <!-- \"More below\" arrow \u2014 an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's scroll-arrow controller (see\n syncScrollArrow); markup mirrors vanilla's createScrollArrowButton. -->\n <button\n #scrollArrow\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-scroll-arrow\"\n data-aia-scroll-arrow=\"\"\n [attr.aria-label]=\"scrollArrowLabel\"\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M4 6.5 8 10.5l4-4\" />\n </svg>\n </button>\n</div>\n", styles: [":where(.magicx-aia){box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html),:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):before,:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):after{all:revert;box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-dropdown]):not(html):not(html):not(html):not(html):not(html){line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-align:start;text-shadow:none;font-style:normal;font-variant:normal;white-space:normal;visibility:visible;cursor:auto}:where([data-aia-input-wrapper] svg,[data-aia-dropdown] svg):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){display:revert;vertical-align:revert;position:revert;inset:revert;float:revert;margin:revert;padding:revert;border:revert;border-radius:revert;outline:revert;background:revert;box-shadow:revert;min-width:revert;max-width:revert;min-height:revert;max-height:revert;flex:revert;transition:revert;animation:revert;rotate:revert;scale:revert;translate:revert}:where([data-aia-input-wrapper] svg *,[data-aia-dropdown] svg *):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){transition:revert;animation:revert}:where(.magicx-aia){--aia-primitive-neutral-0: #000000;--aia-primitive-neutral-150: #1a1b1d;--aia-primitive-neutral-250: #323232;--aia-primitive-neutral-300: #333539;--aia-primitive-neutral-400: #4a4a4a;--aia-primitive-neutral-500: #505050;--aia-primitive-neutral-700: #b0b0b0;--aia-primitive-neutral-750: #bdbdbd;--aia-primitive-neutral-900: #e7e7e7;--aia-primitive-neutral-1000: #ffffff;--aia-primitive-blue-50: #eef2ff;--aia-primitive-neutral-750-a50: rgba(189, 189, 189, .51);--aia-primitive-neutral-750-a25: rgba(189, 189, 189, .25);--aia-primitive-neutral-750-a8: rgba(189, 189, 189, .083);--aia-primitive-neutral-750-a35: rgba(189, 189, 189, .35);--aia-primitive-neutral-750-a30: rgba(189, 189, 189, .3);--aia-primitive-neutral-750-a15: rgba(189, 189, 189, .15);--aia-primitive-neutral-750-a105: rgba(189, 189, 189, .105);--aia-primitive-neutral-700-a40: rgba(176, 176, 176, .4);--aia-primitive-neutral-900-a50: rgba(231, 231, 231, .5);--aia-primitive-neutral-400-a50: rgba(74, 74, 74, .5)}:where(.magicx-aia),:where(.magicx-aia[data-mode=\"light\"]){--aia-surface: var(--aia-primitive-neutral-1000);--aia-border: var(--aia-primitive-neutral-700);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-900-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-300);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #b84549;--aia-smart-suggestion-glint: #f3c4c5;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a105);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-0);--aia-option-bg: var(--aia-primitive-blue-50);--aia-option-color: var(--aia-primitive-neutral-150);--aia-option-color-selected: var(--aia-primitive-neutral-0);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-0);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #000000);--aia-submit-bg: var(--aia-primitive-neutral-0);--aia-submit-color: var(--aia-primitive-neutral-1000);--aia-color-text-muted: #6b7280;--aia-skeleton-bg: var(--aia-primitive-neutral-750-a8);--aia-streak-rgb: 99, 102, 241;--aia-footer-hint-color: var(--aia-primitive-neutral-500);--aia-footer-brand-color: var(--aia-primitive-neutral-700);--aia-footer-badge-border: var(--aia-primitive-neutral-750-a50)}:where(.magicx-aia[data-mode=\"dark\"]){--aia-surface: var(--aia-primitive-neutral-0);--aia-border: var(--aia-primitive-neutral-500);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-400-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-700);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #e0787b;--aia-smart-suggestion-glint: #ffe1e1;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a15);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-1000);--aia-option-bg: var(--aia-primitive-neutral-250);--aia-option-color: var(--aia-primitive-neutral-900);--aia-option-color-selected: var(--aia-primitive-neutral-1000);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-1000);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #ffffff);--aia-submit-bg: var(--aia-primitive-neutral-1000);--aia-submit-color: var(--aia-primitive-neutral-0);--aia-color-text-muted: #c1c4cb;--aia-skeleton-bg: var(--aia-primitive-neutral-150);--aia-streak-rgb: 255, 255, 255;--aia-footer-hint-color: var(--aia-primitive-neutral-700);--aia-footer-brand-color: var(--aia-primitive-neutral-500);--aia-footer-badge-border: var(--aia-primitive-neutral-500)}[data-aia-dropdown]{--aia-footer-row-height: 23px;--aia-footer-band: calc(var(--aia-footer-gap, 12px) + var(--aia-footer-row-height, 23px));--aia-grid-scroll-bottom: var(--aia-footer-band);--aia-grid-overlap-bottom: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-lead: 20px;--aia-footer-fade-inset: calc(-1 * var(--aia-footer-fade-lead)) 0 0}[data-aia-dropdown] [data-aia-pillbar] .aia-pill-list{padding-inline:10px}[data-aia-dropdown] [data-aia-pillbar] .aia-pill{justify-content:flex-start;border-inline-width:0;padding-inline:0}[data-aia-dropdown] .aia-grid[data-scroll]{padding-top:var(--aia-grid-scroll-top, 0);padding-bottom:var(--aia-grid-scroll-bottom, 0);margin-top:var(--aia-grid-overlap-top, 0);margin-bottom:var(--aia-grid-overlap-bottom, 0)}[data-aia-dropdown] [data-aia-footer]:before{content:\"\";position:absolute;inset:var(--aia-footer-fade-inset, -20px 0 0);z-index:-1;pointer-events:none;background:linear-gradient(to bottom,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}[data-aia-dropdown][data-aia-surface=glass]{--aia-footer-chip-bg: transparent}[data-aia-dropdown][data-aia-surface=glass] [data-aia-footer]:before{display:none}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown],[data-aia-dropdown][data-options-position=above]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: var(--aia-footer-band);--aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));transform-origin:50% 100%;top:auto;bottom:100%;margin-top:0;margin-bottom:6px}[data-aia-dropdown][data-aia-has-products]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .aia-stack,[data-aia-dropdown][data-options-position=above] .aia-stack{flex-direction:column-reverse}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer],[data-aia-dropdown][data-options-position=above] [data-aia-footer]{padding:0 0 var(--aia-footer-gap, 12px) 8px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before{background:linear-gradient(to top,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .magicx-aia-footer,[data-aia-dropdown][data-options-position=above] .magicx-aia-footer{flex-direction:column-reverse}@media (min-width: 769px){[data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before,:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before{inset:0;background:var(--aia-surface, #ffffff)}}[data-aia-dropdown][data-aia-fit]{max-height:var(--aia-dropdown-fit-height, none);--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}[data-aia-dropdown][data-aia-fit]>.aia-stack{flex:1 1 auto;min-height:0;margin-inline:-6px;padding-inline:6px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}[data-aia-dropdown][data-aia-fit]>.aia-stack::-webkit-scrollbar{display:none}[data-aia-dropdown][data-aia-fit]>.aia-stack>*{flex-shrink:0}[data-aia-dropdown][data-aia-fit] .aia-grid[data-scroll]{max-height:none;overflow:visible}\n", ".magicx-aia-dropdown{position:absolute;left:0;right:0;top:100%;max-width:544px;margin-top:6px;display:flex;flex-direction:column;box-sizing:border-box;padding:10px 8px 10px max(0px,calc(var(--aia-content-inset-left, 16px) - 10px));overflow:hidden;container-type:inline-size;z-index:10;opacity:0;pointer-events:none;transform-origin:50% 0;transform:scaleY(var(--aia-dropdown-reveal-scale, .02));transition:opacity .4s cubic-bezier(.4,0,.2,1),transform 0s .4s;background:var(--aia-surface, #ffffff);border:1px solid var(--aia-dropdown-border, rgba(231, 231, 231, .5));border-radius:9px;box-shadow:var(--aia-dropdown-shadow, none)}.magicx-aia-dropdown:has([data-aia-datepicker]){max-width:var(--aia-date-panel-width, 312px)}.magicx-aia-dropdown[data-aia-surface=glass]{background:transparent;border-color:transparent;box-shadow:#fff -3.2px -3.2px 3.2px -3.2px inset,#fff 6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) -6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) 6.4px -6.4px 1.6px -8px inset,#ffffff26 -1.6px 0 0 -1.6px inset,#ffffff26 0 -1.6px 0 -1.6px inset,#ffffff4d 0 1.6px inset,#ffffff4d 1.6px 0 inset,inset 0 0 30px 5px #0000000d;backdrop-filter:blur(30px)}.magicx-aia-dropdown-visible{opacity:1;pointer-events:auto;transform:scaleY(1);transition:opacity .1s cubic-bezier(.4,0,.2,1),transform .32s cubic-bezier(.22,1.28,.36,1)}.magicx-aia-scroll-arrow{position:absolute;left:50%;bottom:var(--aia-scroll-arrow-bottom, 8px);z-index:4;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0 0 0 -16px;padding:0;border:0;border-radius:0;background:transparent;color:var( --aia-scroll-arrow-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );box-shadow:none;cursor:pointer;pointer-events:none;opacity:0;transition:opacity 1s cubic-bezier(.4,0,.2,1);animation:magicx-aia-scroll-arrow-bob 2.6s ease-in-out infinite}@keyframes magicx-aia-scroll-arrow-bob{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}.magicx-aia-scroll-arrow[data-aia-visible]{pointer-events:auto;opacity:1}.magicx-aia-scroll-arrow:disabled{cursor:default}.magicx-aia-scroll-arrow svg{width:14px;height:14px;fill:none;stroke:currentColor}.magicx-aia-scroll-arrow svg path{fill:none;stroke:currentColor}.magicx-aia-scroll-arrow:hover{color:var( --aia-scroll-arrow-color-hover, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}@media (prefers-reduced-motion: reduce){.magicx-aia-scroll-arrow,.magicx-aia-dropdown{animation-duration:0s;animation-delay:0s;transition-duration:0s}}.magicx-aia-dropdown-pillbar{overflow:hidden}.magicx-aia-pill-scroll{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%);-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%)}.magicx-aia-pill-scroll::-webkit-scrollbar{display:none}.magicx-aia-skip{display:inline-flex;align-items:center;margin-inline-start:auto;flex-shrink:0;padding:5px 8px;border:none;border-radius:6px;background:transparent;font-family:inherit;font-size:var(--aia-skip-font-size, 10px);line-height:18px;color:var(--aia-skip-color, var(--aia-footer-hint-color, #505050));cursor:pointer;white-space:nowrap;transition:color .15s ease-out,background-color .15s ease-out}.magicx-aia-skip:hover{color:var(--aia-skip-color-hover, var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)));background:var(--aia-skip-hover-bg, var(--aia-option-bg, transparent))}.magicx-aia-skip:disabled{pointer-events:none;cursor:default;opacity:.5}.magicx-aia-footer{display:flex;flex-direction:column;gap:8px;padding:var(--aia-footer-gap, 12px) 0 0 8px;position:relative;z-index:3;pointer-events:none}.magicx-aia-footer-row{display:flex;align-items:center;justify-content:space-between;min-height:var(--aia-footer-row-min-height, var(--aia-footer-row-height, 23px))}.magicx-aia-footer-hint-group{display:inline-flex;align-items:center;gap:5px}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{pointer-events:auto}.magicx-aia-footer-brand-link{display:inline-flex;align-items:center;gap:2px;text-decoration:none;cursor:pointer;transition:opacity .15s ease-out}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{background:var( --aia-footer-chip-bg, color-mix(in srgb, var(--aia-surface, #ffffff) 65%, transparent) );padding-inline:4px;border-radius:6px}.magicx-aia-footer-brand-link{background:var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));border-radius:999px;padding:2px 4px;gap:4px}.magicx-aia-footer-brand-link:hover{opacity:.7}.magicx-aia-footer-key{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:22px;padding:2px 6px;border:.5px solid var(--aia-footer-hint-color, #505050);border-radius:5px;font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-hint{font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-brand{font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}.magicx-aia-footer-badge{display:inline-flex;align-items:center;height:var(--aia-footer-row-height, 23px);padding:2.5px 5.5px;border:.5px solid var(--aia-footer-badge-border, rgba(189, 189, 189, .51));border-radius:999px;font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}@media (max-width: 768px){.magicx-aia-footer-hint-group{display:none}.magicx-aia-footer-row{justify-content:flex-end}}.magicx-aia-dropdown-skeleton-bars{display:flex;flex-direction:column;gap:20px;padding:7px 8px;animation:aiaSkeletonBarsIn .1s ease-out}[data-aia-skeleton-exiting] .magicx-aia-dropdown-skeleton-bars{animation:aiaSkeletonBarsOut .1s ease-in forwards}@keyframes aiaSkeletonBarsOut{to{opacity:0}}@keyframes aiaSkeletonBarsIn{0%{opacity:0}}.magicx-aia-dropdown-skeleton-bar{display:block;height:14px;border-radius:999px;background:var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, .25)));opacity:.5;animation:aiaDropdownSkeletonPulse 1.4s ease-in-out infinite}.magicx-aia-dropdown-skeleton-bar:nth-child(2){animation-delay:.15s}.magicx-aia-dropdown-skeleton-bar:nth-child(3){animation-delay:.3s}@keyframes aiaDropdownSkeletonPulse{0%,to{opacity:.5}50%{opacity:.25}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: PillListComponent, selector: "aia-pill-list", inputs: ["pills", "activePillIndex", "rounded", "loading", "activeSelected"], outputs: ["selectPill"] }, { kind: "component", type: ProductStripComponent, selector: "aia-product-strip", inputs: ["products", "listboxId", "focusable", "layout", "imageFallback", "strings", "addToCart"], outputs: ["select", "focusChange"] }, { kind: "component", type: SuggestionGridComponent, selector: "aia-suggestion-grid", inputs: ["options", "activeIndex", "listboxId", "loading", "groupKey", "optionsPosition", "showIcons", "showImages", "showCounts"], outputs: ["select", "highlight", "unhighlight"] }, { kind: "component", type: DateGridComponent, selector: "aia-date-grid", inputs: ["options", "activeIndex", "listboxId", "view", "selection"], outputs: ["select", "highlight", "unhighlight", "previousMonth", "nextMonth"] }, { kind: "component", type: StackComponent, selector: "aia-stack", inputs: ["space", "align"] }, { kind: "component", type: ClusterComponent, selector: "aia-cluster", inputs: ["gap", "align", "justify", "noWrap", "inline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1259
1358
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AIAutocompleteDropdownComponent, decorators: [{
|
|
1260
1359
|
type: Component,
|
|
1261
1360
|
args: [{ selector: "ai-autocomplete-dropdown", standalone: true, imports: [
|
|
@@ -1266,7 +1365,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1266
1365
|
DateGridComponent,
|
|
1267
1366
|
StackComponent,
|
|
1268
1367
|
ClusterComponent,
|
|
1269
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n *ngIf=\"vm$ | async as vm\"\n #dropdownRoot\n [id]=\"controller.listboxId\"\n role=\"listbox\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-aia-skeleton-exiting]=\"vm.skeletonExiting ? '' : null\"\n [attr.data-mode]=\"resolvedMode\"\n [attr.data-options-position]=\"vm.optionsPosition\"\n [attr.data-aia-has-products]=\"vm.products.length > 0 ? '' : null\"\n [class]=\"rootClass\"\n [class.magicx-aia-dropdown-visible]=\"vm.isVisible\"\n (mousedown)=\"preventBlur($event)\"\n>\n <aia-stack space=\"8px\">\n <aia-cluster\n *ngIf=\"vm.showsPills || vm.showsSkip\"\n class=\"magicx-aia-dropdown-pillbar\"\n data-aia-pillbar=\"\"\n [noWrap]=\"true\"\n >\n <!-- The scroll + right-edge fade live on this wrapper (not the bar) so\n the skip button stays outside the masked region \u2014 pinned and fully\n opaque while overflowing pills fade under it. Absent in a skip-only\n row (pills rendered elsewhere via pillPlacement inline/hidden). -->\n <span *ngIf=\"vm.showsPills\" class=\"magicx-aia-pill-scroll\" data-aia-pill-scroll=\"\">\n <aia-pill-list\n [pills]=\"vm.pills\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"vm.isActivePillSelected\"\n [rounded]=\"true\"\n [loading]=\"vm.isLoading\"\n (selectPill)=\"onPillClick($event)\"\n ></aia-pill-list>\n </span>\n <button\n *ngIf=\"vm.showsSkip\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-skip\"\n data-aia-skip=\"\"\n [disabled]=\"vm.skipDisabled\"\n [attr.aria-label]=\"\n vm.activePillLabel ? vm.strings.skipLabel + ' ' + vm.activePillLabel : vm.strings.skipLabel\n \"\n (click)=\"onSkip()\"\n >\n {{ vm.strings.skip }}\n </button>\n </aia-cluster>\n\n <aia-suggestion-grid\n *ngIf=\"vm.showsOptions\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [loading]=\"vm.isLoading\"\n [groupKey]=\"vm.groupKey\"\n [optionsPosition]=\"vm.optionsPosition\"\n [showIcons]=\"vm.showOptionIcons\"\n [showImages]=\"vm.showOptionImages\"\n [showCounts]=\"vm.showOptionCounts\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n ></aia-suggestion-grid>\n\n <aia-date-grid\n *ngIf=\"vm.showsDateGrid\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [view]=\"vm.dateView\"\n [selection]=\"vm.dateSelection\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <div\n *ngIf=\"vm.showsFallbackSkeleton\"\n class=\"magicx-aia-dropdown-skeleton-bars\"\n data-aia-skeleton-bars=\"\"\n >\n <span\n *ngFor=\"let w of fallbackSkeletonBarWidths; trackBy: trackByWidth\"\n class=\"magicx-aia-dropdown-skeleton-bar\"\n [style.width.px]=\"w\"\n ></span>\n </div>\n\n <!-- *ngIf, not just the section's own guard inside the component: the host\n element is an in-flow child of .aia-stack (display:flex; gap:8px), so\n an always-instantiated zero-height host would add a SECOND 8px gap\n between the grid and the footer \u2014 in every dropdown, products or not.\n The grid's --aia-grid-overlap-bottom is tuned for exactly one gap, so\n the footer would land 8px below the band it is meant to cover. -->\n <aia-product-strip\n *ngIf=\"vm.products.length > 0\"\n [products]=\"vm.products\"\n [listboxId]=\"controller.listboxId\"\n [focusable]=\"vm.isVisible\"\n [layout]=\"productsLayout\"\n [imageFallback]=\"productImageFallback\"\n [strings]=\"vm.strings\"\n (select)=\"onProductSelect($event)\"\n (focusChange)=\"onProductFocusChange($event)\"\n ></aia-product-strip>\n\n <footer class=\"magicx-aia-footer\" data-aia-footer=\"\">\n <div class=\"magicx-aia-footer-row\">\n <span class=\"magicx-aia-footer-hint-group\">\n <kbd class=\"magicx-aia-footer-key\">{{ vm.footerKey }}</kbd>\n <span class=\"magicx-aia-footer-hint\">{{ vm.footerHint }}</span>\n </span>\n <a\n class=\"magicx-aia-footer-brand-link\"\n [href]=\"brandHref\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span class=\"magicx-aia-footer-brand\">AI</span>\n <span class=\"magicx-aia-footer-badge\">Autocomplete</span>\n </a>\n </div>\n </footer>\n </aia-stack>\n <!-- \"More below\" arrow \u2014 an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's scroll-arrow controller (see\n syncScrollArrow); markup mirrors vanilla's createScrollArrowButton. -->\n <button\n #scrollArrow\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-scroll-arrow\"\n data-aia-scroll-arrow=\"\"\n [attr.aria-label]=\"scrollArrowLabel\"\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M4 6.5 8 10.5l4-4\" />\n </svg>\n </button>\n</div>\n", styles: [":where(.magicx-aia){box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html),:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):before,:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):after{all:revert;box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-dropdown]):not(html):not(html):not(html):not(html):not(html){line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-align:start;text-shadow:none;font-style:normal;font-variant:normal;white-space:normal;visibility:visible;cursor:auto}:where([data-aia-input-wrapper] svg,[data-aia-dropdown] svg):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){display:revert;vertical-align:revert;position:revert;inset:revert;float:revert;margin:revert;padding:revert;border:revert;border-radius:revert;outline:revert;background:revert;box-shadow:revert;min-width:revert;max-width:revert;min-height:revert;max-height:revert;flex:revert;transition:revert;animation:revert;rotate:revert;scale:revert;translate:revert}:where([data-aia-input-wrapper] svg *,[data-aia-dropdown] svg *):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){transition:revert;animation:revert}:where(.magicx-aia){--aia-primitive-neutral-0: #000000;--aia-primitive-neutral-150: #1a1b1d;--aia-primitive-neutral-250: #323232;--aia-primitive-neutral-300: #333539;--aia-primitive-neutral-400: #4a4a4a;--aia-primitive-neutral-500: #505050;--aia-primitive-neutral-700: #b0b0b0;--aia-primitive-neutral-750: #bdbdbd;--aia-primitive-neutral-900: #e7e7e7;--aia-primitive-neutral-1000: #ffffff;--aia-primitive-blue-50: #eef2ff;--aia-primitive-neutral-750-a50: rgba(189, 189, 189, .51);--aia-primitive-neutral-750-a25: rgba(189, 189, 189, .25);--aia-primitive-neutral-750-a8: rgba(189, 189, 189, .083);--aia-primitive-neutral-750-a35: rgba(189, 189, 189, .35);--aia-primitive-neutral-750-a30: rgba(189, 189, 189, .3);--aia-primitive-neutral-750-a15: rgba(189, 189, 189, .15);--aia-primitive-neutral-750-a105: rgba(189, 189, 189, .105);--aia-primitive-neutral-700-a40: rgba(176, 176, 176, .4);--aia-primitive-neutral-900-a50: rgba(231, 231, 231, .5);--aia-primitive-neutral-400-a50: rgba(74, 74, 74, .5)}:where(.magicx-aia),:where(.magicx-aia[data-mode=\"light\"]){--aia-surface: var(--aia-primitive-neutral-1000);--aia-border: var(--aia-primitive-neutral-700);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-900-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-300);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #b84549;--aia-smart-suggestion-glint: #f3c4c5;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a105);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-0);--aia-option-bg: var(--aia-primitive-blue-50);--aia-option-color: var(--aia-primitive-neutral-150);--aia-option-color-selected: var(--aia-primitive-neutral-0);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-0);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #000000);--aia-submit-bg: var(--aia-primitive-neutral-0);--aia-submit-color: var(--aia-primitive-neutral-1000);--aia-color-text-muted: #6b7280;--aia-skeleton-bg: var(--aia-primitive-neutral-750-a8);--aia-streak-rgb: 99, 102, 241;--aia-footer-hint-color: var(--aia-primitive-neutral-500);--aia-footer-brand-color: var(--aia-primitive-neutral-700);--aia-footer-badge-border: var(--aia-primitive-neutral-750-a50)}:where(.magicx-aia[data-mode=\"dark\"]){--aia-surface: var(--aia-primitive-neutral-0);--aia-border: var(--aia-primitive-neutral-500);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-400-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-700);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #e0787b;--aia-smart-suggestion-glint: #ffe1e1;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a15);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-1000);--aia-option-bg: var(--aia-primitive-neutral-250);--aia-option-color: var(--aia-primitive-neutral-900);--aia-option-color-selected: var(--aia-primitive-neutral-1000);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-1000);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #ffffff);--aia-submit-bg: var(--aia-primitive-neutral-1000);--aia-submit-color: var(--aia-primitive-neutral-0);--aia-color-text-muted: #c1c4cb;--aia-skeleton-bg: var(--aia-primitive-neutral-150);--aia-streak-rgb: 255, 255, 255;--aia-footer-hint-color: var(--aia-primitive-neutral-700);--aia-footer-brand-color: var(--aia-primitive-neutral-500);--aia-footer-badge-border: var(--aia-primitive-neutral-500)}[data-aia-dropdown]{--aia-footer-row-height: 23px;--aia-footer-band: calc(var(--aia-footer-gap, 12px) + var(--aia-footer-row-height, 23px));--aia-grid-scroll-bottom: var(--aia-footer-band);--aia-grid-overlap-bottom: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-lead: 20px;--aia-footer-fade-inset: calc(-1 * var(--aia-footer-fade-lead)) 0 0}[data-aia-dropdown] [data-aia-pillbar] .aia-pill-list{padding-inline:10px}[data-aia-dropdown] [data-aia-pillbar] .aia-pill{justify-content:flex-start;border-inline-width:0;padding-inline:0}[data-aia-dropdown] .aia-grid[data-scroll]{padding-top:var(--aia-grid-scroll-top, 0);padding-bottom:var(--aia-grid-scroll-bottom, 0);margin-top:var(--aia-grid-overlap-top, 0);margin-bottom:var(--aia-grid-overlap-bottom, 0)}[data-aia-dropdown] [data-aia-footer]:before{content:\"\";position:absolute;inset:var(--aia-footer-fade-inset, -20px 0 0);z-index:-1;pointer-events:none;background:linear-gradient(to bottom,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}[data-aia-dropdown][data-aia-surface=glass]{--aia-footer-chip-bg: transparent}[data-aia-dropdown][data-aia-surface=glass] [data-aia-footer]:before{display:none}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown],[data-aia-dropdown][data-options-position=above]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: var(--aia-footer-band);--aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));transform-origin:50% 100%;top:auto;bottom:100%;margin-top:0;margin-bottom:6px}[data-aia-dropdown][data-aia-has-products]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .aia-stack,[data-aia-dropdown][data-options-position=above] .aia-stack{flex-direction:column-reverse}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer],[data-aia-dropdown][data-options-position=above] [data-aia-footer]{padding:0 0 var(--aia-footer-gap, 12px) 8px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before{background:linear-gradient(to top,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .magicx-aia-footer,[data-aia-dropdown][data-options-position=above] .magicx-aia-footer{flex-direction:column-reverse}@media (min-width: 769px){[data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before,:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before{inset:0;background:var(--aia-surface, #ffffff)}}[data-aia-dropdown][data-aia-fit]{max-height:var(--aia-dropdown-fit-height, none);--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}[data-aia-dropdown][data-aia-fit]>.aia-stack{flex:1 1 auto;min-height:0;margin-inline:-6px;padding-inline:6px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}[data-aia-dropdown][data-aia-fit]>.aia-stack::-webkit-scrollbar{display:none}[data-aia-dropdown][data-aia-fit]>.aia-stack>*{flex-shrink:0}[data-aia-dropdown][data-aia-fit] .aia-grid[data-scroll]{max-height:none;overflow:visible}\n", ".magicx-aia-dropdown{position:absolute;left:0;right:0;top:100%;max-width:544px;margin-top:6px;display:flex;flex-direction:column;box-sizing:border-box;padding:10px 8px 10px max(0px,calc(var(--aia-content-inset-left, 16px) - 10px));overflow:hidden;container-type:inline-size;z-index:10;opacity:0;pointer-events:none;transform-origin:50% 0;transform:scaleY(var(--aia-dropdown-reveal-scale, .02));transition:opacity .4s cubic-bezier(.4,0,.2,1),transform 0s .4s;background:var(--aia-surface, #ffffff);border:1px solid var(--aia-dropdown-border, rgba(231, 231, 231, .5));border-radius:9px;box-shadow:var(--aia-dropdown-shadow, none)}.magicx-aia-dropdown:has([data-aia-datepicker]){max-width:var(--aia-date-panel-width, 312px)}.magicx-aia-dropdown[data-aia-surface=glass]{background:transparent;border-color:transparent;box-shadow:#fff -3.2px -3.2px 3.2px -3.2px inset,#fff 6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) -6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) 6.4px -6.4px 1.6px -8px inset,#ffffff26 -1.6px 0 0 -1.6px inset,#ffffff26 0 -1.6px 0 -1.6px inset,#ffffff4d 0 1.6px inset,#ffffff4d 1.6px 0 inset,inset 0 0 30px 5px #0000000d;backdrop-filter:blur(30px)}.magicx-aia-dropdown-visible{opacity:1;pointer-events:auto;transform:scaleY(1);transition:opacity .1s cubic-bezier(.4,0,.2,1),transform .32s cubic-bezier(.22,1.28,.36,1)}.magicx-aia-scroll-arrow{position:absolute;left:50%;bottom:var(--aia-scroll-arrow-bottom, 8px);z-index:4;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0 0 0 -16px;padding:0;border:0;border-radius:0;background:transparent;color:var( --aia-scroll-arrow-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );box-shadow:none;cursor:pointer;pointer-events:none;opacity:0;transition:opacity 1s cubic-bezier(.4,0,.2,1);animation:magicx-aia-scroll-arrow-bob 2.6s ease-in-out infinite}@keyframes magicx-aia-scroll-arrow-bob{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}.magicx-aia-scroll-arrow[data-aia-visible]{pointer-events:auto;opacity:1}.magicx-aia-scroll-arrow:disabled{cursor:default}.magicx-aia-scroll-arrow svg{width:14px;height:14px;fill:none;stroke:currentColor}.magicx-aia-scroll-arrow svg path{fill:none;stroke:currentColor}.magicx-aia-scroll-arrow:hover{color:var( --aia-scroll-arrow-color-hover, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}@media (prefers-reduced-motion: reduce){.magicx-aia-scroll-arrow,.magicx-aia-dropdown{animation-duration:0s;animation-delay:0s;transition-duration:0s}}.magicx-aia-dropdown-pillbar{overflow:hidden}.magicx-aia-pill-scroll{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%);-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%)}.magicx-aia-pill-scroll::-webkit-scrollbar{display:none}.magicx-aia-skip{display:inline-flex;align-items:center;margin-inline-start:auto;flex-shrink:0;padding:5px 8px;border:none;border-radius:6px;background:transparent;font-family:inherit;font-size:var(--aia-skip-font-size, 10px);line-height:18px;color:var(--aia-skip-color, var(--aia-footer-hint-color, #505050));cursor:pointer;white-space:nowrap;transition:color .15s ease-out,background-color .15s ease-out}.magicx-aia-skip:hover{color:var(--aia-skip-color-hover, var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)));background:var(--aia-skip-hover-bg, var(--aia-option-bg, transparent))}.magicx-aia-skip:disabled{pointer-events:none;cursor:default;opacity:.5}.magicx-aia-footer{display:flex;flex-direction:column;gap:8px;padding:var(--aia-footer-gap, 12px) 0 0 8px;position:relative;z-index:3;pointer-events:none}.magicx-aia-footer-row{display:flex;align-items:center;justify-content:space-between;min-height:var(--aia-footer-row-min-height, var(--aia-footer-row-height, 23px))}.magicx-aia-footer-hint-group{display:inline-flex;align-items:center;gap:5px}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{pointer-events:auto}.magicx-aia-footer-brand-link{display:inline-flex;align-items:center;gap:2px;text-decoration:none;cursor:pointer;transition:opacity .15s ease-out}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{background:var( --aia-footer-chip-bg, color-mix(in srgb, var(--aia-surface, #ffffff) 65%, transparent) );padding-inline:4px;border-radius:6px}.magicx-aia-footer-brand-link{background:var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));border-radius:999px;padding:2px 4px;gap:4px}.magicx-aia-footer-brand-link:hover{opacity:.7}.magicx-aia-footer-key{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:22px;padding:2px 6px;border:.5px solid var(--aia-footer-hint-color, #505050);border-radius:5px;font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-hint{font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-brand{font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}.magicx-aia-footer-badge{display:inline-flex;align-items:center;height:var(--aia-footer-row-height, 23px);padding:2.5px 5.5px;border:.5px solid var(--aia-footer-badge-border, rgba(189, 189, 189, .51));border-radius:999px;font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}@media (max-width: 768px){.magicx-aia-footer-hint-group{display:none}.magicx-aia-footer-row{justify-content:flex-end}}.magicx-aia-dropdown-skeleton-bars{display:flex;flex-direction:column;gap:20px;padding:7px 8px;animation:aiaSkeletonBarsIn .1s ease-out}[data-aia-skeleton-exiting] .magicx-aia-dropdown-skeleton-bars{animation:aiaSkeletonBarsOut .1s ease-in forwards}@keyframes aiaSkeletonBarsOut{to{opacity:0}}@keyframes aiaSkeletonBarsIn{0%{opacity:0}}.magicx-aia-dropdown-skeleton-bar{display:block;height:14px;border-radius:999px;background:var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, .25)));opacity:.5;animation:aiaDropdownSkeletonPulse 1.4s ease-in-out infinite}.magicx-aia-dropdown-skeleton-bar:nth-child(2){animation-delay:.15s}.magicx-aia-dropdown-skeleton-bar:nth-child(3){animation-delay:.3s}@keyframes aiaDropdownSkeletonPulse{0%,to{opacity:.5}50%{opacity:.25}}\n"] }]
|
|
1368
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n *ngIf=\"vm$ | async as vm\"\n #dropdownRoot\n [id]=\"controller.listboxId\"\n role=\"listbox\"\n data-aia-dropdown=\"\"\n [attr.data-aia-loading]=\"vm.isLoading ? '' : null\"\n [attr.data-aia-skeleton-exiting]=\"vm.skeletonExiting ? '' : null\"\n [attr.data-mode]=\"resolvedMode\"\n [attr.data-options-position]=\"vm.optionsPosition\"\n [attr.data-aia-has-products]=\"vm.products.length > 0 ? '' : null\"\n [class]=\"rootClass\"\n [class.magicx-aia-dropdown-visible]=\"vm.isVisible\"\n (mousedown)=\"preventBlur($event)\"\n>\n <aia-stack space=\"8px\">\n <aia-cluster\n *ngIf=\"vm.showsPills || vm.showsSkip\"\n class=\"magicx-aia-dropdown-pillbar\"\n data-aia-pillbar=\"\"\n [noWrap]=\"true\"\n >\n <!-- The scroll + right-edge fade live on this wrapper (not the bar) so\n the skip button stays outside the masked region \u2014 pinned and fully\n opaque while overflowing pills fade under it. Absent in a skip-only\n row (pills rendered elsewhere via pillPlacement inline/hidden). -->\n <span *ngIf=\"vm.showsPills\" class=\"magicx-aia-pill-scroll\" data-aia-pill-scroll=\"\">\n <aia-pill-list\n [pills]=\"vm.pills\"\n [activePillIndex]=\"0\"\n [activeSelected]=\"vm.isActivePillSelected\"\n [rounded]=\"true\"\n [loading]=\"vm.isLoading\"\n (selectPill)=\"onPillClick($event)\"\n ></aia-pill-list>\n </span>\n <button\n *ngIf=\"vm.showsSkip\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-skip\"\n data-aia-skip=\"\"\n [disabled]=\"vm.skipDisabled\"\n [attr.aria-label]=\"\n vm.activePillLabel ? vm.strings.skipLabel + ' ' + vm.activePillLabel : vm.strings.skipLabel\n \"\n (click)=\"onSkip()\"\n >\n {{ vm.strings.skip }}\n </button>\n </aia-cluster>\n\n <aia-suggestion-grid\n *ngIf=\"vm.showsOptions\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [loading]=\"vm.isLoading\"\n [groupKey]=\"vm.groupKey\"\n [optionsPosition]=\"vm.optionsPosition\"\n [showIcons]=\"vm.showOptionIcons\"\n [showImages]=\"vm.showOptionImages\"\n [showCounts]=\"vm.showOptionCounts\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n ></aia-suggestion-grid>\n\n <aia-date-grid\n *ngIf=\"vm.showsDateGrid\"\n [options]=\"vm.options\"\n [activeIndex]=\"vm.activeIndex\"\n [listboxId]=\"controller.listboxId\"\n [view]=\"vm.dateView\"\n [selection]=\"vm.dateSelection\"\n (select)=\"onSelect($event)\"\n (highlight)=\"onHighlight($event)\"\n (unhighlight)=\"onUnhighlight($event)\"\n (previousMonth)=\"onPreviousMonth()\"\n (nextMonth)=\"onNextMonth()\"\n ></aia-date-grid>\n\n <div\n *ngIf=\"vm.showsFallbackSkeleton\"\n class=\"magicx-aia-dropdown-skeleton-bars\"\n data-aia-skeleton-bars=\"\"\n >\n <span\n *ngFor=\"let w of fallbackSkeletonBarWidths; trackBy: trackByWidth\"\n class=\"magicx-aia-dropdown-skeleton-bar\"\n [style.width.px]=\"w\"\n ></span>\n </div>\n\n <!-- *ngIf, not just the section's own guard inside the component: the host\n element is an in-flow child of .aia-stack (display:flex; gap:8px), so\n an always-instantiated zero-height host would add a SECOND 8px gap\n between the grid and the footer \u2014 in every dropdown, products or not.\n The grid's --aia-grid-overlap-bottom is tuned for exactly one gap, so\n the footer would land 8px below the band it is meant to cover. -->\n <aia-product-strip\n *ngIf=\"vm.products.length > 0\"\n [products]=\"vm.products\"\n [listboxId]=\"controller.listboxId\"\n [focusable]=\"vm.isVisible\"\n [layout]=\"productsLayout\"\n [imageFallback]=\"productImageFallback\"\n [strings]=\"vm.strings\"\n [addToCart]=\"vm.hasProductAddToCart ? addProductToCart : null\"\n (select)=\"onProductSelect($event)\"\n (focusChange)=\"onProductFocusChange($event)\"\n ></aia-product-strip>\n\n <footer class=\"magicx-aia-footer\" data-aia-footer=\"\">\n <div class=\"magicx-aia-footer-row\">\n <span class=\"magicx-aia-footer-hint-group\">\n <kbd class=\"magicx-aia-footer-key\">{{ vm.footerKey }}</kbd>\n <span class=\"magicx-aia-footer-hint\">{{ vm.footerHint }}</span>\n </span>\n <a\n class=\"magicx-aia-footer-brand-link\"\n [href]=\"brandHref\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span class=\"magicx-aia-footer-brand\">AI</span>\n <span class=\"magicx-aia-footer-badge\">Autocomplete</span>\n </a>\n </div>\n </footer>\n </aia-stack>\n <!-- \"More below\" arrow \u2014 an overlay on the panel, not a section of the\n stack. Shown/positioned by the core's scroll-arrow controller (see\n syncScrollArrow); markup mirrors vanilla's createScrollArrowButton. -->\n <button\n #scrollArrow\n type=\"button\"\n tabindex=\"-1\"\n class=\"magicx-aia-scroll-arrow\"\n data-aia-scroll-arrow=\"\"\n [attr.aria-label]=\"scrollArrowLabel\"\n aria-hidden=\"true\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M4 6.5 8 10.5l4-4\" />\n </svg>\n </button>\n</div>\n", styles: [":where(.magicx-aia){box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html),:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):before,:where([data-aia-input-wrapper],[data-aia-input-wrapper] *,[data-aia-dropdown],[data-aia-dropdown] *):not(:where(svg,svg *,[data-aia-submit-slot],[data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html):after{all:revert;box-sizing:border-box}:where([data-aia-input-wrapper],[data-aia-dropdown]):not(html):not(html):not(html):not(html):not(html){line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-align:start;text-shadow:none;font-style:normal;font-variant:normal;white-space:normal;visibility:visible;cursor:auto}:where([data-aia-input-wrapper] svg,[data-aia-dropdown] svg):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){display:revert;vertical-align:revert;position:revert;inset:revert;float:revert;margin:revert;padding:revert;border:revert;border-radius:revert;outline:revert;background:revert;box-shadow:revert;min-width:revert;max-width:revert;min-height:revert;max-height:revert;flex:revert;transition:revert;animation:revert;rotate:revert;scale:revert;translate:revert}:where([data-aia-input-wrapper] svg *,[data-aia-dropdown] svg *):not(:where([data-aia-submit-slot] *)):not(html):not(html):not(html):not(html):not(html){transition:revert;animation:revert}:where(.magicx-aia){--aia-primitive-neutral-0: #000000;--aia-primitive-neutral-150: #1a1b1d;--aia-primitive-neutral-250: #323232;--aia-primitive-neutral-300: #333539;--aia-primitive-neutral-400: #4a4a4a;--aia-primitive-neutral-500: #505050;--aia-primitive-neutral-700: #b0b0b0;--aia-primitive-neutral-750: #bdbdbd;--aia-primitive-neutral-900: #e7e7e7;--aia-primitive-neutral-1000: #ffffff;--aia-primitive-blue-50: #eef2ff;--aia-primitive-neutral-750-a50: rgba(189, 189, 189, .51);--aia-primitive-neutral-750-a25: rgba(189, 189, 189, .25);--aia-primitive-neutral-750-a8: rgba(189, 189, 189, .083);--aia-primitive-neutral-750-a35: rgba(189, 189, 189, .35);--aia-primitive-neutral-750-a30: rgba(189, 189, 189, .3);--aia-primitive-neutral-750-a15: rgba(189, 189, 189, .15);--aia-primitive-neutral-750-a105: rgba(189, 189, 189, .105);--aia-primitive-neutral-700-a40: rgba(176, 176, 176, .4);--aia-primitive-neutral-900-a50: rgba(231, 231, 231, .5);--aia-primitive-neutral-400-a50: rgba(74, 74, 74, .5)}:where(.magicx-aia),:where(.magicx-aia[data-mode=\"light\"]){--aia-surface: var(--aia-primitive-neutral-1000);--aia-border: var(--aia-primitive-neutral-700);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-900-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-300);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #b84549;--aia-smart-suggestion-glint: #f3c4c5;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a105);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-0);--aia-option-bg: var(--aia-primitive-blue-50);--aia-option-color: var(--aia-primitive-neutral-150);--aia-option-color-selected: var(--aia-primitive-neutral-0);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-0);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #000000);--aia-submit-bg: var(--aia-primitive-neutral-0);--aia-submit-color: var(--aia-primitive-neutral-1000);--aia-color-text-muted: #6b7280;--aia-skeleton-bg: var(--aia-primitive-neutral-750-a8);--aia-streak-rgb: 99, 102, 241;--aia-footer-hint-color: var(--aia-primitive-neutral-500);--aia-footer-brand-color: var(--aia-primitive-neutral-700);--aia-footer-badge-border: var(--aia-primitive-neutral-750-a50)}:where(.magicx-aia[data-mode=\"dark\"]){--aia-surface: var(--aia-primitive-neutral-0);--aia-border: var(--aia-primitive-neutral-500);--aia-shadow: none;--aia-dropdown-border: var(--aia-primitive-neutral-400-a50);--aia-dropdown-shadow: none;--aia-pill-bg: var(--aia-primitive-neutral-750);--aia-pill-color: var(--aia-primitive-neutral-700);--aia-pill-font-size: 16px;--aia-smart-suggestion-accent: #e0787b;--aia-smart-suggestion-glint: #ffe1e1;--aia-completed-pill-bg: var(--aia-primitive-neutral-750-a15);--aia-completed-pill-bg-active: var(--aia-primitive-neutral-750-a35);--aia-completed-pill-color: var(--aia-primitive-neutral-1000);--aia-option-bg: var(--aia-primitive-neutral-250);--aia-option-color: var(--aia-primitive-neutral-900);--aia-option-color-selected: var(--aia-primitive-neutral-1000);--aia-option-font-size: 16px;--aia-written-text-color: var(--aia-primitive-neutral-1000);--aia-written-text-font-size: 16px;--aia-caret-color: var(--aia-written-text-color, #ffffff);--aia-submit-bg: var(--aia-primitive-neutral-1000);--aia-submit-color: var(--aia-primitive-neutral-0);--aia-color-text-muted: #c1c4cb;--aia-skeleton-bg: var(--aia-primitive-neutral-150);--aia-streak-rgb: 255, 255, 255;--aia-footer-hint-color: var(--aia-primitive-neutral-700);--aia-footer-brand-color: var(--aia-primitive-neutral-500);--aia-footer-badge-border: var(--aia-primitive-neutral-500)}[data-aia-dropdown]{--aia-footer-row-height: 23px;--aia-footer-band: calc(var(--aia-footer-gap, 12px) + var(--aia-footer-row-height, 23px));--aia-grid-scroll-bottom: var(--aia-footer-band);--aia-grid-overlap-bottom: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-lead: 20px;--aia-footer-fade-inset: calc(-1 * var(--aia-footer-fade-lead)) 0 0}[data-aia-dropdown] [data-aia-pillbar] .aia-pill-list{padding-inline:10px}[data-aia-dropdown] [data-aia-pillbar] .aia-pill{justify-content:flex-start;border-inline-width:0;padding-inline:0}[data-aia-dropdown] .aia-grid[data-scroll]{padding-top:var(--aia-grid-scroll-top, 0);padding-bottom:var(--aia-grid-scroll-bottom, 0);margin-top:var(--aia-grid-overlap-top, 0);margin-bottom:var(--aia-grid-overlap-bottom, 0)}[data-aia-dropdown] [data-aia-footer]:before{content:\"\";position:absolute;inset:var(--aia-footer-fade-inset, -20px 0 0);z-index:-1;pointer-events:none;background:linear-gradient(to bottom,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}[data-aia-dropdown][data-aia-surface=glass]{--aia-footer-chip-bg: transparent}[data-aia-dropdown][data-aia-surface=glass] [data-aia-footer]:before{display:none}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown],[data-aia-dropdown][data-options-position=above]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: var(--aia-footer-band);--aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));--aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));transform-origin:50% 100%;top:auto;bottom:100%;margin-top:0;margin-bottom:6px}[data-aia-dropdown][data-aia-has-products]{--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .aia-stack,[data-aia-dropdown][data-options-position=above] .aia-stack{flex-direction:column-reverse}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer],[data-aia-dropdown][data-options-position=above] [data-aia-footer]{padding:0 0 var(--aia-footer-gap, 12px) 8px}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before{background:linear-gradient(to top,transparent,var(--aia-surface, #ffffff) var(--aia-footer-fade-lead, 20px))}:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] .magicx-aia-footer,[data-aia-dropdown][data-options-position=above] .magicx-aia-footer{flex-direction:column-reverse}@media (min-width: 769px){[data-aia-dropdown] [data-aia-footer]:before,[data-aia-dropdown][data-options-position=above] [data-aia-footer]:before,:where(.magicx-aia[data-options-position=\"above\"]) [data-aia-dropdown] [data-aia-footer]:before{inset:0;background:var(--aia-surface, #ffffff)}}[data-aia-dropdown][data-aia-fit]{max-height:var(--aia-dropdown-fit-height, none);--aia-grid-scroll-bottom: 0px;--aia-grid-overlap-bottom: 0px;--aia-grid-scroll-top: 0px;--aia-grid-overlap-top: 0px;--aia-footer-fade-lead: 0px;--aia-footer-row-min-height: 0px}[data-aia-dropdown][data-aia-fit]>.aia-stack{flex:1 1 auto;min-height:0;margin-inline:-6px;padding-inline:6px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}[data-aia-dropdown][data-aia-fit]>.aia-stack::-webkit-scrollbar{display:none}[data-aia-dropdown][data-aia-fit]>.aia-stack>*{flex-shrink:0}[data-aia-dropdown][data-aia-fit] .aia-grid[data-scroll]{max-height:none;overflow:visible}\n", ".magicx-aia-dropdown{position:absolute;left:0;right:0;top:100%;max-width:544px;margin-top:6px;display:flex;flex-direction:column;box-sizing:border-box;padding:10px 8px 10px max(0px,calc(var(--aia-content-inset-left, 16px) - 10px));overflow:hidden;container-type:inline-size;z-index:10;opacity:0;pointer-events:none;transform-origin:50% 0;transform:scaleY(var(--aia-dropdown-reveal-scale, .02));transition:opacity .4s cubic-bezier(.4,0,.2,1),transform 0s .4s;background:var(--aia-surface, #ffffff);border:1px solid var(--aia-dropdown-border, rgba(231, 231, 231, .5));border-radius:9px;box-shadow:var(--aia-dropdown-shadow, none)}.magicx-aia-dropdown:has([data-aia-datepicker]){max-width:var(--aia-date-panel-width, 312px)}.magicx-aia-dropdown[data-aia-surface=glass]{background:transparent;border-color:transparent;box-shadow:#fff -3.2px -3.2px 3.2px -3.2px inset,#fff 6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) -6.4px 6.4px 1.6px -8px inset,var(--aia-dropdown-bg, transparent) 6.4px -6.4px 1.6px -8px inset,#ffffff26 -1.6px 0 0 -1.6px inset,#ffffff26 0 -1.6px 0 -1.6px inset,#ffffff4d 0 1.6px inset,#ffffff4d 1.6px 0 inset,inset 0 0 30px 5px #0000000d;backdrop-filter:blur(30px)}.magicx-aia-dropdown-visible{opacity:1;pointer-events:auto;transform:scaleY(1);transition:opacity .1s cubic-bezier(.4,0,.2,1),transform .32s cubic-bezier(.22,1.28,.36,1)}.magicx-aia-scroll-arrow{position:absolute;left:50%;bottom:var(--aia-scroll-arrow-bottom, 8px);z-index:4;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0 0 0 -16px;padding:0;border:0;border-radius:0;background:transparent;color:var( --aia-scroll-arrow-color, var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb)) );box-shadow:none;cursor:pointer;pointer-events:none;opacity:0;transition:opacity 1s cubic-bezier(.4,0,.2,1);animation:magicx-aia-scroll-arrow-bob 2.6s ease-in-out infinite}@keyframes magicx-aia-scroll-arrow-bob{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}.magicx-aia-scroll-arrow[data-aia-visible]{pointer-events:auto;opacity:1}.magicx-aia-scroll-arrow:disabled{cursor:default}.magicx-aia-scroll-arrow svg{width:14px;height:14px;fill:none;stroke:currentColor}.magicx-aia-scroll-arrow svg path{fill:none;stroke:currentColor}.magicx-aia-scroll-arrow:hover{color:var( --aia-scroll-arrow-color-hover, var(--aia-option-color-selected, var(--aia-color-text-default, #fff)) )}@media (prefers-reduced-motion: reduce){.magicx-aia-scroll-arrow,.magicx-aia-dropdown{animation-duration:0s;animation-delay:0s;transition-duration:0s}}.magicx-aia-dropdown-pillbar{overflow:hidden}.magicx-aia-pill-scroll{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%);-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - 48px),transparent 100%)}.magicx-aia-pill-scroll::-webkit-scrollbar{display:none}.magicx-aia-skip{display:inline-flex;align-items:center;margin-inline-start:auto;flex-shrink:0;padding:5px 8px;border:none;border-radius:6px;background:transparent;font-family:inherit;font-size:var(--aia-skip-font-size, 10px);line-height:18px;color:var(--aia-skip-color, var(--aia-footer-hint-color, #505050));cursor:pointer;white-space:nowrap;transition:color .15s ease-out,background-color .15s ease-out}.magicx-aia-skip:hover{color:var(--aia-skip-color-hover, var(--aia-pill-color, var(--aia-color-text-muted, #c1c4cb)));background:var(--aia-skip-hover-bg, var(--aia-option-bg, transparent))}.magicx-aia-skip:disabled{pointer-events:none;cursor:default;opacity:.5}.magicx-aia-footer{display:flex;flex-direction:column;gap:8px;padding:var(--aia-footer-gap, 12px) 0 0 8px;position:relative;z-index:3;pointer-events:none}.magicx-aia-footer-row{display:flex;align-items:center;justify-content:space-between;min-height:var(--aia-footer-row-min-height, var(--aia-footer-row-height, 23px))}.magicx-aia-footer-hint-group{display:inline-flex;align-items:center;gap:5px}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{pointer-events:auto}.magicx-aia-footer-brand-link{display:inline-flex;align-items:center;gap:2px;text-decoration:none;cursor:pointer;transition:opacity .15s ease-out}.magicx-aia-footer-hint-group,.magicx-aia-footer-brand-link{background:var( --aia-footer-chip-bg, color-mix(in srgb, var(--aia-surface, #ffffff) 65%, transparent) );padding-inline:4px;border-radius:6px}.magicx-aia-footer-brand-link{background:var(--aia-footer-brand-pill-bg, var(--aia-surface, #ffffff));border-radius:999px;padding:2px 4px;gap:4px}.magicx-aia-footer-brand-link:hover{opacity:.7}.magicx-aia-footer-key{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:22px;padding:2px 6px;border:.5px solid var(--aia-footer-hint-color, #505050);border-radius:5px;font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-hint{font-family:inherit;font-size:11px;line-height:18px;color:var(--aia-footer-hint-color, #505050)}.magicx-aia-footer-brand{font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}.magicx-aia-footer-badge{display:inline-flex;align-items:center;height:var(--aia-footer-row-height, 23px);padding:2.5px 5.5px;border:.5px solid var(--aia-footer-badge-border, rgba(189, 189, 189, .51));border-radius:999px;font-family:inherit;font-size:10px;line-height:18px;color:var(--aia-footer-brand-color, #b0b0b0)}@media (max-width: 768px){.magicx-aia-footer-hint-group{display:none}.magicx-aia-footer-row{justify-content:flex-end}}.magicx-aia-dropdown-skeleton-bars{display:flex;flex-direction:column;gap:20px;padding:7px 8px;animation:aiaSkeletonBarsIn .1s ease-out}[data-aia-skeleton-exiting] .magicx-aia-dropdown-skeleton-bars{animation:aiaSkeletonBarsOut .1s ease-in forwards}@keyframes aiaSkeletonBarsOut{to{opacity:0}}@keyframes aiaSkeletonBarsIn{0%{opacity:0}}.magicx-aia-dropdown-skeleton-bar{display:block;height:14px;border-radius:999px;background:var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, .25)));opacity:.5;animation:aiaDropdownSkeletonPulse 1.4s ease-in-out infinite}.magicx-aia-dropdown-skeleton-bar:nth-child(2){animation-delay:.15s}.magicx-aia-dropdown-skeleton-bar:nth-child(3){animation-delay:.3s}@keyframes aiaDropdownSkeletonPulse{0%,to{opacity:.5}50%{opacity:.25}}\n"] }]
|
|
1270
1369
|
}], propDecorators: { controller: [{
|
|
1271
1370
|
type: Input
|
|
1272
1371
|
}], showPills: [{
|
|
@@ -1344,6 +1443,7 @@ class AIAutocompleteController {
|
|
|
1344
1443
|
// here and fold it into `dropdown$` so the dropdown can read placement from
|
|
1345
1444
|
// the controller — configured once, kept in sync through update().
|
|
1346
1445
|
this.optionsPosition$ = new BehaviorSubject("below");
|
|
1446
|
+
this.hasProductAddToCart$ = new BehaviorSubject(false);
|
|
1347
1447
|
this.isDestroyed = false;
|
|
1348
1448
|
if (typeof document === "undefined") {
|
|
1349
1449
|
throw new Error("AIAutocompleteController requires a browser environment. " +
|
|
@@ -1352,7 +1452,10 @@ class AIAutocompleteController {
|
|
|
1352
1452
|
// Headless mode never renders to the host, so a throwaway div is fine —
|
|
1353
1453
|
// it's required by the core's signature for symmetry with full mode.
|
|
1354
1454
|
const host = document.createElement("div");
|
|
1355
|
-
|
|
1455
|
+
const { onProductAddToCart } = opts, coreOpts = __rest(opts, ["onProductAddToCart"]);
|
|
1456
|
+
this.productAddToCart = onProductAddToCart;
|
|
1457
|
+
this.hasProductAddToCart$.next(typeof onProductAddToCart === "function");
|
|
1458
|
+
this.core = new AIAutocomplete(host, Object.assign(Object.assign({}, coreOpts), { onProductAddToCart: (product) => { var _a; return (_a = this.productAddToCart) === null || _a === void 0 ? void 0 : _a.call(this, product); }, renderMode: "headless", source: (_a = opts.source) !== null && _a !== void 0 ? _a : "headless-sdk",
|
|
1356
1459
|
// Headless mode never renders the dropdown DOM, but the keyboard
|
|
1357
1460
|
// controller still reads `optionsPosition` to decide which vertical
|
|
1358
1461
|
// arrow opens the dropdown from the input.
|
|
@@ -1420,7 +1523,11 @@ class AIAutocompleteController {
|
|
|
1420
1523
|
// at the pre-click position.
|
|
1421
1524
|
this.state$ = this.rawState$.pipe(map$1(computeState), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1422
1525
|
this.optionsPosition$.next((_c = opts.optionsPosition) !== null && _c !== void 0 ? _c : "below");
|
|
1423
|
-
this.dropdown$ = combineLatest([
|
|
1526
|
+
this.dropdown$ = combineLatest([
|
|
1527
|
+
this.rawState$,
|
|
1528
|
+
this.optionsPosition$,
|
|
1529
|
+
this.hasProductAddToCart$,
|
|
1530
|
+
]).pipe(map$1(([s, optionsPosition, hasCart]) => computeDropdown(s, optionsPosition, hasCart)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1424
1531
|
}
|
|
1425
1532
|
// === Read-only accessors ===
|
|
1426
1533
|
/** Stable ARIA listbox ID for the dropdown. Pass to `<textarea aria-controls="...">`. */
|
|
@@ -1464,6 +1571,12 @@ class AIAutocompleteController {
|
|
|
1464
1571
|
return;
|
|
1465
1572
|
this.core.reset();
|
|
1466
1573
|
}
|
|
1574
|
+
/** Prepare the typed word before you build a submit result from your own button. */
|
|
1575
|
+
prepareSubmit() {
|
|
1576
|
+
if (this.isDestroyed)
|
|
1577
|
+
return;
|
|
1578
|
+
this.core.prepareSubmit();
|
|
1579
|
+
}
|
|
1467
1580
|
/**
|
|
1468
1581
|
* Records a submit in telemetry. Enter is recorded by the SDK; call this
|
|
1469
1582
|
* from a submit button you render, so each submit is counted once.
|
|
@@ -1493,6 +1606,22 @@ class AIAutocompleteController {
|
|
|
1493
1606
|
return;
|
|
1494
1607
|
this.core.selectProduct(product);
|
|
1495
1608
|
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Add a product to the cart through `onProductAddToCart`.
|
|
1611
|
+
* `<ai-autocomplete-dropdown>`'s cart buttons call this for you; consumers
|
|
1612
|
+
* rendering their own strip call it themselves. Resolves once the handler's
|
|
1613
|
+
* promise settles and rejects with its error. Without a handler it does
|
|
1614
|
+
* nothing.
|
|
1615
|
+
*/
|
|
1616
|
+
addProductToCart(product) {
|
|
1617
|
+
if (this.isDestroyed || !this.productAddToCart)
|
|
1618
|
+
return Promise.resolve();
|
|
1619
|
+
return this.core.addProductToCart(product);
|
|
1620
|
+
}
|
|
1621
|
+
/** Whether cards draw a cart button: an `onProductAddToCart` handler is set. */
|
|
1622
|
+
hasProductAddToCart() {
|
|
1623
|
+
return typeof this.productAddToCart === "function";
|
|
1624
|
+
}
|
|
1496
1625
|
/** Promote the pill at `index` to active (front of the list). */
|
|
1497
1626
|
setActivePill(index) {
|
|
1498
1627
|
if (this.isDestroyed)
|
|
@@ -1625,12 +1754,19 @@ class AIAutocompleteController {
|
|
|
1625
1754
|
* (`onSubmit`, `onResult`, `onError`, etc.) cannot be swapped this way — they are
|
|
1626
1755
|
* registered once at construction (matches the React hook's design). For
|
|
1627
1756
|
* dynamic event reactivity, subscribe to the corresponding observable
|
|
1628
|
-
* (e.g. `text$` instead of `onChange`).
|
|
1757
|
+
* (e.g. `text$` instead of `onChange`). The exception is
|
|
1758
|
+
* `onProductAddToCart`, a handler rather than an event: passing the key sets,
|
|
1759
|
+
* swaps or (with `undefined`) removes it, and the cart buttons follow.
|
|
1629
1760
|
*/
|
|
1630
1761
|
update(opts) {
|
|
1631
1762
|
if (this.isDestroyed)
|
|
1632
1763
|
return;
|
|
1633
|
-
|
|
1764
|
+
const { onProductAddToCart } = opts, coreOpts = __rest(opts, ["onProductAddToCart"]);
|
|
1765
|
+
if ("onProductAddToCart" in opts) {
|
|
1766
|
+
this.productAddToCart = onProductAddToCart;
|
|
1767
|
+
this.hasProductAddToCart$.next(typeof onProductAddToCart === "function");
|
|
1768
|
+
}
|
|
1769
|
+
this.core.update(coreOpts);
|
|
1634
1770
|
if (opts.optionsPosition !== undefined) {
|
|
1635
1771
|
this.optionsPosition$.next(opts.optionsPosition);
|
|
1636
1772
|
}
|
|
@@ -1697,7 +1833,7 @@ function computeState(s) {
|
|
|
1697
1833
|
caretOffset: s.caretOffset,
|
|
1698
1834
|
};
|
|
1699
1835
|
}
|
|
1700
|
-
function computeDropdown(s, optionsPosition) {
|
|
1836
|
+
function computeDropdown(s, optionsPosition, hasProductAddToCart) {
|
|
1701
1837
|
var _a, _b;
|
|
1702
1838
|
const editingParam = s.editingParam;
|
|
1703
1839
|
const editingIdentified = s.editingIdentified;
|
|
@@ -1744,6 +1880,7 @@ function computeDropdown(s, optionsPosition) {
|
|
|
1744
1880
|
selectedDateRange: dateSelection.selectedRange,
|
|
1745
1881
|
dateRangeStart: dateSelection.rangeStart,
|
|
1746
1882
|
optionsPosition,
|
|
1883
|
+
hasProductAddToCart,
|
|
1747
1884
|
};
|
|
1748
1885
|
}
|
|
1749
1886
|
|
|
@@ -2233,6 +2370,7 @@ class AIAutocompleteComponent {
|
|
|
2233
2370
|
onParamsChange: (params) => this.completedParamsChange.emit(params),
|
|
2234
2371
|
onFocus: () => this.focused.emit(),
|
|
2235
2372
|
onProductSelect: (product) => this.productSelect.emit(product),
|
|
2373
|
+
onProductAddToCart: this.onProductAddToCart,
|
|
2236
2374
|
onBlur: () => {
|
|
2237
2375
|
this.blurred.emit();
|
|
2238
2376
|
this.onTouchedFn();
|
|
@@ -2329,6 +2467,9 @@ class AIAutocompleteComponent {
|
|
|
2329
2467
|
mapProducts: this.mapProducts,
|
|
2330
2468
|
});
|
|
2331
2469
|
}
|
|
2470
|
+
if (changes["onProductAddToCart"]) {
|
|
2471
|
+
this.controller.update({ onProductAddToCart: this.onProductAddToCart });
|
|
2472
|
+
}
|
|
2332
2473
|
if (changes["mode"]) {
|
|
2333
2474
|
// Keep the binding correct even when ModeController doesn't exist yet
|
|
2334
2475
|
// (SSR / pre-ngAfterViewInit). On the browser, setMode triggers the
|
|
@@ -2495,9 +2636,8 @@ class AIAutocompleteComponent {
|
|
|
2495
2636
|
const state = this.controller.getState();
|
|
2496
2637
|
if (!this.canSubmit(state))
|
|
2497
2638
|
return;
|
|
2498
|
-
|
|
2499
|
-
// the
|
|
2500
|
-
// can take either entry point.
|
|
2639
|
+
this.controller.prepareSubmit();
|
|
2640
|
+
// Use the same handler for button clicks and Enter.
|
|
2501
2641
|
this.handleSubmit({
|
|
2502
2642
|
query: state.text.trim(),
|
|
2503
2643
|
raw_query: "",
|
|
@@ -2532,7 +2672,7 @@ class AIAutocompleteComponent {
|
|
|
2532
2672
|
}
|
|
2533
2673
|
}
|
|
2534
2674
|
AIAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AIAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2535
|
-
AIAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AIAutocompleteComponent, isStandalone: true, selector: "ai-autocomplete", inputs: { apiConfig: "apiConfig", additionalContext: "additionalContext", language: "language", currency: "currency", productId: "productId", visitorId: "visitorId", optionOverrides: "optionOverrides", maskCompletedText: "maskCompletedText", columns: "columns", pillPlacement: "pillPlacement", mode: "mode", optionsPosition: "optionsPosition", animations: "animations", dropdownTrigger: "dropdownTrigger", closeDropdownOnBlur: "closeDropdownOnBlur", showNonTappableOptions: "showNonTappableOptions", showSkipButton: "showSkipButton", showOptionIcons: "showOptionIcons", showOptionImages: "showOptionImages", showOptionCounts: "showOptionCounts", productsLayout: "productsLayout", productImageFallback: "productImageFallback", showChipIcons: "showChipIcons", showChipImages: "showChipImages", autoFocus: "autoFocus", value: "value", completedParams: "completedParams", showProducts: "showProducts", products: "products", mapProducts: "mapProducts", submitButton: "submitButton", resetOnSubmit: "resetOnSubmit" }, outputs: { submitted: "submitted", resultChange: "resultChange", errored: "errored", valueChange: "valueChange", completedParamsChange: "completedParamsChange", focused: "focused", blurred: "blurred", productSelect: "productSelect" }, providers: [
|
|
2675
|
+
AIAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AIAutocompleteComponent, isStandalone: true, selector: "ai-autocomplete", inputs: { apiConfig: "apiConfig", additionalContext: "additionalContext", language: "language", currency: "currency", productId: "productId", visitorId: "visitorId", optionOverrides: "optionOverrides", maskCompletedText: "maskCompletedText", columns: "columns", pillPlacement: "pillPlacement", mode: "mode", optionsPosition: "optionsPosition", animations: "animations", dropdownTrigger: "dropdownTrigger", closeDropdownOnBlur: "closeDropdownOnBlur", showNonTappableOptions: "showNonTappableOptions", showSkipButton: "showSkipButton", showOptionIcons: "showOptionIcons", showOptionImages: "showOptionImages", showOptionCounts: "showOptionCounts", productsLayout: "productsLayout", productImageFallback: "productImageFallback", showChipIcons: "showChipIcons", showChipImages: "showChipImages", autoFocus: "autoFocus", value: "value", completedParams: "completedParams", showProducts: "showProducts", products: "products", mapProducts: "mapProducts", onProductAddToCart: "onProductAddToCart", submitButton: "submitButton", resetOnSubmit: "resetOnSubmit" }, outputs: { submitted: "submitted", resultChange: "resultChange", errored: "errored", valueChange: "valueChange", completedParamsChange: "completedParamsChange", focused: "focused", blurred: "blurred", productSelect: "productSelect" }, providers: [
|
|
2536
2676
|
{
|
|
2537
2677
|
provide: NG_VALUE_ACCESSOR,
|
|
2538
2678
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
@@ -2616,6 +2756,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2616
2756
|
type: Input
|
|
2617
2757
|
}], mapProducts: [{
|
|
2618
2758
|
type: Input
|
|
2759
|
+
}], onProductAddToCart: [{
|
|
2760
|
+
type: Input
|
|
2619
2761
|
}], submitButton: [{
|
|
2620
2762
|
type: Input
|
|
2621
2763
|
}], resetOnSubmit: [{
|