@magicx-eng/ai-autocomplete-angular 0.38.4 → 0.39.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.
@@ -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, 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';
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, 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';
@@ -735,6 +735,13 @@ class SuggestionGridComponent {
735
735
  */
736
736
  this.trackByOptionText = (_, opt) => `${this.groupKey}\0${opt.text}`;
737
737
  }
738
+ /**
739
+ * Icons and pictures are all-or-nothing across the list — no single row can
740
+ * decide its own (see `optionsShowLeadingVisuals`).
741
+ */
742
+ get leadingVisuals() {
743
+ return optionsShowLeadingVisuals$1(this.options, this.showIcons, this.showImages);
744
+ }
738
745
  // Re-measure when the viewport changes (breakpoint or width both matter to
739
746
  // the two-column fit).
740
747
  onResize() {
@@ -796,10 +803,10 @@ class SuggestionGridComponent {
796
803
  }
797
804
  }
798
805
  SuggestionGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SuggestionGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
799
- SuggestionGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SuggestionGridComponent, isStandalone: true, selector: "aia-suggestion-grid", inputs: { options: "options", activeIndex: "activeIndex", listboxId: "listboxId", loading: "loading", groupKey: "groupKey", optionsPosition: "optionsPosition", showIcons: "showIcons", showImages: "showImages", showCounts: "showCounts" }, outputs: { select: "select", highlight: "highlight", unhighlight: "unhighlight" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "gridComp", first: true, predicate: GridComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- max=\"1fr\": columns share out the full width, so a lone column spans the\n whole options box instead of stopping at 250px. -->\n<aia-grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n [scroll]=\"true\"\n [scrollResetKey]=\"groupKey\"\n [template]=\"plan.template\"\n [maxHeight]=\"plan.maxHeight\"\n [group]=\"groupKey\"\n>\n <aia-suggestion-item\n *ngFor=\"let option of options; trackBy: trackByOptionText; let i = index\"\n [option]=\"option\"\n [isHighlighted]=\"i === activeIndex\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [showIcon]=\"showIcons\"\n [showImage]=\"showImages\"\n [showCount]=\"showCounts\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (highlight)=\"highlight.emit(i)\"\n (unhighlight)=\"unhighlight.emit(i)\"\n ></aia-suggestion-item>\n</aia-grid>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: GridComponent, selector: "aia-grid", inputs: ["min", "max", "gap", "scroll", "maxHeight", "scrollResetKey", "cols", "template", "group"] }, { kind: "component", type: SuggestionItemComponent, selector: "aia-suggestion-item", inputs: ["option", "isHighlighted", "id", "loading", "showIcon", "showImage", "showCount", "scrollHint", "enterDelayMs"], outputs: ["select", "highlight", "unhighlight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
806
+ SuggestionGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SuggestionGridComponent, isStandalone: true, selector: "aia-suggestion-grid", inputs: { options: "options", activeIndex: "activeIndex", listboxId: "listboxId", loading: "loading", groupKey: "groupKey", optionsPosition: "optionsPosition", showIcons: "showIcons", showImages: "showImages", showCounts: "showCounts" }, outputs: { select: "select", highlight: "highlight", unhighlight: "unhighlight" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "gridComp", first: true, predicate: GridComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- max=\"1fr\": columns share out the full width, so a lone column spans the\n whole options box instead of stopping at 250px. -->\n<aia-grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n [scroll]=\"true\"\n [scrollResetKey]=\"groupKey\"\n [template]=\"plan.template\"\n [maxHeight]=\"plan.maxHeight\"\n [group]=\"groupKey\"\n>\n <aia-suggestion-item\n *ngFor=\"let option of options; trackBy: trackByOptionText; let i = index\"\n [option]=\"option\"\n [isHighlighted]=\"i === activeIndex\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [showIcon]=\"showIcons && leadingVisuals\"\n [showImage]=\"showImages && leadingVisuals\"\n [showCount]=\"showCounts\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (highlight)=\"highlight.emit(i)\"\n (unhighlight)=\"unhighlight.emit(i)\"\n ></aia-suggestion-item>\n</aia-grid>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: GridComponent, selector: "aia-grid", inputs: ["min", "max", "gap", "scroll", "maxHeight", "scrollResetKey", "cols", "template", "group"] }, { kind: "component", type: SuggestionItemComponent, selector: "aia-suggestion-item", inputs: ["option", "isHighlighted", "id", "loading", "showIcon", "showImage", "showCount", "scrollHint", "enterDelayMs"], outputs: ["select", "highlight", "unhighlight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
800
807
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SuggestionGridComponent, decorators: [{
801
808
  type: Component,
802
- args: [{ selector: "aia-suggestion-grid", standalone: true, imports: [CommonModule, GridComponent, SuggestionItemComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<!-- max=\"1fr\": columns share out the full width, so a lone column spans the\n whole options box instead of stopping at 250px. -->\n<aia-grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n [scroll]=\"true\"\n [scrollResetKey]=\"groupKey\"\n [template]=\"plan.template\"\n [maxHeight]=\"plan.maxHeight\"\n [group]=\"groupKey\"\n>\n <aia-suggestion-item\n *ngFor=\"let option of options; trackBy: trackByOptionText; let i = index\"\n [option]=\"option\"\n [isHighlighted]=\"i === activeIndex\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [showIcon]=\"showIcons\"\n [showImage]=\"showImages\"\n [showCount]=\"showCounts\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (highlight)=\"highlight.emit(i)\"\n (unhighlight)=\"unhighlight.emit(i)\"\n ></aia-suggestion-item>\n</aia-grid>\n" }]
809
+ args: [{ selector: "aia-suggestion-grid", standalone: true, imports: [CommonModule, GridComponent, SuggestionItemComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<!-- max=\"1fr\": columns share out the full width, so a lone column spans the\n whole options box instead of stopping at 250px. -->\n<aia-grid\n min=\"250px\"\n max=\"1fr\"\n gap=\"0\"\n [scroll]=\"true\"\n [scrollResetKey]=\"groupKey\"\n [template]=\"plan.template\"\n [maxHeight]=\"plan.maxHeight\"\n [group]=\"groupKey\"\n>\n <aia-suggestion-item\n *ngFor=\"let option of options; trackBy: trackByOptionText; let i = index\"\n [option]=\"option\"\n [isHighlighted]=\"i === activeIndex\"\n [id]=\"listboxId + '-option-' + i\"\n [loading]=\"loading\"\n [showIcon]=\"showIcons && leadingVisuals\"\n [showImage]=\"showImages && leadingVisuals\"\n [showCount]=\"showCounts\"\n [scrollHint]=\"isScrollHint(i)\"\n [enterDelayMs]=\"enterDelayMs(i)\"\n (select)=\"select.emit($event)\"\n (highlight)=\"highlight.emit(i)\"\n (unhighlight)=\"unhighlight.emit(i)\"\n ></aia-suggestion-item>\n</aia-grid>\n" }]
803
810
  }], propDecorators: { options: [{
804
811
  type: Input
805
812
  }], activeIndex: [{
@@ -2920,6 +2927,7 @@ const optionCountLabel = optionCountLabel$1;
2920
2927
  const optionHasImage = optionHasImage$1;
2921
2928
  const optionImageSrc = optionImageSrc$1;
2922
2929
  const optionImageSources = optionImageSources$1;
2930
+ const optionsShowLeadingVisuals = optionsShowLeadingVisuals$1;
2923
2931
  // Product strip helpers, for a custom strip fed from `customFields$`.
2924
2932
  const PRODUCT_PATH_PREFIX = PRODUCT_PATH_PREFIX$1;
2925
2933
  const productFromMatchedItem = productFromMatchedItem$1;
@@ -2930,5 +2938,5 @@ const productsFromCustomFields = productsFromCustomFields$1;
2930
2938
  * Generated bundle index. Do not edit.
2931
2939
  */
2932
2940
 
2933
- export { AIAutocompleteComponent, AIAutocompleteController, AIAutocompleteDropdownComponent, AIAutocompleteInputDirective, AIAutocompleteModule, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, PRODUCT_PATH_PREFIX, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, dateCellMarks, formatDate, formatDateRange, formatOptionCount, isoDate, monthLabel, optionCountLabel, optionHasImage, optionImageSources, optionImageSrc, optionLabel, parseDate, parseLooseDate, parseLooseDateRange, productFromMatchedItem, productImageSources, productsFromCustomFields, sanitizeOptionIconSvg, selectedRangeFor, visibleDateRange, withSkippedParams };
2941
+ export { AIAutocompleteComponent, AIAutocompleteController, AIAutocompleteDropdownComponent, AIAutocompleteInputDirective, AIAutocompleteModule, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, PRODUCT_PATH_PREFIX, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, dateCellMarks, formatDate, formatDateRange, formatOptionCount, isoDate, monthLabel, optionCountLabel, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsShowLeadingVisuals, parseDate, parseLooseDate, parseLooseDateRange, productFromMatchedItem, productImageSources, productsFromCustomFields, sanitizeOptionIconSvg, selectedRangeFor, visibleDateRange, withSkippedParams };
2934
2942
  //# sourceMappingURL=magicx-eng-ai-autocomplete-angular.mjs.map