UNPKG

laya-coreui-es

Version:

laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改

37 lines (36 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CheckBox = void 0; const Button_1 = require("./Button"); class CheckBox extends Button_1.Button { constructor(skin = null, label = "") { super(skin, label); this.toggle = true; this._autoSize = false; } preinitialize() { super.preinitialize(); this.toggle = true; this._autoSize = false; } initialize() { super.initialize(); this.createText(); this._text.align = "left"; this._text.valign = "top"; this._text.width = 0; } set dataSource(value) { this._dataSource = value; if (value instanceof Boolean) this.selected = value; else if (typeof (value) == 'string') this.selected = value === "true"; else super.dataSource = value; } get dataSource() { return super.dataSource; } } exports.CheckBox = CheckBox;