@ascentgl/ads-ui 22.14.1 → 22.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ascentgl/ads-ui",
3
- "version": "22.14.1",
3
+ "version": "22.16.0",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": ">=22.0.0",
6
6
  "date-fns": ">=4.1.0",
@@ -10,6 +10,19 @@
10
10
  &.ads-dropdown-panel {
11
11
  padding: 0;
12
12
 
13
+ // A panel with a pinned header or footer stops being the scrolling element
14
+ // and becomes a column that holds one: the bars take their own height and
15
+ // the options' box absorbs what is left, so the scrollbar runs between them
16
+ // instead of the full height of the panel.
17
+ //
18
+ // `max-height` above still caps the panel, so the whole thing — bars
19
+ // included — stays within it.
20
+ &.has-pinned-chrome {
21
+ display: flex;
22
+ flex-direction: column;
23
+ overflow: hidden;
24
+ }
25
+
13
26
  &.fit-content {
14
27
  min-width: fit-content;
15
28
  }
@@ -159,7 +159,7 @@ declare class AdsButtonComponent {
159
159
  /** Whether the button is a smaller version */
160
160
  size: i0.InputSignal<Size>;
161
161
  /** Sets the "type" attribute on the button */
162
- type: i0.InputSignal<"reset" | "submit" | "button">;
162
+ type: i0.InputSignal<"button" | "submit" | "reset">;
163
163
  /** Makes the button take 100% width of its container */
164
164
  fullWidth: i0.InputSignal<boolean>;
165
165
  static ɵfac: i0.ɵɵFactoryDeclaration<AdsButtonComponent, never>;
@@ -1531,6 +1531,28 @@ type SearchDropdownStaticOption = {
1531
1531
  onClick?: (currentInputValue: string) => void;
1532
1532
  cssClass?: string;
1533
1533
  };
1534
+ /**
1535
+ * A bar pinned to the bottom of the panel, below the scrolling options: a
1536
+ * read-only label on the left and, on the right, a single action.
1537
+ *
1538
+ * Unlike a static option this is not an option — it never joins the option
1539
+ * list, arrow keys skip it, and only the action button reacts to a click. That
1540
+ * is what lets the label state something about the results, such as how many
1541
+ * of them are shown, without being a click target itself.
1542
+ */
1543
+ type SearchDropdownFooterOption = {
1544
+ /** Left-hand text, or a template when it needs markup. Rendered inert. */
1545
+ label?: string | TemplateRef<SearchDropdownStaticOptionTemplateContext>;
1546
+ /**
1547
+ * The right-hand action's label. Omit for a footer that only reports
1548
+ * something. Accepts a template so a caller whose text is translated or
1549
+ * interpolated can supply it without resolving the string up front.
1550
+ */
1551
+ actionLabel?: string | TemplateRef<SearchDropdownStaticOptionTemplateContext>;
1552
+ /** Receives the input's current value, as a static option's `onClick` does. */
1553
+ onActionClick?: (currentInputValue: string) => void;
1554
+ cssClass?: string;
1555
+ };
1534
1556
 
1535
1557
  type TEMPLATE_TYPE = {
1536
1558
  $implicit: DropdownComponentOption;
@@ -1574,6 +1596,21 @@ declare class AdsSearchDropdownComponent extends AbstractDropdownComponent imple
1574
1596
  prependOption: SearchDropdownStaticOption | undefined;
1575
1597
  /** If "true", will show prependOption. Default is false */
1576
1598
  showPrependOption: boolean;
1599
+ /**
1600
+ * If "true", pins prependOption to the top of the panel so it stays visible
1601
+ * while the options scroll beneath it. Default is false, which scrolls it
1602
+ * away with them.
1603
+ */
1604
+ stickyPrependOption: boolean;
1605
+ /**
1606
+ * Provide configuration for a bar pinned to the bottom of the panel, below
1607
+ * the scrolling options — a read-only label and a single action button.
1608
+ *
1609
+ * Not an option: arrow keys skip it, and only its button reacts to a click.
1610
+ * Use it where the panel needs to say something about its results, such as
1611
+ * how many of them are shown, beside one way out.
1612
+ */
1613
+ footerOption: SearchDropdownFooterOption | undefined;
1577
1614
  /** Provide event that is fired when enter key is down while input value is being set */
1578
1615
  onEnterKeyDown: ((currentInputValue: string) => void) | undefined;
1579
1616
  /** Provide callback that will vbe executed when user clicks on magnifying glass icon */
@@ -1582,6 +1619,16 @@ declare class AdsSearchDropdownComponent extends AbstractDropdownComponent imple
1582
1619
  showSearchIcon: boolean;
1583
1620
  /** If "false", will not auto-select single option on blur. Default is true */
1584
1621
  autoSelectSingleOption: boolean;
1622
+ /**
1623
+ * If "false", blurring the field never adopts an option merely because the
1624
+ * typed text equals its label — the field clears, and only an explicit pick
1625
+ * sets a value. Default is true.
1626
+ *
1627
+ * Turn it off where several options can carry the same label, or where the
1628
+ * text the user typed is the very thing that makes the choice ambiguous.
1629
+ * Adopting the first of those matches is a guess dressed up as a selection.
1630
+ */
1631
+ selectExactMatchOnBlur: boolean;
1585
1632
  /** Provide callback that will vbe executed when user clicks on magnifying glass icon */
1586
1633
  displayValueFormatter: ((value: string, option: DropdownComponentOption) => string | SafeHtml) | undefined;
1587
1634
  /** If "true", will read option template provided via "ng-template dropdown-option" selector */
@@ -1630,6 +1677,12 @@ declare class AdsSearchDropdownComponent extends AbstractDropdownComponent imple
1630
1677
  noDataMatOption?: MatOption;
1631
1678
  /** @ignore */
1632
1679
  staticDataMatOption?: MatOption;
1680
+ /**
1681
+ * @ignore
1682
+ * The box the options scroll in when a pinned slot is used. Lives inside the
1683
+ * autocomplete panel, so it only exists once the panel has been opened.
1684
+ */
1685
+ optionsScroller?: ElementRef<HTMLElement>;
1633
1686
  /** @ignore */
1634
1687
  auto?: MatAutocomplete;
1635
1688
  /** @ignore */
@@ -1683,6 +1736,24 @@ declare class AdsSearchDropdownComponent extends AbstractDropdownComponent imple
1683
1736
  get canUseStaticOption(): boolean;
1684
1737
  /** @ignore */
1685
1738
  get canUsePrependOption(): boolean;
1739
+ /**
1740
+ * @ignore
1741
+ * Hidden while results are still loading, so the bar doesn't report a stale
1742
+ * count over a list that is about to be replaced. Deliberately not gated on
1743
+ * there being options: a footer reporting that nothing was found is a valid
1744
+ * use, and the caller decides by passing the option or not.
1745
+ */
1746
+ get canUseFooterOption(): boolean;
1747
+ /**
1748
+ * @ignore
1749
+ * Whether either pinned slot is in play, and so whether the options need
1750
+ * their own scrolling box between them.
1751
+ *
1752
+ * Read off the inputs rather than the `canUse*` getters on purpose: those
1753
+ * turn false while results load, and the options must not jump out of their
1754
+ * scroller and back on every keystroke.
1755
+ */
1756
+ get hasPinnedChrome(): boolean;
1686
1757
  /** @ignore */
1687
1758
  get showDropdownIcon(): boolean;
1688
1759
  /** @ignore */
@@ -1701,6 +1772,14 @@ declare class AdsSearchDropdownComponent extends AbstractDropdownComponent imple
1701
1772
  getDisplayedValueAsString(checkAdditionalFormatting?: boolean): string;
1702
1773
  /** @ignore */
1703
1774
  reset(): void;
1775
+ /**
1776
+ * @ignore
1777
+ * Bound to mousedown rather than click for the same reason static options
1778
+ * are: the action blurs the input to close the panel, and a click event
1779
+ * dispatched after that blur may never reach a button that has gone away
1780
+ * with it.
1781
+ */
1782
+ onFooterActionMouseDown(event: MouseEvent): void;
1704
1783
  /** @ignore */
1705
1784
  onStaticOptionMouseDown(event: MouseEvent, option: SearchDropdownStaticOption): void;
1706
1785
  /** @ignore */
@@ -1749,6 +1828,22 @@ declare class AdsSearchDropdownComponent extends AbstractDropdownComponent imple
1749
1828
  /** @ignore */
1750
1829
  private setControlValueFromOption;
1751
1830
  private setControlValue;
1831
+ /**
1832
+ * @ignore
1833
+ * Points Material's "keep the active option in view" scrolling at the box the
1834
+ * options actually scroll in.
1835
+ *
1836
+ * With a pinned header or footer the panel itself no longer scrolls — the box
1837
+ * between them does — so `_setScrollTop`, which drives the panel's own
1838
+ * `scrollTop`, would quietly do nothing and arrow-keying past the visible
1839
+ * rows would leave the active one off screen. Overridden on the instance
1840
+ * rather than reimplemented, so Material goes on deciding *where* to scroll
1841
+ * and this only redirects *what*. Falls through to the panel whenever there
1842
+ * is no scroller, which is every consumer that hasn't asked for a pinned
1843
+ * slot.
1844
+ */
1845
+ private redirectPanelScrollToOptions;
1846
+ /** @ignore */
1752
1847
  private overrideKeydownHandler;
1753
1848
  private modifyOptionClickEvent;
1754
1849
  /** @ignore */
@@ -1762,7 +1857,7 @@ declare class AdsSearchDropdownComponent extends AbstractDropdownComponent imple
1762
1857
  private autoResizeTextarea;
1763
1858
  private setupIntersectionObserver;
1764
1859
  static ɵfac: i0.ɵɵFactoryDeclaration<AdsSearchDropdownComponent, never>;
1765
- static ɵcmp: i0.ɵɵComponentDeclaration<AdsSearchDropdownComponent, "ads-search-dropdown", never, { "externalButton": { "alias": "externalButton"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; "options": { "alias": "options"; "required": false; }; "staticOptions": { "alias": "staticOptions"; "required": false; }; "filterOptions": { "alias": "filterOptions"; "required": false; }; "emitEmptyValues": { "alias": "emitEmptyValues"; "required": false; }; "loadSuggestionOnInit": { "alias": "loadSuggestionOnInit"; "required": false; }; "noDataOption": { "alias": "noDataOption"; "required": false; }; "showNoDataOption": { "alias": "showNoDataOption"; "required": false; }; "moreDataOption": { "alias": "moreDataOption"; "required": false; }; "staticDataOption": { "alias": "staticDataOption"; "required": false; }; "prependOption": { "alias": "prependOption"; "required": false; }; "showPrependOption": { "alias": "showPrependOption"; "required": false; }; "onEnterKeyDown": { "alias": "onEnterKeyDown"; "required": false; }; "searchIconClickCallback": { "alias": "searchIconClickCallback"; "required": false; }; "showSearchIcon": { "alias": "showSearchIcon"; "required": false; }; "autoSelectSingleOption": { "alias": "autoSelectSingleOption"; "required": false; }; "displayValueFormatter": { "alias": "displayValueFormatter"; "required": false; }; "useOptionTemplate": { "alias": "useOptionTemplate"; "required": false; }; "minValueLength": { "alias": "minValueLength"; "required": false; }; "preventClick": { "alias": "preventClick"; "required": false; }; "closePanelEnabled": { "alias": "closePanelEnabled"; "required": false; }; "trimValue": { "alias": "trimValue"; "required": false; }; "closeOnOutOfView": { "alias": "closeOnOutOfView"; "required": false; }; "outOfViewRootMargin": { "alias": "outOfViewRootMargin"; "required": false; }; "control": { "alias": "control"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, { "externalButtonClick": "externalButtonClick"; "focusInput": "focusInput"; "blurInput": "blurInput"; "emitSearchValueInput": "emitSearchValueInput"; }, ["optionRef"], never, true, never>;
1860
+ static ɵcmp: i0.ɵɵComponentDeclaration<AdsSearchDropdownComponent, "ads-search-dropdown", never, { "externalButton": { "alias": "externalButton"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; "options": { "alias": "options"; "required": false; }; "staticOptions": { "alias": "staticOptions"; "required": false; }; "filterOptions": { "alias": "filterOptions"; "required": false; }; "emitEmptyValues": { "alias": "emitEmptyValues"; "required": false; }; "loadSuggestionOnInit": { "alias": "loadSuggestionOnInit"; "required": false; }; "noDataOption": { "alias": "noDataOption"; "required": false; }; "showNoDataOption": { "alias": "showNoDataOption"; "required": false; }; "moreDataOption": { "alias": "moreDataOption"; "required": false; }; "staticDataOption": { "alias": "staticDataOption"; "required": false; }; "prependOption": { "alias": "prependOption"; "required": false; }; "showPrependOption": { "alias": "showPrependOption"; "required": false; }; "stickyPrependOption": { "alias": "stickyPrependOption"; "required": false; }; "footerOption": { "alias": "footerOption"; "required": false; }; "onEnterKeyDown": { "alias": "onEnterKeyDown"; "required": false; }; "searchIconClickCallback": { "alias": "searchIconClickCallback"; "required": false; }; "showSearchIcon": { "alias": "showSearchIcon"; "required": false; }; "autoSelectSingleOption": { "alias": "autoSelectSingleOption"; "required": false; }; "selectExactMatchOnBlur": { "alias": "selectExactMatchOnBlur"; "required": false; }; "displayValueFormatter": { "alias": "displayValueFormatter"; "required": false; }; "useOptionTemplate": { "alias": "useOptionTemplate"; "required": false; }; "minValueLength": { "alias": "minValueLength"; "required": false; }; "preventClick": { "alias": "preventClick"; "required": false; }; "closePanelEnabled": { "alias": "closePanelEnabled"; "required": false; }; "trimValue": { "alias": "trimValue"; "required": false; }; "closeOnOutOfView": { "alias": "closeOnOutOfView"; "required": false; }; "outOfViewRootMargin": { "alias": "outOfViewRootMargin"; "required": false; }; "control": { "alias": "control"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, { "externalButtonClick": "externalButtonClick"; "focusInput": "focusInput"; "blurInput": "blurInput"; "emitSearchValueInput": "emitSearchValueInput"; }, ["optionRef"], never, true, never>;
1766
1861
  }
1767
1862
 
1768
1863
  declare class AdsSearchInputComponent extends AdsInputComponent {
@@ -4213,4 +4308,4 @@ declare function provideAdsUi(config: AdsUiConfig): {
4213
4308
  }[];
4214
4309
 
4215
4310
  export { AdsArchitectureLogoComponent, AdsAscentLogoComponent, AdsAvatarComponent, AdsBaselineWidgetComponent, AdsBreadcrumbComponent, AdsBubbleComponent, AdsButtonComponent, AdsButtonContainerComponent, AdsCardComponent, AdsCheckboxComponent, AdsChipComponent, AdsColumnSortFilterMenuComponent, AdsCreateTagComponent, AdsCurrencyFieldComponent, AdsCustomHeaderComponent, AdsCustomerPortalLogoComponent, AdsCxaLogoComponent, AdsDatepickerComponent, AdsDatetimepickerComponent, AdsDragAndDropListComponent, AdsDropdownComponent, AdsErrorPageCodeComponent, AdsErrorPageComponent, AdsExpansionPanelComponent, AdsFilterMenuComponent, AdsFooterComponent, AdsFooterContainerComponent, AdsGenericLogoComponent, AdsHeaderComponent, AdsHeaderContainerComponent, AdsHistoryStepperComponent, AdsHorizontalNavBarComponent, AdsHorizontalStepperComponent, AdsIconButtonComponent, AdsIconHoverComponent, AdsInputComponent, AdsInputDropdownComponent, AdsInternationalPhoneFieldComponent, AdsLinkButtonComponent, AdsMainMenuComponent, AdsMenuDropDownComponent, AdsMenuDropDownTriggerDirective, AdsModalComponent, AdsMultiSelectDropdownComponent, AdsNavMenuComponent, AdsNavigationCollapseHandleComponent, AdsNavigationComponent, AdsNavigationHeaderComponent, AdsNavigationItemComponent, AdsNavigationItemsContainerComponent, AdsNumericBadgeComponent, AdsNumericStepperComponent, AdsOrgDisplayTextComponent, AdsPeakEssentialsLogoComponent, AdsPeakMarketplaceLogoComponent, AdsPeakOrderManagementLogoComponent, AdsPhoneFieldComponent, AdsPilotPayLogoComponent, AdsPrimaryLogoComponent, AdsProgressBarComponent, AdsProgressIndicatorSpinnerComponent, AdsProgressSpinnerComponent, AdsProgressStepperComponent, AdsRadioButtonComponent, AdsRateOptionCardComponent, AdsScmsLogoComponent, AdsScmsSideNavBarComponent, AdsSearchDropdownComponent, AdsSearchInputComponent, AdsShipmentHorizontalStepperComponent, AdsSideNavBarComponent, AdsSideNavBarV2Component, AdsSlideToggleComponent, AdsSliderComponent, AdsSnackbarComponent, AdsSortMenuComponent, AdsSplashPageComponent, AdsStepperComponent, AdsSubNavigationButtonComponent, AdsTableComponent, AdsTabsComponent, AdsTagComponent, AdsTagContainerComponent, AdsTextareaComponent, AdsTimeFieldComponent, AdsTimepickerComponent, AdsVerticalSideNavigationStepperComponent, AdsVerticalStepComponent, AdsVerticalStepperComponent, AdsWizardStepperComponent, AscentCardComponent, BadgeColor, Colors, CountryCode, CustomDatetimeAdapter, DividerComponent, ErrorPageDefault, HistoryAction, HorizontalStepStatus, MainMenuService, ModalActionType, ModalPanelClass, PanelClass, ShellLayoutComponent, SpinnerSize, StepStatus, TableBreakpoint, VerticalStepStatus, ViewportService, WindowService, WizardStepStatus, provideAdsUi };
4216
- export type { ActiveFilter, ActiveSort, AdsMenuDropDownItem, AdsMenuDropDownPosition, AdsModalData, AdsNavItemV2, AdsNavSubItemV2, AdsUiConfig, Breadcrumb, ColumnFilterOption, ColumnSortFilterConfig, ColumnSortOption, ColumnVisibilityControl, Copyright, CustomHeaderParams, DROP_CALLBACK_INDEXES, DividerStyle, ErrorPageConfig, ErrorPageInfoColumn, FilterOptionsSortComparator, FilterValueFormatter, HistoryContextTag, HistoryEvent, HistoryGroup, HorizontalNavLink, HorizontalStep, IconButtonSize, Link, MainMenuItem, NavItem, NavMenuItem, NumericStep, ProgressStep, RateOptionCardTag, ScmsNavItem, ScmsNavSubItem, SearchDropdownComponentOptions, SearchDropdownDisplayControlValue, SearchDropdownStaticOption, SearchDropdownStaticOptionTemplateContext, ShipmentStep, Size, SnackBarData, SortComparator, SortMenuChangeEvent, SortType, Step, Tab, Tag, UNSUBSCRIBE_FUNCTIONS_COLLECTION, Variant, VerticalSideNavigationStep, WizardStep };
4311
+ export type { ActiveFilter, ActiveSort, AdsMenuDropDownItem, AdsMenuDropDownPosition, AdsModalData, AdsNavItemV2, AdsNavSubItemV2, AdsUiConfig, Breadcrumb, ColumnFilterOption, ColumnSortFilterConfig, ColumnSortOption, ColumnVisibilityControl, Copyright, CustomHeaderParams, DROP_CALLBACK_INDEXES, DividerStyle, ErrorPageConfig, ErrorPageInfoColumn, FilterOptionsSortComparator, FilterValueFormatter, HistoryContextTag, HistoryEvent, HistoryGroup, HorizontalNavLink, HorizontalStep, IconButtonSize, Link, MainMenuItem, NavItem, NavMenuItem, NumericStep, ProgressStep, RateOptionCardTag, ScmsNavItem, ScmsNavSubItem, SearchDropdownComponentOptions, SearchDropdownDisplayControlValue, SearchDropdownFooterOption, SearchDropdownStaticOption, SearchDropdownStaticOptionTemplateContext, ShipmentStep, Size, SnackBarData, SortComparator, SortMenuChangeEvent, SortType, Step, Tab, Tag, UNSUBSCRIBE_FUNCTIONS_COLLECTION, Variant, VerticalSideNavigationStep, WizardStep };