Sidepanel
Sidepanel — UI component for opening a side panel in the Аспро.Cloud platform interface
ts
import { Sidepanel } from '@aspro-cloud/miniapp-jssdk'Constructor
Creates a Sidepanel instance with the given parameters
ts
constructor(params: SidepanelParams)| Parameter | Type | Description |
|---|---|---|
params | SidepanelParams | Side panel creation parameters |
Properties
events
Object of type EventCallbacks<SidepanelEventName> with event handlers
ts
get events(): EventCallbacks
set events(value: EventCallbacks)options
Side panel display options of type SidepanelOptions
ts
options: SidepanelOptionstitle
Side panel title
ts
title: stringurl
URL of the page to open
ts
url: stringMethods
destroy
Removes subscriptions and frees resources
ts
destroy(): voidhide
Closes the side panel programmatically
ts
async hide(): Promise<any>show
Opens the side panel
ts
async show(): Promise<any>show() method events:
| Event | Parameter | Type | Description |
|---|---|---|---|
'onShow' | Side panel is shown | ||
'onHide' | Side panel is hidden | ||
'onClose' | Side panel is closed by user |
Example
ts
import { App, Sidepanel } from '@aspro-cloud/miniapp-jssdk'
await App.initializeFrame()
const panel = new Sidepanel({
title: 'User Profile',
url: '/_module/company/view/member/433772?tab=contacts',
options: {
width: 'md'
},
events: {
onShow: () => console.log('Side panel shown'),
onHide: () => console.log('Side panel hidden'),
onClose: () => console.log('Side panel closed by user')
}
})
await panel.show()js
const App = window.ACloudMiniApp;
await App.initializeFrame();
const panel = new App.Frame.Sidepanel({
title: 'User Profile',
url: '/_module/company/view/member/433772?tab=contacts',
options: {
width: 'md'
},
events: {
onShow: () => console.log('Side panel shown'),
onHide: () => console.log('Side panel hidden'),
onClose: () => console.log('Side panel closed by user')
}
});
await panel.show();