
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@libs-ui/components-buttons-dropdown
Advanced tools
@libs-ui/components-buttons-dropdown là một component Dropdown Button dùng cho Angular, cho phép hiển thị danh sách các tùy chọn khi nhấn vào button, hỗ trợ custom templates, binding lựa chọn và nhiều tùy chỉnh linh hoạt.
keySelected)applyNow) hoặc yêu cầu click nút Áp dụngnpm install @libs-ui/components-buttons-dropdown
hoặc
yarn add @libs-ui/components-buttons-dropdown
import { Component } from '@angular/core';
import { LibsUiComponentsButtonsDropdownComponent } from '@libs-ui/components-buttons-dropdown';
@Component({
selector: 'app-example',
standalone: true,
imports: [LibsUiComponentsButtonsDropdownComponent],
template: `
<libs_ui-components-buttons-dropdown
[label]="'Chọn mục'"
[items]="items"
[(keySelected)]="selectedKey"
(outSelectItem)="onSelect($event)"></libs_ui-components-buttons-dropdown>
`,
})
export class ExampleComponent {
items = [
{ id: '1', label: 'Option 1' },
{ id: '2', label: 'Option 2' },
{ id: '3', label: 'Option 3' },
];
selectedKey = '1';
onSelect(item: any) {
console.log('Selected:', item);
}
}
import { Component } from '@angular/core';
import { LibsUiComponentsButtonsDropdownComponent } from '@libs-ui/components-buttons-dropdown';
@Component({
selector: 'app-example',
standalone: true,
imports: [LibsUiComponentsButtonsDropdownComponent],
templateUrl: './example.component.html',
})
export class ExampleComponent {
items = [
/* ... */
];
selectedKey = '';
onSelect(item: any) {}
}
<libs_ui-components-buttons-dropdown
[label]="'Chọn mục'"
[items]="items"
[(keySelected)]="selectedKey"
(outSelectItem)="onSelect($event)"></libs_ui-components-buttons-dropdown>
| Tên | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
| label | string | '' | Text hiển thị trên nút (ví dụ: "Chọn mục"). |
| items | Array<any> | required | Danh sách các mục sẽ hiển thị trong menu. |
| fieldDisplay | string | label | Trường của mục để hiển thị nội dung. |
| keyField | string | id | Trường của mục dùng làm giá trị key. |
| keySelected | string | undefined | Giá trị key đang được chọn (hỗ trợ two-way binding). |
| applyNow | boolean | false | Nếu true: chọn xong tự emit sự kiện; false: cần bấm nút Áp dụng. |
| showBorderBottom | boolean | false | Hiện đường kẻ dưới menu khi mở. |
| disable | boolean | false | Khóa dropdown, không cho chọn mục. |
| sizeButton | TYPE_SIZE_BUTTON | medium | Kích thước nút (.small/.medium/.large). |
| typeButton | TYPE_BUTTON | button-primary | Kiểu style của nút (primary, secondary,...). |
| classLabel | string | '' | Class CSS thêm cho nhãn (text). |
| classInclude | string | '' | Class CSS thêm cho phần container chính. |
| classIncludeContainer | string | undefined | Class CSS thêm cho phần container nội dung. |
| fieldClass | string | class | Trường trong mục chứa class CSS khi cần. |
| classIconLeft | string | '' | Class CSS thêm cho icon bên trái. |
| classIconRight | string | libs-ui-icon-move-right rotate-[90deg] | Class CSS thêm cho icon bên phải. |
| iconOnlyType | boolean | false | Chỉ hiện icon, không hiển thị nhãn. |
| popupConfig | IPopupConfigButtonDropdown | default cấu hình popover | Cấu hình chi tiết cho popover (vị trí, kích thước). |
| ignoreHiddenPopoverContentWhenMouseLeave | boolean | true | Giữ popover mở khi chuột rời khỏi nội dung. |
| modePopover | TYPE_POPOVER_MODE | click-toggle | Cách hiển thị popover (click, hover,...). |
| Tên | Kiểu | Mô tả |
|---|---|---|
| outSelectItem | (item: any) => void | Trả về mục (item) bạn vừa chọn. |
| outHover | (isHover: boolean) => void | Phát ra khi rê chuột lên/xuống trên một mục. |
| outApply | (item: any) => void | Phát ra khi bạn bấm nút Áp dụng (với applyNow=false). |
| outPopoverEvent | (event: TYPE_POPOVER_EVENT) => void | Phát ra các sự kiện của popover (show, hide, click, ...). |
| outFunctionsControl | (control: IPopoverFunctionControlEvent) => void | Cung cấp control API để điều khiển popover. |
| outIconEvent | (event: MouseEvent) => void | Phát ra khi bạn nhấn vào icon. |
export interface IButtonDropdown extends IButton {
items: any[];
fieldDisplay?: string;
keyField?: string;
keySelected?: string;
applyNow?: boolean;
showBorderBottom?: boolean;
popupConfig?: IPopupConfigButtonDropdown;
ignoreHiddenPopoverContentWhenMouseLeave?: boolean;
modePopover?: TYPE_POPOVER_MODE;
}
export interface IPopupConfigButtonDropdown {
width?: number;
maxWidth?: number;
maxHeight?: number;
zIndex?: number;
direction?: TYPE_POPOVER_DIRECTION;
timeDestroy?: number;
widthByParent?: boolean;
position?: {
mode: 'start' | 'center' | 'end';
distance: number;
};
classInclude?: string;
}
export type TYPE_POPOVER_DIRECTION = 'top' | 'right' | 'bottom' | 'left';
export type TYPE_POPOVER_MODE = 'hover' | 'click' | 'click-toggle' | 'click_open_and_click_panel_content_hidden';
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.