(container: HTMLElement, options: BaseGridOptions)
| 159 | } |
| 160 | |
| 161 | constructor(container: HTMLElement, options: BaseGridOptions) { |
| 162 | super(document.createElement('div'), options.disableAutoResizing); |
| 163 | this.element.style.height = '100%'; |
| 164 | this.element.style.width = '100%'; |
| 165 | |
| 166 | this._classNames = new Classnames(this.element); |
| 167 | this._classNames.setClassNames(options.className ?? ''); |
| 168 | |
| 169 | // the container is owned by the third-party, do not modify/delete it |
| 170 | container.appendChild(this.element); |
| 171 | |
| 172 | this.gridview = new Gridview( |
| 173 | !!options.proportionalLayout, |
| 174 | options.styles, |
| 175 | options.orientation, |
| 176 | options.locked, |
| 177 | options.margin |
| 178 | ); |
| 179 | |
| 180 | this.gridview.locked = !!options.locked; |
| 181 | |
| 182 | this.element.appendChild(this.gridview.element); |
| 183 | |
| 184 | this.layout(0, 0, true); // set some elements height/widths |
| 185 | |
| 186 | this.addDisposables( |
| 187 | this.gridview.onDidMaximizedNodeChange((event) => { |
| 188 | this._onDidMaximizedChange.fire({ |
| 189 | panel: event.view as T, |
| 190 | isMaximized: event.isMaximized, |
| 191 | }); |
| 192 | }), |
| 193 | this.gridview.onDidViewVisibilityChange(() => |
| 194 | this._onDidViewVisibilityChangeMicroTaskQueue.fire() |
| 195 | ), |
| 196 | this.onDidViewVisibilityChangeMicroTaskQueue(() => { |
| 197 | this.forceRelayout(); |
| 198 | }), |
| 199 | Disposable.from(() => { |
| 200 | this.element.parentElement?.removeChild(this.element); |
| 201 | }), |
| 202 | this.gridview.onDidChange(() => { |
| 203 | this._bufferOnDidLayoutChange.fire(); |
| 204 | }), |
| 205 | Event.any( |
| 206 | this.onDidAdd, |
| 207 | this.onDidRemove, |
| 208 | this.onDidActiveChange |
| 209 | )(() => { |
| 210 | this._bufferOnDidLayoutChange.fire(); |
| 211 | }), |
| 212 | this._onDidMaximizedChange, |
| 213 | this._onDidViewVisibilityChangeMicroTaskQueue, |
| 214 | this._bufferOnDidLayoutChange |
| 215 | ); |
| 216 | } |
| 217 | |
| 218 | public abstract toJSON(): object; |
nothing calls this directly
no test coverage detected
searching dependent graphs…