import { ButtonCurrentType, ButtonIconPositionType, ButtonSizeType, ButtonTargetType, ButtonType, ButtonVariantType } from "../../type/button"; import { ToneBoxVariantType } from "../../type/tone"; import { TypographyTruncateType } from "../../type/text"; import { TextAnimationType } from "../mds-text/meta/types"; /** * @slot - Add `text string` to this slot, **avoid** to add `HTML elements` or `components` here. * @slot notification - Add `HTML elements` or `components`, it is **recommended** to use `mds-notification` element. * @part icon - The icon inside the component * @part label - The text of the button: the `label`, or the default slot when `label` is not set * @category actions */ export declare class MdsButton { private typography?; private km; private anchor?; private hasAwaited; private iconTitle; private ownAriaCurrent; host: HTMLMdsButtonElement; internals: ElementInternals; /** * Specifies if the component is focused when is loaded on the viewport */ readonly autoFocus: boolean; /** * The label of the button */ label?: string; /** * Specifies if the text is animated when it is rendered */ readonly animation?: TextAnimationType; /** * The icon displayed in the button; `iconCurrent` and `iconHover` take its place in their * states */ icon?: string; /** * The icon of the current button, in place of `icon`: the filled icon, say, of an `icon` drawn * as an outline. It is the icon under the pointer too, unless `iconHover` says otherwise, so * the pointer previews it on the buttons that are not current. It takes the place of `icon`: * without `icon` it shows nothing */ readonly iconCurrent?: string; /** * The icon under the pointer, in place of `icon`, and `iconCurrent` when it is not set. Set it * to the `icon` to keep the icon still under the pointer, when `iconCurrent` says something * the click does not do (a check, say). A pointer that cannot hover, as a finger, never shows * it. It takes the place of `icon`: without `icon` it shows nothing */ readonly iconHover?: string; /** * Specifies the horizontal position of the icon displayed in the button */ readonly iconPosition?: ButtonIconPositionType; /** * The type of the button element */ readonly type?: ButtonType; /** * The name sent with `value` to the form the button submits, as a native submit button * does: buttons that submit the same form tell the receiver which one was chosen */ readonly name?: string; /** * The value sent under `name` to the form the button submits */ readonly value?: string; /** * Specifies the color variant for the button */ readonly variant?: ButtonVariantType; /** * Specifies the tone variant for the button */ readonly tone?: ToneBoxVariantType; /** * Specifies the size for the button */ readonly size: ButtonSizeType; /** * Specifies if the button is active or not */ active: boolean; /** * Specifies if the component is disabled or not */ disabled?: boolean; /** * Specifies if the button is awaiting for a response */ await?: boolean; /** * Turns the button into a link to this URL: a real anchor in its shadow root, so the browser * gives it what it gives every link (new tab on a modifier or middle click, the context menu, * drag). A client-side router takes the plain clicks over once registered with * `NavigationService.setHandler()` (from `@maggioli-design-system/magma/services`); without * one, a click listener on the host can still cancel the navigation with `preventDefault()`. */ readonly href?: string; /** * Specifies the target of the URL, if self or blank */ readonly target: ButtonTargetType; /** * With `href`, saves its file instead of opening it, as the `download` attribute of ``: * present with no value, or `true`, the file takes the name the server gives it; a string is * the name of the saved file. Browsers apply it to the URLs of the origin of the page, `blob:` * and `data:`: a link to another origin opens the file as without it. A download never goes to * the router registered with `NavigationService` */ readonly download?: boolean | string; /** * Marks the button that leads to the view you are in, as the current section of a bar or the * current view of a switcher, with a look of its own: an area that weighs less than the hover of * its tone, never its ring, and a heavier label. `current`, or * `current="page"`, is that view: the button neither navigates nor submits, a click and Enter do * nothing, but it stays in the Tab order, announced with `aria-current` (`"page"` on a link, * `"true"` otherwise). `current="section"` is a view inside it, as a record of its list: the * same look, and the button stays a link that brings you back, announced with * `aria-current="true"`. An `aria-current` written on the host stays as written. */ readonly current?: ButtonCurrentType; /** * Specifies if the text shoud be truncated or should behave as a normal text */ readonly truncate?: TypographyTruncateType; disabledChanged(newValue: boolean | undefined): void; labelChanged(newValue?: string): void; awaitChanged(newValue?: boolean): void; currentChanged(): void; /** * Enter, and Space unless the button is a link, click the button as the pointer does: never * while it is disabled or awaiting, nor on the view you are in. A busy button keeps the focus * it had, but a second Enter does not submit again. */ private syncClickBehavior; handleTypeChange(newValue: string): void; handleHrefChange(): void; /** * The current button tells the assistive technology where you are, as the paginator and the * breadcrumb do: `page` for the link to the page you are on, `true` for a view that is not a * page of its own and for a section you are inside of (#1264). An aria-current the author * wrote, `step` or `date` say, is theirs and stays. */ private syncAriaCurrent; handleVariantChange(newValue?: ButtonVariantType): void; private handleRequestSubmitForm; private handleReset; private mouseDown; private mouseUp; private isLink; private isDownload; private savingFile; private isCurrentView; private opensElsewhere; /** * A click on the anchor is the browser's to follow, unless the router registered with * `NavigationService` takes it over: then the navigation is cancelled here, before the page * loads, and the router renders the route. * * A click that did not land on the anchor comes from the keyboard, a script or an assistive * technology: the host follows the link as the anchor would, once every listener on the page * had its say. The timeout is what lets a listener added after this one, or delegated to the * document by a framework, cancel the navigation: a microtask could run between two listeners. * * A download is the browser's on every path: it saves the file, and a router has no view to * render for it. */ private handleLinkClick; private follow; private route; private focusHost; componentWillLoad(): void; componentDidLoad(): void; /** * Without a label, an aria-label or a title, the button is named after the last segment of its * icon slug, as a `title`. Another element that names it (`aria-labelledby`, which an * `mds-tooltip` with `relation="label"` writes after the button has loaded) takes that name * back: the slug would put a native tooltip on top of the real name (#923). */ private readonly syncIconName; handleAriaLabelledbyChange(): void; connectedCallback(): void; disconnectedCallback(): void; /** * The icons of the button, one for each icon it shows: at rest `icon`, on the current button * `iconCurrent`, under the pointer `iconHover`, which falls back on `iconCurrent` (#1264). Each * carries the states it is the icon of, and the stylesheet hides the others * (mds-button-icon-state.css): all of them are rendered, so an icon is fetched with the button * and not the first time its state comes, blank until it arrives. Without `icon` there is * none: the room of the icon is the one `icon` gives (mds-button-size.css), and an icon that * came only in a state would move the label. */ private renderIcons; private onSlotChangeHandler; render(): any; }