Files
ui-lib/lib/ui/icon.d.ts
T
lchen 5baf00de64 add: getText compatibility.
add: `AssetSelector` and `TemplateSelector`.
add: `popup-selector` style class.
add: `ui.resolvePopup` function.
add: `switch` in checkbox.
add: `GridColumn.filterTemplate` supports.
add: add `action` callback in `createIcon`.
change: replace `setTimeout(..., 0)` with `requestAnimationFrame`.
change: Popup result structure adjustment ({ result: any, popup: Popup }).
change: complete add work order flow.
change: reduce Popup title height.
fix: Grid column sort in number.
2024-06-21 17:28:11 +08:00

26 lines
1.1 KiB
TypeScript

/**
* 创建矢量图标元素
* @param type 样式分类,可以是 ['`fa-light`', '`fa-regular`', '`fa-solid`'] 其中之一
* @param id 图标 id
* @param style 样式表对象
* @param action 点击回调事件
*/
export function createIcon(type: string, id: string, style?: { [key: string]: string } | ((icon: SVGSVGElement) => { [key: string]: string }), action?: (this: SVGSVGElement, ev: MouseEvent) => any): SVGSVGElement
/**
* 修改矢量图标
* @param svg 矢量图标元素
* @param type 样式分类,见 { @link createIcon } 第一个参数
* @param id 图标 id,见 { @link createIcon } 第二个参数
*/
export function changeIcon(svg: SVGSVGElement, type: string, id: string): SVGSVGElement
/**
* 解析容器元素内符合条件的子元素为矢量图标元素
* @param container 容器元素
* @example
* ```
* <svg data-id="user" data-type="fa-solid"></svg>
* ```
* - `data-id`: 见 { @link createIcon } 第二个参数
* - `data-type`: 见 { @link createIcon } 第一个参数
*/
export function resolveIcon(container: HTMLElement): HTMLElement