communications app, popup lib

This commit is contained in:
2023-04-08 11:46:20 +08:00
parent 449196b491
commit f85d4c9903
25 changed files with 746 additions and 279 deletions

View File

@ -1,4 +1,4 @@
import { createElement, createElementInit } from "../functions";
import { createElement } from "../functions";
import { createIcon } from "./icon";
function fillCheckbox(container, type, label) {
@ -9,14 +9,14 @@ function fillCheckbox(container, type, label) {
container.appendChild(label);
} else if (label?.length > 0) {
container.appendChild(
createElementInit('span', span => span.innerText = label)
createElement('span', span => span.innerText = label)
);
}
}
function createCheckbox(opts = {}) {
const container = createElement('label', 'checkbox-wrapper',
createElementInit('input', input => {
createElement('input', input => {
input.setAttribute('type', 'checkbox');
if (opts.checked === true) {
input.checked = true;