@jupyterlab/ui-components 3.3.0-alpha.6 → 4.0.0-alpha.15
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/button.d.ts +21 -0
- package/lib/components/button.js +24 -0
- package/lib/components/button.js.map +1 -0
- package/lib/components/collapse.d.ts +13 -58
- package/lib/components/collapse.js +20 -141
- package/lib/components/collapse.js.map +1 -1
- package/lib/components/collapser.d.ts +64 -0
- package/lib/components/collapser.js +145 -0
- package/lib/components/collapser.js.map +1 -0
- package/lib/components/index.d.ts +4 -1
- package/lib/components/index.js +4 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/inputgroup.d.ts +18 -0
- package/lib/components/inputgroup.js +27 -0
- package/lib/components/inputgroup.js.map +1 -0
- package/lib/components/menu.d.ts +18 -13
- package/lib/components/menu.js +138 -3
- package/lib/components/menu.js.map +1 -1
- package/lib/components/toolbar.d.ts +115 -17
- package/lib/components/toolbar.js +209 -53
- package/lib/components/toolbar.js.map +1 -1
- package/lib/icon/iconimports.d.ts +1 -0
- package/lib/icon/iconimports.js +2 -0
- package/lib/icon/iconimports.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/style/icon.js +0 -1
- package/lib/style/icon.js.map +1 -1
- package/package.json +14 -24
- package/style/base.css +88 -17
- package/style/deprecated.css +4 -0
- package/style/icons/toolbar/bug-dot.svg +6 -0
- package/style/index.css +0 -2
- package/style/index.js +0 -2
- package/lib/blueprint.d.ts +0 -20
- package/lib/blueprint.js +0 -23
- package/lib/blueprint.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Button component property
|
|
4
|
+
*/
|
|
5
|
+
export interface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Whether this button should use minimal styles.
|
|
8
|
+
*/
|
|
9
|
+
minimal?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether this button should use small styles.
|
|
12
|
+
*/
|
|
13
|
+
small?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Button component
|
|
17
|
+
*
|
|
18
|
+
* @param props Component properties
|
|
19
|
+
* @returns Component
|
|
20
|
+
*/
|
|
21
|
+
export declare function Button(props: IButtonProps): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { classes } from '../utils';
|
|
14
|
+
/**
|
|
15
|
+
* Button component
|
|
16
|
+
*
|
|
17
|
+
* @param props Component properties
|
|
18
|
+
* @returns Component
|
|
19
|
+
*/
|
|
20
|
+
export function Button(props) {
|
|
21
|
+
const { minimal, small, children } = props, others = __rest(props, ["minimal", "small", "children"]);
|
|
22
|
+
return (React.createElement("button", Object.assign({}, others, { className: classes(props.className, minimal ? 'jp-mod-minimal' : '', small ? 'jp-mod-small' : '', 'jp-Button') }), children));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAiBnC;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,KAAmB;IACxC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,KAAgB,KAAK,EAAhB,MAAM,UAAK,KAAK,EAA/C,gCAAuC,CAAQ,CAAC;IACtD,OAAO,CACL,gDACM,MAAM,IACV,SAAS,EAAE,OAAO,CAChB,KAAK,CAAC,SAAS,EACf,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAC/B,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAC3B,WAAW,CACZ,KAEA,QAAQ,CACF,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,64 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ISignal } from '@lumino/signaling';
|
|
3
|
-
import { Widget } from '@lumino/widgets';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Clicking on the title expands or contracts the widget.
|
|
3
|
+
* Collapse component property
|
|
7
4
|
*/
|
|
8
|
-
export
|
|
9
|
-
constructor(options: Collapse.IOptions<T>);
|
|
5
|
+
export interface ICollapseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
6
|
/**
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
get widget(): T;
|
|
14
|
-
set widget(widget: T);
|
|
15
|
-
/**
|
|
16
|
-
* The collapsed state of the panel.
|
|
17
|
-
*/
|
|
18
|
-
get collapsed(): boolean;
|
|
19
|
-
set collapsed(value: boolean);
|
|
20
|
-
/**
|
|
21
|
-
* A signal for when the widget collapse state changes.
|
|
22
|
-
*/
|
|
23
|
-
get collapseChanged(): ISignal<Collapse, void>;
|
|
24
|
-
/**
|
|
25
|
-
* Toggle the collapse state of the panel.
|
|
26
|
-
*/
|
|
27
|
-
toggle(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Dispose the widget.
|
|
30
|
-
*/
|
|
31
|
-
dispose(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Handle the DOM events for the Collapse widget.
|
|
7
|
+
* Whether the component is open or closed.
|
|
34
8
|
*
|
|
35
|
-
* @
|
|
36
|
-
*
|
|
37
|
-
* #### Notes
|
|
38
|
-
* This method implements the DOM `EventListener` interface and is
|
|
39
|
-
* called in response to events on the panel's DOM node. It should
|
|
40
|
-
* not be called directly by user code.
|
|
41
|
-
*/
|
|
42
|
-
handleEvent(event: Event): void;
|
|
43
|
-
protected onAfterAttach(msg: Message): void;
|
|
44
|
-
protected onBeforeDetach(msg: Message): void;
|
|
45
|
-
private _collapse;
|
|
46
|
-
private _uncollapse;
|
|
47
|
-
private _evtClick;
|
|
48
|
-
/**
|
|
49
|
-
* Handle the `changed` signal of a title object.
|
|
9
|
+
* @default false
|
|
50
10
|
*/
|
|
51
|
-
|
|
52
|
-
private _setHeader;
|
|
53
|
-
private _collapseChanged;
|
|
54
|
-
private _collapsed;
|
|
55
|
-
private _content;
|
|
56
|
-
private _header;
|
|
57
|
-
private _widget;
|
|
58
|
-
}
|
|
59
|
-
export declare namespace Collapse {
|
|
60
|
-
interface IOptions<T extends Widget = Widget> extends Widget.IOptions {
|
|
61
|
-
widget: T;
|
|
62
|
-
collapsed?: boolean;
|
|
63
|
-
}
|
|
11
|
+
isOpen?: boolean;
|
|
64
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Collapse component
|
|
15
|
+
*
|
|
16
|
+
* @param props Component properties
|
|
17
|
+
* @returns Component
|
|
18
|
+
*/
|
|
19
|
+
export declare function Collapse(props: ICollapseProps): JSX.Element;
|
|
@@ -1,145 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
6
13
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
14
|
+
* Collapse component
|
|
15
|
+
*
|
|
16
|
+
* @param props Component properties
|
|
17
|
+
* @returns Component
|
|
9
18
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const { widget, collapsed = true } = options;
|
|
15
|
-
this.addClass('jp-Collapse');
|
|
16
|
-
this._header = new Widget();
|
|
17
|
-
this._header.addClass('jp-Collapse-header');
|
|
18
|
-
this._content = new Panel();
|
|
19
|
-
this._content.addClass('jp-Collapse-contents');
|
|
20
|
-
const layout = new PanelLayout();
|
|
21
|
-
this.layout = layout;
|
|
22
|
-
layout.addWidget(this._header);
|
|
23
|
-
layout.addWidget(this._content);
|
|
24
|
-
this.widget = widget;
|
|
25
|
-
this.collapsed = collapsed;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The widget inside the collapse panel.
|
|
29
|
-
*/
|
|
30
|
-
get widget() {
|
|
31
|
-
return this._widget;
|
|
32
|
-
}
|
|
33
|
-
set widget(widget) {
|
|
34
|
-
const oldWidget = this._widget;
|
|
35
|
-
if (oldWidget) {
|
|
36
|
-
oldWidget.title.changed.disconnect(this._onTitleChanged, this);
|
|
37
|
-
oldWidget.parent = null;
|
|
38
|
-
}
|
|
39
|
-
this._widget = widget;
|
|
40
|
-
widget.title.changed.connect(this._onTitleChanged, this);
|
|
41
|
-
this._onTitleChanged(widget.title);
|
|
42
|
-
this._content.addWidget(widget);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* The collapsed state of the panel.
|
|
46
|
-
*/
|
|
47
|
-
get collapsed() {
|
|
48
|
-
return this._collapsed;
|
|
49
|
-
}
|
|
50
|
-
set collapsed(value) {
|
|
51
|
-
if (value === this._collapsed) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (value) {
|
|
55
|
-
this._collapse();
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
this._uncollapse();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* A signal for when the widget collapse state changes.
|
|
63
|
-
*/
|
|
64
|
-
get collapseChanged() {
|
|
65
|
-
return this._collapseChanged;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Toggle the collapse state of the panel.
|
|
69
|
-
*/
|
|
70
|
-
toggle() {
|
|
71
|
-
this.collapsed = !this.collapsed;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Dispose the widget.
|
|
75
|
-
*/
|
|
76
|
-
dispose() {
|
|
77
|
-
if (this.isDisposed) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
// Delete references we explicitly hold to other widgets.
|
|
81
|
-
this._header = null;
|
|
82
|
-
this._widget = null;
|
|
83
|
-
this._content = null;
|
|
84
|
-
super.dispose();
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Handle the DOM events for the Collapse widget.
|
|
88
|
-
*
|
|
89
|
-
* @param event - The DOM event sent to the panel.
|
|
90
|
-
*
|
|
91
|
-
* #### Notes
|
|
92
|
-
* This method implements the DOM `EventListener` interface and is
|
|
93
|
-
* called in response to events on the panel's DOM node. It should
|
|
94
|
-
* not be called directly by user code.
|
|
95
|
-
*/
|
|
96
|
-
handleEvent(event) {
|
|
97
|
-
switch (event.type) {
|
|
98
|
-
case 'click':
|
|
99
|
-
this._evtClick(event);
|
|
100
|
-
break;
|
|
101
|
-
default:
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
onAfterAttach(msg) {
|
|
106
|
-
this._header.node.addEventListener('click', this);
|
|
107
|
-
}
|
|
108
|
-
onBeforeDetach(msg) {
|
|
109
|
-
this._header.node.removeEventListener('click', this);
|
|
110
|
-
}
|
|
111
|
-
_collapse() {
|
|
112
|
-
this._collapsed = true;
|
|
113
|
-
if (this._content) {
|
|
114
|
-
this._content.hide();
|
|
115
|
-
}
|
|
116
|
-
this._setHeader();
|
|
117
|
-
this._collapseChanged.emit(void 0);
|
|
118
|
-
}
|
|
119
|
-
_uncollapse() {
|
|
120
|
-
this._collapsed = false;
|
|
121
|
-
if (this._content) {
|
|
122
|
-
this._content.show();
|
|
123
|
-
}
|
|
124
|
-
this._setHeader();
|
|
125
|
-
this._collapseChanged.emit(void 0);
|
|
126
|
-
}
|
|
127
|
-
_evtClick(event) {
|
|
128
|
-
this.toggle();
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Handle the `changed` signal of a title object.
|
|
132
|
-
*/
|
|
133
|
-
_onTitleChanged(sender) {
|
|
134
|
-
this._setHeader();
|
|
135
|
-
}
|
|
136
|
-
_setHeader() {
|
|
137
|
-
(this._collapsed ? caretUpIcon : caretDownIcon).element({
|
|
138
|
-
container: this._header.node,
|
|
139
|
-
label: this._widget.title.label,
|
|
140
|
-
elementPosition: 'right',
|
|
141
|
-
height: '28px'
|
|
142
|
-
});
|
|
143
|
-
}
|
|
19
|
+
export function Collapse(props) {
|
|
20
|
+
const { children, isOpen } = props, others = __rest(props, ["children", "isOpen"]);
|
|
21
|
+
others['aria-hidden'] = !!isOpen;
|
|
22
|
+
return React.createElement("div", Object.assign({}, others), isOpen && children);
|
|
144
23
|
}
|
|
145
24
|
//# sourceMappingURL=collapse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse.js","sourceRoot":"","sources":["../../src/components/collapse.
|
|
1
|
+
{"version":3,"file":"collapse.js","sourceRoot":"","sources":["../../src/components/collapse.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAqB;IAC5C,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAgB,KAAK,EAAhB,MAAM,UAAK,KAAK,EAAvC,sBAA+B,CAAQ,CAAC;IAC9C,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,OAAO,6CAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAO,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Message } from '@lumino/messaging';
|
|
2
|
+
import { ISignal } from '@lumino/signaling';
|
|
3
|
+
import { Widget } from '@lumino/widgets';
|
|
4
|
+
/**
|
|
5
|
+
* A panel that supports a collapsible header made from the widget's title.
|
|
6
|
+
* Clicking on the title expands or contracts the widget.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Collapser<T extends Widget = Widget> extends Widget {
|
|
9
|
+
constructor(options: Collapser.IOptions<T>);
|
|
10
|
+
/**
|
|
11
|
+
* The widget inside the collapse panel.
|
|
12
|
+
*/
|
|
13
|
+
get widget(): T;
|
|
14
|
+
set widget(widget: T);
|
|
15
|
+
/**
|
|
16
|
+
* The collapsed state of the panel.
|
|
17
|
+
*/
|
|
18
|
+
get collapsed(): boolean;
|
|
19
|
+
set collapsed(value: boolean);
|
|
20
|
+
/**
|
|
21
|
+
* A signal for when the widget collapse state changes.
|
|
22
|
+
*/
|
|
23
|
+
get collapseChanged(): ISignal<Collapser, void>;
|
|
24
|
+
/**
|
|
25
|
+
* Toggle the collapse state of the panel.
|
|
26
|
+
*/
|
|
27
|
+
toggle(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Dispose the widget.
|
|
30
|
+
*/
|
|
31
|
+
dispose(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Handle the DOM events for the Collapser widget.
|
|
34
|
+
*
|
|
35
|
+
* @param event - The DOM event sent to the panel.
|
|
36
|
+
*
|
|
37
|
+
* #### Notes
|
|
38
|
+
* This method implements the DOM `EventListener` interface and is
|
|
39
|
+
* called in response to events on the panel's DOM node. It should
|
|
40
|
+
* not be called directly by user code.
|
|
41
|
+
*/
|
|
42
|
+
handleEvent(event: Event): void;
|
|
43
|
+
protected onAfterAttach(msg: Message): void;
|
|
44
|
+
protected onBeforeDetach(msg: Message): void;
|
|
45
|
+
private _collapse;
|
|
46
|
+
private _uncollapse;
|
|
47
|
+
private _evtClick;
|
|
48
|
+
/**
|
|
49
|
+
* Handle the `changed` signal of a title object.
|
|
50
|
+
*/
|
|
51
|
+
private _onTitleChanged;
|
|
52
|
+
private _setHeader;
|
|
53
|
+
private _collapseChanged;
|
|
54
|
+
private _collapsed;
|
|
55
|
+
private _content;
|
|
56
|
+
private _header;
|
|
57
|
+
private _widget;
|
|
58
|
+
}
|
|
59
|
+
export declare namespace Collapser {
|
|
60
|
+
interface IOptions<T extends Widget = Widget> extends Widget.IOptions {
|
|
61
|
+
widget: T;
|
|
62
|
+
collapsed?: boolean;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { Signal } from '@lumino/signaling';
|
|
4
|
+
import { Panel, PanelLayout, Widget } from '@lumino/widgets';
|
|
5
|
+
import { caretDownIcon, caretUpIcon } from '../icon';
|
|
6
|
+
/**
|
|
7
|
+
* A panel that supports a collapsible header made from the widget's title.
|
|
8
|
+
* Clicking on the title expands or contracts the widget.
|
|
9
|
+
*/
|
|
10
|
+
export class Collapser extends Widget {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
super(options);
|
|
13
|
+
this._collapseChanged = new Signal(this);
|
|
14
|
+
const { widget, collapsed = true } = options;
|
|
15
|
+
this.addClass('jp-Collapse');
|
|
16
|
+
this._header = new Widget();
|
|
17
|
+
this._header.addClass('jp-Collapse-header');
|
|
18
|
+
this._content = new Panel();
|
|
19
|
+
this._content.addClass('jp-Collapse-contents');
|
|
20
|
+
const layout = new PanelLayout();
|
|
21
|
+
this.layout = layout;
|
|
22
|
+
layout.addWidget(this._header);
|
|
23
|
+
layout.addWidget(this._content);
|
|
24
|
+
this.widget = widget;
|
|
25
|
+
this.collapsed = collapsed;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The widget inside the collapse panel.
|
|
29
|
+
*/
|
|
30
|
+
get widget() {
|
|
31
|
+
return this._widget;
|
|
32
|
+
}
|
|
33
|
+
set widget(widget) {
|
|
34
|
+
const oldWidget = this._widget;
|
|
35
|
+
if (oldWidget) {
|
|
36
|
+
oldWidget.title.changed.disconnect(this._onTitleChanged, this);
|
|
37
|
+
oldWidget.parent = null;
|
|
38
|
+
}
|
|
39
|
+
this._widget = widget;
|
|
40
|
+
widget.title.changed.connect(this._onTitleChanged, this);
|
|
41
|
+
this._onTitleChanged(widget.title);
|
|
42
|
+
this._content.addWidget(widget);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The collapsed state of the panel.
|
|
46
|
+
*/
|
|
47
|
+
get collapsed() {
|
|
48
|
+
return this._collapsed;
|
|
49
|
+
}
|
|
50
|
+
set collapsed(value) {
|
|
51
|
+
if (value === this._collapsed) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (value) {
|
|
55
|
+
this._collapse();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this._uncollapse();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A signal for when the widget collapse state changes.
|
|
63
|
+
*/
|
|
64
|
+
get collapseChanged() {
|
|
65
|
+
return this._collapseChanged;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Toggle the collapse state of the panel.
|
|
69
|
+
*/
|
|
70
|
+
toggle() {
|
|
71
|
+
this.collapsed = !this.collapsed;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Dispose the widget.
|
|
75
|
+
*/
|
|
76
|
+
dispose() {
|
|
77
|
+
if (this.isDisposed) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Delete references we explicitly hold to other widgets.
|
|
81
|
+
this._header = null;
|
|
82
|
+
this._widget = null;
|
|
83
|
+
this._content = null;
|
|
84
|
+
super.dispose();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Handle the DOM events for the Collapser widget.
|
|
88
|
+
*
|
|
89
|
+
* @param event - The DOM event sent to the panel.
|
|
90
|
+
*
|
|
91
|
+
* #### Notes
|
|
92
|
+
* This method implements the DOM `EventListener` interface and is
|
|
93
|
+
* called in response to events on the panel's DOM node. It should
|
|
94
|
+
* not be called directly by user code.
|
|
95
|
+
*/
|
|
96
|
+
handleEvent(event) {
|
|
97
|
+
switch (event.type) {
|
|
98
|
+
case 'click':
|
|
99
|
+
this._evtClick(event);
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
onAfterAttach(msg) {
|
|
106
|
+
this._header.node.addEventListener('click', this);
|
|
107
|
+
}
|
|
108
|
+
onBeforeDetach(msg) {
|
|
109
|
+
this._header.node.removeEventListener('click', this);
|
|
110
|
+
}
|
|
111
|
+
_collapse() {
|
|
112
|
+
this._collapsed = true;
|
|
113
|
+
if (this._content) {
|
|
114
|
+
this._content.hide();
|
|
115
|
+
}
|
|
116
|
+
this._setHeader();
|
|
117
|
+
this._collapseChanged.emit(void 0);
|
|
118
|
+
}
|
|
119
|
+
_uncollapse() {
|
|
120
|
+
this._collapsed = false;
|
|
121
|
+
if (this._content) {
|
|
122
|
+
this._content.show();
|
|
123
|
+
}
|
|
124
|
+
this._setHeader();
|
|
125
|
+
this._collapseChanged.emit(void 0);
|
|
126
|
+
}
|
|
127
|
+
_evtClick(event) {
|
|
128
|
+
this.toggle();
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Handle the `changed` signal of a title object.
|
|
132
|
+
*/
|
|
133
|
+
_onTitleChanged(sender) {
|
|
134
|
+
this._setHeader();
|
|
135
|
+
}
|
|
136
|
+
_setHeader() {
|
|
137
|
+
(this._collapsed ? caretUpIcon : caretDownIcon).element({
|
|
138
|
+
container: this._header.node,
|
|
139
|
+
label: this._widget.title.label,
|
|
140
|
+
elementPosition: 'right',
|
|
141
|
+
height: '28px'
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=collapser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapser.js","sourceRoot":"","sources":["../../src/components/collapser.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAS,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAErD;;;GAGG;AACH,MAAM,OAAO,SAAqC,SAAQ,MAAM;IAC9D,YAAY,OAA8B;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QAqJT,qBAAgB,GAAG,IAAI,MAAM,CAAa,IAAI,CAAC,CAAC;QApJtD,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;QAE7C,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,QAAQ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AAE;YACjB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;SACtB;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACrC,CAAC;IAEO,SAAS,CAAC,KAAiB;QACjC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,MAAqB;QAC3C,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEO,UAAU;QAChB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC;YACtD,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YAC5B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;YAC/B,eAAe,EAAE,OAAO;YACxB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;CAOF"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './button';
|
|
2
|
+
export * from './collapse';
|
|
3
|
+
export * from './collapser';
|
|
2
4
|
export * from './htmlselect';
|
|
3
5
|
export * from './iframe';
|
|
6
|
+
export * from './inputgroup';
|
|
4
7
|
export * from './interface';
|
|
5
8
|
export * from './menu';
|
|
6
9
|
export * from './spinner';
|
package/lib/components/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
export
|
|
3
|
+
export * from './button';
|
|
4
|
+
export * from './collapse';
|
|
5
|
+
export * from './collapser';
|
|
4
6
|
export * from './htmlselect';
|
|
5
7
|
export * from './iframe';
|
|
8
|
+
export * from './inputgroup';
|
|
6
9
|
export * from './interface';
|
|
7
10
|
export * from './menu';
|
|
8
11
|
export * from './spinner';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LabIcon } from '../icon';
|
|
3
|
+
/**
|
|
4
|
+
* InputGroup component properties
|
|
5
|
+
*/
|
|
6
|
+
export interface IInputGroupProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Right icon adornment
|
|
9
|
+
*/
|
|
10
|
+
rightIcon?: string | LabIcon;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* InputGroup component
|
|
14
|
+
*
|
|
15
|
+
* @param props Component properties
|
|
16
|
+
* @returns Component
|
|
17
|
+
*/
|
|
18
|
+
export declare function InputGroup(props: IInputGroupProps): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { LabIcon } from '../icon';
|
|
14
|
+
import { classes } from '../utils';
|
|
15
|
+
/**
|
|
16
|
+
* InputGroup component
|
|
17
|
+
*
|
|
18
|
+
* @param props Component properties
|
|
19
|
+
* @returns Component
|
|
20
|
+
*/
|
|
21
|
+
export function InputGroup(props) {
|
|
22
|
+
const { className, rightIcon } = props, others = __rest(props, ["className", "rightIcon"]);
|
|
23
|
+
return (React.createElement("div", { className: classes('jp-InputGroup', className) },
|
|
24
|
+
React.createElement("input", Object.assign({}, others)),
|
|
25
|
+
rightIcon && (React.createElement("span", { className: "jp-InputGroupAction" }, typeof rightIcon === 'string' ? (React.createElement(LabIcon.resolveReact, { icon: rightIcon, elementPosition: "center", tag: "span" })) : (React.createElement(rightIcon.react, { elementPosition: "center", tag: "span" }))))));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=inputgroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputgroup.js","sourceRoot":"","sources":["../../src/components/inputgroup.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAanC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAuB;IAChD,MAAM,EAAE,SAAS,EAAE,SAAS,KAAgB,KAAK,EAAhB,MAAM,UAAK,KAAK,EAA3C,0BAAmC,CAAQ,CAAC;IAClD,OAAO,CACL,6BAAK,SAAS,EAAE,OAAO,CAAC,eAAe,EAAE,SAAS,CAAC;QACjD,+CAAW,MAAM,EAAU;QAC1B,SAAS,IAAI,CACZ,8BAAM,SAAS,EAAC,qBAAqB,IAClC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC/B,oBAAC,OAAO,CAAC,YAAY,IACnB,IAAI,EAAE,SAAS,EACf,eAAe,EAAC,QAAQ,EACxB,GAAG,EAAC,MAAM,GACV,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,CAAC,KAAK,IAAC,eAAe,EAAC,QAAQ,EAAC,GAAG,EAAC,MAAM,GAAG,CACxD,CACI,CACR,CACG,CACP,CAAC;AACJ,CAAC"}
|