igniteui-react-inputs
Version:
Ignite UI React input components.
1,188 lines (1,185 loc) • 41.1 kB
JavaScript
import { __extends, __values } from "tslib";
import * as React from 'react';
import { XButtonGroup } from "./XButtonGroup";
import { XButton } from "./XButton";
import { ensureEnum, brushToString, stringToBrush, ensureBool, initializePropertiesFromCss, NamePatcher, isValidProp, toSpinal, getModifiedProps } from "igniteui-react-core";
import { ReactRenderer, PortalManager } from "igniteui-react-core";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrXButtonGroupButtonCollection } from './igr-x-button-group-button-collection';
import { CollectionAdapter } from "igniteui-react-core";
import { NotifyCollectionChangedAction } from "igniteui-react-core";
import { IgrButtonGroupSelectionChangedEventArgs } from './igr-button-group-selection-changed-event-args';
import { ContentChildrenManager } from "igniteui-react-core";
import { ButtonGroupOrientation_$type } from './ButtonGroupOrientation';
import { ControlDisplayDensity_$type } from "igniteui-react-core";
import { BaseControlTheme_$type } from "igniteui-react-core";
import { ButtonGroupDisplayStyle_$type } from './ButtonGroupDisplayStyle';
var IgrXButtonGroup = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrXButtonGroup, _super);
function IgrXButtonGroup(props) {
var _this = _super.call(this, props) || this;
_this._wrapper = null;
_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 React to reproject the child content.
* Or adding and removing ranges from the manual ranges collection on the ranges property.
*/
_this.actualButtons = [];
_this._buttons = null;
_this._buttonsAdapter = null;
_this._implementation = null;
_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._contentChildrenManager = new ContentChildrenManager(function (ch) { return ch.props.name || ch.key || ch.props.id; }, function (ch) { return ch.name || ch.key || ch.id; }, function () { return _this._updateContentChildren(); });
_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 buttonGroup = _this.i;
_this._buttonGroup = buttonGroup;
_this._buttonsAdapter = new CollectionAdapter(_this.contentButtons, _this.i.buttons, _this.actualButtons, function (c) { return c.i; }, function (i) {
if (_this._container && _this._container.getNativeElement().parentElement) {
i._styling(_this._container.getNativeElement(), _this, _this);
}
}, function (i) { });
buttonGroup.provideContainer(ren);
if (props) {
_this.initializeProperties();
}
return _this;
}
IgrXButtonGroup.prototype._getMainRef = function (ref) {
this._elRef = ref;
};
IgrXButtonGroup.prototype._updateContentChildren = function () {
this.contentButtons.length = 0;
var contentChildrenActual = this._contentChildrenManager.contentChildrenActual;
for (var i = 0; i < contentChildrenActual.length; i++) {
if ((XButton.$type).isAssignableFrom(contentChildrenActual[i].i.$type)) {
this.contentButtons.push(contentChildrenActual[i]);
}
}
if (this._buttonsAdapter !== null) {
this._buttonsAdapter.notifyContentChanged();
}
};
Object.defineProperty(IgrXButtonGroup.prototype, "buttons", {
/**
* A collection of manually added style mappings for the treemap.
*/
get: function () {
var _this = this;
if (this._buttons === null) {
var coll = new IgrXButtonGroupButtonCollection();
var inner = coll._innerColl;
inner.addListener(function (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;
},
enumerable: false,
configurable: true
});
IgrXButtonGroup.prototype.render = function () {
var children = this._contentChildrenManager.getChildren(this.props.children);
this._portalManager.onRender(children);
var div = React.createElement("div", {
className: "ig-x-button-group igr-x-button-group",
ref: this._getMainRef,
children: children
});
return div;
};
IgrXButtonGroup.prototype.requestRender = function () {
if (this._initialized) {
this.setState({});
}
};
//private _getLabelPortal(element: DomWrapper, portalCallback: (portal: DomPortal) => void): void {
// this._portalManager.getPortal(element, "TemplateContent", portalCallback);
//}
IgrXButtonGroup.prototype.shouldComponentUpdate = function (nextProps, nextState) {
var e_1, _a;
var mod = getModifiedProps(this.props, nextProps);
try {
for (var _b = __values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) {
var p = _c.value;
if (isValidProp(this, p)) {
this[p] = mod[p];
}
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
return true;
};
IgrXButtonGroup.prototype.initializeProperties = function () {
var e_2, _a;
try {
for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
var p = _c.value;
if (isValidProp(this, p)) {
this[p] = this.props[p];
}
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_2)
throw e_2.error;
}
}
};
// supports angular themes or custom properties set in CSS
IgrXButtonGroup.prototype.updateStyle = function () {
this._styling(this._elRef, this);
};
IgrXButtonGroup.prototype.destroy = function () {
this._buttonGroup.destroy();
this._wrapper.destroy();
};
IgrXButtonGroup.prototype.componentWillUnmount = function () {
};
IgrXButtonGroup.prototype.componentDidMount = function () {
this._elRef.appendChild(this._container.getNativeElement());
this.initializeContent();
};
IgrXButtonGroup.prototype.initializeContent = function () {
this._styling(this._container.getNativeElement(), this);
this.updateStyle();
};
IgrXButtonGroup.prototype.createImplementation = function () {
return new XButtonGroup();
};
Object.defineProperty(IgrXButtonGroup.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "displayType", {
/**
* Gets or sets the display style to use for the button.
*/
get: function () {
return this.i.i;
},
set: function (v) {
this.i.i = ensureEnum(ButtonGroupDisplayStyle_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "baseTheme", {
/**
* Gets or sets the base built in theme to use for the button group.
*/
get: function () {
return this.i.p;
},
set: function (v) {
this.i.p = ensureEnum(BaseControlTheme_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "density", {
/**
* Gets or sets the display density to use for the button group.
*/
get: function () {
return this.i.t;
},
set: function (v) {
this.i.t = ensureEnum(ControlDisplayDensity_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualDensity", {
/**
* Gets the actual display density to use for the button group.
*/
get: function () {
return this.i.s;
},
set: function (v) {
this.i.s = ensureEnum(ControlDisplayDensity_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "selectedIndices", {
/**
* Gets the currently selected button indices.
*/
get: function () {
return this.i.d;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.d = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemCornerRadius", {
/**
* Gets the actual item corner radius for the appropriate corners.
*/
get: function () {
return this.i.al;
},
set: function (v) {
this.i.al = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemBackgroundColor", {
/**
* Gets the actual item background color.
*/
get: function () {
return brushToString(this.i.ez);
},
set: function (v) {
this.i.ez = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemDisabledBackgroundColor", {
/**
* Gets the actual item background color.
*/
get: function () {
return brushToString(this.i.e1);
},
set: function (v) {
this.i.e1 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemTextColor", {
/**
* Gets the actual item text color.
*/
get: function () {
return brushToString(this.i.e6);
},
set: function (v) {
this.i.e6 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemDisabledTextColor", {
/**
* Gets the actual item text color.
*/
get: function () {
return brushToString(this.i.e3);
},
set: function (v) {
this.i.e3 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemBorderColor", {
/**
* Gets the actual item border color.
*/
get: function () {
return brushToString(this.i.e0);
},
set: function (v) {
this.i.e0 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemDisabledBorderColor", {
/**
* Gets the actual item border color.
*/
get: function () {
return brushToString(this.i.e2);
},
set: function (v) {
this.i.e2 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemBorderWidth", {
/**
* Gets the actual item border width.
*/
get: function () {
return this.i.ak;
},
set: function (v) {
this.i.ak = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualSelectedItemBackgroundColor", {
/**
* Gets the actual selected item background color.
*/
get: function () {
return brushToString(this.i.e7);
},
set: function (v) {
this.i.e7 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualSelectedItemTextColor", {
/**
* Gets the stroke actual selected item text color.
*/
get: function () {
return brushToString(this.i.fa);
},
set: function (v) {
this.i.fa = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemHoverBackgroundColor", {
/**
* Gets the actual item hovered background color.
*/
get: function () {
return brushToString(this.i.e4);
},
set: function (v) {
this.i.e4 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualItemHoverTextColor", {
/**
* Gets the actual item text color.
*/
get: function () {
return brushToString(this.i.e5);
},
set: function (v) {
this.i.e5 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualSelectedItemHoverBackgroundColor", {
/**
* Gets the actual selected item hovered background color.
*/
get: function () {
return brushToString(this.i.e8);
},
set: function (v) {
this.i.e8 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "actualSelectedItemHoverTextColor", {
/**
* Gets the actual selected item hovered text color.
*/
get: function () {
return brushToString(this.i.e9);
},
set: function (v) {
this.i.e9 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemCornerRadius", {
/**
* Gets or sets the corner radius to use for the appropriate corners for the item buttons.
*/
get: function () {
return this.i.a1;
},
set: function (v) {
this.i.a1 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemBackgroundColor", {
/**
* Gets or sets the color to use the background of the buttons in the group.
*/
get: function () {
return brushToString(this.i.hn);
},
set: function (v) {
this.i.hn = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemDisabledBackgroundColor", {
/**
* Gets or sets the disabled color to use the background of the buttons in the group.
*/
get: function () {
return brushToString(this.i.hp);
},
set: function (v) {
this.i.hp = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemTextColor", {
/**
* Gets or sets the color to use the text of the buttons in the group.
*/
get: function () {
return brushToString(this.i.hu);
},
set: function (v) {
this.i.hu = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemDisabledTextColor", {
/**
* Gets or sets the disabled color to use the text of the buttons in the group.
*/
get: function () {
return brushToString(this.i.hr);
},
set: function (v) {
this.i.hr = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemHoverBackgroundColor", {
/**
* Gets or sets the color to use the hovered background of the buttons in the group.
*/
get: function () {
return brushToString(this.i.hs);
},
set: function (v) {
this.i.hs = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemBorderColor", {
/**
* Gets or sets the color to use the border of the buttons in the group.
*/
get: function () {
return brushToString(this.i.ho);
},
set: function (v) {
this.i.ho = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemDisabledBorderColor", {
/**
* Gets or sets the disabled color to use the border of the buttons in the group.
*/
get: function () {
return brushToString(this.i.hq);
},
set: function (v) {
this.i.hq = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemBorderWidth", {
/**
* Gets or sets the border width to use for the buttons in the group.
*/
get: function () {
return this.i.a0;
},
set: function (v) {
this.i.a0 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "itemHoverTextColor", {
/**
* Gets or sets the color to use the hovered text of the buttons in the group.
*/
get: function () {
return brushToString(this.i.ht);
},
set: function (v) {
this.i.ht = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "selectedItemBackgroundColor", {
/**
* Gets or sets the color to use the background of the buttons in the group that are selected.
*/
get: function () {
return brushToString(this.i.h7);
},
set: function (v) {
this.i.h7 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "selectedItemTextColor", {
/**
* Gets or sets the color to use the text of the buttons in the group that are selected.
*/
get: function () {
return brushToString(this.i.ia);
},
set: function (v) {
this.i.ia = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "selectedItemHoverBackgroundColor", {
/**
* Gets or sets the color to use the hovered background of the buttons in the group that are selected.
*/
get: function () {
return brushToString(this.i.h8);
},
set: function (v) {
this.i.h8 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "selectedItemHoverTextColor", {
/**
* Gets or sets the color to use the hovered text of the buttons in the group that are selected.
*/
get: function () {
return brushToString(this.i.h9);
},
set: function (v) {
this.i.h9 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemCornerRadius", {
/**
* Gets or sets the corner radius to use for the appropriate corners for the outlined type item buttons.
*/
get: function () {
return this.i.a3;
},
set: function (v) {
this.i.a3 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemBackgroundColor", {
/**
* Gets or sets the color to use the background of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.hv);
},
set: function (v) {
this.i.hv = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemDisabledBackgroundColor", {
/**
* Gets or sets the disabled color to use the background of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.hx);
},
set: function (v) {
this.i.hx = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemTextColor", {
/**
* Gets or sets the color to use the text of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.h2);
},
set: function (v) {
this.i.h2 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemDisabledTextColor", {
/**
* Gets or sets the disabled color to use the text of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.hz);
},
set: function (v) {
this.i.hz = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemHoverBackgroundColor", {
/**
* Gets or sets the color to use the hovered background of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.h0);
},
set: function (v) {
this.i.h0 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemBorderColor", {
/**
* Gets or sets the color to use the border of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.hw);
},
set: function (v) {
this.i.hw = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemDisabledBorderColor", {
/**
* Gets or sets the disabled color to use the border of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.hy);
},
set: function (v) {
this.i.hy = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemBorderWidth", {
/**
* Gets or sets the border width to use for the buttons in the group when type is outlined.
*/
get: function () {
return this.i.a2;
},
set: function (v) {
this.i.a2 = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedItemHoverTextColor", {
/**
* Gets or sets the color to use the hovered text of the buttons in the group when type is outlined.
*/
get: function () {
return brushToString(this.i.h1);
},
set: function (v) {
this.i.h1 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedSelectedItemBackgroundColor", {
/**
* Gets or sets the color to use the background of the buttons in the group that are selected when type is outlined.
*/
get: function () {
return brushToString(this.i.h3);
},
set: function (v) {
this.i.h3 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedSelectedItemTextColor", {
/**
* Gets or sets the color to use the text of the buttons in the group that are selected when type is outlined.
*/
get: function () {
return brushToString(this.i.h6);
},
set: function (v) {
this.i.h6 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedSelectedItemHoverBackgroundColor", {
/**
* Gets or sets the color to use the hovered background of the buttons in the group that are selected when type is outlined.
*/
get: function () {
return brushToString(this.i.h4);
},
set: function (v) {
this.i.h4 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "outlinedSelectedItemHoverTextColor", {
/**
* Gets or sets the color to use the hovered text of the buttons in the group that are selected when type is outlined.
*/
get: function () {
return brushToString(this.i.h5);
},
set: function (v) {
this.i.h5 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemCornerRadius", {
/**
* Gets or sets the corner radius to use for the appropriate corners for the flat type item buttons.
*/
get: function () {
return this.i.az;
},
set: function (v) {
this.i.az = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemBackgroundColor", {
/**
* Gets or sets the color to use the background of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.hb);
},
set: function (v) {
this.i.hb = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemDisabledBackgroundColor", {
/**
* Gets or sets the disabled color to use the background of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.hd);
},
set: function (v) {
this.i.hd = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemTextColor", {
/**
* Gets or sets the color to use the text of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.hi);
},
set: function (v) {
this.i.hi = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemDisabledTextColor", {
/**
* Gets or sets the disabled color to use the text of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.hf);
},
set: function (v) {
this.i.hf = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemHoverBackgroundColor", {
/**
* Gets or sets the color to use the hovered background of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.hg);
},
set: function (v) {
this.i.hg = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemBorderColor", {
/**
* Gets or sets the color to use the border of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.hc);
},
set: function (v) {
this.i.hc = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemDisabledBorderColor", {
/**
* Gets or sets the disabled color to use the border of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.he);
},
set: function (v) {
this.i.he = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemBorderWidth", {
/**
* Gets or sets the border width to use for the buttons in the group when type is flat.
*/
get: function () {
return this.i.ay;
},
set: function (v) {
this.i.ay = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatItemHoverTextColor", {
/**
* Gets or sets the color to use the hovered text of the buttons in the group when type is flat.
*/
get: function () {
return brushToString(this.i.hh);
},
set: function (v) {
this.i.hh = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatSelectedItemBackgroundColor", {
/**
* Gets or sets the color to use the background of the buttons in the group that are selected when type is flat.
*/
get: function () {
return brushToString(this.i.hj);
},
set: function (v) {
this.i.hj = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatSelectedItemTextColor", {
/**
* Gets or sets the color to use the text of the buttons in the group that are selected when type is flat.
*/
get: function () {
return brushToString(this.i.hm);
},
set: function (v) {
this.i.hm = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatSelectedItemHoverBackgroundColor", {
/**
* Gets or sets the color to use the hovered background of the buttons in the group that are selected when type is flat.
*/
get: function () {
return brushToString(this.i.hk);
},
set: function (v) {
this.i.hk = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "flatSelectedItemHoverTextColor", {
/**
* Gets or sets the color to use the hovered text of the buttons in the group that are selected when type is flat.
*/
get: function () {
return brushToString(this.i.hl);
},
set: function (v) {
this.i.hl = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "orientation", {
/**
* Gets or sets the oreientation to use the button group when type is outlined.
*/
get: function () {
return this.i.k;
},
set: function (v) {
this.i.k = ensureEnum(ButtonGroupOrientation_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "id", {
/**
* Gets or sets the id to use for the button group.
*/
get: function () {
return this.i.b5;
},
set: function (v) {
this.i.b5 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "disabled", {
/**
* Gets or sets whether the checkbox is disabled.
*/
get: function () {
return this.i.disabled;
},
set: function (v) {
this.i.disabled = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrXButtonGroup.prototype, "isMultiSelect", {
/**
* Gets or sets whether the group supports multi-select.
*/
get: function () {
return this.i.z;
},
set: function (v) {
this.i.z = ensureBool(v);
},
enumerable: false,
configurable: true
});
IgrXButtonGroup.prototype.findByName = function (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;
};
Object.defineProperty(IgrXButtonGroup.prototype, "hasUserValues", {
get: function () {
return this._hasUserValues;
},
enumerable: false,
configurable: true
});
IgrXButtonGroup.prototype.__m = function (propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
};
IgrXButtonGroup.prototype._styling = function (container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
var genericPrefix = "";
var typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("XButtonGroup");
var additionalPrefixes = [];
var prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
var 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);
}
var basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
var parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
var 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;
};
IgrXButtonGroup.prototype.onDetachedFromUI = function () {
this.i.onDetachedFromUI();
};
IgrXButtonGroup.prototype.onAttachedToUI = function () {
this.i.onAttachedToUI();
};
/**
* Exports visual information about the current state of the grid.
*/
IgrXButtonGroup.prototype.exportVisualModel = function () {
var iv = this.i.a5();
return (iv);
};
/**
* Returns a serialized copy of the exported visual model
*/
IgrXButtonGroup.prototype.exportSerializedVisualModel = function () {
var iv = this.i.bq();
return (iv);
};
Object.defineProperty(IgrXButtonGroup.prototype, "selectionChanged", {
get: function () {
return this._selectionChanged;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var outerArgs = new IgrButtonGroupSelectionChangedEventArgs();
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);
;
},
enumerable: false,
configurable: true
});
return IgrXButtonGroup;
}(React.Component));
export { IgrXButtonGroup };