UNPKG

igniteui-webcomponents-inputs

Version:

Ignite UI Web Components inputs components.

1,024 lines (1,021 loc) 40 kB
import { XButtonGroup } from "./XButtonGroup"; import { ensureEnum, brushToString, stringToBrush, ensureBool, initializePropertiesFromCss, NamePatcher, toSpinal, enumToString, getAllPropertyNames, fromSpinal } from "igniteui-webcomponents-core"; import { WebComponentRenderer, PortalManager } from "igniteui-webcomponents-core"; import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { TypeRegistrar } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; import { IgcXButtonComponent } from './igc-x-button-component'; import { IgcXButtonGroupButtonCollection } from './igc-x-button-group-button-collection'; import { CollectionAdapter } from "igniteui-webcomponents-core"; import { NotifyCollectionChangedAction } from "igniteui-webcomponents-core"; import { ButtonGroupOrientation_$type } from './ButtonGroupOrientation'; import { IgcButtonGroupSelectionChangedEventArgs } from './igc-button-group-selection-changed-event-args'; import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core"; import { BaseControlTheme_$type } from "igniteui-webcomponents-core"; import { ButtonGroupDisplayStyle_$type } from './ButtonGroupDisplayStyle'; import { IgcHTMLElement } from "igniteui-webcomponents-core"; let IgcXButtonGroupComponent = /*@__PURE__*/ (() => { class IgcXButtonGroupComponent extends IgcHTMLElement { /** * A collection or manually added axes for the chart. */ get buttons() { if (this._buttons === null) { let coll = new IgcXButtonGroupButtonCollection(); let inner = coll._innerColl; inner.addListener((sender, e) => { switch (e.action) { case NotifyCollectionChangedAction.Add: this._buttonsAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0)); break; case NotifyCollectionChangedAction.Remove: this._buttonsAdapter.removeManualItemAt(e.oldStartingIndex); break; case NotifyCollectionChangedAction.Replace: this._buttonsAdapter.removeManualItemAt(e.oldStartingIndex); this._buttonsAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0)); break; case NotifyCollectionChangedAction.Reset: this._buttonsAdapter.clearManualItems(); break; } }); this._buttons = coll; } return this._buttons; } constructor() { super(); this.contentButtons = []; /** * The style mappings actually present in the treemap. Do not directly modify this array. * This array's contents can be modified by causing Angular to reproject the child content. * Or adding and removing style mappings from the manual style mappings collection on the buttons property. */ this.actualButtons = []; this._buttons = null; this._buttonsAdapter = null; this._disconnected = false; this._settingAttributes = false; this._attached = false; this._queuedSetAttributes = []; this._updatingFromAttribute = false; this.__p = null; this._hasUserValues = new Set(); this._stylingContainer = null; this._stylingParent = null; this._inStyling = false; this._selectionChanged = null; this._selectionChanged_wrapped = null; if (this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this)); } this._portalManager = new PortalManager("buttonContent"); this._renderer = new WebComponentRenderer(this, document, true, {}, this._portalManager); this._container = this._renderer.createElement("div"); this._renderer.updateRoot(this._container); this._implementation = this.createImplementation(); this._implementation.externalObject = this; //this._container.setStyleProperty("width", "100%"); //this._container.setStyleProperty("height", "100%"); var root; root = this._container; if (this._container.getNativeElement() != null) { root = this._container.getNativeElement(); } this._wrapper = this._renderer; var buttonGroup = this.i; this._buttonGroup = buttonGroup; this._buttonsAdapter = new CollectionAdapter(this.contentButtons, this.i.buttons, this.actualButtons, (c) => c.i, (i) => { if (this._container && this._container.getNativeElement().parentElement) { i._styling(this, this, this); } }, (i) => { }); buttonGroup.provideContainer(this._renderer); this._onChildrenChanged(); //Checkbox.notifySizeChanged(); let mut = new MutationObserver((list) => { for (var mutation of list) { if (mutation.type == 'childList') { this._onChildrenChanged(); this.updateButtons(); } } }); mut.observe(this, { childList: true }); //this._renderer.addSizeWatcher(() => { // this._checkbox.notifySizeChanged(); //}); } _onChildrenChanged() { var children = []; for (var i = 0; i < this.childNodes.length; i++) { var child = this.childNodes[i]; if (child !== this._container.getNativeElement()) { children.push(child); } } this._portalManager.onChildrenChanged(children); } updateButtons() { this.contentButtons.length = 0; for (var i = 0; i < this.children.length; i++) { if (this.children[i] instanceof IgcXButtonComponent) { this.contentButtons.push(this.children[i]); } } var childContent = this.querySelector("igc-child-content"); if (childContent) { for (var i = 0; i < childContent.children.length; i++) { if (childContent.children[i] instanceof IgcXButtonComponent) { this.contentButtons.push(childContent.children[i]); } } } if (this._buttonsAdapter != null) { this._buttonsAdapter.notifyContentChanged(); } } // supports angular themes or custom properties set in CSS updateStyle() { this._styling(this, this); } destroy() { this._buttonGroup.destroy(); this._wrapper.destroy(); } createImplementation() { return new XButtonGroup(); } disconnectedCallback() { this._disconnected = true; if (this.i) { this.i.onDetachedFromUI(); } } connectedCallback() { if (this._disconnected) { this._disconnected = false; if (this.i) { this.i.onAttachedToUI(); } return; } this.classList.add("ig-x-button-group"); this.classList.add("igc-x-button-group"); this.appendChild(this._container.getNativeElement()); this._attached = true; this.style.display = "inline-block"; //this.style.height = this._height; //this.style.width = this._width; this._flushQueuedAttributes(); // supports themes or custom properties set in CSS this._styling(this, this); this.afterContentInit(); } afterContentInit() { //this.i.notifySizeChanged(); } /** * @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 = "Igc" + name + "Component"; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); } _enqueueSetAttribute(attrName, attrValue) { this._queuedSetAttributes.push({ attrName: attrName, attrValue: attrValue }); } _flushQueuedAttributes() { this._settingAttributes = true; for (let i = 0; i < this._queuedSetAttributes.length; i++) { this.setAttribute(this._queuedSetAttributes[i].attrName, this._queuedSetAttributes[i].attrValue); } this._settingAttributes = false; this._queuedSetAttributes.length = 0; } _a(attrName, attrValue) { if (this._updatingFromAttribute) { return; } if (attrValue) { attrValue = attrValue.toString(); } this._settingAttributes = true; attrName = toSpinal(attrName); if (this._attached) { this.setAttribute(attrName, attrValue); } else { this._enqueueSetAttribute(attrName, attrValue); } this._settingAttributes = false; } static get observedAttributes() { if (IgcXButtonGroupComponent._observedAttributesIgcXButtonGroupComponent == null) { let names = getAllPropertyNames(IgcXButtonGroupComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcXButtonGroupComponent._observedAttributesIgcXButtonGroupComponent = names; } return IgcXButtonGroupComponent._observedAttributesIgcXButtonGroupComponent; } attributeChangedCallback(name, oldValue, newValue) { if (this._settingAttributes) { return; } let setName = fromSpinal(name); this._updatingFromAttribute = true; this[setName] = newValue; this._updatingFromAttribute = false; } static register() { if (!IgcXButtonGroupComponent._isElementRegistered) { IgcXButtonGroupComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcXButtonGroupComponent.htmlTagName, IgcXButtonGroupComponent); } } /** * Gets or sets the display style to use for the button. */ get displayType() { return this.i.i; } set displayType(v) { this.i.i = ensureEnum(ButtonGroupDisplayStyle_$type, v); this._a("displayType", enumToString(ButtonGroupDisplayStyle_$type, this.i.i)); } /** * Gets or sets the base built in theme to use for the button group. */ get baseTheme() { return this.i.p; } set baseTheme(v) { this.i.p = ensureEnum(BaseControlTheme_$type, v); this._a("baseTheme", enumToString(BaseControlTheme_$type, this.i.p)); } /** * Gets or sets the display density to use for the button group. */ get density() { return this.i.t; } set density(v) { this.i.t = ensureEnum(ControlDisplayDensity_$type, v); this._a("density", enumToString(ControlDisplayDensity_$type, this.i.t)); } /** * Gets the actual display density to use for the button group. */ get actualDensity() { return this.i.s; } set actualDensity(v) { this.i.s = ensureEnum(ControlDisplayDensity_$type, v); this._a("actualDensity", enumToString(ControlDisplayDensity_$type, this.i.s)); } /** * Gets the currently selected button indices. */ get selectedIndices() { return this.i.d; } set selectedIndices(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.d = v; } /** * Gets the actual item corner radius for the appropriate corners. */ get actualItemCornerRadius() { return this.i.al; } set actualItemCornerRadius(v) { this.i.al = +v; this._a("actualItemCornerRadius", this.i.al); } /** * Gets the actual item background color. */ get actualItemBackgroundColor() { return brushToString(this.i.ez); } set actualItemBackgroundColor(v) { this.i.ez = stringToBrush(v); this._a("actualItemBackgroundColor", brushToString(this.i.ez)); } /** * Gets the actual item background color. */ get actualItemDisabledBackgroundColor() { return brushToString(this.i.e1); } set actualItemDisabledBackgroundColor(v) { this.i.e1 = stringToBrush(v); this._a("actualItemDisabledBackgroundColor", brushToString(this.i.e1)); } /** * Gets the actual item text color. */ get actualItemTextColor() { return brushToString(this.i.e6); } set actualItemTextColor(v) { this.i.e6 = stringToBrush(v); this._a("actualItemTextColor", brushToString(this.i.e6)); } /** * Gets the actual item text color. */ get actualItemDisabledTextColor() { return brushToString(this.i.e3); } set actualItemDisabledTextColor(v) { this.i.e3 = stringToBrush(v); this._a("actualItemDisabledTextColor", brushToString(this.i.e3)); } /** * Gets the actual item border color. */ get actualItemBorderColor() { return brushToString(this.i.e0); } set actualItemBorderColor(v) { this.i.e0 = stringToBrush(v); this._a("actualItemBorderColor", brushToString(this.i.e0)); } /** * Gets the actual item border color. */ get actualItemDisabledBorderColor() { return brushToString(this.i.e2); } set actualItemDisabledBorderColor(v) { this.i.e2 = stringToBrush(v); this._a("actualItemDisabledBorderColor", brushToString(this.i.e2)); } /** * Gets the actual item border width. */ get actualItemBorderWidth() { return this.i.ak; } set actualItemBorderWidth(v) { this.i.ak = +v; this._a("actualItemBorderWidth", this.i.ak); } /** * Gets the actual selected item background color. */ get actualSelectedItemBackgroundColor() { return brushToString(this.i.e7); } set actualSelectedItemBackgroundColor(v) { this.i.e7 = stringToBrush(v); this._a("actualSelectedItemBackgroundColor", brushToString(this.i.e7)); } /** * Gets the stroke actual selected item text color. */ get actualSelectedItemTextColor() { return brushToString(this.i.fa); } set actualSelectedItemTextColor(v) { this.i.fa = stringToBrush(v); this._a("actualSelectedItemTextColor", brushToString(this.i.fa)); } /** * Gets the actual item hovered background color. */ get actualItemHoverBackgroundColor() { return brushToString(this.i.e4); } set actualItemHoverBackgroundColor(v) { this.i.e4 = stringToBrush(v); this._a("actualItemHoverBackgroundColor", brushToString(this.i.e4)); } /** * Gets the actual item text color. */ get actualItemHoverTextColor() { return brushToString(this.i.e5); } set actualItemHoverTextColor(v) { this.i.e5 = stringToBrush(v); this._a("actualItemHoverTextColor", brushToString(this.i.e5)); } /** * Gets the actual selected item hovered background color. */ get actualSelectedItemHoverBackgroundColor() { return brushToString(this.i.e8); } set actualSelectedItemHoverBackgroundColor(v) { this.i.e8 = stringToBrush(v); this._a("actualSelectedItemHoverBackgroundColor", brushToString(this.i.e8)); } /** * Gets the actual selected item hovered text color. */ get actualSelectedItemHoverTextColor() { return brushToString(this.i.e9); } set actualSelectedItemHoverTextColor(v) { this.i.e9 = stringToBrush(v); this._a("actualSelectedItemHoverTextColor", brushToString(this.i.e9)); } /** * Gets or sets the corner radius to use for the appropriate corners for the item buttons. */ get itemCornerRadius() { return this.i.a1; } set itemCornerRadius(v) { this.i.a1 = +v; this._a("itemCornerRadius", this.i.a1); } /** * Gets or sets the color to use the background of the buttons in the group. */ get itemBackgroundColor() { return brushToString(this.i.hn); } set itemBackgroundColor(v) { this.i.hn = stringToBrush(v); this._a("itemBackgroundColor", brushToString(this.i.hn)); } /** * Gets or sets the disabled color to use the background of the buttons in the group. */ get itemDisabledBackgroundColor() { return brushToString(this.i.hp); } set itemDisabledBackgroundColor(v) { this.i.hp = stringToBrush(v); this._a("itemDisabledBackgroundColor", brushToString(this.i.hp)); } /** * Gets or sets the color to use the text of the buttons in the group. */ get itemTextColor() { return brushToString(this.i.hu); } set itemTextColor(v) { this.i.hu = stringToBrush(v); this._a("itemTextColor", brushToString(this.i.hu)); } /** * Gets or sets the disabled color to use the text of the buttons in the group. */ get itemDisabledTextColor() { return brushToString(this.i.hr); } set itemDisabledTextColor(v) { this.i.hr = stringToBrush(v); this._a("itemDisabledTextColor", brushToString(this.i.hr)); } /** * Gets or sets the color to use the hovered background of the buttons in the group. */ get itemHoverBackgroundColor() { return brushToString(this.i.hs); } set itemHoverBackgroundColor(v) { this.i.hs = stringToBrush(v); this._a("itemHoverBackgroundColor", brushToString(this.i.hs)); } /** * Gets or sets the color to use the border of the buttons in the group. */ get itemBorderColor() { return brushToString(this.i.ho); } set itemBorderColor(v) { this.i.ho = stringToBrush(v); this._a("itemBorderColor", brushToString(this.i.ho)); } /** * Gets or sets the disabled color to use the border of the buttons in the group. */ get itemDisabledBorderColor() { return brushToString(this.i.hq); } set itemDisabledBorderColor(v) { this.i.hq = stringToBrush(v); this._a("itemDisabledBorderColor", brushToString(this.i.hq)); } /** * Gets or sets the border width to use for the buttons in the group. */ get itemBorderWidth() { return this.i.a0; } set itemBorderWidth(v) { this.i.a0 = +v; this._a("itemBorderWidth", this.i.a0); } /** * Gets or sets the color to use the hovered text of the buttons in the group. */ get itemHoverTextColor() { return brushToString(this.i.ht); } set itemHoverTextColor(v) { this.i.ht = stringToBrush(v); this._a("itemHoverTextColor", brushToString(this.i.ht)); } /** * Gets or sets the color to use the background of the buttons in the group that are selected. */ get selectedItemBackgroundColor() { return brushToString(this.i.h7); } set selectedItemBackgroundColor(v) { this.i.h7 = stringToBrush(v); this._a("selectedItemBackgroundColor", brushToString(this.i.h7)); } /** * Gets or sets the color to use the text of the buttons in the group that are selected. */ get selectedItemTextColor() { return brushToString(this.i.ia); } set selectedItemTextColor(v) { this.i.ia = stringToBrush(v); this._a("selectedItemTextColor", brushToString(this.i.ia)); } /** * Gets or sets the color to use the hovered background of the buttons in the group that are selected. */ get selectedItemHoverBackgroundColor() { return brushToString(this.i.h8); } set selectedItemHoverBackgroundColor(v) { this.i.h8 = stringToBrush(v); this._a("selectedItemHoverBackgroundColor", brushToString(this.i.h8)); } /** * Gets or sets the color to use the hovered text of the buttons in the group that are selected. */ get selectedItemHoverTextColor() { return brushToString(this.i.h9); } set selectedItemHoverTextColor(v) { this.i.h9 = stringToBrush(v); this._a("selectedItemHoverTextColor", brushToString(this.i.h9)); } /** * Gets or sets the corner radius to use for the appropriate corners for the outlined type item buttons. */ get outlinedItemCornerRadius() { return this.i.a3; } set outlinedItemCornerRadius(v) { this.i.a3 = +v; this._a("outlinedItemCornerRadius", this.i.a3); } /** * Gets or sets the color to use the background of the buttons in the group when type is outlined. */ get outlinedItemBackgroundColor() { return brushToString(this.i.hv); } set outlinedItemBackgroundColor(v) { this.i.hv = stringToBrush(v); this._a("outlinedItemBackgroundColor", brushToString(this.i.hv)); } /** * Gets or sets the disabled color to use the background of the buttons in the group when type is outlined. */ get outlinedItemDisabledBackgroundColor() { return brushToString(this.i.hx); } set outlinedItemDisabledBackgroundColor(v) { this.i.hx = stringToBrush(v); this._a("outlinedItemDisabledBackgroundColor", brushToString(this.i.hx)); } /** * Gets or sets the color to use the text of the buttons in the group when type is outlined. */ get outlinedItemTextColor() { return brushToString(this.i.h2); } set outlinedItemTextColor(v) { this.i.h2 = stringToBrush(v); this._a("outlinedItemTextColor", brushToString(this.i.h2)); } /** * Gets or sets the disabled color to use the text of the buttons in the group when type is outlined. */ get outlinedItemDisabledTextColor() { return brushToString(this.i.hz); } set outlinedItemDisabledTextColor(v) { this.i.hz = stringToBrush(v); this._a("outlinedItemDisabledTextColor", brushToString(this.i.hz)); } /** * Gets or sets the color to use the hovered background of the buttons in the group when type is outlined. */ get outlinedItemHoverBackgroundColor() { return brushToString(this.i.h0); } set outlinedItemHoverBackgroundColor(v) { this.i.h0 = stringToBrush(v); this._a("outlinedItemHoverBackgroundColor", brushToString(this.i.h0)); } /** * Gets or sets the color to use the border of the buttons in the group when type is outlined. */ get outlinedItemBorderColor() { return brushToString(this.i.hw); } set outlinedItemBorderColor(v) { this.i.hw = stringToBrush(v); this._a("outlinedItemBorderColor", brushToString(this.i.hw)); } /** * Gets or sets the disabled color to use the border of the buttons in the group when type is outlined. */ get outlinedItemDisabledBorderColor() { return brushToString(this.i.hy); } set outlinedItemDisabledBorderColor(v) { this.i.hy = stringToBrush(v); this._a("outlinedItemDisabledBorderColor", brushToString(this.i.hy)); } /** * Gets or sets the border width to use for the buttons in the group when type is outlined. */ get outlinedItemBorderWidth() { return this.i.a2; } set outlinedItemBorderWidth(v) { this.i.a2 = +v; this._a("outlinedItemBorderWidth", this.i.a2); } /** * Gets or sets the color to use the hovered text of the buttons in the group when type is outlined. */ get outlinedItemHoverTextColor() { return brushToString(this.i.h1); } set outlinedItemHoverTextColor(v) { this.i.h1 = stringToBrush(v); this._a("outlinedItemHoverTextColor", brushToString(this.i.h1)); } /** * Gets or sets the color to use the background of the buttons in the group that are selected when type is outlined. */ get outlinedSelectedItemBackgroundColor() { return brushToString(this.i.h3); } set outlinedSelectedItemBackgroundColor(v) { this.i.h3 = stringToBrush(v); this._a("outlinedSelectedItemBackgroundColor", brushToString(this.i.h3)); } /** * Gets or sets the color to use the text of the buttons in the group that are selected when type is outlined. */ get outlinedSelectedItemTextColor() { return brushToString(this.i.h6); } set outlinedSelectedItemTextColor(v) { this.i.h6 = stringToBrush(v); this._a("outlinedSelectedItemTextColor", brushToString(this.i.h6)); } /** * Gets or sets the color to use the hovered background of the buttons in the group that are selected when type is outlined. */ get outlinedSelectedItemHoverBackgroundColor() { return brushToString(this.i.h4); } set outlinedSelectedItemHoverBackgroundColor(v) { this.i.h4 = stringToBrush(v); this._a("outlinedSelectedItemHoverBackgroundColor", brushToString(this.i.h4)); } /** * Gets or sets the color to use the hovered text of the buttons in the group that are selected when type is outlined. */ get outlinedSelectedItemHoverTextColor() { return brushToString(this.i.h5); } set outlinedSelectedItemHoverTextColor(v) { this.i.h5 = stringToBrush(v); this._a("outlinedSelectedItemHoverTextColor", brushToString(this.i.h5)); } /** * Gets or sets the corner radius to use for the appropriate corners for the flat type item buttons. */ get flatItemCornerRadius() { return this.i.az; } set flatItemCornerRadius(v) { this.i.az = +v; this._a("flatItemCornerRadius", this.i.az); } /** * Gets or sets the color to use the background of the buttons in the group when type is flat. */ get flatItemBackgroundColor() { return brushToString(this.i.hb); } set flatItemBackgroundColor(v) { this.i.hb = stringToBrush(v); this._a("flatItemBackgroundColor", brushToString(this.i.hb)); } /** * Gets or sets the disabled color to use the background of the buttons in the group when type is flat. */ get flatItemDisabledBackgroundColor() { return brushToString(this.i.hd); } set flatItemDisabledBackgroundColor(v) { this.i.hd = stringToBrush(v); this._a("flatItemDisabledBackgroundColor", brushToString(this.i.hd)); } /** * Gets or sets the color to use the text of the buttons in the group when type is flat. */ get flatItemTextColor() { return brushToString(this.i.hi); } set flatItemTextColor(v) { this.i.hi = stringToBrush(v); this._a("flatItemTextColor", brushToString(this.i.hi)); } /** * Gets or sets the disabled color to use the text of the buttons in the group when type is flat. */ get flatItemDisabledTextColor() { return brushToString(this.i.hf); } set flatItemDisabledTextColor(v) { this.i.hf = stringToBrush(v); this._a("flatItemDisabledTextColor", brushToString(this.i.hf)); } /** * Gets or sets the color to use the hovered background of the buttons in the group when type is flat. */ get flatItemHoverBackgroundColor() { return brushToString(this.i.hg); } set flatItemHoverBackgroundColor(v) { this.i.hg = stringToBrush(v); this._a("flatItemHoverBackgroundColor", brushToString(this.i.hg)); } /** * Gets or sets the color to use the border of the buttons in the group when type is flat. */ get flatItemBorderColor() { return brushToString(this.i.hc); } set flatItemBorderColor(v) { this.i.hc = stringToBrush(v); this._a("flatItemBorderColor", brushToString(this.i.hc)); } /** * Gets or sets the disabled color to use the border of the buttons in the group when type is flat. */ get flatItemDisabledBorderColor() { return brushToString(this.i.he); } set flatItemDisabledBorderColor(v) { this.i.he = stringToBrush(v); this._a("flatItemDisabledBorderColor", brushToString(this.i.he)); } /** * Gets or sets the border width to use for the buttons in the group when type is flat. */ get flatItemBorderWidth() { return this.i.ay; } set flatItemBorderWidth(v) { this.i.ay = +v; this._a("flatItemBorderWidth", this.i.ay); } /** * Gets or sets the color to use the hovered text of the buttons in the group when type is flat. */ get flatItemHoverTextColor() { return brushToString(this.i.hh); } set flatItemHoverTextColor(v) { this.i.hh = stringToBrush(v); this._a("flatItemHoverTextColor", brushToString(this.i.hh)); } /** * Gets or sets the color to use the background of the buttons in the group that are selected when type is flat. */ get flatSelectedItemBackgroundColor() { return brushToString(this.i.hj); } set flatSelectedItemBackgroundColor(v) { this.i.hj = stringToBrush(v); this._a("flatSelectedItemBackgroundColor", brushToString(this.i.hj)); } /** * Gets or sets the color to use the text of the buttons in the group that are selected when type is flat. */ get flatSelectedItemTextColor() { return brushToString(this.i.hm); } set flatSelectedItemTextColor(v) { this.i.hm = stringToBrush(v); this._a("flatSelectedItemTextColor", brushToString(this.i.hm)); } /** * Gets or sets the color to use the hovered background of the buttons in the group that are selected when type is flat. */ get flatSelectedItemHoverBackgroundColor() { return brushToString(this.i.hk); } set flatSelectedItemHoverBackgroundColor(v) { this.i.hk = stringToBrush(v); this._a("flatSelectedItemHoverBackgroundColor", brushToString(this.i.hk)); } /** * Gets or sets the color to use the hovered text of the buttons in the group that are selected when type is flat. */ get flatSelectedItemHoverTextColor() { return brushToString(this.i.hl); } set flatSelectedItemHoverTextColor(v) { this.i.hl = stringToBrush(v); this._a("flatSelectedItemHoverTextColor", brushToString(this.i.hl)); } /** * Gets or sets the oreientation to use the button group when type is outlined. */ get orientation() { return this.i.k; } set orientation(v) { this.i.k = ensureEnum(ButtonGroupOrientation_$type, v); this._a("orientation", enumToString(ButtonGroupOrientation_$type, this.i.k)); } /** * Gets or sets the id to use for the button group. */ get id() { return this.i.b5; } set id(v) { this.i.b5 = v; } /** * Gets or sets whether the checkbox is disabled. */ get disabled() { return this.i.disabled; } set disabled(v) { this.i.disabled = ensureBool(v); this._a("disabled", this.i.disabled); } /** * Gets or sets whether the group supports multi-select. */ get isMultiSelect() { return this.i.z; } set isMultiSelect(v) { this.i.z = ensureBool(v); this._a("isMultiSelect", this.i.z); } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.buttons != null && this.buttons.findByName && this.buttons.findByName(name)) { return this.buttons.findByName(name); } return null; } get hasUserValues() { return this._hasUserValues; } __m(propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } } _styling(container, component, parent) { if (this._inStyling) { return; } this._inStyling = true; this._stylingContainer = container; this._stylingParent = component; let genericPrefix = ""; let typeName = this.i.$type.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } genericPrefix = toSpinal("XButtonGroupComponent"); let additionalPrefixes = []; let prefix = toSpinal(typeName); additionalPrefixes.push(prefix + "-"); let b = this.i.$type.baseType; while (b && b.name != "Object" && b.name != "Base" && b.name != "Control" && b.Name != "DependencyObject" && b.Name != "FrameworkElement") { typeName = b.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } let basePrefix = toSpinal(typeName); additionalPrefixes.push(basePrefix + "-"); b = b.baseType; } if (parent) { let parentTypeName = parent.i.$type.name; if (parentTypeName.indexOf("Xam") === 0) { parentTypeName = parentTypeName.substring(3); } let parentPrefix = toSpinal(parentTypeName); additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-"); additionalPrefixes.push(parentPrefix + "-" + prefix + "-"); } initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes); if (this._otherStyling) { this._otherStyling(container, component, parent); } this._inStyling = false; } onDetachedFromUI() { this.i.onDetachedFromUI(); } onAttachedToUI() { this.i.onAttachedToUI(); } /** * Exports visual information about the current state of the grid. */ exportVisualModel() { let iv = this.i.a5(); return (iv); } /** * Returns a serialized copy of the exported visual model */ exportSerializedVisualModel() { let iv = this.i.bq(); return (iv); } get selectionChanged() { return this._selectionChanged; } set selectionChanged(ev) { if (this._selectionChanged_wrapped !== null) { this.i.selectionChanged = delegateRemove(this.i.selectionChanged, this._selectionChanged_wrapped); this._selectionChanged_wrapped = null; this._selectionChanged = null; } this._selectionChanged = ev; this._selectionChanged_wrapped = (o, e) => { let outerArgs = new IgcButtonGroupSelectionChangedEventArgs(); outerArgs._provideImplementation(e); if (this.beforeSelectionChanged) { this.beforeSelectionChanged(this, outerArgs); } if (this._selectionChanged) { this._selectionChanged(this, outerArgs); } }; this.i.selectionChanged = delegateCombine(this.i.selectionChanged, this._selectionChanged_wrapped); ; } } IgcXButtonGroupComponent._observedAttributesIgcXButtonGroupComponent = null; IgcXButtonGroupComponent.htmlTagName = "igc-x-button-group"; IgcXButtonGroupComponent._isElementRegistered = false; return IgcXButtonGroupComponent; })(); export { IgcXButtonGroupComponent };