MCPcopy
hub / github.com/mathuo/dockview / constructor

Function constructor

packages/dockview-core/src/gridview/baseComponentGridview.ts:161–216  ·  view source on GitHub ↗
(container: HTMLElement, options: BaseGridOptions)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 7

setClassNamesMethod · 0.80
addDisposablesMethod · 0.80
forceRelayoutMethod · 0.80
removeChildMethod · 0.80
onDidChangeMethod · 0.80
layoutMethod · 0.65
fireMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…