Skip to content

Class: Selector

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Selector(target, userConfig?): Selector

Parameters

NameType
targetILeaf
userConfig?ISelectorConfig

Returns

Selector

Defined in

leafer/packages/partner/selector/src/Selector.ts:35

Properties

target

Optional target: ILeaf

Implementation of

ISelector.target

Defined in

leafer/packages/partner/selector/src/Selector.ts:11


proxy

Optional proxy: ISelectorProxy

Implementation of

ISelector.proxy

Defined in

leafer/packages/partner/selector/src/Selector.ts:13


config

config: ISelectorConfig = {}

Implementation of

ISelector.config

Defined in

leafer/packages/partner/selector/src/Selector.ts:15


picker

Protected picker: Picker

Defined in

leafer/packages/partner/selector/src/Selector.ts:17


innerIdMap

Protected innerIdMap: ILeafMap = {}

Defined in

leafer/packages/partner/selector/src/Selector.ts:19


idMap

Protected idMap: ILeafMap = {}

Defined in

leafer/packages/partner/selector/src/Selector.ts:20


findLeaf

Protected findLeaf: ILeaf

Defined in

leafer/packages/partner/selector/src/Selector.ts:22


methods

Protected methods: Object

Type declaration

NameType
id(leaf: ILeaf, name: string) => 0 | 1
innerId(leaf: ILeaf, innerId: number) => 0 | 1
className(leaf: ILeaf, name: string) => 0 | 1
tag(leaf: ILeaf, name: string) => 0 | 1
tags(leaf: ILeaf, nameMap: IBooleanMap) => 0 | 1

Defined in

leafer/packages/partner/selector/src/Selector.ts:24


__eventIds

Protected __eventIds: IEventListenerId[]

Defined in

leafer/packages/partner/selector/src/Selector.ts:32

Methods

getBy

getBy(condition, branch?, one?, options?): ILeaf | ILeaf[]

Parameters

NameType
conditionstring | number | IFindCondition | IFindMethod
branch?ILeaf
one?boolean
options?any

Returns

ILeaf | ILeaf[]

Implementation of

ISelector.getBy

Defined in

leafer/packages/partner/selector/src/Selector.ts:42


getByPoint

getByPoint(hitPoint, hitRadius, options?): IPickResult

Parameters

NameType
hitPointIPointData
hitRadiusnumber
options?IPickOptions

Returns

IPickResult

Implementation of

ISelector.getByPoint

Defined in

leafer/packages/partner/selector/src/Selector.ts:71


getByInnerId

getByInnerId(innerId, branch?): ILeaf

Parameters

NameType
innerIdnumber
branch?ILeaf

Returns

ILeaf

Implementation of

ISelector.getByInnerId

Defined in

leafer/packages/partner/selector/src/Selector.ts:76


getById

getById(id, branch?): ILeaf

Parameters

NameType
idstring
branch?ILeaf

Returns

ILeaf

Implementation of

ISelector.getById

Defined in

leafer/packages/partner/selector/src/Selector.ts:83


getByClassName

getByClassName(className, branch?): ILeaf[]

Parameters

NameType
classNamestring
branch?ILeaf

Returns

ILeaf[]

Implementation of

ISelector.getByClassName

Defined in

leafer/packages/partner/selector/src/Selector.ts:90


getByTag

getByTag(tag, branch?): ILeaf[]

Parameters

NameType
tagstring
branch?ILeaf

Returns

ILeaf[]

Implementation of

ISelector.getByTag

Defined in

leafer/packages/partner/selector/src/Selector.ts:94


getByMethod

getByMethod(method, branch?, one?, options?): ILeaf | ILeaf[]

Parameters

NameType
methodIFindMethod
branch?ILeaf
one?boolean
options?any

Returns

ILeaf | ILeaf[]

Implementation of

ISelector.getByMethod

Defined in

leafer/packages/partner/selector/src/Selector.ts:98


eachFind

eachFind(children, method, list?, options?): void

Parameters

NameType
childrenILeaf[]
methodIFindMethod
list?ILeaf[]
options?any

Returns

void

Defined in

leafer/packages/partner/selector/src/Selector.ts:105


toChildren

toChildren(branch): ILeaf[]

Parameters

NameType
branchILeaf

Returns

ILeaf[]

Defined in

leafer/packages/partner/selector/src/Selector.ts:122


__onRemoveChild

__onRemoveChild(event): void

Parameters

NameType
eventChildEvent

Returns

void

Defined in

leafer/packages/partner/selector/src/Selector.ts:128


__checkIdChange

__checkIdChange(event): void

Parameters

NameType
eventPropertyEvent

Returns

void

Defined in

leafer/packages/partner/selector/src/Selector.ts:134


__listenEvents

__listenEvents(): void

Returns

void

Defined in

leafer/packages/partner/selector/src/Selector.ts:142


__removeListenEvents

__removeListenEvents(): void

Returns

void

Defined in

leafer/packages/partner/selector/src/Selector.ts:149


destroy

destroy(): void

Returns

void

Implementation of

ISelector.destroy

Defined in

leafer/packages/partner/selector/src/Selector.ts:154

Released under the MIT License.