@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
32 lines (31 loc) • 928 B
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { labelProp } from "../../props";
import { BaseController } from "../base-controller";
import { clickButtonPropsConfig } from "./api";
export class ClickButtonController extends BaseController {
constructor(stateAccess) {
super(stateAccess, clickButtonPropsConfig);
this.handleClick = () => {
console.log(this, this.buttonRef, 'button clicked');
};
this.setButtonRef = (element) => {
this.buttonRef = element;
};
}
componentWillLoad(props) {
const { label } = props;
this.watchLabel(label);
}
watchLabel(value) {
labelProp.apply(value, (v) => {
this.setRenderProp('label', v);
});
}
focus() {
var _a;
(_a = this.buttonRef) === null || _a === void 0 ? void 0 : _a.focus();
}
}
//# sourceMappingURL=controller.js.map