SHA256
Доработать исследователь сети и кошелёк
This commit is contained in:
@@ -109,14 +109,16 @@ export function createDropdownMenu({
|
||||
|
||||
const button = document.createElement('button');
|
||||
button.type = 'button';
|
||||
button.className = `dropdown-menu__item${item.selected ? ' is-selected' : ''}${item.danger ? ' is-danger' : ''}${item.className ? ` ${item.className}` : ''}`;
|
||||
button.setAttribute('role', 'menuitem');
|
||||
const checkable = typeof item.checked === 'boolean';
|
||||
button.className = `dropdown-menu__item${(item.selected || item.checked) ? ' is-selected' : ''}${item.danger ? ' is-danger' : ''}${item.className ? ` ${item.className}` : ''}`;
|
||||
button.setAttribute('role', checkable ? 'menuitemcheckbox' : 'menuitem');
|
||||
if (checkable) button.setAttribute('aria-checked', String(item.checked));
|
||||
button.disabled = Boolean(item.disabled);
|
||||
|
||||
if (item.iconHtml) {
|
||||
if (checkable || item.iconHtml) {
|
||||
const icon = document.createElement('span');
|
||||
icon.className = 'dropdown-menu__icon';
|
||||
icon.innerHTML = item.iconHtml;
|
||||
icon.innerHTML = checkable ? iconHtml(item.checked ? 'checkbox-checked' : 'checkbox') : item.iconHtml;
|
||||
button.append(icon);
|
||||
} else if (item.iconSrc) {
|
||||
const icon = document.createElement('img');
|
||||
|
||||
@@ -34,6 +34,8 @@ const paths = {
|
||||
gift: '<rect x="3" y="8" width="18" height="5" rx="1"/><path d="M5 13v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7M12 8v13M12 8S10.5 3 8 3.5 7 8 12 8Zm0 0s1.5-5 4-4.5S17 8 12 8Z"/>',
|
||||
plus: '<path d="M12 5v14M5 12h14"/>',
|
||||
check: '<path d="m5 12.5 4.5 4.5L19 7.5"/>',
|
||||
checkbox: '<rect x="4" y="4" width="16" height="16" rx="3"/>',
|
||||
'checkbox-checked': '<rect x="4" y="4" width="16" height="16" rx="3"/><path d="m7.5 12 3 3 6-6"/>',
|
||||
open: '<path d="M5 12h14M13 6l6 6-6 6"/>',
|
||||
chevron: '<path d="m9 6 6 6-6 6"/>',
|
||||
'chevron-up': '<path d="m6 15 6-6 6 6"/>',
|
||||
|
||||
Reference in New Issue
Block a user