@magicx-eng/ai-autocomplete-angular 0.35.0 → 0.37.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 +4 -0
- package/esm2020/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.mjs +6 -5
- package/esm2020/lib/controller/ai-autocomplete.controller.mjs +4 -4
- package/esm2020/lib/internal/suggestion-item/suggestion-item.component.mjs +12 -4
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +17 -8
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +17 -8
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.d.ts.map +1 -1
- package/lib/controller/ai-autocomplete.controller.d.ts.map +1 -1
- package/lib/internal/suggestion-item/suggestion-item.component.d.ts +7 -0
- package/lib/internal/suggestion-item/suggestion-item.component.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
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, uiStringsFor, productInitial, productImageSources as productImageSources$1, attachProductRowWheel, optionsGridTemplateColumns, optionLabel as optionLabel$1, optionImageSources as optionImageSources$1, formatOptionCount as formatOptionCount$1, sanitizeOptionIconSvg as sanitizeOptionIconSvg$1, planOptionsGrid, sameOptionRows, isOptionsGridMobileViewport, needsOptionsGridMeasurement, measureOptionsGrid, optionEnterDelayMs, buildAttributionUrl, containScroll, attachScrollArrow, attachViewportFit, isCalendarFormat, getFooterHint, AIAutocomplete, 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, 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, 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';
|
|
@@ -555,6 +555,14 @@ class SuggestionItemComponent {
|
|
|
555
555
|
if (this.enterDelay === null)
|
|
556
556
|
this.enterDelay = value;
|
|
557
557
|
}
|
|
558
|
+
/** The label split so the typed fragment's match can be drawn in bold. */
|
|
559
|
+
get parts() {
|
|
560
|
+
return highlightParts(this.label, this.option.matchedText);
|
|
561
|
+
}
|
|
562
|
+
/** `parts` is rebuilt on every check, so its nodes are kept by position. */
|
|
563
|
+
trackByIndex(index) {
|
|
564
|
+
return index;
|
|
565
|
+
}
|
|
558
566
|
/** The option's text. `icon` is the icon's name and is never shown as text. */
|
|
559
567
|
get label() {
|
|
560
568
|
return optionLabel$1(this.option);
|
|
@@ -640,10 +648,10 @@ class SuggestionItemComponent {
|
|
|
640
648
|
}
|
|
641
649
|
}
|
|
642
650
|
SuggestionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SuggestionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
643
|
-
SuggestionItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SuggestionItemComponent, isStandalone: true, selector: "aia-suggestion-item", inputs: { option: "option", isHighlighted: "isHighlighted", id: "id", loading: "loading", showIcon: "showIcon", showImage: "showImage", showCount: "showCount", scrollHint: "scrollHint", enterDelayMs: "enterDelayMs" }, outputs: { select: "select", highlight: "highlight", unhighlight: "unhighlight" }, ngImport: i0, template: "<div\n [id]=\"id\"\n role=\"option\"\n data-aia-option=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-icon]=\"iconHtml && option.icon ? option.icon : null\"\n [attr.data-aia-image]=\"imageSrc ? '' : null\"\n [attr.data-aia-item-count]=\"countLabel !== null ? option.item_count : null\"\n [attr.aria-selected]=\"isHighlighted\"\n class=\"aia-suggestion-item\"\n [style.--aia-option-enter-delay]=\"(enterDelay ?? 0) + 'ms'\"\n [class.aia-suggestion-item-highlighted]=\"isHighlighted && !loading\"\n [class.aia-suggestion-item-tappable]=\"option.is_tappable\"\n [class.aia-suggestion-item-non-tappable]=\"!option.is_tappable\"\n [class.aia-suggestion-item-pressed]=\"pressed\"\n [class.aia-suggestion-item-scroll-hint]=\"scrollHint\"\n [attr.tabindex]=\"loading || !option.is_tappable ? -1 : 0\"\n (click)=\"onSelect()\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n>\n <span class=\"aia-suggestion-content\">\n <!-- The tile keeps a placeholder fill under the picture, so a slow or\n failed load leaves a neutral square rather than a gap. The picture is\n decorative: the text is the option's accessible name. -->\n <span *ngIf=\"imageSrc as src\" class=\"aia-suggestion-image\" aria-hidden=\"true\">\n <img\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n [hidden]=\"imageFailed\"\n (error)=\"onImageError()\"\n />\n </span>\n <span\n *ngIf=\"iconHtml\"\n class=\"aia-suggestion-icon\"\n aria-hidden=\"true\"\n [innerHTML]=\"iconHtml\"\n ></span>\n <span class=\"aia-suggestion-text\">{{
|
|
651
|
+
SuggestionItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SuggestionItemComponent, isStandalone: true, selector: "aia-suggestion-item", inputs: { option: "option", isHighlighted: "isHighlighted", id: "id", loading: "loading", showIcon: "showIcon", showImage: "showImage", showCount: "showCount", scrollHint: "scrollHint", enterDelayMs: "enterDelayMs" }, outputs: { select: "select", highlight: "highlight", unhighlight: "unhighlight" }, ngImport: i0, template: "<div\n [id]=\"id\"\n role=\"option\"\n data-aia-option=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-icon]=\"iconHtml && option.icon ? option.icon : null\"\n [attr.data-aia-image]=\"imageSrc ? '' : null\"\n [attr.data-aia-item-count]=\"countLabel !== null ? option.item_count : null\"\n [attr.aria-selected]=\"isHighlighted\"\n class=\"aia-suggestion-item\"\n [style.--aia-option-enter-delay]=\"(enterDelay ?? 0) + 'ms'\"\n [class.aia-suggestion-item-highlighted]=\"isHighlighted && !loading\"\n [class.aia-suggestion-item-tappable]=\"option.is_tappable\"\n [class.aia-suggestion-item-non-tappable]=\"!option.is_tappable\"\n [class.aia-suggestion-item-pressed]=\"pressed\"\n [class.aia-suggestion-item-scroll-hint]=\"scrollHint\"\n [attr.tabindex]=\"loading || !option.is_tappable ? -1 : 0\"\n (click)=\"onSelect()\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n>\n <span class=\"aia-suggestion-content\">\n <!-- The tile keeps a placeholder fill under the picture, so a slow or\n failed load leaves a neutral square rather than a gap. The picture is\n decorative: the text is the option's accessible name. -->\n <span *ngIf=\"imageSrc as src\" class=\"aia-suggestion-image\" aria-hidden=\"true\">\n <img\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n [hidden]=\"imageFailed\"\n (error)=\"onImageError()\"\n />\n </span>\n <span\n *ngIf=\"iconHtml\"\n class=\"aia-suggestion-icon\"\n aria-hidden=\"true\"\n [innerHTML]=\"iconHtml\"\n ></span>\n <span class=\"aia-suggestion-text\"\n ><ng-container *ngFor=\"let part of parts; trackBy: trackByIndex\"\n ><strong *ngIf=\"part.bold; else plain\">{{ part.text }}</strong\n ><ng-template #plain>{{ part.text }}</ng-template></ng-container\n ></span\n >\n <span *ngIf=\"option.tag\" class=\"aia-suggestion-tag\">{{ option.tag }}</span>\n <!-- Part of the row's accessible name, read after the option's text. -->\n <span *ngIf=\"countLabel !== null\" class=\"aia-suggestion-count\">{{ countLabel }}</span>\n </span>\n</div>\n", styles: [".aia-suggestion-item{position:relative;overflow:hidden;overflow:clip;display:flex;align-items:flex-start;font-family:inherit;font-size:var(--aia-option-font-size, 16px);font-weight:450;line-height:21px;color:var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));white-space:normal;word-break:break-word;border-radius:8px;padding:8px 10px}@keyframes aiaSuggestionFadeIn{0%{opacity:0}}@keyframes aiaSuggestionRiseIn{0%{transform:translateY(16px)}}@media (prefers-reduced-motion: reduce){.aia-suggestion-item,.aia-suggestion-content{animation-duration:0s;animation-delay:0s}}.aia-suggestion-content{position:relative;z-index:2;animation:aiaSuggestionRiseIn .28s cubic-bezier(.25,.46,.45,.94) both,aiaSuggestionFadeIn .15s ease-out both;animation-delay:var(--aia-option-enter-delay, 0ms)}.aia-suggestion-item-tappable{cursor:pointer}.aia-suggestion-item-tappable:hover{color:var(--aia-option-color-selected, var(--aia-color-text-default, #fff))}.aia-suggestion-item-non-tappable{cursor:default}.aia-suggestion-item-highlighted{color:var(--aia-option-color-selected, var(--aia-color-text-default, #fff));background:var(--aia-option-bg, transparent);font-weight:500}.aia-suggestion-tag{font-size:11px;margin-left:6px;opacity:.5}.aia-suggestion-item-pressed{color:var(--aia-option-color-selected, var(--aia-color-text-default, #fff));animation:aiaPressCompress .17s ease forwards}[role=listbox]:has(.aia-suggestion-item-pressed) .aia-suggestion-item:not(.aia-suggestion-item-pressed){opacity:.35;transition:opacity 60ms ease}@keyframes aiaPressCompress{0%{transform:scale(1)}25%{transform:scale(.93)}60%{transform:scale(.93)}to{transform:scale(1)}}.aia-suggestion-item-scroll-hint .aia-suggestion-content{mask-image:linear-gradient(to bottom,rgb(0 0 0),rgb(0 0 0 / .6))}[data-aia-fit] .aia-suggestion-item-scroll-hint .aia-suggestion-content{mask-image:none}.aia-suggestion-item[data-aia-loading]{cursor:default;animation:aiaSuggestionSkeletonPulse 1.4s ease-in-out infinite}.aia-suggestion-item[data-aia-loading] .aia-suggestion-text{color:transparent;background:var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, .25)));border-radius:999px;-webkit-box-decoration-break:clone;box-decoration-break:clone;animation:aiaSkeletonBarIn .1s ease-out}.aia-suggestion-item[data-aia-loading] .aia-suggestion-tag{display:none}.aia-suggestion-icon{display:inline-flex;align-items:center;height:21px;margin-right:8px;vertical-align:top;will-change:transform}.aia-suggestion-icon svg{display:block;width:1em;height:1em}.aia-suggestion-item[data-aia-loading] .aia-suggestion-icon{visibility:hidden}.aia-suggestion-content:not(:has(.aia-suggestion-count)):has(.aia-suggestion-icon){padding-left:calc(1em + 8px);text-indent:calc(-1em - 8px)}.aia-suggestion-content:has(.aia-suggestion-image),.aia-suggestion-content:has(.aia-suggestion-count){display:flex;flex:1 1 auto;align-items:flex-start;min-width:0}.aia-suggestion-content:has(.aia-suggestion-image) .aia-suggestion-text,.aia-suggestion-content:has(.aia-suggestion-count) .aia-suggestion-text{flex:1 1 auto;min-width:0}.aia-suggestion-item[data-aia-loading] .aia-suggestion-content .aia-suggestion-text{flex:0 1 auto}.aia-suggestion-content:has(.aia-suggestion-image){align-items:center;gap:var(--aia-option-image-gap, 12px)}.aia-suggestion-image{flex:0 0 auto;display:block;width:var(--aia-option-image-size, 40px);height:var(--aia-option-image-size, 40px);border-radius:var(--aia-option-image-radius, 12px);overflow:hidden;background:var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, .083)))}.aia-suggestion-image img{display:block;width:100%;height:100%;object-fit:cover}.aia-suggestion-image img[hidden]{display:none}.aia-suggestion-count{flex:0 0 auto;margin-left:auto;padding-left:12px;font-size:var(--aia-option-count-font-size, 12px);font-weight:400;line-height:21px;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--aia-option-count-color, inherit);opacity:var(--aia-option-count-opacity, .6)}.aia-suggestion-count:after{content:\" \" var(--aia-option-count-unit, \"items\")}.aia-suggestion-item[data-aia-item-count=\"1\"] .aia-suggestion-count:after{content:\" \" var(--aia-option-count-unit-one, var(--aia-option-count-unit, \"item\"))}.aia-suggestion-item[data-aia-loading] .aia-suggestion-image img{visibility:hidden}.aia-suggestion-item[data-aia-loading] .aia-suggestion-count{display:none}[data-aia-group]:has(.aia-suggestion-image){--aia-option-row-height: calc(var(--aia-option-image-size, 40px) + 16px)}[data-aia-group]:has(.aia-suggestion-image) .aia-suggestion-content:not(:has(.aia-suggestion-image)){display:flex;flex:1 1 auto;align-items:center;gap:var(--aia-option-image-gap, 12px);min-width:0;min-height:var(--aia-option-image-size, 40px);padding-left:0;text-indent:0}[data-aia-group]:has(.aia-suggestion-image) .aia-suggestion-content:not(:has(.aia-suggestion-image)) .aia-suggestion-icon{flex:0 0 auto;justify-content:center;width:var(--aia-option-image-size, 40px);height:var(--aia-option-image-size, 40px);margin-right:0}[data-aia-group]:has(.aia-suggestion-image) .aia-suggestion-content:not(:has(.aia-suggestion-image)) .aia-suggestion-icon svg{width:var(--aia-option-tile-icon-size, 1.5em);height:var(--aia-option-tile-icon-size, 1.5em)}@keyframes aiaSuggestionSkeletonPulse{0%,to{filter:brightness(1)}50%{filter:brightness(.55)}}[data-aia-skeleton-exiting] .aia-suggestion-item[data-aia-loading] .aia-suggestion-content,[data-aia-skeleton-exiting] .aia-suggestion-item[data-aia-loading] .aia-suggestion-text{animation:none}[data-aia-skeleton-exiting] .aia-suggestion-item[data-aia-loading]{animation:aiaSkeletonOut .1s ease-in forwards}@keyframes aiaSkeletonBarIn{0%{background-color:transparent;color:inherit}}@keyframes aiaSkeletonOut{to{opacity:0}}\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 });
|
|
644
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SuggestionItemComponent, decorators: [{
|
|
645
653
|
type: Component,
|
|
646
|
-
args: [{ selector: "aia-suggestion-item", standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n [id]=\"id\"\n role=\"option\"\n data-aia-option=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-icon]=\"iconHtml && option.icon ? option.icon : null\"\n [attr.data-aia-image]=\"imageSrc ? '' : null\"\n [attr.data-aia-item-count]=\"countLabel !== null ? option.item_count : null\"\n [attr.aria-selected]=\"isHighlighted\"\n class=\"aia-suggestion-item\"\n [style.--aia-option-enter-delay]=\"(enterDelay ?? 0) + 'ms'\"\n [class.aia-suggestion-item-highlighted]=\"isHighlighted && !loading\"\n [class.aia-suggestion-item-tappable]=\"option.is_tappable\"\n [class.aia-suggestion-item-non-tappable]=\"!option.is_tappable\"\n [class.aia-suggestion-item-pressed]=\"pressed\"\n [class.aia-suggestion-item-scroll-hint]=\"scrollHint\"\n [attr.tabindex]=\"loading || !option.is_tappable ? -1 : 0\"\n (click)=\"onSelect()\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n>\n <span class=\"aia-suggestion-content\">\n <!-- The tile keeps a placeholder fill under the picture, so a slow or\n failed load leaves a neutral square rather than a gap. The picture is\n decorative: the text is the option's accessible name. -->\n <span *ngIf=\"imageSrc as src\" class=\"aia-suggestion-image\" aria-hidden=\"true\">\n <img\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n [hidden]=\"imageFailed\"\n (error)=\"onImageError()\"\n />\n </span>\n <span\n *ngIf=\"iconHtml\"\n class=\"aia-suggestion-icon\"\n aria-hidden=\"true\"\n [innerHTML]=\"iconHtml\"\n ></span>\n <span class=\"aia-suggestion-text\">{{
|
|
654
|
+
args: [{ selector: "aia-suggestion-item", standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n [id]=\"id\"\n role=\"option\"\n data-aia-option=\"\"\n [attr.data-aia-loading]=\"loading ? '' : null\"\n [attr.data-aia-icon]=\"iconHtml && option.icon ? option.icon : null\"\n [attr.data-aia-image]=\"imageSrc ? '' : null\"\n [attr.data-aia-item-count]=\"countLabel !== null ? option.item_count : null\"\n [attr.aria-selected]=\"isHighlighted\"\n class=\"aia-suggestion-item\"\n [style.--aia-option-enter-delay]=\"(enterDelay ?? 0) + 'ms'\"\n [class.aia-suggestion-item-highlighted]=\"isHighlighted && !loading\"\n [class.aia-suggestion-item-tappable]=\"option.is_tappable\"\n [class.aia-suggestion-item-non-tappable]=\"!option.is_tappable\"\n [class.aia-suggestion-item-pressed]=\"pressed\"\n [class.aia-suggestion-item-scroll-hint]=\"scrollHint\"\n [attr.tabindex]=\"loading || !option.is_tappable ? -1 : 0\"\n (click)=\"onSelect()\"\n (keydown)=\"onKeyDown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n>\n <span class=\"aia-suggestion-content\">\n <!-- The tile keeps a placeholder fill under the picture, so a slow or\n failed load leaves a neutral square rather than a gap. The picture is\n decorative: the text is the option's accessible name. -->\n <span *ngIf=\"imageSrc as src\" class=\"aia-suggestion-image\" aria-hidden=\"true\">\n <img\n [src]=\"src\"\n alt=\"\"\n loading=\"lazy\"\n decoding=\"async\"\n referrerpolicy=\"no-referrer\"\n draggable=\"false\"\n [hidden]=\"imageFailed\"\n (error)=\"onImageError()\"\n />\n </span>\n <span\n *ngIf=\"iconHtml\"\n class=\"aia-suggestion-icon\"\n aria-hidden=\"true\"\n [innerHTML]=\"iconHtml\"\n ></span>\n <span class=\"aia-suggestion-text\"\n ><ng-container *ngFor=\"let part of parts; trackBy: trackByIndex\"\n ><strong *ngIf=\"part.bold; else plain\">{{ part.text }}</strong\n ><ng-template #plain>{{ part.text }}</ng-template></ng-container\n ></span\n >\n <span *ngIf=\"option.tag\" class=\"aia-suggestion-tag\">{{ option.tag }}</span>\n <!-- Part of the row's accessible name, read after the option's text. -->\n <span *ngIf=\"countLabel !== null\" class=\"aia-suggestion-count\">{{ countLabel }}</span>\n </span>\n</div>\n", styles: [".aia-suggestion-item{position:relative;overflow:hidden;overflow:clip;display:flex;align-items:flex-start;font-family:inherit;font-size:var(--aia-option-font-size, 16px);font-weight:450;line-height:21px;color:var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));white-space:normal;word-break:break-word;border-radius:8px;padding:8px 10px}@keyframes aiaSuggestionFadeIn{0%{opacity:0}}@keyframes aiaSuggestionRiseIn{0%{transform:translateY(16px)}}@media (prefers-reduced-motion: reduce){.aia-suggestion-item,.aia-suggestion-content{animation-duration:0s;animation-delay:0s}}.aia-suggestion-content{position:relative;z-index:2;animation:aiaSuggestionRiseIn .28s cubic-bezier(.25,.46,.45,.94) both,aiaSuggestionFadeIn .15s ease-out both;animation-delay:var(--aia-option-enter-delay, 0ms)}.aia-suggestion-item-tappable{cursor:pointer}.aia-suggestion-item-tappable:hover{color:var(--aia-option-color-selected, var(--aia-color-text-default, #fff))}.aia-suggestion-item-non-tappable{cursor:default}.aia-suggestion-item-highlighted{color:var(--aia-option-color-selected, var(--aia-color-text-default, #fff));background:var(--aia-option-bg, transparent);font-weight:500}.aia-suggestion-tag{font-size:11px;margin-left:6px;opacity:.5}.aia-suggestion-item-pressed{color:var(--aia-option-color-selected, var(--aia-color-text-default, #fff));animation:aiaPressCompress .17s ease forwards}[role=listbox]:has(.aia-suggestion-item-pressed) .aia-suggestion-item:not(.aia-suggestion-item-pressed){opacity:.35;transition:opacity 60ms ease}@keyframes aiaPressCompress{0%{transform:scale(1)}25%{transform:scale(.93)}60%{transform:scale(.93)}to{transform:scale(1)}}.aia-suggestion-item-scroll-hint .aia-suggestion-content{mask-image:linear-gradient(to bottom,rgb(0 0 0),rgb(0 0 0 / .6))}[data-aia-fit] .aia-suggestion-item-scroll-hint .aia-suggestion-content{mask-image:none}.aia-suggestion-item[data-aia-loading]{cursor:default;animation:aiaSuggestionSkeletonPulse 1.4s ease-in-out infinite}.aia-suggestion-item[data-aia-loading] .aia-suggestion-text{color:transparent;background:var(--aia-skeleton-bg, var(--aia-pill-bg, rgba(189, 189, 189, .25)));border-radius:999px;-webkit-box-decoration-break:clone;box-decoration-break:clone;animation:aiaSkeletonBarIn .1s ease-out}.aia-suggestion-item[data-aia-loading] .aia-suggestion-tag{display:none}.aia-suggestion-icon{display:inline-flex;align-items:center;height:21px;margin-right:8px;vertical-align:top;will-change:transform}.aia-suggestion-icon svg{display:block;width:1em;height:1em}.aia-suggestion-item[data-aia-loading] .aia-suggestion-icon{visibility:hidden}.aia-suggestion-content:not(:has(.aia-suggestion-count)):has(.aia-suggestion-icon){padding-left:calc(1em + 8px);text-indent:calc(-1em - 8px)}.aia-suggestion-content:has(.aia-suggestion-image),.aia-suggestion-content:has(.aia-suggestion-count){display:flex;flex:1 1 auto;align-items:flex-start;min-width:0}.aia-suggestion-content:has(.aia-suggestion-image) .aia-suggestion-text,.aia-suggestion-content:has(.aia-suggestion-count) .aia-suggestion-text{flex:1 1 auto;min-width:0}.aia-suggestion-item[data-aia-loading] .aia-suggestion-content .aia-suggestion-text{flex:0 1 auto}.aia-suggestion-content:has(.aia-suggestion-image){align-items:center;gap:var(--aia-option-image-gap, 12px)}.aia-suggestion-image{flex:0 0 auto;display:block;width:var(--aia-option-image-size, 40px);height:var(--aia-option-image-size, 40px);border-radius:var(--aia-option-image-radius, 12px);overflow:hidden;background:var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, .083)))}.aia-suggestion-image img{display:block;width:100%;height:100%;object-fit:cover}.aia-suggestion-image img[hidden]{display:none}.aia-suggestion-count{flex:0 0 auto;margin-left:auto;padding-left:12px;font-size:var(--aia-option-count-font-size, 12px);font-weight:400;line-height:21px;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--aia-option-count-color, inherit);opacity:var(--aia-option-count-opacity, .6)}.aia-suggestion-count:after{content:\" \" var(--aia-option-count-unit, \"items\")}.aia-suggestion-item[data-aia-item-count=\"1\"] .aia-suggestion-count:after{content:\" \" var(--aia-option-count-unit-one, var(--aia-option-count-unit, \"item\"))}.aia-suggestion-item[data-aia-loading] .aia-suggestion-image img{visibility:hidden}.aia-suggestion-item[data-aia-loading] .aia-suggestion-count{display:none}[data-aia-group]:has(.aia-suggestion-image){--aia-option-row-height: calc(var(--aia-option-image-size, 40px) + 16px)}[data-aia-group]:has(.aia-suggestion-image) .aia-suggestion-content:not(:has(.aia-suggestion-image)){display:flex;flex:1 1 auto;align-items:center;gap:var(--aia-option-image-gap, 12px);min-width:0;min-height:var(--aia-option-image-size, 40px);padding-left:0;text-indent:0}[data-aia-group]:has(.aia-suggestion-image) .aia-suggestion-content:not(:has(.aia-suggestion-image)) .aia-suggestion-icon{flex:0 0 auto;justify-content:center;width:var(--aia-option-image-size, 40px);height:var(--aia-option-image-size, 40px);margin-right:0}[data-aia-group]:has(.aia-suggestion-image) .aia-suggestion-content:not(:has(.aia-suggestion-image)) .aia-suggestion-icon svg{width:var(--aia-option-tile-icon-size, 1.5em);height:var(--aia-option-tile-icon-size, 1.5em)}@keyframes aiaSuggestionSkeletonPulse{0%,to{filter:brightness(1)}50%{filter:brightness(.55)}}[data-aia-skeleton-exiting] .aia-suggestion-item[data-aia-loading] .aia-suggestion-content,[data-aia-skeleton-exiting] .aia-suggestion-item[data-aia-loading] .aia-suggestion-text{animation:none}[data-aia-skeleton-exiting] .aia-suggestion-item[data-aia-loading]{animation:aiaSkeletonOut .1s ease-in forwards}@keyframes aiaSkeletonBarIn{0%{background-color:transparent;color:inherit}}@keyframes aiaSkeletonOut{to{opacity:0}}\n"] }]
|
|
647
655
|
}], propDecorators: { option: [{
|
|
648
656
|
type: Input
|
|
649
657
|
}], isHighlighted: [{
|
|
@@ -1092,7 +1100,7 @@ class AIAutocompleteDropdownComponent {
|
|
|
1092
1100
|
// row holding just the button. Hidden while the input is empty — the
|
|
1093
1101
|
// footer hint doesn't advertise "→ to skip" until the user has typed,
|
|
1094
1102
|
// so the pristine starting state stays free of the affordance too.
|
|
1095
|
-
const showsSkip = dd.pills
|
|
1103
|
+
const showsSkip = hasSkippablePill(dd.pills) && showSkipButton && !dd.isEditing && !dd.isInputEmpty;
|
|
1096
1104
|
// Exactly one body renders. `options` above already holds the visible
|
|
1097
1105
|
// month's cells when this is a date — the core swapped them in its
|
|
1098
1106
|
// derive layer — so the two are the same list drawn two different
|
|
@@ -1124,9 +1132,10 @@ class AIAutocompleteDropdownComponent {
|
|
|
1124
1132
|
}
|
|
1125
1133
|
const optionHighlighted = dd.activeIndex >= 0 && Boolean(options[dd.activeIndex]?.is_tappable);
|
|
1126
1134
|
const strings = uiStringsFor(language);
|
|
1135
|
+
const pills = labelTraditionalAutocomplete(dd.pills, strings.keepTyping);
|
|
1127
1136
|
const { key: footerKey, hint: footerHint } = getFooterHint(optionHighlighted, dd.isInputEmpty, strings);
|
|
1128
1137
|
const content = {
|
|
1129
|
-
pills
|
|
1138
|
+
pills,
|
|
1130
1139
|
options,
|
|
1131
1140
|
activeIndex: dd.activeIndex,
|
|
1132
1141
|
isActivePillSelected: dd.isActivePillSelected,
|
|
@@ -1135,7 +1144,7 @@ class AIAutocompleteDropdownComponent {
|
|
|
1135
1144
|
showsPills,
|
|
1136
1145
|
showsSkip,
|
|
1137
1146
|
skipDisabled: dd.isLoading || Boolean(dd.inSelectionAnimation),
|
|
1138
|
-
activePillLabel:
|
|
1147
|
+
activePillLabel: pills[0]?.text ?? "",
|
|
1139
1148
|
showsOptions,
|
|
1140
1149
|
showsDateGrid,
|
|
1141
1150
|
dateView: dd.dateView ?? null,
|
|
@@ -1340,7 +1349,7 @@ class AIAutocompleteController {
|
|
|
1340
1349
|
this.completedParams$ = deriveField(this.rawState$, (s) => s.completedParams, arrEq);
|
|
1341
1350
|
this.skippedParams$ = deriveField(this.rawState$, (s) => s.skippedParams, arrEq);
|
|
1342
1351
|
this.identifiedParams$ = deriveField(this.rawState$, (s) => s.identifiedParams, arrEq);
|
|
1343
|
-
this.suggestionPills$ = deriveField(this.rawState$, (s) => s.actionableSuggestions, arrEq);
|
|
1352
|
+
this.suggestionPills$ = deriveField(this.rawState$, (s) => withoutTraditionalAutocomplete(s.actionableSuggestions), arrEq);
|
|
1344
1353
|
this.segments$ = deriveField(this.rawState$, (s) => s.segments, arrEq);
|
|
1345
1354
|
this.newParamId$ = deriveField(this.rawState$, (s) => s.newParamId);
|
|
1346
1355
|
this.suggestions$ = deriveField(this.rawState$, (s) => s.suggestions, arrEq);
|
|
@@ -1626,7 +1635,7 @@ function computeState(s) {
|
|
|
1626
1635
|
completedParams: s.completedParams,
|
|
1627
1636
|
skippedParams: s.skippedParams,
|
|
1628
1637
|
identifiedParams: s.identifiedParams,
|
|
1629
|
-
suggestionPills: s.actionableSuggestions,
|
|
1638
|
+
suggestionPills: withoutTraditionalAutocomplete(s.actionableSuggestions),
|
|
1630
1639
|
segments: s.segments,
|
|
1631
1640
|
newParamId: s.newParamId,
|
|
1632
1641
|
suggestions: s.suggestions,
|