UNPKG

igniteui-react-inputs

Version:

Ignite UI React input components.

1,797 lines 54.9 kB
import * as React from 'react'; import { XButton } from "./XButton"; import { ensureEnum, brushToString, stringToBrush, ensureBool, initializePropertiesFromCss, NamePatcher, isValidProp, toSpinal, getModifiedProps } from "igniteui-react-core"; import { FontInfo } from "igniteui-react-core"; import { ReactRenderer, PortalManager } from "igniteui-react-core"; import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { CornerRadius } from "igniteui-react-core"; import { ButtonDisplayStyle_$type } from './ButtonDisplayStyle'; import { IgrButtonClickEventArgs } from './igr-button-click-event-args'; import { TypeRegistrar } from "igniteui-react-core"; import { ControlDisplayDensity_$type } from "igniteui-react-core"; import { BaseControlTheme_$type } from "igniteui-react-core"; import { ElevationMode_$type } from "igniteui-react-core"; import { HorizontalAlignment_$type } from "igniteui-react-core"; import { VerticalAlignment_$type } from "igniteui-react-core"; import { IgrFocusEventArgs } from "igniteui-react-core"; export class IgrXButton extends React.Component { _getMainRef(ref) { this._elRef = ref; } render() { let propChildren = this.props.children; let children = []; React.Children.forEach(propChildren, (ch) => { children.push(React.cloneElement(ch)); }); this._portalManager.onRender(children); let div = React.createElement("div", { className: "ig-x-button igr-x-button", ref: this._getMainRef, children: children }); return div; } requestRender() { if (this._initialized) { this.setState({}); } } constructor(props) { super(props); this._wrapper = null; this.mounted = false; this.__p = null; this._hasUserValues = new Set(); this._stylingContainer = null; this._stylingParent = null; this._inStyling = false; this._clicked = null; this._clicked_wrapped = null; this._gotFocus = null; this._gotFocus_wrapped = null; this._lostFocus = null; this._lostFocus_wrapped = null; if (this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this)); } this._implementation = this.createImplementation(); this._implementation.externalObject = this; this._getMainRef = this._getMainRef.bind(this); var container; if (document) { container = document.createElement("div"); } var root; root = container; if (container != null) { root = container; } this.requestRender = this.requestRender.bind(this); this._portalManager = new PortalManager("buttonContent", this.requestRender); var ren = new ReactRenderer(root, document, true, {}, this._portalManager); this._wrapper = ren; this._container = this._wrapper.rootWrapper; this._container.setStyleProperty("display", "inline-block"); var button = this.i; this._button = button; button.provideContainer(ren); if (props) { this.initializeProperties(); } } _onDisplayChanged() { this._container.setStyleProperty("display", this.display); } _onFlexDirectionChanged() { this._container.setStyleProperty("flex-direction", this.flexDirection); } _onFlexGrowChanged() { this._container.setStyleProperty("flex-grow", this.flexGrow); } _onAlignItemsChanged() { this._container.setStyleProperty("align-items", this.alignItems); } //private _getLabelPortal(element: DomWrapper, portalCallback: (portal: DomPortal) => void): void { // this._portalManager.getPortal(element, "TemplateContent", portalCallback); //} shouldComponentUpdate(nextProps, nextState) { const mod = getModifiedProps(this.props, nextProps); for (const p of Object.keys(mod)) { if (isValidProp(this, p)) { this[p] = mod[p]; } } return true; } initializeProperties() { for (const p of Object.keys(this.props)) { if (isValidProp(this, p)) { this[p] = this.props[p]; } } } // supports angular themes or custom properties set in CSS updateStyle() { this._styling(this._elRef, this); } destroy() { this._button.destroy(); this._wrapper.destroy(); } componentWillUnmount() { } componentDidMount() { this._elRef.appendChild(this._container.getNativeElement()); this.initializeContent(); } initializeContent() { this._styling(this._container.getNativeElement(), this); this.updateStyle(); } createImplementation() { return new XButton(); } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } /** * @hidden */ static _createFromInternal(internal) { if (!internal) { return null; } if (!internal.$type) { return null; } let name = internal.$type.name; let externalName = "Igr" + name; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); } /** * Gets or sets the min width to use for the button. */ get minWidth() { return this.i.by; } set minWidth(v) { this.i.by = +v; } /** * Gets or sets the min height to use for the button. */ get minHeight() { return this.i.bx; } set minHeight(v) { this.i.bx = +v; } /** * Gets or sets the display style to use for the button. */ get displayType() { return this.i.e; } set displayType(v) { this.i.e = ensureEnum(ButtonDisplayStyle_$type, v); } /** * Gets or sets the display density to use for the button. */ get density() { return this.i.r; } set density(v) { this.i.r = ensureEnum(ControlDisplayDensity_$type, v); } /** * Gets or sets the base built in theme to use for the button. */ get baseTheme() { return this.i.n; } set baseTheme(v) { this.i.n = ensureEnum(BaseControlTheme_$type, v); } /** * Gets the actual display density to use for the label. */ get actualDensity() { return this.i.q; } set actualDensity(v) { this.i.q = ensureEnum(ControlDisplayDensity_$type, v); } /** * Gets or sets the color to use for the check mark when the checkbox is checked. */ get actualBorderColor() { return brushToString(this.i.np); } set actualBorderColor(v) { this.i.np = stringToBrush(v); } /** * Gets or sets the color to use for the check mark when the checkbox is checked. */ get actualUmbraShadowColor() { return brushToString(this.i.n0); } set actualUmbraShadowColor(v) { this.i.n0 = stringToBrush(v); } /** * Gets or sets the color to use for the check mark when the checkbox is checked. */ get actualPenumbraShadowColor() { return brushToString(this.i.nx); } set actualPenumbraShadowColor(v) { this.i.nx = stringToBrush(v); } /** * Gets or sets the color to use for the check mark when the checkbox is checked. */ get actualAmbientShadowColor() { return brushToString(this.i.nn); } set actualAmbientShadowColor(v) { this.i.nn = stringToBrush(v); } /** * Gets or sets the color to use for the check mark when the checkbox is checked. */ get actualRestingElevation() { return this.i.cx; } set actualRestingElevation(v) { this.i.cx = +v; } /** * Gets or sets the color to use for the check mark when the checkbox is checked. */ get actualFocusElevation() { return this.i.cv; } set actualFocusElevation(v) { this.i.cv = +v; } /** * Gets or sets the color to use for the check mark when the checkbox is checked. */ get actualHoverElevation() { return this.i.cw; } set actualHoverElevation(v) { this.i.cw = +v; } /** * Gets or sets the color to use for the ripple when the button is pressed. */ get actualRippleColor() { return brushToString(this.i.ny); } set actualRippleColor(v) { this.i.ny = stringToBrush(v); } get actualCornerRadiusBottomRight() { return this.i.kz ? this.i.kz.c : NaN; } set actualCornerRadiusBottomRight(v) { this.ensureActualCornerRadius(); this.i.kz.c = +v; this.i.kz = this.i.kz; } get actualCornerRadiusBottomLeft() { return this.i.kz ? this.i.kz.b : NaN; } set actualCornerRadiusBottomLeft(v) { this.ensureActualCornerRadius(); this.i.kz.b = +v; this.i.kz = this.i.kz; } get actualCornerRadiusTopLeft() { return this.i.kz ? this.i.kz.d : NaN; } set actualCornerRadiusTopLeft(v) { this.ensureActualCornerRadius(); this.i.kz.d = +v; this.i.kz = this.i.kz; } get actualCornerRadiusTopRight() { return this.i.kz ? this.i.kz.e : NaN; } set actualCornerRadiusTopRight(v) { this.ensureActualCornerRadius(); this.i.kz.e = +v; this.i.kz = this.i.kz; } ensureActualCornerRadius() { if (this.i.kz) { return; } this.i.kz = new CornerRadius(2); } /** * Gets the color to use for the actual background. */ get actualBackgroundColor() { return brushToString(this.i.no); } set actualBackgroundColor(v) { this.i.no = stringToBrush(v); } /** * Gets the actual color to use for the disabled background of the button. */ get actualDisabledBackgroundColor() { return brushToString(this.i.nq); } set actualDisabledBackgroundColor(v) { this.i.nq = stringToBrush(v); } /** * Gets the actual color to use for the disabled border of the button. */ get actualDisabledBorderColor() { return brushToString(this.i.nr); } set actualDisabledBorderColor(v) { this.i.nr = stringToBrush(v); } /** * Gets the actual color to use for the disabled text of the button. */ get actualDisabledTextColor() { return brushToString(this.i.ns); } set actualDisabledTextColor(v) { this.i.ns = stringToBrush(v); } /** * Gets the actual disabled elevation to use for the button. */ get actualDisabledElevation() { return this.i.cu; } set actualDisabledElevation(v) { this.i.cu = +v; } /** * Gets the actual disabled elevation to use for the button. */ get actualElevationMode() { return this.i.u; } set actualElevationMode(v) { this.i.u = ensureEnum(ElevationMode_$type, v); } /** * Gets the color to use for the actual background. */ get actualTextColor() { return brushToString(this.i.nz); } set actualTextColor(v) { this.i.nz = stringToBrush(v); } /** * Gets the color to use for the actual background. */ get actualHoverTextColor() { return brushToString(this.i.nw); } set actualHoverTextColor(v) { this.i.nw = stringToBrush(v); } /** * Gets the color to use for the actual background. */ get actualFocusBackgroundColor() { return brushToString(this.i.nt); } set actualFocusBackgroundColor(v) { this.i.nt = stringToBrush(v); } /** * Gets the actual color to use for the focused text. */ get actualFocusTextColor() { return brushToString(this.i.nu); } set actualFocusTextColor(v) { this.i.nu = stringToBrush(v); } /** * Gets the hover color to use for the actual background. */ get actualHoverBackgroundColor() { return brushToString(this.i.nv); } set actualHoverBackgroundColor(v) { this.i.nv = stringToBrush(v); } /** * Gets or sets the Width to use for the check mark when the checkbox is checked. */ get actualBorderWidth() { return this.i.bj; } set actualBorderWidth(v) { this.i.bj = +v; } /** * Gets or sets the color to use for the background of the button when the type is raised. */ get raisedBackgroundColor() { return brushToString(this.i.q4); } set raisedBackgroundColor(v) { this.i.q4 = stringToBrush(v); } /** * Gets or sets the color to use for the disabled background of the button when the type is raised. */ get raisedDisabledBackgroundColor() { return brushToString(this.i.q6); } set raisedDisabledBackgroundColor(v) { this.i.q6 = stringToBrush(v); } /** * Gets or sets the color to use for the disabled border of the button when the type is raised. */ get raisedDisabledBorderColor() { return brushToString(this.i.q7); } set raisedDisabledBorderColor(v) { this.i.q7 = stringToBrush(v); } /** * Gets or sets the color to use for the disabled text of the button when the type is raised. */ get raisedDisabledTextColor() { return brushToString(this.i.q8); } set raisedDisabledTextColor(v) { this.i.q8 = stringToBrush(v); } /** * Gets or sets the disabled elevation to use for the button when the type is raised. */ get raisedDisabledElevation() { return this.i.d2; } set raisedDisabledElevation(v) { this.i.d2 = +v; } /** * Gets or sets the hover color to use for the background of the button when the type is raised. */ get raisedHoverBackgroundColor() { return brushToString(this.i.rb); } set raisedHoverBackgroundColor(v) { this.i.rb = stringToBrush(v); } /** * Gets or sets the border color to use for the button when the type is raised. */ get raisedBorderColor() { return brushToString(this.i.q5); } set raisedBorderColor(v) { this.i.q5 = stringToBrush(v); } /** * Gets or sets the elevation to use for the button when the type is raised. */ get raisedRestingElevation() { return this.i.d5; } set raisedRestingElevation(v) { this.i.d5 = +v; } /** * Gets or sets the hover elevation to use for the button when the type is raised. */ get raisedHoverElevation() { return this.i.d4; } set raisedHoverElevation(v) { this.i.d4 = +v; } /** * Gets or sets the focus elevation to use for the button when the type is raised. */ get raisedFocusElevation() { return this.i.d3; } set raisedFocusElevation(v) { this.i.d3 = +v; } /** * Gets or sets the width to use for the button border when the type is raised. */ get raisedBorderWidth() { return this.i.b0; } set raisedBorderWidth(v) { this.i.b0 = +v; } get raisedCornerRadiusBottomRight() { return this.i.lc ? this.i.lc.c : NaN; } set raisedCornerRadiusBottomRight(v) { this.ensureRaisedCornerRadius(); this.i.lc.c = +v; this.i.lc = this.i.lc; } get raisedCornerRadiusBottomLeft() { return this.i.lc ? this.i.lc.b : NaN; } set raisedCornerRadiusBottomLeft(v) { this.ensureRaisedCornerRadius(); this.i.lc.b = +v; this.i.lc = this.i.lc; } get raisedCornerRadiusTopLeft() { return this.i.lc ? this.i.lc.d : NaN; } set raisedCornerRadiusTopLeft(v) { this.ensureRaisedCornerRadius(); this.i.lc.d = +v; this.i.lc = this.i.lc; } get raisedCornerRadiusTopRight() { return this.i.lc ? this.i.lc.e : NaN; } set raisedCornerRadiusTopRight(v) { this.ensureRaisedCornerRadius(); this.i.lc.e = +v; this.i.lc = this.i.lc; } ensureRaisedCornerRadius() { if (this.i.lc) { return; } this.i.lc = new CornerRadius(2); } /** * Gets or sets the color to use for the background when the button is pressed and the type is floating action button. */ get raisedRippleColor() { return brushToString(this.i.rd); } set raisedRippleColor(v) { this.i.rd = stringToBrush(v); } /** * Gets or sets the color to use for the background of the button when the type is flat. */ get flatBackgroundColor() { return brushToString(this.i.p3); } set flatBackgroundColor(v) { this.i.p3 = stringToBrush(v); } /** * Gets or sets the color to use for the disabled background of the button when the type is flat. */ get flatDisabledBackgroundColor() { return brushToString(this.i.p5); } set flatDisabledBackgroundColor(v) { this.i.p5 = stringToBrush(v); } /** * Gets or sets the color to use for the disabled border of the button when the type is flat. */ get flatDisabledBorderColor() { return brushToString(this.i.p6); } set flatDisabledBorderColor(v) { this.i.p6 = stringToBrush(v); } /** * Gets or sets the color to use for the disabled text of the button when the type is flat. */ get flatDisabledTextColor() { return brushToString(this.i.p7); } set flatDisabledTextColor(v) { this.i.p7 = stringToBrush(v); } /** * Gets or sets the disabled elevation to use for the button when the type is flat. */ get flatDisabledElevation() { return this.i.dn; } set flatDisabledElevation(v) { this.i.dn = +v; } /** * Gets or sets the hover color to use for the background of the button when the type is flat. */ get flatHoverBackgroundColor() { return brushToString(this.i.qa); } set flatHoverBackgroundColor(v) { this.i.qa = stringToBrush(v); } /** * Gets or sets the border color to use for the button when the type is flat. */ get flatBorderColor() { return brushToString(this.i.p4); } set flatBorderColor(v) { this.i.p4 = stringToBrush(v); } /** * Gets or sets the elevation to use for the button when the type is flat. */ get flatRestingElevation() { return this.i.dr; } set flatRestingElevation(v) { this.i.dr = +v; } /** * Gets or sets the hover elevation to use for the button when the type is flat. */ get flatHoverElevation() { return this.i.dq; } set flatHoverElevation(v) { this.i.dq = +v; } /** * Gets or sets the focus elevation to use for the button when the type is flat. */ get flatFocusElevation() { return this.i.dp; } set flatFocusElevation(v) { this.i.dp = +v; } /** * Gets or sets the color to use for the background when the button is pressed and the type is floating action button. */ get flatRippleColor() { return brushToString(this.i.qc); } set flatRippleColor(v) { this.i.qc = stringToBrush(v); } /** * Gets or sets the color to use for the text of the button when type is flat. */ get flatTextColor() { return brushToString(this.i.qd); } set flatTextColor(v) { this.i.qd = stringToBrush(v); } /** * Gets or sets the color to use for the hovered text of the button when type is flat. */ get flatHoverTextColor() { return brushToString(this.i.qb); } set flatHoverTextColor(v) { this.i.qb = stringToBrush(v); } /** * Gets or sets the color to use for the backround the button when it is focused and flat. */ get flatFocusBackgroundColor() { return brushToString(this.i.p8); } set flatFocusBackgroundColor(v) { this.i.p8 = stringToBrush(v); } /** * Gets or sets the color to use for the text the button when it is focused and flat. */ get flatFocusTextColor() { return brushToString(this.i.p9); } set flatFocusTextColor(v) { this.i.p9 = stringToBrush(v); } /** * Gets or sets the width to use for the button border when the type is flat. */ get flatBorderWidth() { return this.i.bv; } set flatBorderWidth(v) { this.i.bv = +v; } get flatCornerRadiusBottomRight() { return this.i.k8 ? this.i.k8.c : NaN; } set flatCornerRadiusBottomRight(v) { this.ensureFlatCornerRadius(); this.i.k8.c = +v; this.i.k8 = this.i.k8; } get flatCornerRadiusBottomLeft() { return this.i.k8 ? this.i.k8.b : NaN; } set flatCornerRadiusBottomLeft(v) { this.ensureFlatCornerRadius(); this.i.k8.b = +v; this.i.k8 = this.i.k8; } get flatCornerRadiusTopLeft() { return this.i.k8 ? this.i.k8.d : NaN; } set flatCornerRadiusTopLeft(v) { this.ensureFlatCornerRadius(); this.i.k8.d = +v; this.i.k8 = this.i.k8; } get flatCornerRadiusTopRight() { return this.i.k8 ? this.i.k8.e : NaN; } set flatCornerRadiusTopRight(v) { this.ensureFlatCornerRadius(); this.i.k8.e = +v; this.i.k8 = this.i.k8; } ensureFlatCornerRadius() { if (this.i.k8) { return; } this.i.k8 = new CornerRadius(2); } /** * Gets or sets the color to use for the background when the button regardless of type. */ get backgroundColor() { return brushToString(this.i.n1); } set backgroundColor(v) { this.i.n1 = stringToBrush(v); } /** * Gets or sets the color to use for the disabled background of the button when the type is disabled. */ get disabledBackgroundColor() { return brushToString(this.i.pp); } set disabledBackgroundColor(v) { this.i.pp = stringToBrush(v); } /** * Gets or sets the color to use for the disabled border of the button when the type is raised. */ get disabledBorderColor() { return brushToString(this.i.pq); } set disabledBorderColor(v) { this.i.pq = stringToBrush(v); } /** * Gets or sets the color to use for the disabled text of the button when the type is raised. */ get disabledTextColor() { return brushToString(this.i.pr); } set disabledTextColor(v) { this.i.pr = stringToBrush(v); } /** * Gets or sets the disabled elevation to use for the button when the type is raised. */ get disabledElevation() { return this.i.di; } set disabledElevation(v) { this.i.di = +v; } /** * Gets or sets the disabled elevation to use for the button when the type is raised. */ get elevationMode() { return this.i.w; } set elevationMode(v) { this.i.w = ensureEnum(ElevationMode_$type, v); } /** * Gets or sets the hover color to use for the background of the button when the type is hovered. */ get hoverBackgroundColor() { return brushToString(this.i.qg); } set hoverBackgroundColor(v) { this.i.qg = stringToBrush(v); } /** * Gets or sets the border color to use for the button regardless of type. */ get borderColor() { return brushToString(this.i.n2); } set borderColor(v) { this.i.n2 = stringToBrush(v); } /** * Gets or sets the elevation to use for the button regardless of type. */ get restingElevation() { return this.i.d6; } set restingElevation(v) { this.i.d6 = +v; } /** * Gets or sets the hover elevation to use for the button regardless of type. */ get hoverElevation() { return this.i.dt; } set hoverElevation(v) { this.i.dt = +v; } /** * Gets or sets the focus elevation to use for the button regardless of type. */ get focusElevation() { return this.i.ds; } set focusElevation(v) { this.i.ds = +v; } /** * Gets or sets the use for the button. */ get textStyle() { if (this.i.aa == null) { return null; } return this.i.aa.fontString; } set textStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.aa = fi; } /** * Gets or sets the color to use for the text of the button regardless of type. */ get textColor() { return brushToString(this.i.rg); } set textColor(v) { this.i.rg = stringToBrush(v); } /** * Gets or sets the color to use for the hovered text of the button regardless of type. */ get hoverTextColor() { return brushToString(this.i.qh); } set hoverTextColor(v) { this.i.qh = stringToBrush(v); } /** * Gets or sets the color to use for the background of the button regardless of type. */ get rippleColor() { return brushToString(this.i.rf); } set rippleColor(v) { this.i.rf = stringToBrush(v); } /** * Gets or sets the color to use for the text of the button when type is raised. */ get raisedTextColor() { return brushToString(this.i.re); } set raisedTextColor(v) { this.i.re = stringToBrush(v); } /** * Gets or sets the color to use for the hovered text of the button when type is raised. */ get raisedHoverTextColor() { return brushToString(this.i.rc); } set raisedHoverTextColor(v) { this.i.rc = stringToBrush(v); } /** * Gets or sets the color to use for the backround the button when it is focused and raised. */ get raisedFocusBackgroundColor() { return brushToString(this.i.q9); } set raisedFocusBackgroundColor(v) { this.i.q9 = stringToBrush(v); } /** * Gets or sets the color to use for the text the button when it is focused and raised. */ get raisedFocusTextColor() { return brushToString(this.i.ra); } set raisedFocusTextColor(v) { this.i.ra = stringToBrush(v); } /** * Gets or sets the color to use for the backround the button when it is focused. */ get focusBackgroundColor() { return brushToString(this.i.qe); } set focusBackgroundColor(v) { this.i.qe = stringToBrush(v); } /** * Gets or sets the color to use for the text of the button when it is focused. */ get focusTextColor() { return brushToString(this.i.qf); } set focusTextColor(v) { this.i.qf = stringToBrush(v); } /** * Gets or sets the width to use for the button border regardless of type. */ get borderWidth() { return this.i.bk; } set borderWidth(v) { this.i.bk = +v; } get cornerRadiusBottomRight() { return this.i.k1 ? this.i.k1.c : NaN; } set cornerRadiusBottomRight(v) { this.ensureCornerRadius(); this.i.k1.c = +v; this.i.k1 = this.i.k1; } get cornerRadiusBottomLeft() { return this.i.k1 ? this.i.k1.b : NaN; } set cornerRadiusBottomLeft(v) { this.ensureCornerRadius(); this.i.k1.b = +v; this.i.k1 = this.i.k1; } get cornerRadiusTopLeft() { return this.i.k1 ? this.i.k1.d : NaN; } set cornerRadiusTopLeft(v) { this.ensureCornerRadius(); this.i.k1.d = +v; this.i.k1 = this.i.k1; } get cornerRadiusTopRight() { return this.i.k1 ? this.i.k1.e : NaN; } set cornerRadiusTopRight(v) { this.ensureCornerRadius(); this.i.k1.e = +v; this.i.k1 = this.i.k1; } ensureCornerRadius() { if (this.i.k1) { return; } this.i.k1 = new CornerRadius(2); } /** * Gets or sets the color to use for the background of the button when the type is outlined. */ get outlinedBackgroundColor() { return brushToString(this.i.qt); } set outlinedBackgroundColor(v) { this.i.qt = stringToBrush(v); } /** * Gets or sets the color to use for the disabled background of the button when the type is outlined. */ get outlinedDisabledBackgroundColor() { return brushToString(this.i.qv); } set outlinedDisabledBackgroundColor(v) { this.i.qv = stringToBrush(v); } /** * Gets or sets the color to use for the disabled border of the button when the type is outlined. */ get outlinedDisabledBorderColor() { return brushToString(this.i.qw); } set outlinedDisabledBorderColor(v) { this.i.qw = stringToBrush(v); } /** * Gets or sets the color to use for the disabled text of the button when the type is outlined. */ get outlinedDisabledTextColor() { return brushToString(this.i.qx); } set outlinedDisabledTextColor(v) { this.i.qx = stringToBrush(v); } /** * Gets or sets the disabled elevation to use for the button when the type is outlined. */ get outlinedDisabledElevation() { return this.i.dy; } set outlinedDisabledElevation(v) { this.i.dy = +v; } /** * Gets or sets the hover color to use for the background of the button when the type is hoveredOutlined. */ get outlinedHoverBackgroundColor() { return brushToString(this.i.q0); } set outlinedHoverBackgroundColor(v) { this.i.q0 = stringToBrush(v); } /** * Gets or sets the border color to use for the button when the type is outlined. */ get outlinedBorderColor() { return brushToString(this.i.qu); } set outlinedBorderColor(v) { this.i.qu = stringToBrush(v); } /** * Gets or sets the elevation to use for the button when the type is outlined. */ get outlinedRestingElevation() { return this.i.d1; } set outlinedRestingElevation(v) { this.i.d1 = +v; } /** * Gets or sets the hover elevation to use for the button when the type is outlined. */ get outlinedHoverElevation() { return this.i.d0; } set outlinedHoverElevation(v) { this.i.d0 = +v; } /** * Gets or sets the focus elevation to use for the button when the type is outlined. */ get outlinedFocusElevation() { return this.i.dz; } set outlinedFocusElevation(v) { this.i.dz = +v; } /** * Gets or sets the width to use for the button border when the type is outlined. */ get outlinedBorderWidth() { return this.i.bz; } set outlinedBorderWidth(v) { this.i.bz = +v; } get outlinedCornerRadiusBottomRight() { return this.i.lb ? this.i.lb.c : NaN; } set outlinedCornerRadiusBottomRight(v) { this.ensureOutlinedCornerRadius(); this.i.lb.c = +v; this.i.lb = this.i.lb; } get outlinedCornerRadiusBottomLeft() { return this.i.lb ? this.i.lb.b : NaN; } set outlinedCornerRadiusBottomLeft(v) { this.ensureOutlinedCornerRadius(); this.i.lb.b = +v; this.i.lb = this.i.lb; } get outlinedCornerRadiusTopLeft() { return this.i.lb ? this.i.lb.d : NaN; } set outlinedCornerRadiusTopLeft(v) { this.ensureOutlinedCornerRadius(); this.i.lb.d = +v; this.i.lb = this.i.lb; } get outlinedCornerRadiusTopRight() { return this.i.lb ? this.i.lb.e : NaN; } set outlinedCornerRadiusTopRight(v) { this.ensureOutlinedCornerRadius(); this.i.lb.e = +v; this.i.lb = this.i.lb; } ensureOutlinedCornerRadius() { if (this.i.lb) { return; } this.i.lb = new CornerRadius(2); } /** * Gets or sets the color to use for the background when the button is pressed and the type is floating action button. */ get outlinedRippleColor() { return brushToString(this.i.q2); } set outlinedRippleColor(v) { this.i.q2 = stringToBrush(v); } /** * Gets or sets the color to use for the text of the button when type is outlined. */ get outlinedTextColor() { return brushToString(this.i.q3); } set outlinedTextColor(v) { this.i.q3 = stringToBrush(v); } /** * Gets or sets the color to use for the hovered text of the button when type is outlined. */ get outlinedHoverTextColor() { return brushToString(this.i.q1); } set outlinedHoverTextColor(v) { this.i.q1 = stringToBrush(v); } /** * Gets or sets the color to use for the backround the button when it is focused and outlined. */ get outlinedFocusBackgroundColor() { return brushToString(this.i.qy); } set outlinedFocusBackgroundColor(v) { this.i.qy = stringToBrush(v); } /** * Gets or sets the color to use for the text the button when it is focused and outlined. */ get outlinedFocusTextColor() { return brushToString(this.i.qz); } set outlinedFocusTextColor(v) { this.i.qz = stringToBrush(v); } /** * Gets or sets the color to use for the background of the button when the type is floating action button. */ get fabBackgroundColor() { return brushToString(this.i.ps); } set fabBackgroundColor(v) { this.i.ps = stringToBrush(v); } /** * Gets or sets the color to use for the disabled background of the button when the type is fab. */ get fabDisabledBackgroundColor() { return brushToString(this.i.pu); } set fabDisabledBackgroundColor(v) { this.i.pu = stringToBrush(v); } /** * Gets or sets the color to use for the disabled border of the button when the type is fab. */ get fabDisabledBorderColor() { return brushToString(this.i.pv); } set fabDisabledBorderColor(v) { this.i.pv = stringToBrush(v); } /** * Gets or sets the color to use for the disabled text of the button when the type is fab. */ get fabDisabledTextColor() { return brushToString(this.i.pw); } set fabDisabledTextColor(v) { this.i.pw = stringToBrush(v); } /** * Gets or sets the disabled elevation to use for the button when the type is fab. */ get fabDisabledElevation() { return this.i.dj; } set fabDisabledElevation(v) { this.i.dj = +v; } /** * Gets or sets the hover color to use for the background of the button when the type is hoveredFab. */ get fabHoverBackgroundColor() { return brushToString(this.i.pz); } set fabHoverBackgroundColor(v) { this.i.pz = stringToBrush(v); } /** * Gets or sets the border color to use for the button when the type is floating action button. */ get fabBorderColor() { return brushToString(this.i.pt); } set fabBorderColor(v) { this.i.pt = stringToBrush(v); } /** * Gets or sets the elevation to use for the button when the type is floating action button. */ get fabRestingElevation() { return this.i.dm; } set fabRestingElevation(v) { this.i.dm = +v; } /** * Gets or sets the hover elevation to use for the button when the type is floating action button. */ get fabHoverElevation() { return this.i.dl; } set fabHoverElevation(v) { this.i.dl = +v; } /** * Gets or sets the focus elevation to use for the button when the type is floating action button. */ get fabFocusElevation() { return this.i.dk; } set fabFocusElevation(v) { this.i.dk = +v; } /** * Gets or sets the width to use for the button border when the type is floating action button. */ get fabBorderWidth() { return this.i.bu; } set fabBorderWidth(v) { this.i.bu = +v; } get fabCornerRadiusBottomRight() { return this.i.k7 ? this.i.k7.c : NaN; } set fabCornerRadiusBottomRight(v) { this.ensureFabCornerRadius(); this.i.k7.c = +v; this.i.k7 = this.i.k7; } get fabCornerRadiusBottomLeft() { return this.i.k7 ? this.i.k7.b : NaN; } set fabCornerRadiusBottomLeft(v) { this.ensureFabCornerRadius(); this.i.k7.b = +v; this.i.k7 = this.i.k7; } get fabCornerRadiusTopLeft() { return this.i.k7 ? this.i.k7.d : NaN; } set fabCornerRadiusTopLeft(v) { this.ensureFabCornerRadius(); this.i.k7.d = +v; this.i.k7 = this.i.k7; } get fabCornerRadiusTopRight() { return this.i.k7 ? this.i.k7.e : NaN; } set fabCornerRadiusTopRight(v) { this.ensureFabCornerRadius(); this.i.k7.e = +v; this.i.k7 = this.i.k7; } ensureFabCornerRadius() { if (this.i.k7) { return; } this.i.k7 = new CornerRadius(2); } /** * Gets or sets the color to use for the background when the button is pressed and the type is floating action button. */ get fabRippleColor() { return brushToString(this.i.p1); } set fabRippleColor(v) { this.i.p1 = stringToBrush(v); } /** * Gets or sets the color to use for the text of the button when type is floating action button. */ get fabTextColor() { return brushToString(this.i.p2); } set fabTextColor(v) { this.i.p2 = stringToBrush(v); } /** * Gets or sets the color to use for the hovered text of the button when type is floating action button. */ get fabHoverTextColor() { return brushToString(this.i.p0); } set fabHoverTextColor(v) { this.i.p0 = stringToBrush(v); } /** * Gets or sets the color to use for the backround the button when it is focused and fab. */ get fabFocusBackgroundColor() { return brushToString(this.i.px); } set fabFocusBackgroundColor(v) { this.i.px = stringToBrush(v); } /** * Gets or sets the color to use for the text the button when it is focused and fab. */ get fabFocusTextColor() { return brushToString(this.i.py); } set fabFocusTextColor(v) { this.i.py = stringToBrush(v); } /** * Gets or sets the color to use for the background of the button when the type is icon. */ get iconBackgroundColor() { return brushToString(this.i.qi); } set iconBackgroundColor(v) { this.i.qi = stringToBrush(v); } /** * Gets or sets the color to use for the disabled background of the button when the type is icon. */ get iconDisabledBackgroundColor() { return brushToString(this.i.qk); } set iconDisabledBackgroundColor(v) { this.i.qk = stringToBrush(v); } /** * Gets or sets the color to use for the disabled border of the button when the type is icon. */ get iconDisabledBorderColor() { return brushToString(this.i.ql); } set iconDisabledBorderColor(v) { this.i.ql = stringToBrush(v); } /** * Gets or sets the color to use for the disabled text of the button when the type is icon. */ get iconDisabledTextColor() { return brushToString(this.i.qm); } set iconDisabledTextColor(v) { this.i.qm = stringToBrush(v); } /** * Gets or sets the disabled elevation to use for the button when the type is icon. */ get iconDisabledElevation() { return this.i.du; } set iconDisabledElevation(v) { this.i.du = +v; } /** * Gets or sets the hover color to use for the background of the button when the type is hoveredIcon. */ get iconHoverBackgroundColor() { return brushToString(this.i.qp); } set iconHoverBackgroundColor(v) { this.i.qp = stringToBrush(v); } /** * Gets or sets the border color to use for the button when the type is icon. */ get iconBorderColor() { return brushToString(this.i.qj); } set iconBorderColor(v) { this.i.qj = stringToBrush(v); } /** * Gets or sets the elevation to use for the button when the type is icon. */ get iconRestingElevation() { return this.i.dx; } set iconRestingElevation(v) { this.i.dx = +v; } /** * Gets or sets the hover elevation to use for the button when the type is icon. */ get iconHoverElevation() { return this.i.dw; } set iconHoverElevation(v) { this.i.dw = +v; } /** * Gets or sets the focus elevation to use for the button when the type is icon. */ get iconFocusElevation() { return this.i.dv; } set iconFocusElevation(v) { this.i.dv = +v; } /** * Gets or sets the width to use for the button border when the type is icon. */ get iconBorderWidth() { return this.i.bw; } set iconBorderWidth(v) { this.i.bw = +v; } get iconCornerRadiusBottomRight() { return this.i.la ? this.i.la.c : NaN; } set iconCornerRadiusBottomRight(v) { this.ensureIconCornerRadius(); this.i.la.c = +v; this.i.la = this.i.la; } get iconCornerRadiusBottomLeft() { return this.i.la ? this.i.la.b : NaN; } set iconCornerRadiusBottomLeft(v) { this.ensureIconCornerRadius(); this.i.la.b = +v; this.i.la = this.i.la; } get iconCornerRadiusTopLeft() { return this.i.la ? this.i.la.d : NaN; } set iconCornerRadiusTopLeft(v) { this.ensureIconCornerRadius(); this.i.la.d = +v; this.i.la = this.i.la; } get iconCornerRadiusTopRight() { return this.i.la ? this.i.la.e : NaN; } set iconCornerRadiusTopRight(v) { this.ensureIconCornerRadius(); this.i.la.e = +v; this.i.la = this.i.la; } ensureIconCornerRadius() { if (this.i.la) { return; } this.i.la = new CornerRadius(2); } /** * Gets or sets the color to use for the background when the button is pressed and the type is floating action button. */ get iconRippleColor() { return brushToString(this.i.qr); } set iconRippleColor(v) { this.i.qr = stringToBrush(v); } /** * Gets or sets the color to use for the text of the button when type is icon. */ get iconTextColor() { return brushToString(this.i.qs); } set iconTextColor(v) { this.i.qs = stringToBrush(v); } /** * Gets or sets the color to use for the hovered text of the button when type is icon. */ get iconHoverTextColor() { return brushToString(this.i.qq); } set iconHoverTextColor(v) { this.i.qq = stringToBrush(v); } /** * Gets or sets the color to use for the backround the button when it is focused and icon. */ get iconFocusBackgroundColor() { return brushToString(this.i.qn); } set iconFocusBackgroundColor(v) { this.i.qn = stringToBrush(v); } /** * Gets or sets the color to use for the text the button when it is focused and icon. */ get iconFocusTextColor() { return brushToString(this.i.qo); } set iconFocusTextColor(v) { this.i.qo = stringToBrush(v); } /** * Gets or sets the id to use for the internal native checkbox. */ get inputId() { return this.i.hy; } set inputId(v) { this.i.hy = v; } /** * Gets or sets the id to use for the checkbox. */ get id() { return this.i.hw; } set id(v) { this.i.hw = v; } /** * Gets or sets the id to use for the checkbox. */ get display() { return this.i.f0; } set display(v) { this.i.f0 = v; } /** * Gets or sets the id to use for the checkbox. */ get flexDirection() { return this.i.g4; } set flexDirection(v) { this.i.g4 = v; } /** * Gets or sets the flex-grow setting for the button. */ get flexGrow() { return this.i.g6; } set flexGrow(v) { this.i.g6 = v; } /** * Gets or sets the id to use for the checkbox. */ get alignItems() { return this.i.fb; } set alignItems(v) { this.i.fb = v; } /** * Gets or sets value to use for the checkbox. */ get value() { return this.i.ee; } set value(v) { this.i.ee = v; } /** * Gets or sets name to use for the button. */ get name() { return this.i.h6; } set name(v) { this.i.h6 = v; } /** * Gets or sets TabIndex to use for the checkbox. */ get tabIndex() { return this.i.d7; } set tabIndex(v) { this.i.d7 = +v; } /** * Gets or sets the value of the aria-label attribute. */ get ariaLabel() { return this.i.fd; } set ariaLabel(v) { this.i.fd = v; } /** * Gets or sets whether the button should fill the available space. If false, the button * will use an intrinsic size. */ get fillAvailableSpace() { return this.i.ay; } set fillAvailableSpace(v) { this.i.ay = ensureBool(v); } /** * Gets or sets if the checkbox is Focused. */ get focused() { return this.i.focused; } set focused(v) { this.i.focused = ensureBool(v); } /** * Gets or sets if the button show use styling to show focus. */ get isFocusStyleEnabled() { return this.i.a2; } set isFocusStyleEnabled(v) { this.i.a2 = ensureBool(v); } /** * Gets or sets whether to disable the ripple effect for the button. */ get disableRipple() { return this.i.aw; } set disableRipple(v) { this.i.aw = ensureBool(v); } /** * Gets whether to actually disable the ripple effect for the button. */ get actualDisableRipple() { return this.i.as; } set actualDisableRipple(v) { this.i.as = ensureBool(v); } /** * Gets or sets whether the hover effect is disabled. */ get disableHover() { return this.i.au; } set disableHover(v) { this.i.au = ensureBool(v); } /** * Gets or sets whether the checkbox is checked. */ get isHover() { return this.i.a3; } set isHover(v) { this.i.a3 = ensureBool(v); } /** * Gets or sets whether the checkbox is disabled. */ get disabled() { return this.i.disabled; } set disabled(v) { this.i.disabled = ensureBool(v); } /** * Gets or sets whether the checkbox transitions are disabled. */ get disableTransitions() { return this.i.ax; } set disableTransitions(v) { this.i.ax = ensureBool(v); } /** * Gets or sets whether the cursor will change into a pointer when the button is hovered. */ get disablePointer() { return this.i.av; } set disablePointer(v) { this.i.av = ensureBool(v); } /** * Gets or sets the left padding for the button content. */ get contentPaddingLeft() { return this.i.bm; } set contentPaddingLeft(v) { this.i.bm = +v; } /** * Gets or sets the top padding for the button content. */ get contentPaddingTop() { return this.i.bo; } set contentPaddingTop(v) { this.i.bo = +v; } /** * Gets or sets the right padding for the button content. */ get contentPaddingRight() { return this.i.bn; } set contentPaddingRight(v) { this.i.bn = +v; } /** * Gets or sets the bottom padding for the button content. */ get contentPaddingBottom() { return this.i.bl; } set contentPaddingBottom(v) { this.i.bl = +v; } get horizontalContentAlignment() { return this.i.le; } set horizontalContentAlignment(v) { this.i.le = ensureEnum(HorizontalAlignment_$type, v); } get verticalContentAlignment() { return this.i.ri; } set verticalContentAlignment(v) { this.i.ri = ensureEnum(VerticalAlignment_$type, v); } /** * Gets or sets if clicking on the button is allowed to tunnel down to button content. */ get clickTunneling() { return this.i.at; } set clickTunneling(v) { this.i.at = ensureBool(v); } /** * Gets or sets whether mouse events on the button will bubble up to parent elements. */ get stopPropagation() { return this.i.a5; } set stopPropagation(v) { this.i.a5 = ensureBool(v); } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return thi