import { Widget, VDOM } from "../../ui/Widget"; import { Button } from "../Button"; import { History } from "../../ui/app/History"; import { Url } from "../../ui/app/Url"; import { routeAppend } from "../../util/routeAppend"; import { parseStyle } from "../../util/parseStyle"; import { StringProp, StyleProp, ClassProp, Prop } from "../../ui/Prop"; import { Instance } from "../../ui/Instance"; import { RenderingContext } from "../../ui/RenderingContext"; import { ButtonConfig } from "../Button"; import { HtmlElementInstance } from "../HtmlElement"; export interface LinkButtonConfig extends ButtonConfig { /** Url to the link's target location. Should start with `~/` or `#/` for pushState/hash based navigation. */ href?: StringProp; /** Binding to the current url location in the store. If `href` matches `url`, additional CSS class `active` is applied. */ url?: StringProp; /** * Accepted values are `equal`, `prefix` and `subroute`. Default is `equal` which means that `url` must exactly match `href` in order to consider the link active. * In `prefix` mode, if `href` is a prefix of `url`, the link is considered active. The `subroute` mode is similar to `prefix` mode, except that `href` must be followed by a forward slash `/`, indicating * a subroute. */ match?: "equal" | "prefix" | "subroute"; /** Explicitly set the active state of the link. If not set, the active state is determined by comparing `href` and `url`. */ active?: Prop; /** Additional CSS style to applied when the link is active. */ activeStyle?: StyleProp; /** Additional CSS style to applied when the link is inactive. */ inactiveStyle?: StyleProp; /** Additional CSS class to applied when the link is active. */ activeClass?: ClassProp; /** Additional CSS class to applied when the link is inactive. */ inactiveClass?: ClassProp; /** Where to display the linked URL, as the name for a browsing context (a tab, window, or