feature: tooltip in the checkbox

feature: add GridColumn.getElement
feature: column property of `contentWrap` and `maxLines`
change: line height from 24px to 18px
fix: adapt enabled after cell changed
fix: wrap issue of filter panel
This commit is contained in:
2024-03-07 12:54:00 +08:00
parent 6fb7c3c769
commit 168cae3ce1
8 changed files with 343 additions and 126 deletions

@@ -2,7 +2,7 @@ import './css/checkbox.scss';
import { createElement } from "../functions";
import { createIcon } from "./icon";
function fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check') {
function fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check', title) {
container.appendChild(
createElement('layer', layer => {
layer.className = 'ui-check-inner';
@@ -24,7 +24,10 @@ function fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, char
container.appendChild(label);
} else if (label != null && String(label).length > 0) {
container.appendChild(
createElement('span', span => span.innerText = label)
createElement('span', span => {
span.innerText = label;
span.title = title;
})
);
}
}
@@ -52,7 +55,7 @@ export function createRadiobox(opts = {}) {
if (opts.className) {
container.classList.add(opts.className);
}
fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle');
fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle', opts.title);
return container;
}
@@ -92,7 +95,7 @@ export function createCheckbox(opts = {}) {
opts.uncheckedNode.classList.add('unchecked');
container.appendChild(opts.uncheckedNode);
} else {
fillCheckbox(container, opts.type, opts.label, opts.tabIndex);
fillCheckbox(container, opts.type, opts.label, opts.tabIndex, undefined, opts.title);
}
return container;
}
@@ -144,7 +147,7 @@ export function resolveCheckbox(container = document.body, legacy) {
label.className = 'ui-check-wrapper';
}
label.replaceChildren();
fillCheckbox(label, 'fa-regular', text, chk.tabIndex);
fillCheckbox(label, 'fa-regular', text, chk.tabIndex, undefined, label.title);
label.insertBefore(chk, label.firstChild);
}
}
@@ -161,7 +164,10 @@ export function resolveCheckbox(container = document.body, legacy) {
fillCheckbox(box,
box.dataset.type,
box.dataset.label,
box.dataset.tabIndex)
box.dataset.tabIndex,
undefined,
box.title);
box.removeAttribute('title');
box.removeAttribute('data-type');
box.removeAttribute('data-label');
}