@jupyterlab/ui-components 3.3.0-alpha.6 → 3.3.0-beta.0

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.
Files changed (54) hide show
  1. package/lib/FormComponentRegistry.d.ts +56 -0
  2. package/lib/FormComponentRegistry.js +44 -0
  3. package/lib/FormComponentRegistry.js.map +1 -0
  4. package/lib/blueprint.js +1 -1
  5. package/lib/blueprint.js.map +1 -1
  6. package/lib/components/index.d.ts +0 -6
  7. package/lib/components/index.js +0 -6
  8. package/lib/components/index.js.map +1 -1
  9. package/lib/components/menu.d.ts +19 -6
  10. package/lib/components/menu.js +138 -3
  11. package/lib/components/menu.js.map +1 -1
  12. package/lib/icon/iconimports.d.ts +2 -0
  13. package/lib/icon/iconimports.js +4 -0
  14. package/lib/icon/iconimports.js.map +1 -1
  15. package/lib/icon/labicon.d.ts +1 -1
  16. package/lib/icon/labicon.js +1 -2
  17. package/lib/icon/labicon.js.map +1 -1
  18. package/lib/index.d.ts +1 -0
  19. package/lib/index.js +1 -0
  20. package/lib/index.js.map +1 -1
  21. package/lib/style/icon.js +1 -2
  22. package/lib/style/icon.js.map +1 -1
  23. package/lib/utils.d.ts +1 -3
  24. package/lib/utils.js +1 -3
  25. package/lib/utils.js.map +1 -1
  26. package/package.json +5 -8
  27. package/style/base.css +0 -5
  28. package/style/deprecated.css +8 -0
  29. package/style/icons/toolbar/bug-dot.svg +6 -0
  30. package/style/icons/toolbar/launch.svg +6 -0
  31. package/style/icons.css +0 -11
  32. package/lib/components/collapse.d.ts +0 -64
  33. package/lib/components/collapse.js +0 -145
  34. package/lib/components/collapse.js.map +0 -1
  35. package/lib/components/iframe.d.ts +0 -77
  36. package/lib/components/iframe.js +0 -89
  37. package/lib/components/iframe.js.map +0 -1
  38. package/lib/components/spinner.d.ts +0 -15
  39. package/lib/components/spinner.js +0 -28
  40. package/lib/components/spinner.js.map +0 -1
  41. package/lib/components/styling.d.ts +0 -27
  42. package/lib/components/styling.js +0 -100
  43. package/lib/components/styling.js.map +0 -1
  44. package/lib/components/toolbar.d.ts +0 -320
  45. package/lib/components/toolbar.js +0 -718
  46. package/lib/components/toolbar.js.map +0 -1
  47. package/lib/components/vdom.d.ts +0 -189
  48. package/lib/components/vdom.js +0 -203
  49. package/lib/components/vdom.js.map +0 -1
  50. package/style/collapse.css +0 -30
  51. package/style/iframe.css +0 -33
  52. package/style/spinner.css +0 -79
  53. package/style/styling.css +0 -89
  54. package/style/toolbar.css +0 -115
@@ -1,27 +0,0 @@
1
- /**
2
- * A namespace for node styling.
3
- */
4
- export declare namespace Styling {
5
- /**
6
- * Style a node and its child elements with the default tag names.
7
- *
8
- * @param node - The base node.
9
- *
10
- * @param className - The optional CSS class to add to styled nodes.
11
- */
12
- function styleNode(node: HTMLElement, className?: string): void;
13
- /**
14
- * Style a node and its elements that have a given tag name.
15
- *
16
- * @param node - The base node.
17
- *
18
- * @param tagName - The html tag name to style.
19
- *
20
- * @param className - The optional CSS class to add to styled nodes.
21
- */
22
- function styleNodeByTag(node: HTMLElement, tagName: string, className?: string): void;
23
- /**
24
- * Wrap a select node.
25
- */
26
- function wrapSelect(node: HTMLSelectElement): HTMLElement;
27
- }
@@ -1,100 +0,0 @@
1
- // Copyright (c) Jupyter Development Team.
2
- // Distributed under the terms of the Modified BSD License.
3
- import { caretDownEmptyIcon } from '../icon';
4
- /**
5
- * A namespace for node styling.
6
- */
7
- export var Styling;
8
- (function (Styling) {
9
- /**
10
- * Style a node and its child elements with the default tag names.
11
- *
12
- * @param node - The base node.
13
- *
14
- * @param className - The optional CSS class to add to styled nodes.
15
- */
16
- function styleNode(node, className = '') {
17
- styleNodeByTag(node, 'select', className);
18
- styleNodeByTag(node, 'textarea', className);
19
- styleNodeByTag(node, 'input', className);
20
- styleNodeByTag(node, 'button', className);
21
- }
22
- Styling.styleNode = styleNode;
23
- /**
24
- * Style a node and its elements that have a given tag name.
25
- *
26
- * @param node - The base node.
27
- *
28
- * @param tagName - The html tag name to style.
29
- *
30
- * @param className - The optional CSS class to add to styled nodes.
31
- */
32
- function styleNodeByTag(node, tagName, className = '') {
33
- if (node.localName === tagName) {
34
- node.classList.add('jp-mod-styled');
35
- }
36
- if (node.localName === 'select') {
37
- wrapSelect(node);
38
- }
39
- const nodes = node.getElementsByTagName(tagName);
40
- for (let i = 0; i < nodes.length; i++) {
41
- const child = nodes[i];
42
- child.classList.add('jp-mod-styled');
43
- if (className) {
44
- child.classList.add(className);
45
- }
46
- if (tagName === 'select') {
47
- wrapSelect(child);
48
- }
49
- }
50
- }
51
- Styling.styleNodeByTag = styleNodeByTag;
52
- /**
53
- * Wrap a select node.
54
- */
55
- function wrapSelect(node) {
56
- const wrapper = document.createElement('div');
57
- wrapper.classList.add('jp-select-wrapper');
58
- node.addEventListener('focus', Private.onFocus);
59
- node.addEventListener('blur', Private.onFocus);
60
- node.classList.add('jp-mod-styled');
61
- if (node.parentElement) {
62
- node.parentElement.replaceChild(wrapper, node);
63
- }
64
- wrapper.appendChild(node);
65
- // add the icon node
66
- wrapper.appendChild(caretDownEmptyIcon.element({
67
- tag: 'span',
68
- stylesheet: 'select',
69
- right: '8px',
70
- top: '5px',
71
- width: '18px'
72
- }));
73
- return wrapper;
74
- }
75
- Styling.wrapSelect = wrapSelect;
76
- })(Styling || (Styling = {}));
77
- /**
78
- * The namespace for module private data.
79
- */
80
- var Private;
81
- (function (Private) {
82
- /**
83
- * Handle a focus event on a styled select.
84
- */
85
- function onFocus(event) {
86
- const target = event.target;
87
- const parent = target.parentElement;
88
- if (!parent) {
89
- return;
90
- }
91
- if (event.type === 'focus') {
92
- parent.classList.add('jp-mod-focused');
93
- }
94
- else {
95
- parent.classList.remove('jp-mod-focused');
96
- }
97
- }
98
- Private.onFocus = onFocus;
99
- })(Private || (Private = {}));
100
- //# sourceMappingURL=styling.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styling.js","sourceRoot":"","sources":["../../src/components/styling.ts"],"names":[],"mappings":"AAAA,0C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C,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;SACxC;aAAM;YACL,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;SAC3C;IACH,CAAC;IAXe,eAAO,UAWtB,CAAA;AACH,CAAC,EAhBS,OAAO,KAAP,OAAO,QAgBhB"}
@@ -1,320 +0,0 @@
1
- /// <reference types="react" />
2
- import { ITranslator } from '@jupyterlab/translation';
3
- import { IIterator } from '@lumino/algorithm';
4
- import { CommandRegistry } from '@lumino/commands';
5
- import { ReadonlyJSONObject } from '@lumino/coreutils';
6
- import { Message } from '@lumino/messaging';
7
- import { Widget } from '@lumino/widgets';
8
- import { LabIcon } from '../icon';
9
- import { ReactWidget } from './vdom';
10
- /**
11
- * A class which provides a toolbar widget.
12
- */
13
- export declare class Toolbar<T extends Widget = Widget> extends Widget {
14
- /**
15
- * Construct a new toolbar widget.
16
- */
17
- constructor();
18
- /**
19
- * Get an iterator over the ordered toolbar item names.
20
- *
21
- * @returns An iterator over the toolbar item names.
22
- */
23
- names(): IIterator<string>;
24
- /**
25
- * Add an item to the end of the toolbar.
26
- *
27
- * @param name - The name of the widget to add to the toolbar.
28
- *
29
- * @param widget - The widget to add to the toolbar.
30
- *
31
- * @param index - The optional name of the item to insert after.
32
- *
33
- * @returns Whether the item was added to toolbar. Returns false if
34
- * an item of the same name is already in the toolbar.
35
- *
36
- * #### Notes
37
- * The item can be removed from the toolbar by setting its parent to `null`.
38
- */
39
- addItem(name: string, widget: T): boolean;
40
- /**
41
- * Dispose of the widget and its descendant widgets.
42
- */
43
- dispose(): void;
44
- /**
45
- * Insert an item into the toolbar at the specified index.
46
- *
47
- * @param index - The index at which to insert the item.
48
- *
49
- * @param name - The name of the item.
50
- *
51
- * @param widget - The widget to add.
52
- *
53
- * @returns Whether the item was added to the toolbar. Returns false if
54
- * an item of the same name is already in the toolbar.
55
- *
56
- * #### Notes
57
- * The index will be clamped to the bounds of the items.
58
- * The item can be removed from the toolbar by setting its parent to `null`.
59
- */
60
- insertItem(index: number, name: string, widget: T): boolean;
61
- /**
62
- * Insert an item into the toolbar at the after a target item.
63
- *
64
- * @param at - The target item to insert after.
65
- *
66
- * @param name - The name of the item.
67
- *
68
- * @param widget - The widget to add.
69
- *
70
- * @returns Whether the item was added to the toolbar. Returns false if
71
- * an item of the same name is already in the toolbar.
72
- *
73
- * #### Notes
74
- * The index will be clamped to the bounds of the items.
75
- * The item can be removed from the toolbar by setting its parent to `null`.
76
- */
77
- insertAfter(at: string, name: string, widget: T): boolean;
78
- /**
79
- * Insert an item into the toolbar at the before a target item.
80
- *
81
- * @param at - The target item to insert before.
82
- *
83
- * @param name - The name of the item.
84
- *
85
- * @param widget - The widget to add.
86
- *
87
- * @returns Whether the item was added to the toolbar. Returns false if
88
- * an item of the same name is already in the toolbar.
89
- *
90
- * #### Notes
91
- * The index will be clamped to the bounds of the items.
92
- * The item can be removed from the toolbar by setting its parent to `null`.
93
- */
94
- insertBefore(at: string, name: string, widget: T): boolean;
95
- private _insertRelative;
96
- /**
97
- * Handle the DOM events for the widget.
98
- *
99
- * @param event - The DOM event sent to the widget.
100
- *
101
- * #### Notes
102
- * This method implements the DOM `EventListener` interface and is
103
- * called in response to events on the dock panel's node. It should
104
- * not be called directly by user code.
105
- */
106
- handleEvent(event: Event): void;
107
- /**
108
- * Handle a DOM click event.
109
- */
110
- protected handleClick(event: Event): void;
111
- /**
112
- * Handle `after-attach` messages for the widget.
113
- */
114
- protected onAfterAttach(msg: Message): void;
115
- /**
116
- * Handle `before-detach` messages for the widget.
117
- */
118
- protected onBeforeDetach(msg: Message): void;
119
- protected onResize(msg: Widget.ResizeMessage): void;
120
- private _onResize;
121
- private _saveWidgetWidth;
122
- private _getWidgetWidth;
123
- readonly popupOpener: ToolbarPopupOpener;
124
- private readonly _widgetWidths;
125
- private readonly _resizer;
126
- }
127
- /**
128
- * The namespace for Toolbar class statics.
129
- */
130
- export declare namespace Toolbar {
131
- /**
132
- * Create a toolbar spacer item.
133
- *
134
- * #### Notes
135
- * It is a flex spacer that separates the left toolbar items
136
- * from the right toolbar items.
137
- */
138
- function createSpacerItem(): Widget;
139
- }
140
- /**
141
- * Namespace for ToolbarButtonComponent.
142
- */
143
- export declare namespace ToolbarButtonComponent {
144
- /**
145
- * Interface for ToolbarButtonComponent props.
146
- */
147
- interface IProps {
148
- className?: string;
149
- label?: string;
150
- icon?: LabIcon.IMaybeResolvable;
151
- iconClass?: string;
152
- iconLabel?: string;
153
- tooltip?: string;
154
- onClick?: () => void;
155
- enabled?: boolean;
156
- /**
157
- * Trigger the button on the actual onClick event rather than onMouseDown.
158
- *
159
- * See note in ToolbarButtonComponent below as to why the default is to
160
- * trigger on onMouseDown.
161
- */
162
- actualOnClick?: boolean;
163
- /**
164
- * The application language translator.
165
- */
166
- translator?: ITranslator;
167
- }
168
- }
169
- /**
170
- * React component for a toolbar button.
171
- *
172
- * @param props - The props for ToolbarButtonComponent.
173
- */
174
- export declare function ToolbarButtonComponent(props: ToolbarButtonComponent.IProps): JSX.Element;
175
- /**
176
- * Adds the toolbar button class to the toolbar widget.
177
- * @param w Toolbar button widget.
178
- */
179
- export declare function addToolbarButtonClass(w: Widget): Widget;
180
- /**
181
- * Phosphor Widget version of static ToolbarButtonComponent.
182
- */
183
- export declare class ToolbarButton extends ReactWidget {
184
- private props;
185
- /**
186
- * Creates a toolbar button
187
- * @param props props for underlying `ToolbarButton` component
188
- */
189
- constructor(props?: ToolbarButtonComponent.IProps);
190
- render(): JSX.Element;
191
- }
192
- /**
193
- * Namespace for CommandToolbarButtonComponent.
194
- */
195
- export declare namespace CommandToolbarButtonComponent {
196
- /**
197
- * Interface for CommandToolbarButtonComponent props.
198
- */
199
- interface IProps {
200
- /**
201
- * Application commands registry
202
- */
203
- commands: CommandRegistry;
204
- /**
205
- * Command unique id
206
- */
207
- id: string;
208
- /**
209
- * Command arguments
210
- */
211
- args?: ReadonlyJSONObject;
212
- /**
213
- * Overrides command icon
214
- */
215
- icon?: LabIcon;
216
- /**
217
- * Overrides command label
218
- */
219
- label?: string;
220
- }
221
- }
222
- /**
223
- * React component for a toolbar button that wraps a command.
224
- *
225
- * This wraps the ToolbarButtonComponent and watches the command registry
226
- * for changes to the command.
227
- */
228
- export declare function CommandToolbarButtonComponent(props: CommandToolbarButtonComponent.IProps): JSX.Element;
229
- export declare function addCommandToolbarButtonClass(w: Widget): Widget;
230
- /**
231
- * Phosphor Widget version of CommandToolbarButtonComponent.
232
- */
233
- export declare class CommandToolbarButton extends ReactWidget {
234
- private props;
235
- /**
236
- * Creates a command toolbar button
237
- * @param props props for underlying `CommandToolbarButtonComponent` component
238
- */
239
- constructor(props: CommandToolbarButtonComponent.IProps);
240
- render(): JSX.Element;
241
- }
242
- /**
243
- * A class which provides a toolbar popup
244
- * used to store widgets that don't fit
245
- * in the toolbar when it is resized
246
- */
247
- declare class ToolbarPopup extends Widget {
248
- width: number;
249
- /**
250
- * Construct a new ToolbarPopup
251
- */
252
- constructor();
253
- /**
254
- * Updates the width of the popup, this
255
- * should match with the toolbar width
256
- *
257
- * @param width - The width to resize to
258
- * @protected
259
- */
260
- updateWidth(width: number): void;
261
- /**
262
- * Aligns the popup to left bottom of widget
263
- *
264
- * @param widget the widget to align to
265
- * @private
266
- */
267
- alignTo(widget: Widget): void;
268
- /**
269
- * Inserts the widget at specified index
270
- * @param index the index
271
- * @param widget widget to add
272
- */
273
- insertWidget(index: number, widget: Widget): void;
274
- /**
275
- * Total number of widgets in the popup
276
- */
277
- widgetCount(): number;
278
- /**
279
- * Returns the widget at index
280
- * @param index the index
281
- */
282
- widgetAt(index: number): Widget;
283
- }
284
- /**
285
- * A class that provides a ToolbarPopupOpener,
286
- * which is a button added to toolbar when
287
- * the toolbar items overflow toolbar width
288
- */
289
- declare class ToolbarPopupOpener extends ToolbarButton {
290
- readonly _popup: ToolbarPopup;
291
- /**
292
- * Create a new popup opener
293
- */
294
- constructor();
295
- protected handleClick(): void;
296
- /**
297
- * Updates width and position of the popup
298
- * to align with the toolbar
299
- */
300
- updatePopup(): void;
301
- /**
302
- * Add widget to the popup, prepends widgets
303
- * @param widget the widget to add
304
- */
305
- addWidget(widget: Widget): void;
306
- /**
307
- * Returns total no of widgets in the popup
308
- */
309
- widgetCount(): number;
310
- /**
311
- * Returns widget at index in the popup
312
- * @param index
313
- */
314
- widgetAt(index: number): Widget;
315
- /**
316
- * Hides the opener and the popup
317
- */
318
- hide(): void;
319
- }
320
- export {};