sync from work

This commit is contained in:
2023-04-14 17:40:15 +08:00
parent d702197a3f
commit af78bf0381
13 changed files with 566 additions and 319 deletions

View File

@ -63,6 +63,9 @@ function createCheckbox(opts = {}) {
if (opts.className) {
container.classList.add(opts.className);
}
if (opts.enabled === false) {
container.classList.add('disabled');
}
if (opts.checkedNode != null && opts.uncheckedNode != null) {
container.classList.add('checkbox-image');
let height = opts.imageHeight;
@ -120,7 +123,11 @@ function resolveCheckbox(container = document.body, legacy) {
} else {
text = label.innerText;
}
label.className = 'checkbox-wrapper';
if (chk.disabled) {
label.className = 'checkbox-wrapper disabled';
} else {
label.className = 'checkbox-wrapper';
}
label.replaceChildren();
fillCheckbox(label, 'fa-regular', text);
label.insertBefore(chk, label.firstChild);