UNPKG

@jupyter/web-components

Version:

A component library for building extensions in Jupyter frontends.

144 lines (143 loc) 4.29 kB
import { Select, SelectOptions } from '@microsoft/fast-foundation'; import { selectStyles as styles } from './select.styles.js'; /** * Scale locally an element. */ export type SelectScale = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'; /** * Select class * @public * @tagname jp-select */ declare class JupyterSelect extends Select { /** * Whether the select has a compact layout or not. * * @public * @remarks * HTML Attribute: minimal */ autoWidth: boolean; /** * (Un-)set the width when the autoWidth property changes. * * @param prev - the previous autoWidth value * @param next - the current autoWidth value */ protected autoWidthChanged(prev: boolean | undefined, next: boolean): void; /** * Compute the listbox width to set the one of the input. */ protected setAutoWidth(): void; /** * Whether the select has a compact layout or not. * * @public * @remarks * * @deprecated Use {@link scale} `xsmall` instead * * HTML Attribute: minimal */ minimal: boolean; /** * Scale the element compared to the theme size. */ scale?: SelectScale; /** * An internal stylesheet to hold calculated CSS custom properties. * * @internal */ private computedStylesheet?; /** * @internal */ connectedCallback(): void; /** * Synchronize the form-associated proxy and updates the value property of the element. * * @param prev - the previous collection of slotted option elements * @param next - the next collection of slotted option elements * * @internal */ slottedOptionsChanged(prev: Element[] | undefined, next: Element[]): void; /** * Returns the calculated max height for the listbox. * * @internal * @remarks * Used to generate the `--listbox-max-height` CSS custom property. * */ private get listboxMaxHeight(); /** * The cached scroll width of the listbox when visible. * * @internal */ private listboxScrollWidth; /** * @internal */ protected listboxScrollWidthChanged(): void; /** * Returns the size value, if any. Otherwise, returns 4 if in * multi-selection mode, or 0 if in single-selection mode. * * @internal * @remarks * Used to generate the `--size` CSS custom property. * */ private get selectSize(); /** * Updates the computed stylesheet when the multiple property changes. * * @param prev - the previous multiple value * @param next - the current multiple value * * @override * @internal */ multipleChanged(prev: boolean | undefined, next: boolean): void; /** * Sets the selectMaxSize design token when the maxHeight property changes. * * @param prev - the previous maxHeight value * @param next - the current maxHeight value * * @internal */ protected maxHeightChanged(prev: number | undefined, next: number): void; setPositioning(): void; /** * Updates the component dimensions when the size property is changed. * * @param prev - the previous size value * @param next - the current size value * * @override * @internal */ protected sizeChanged(prev: number | undefined, next: number): void; /** * Updates an internal stylesheet with calculated CSS custom properties. * * @internal */ protected updateComputedStylesheet(): void; } /** * A function that returns a {@link @microsoft/fast-foundation#Select} registration for configuring the component with a DesignSystem. * Implements {@link @microsoft/fast-foundation#selectTemplate} * * * @public * @remarks * Generates HTML Element: `<jp-select>` * */ export declare const jpSelect: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<SelectOptions> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<SelectOptions, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>; export { JupyterSelect as Select, styles as selectStyles };