import { Observable } from 'rxjs'; import * as i0 from '@angular/core'; import { OnDestroy, EventEmitter } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { SkyToken } from '@skyux/indicators'; /** * Extends the `any` type and supports values for data objects that you can inject into * the select field component to populate the picker. * @deprecated `SkySelectFieldComponent` is deprecated. Use `SkyLookupComponent` instead. */ interface SkySelectField { /** * The category for an item. */ category?: string; /** * The description to display below an item's label when `selectMode` * is set to `multiple`. */ description?: string; /** * The ID for an item. */ id?: string; /** * The label for an item. */ label?: string; /** * All other properties for an item. */ [index: string]: any; } /** * @deprecated `SkySelectFieldComponent` is deprecated. Use `SkyLookupComponent` instead. */ type SkySelectFieldSelectMode = 'single' | 'multiple'; /** * Provides values to a custom picker. * @deprecated `SkySelectFieldComponent` is deprecated. Use `SkyLookupComponent` instead. */ declare class SkySelectFieldPickerContext { /** * An array of `SkySelectField` objects from the select field's `data` property. * Use this property to populate the custom picker with items for users to select. */ data: Observable; /** * Text from the select field's `pickerHeading` property. If your custom picker is a modal, * use this property to display a header. */ headingText?: string; /** * The boolean value from the select field's `inMemorySearchEnabled`. When `false`, it * circumvents the list-builder search function to enable consumers to provide results * from a remote source by updating the `data` value. */ inMemorySearchEnabled: boolean; /** * The select field's current value. If the select field's `selectMode` is set to `single`, * then this value is a `SkySelectField` object. If `selectMode` is set to `multiple`, then * this value is an array of `SkySelectField` objects. Use this property to select the * corresponding items in the custom picker. */ selectedValue?: any; /** * The `SkySelectFieldSelectMode` value from the select field's `selectMode` property. * Use this property to determine whether users can select one item or multiple items. */ selectMode?: SkySelectFieldSelectMode; /** * The boolean value from the select field's `showAddNewRecordButton` property. * Use this property to determine whether to display a button in the custom picker * for users to add items. * @default false */ showAddNewRecordButton: boolean; } /** * @deprecated `SkySelectFieldComponent` is deprecated. Use `SkyLookupComponent` instead. */ interface SkySelectFieldCustomPicker { /** * The function to call when users select the text field or button. * @param pickerContext A `SkySelectFieldPickerContext` object that provides values to the * custom picker. * @param updateValue A function that accepts an array of `SkySelectField` objects that * represent the values selected in the custom picker. */ open: (pickerContext: SkySelectFieldPickerContext, updateValue: (value: SkySelectField[]) => void) => void; } /** * @deprecated `SkySelectFieldComponent` is deprecated. Use `SkyLookupComponent` instead. */ declare class SkySelectFieldComponent implements ControlValueAccessor, OnDestroy { /** * The ARIA label for the text input or button. This sets the `aria-label` attribute to provide a text equivalent for screen readers * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility). * If the input or button includes a visible label, use `ariaLabelledBy` instead. * For more information about the `aria-label` attribute, see the [WAI-ARIA definition](https://www.w3.org/TR/wai-aria/#aria-label). */ ariaLabel: string; /** * The HTML element ID of the element that labels * the text input or button. This sets the `aria-labelledby` attribute to provide a text equivalent for screen readers * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility). * If the input or button does not include a visible label, use `ariaLabel` instead. * For more information about the `aria-labelledby` attribute, see the [WAI-ARIA definition](https://www.w3.org/TR/wai-aria/#aria-labelledby). */ ariaLabelledBy: string; /** * Defines a data source to populate the modal picker with items that users can select. * This property accepts an observable array of `SkySelectField` values. The `SkySelectField` * type extends the any type and supports `id`, `label`, and `category` values. * @required */ data: Observable; /** * The `SkySelectFieldCustomPicker` object that displays a custom UI when users * select the select field button. */ customPicker: SkySelectFieldCustomPicker; /** * The property to highlight in the picker with bold text. The valid options are * the values that the `data` property injects into the component: `"id"`, `"label"`, and `"category"`. * @default "label" */ set descriptorKey(value: string); get descriptorKey(): string; /** * Whether to disable the text input or button and prevent users * from opening the picker on template-driven forms. Don't use this input on reactive forms because they may overwrite the input or leave the control out of sync. * To set the disabled state on reactive forms, use the `FormControl` instead. * @default false */ set disabled(value: boolean); get disabled(): boolean; /** * The selection mode that determines whether users can select one item * or multiple items. The valid options are `single`, which displays a text input, * and `multiple`, which displays a button. * @default "multiple" */ set selectMode(value: SkySelectFieldSelectMode); get selectMode(): SkySelectFieldSelectMode; /** * The label for the button when `selectMode` is set to `multiple`. * @default "Select values" */ multipleSelectOpenButtonText: string; /** * Whether to use the default search function. To circumvent the list-builder search function * and provide search results from a remote source, set this property to `false` and specify the source * with the *data* property. * @default true */ inMemorySearchEnabled: boolean; /** * Tooltip text for the icon that clears the text input when `selectMode` * is set to `"single"`. The clear icon appears after users select an item. * @default "Clear selection" */ singleSelectClearButtonTitle: string; /** * Tooltip text for the text input when `selectMode` is set to `"single"`. * @default "Click to select a value" */ singleSelectOpenButtonTitle: string; /** * Placeholder text to display in the text input when `selectMode` is set to * `"single"` and no item is selected. * @default "Select a value" */ singleSelectPlaceholderText: string; /** * The header for the picker. When `selectMode` is set to `"single"`, the default * header is "Select a value." When `selectMode` is set to `"multiple"`, the default header * is "Select values." */ pickerHeading: string; /** * Whether to display a button in the picker for users to add items. Consumers * must tie into the `addNewRecordButtonClick` event and provide the logic to add items. * @default false */ showAddNewRecordButton: boolean; /** * Fires when the component loses focus. This event does not emit a value. */ blur: EventEmitter; /** * Fires when users select the add button in the picker to add an item. The button appears * when when `showAddNewRecordButton` is set to `true`. */ addNewRecordButtonClick: EventEmitter; /** * Fires when a search is submitted from the picker's toolbar. */ searchApplied: EventEmitter; get value(): any; set value(value: any); get singleSelectModeValue(): string; tokens: SkyToken[]; private _descriptorKey; private _disabled; private _selectMode; private _value; private isPickerOpen; private readonly changeDetector; private readonly modalService; private readonly resourcesService; private readonly elementRef; constructor(); ngOnDestroy(): void; onTokensChange(change: SkyToken[]): void; openPicker(): void; writeValue(value: any): void; onHostFocusOut(): void; onTouched(blur?: boolean): void; onChange: (value: any) => void; registerOnChange(fn: (value: any) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(disabled: boolean): void; clearSelection(): void; private _registeredTouchCallback; private setTokensFromValue; private openStandardPicker; private openCustomPicker; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * @deprecated `SkySelectFieldComponent` is deprecated. Use `SkyLookupComponent` instead. */ declare class SkySelectFieldModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { SkySelectFieldModule, SkySelectFieldPickerContext, SkySelectFieldComponent as λ1 }; export type { SkySelectField, SkySelectFieldCustomPicker, SkySelectFieldSelectMode };