@jupyterlab/ui-components 4.7.0-alpha.2 → 4.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/accordionpanelreorderer.d.ts +62 -0
- package/lib/components/accordionpanelreorderer.js +271 -0
- package/lib/components/accordionpanelreorderer.js.map +1 -0
- package/lib/components/form.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/sidepanel.d.ts +1 -0
- package/lib/components/sidepanel.js +5 -0
- package/lib/components/sidepanel.js.map +1 -1
- package/lib/components/toolbar.d.ts +8 -11
- package/lib/components/toolbar.js +77 -52
- package/lib/components/toolbar.js.map +1 -1
- package/lib/components/vdom.d.ts +10 -0
- package/lib/components/vdom.js +50 -12
- package/lib/components/vdom.js.map +1 -1
- package/lib/components/windowedlist.js +13 -0
- package/lib/components/windowedlist.js.map +1 -1
- package/package.json +7 -7
- package/src/components/accordionpanelreorderer.ts +318 -0
- package/src/components/form.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/sidepanel.ts +6 -0
- package/src/components/toolbar.tsx +93 -58
- package/src/components/vdom.ts +50 -12
- package/src/components/windowedlist.ts +18 -0
- package/style/icons/debugger/open-kernel-source.svg +1 -1
- package/style/sidepanel.css +43 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ITranslator } from '@jupyterlab/translation';
|
|
2
|
+
import type { IDisposable } from '@lumino/disposable';
|
|
3
|
+
import type { ISignal } from '@lumino/signaling';
|
|
4
|
+
import type { AccordionPanel, Widget } from '@lumino/widgets';
|
|
5
|
+
/**
|
|
6
|
+
* Opt-in drag reordering shared by sidebar accordion panels.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AccordionPanelReorderer implements IDisposable, EventListenerObject {
|
|
9
|
+
private _panel;
|
|
10
|
+
/**
|
|
11
|
+
* Get or create the reorderer for a panel.
|
|
12
|
+
*/
|
|
13
|
+
static get(panel: AccordionPanel, translator?: ITranslator): AccordionPanelReorderer;
|
|
14
|
+
/**
|
|
15
|
+
* Find the reorderer associated with an accordion node.
|
|
16
|
+
*/
|
|
17
|
+
static find(node: HTMLElement): AccordionPanelReorderer | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Whether drag reordering is enabled in every accordion panel.
|
|
20
|
+
*/
|
|
21
|
+
static get enabled(): boolean;
|
|
22
|
+
static set enabled(value: boolean);
|
|
23
|
+
/**
|
|
24
|
+
* A signal emitted when drag reordering is enabled or disabled.
|
|
25
|
+
*/
|
|
26
|
+
static get enabledChanged(): ISignal<typeof AccordionPanelReorderer, boolean>;
|
|
27
|
+
private constructor();
|
|
28
|
+
/**
|
|
29
|
+
* A signal emitted after a section is reordered.
|
|
30
|
+
*/
|
|
31
|
+
get reordered(): ISignal<this, Widget>;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the reorderer has been disposed.
|
|
34
|
+
*/
|
|
35
|
+
get isDisposed(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Remove event listeners and drag controls.
|
|
38
|
+
*/
|
|
39
|
+
dispose(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Handle pointer events from the panel's drag handles.
|
|
42
|
+
*/
|
|
43
|
+
handleEvent(event: Event): void;
|
|
44
|
+
private _onEnabledChanged;
|
|
45
|
+
private _updateHandles;
|
|
46
|
+
private _coordinate;
|
|
47
|
+
private _getTargetSlot;
|
|
48
|
+
private _showIndicator;
|
|
49
|
+
private _endDrag;
|
|
50
|
+
private static _instances;
|
|
51
|
+
private static _enabled;
|
|
52
|
+
private static _enabledChanged;
|
|
53
|
+
private _trans;
|
|
54
|
+
private _observer;
|
|
55
|
+
private _indicator;
|
|
56
|
+
private _isDisposed;
|
|
57
|
+
private _draggedWidget;
|
|
58
|
+
private _pointerId;
|
|
59
|
+
private _start;
|
|
60
|
+
private _isDragging;
|
|
61
|
+
private _reordered;
|
|
62
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { nullTranslator } from '@jupyterlab/translation';
|
|
4
|
+
import { Signal } from '@lumino/signaling';
|
|
5
|
+
/**
|
|
6
|
+
* Opt-in drag reordering shared by sidebar accordion panels.
|
|
7
|
+
*/
|
|
8
|
+
export class AccordionPanelReorderer {
|
|
9
|
+
/**
|
|
10
|
+
* Get or create the reorderer for a panel.
|
|
11
|
+
*/
|
|
12
|
+
static get(panel, translator = nullTranslator) {
|
|
13
|
+
let reorderer = this._instances.get(panel.node);
|
|
14
|
+
if (!reorderer) {
|
|
15
|
+
reorderer = new AccordionPanelReorderer(panel, translator);
|
|
16
|
+
this._instances.set(panel.node, reorderer);
|
|
17
|
+
}
|
|
18
|
+
return reorderer;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Find the reorderer associated with an accordion node.
|
|
22
|
+
*/
|
|
23
|
+
static find(node) {
|
|
24
|
+
return this._instances.get(node);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Whether drag reordering is enabled in every accordion panel.
|
|
28
|
+
*/
|
|
29
|
+
static get enabled() {
|
|
30
|
+
return this._enabled;
|
|
31
|
+
}
|
|
32
|
+
static set enabled(value) {
|
|
33
|
+
if (value === this._enabled) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this._enabled = value;
|
|
37
|
+
this._enabledChanged.emit(value);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A signal emitted when drag reordering is enabled or disabled.
|
|
41
|
+
*/
|
|
42
|
+
static get enabledChanged() {
|
|
43
|
+
return this._enabledChanged;
|
|
44
|
+
}
|
|
45
|
+
constructor(_panel, translator) {
|
|
46
|
+
this._panel = _panel;
|
|
47
|
+
this._indicator = document.createElement('div');
|
|
48
|
+
this._isDisposed = false;
|
|
49
|
+
this._draggedWidget = null;
|
|
50
|
+
this._pointerId = null;
|
|
51
|
+
this._start = 0;
|
|
52
|
+
this._isDragging = false;
|
|
53
|
+
this._reordered = new Signal(this);
|
|
54
|
+
this._trans = translator.load('jupyterlab');
|
|
55
|
+
this._indicator.className = 'jp-AccordionPanel-dropIndicator';
|
|
56
|
+
this._indicator.style.display = 'none';
|
|
57
|
+
_panel.node.appendChild(this._indicator);
|
|
58
|
+
this._onEnabledChanged();
|
|
59
|
+
AccordionPanelReorderer._enabledChanged.connect(this._onEnabledChanged, this);
|
|
60
|
+
this._observer = new MutationObserver(() => this._updateHandles());
|
|
61
|
+
this._observer.observe(_panel.node, { childList: true });
|
|
62
|
+
for (const type of [
|
|
63
|
+
'pointerdown',
|
|
64
|
+
'pointermove',
|
|
65
|
+
'pointerup',
|
|
66
|
+
'pointercancel',
|
|
67
|
+
'lostpointercapture'
|
|
68
|
+
]) {
|
|
69
|
+
_panel.node.addEventListener(type, this);
|
|
70
|
+
}
|
|
71
|
+
_panel.disposed.connect(this.dispose, this);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A signal emitted after a section is reordered.
|
|
75
|
+
*/
|
|
76
|
+
get reordered() {
|
|
77
|
+
return this._reordered;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Whether the reorderer has been disposed.
|
|
81
|
+
*/
|
|
82
|
+
get isDisposed() {
|
|
83
|
+
return this._isDisposed;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Remove event listeners and drag controls.
|
|
87
|
+
*/
|
|
88
|
+
dispose() {
|
|
89
|
+
if (this._isDisposed) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this._isDisposed = true;
|
|
93
|
+
this._endDrag();
|
|
94
|
+
this._panel.removeClass('jp-mod-reorderable');
|
|
95
|
+
this._observer.disconnect();
|
|
96
|
+
for (const type of [
|
|
97
|
+
'pointerdown',
|
|
98
|
+
'pointermove',
|
|
99
|
+
'pointerup',
|
|
100
|
+
'pointercancel',
|
|
101
|
+
'lostpointercapture'
|
|
102
|
+
]) {
|
|
103
|
+
this._panel.node.removeEventListener(type, this);
|
|
104
|
+
}
|
|
105
|
+
this._panel.node
|
|
106
|
+
.querySelectorAll('.jp-AccordionPanel-dragHandle')
|
|
107
|
+
.forEach(handle => handle.remove());
|
|
108
|
+
this._indicator.remove();
|
|
109
|
+
AccordionPanelReorderer._instances.delete(this._panel.node);
|
|
110
|
+
Signal.clearData(this);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Handle pointer events from the panel's drag handles.
|
|
114
|
+
*/
|
|
115
|
+
handleEvent(event) {
|
|
116
|
+
if (event.type === 'keydown') {
|
|
117
|
+
if (this._draggedWidget && event.key === 'Escape') {
|
|
118
|
+
this._endDrag();
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
event.stopPropagation();
|
|
121
|
+
}
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const pointer = event;
|
|
125
|
+
if (event.type === 'pointerdown') {
|
|
126
|
+
const target = event.target;
|
|
127
|
+
if (!AccordionPanelReorderer.enabled ||
|
|
128
|
+
this._pointerId !== null ||
|
|
129
|
+
pointer.button !== 0 ||
|
|
130
|
+
!(target instanceof HTMLElement) ||
|
|
131
|
+
!target.closest('.jp-AccordionPanel-dragHandle')) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const title = target.closest('.lm-AccordionPanel-title');
|
|
135
|
+
const index = this._panel.titles.findIndex(node => node === title);
|
|
136
|
+
if (index < 0) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this._draggedWidget = this._panel.widgets[index];
|
|
140
|
+
this._start = this._coordinate(pointer);
|
|
141
|
+
this._pointerId = pointer.pointerId;
|
|
142
|
+
this._panel.node.setPointerCapture(pointer.pointerId);
|
|
143
|
+
this._panel.node.ownerDocument.addEventListener('keydown', this, true);
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
}
|
|
146
|
+
else if (pointer.pointerId === this._pointerId) {
|
|
147
|
+
switch (event.type) {
|
|
148
|
+
case 'pointermove': {
|
|
149
|
+
const position = this._coordinate(pointer);
|
|
150
|
+
if (Math.abs(position - this._start) > 5) {
|
|
151
|
+
this._isDragging = true;
|
|
152
|
+
this._panel.addClass('jp-mod-dragging');
|
|
153
|
+
}
|
|
154
|
+
if (this._isDragging) {
|
|
155
|
+
this._showIndicator(this._getTargetSlot(position));
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
case 'pointerup':
|
|
160
|
+
this._endDrag(this._coordinate(pointer));
|
|
161
|
+
break;
|
|
162
|
+
case 'pointercancel':
|
|
163
|
+
case 'lostpointercapture':
|
|
164
|
+
this._endDrag();
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_onEnabledChanged() {
|
|
170
|
+
this._panel.toggleClass('jp-mod-reorderable', AccordionPanelReorderer.enabled);
|
|
171
|
+
if (!AccordionPanelReorderer.enabled) {
|
|
172
|
+
this._endDrag();
|
|
173
|
+
}
|
|
174
|
+
this._updateHandles();
|
|
175
|
+
}
|
|
176
|
+
_updateHandles() {
|
|
177
|
+
for (const title of this._panel.titles) {
|
|
178
|
+
if (!title.querySelector('.jp-AccordionPanel-dragHandle')) {
|
|
179
|
+
const handle = document.createElement('span');
|
|
180
|
+
handle.className = 'jp-AccordionPanel-dragHandle';
|
|
181
|
+
handle.setAttribute('aria-hidden', 'true');
|
|
182
|
+
handle.title = this._trans.__('Drag to reorder');
|
|
183
|
+
title.prepend(handle);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
_coordinate(event) {
|
|
188
|
+
return this._panel.orientation === 'horizontal'
|
|
189
|
+
? event.clientX
|
|
190
|
+
: event.clientY;
|
|
191
|
+
}
|
|
192
|
+
_getTargetSlot(position) {
|
|
193
|
+
const horizontal = this._panel.orientation === 'horizontal';
|
|
194
|
+
const slot = this._panel.titles.findIndex(title => {
|
|
195
|
+
const rect = title.getBoundingClientRect();
|
|
196
|
+
return (position <
|
|
197
|
+
(horizontal ? rect.left + rect.width / 2 : rect.top + rect.height / 2));
|
|
198
|
+
});
|
|
199
|
+
return slot < 0 ? this._panel.titles.length : slot;
|
|
200
|
+
}
|
|
201
|
+
_showIndicator(slot) {
|
|
202
|
+
var _a;
|
|
203
|
+
const titles = this._panel.titles;
|
|
204
|
+
if (!titles.length) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const horizontal = this._panel.orientation === 'horizontal';
|
|
208
|
+
const last = this._panel.widgets[titles.length - 1];
|
|
209
|
+
// After the last section, the line goes below its body when it is expanded.
|
|
210
|
+
const rect = ((_a = titles[slot]) !== null && _a !== void 0 ? _a : (last.isHidden ? titles[titles.length - 1] : last.node)).getBoundingClientRect();
|
|
211
|
+
const panelRect = this._panel.node.getBoundingClientRect();
|
|
212
|
+
const edge = horizontal
|
|
213
|
+
? slot < titles.length
|
|
214
|
+
? rect.left
|
|
215
|
+
: rect.right
|
|
216
|
+
: slot < titles.length
|
|
217
|
+
? rect.top
|
|
218
|
+
: rect.bottom;
|
|
219
|
+
this._indicator.style.left = horizontal ? `${edge - panelRect.left}px` : '';
|
|
220
|
+
this._indicator.style.top = horizontal ? '' : `${edge - panelRect.top}px`;
|
|
221
|
+
// Draw the line before the far edge, so that it stays inside the panel.
|
|
222
|
+
this._indicator.style.transform =
|
|
223
|
+
slot < titles.length
|
|
224
|
+
? ''
|
|
225
|
+
: horizontal
|
|
226
|
+
? 'translateX(-100%)'
|
|
227
|
+
: 'translateY(-100%)';
|
|
228
|
+
this._indicator.style.display = 'block';
|
|
229
|
+
}
|
|
230
|
+
_endDrag(position) {
|
|
231
|
+
var _a;
|
|
232
|
+
const widget = this._draggedWidget;
|
|
233
|
+
const dragging = this._isDragging;
|
|
234
|
+
const pointerId = this._pointerId;
|
|
235
|
+
this._draggedWidget = null;
|
|
236
|
+
this._isDragging = false;
|
|
237
|
+
this._pointerId = null;
|
|
238
|
+
this._indicator.style.display = 'none';
|
|
239
|
+
this._panel.removeClass('jp-mod-dragging');
|
|
240
|
+
this._panel.node.ownerDocument.removeEventListener('keydown', this, true);
|
|
241
|
+
if (pointerId !== null && this._panel.node.hasPointerCapture(pointerId)) {
|
|
242
|
+
this._panel.node.releasePointerCapture(pointerId);
|
|
243
|
+
}
|
|
244
|
+
if (dragging && widget && position !== undefined) {
|
|
245
|
+
const current = this._panel.widgets.indexOf(widget);
|
|
246
|
+
if (current < 0) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const slot = this._getTargetSlot(position);
|
|
250
|
+
const index = slot > current ? slot - 1 : slot;
|
|
251
|
+
if (index !== current) {
|
|
252
|
+
this._panel.insertWidget(index, widget);
|
|
253
|
+
// Lumino only repositions the section, so move its title, body and
|
|
254
|
+
// handle to keep the Tab order the same as the visual order.
|
|
255
|
+
const next = (_a = this._panel.titles[index + 1]) !== null && _a !== void 0 ? _a : null;
|
|
256
|
+
for (const node of [
|
|
257
|
+
this._panel.titles[index],
|
|
258
|
+
widget.node,
|
|
259
|
+
this._panel.handles[index]
|
|
260
|
+
]) {
|
|
261
|
+
this._panel.node.insertBefore(node, next);
|
|
262
|
+
}
|
|
263
|
+
this._reordered.emit(widget);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
AccordionPanelReorderer._instances = new WeakMap();
|
|
269
|
+
AccordionPanelReorderer._enabled = false;
|
|
270
|
+
AccordionPanelReorderer._enabledChanged = new Signal(AccordionPanelReorderer);
|
|
271
|
+
//# sourceMappingURL=accordionpanelreorderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordionpanelreorderer.js","sourceRoot":"","sources":["../../src/components/accordionpanelreorderer.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EAAE,MAA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M,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,mCAAI,IAAI,CAAC;gBACnD,KAAK,MAAM,IAAI,IAAI;oBACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;oBACzB,MAAM,CAAC,IAAI;oBACX,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;iBAC3B,EAAE,CAAC;oBACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC5C,CAAC;gBACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;;AAEc,kCAAU,GAAG,IAAI,OAAO,EAGpC,AAHsB,CAGrB;AACW,gCAAQ,GAAG,KAAK,AAAR,CAAS;AACjB,uCAAe,GAAG,IAAI,MAAM,CAGzC,uBAAuB,CAAC,AAHI,CAGH"}
|
package/lib/components/form.d.ts
CHANGED
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { Toolbar } from './toolbar';
|
|
|
7
7
|
* #### Note
|
|
8
8
|
* By default the content widget is an accordion panel that supports widget with
|
|
9
9
|
* associated toolbar to be displayed in the widget title.
|
|
10
|
+
* Give content widgets stable, unique IDs to persist their order and state.
|
|
10
11
|
*/
|
|
11
12
|
export declare class SidePanel extends Widget {
|
|
12
13
|
constructor(options?: SidePanel.IOptions);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
4
4
|
import { AccordionPanel, Panel, PanelLayout, Widget } from '@lumino/widgets';
|
|
5
|
+
import { AccordionPanelReorderer } from './accordionpanelreorderer';
|
|
5
6
|
import { AccordionToolbar } from './accordiontoolbar';
|
|
6
7
|
import { Toolbar } from './toolbar';
|
|
7
8
|
/**
|
|
@@ -10,6 +11,7 @@ import { Toolbar } from './toolbar';
|
|
|
10
11
|
* #### Note
|
|
11
12
|
* By default the content widget is an accordion panel that supports widget with
|
|
12
13
|
* associated toolbar to be displayed in the widget title.
|
|
14
|
+
* Give content widgets stable, unique IDs to persist their order and state.
|
|
13
15
|
*/
|
|
14
16
|
export class SidePanel extends Widget {
|
|
15
17
|
constructor(options = {}) {
|
|
@@ -30,6 +32,9 @@ export class SidePanel extends Widget {
|
|
|
30
32
|
content.node.setAttribute('aria-label', trans.__('side panel content'));
|
|
31
33
|
content.addClass('jp-SidePanel-content');
|
|
32
34
|
layout.addWidget(content);
|
|
35
|
+
if (content instanceof AccordionPanel) {
|
|
36
|
+
AccordionPanelReorderer.get(content, options.translator);
|
|
37
|
+
}
|
|
33
38
|
if (options.toolbar) {
|
|
34
39
|
this.addToolbar(options.toolbar);
|
|
35
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidepanel.js","sourceRoot":"","sources":["../../src/components/sidepanel.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC
|
|
1
|
+
{"version":3,"file":"sidepanel.js","sourceRoot":"","sources":["../../src/components/sidepanel.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAo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AAU,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAsB,CAAC,YAAY,CACtC,IAAI,CAAC,MAAsB,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAC/C,UAAU,CACX,CAAC;IACJ,CAAC;CAMF"}
|
|
@@ -118,6 +118,7 @@ export declare class Toolbar<T extends Widget = Widget> extends Widget {
|
|
|
118
118
|
*/
|
|
119
119
|
protected onBeforeDetach(msg: Message): void;
|
|
120
120
|
noFocusOnClick: boolean;
|
|
121
|
+
private _focusBeforeClick;
|
|
121
122
|
}
|
|
122
123
|
/**
|
|
123
124
|
* A class which provides a toolbar widget.
|
|
@@ -184,17 +185,14 @@ export declare class ReactiveToolbar extends Toolbar<Widget> {
|
|
|
184
185
|
*/
|
|
185
186
|
onBeforeHide(msg: Message): void;
|
|
186
187
|
protected onResize(msg: Widget.ResizeMessage): void;
|
|
188
|
+
/**
|
|
189
|
+
* Invoke the resizer when an item in the toolbar no longer has the width
|
|
190
|
+
* used to place the items, for example when the kernel name changes.
|
|
191
|
+
*/
|
|
192
|
+
private _onItemResize;
|
|
187
193
|
/**
|
|
188
194
|
* Move the toolbar items between the reactive toolbar and the popup toolbar,
|
|
189
195
|
* depending on the width of the toolbar and the width of each item.
|
|
190
|
-
*
|
|
191
|
-
* @param callTwice - whether to call the function twice.
|
|
192
|
-
*
|
|
193
|
-
* **NOTES**
|
|
194
|
-
* The `callTwice` parameter is useful when the toolbar is displayed the first time,
|
|
195
|
-
* because the size of the items is unknown before their first rendering. The first
|
|
196
|
-
* call will usually add all the items in the main toolbar, and the second call will
|
|
197
|
-
* reorganize the items between the main toolbar and the popup toolbar.
|
|
198
196
|
*/
|
|
199
197
|
private _onResize;
|
|
200
198
|
private _getWidgetsToRemove;
|
|
@@ -205,8 +203,7 @@ export declare class ReactiveToolbar extends Toolbar<Widget> {
|
|
|
205
203
|
private readonly _widgetWidths;
|
|
206
204
|
private _widgetPositions;
|
|
207
205
|
private _movingToPopup;
|
|
208
|
-
private
|
|
209
|
-
private _zoomChanged;
|
|
206
|
+
private _itemResizeObserver;
|
|
210
207
|
}
|
|
211
208
|
/**
|
|
212
209
|
* The namespace for Toolbar class statics.
|
|
@@ -329,7 +326,7 @@ export declare class ToolbarButton extends ReactWidget {
|
|
|
329
326
|
render(): JSX.Element;
|
|
330
327
|
private _pressed;
|
|
331
328
|
private _enabled;
|
|
332
|
-
private _onClick
|
|
329
|
+
private _onClick?;
|
|
333
330
|
}
|
|
334
331
|
/**
|
|
335
332
|
* Namespace for CommandToolbarButtonComponent.
|