UNPKG

ngx-pluto

Version:
51 lines (50 loc) 1.76 kB
import { OnInit, EventEmitter } from '@angular/core'; import { NpTooltipDirective, NpTooltipPosition } from '../tooltip/index'; /** * kebab组件 * * <example-url>https://stackblitz.com/edit/angular-vc3q8h?embed=1&file=src/app/app.component.html</example-url> */ export declare class NpKebab implements OnInit { /**传入的需要进行展示的数组 */ data: KebabComponentData; /**布局格式,默认flex布局 */ display: string; position: NpTooltipPosition; /** * 点击单个item接收符合KebabItem 格式的对象 * */ onItemClicked: EventEmitter<{ $event: any; item: KebabItem; }>; dropdownTooltip: NpTooltipDirective; itemsInKebab: Array<KebabItem>; itemsOutKebab: Array<KebabItem>; isDropdownVisible: boolean; constructor(); ngOnInit(): void; onKebabItemClicked($event: any, item: KebabItem, itemInKebab?: boolean): void; private buildKebabItems; } /** * @ignore */ export interface KebabComponentData { items: Array<KebabItem>; /**If no limit passed in or 0, which means all items out of kebab; * if limit === items.length, which means all items in kebab; * otherwise, limit is the count for items in kebab. * */ limit?: number; } export interface KebabItem { /**页面展示文案,字符串类型,属于必传参数 */ value: string; /**可自己传入不同的id,支持字符串和数字,如果不传入,则默认生成随机id */ id?: string | number; /**支持传入`icon`, `text`, `separator`, 默认`text`*/ type?: 'text' | 'icon' | 'separator'; /** 支持传入颜色,非必传,不传使用默认色 */ color?: string; }