Class: SidebarService
molecule.SidebarService
Hierarchy
Implements
Constructors
constructor
• new SidebarService()
Overrides
Defined in
src/services/workbench/sidebarService.ts:53
Properties
state
• Protected
state: ISidebar
Implementation of
Overrides
Defined in
src/services/workbench/sidebarService.ts:51
Methods
add
▸ add(data
, isActive?
): void
Add a new Sidebar pane
Parameters
Name | Type | Default value |
---|---|---|
data | ISidebarPane | undefined |
isActive | boolean | false |
Returns
void
Implementation of
Defined in
src/services/workbench/sidebarService.ts:69
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:28
emit
▸ emit(name
, ...args
): void
Emit the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
...args | any | Arguments |
Returns
void
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:20
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Implementation of
Inherited from
Defined in
get
▸ get(id
): undefined
| ISidebarPane
Get a specific pane via id
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
undefined
| ISidebarPane
Implementation of
Defined in
src/services/workbench/sidebarService.ts:64
getPane
▸ Private
getPane(id
): undefined
| ISidebarPane
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
undefined
| ISidebarPane
Defined in
src/services/workbench/sidebarService.ts:58
getState
▸ getState(): ISidebar
Get the Component state
Returns
Implementation of
Inherited from
Defined in
onUpdateState
▸ onUpdateState(callback
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
callback | (prevState : ISidebar , nextState : ISidebar ) => void |
Returns
void
Implementation of
Inherited from
Defined in
remove
▸ remove(id
): void
Remove a pane
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
void
Implementation of
Defined in
src/services/workbench/sidebarService.ts:104
removeOnUpdateState
▸ removeOnUpdateState(): void
Remove the Component update event listening
Returns
void
Implementation of
ISidebarService.removeOnUpdateState
Inherited from
Defined in
render
▸ render(nextState?
): void
Initiative notify the component to render the view by the state
Parameters
Name | Type |
---|---|
nextState? | ISidebar |
Returns
void
Implementation of
Inherited from
Defined in
reset
▸ reset(): void
Reset the sidebar data
Returns
void
Implementation of
Defined in
src/services/workbench/sidebarService.ts:142
setActive
▸ setActive(id?
): void
Set the specific pane as active
Parameters
Name | Type |
---|---|
id? | UniqueId |
Returns
void
Implementation of
Defined in
src/services/workbench/sidebarService.ts:125
setState
▸ setState(values
, callback?
): void
Set the state values, and notify the view component to re render
Parameters
Name | Type | Description |
---|---|---|
values | Partial <ISidebar > | update target state values |
callback? | (prevState : ISidebar , nextState : ISidebar ) => void | - |
Returns
void
Implementation of
Inherited from
Defined in
subscribe
▸ subscribe(name
, callback
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
callback | Function | Callback function |
Returns
void
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:11
unsubscribe
▸ unsubscribe(name
): void
Unsubscribe the specific event
Parameters
Name | Type | Description |
---|---|---|
name | any | The event name |
Returns
void
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:37
update
▸ update(pane
): void
Update a specific pane
Parameters
Name | Type |
---|---|
pane | ISidebarPane |
Returns
void