UNPKG

@hashicorp/design-system-components

Version:
48 lines (47 loc) 2.46 kB
/** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ import Component from '@glimmer/component'; import type { PowerSelectSignature } from 'ember-power-select/components/power-select'; import type { Select } from 'ember-power-select/components/power-select'; import type { CalculatePositionResult } from 'ember-basic-dropdown/utils/calculate-position'; import { HdsFormSuperSelectHorizontalPositionValues } from '../types.ts'; import type { HdsFormSuperSelectHorizontalPositions } from '../types.ts'; export declare const DEFAULT_HORIZONTAL_POSITION: string; export declare const HORIZONTAL_POSITION_MAPPING: Record<HdsFormSuperSelectHorizontalPositionValues, import("@floating-ui/dom").Placement | undefined>; export interface HdsFormSuperSelectSingleBaseSignature { Args: Omit<PowerSelectSignature['Args'], 'resultCountMessage'> & { showAfterOptions?: boolean; afterOptionsContent?: string; resultCountMessage?: string | PowerSelectSignature['Args']['resultCountMessage']; dropdownMaxWidth?: string; matchTriggerWidth?: boolean; isInvalid?: boolean; }; Blocks: PowerSelectSignature['Blocks']; Element: PowerSelectSignature['Element']; } export default class HdsFormSuperSelectSingleBase extends Component<HdsFormSuperSelectSingleBaseSignature> { powerSelectAPI?: Select; get horizontalPosition(): HdsFormSuperSelectHorizontalPositions; get resultCountMessageText(): string; get resultCountMessageFunction(): PowerSelectSignature['Args']['resultCountMessage']; /** * This action sets the powerSelectAPI property and optionally calls a registerAPI function. * * @param {Object} powerSelectAPI - The API object for the PowerSelect component. * * If a `registerAPI` function is passed in through the component's arguments, * this function will be called with the `powerSelectAPI` as its argument. * This allows parent components or controllers to have access to the PowerSelect API. * * The `powerSelectAPI` is also stored on the component instance and used in `clearSelected` */ setPowerSelectAPI: (powerSelectAPI: Select) => void; calculatePosition: (trigger: Element, content: HTMLElement) => CalculatePositionResult; get showAfterOptions(): boolean | string; get searchPlaceholder(): string; get dropdownMaxWidthStyle(): Record<string, string>; get classNames(): string; }