UNPKG

@itwin/frontend-devtools

Version:

Debug menu and supporting UI widgets

24 lines 1.11 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @alpha */ export function createCheckBox(props) { const div = document.createElement("div"); const checkbox = document.createElement("input"); checkbox.type = props.typeOverride ? props.typeOverride : "checkbox"; checkbox.id = props.id; checkbox.checked = !!props.isChecked; checkbox.addEventListener("click", () => props.handler(checkbox)); div.appendChild(checkbox); const label = document.createElement("label"); label.htmlFor = props.id; label.innerText = props.name; div.appendChild(label); if (undefined !== props.parent) props.parent.appendChild(div); if (undefined !== props.tooltip) div.title = props.tooltip; return { label, checkbox, div }; } //# sourceMappingURL=CheckBox.js.map