(readonly skeleton: ISkeleton, readonly config: IPublicTypePanelConfig)
| 81 | @obx.ref public parent?: WidgetContainer; |
| 82 | |
| 83 | constructor(readonly skeleton: ISkeleton, readonly config: IPublicTypePanelConfig) { |
| 84 | makeObservable(this); |
| 85 | const { name, content, props = {} } = config; |
| 86 | const { hideTitleBar, title, icon, description, help } = props; |
| 87 | this.name = name; |
| 88 | this.id = uniqueId(`pane:${name}$`); |
| 89 | this.title = composeTitle(title || name, icon, description); |
| 90 | this.plain = hideTitleBar || !title; |
| 91 | this.help = help; |
| 92 | if (Array.isArray(content)) { |
| 93 | this.container = this.skeleton.createContainer( |
| 94 | name, |
| 95 | (item) => { |
| 96 | if (isPanel(item)) { |
| 97 | return item; |
| 98 | } |
| 99 | return this.skeleton.createPanel(item); |
| 100 | }, |
| 101 | true, |
| 102 | () => this.visible, |
| 103 | true, |
| 104 | ); |
| 105 | content.forEach((item) => this.add(item)); |
| 106 | } |
| 107 | if (props.onInit) { |
| 108 | props.onInit.call(this, this); |
| 109 | } |
| 110 | |
| 111 | if (typeof content !== 'string' && content && content.onInit) { |
| 112 | content.onInit.call(this, this); |
| 113 | } |
| 114 | // todo: process shortcut |
| 115 | } |
| 116 | |
| 117 | setParent(parent: WidgetContainer) { |
| 118 | if (parent === this.parent) { |
nothing calls this directly
no test coverage detected