Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getDefaultFoundation() {
const { iconInnerSelector: sel } = this.root_.dataset
this.iconEl_ = sel ? this.root_.querySelector(sel) : this.root_
// prettier-ignore
return new MDCIconToggleFoundation({
addClass: (className) => this.iconEl_.classList.add(className),
removeClass: (className) => this.iconEl_.classList.remove(className),
registerInteractionHandler: helper.registerHandler('rootProps', this),
deregisterInteractionHandler: helper.deregisterHandler('rootProps', this),
setText: (text) => { this.iconEl_.textContent = text },
getTabIndex: helper.getAttr('rootProps', this, 'tabIndex'),
setTabIndex: helper.setAttr('rootProps', this, 'tabIndex'),
getAttr: helper.getAttr('rootProps', this),
setAttr: helper.setAttr('rootProps', this),
rmAttr: helper.rmAttr('rootProps', this),
notifyChange: (detail) => {
this.props.onChange_({ detail })
this.props.onChange({ target: { checked: detail.isOn } })
}
})
}