@alauda-fe/common
Version:
Alauda frontend team common codes.
57 lines (56 loc) • 3.11 kB
TypeScript
import { TagType } from '@alauda/ui';
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, Injector, NgZone, OnDestroy, OnInit, TemplateRef } from '@angular/core';
import { Observable } from 'rxjs';
import { ListenResizeDirective } from '../../core/public-api';
import * as i0 from "@angular/core";
/**
* User could provide two types of tags to use this component.
* Tags requires a map of tags, while tagList requires a list of key/value pairs.
*/
export declare const tagRenderDefault: <T>(tag: T | [string | T, T]) => string;
export declare class TagsLabelComponent<T = string> extends ListenResizeDirective implements AfterViewInit, OnDestroy, OnInit {
private readonly cdr;
private readonly ngZone;
tagsContainerMirror: ElementRef;
tagsContainer: ElementRef;
/**
* @deprecated
* 在父组件内处理 pointer 样式
*/
tagClickable: boolean;
border: boolean;
tagType: TagType;
tagRound: boolean;
tagClick: EventEmitter<T | [string | T, T]>;
tagTemplate: TemplateRef<unknown>;
constructor(injector: Injector, cdr: ChangeDetectorRef, ngZone: NgZone);
tags: Record<string, T> | Array<T | [string | T, T]>;
tags$: Observable<Record<string, T> | Array<T | [string | T, T]>>;
tooltipPosition: string;
showMore: boolean;
isWrapped: boolean;
controlSize: number;
controlSize$: Observable<number>;
isControlSize: boolean;
tagRender: ((tag: T) => string) | ((tag: [string, T]) => string) | ((tag: [T, T]) => string) | ((tag: [string | T, T]) => string);
private readonly tagsContainerSize$$;
private readonly selfContainerSize$;
private readonly containerSize$;
private tagsTotalCount;
shouldRenderCount: number;
shouldRenderEllipse: boolean;
tagsValue$: Observable<(T | [string | T, T])[]>;
private readonly tagsPositionInfo$$;
ELLIPSE_TAG_WIDTH: number;
private readonly renderCount$;
_isChangeDetectionPending: boolean;
debounceResize: import("lodash").DebouncedFunc<() => void>;
private markNeedRender;
/** Run change detection. */
private _doChangeDetection;
ngOnInit(): void;
onResize(): void;
ngAfterViewInit(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<TagsLabelComponent<any>, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TagsLabelComponent<any>, "acl-tags-label", never, { "tagClickable": { "alias": "tagClickable"; "required": false; }; "border": { "alias": "border"; "required": false; }; "tagType": { "alias": "tagType"; "required": false; }; "tagRound": { "alias": "tagRound"; "required": false; }; "tags": { "alias": "tags"; "required": false; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; }; "showMore": { "alias": "showMore"; "required": false; }; "isWrapped": { "alias": "isWrapped"; "required": false; }; "controlSize": { "alias": "controlSize"; "required": false; }; "isControlSize": { "alias": "isControlSize"; "required": false; }; "tagRender": { "alias": "tagRender"; "required": false; }; }, { "tagClick": "tagClick"; }, ["tagTemplate"], ["*"], true, never>;
}