web原子操作

飞道科技

@dfeidao/atom-web > ui操作

External module: ui操作

Index

Functions


Functions

check

check(node: HTMLInputElement, checked: boolean): void

Defined in ui/check.ts:10

选中/取消/选中 复选框

Parameters:

Name Type Description
node HTMLInputElement 节点对象
checked boolean 是否选中

Returns: void


checked

checked(node: HTMLInputElement): boolean

Defined in ui/get-checked.ts:10

获取复选框是否选中

Parameters:

Name Type Description
node HTMLInputElement 节点对象

Returns: boolean 是否选中


exit_full_screen

exit_full_screen(): Promise<void>

Defined in ui/exit-full-screen.ts:23

Returns: Promise<void>


full_screen

full_screen(fd: IFeidaoAiBrowserComponent, event_name: string, element?: HTMLElement): void

Defined in ui/full-screen.ts:36

Parameters:

Name Type Default value
fd IFeidaoAiBrowserComponent -
event_name string -
Default value element HTMLElement document.documentElement

Returns: void


get_attr

get_attr(node: HTMLElement, attr_name: string): null | string

Defined in ui/get-attr.ts:10

获取dom属性值

Parameters:

Name Type Description
node HTMLElement 节点对象
attr_name string 属性名称

Returns: null | string


get_dom_by_attr

get_dom_by_attr(node: HTMLElement, attr: string, id: string): HTMLElement[]

Defined in ui/get-dom-by-attr.ts:11

根据属性获取dom

Parameters:

Name Type Description
node HTMLElement 节点
attr string 属性
id string 属性的值

Returns: HTMLElement[]


get_dom_by_id

get_dom_by_id(node: HTMLElement, id: string): HTMLElement

Defined in ui/get-dom-by-id.ts:12

通过id获取dom

Parameters:

Name Type Description
node HTMLElement 节点对象
id string 节点id或data-feidao-id

Returns: HTMLElement


get_event_target

get_event_target(e: Event): HTMLElement

Defined in ui/get-event-target.ts:9

获取事件目标

Parameters:

Name Type Description
e Event 事件

Returns: HTMLElement


get_html

get_html(node: HTMLElement): string

Defined in ui/get-html.ts:9

获取节点的innerHtml

Parameters:

Name Type Description
node HTMLElement 节点对象

Returns: string


get_selected

get_selected(node: HTMLSelectElement, type: “value” | “text”): string

Defined in ui/get-selected.ts:10

获取select当前选中项value或text

Parameters:

Name Type Description
node HTMLSelectElement select节点
type “value” | “text” 获取value或text

Returns: string


get_value

get_value(e: Event, key: string): any

Defined in ui/get-event-value.ts:5

module: ui操作

Parameters:

Name Type
e Event
key string

Returns: any


get_value

get_value(node: HTMLInputElement | HTMLButtonElement | HTMLTextAreaElement | HTMLSelectElement): string

Defined in ui/get-value.ts:9

获取dom表单项值

Parameters:

Name Type Description
node HTMLInputElement | HTMLButtonElement | HTMLTextAreaElement | HTMLSelectElement 节点对象,必须为`input`,`button`,`textarea`,`select`其中的一种

Returns: string


hide

hide(node: HTMLElement): void

Defined in ui/hide.ts:9

隐藏节点

Parameters:

Name Type Description
node HTMLElement 节点对象

Returns: void


notify

notify(fd: IFeidaoAiBrowserComponent, title: string, msg: string, action: string, icon?: undefined | string, image?: undefined | string): Promise<void>

Defined in ui/notify.ts:15

显示通知

Parameters:

Name Type Description
fd IFeidaoAiBrowserComponent  
title string 标题
msg string 消息内容
action string 用户点击消息后的响应(事件)编号
Optional icon undefined | string  
Optional image undefined | string  

Returns: Promise<void>


remove_node

remove_node(node: HTMLElement): void

Defined in ui/remove-node.ts:9

删除节点

Parameters:

Name Type Description
node HTMLElement 节点对象

Returns: void


remove_node_attr

remove_node_attr(node: HTMLElement, …attr_names: string[]): void

Defined in ui/remove-node-attr.ts:10

删除节点属性

Parameters:

Name Type Description
node HTMLElement 节点对象
Rest attr_names string[] 属性名

Returns: void


set_content

set_content(node: HTMLInputElement | HTMLButtonElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement, value: string): void

Defined in ui/set-value.ts:10

设置dom表单项值

Parameters:

Name Type Description
node HTMLInputElement | HTMLButtonElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement 节点对象,必须为`input`,`button`,`textarea`,`select`其中的一种
value string 表单项的值

Returns: void


set_html

set_html(node: HTMLElement, html: string): void

Defined in ui/set-html.ts:10

设置节点的innerHtml

Parameters:

Name Type Description
node HTMLElement 节点对象
html string 设置内容

Returns: void


set_node_attr

set_node_attr(node: HTMLElement, attr_name: string, attr_val: string): void

Defined in ui/set-node-attr.ts:11

设置节点属性值

Parameters:

Name Type Description
node HTMLElement 节点对象
attr_name string 属性名
attr_val string 属性值

Returns: void


set_node_cls

set_node_cls(node: HTMLElement, class_name: string, add: boolean): void

Defined in ui/set-node-cls.ts:11

设置节点的css

Parameters:

Name Type Description
node HTMLElement 节点对象(数组类型可以写多个节点)
class_name string 样式名称多个空格隔开
add boolean true是添加false是移除

Returns: void


set_nodes_cls

set_nodes_cls(nodes: HTMLElement[], class_name: string, add: boolean): void

Defined in ui/set-nodes-cls.ts:13

设置节点的css

Parameters:

Name Type Description
nodes HTMLElement[] 节点对象(数组类型可以写多个节点)
class_name string 样式名称多个空格隔开
add boolean true是添加false是移除

Returns: void


set_text

set_text(node: HTMLElement, text: string): void

Defined in ui/set-text.ts:10

设置节点的innerText

Parameters:

Name Type Description
node HTMLElement 节点对象
text string 设置内容

Returns: void


show

show(node: HTMLElement): void

Defined in ui/show.ts:9

显示节点

Parameters:

Name Type Description
node HTMLElement 节点对象

Returns: void