MCPcopy Create free account
hub / github.com/microsoft/SandDance / ChoiceGroupBase1

Function ChoiceGroupBase1

docs/app/js/sanddance-app.js:36990–37010  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

36988 */ var ChoiceGroupBase = /** @class */ function(_super) {
36989 (0, _tslib.__extends)(ChoiceGroupBase1, _super);
36990 function ChoiceGroupBase1(props) {
36991 var _this = _super.call(this, props) || this;
36992 _this._focusCallbacks = {};
36993 _this._changeCallbacks = {};
36994 _this._onBlur = function(ev, option) {
36995 _this.setState({
36996 keyFocused: undefined
36997 });
36998 };
36999 (0, _utilities.initializeComponentRef)(_this);
37000 var defaultSelectedKey = props.defaultSelectedKey, _a = props.options, options = _a === void 0 ? [] : _a;
37001 var validDefaultSelectedKey = !_isControlled(props) && defaultSelectedKey !== undefined && options.some(function(option) {
37002 return option.key === defaultSelectedKey;
37003 });
37004 _this.state = {
37005 keyChecked: validDefaultSelectedKey ? defaultSelectedKey : _this._getKeyChecked(props)
37006 };
37007 _this._id = (0, _utilities.getId)("ChoiceGroup");
37008 _this._labelId = (0, _utilities.getId)("ChoiceGroupLabel");
37009 return _this;
37010 }
37011 Object.defineProperty(ChoiceGroupBase1.prototype, "checkedOption", {
37012 /**
37013 * Gets the current checked option.

Callers

nothing calls this directly

Calls 1

_isControlledFunction · 0.85

Tested by

no test coverage detected