@theia/memory-inspector 1.45.0 → 1.46.0-next.72

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 (102) hide show
  1. package/README.md +71 -71
  2. package/lib/browser/diff-widget/memory-diff-options-widget.d.ts +36 -36
  3. package/lib/browser/diff-widget/memory-diff-options-widget.js +132 -132
  4. package/lib/browser/diff-widget/memory-diff-select-widget.d.ts +50 -50
  5. package/lib/browser/diff-widget/memory-diff-select-widget.js +137 -137
  6. package/lib/browser/diff-widget/memory-diff-table-widget.d.ts +77 -77
  7. package/lib/browser/diff-widget/memory-diff-table-widget.js +314 -314
  8. package/lib/browser/diff-widget/memory-diff-widget-types.d.ts +41 -41
  9. package/lib/browser/diff-widget/memory-diff-widget-types.js +23 -23
  10. package/lib/browser/editable-widget/memory-editable-table-widget.d.ts +64 -64
  11. package/lib/browser/editable-widget/memory-editable-table-widget.js +324 -324
  12. package/lib/browser/memory-inspector-frontend-contribution.d.ts +46 -46
  13. package/lib/browser/memory-inspector-frontend-contribution.js +291 -291
  14. package/lib/browser/memory-inspector-frontend-module.d.ts +21 -21
  15. package/lib/browser/memory-inspector-frontend-module.js +87 -87
  16. package/lib/browser/memory-provider/cdt-gdb-memory-provider.d.ts +35 -35
  17. package/lib/browser/memory-provider/cdt-gdb-memory-provider.js +136 -136
  18. package/lib/browser/memory-provider/memory-provider-service.d.ts +36 -36
  19. package/lib/browser/memory-provider/memory-provider-service.js +101 -101
  20. package/lib/browser/memory-provider/memory-provider.d.ts +65 -65
  21. package/lib/browser/memory-provider/memory-provider.js +96 -96
  22. package/lib/browser/memory-provider/memory-provider.spec.d.ts +16 -16
  23. package/lib/browser/memory-provider/memory-provider.spec.js +23 -23
  24. package/lib/browser/memory-widget/memory-options-widget.d.ts +136 -136
  25. package/lib/browser/memory-widget/memory-options-widget.js +564 -564
  26. package/lib/browser/memory-widget/memory-table-widget.d.ts +146 -146
  27. package/lib/browser/memory-widget/memory-table-widget.js +487 -487
  28. package/lib/browser/memory-widget/memory-widget.d.ts +33 -33
  29. package/lib/browser/memory-widget/memory-widget.js +112 -112
  30. package/lib/browser/register-widget/register-filter-service.d.ts +42 -42
  31. package/lib/browser/register-widget/register-filter-service.js +81 -81
  32. package/lib/browser/register-widget/register-options-widget.d.ts +81 -81
  33. package/lib/browser/register-widget/register-options-widget.js +338 -338
  34. package/lib/browser/register-widget/register-table-widget.d.ts +77 -77
  35. package/lib/browser/register-widget/register-table-widget.js +230 -230
  36. package/lib/browser/register-widget/register-widget-types.d.ts +29 -29
  37. package/lib/browser/register-widget/register-widget-types.js +35 -35
  38. package/lib/browser/utils/memory-commands.d.ts +27 -27
  39. package/lib/browser/utils/memory-commands.js +67 -67
  40. package/lib/browser/utils/memory-hover-renderer.d.ts +33 -33
  41. package/lib/browser/utils/memory-hover-renderer.js +111 -111
  42. package/lib/browser/utils/memory-recents.d.ts +27 -27
  43. package/lib/browser/utils/memory-recents.js +52 -52
  44. package/lib/browser/utils/memory-widget-components.d.ts +58 -58
  45. package/lib/browser/utils/memory-widget-components.js +69 -69
  46. package/lib/browser/utils/memory-widget-manager.d.ts +50 -50
  47. package/lib/browser/utils/memory-widget-manager.js +182 -182
  48. package/lib/browser/utils/memory-widget-utils.d.ts +113 -113
  49. package/lib/browser/utils/memory-widget-utils.js +42 -42
  50. package/lib/browser/utils/memory-widget-variable-utils.d.ts +57 -57
  51. package/lib/browser/utils/memory-widget-variable-utils.js +143 -143
  52. package/lib/browser/utils/multi-select-bar.d.ts +31 -31
  53. package/lib/browser/utils/multi-select-bar.js +34 -34
  54. package/lib/browser/wrapper-widgets/memory-dock-panel.d.ts +24 -24
  55. package/lib/browser/wrapper-widgets/memory-dock-panel.js +48 -48
  56. package/lib/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.d.ts +23 -23
  57. package/lib/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.js +57 -57
  58. package/lib/browser/wrapper-widgets/memory-layout-widget.d.ts +51 -51
  59. package/lib/browser/wrapper-widgets/memory-layout-widget.js +191 -191
  60. package/lib/common/util.d.ts +21 -21
  61. package/lib/common/util.js +30 -30
  62. package/lib/common/utils.spec.d.ts +16 -16
  63. package/lib/common/utils.spec.js +45 -45
  64. package/package.json +4 -4
  65. package/src/browser/diff-widget/memory-diff-options-widget.tsx +152 -152
  66. package/src/browser/diff-widget/memory-diff-select-widget.tsx +163 -163
  67. package/src/browser/diff-widget/memory-diff-table-widget.tsx +366 -366
  68. package/src/browser/diff-widget/memory-diff-widget-types.ts +45 -45
  69. package/src/browser/editable-widget/memory-editable-table-widget.tsx +359 -359
  70. package/src/browser/memory-inspector-frontend-contribution.ts +301 -301
  71. package/src/browser/memory-inspector-frontend-module.ts +118 -118
  72. package/src/browser/memory-provider/cdt-gdb-memory-provider.ts +132 -132
  73. package/src/browser/memory-provider/memory-provider-service.ts +86 -86
  74. package/src/browser/memory-provider/memory-provider.spec.ts +23 -23
  75. package/src/browser/memory-provider/memory-provider.ts +119 -119
  76. package/src/browser/memory-widget/memory-options-widget.tsx +738 -738
  77. package/src/browser/memory-widget/memory-table-widget.tsx +625 -625
  78. package/src/browser/memory-widget/memory-widget.ts +114 -114
  79. package/src/browser/register-widget/register-filter-service.ts +76 -76
  80. package/src/browser/register-widget/register-options-widget.tsx +393 -393
  81. package/src/browser/register-widget/register-table-widget.tsx +276 -276
  82. package/src/browser/register-widget/register-widget-types.ts +45 -45
  83. package/src/browser/register-widget/register-widget.css +34 -34
  84. package/src/browser/style/index.css +746 -746
  85. package/src/browser/style/memory-lock.svg +21 -21
  86. package/src/browser/style/memory-view.svg +20 -20
  87. package/src/browser/style/register-lock.svg +29 -29
  88. package/src/browser/style/register-view.svg +28 -28
  89. package/src/browser/utils/memory-commands.ts +76 -76
  90. package/src/browser/utils/memory-hover-renderer.ts +113 -113
  91. package/src/browser/utils/memory-recents.ts +58 -58
  92. package/src/browser/utils/memory-widget-components.tsx +193 -193
  93. package/src/browser/utils/memory-widget-manager.ts +179 -179
  94. package/src/browser/utils/memory-widget-utils.tsx +132 -132
  95. package/src/browser/utils/memory-widget-variable-utils.ts +170 -170
  96. package/src/browser/utils/multi-select-bar.css +61 -61
  97. package/src/browser/utils/multi-select-bar.tsx +75 -75
  98. package/src/browser/wrapper-widgets/memory-dock-panel.ts +51 -51
  99. package/src/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.tsx +38 -38
  100. package/src/browser/wrapper-widgets/memory-layout-widget.tsx +167 -167
  101. package/src/common/util.ts +28 -28
  102. package/src/common/utils.spec.ts +52 -52
@@ -1,28 +1,28 @@
1
- /********************************************************************************
2
- * Copyright (C) 2021 Ericsson and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- interface RecentsOptions {
17
- maxValues?: number;
18
- }
19
- export declare class Recents {
20
- protected maxValues: number;
21
- protected _values: string[];
22
- get values(): string[];
23
- constructor(initialValues?: string[], opts?: RecentsOptions);
24
- add(locationString: string): void;
25
- has(locationString: string): number;
26
- }
27
- export {};
1
+ /********************************************************************************
2
+ * Copyright (C) 2021 Ericsson and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ interface RecentsOptions {
17
+ maxValues?: number;
18
+ }
19
+ export declare class Recents {
20
+ protected maxValues: number;
21
+ protected _values: string[];
22
+ get values(): string[];
23
+ constructor(initialValues?: string[], opts?: RecentsOptions);
24
+ add(locationString: string): void;
25
+ has(locationString: string): number;
26
+ }
27
+ export {};
28
28
  //# sourceMappingURL=memory-recents.d.ts.map
@@ -1,53 +1,53 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (C) 2021 Ericsson and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.Recents = void 0;
19
- class Recents {
20
- constructor(initialValues, opts) {
21
- var _a;
22
- this._values = [];
23
- this.maxValues = (_a = opts === null || opts === void 0 ? void 0 : opts.maxValues) !== null && _a !== void 0 ? _a : 10;
24
- if (initialValues) {
25
- if (initialValues.length <= this.maxValues) {
26
- this._values = initialValues;
27
- return;
28
- }
29
- console.error('Initial values length is greater than allowed length, resetting to empty array');
30
- }
31
- this._values = [];
32
- }
33
- get values() {
34
- return this._values;
35
- }
36
- add(locationString) {
37
- const indexOf = this.has(locationString);
38
- if (indexOf > -1) {
39
- this._values.splice(indexOf, 1);
40
- }
41
- else {
42
- if (this._values.length === this.maxValues) {
43
- this._values.shift();
44
- }
45
- }
46
- this._values.push(locationString);
47
- }
48
- has(locationString) {
49
- return this._values.indexOf(locationString);
50
- }
51
- }
52
- exports.Recents = Recents;
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (C) 2021 Ericsson and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.Recents = void 0;
19
+ class Recents {
20
+ constructor(initialValues, opts) {
21
+ var _a;
22
+ this._values = [];
23
+ this.maxValues = (_a = opts === null || opts === void 0 ? void 0 : opts.maxValues) !== null && _a !== void 0 ? _a : 10;
24
+ if (initialValues) {
25
+ if (initialValues.length <= this.maxValues) {
26
+ this._values = initialValues;
27
+ return;
28
+ }
29
+ console.error('Initial values length is greater than allowed length, resetting to empty array');
30
+ }
31
+ this._values = [];
32
+ }
33
+ get values() {
34
+ return this._values;
35
+ }
36
+ add(locationString) {
37
+ const indexOf = this.has(locationString);
38
+ if (indexOf > -1) {
39
+ this._values.splice(indexOf, 1);
40
+ }
41
+ else {
42
+ if (this._values.length === this.maxValues) {
43
+ this._values.shift();
44
+ }
45
+ }
46
+ this._values.push(locationString);
47
+ }
48
+ has(locationString) {
49
+ return this._values.indexOf(locationString);
50
+ }
51
+ }
52
+ exports.Recents = Recents;
53
53
  //# sourceMappingURL=memory-recents.js.map
@@ -1,59 +1,59 @@
1
- /********************************************************************************
2
- * Copyright (C) 2021 Ericsson and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- /// <reference types="react" />
17
- import * as React from '@theia/core/shared/react';
18
- import { Interfaces } from './memory-widget-utils';
19
- export interface MWLabelProps {
20
- id: string;
21
- label: string;
22
- disabled?: boolean;
23
- classNames?: string[];
24
- }
25
- export declare const MWLabel: React.FC<MWLabelProps>;
26
- export interface InputProps<T extends HTMLElement = HTMLElement> {
27
- id: string;
28
- label: string;
29
- defaultValue?: string;
30
- value?: string;
31
- onChange?: React.EventHandler<React.ChangeEvent>;
32
- onKeyDown?: React.EventHandler<React.KeyboardEvent<HTMLInputElement>>;
33
- passRef?: React.ClassAttributes<T>['ref'];
34
- title?: string;
35
- disabled?: boolean;
36
- placeholder?: string;
37
- }
38
- export declare const MWInput: React.FC<InputProps<HTMLInputElement>>;
39
- export interface LabelAndSelectProps extends InputProps<HTMLSelectElement> {
40
- options: string[];
41
- }
42
- export declare const MWSelect: React.FC<LabelAndSelectProps>;
43
- export interface LabelAndSelectWithNameProps extends InputProps<HTMLSelectElement> {
44
- options: Array<[string, string]>;
45
- }
46
- export declare const MWSelectWithName: React.FC<LabelAndSelectWithNameProps>;
47
- export interface InputWithSelectProps<T extends HTMLElement> extends InputProps<T> {
48
- options: string[];
49
- onSelectChange?(e: React.ChangeEvent): void;
50
- onInputChange?(e: React.ChangeEvent<HTMLInputElement>): void;
51
- }
52
- export declare const MWInputWithSelect: React.FC<InputWithSelectProps<HTMLInputElement>>;
53
- export interface MoreMemoryProps {
54
- options: number[];
55
- direction: 'above' | 'below';
56
- handler(opts: Interfaces.MoreMemoryOptions): void;
57
- }
58
- export declare const MWMoreMemorySelect: React.FC<MoreMemoryProps>;
1
+ /********************************************************************************
2
+ * Copyright (C) 2021 Ericsson and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ /// <reference types="react" />
17
+ import * as React from '@theia/core/shared/react';
18
+ import { Interfaces } from './memory-widget-utils';
19
+ export interface MWLabelProps {
20
+ id: string;
21
+ label: string;
22
+ disabled?: boolean;
23
+ classNames?: string[];
24
+ }
25
+ export declare const MWLabel: React.FC<MWLabelProps>;
26
+ export interface InputProps<T extends HTMLElement = HTMLElement> {
27
+ id: string;
28
+ label: string;
29
+ defaultValue?: string;
30
+ value?: string;
31
+ onChange?: React.EventHandler<React.ChangeEvent>;
32
+ onKeyDown?: React.EventHandler<React.KeyboardEvent<HTMLInputElement>>;
33
+ passRef?: React.ClassAttributes<T>['ref'];
34
+ title?: string;
35
+ disabled?: boolean;
36
+ placeholder?: string;
37
+ }
38
+ export declare const MWInput: React.FC<InputProps<HTMLInputElement>>;
39
+ export interface LabelAndSelectProps extends InputProps<HTMLSelectElement> {
40
+ options: string[];
41
+ }
42
+ export declare const MWSelect: React.FC<LabelAndSelectProps>;
43
+ export interface LabelAndSelectWithNameProps extends InputProps<HTMLSelectElement> {
44
+ options: Array<[string, string]>;
45
+ }
46
+ export declare const MWSelectWithName: React.FC<LabelAndSelectWithNameProps>;
47
+ export interface InputWithSelectProps<T extends HTMLElement> extends InputProps<T> {
48
+ options: string[];
49
+ onSelectChange?(e: React.ChangeEvent): void;
50
+ onInputChange?(e: React.ChangeEvent<HTMLInputElement>): void;
51
+ }
52
+ export declare const MWInputWithSelect: React.FC<InputWithSelectProps<HTMLInputElement>>;
53
+ export interface MoreMemoryProps {
54
+ options: number[];
55
+ direction: 'above' | 'below';
56
+ handler(opts: Interfaces.MoreMemoryOptions): void;
57
+ }
58
+ export declare const MWMoreMemorySelect: React.FC<MoreMemoryProps>;
59
59
  //# sourceMappingURL=memory-widget-components.d.ts.map
@@ -1,70 +1,70 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (C) 2021 Ericsson and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.MWMoreMemorySelect = exports.MWInputWithSelect = exports.MWSelectWithName = exports.MWSelect = exports.MWInput = exports.MWLabel = void 0;
19
- const browser_1 = require("@theia/core/lib/browser");
20
- const React = require("@theia/core/shared/react");
21
- const MWLabel = ({ id, label, disabled, classNames }) => {
22
- const additionalClassNames = classNames ? classNames.join(' ') : '';
23
- return React.createElement("label", { htmlFor: id, className: `t-mv-label theia-header no-select ${additionalClassNames}${disabled ? ' disabled' : ''}` }, label);
24
- };
25
- exports.MWLabel = MWLabel;
26
- const MWInput = ({ id, label, passRef, defaultValue, onChange, title, onKeyDown, disabled }) => (React.createElement(React.Fragment, null,
27
- React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
28
- React.createElement("input", { tabIndex: 0, type: 'text', ref: passRef, id: id, className: 'theia-input t-mv-input', defaultValue: defaultValue, onChange: onChange, onKeyDown: onKeyDown, title: title, spellCheck: false, disabled: disabled })));
29
- exports.MWInput = MWInput;
30
- const MWSelect = ({ id, label, options, passRef, onChange, title, value, disabled }) => (React.createElement(React.Fragment, null,
31
- React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
32
- React.createElement("select", { tabIndex: 0, ref: passRef, id: id, className: 'theia-select t-mv-select', value: value, onChange: onChange, title: title, disabled: disabled }, options.map(option => React.createElement("option", { value: option, key: option }, option)))));
33
- exports.MWSelect = MWSelect;
34
- const MWSelectWithName = ({ id, label, options, passRef, onChange, title, value, disabled }) => (React.createElement(React.Fragment, null,
35
- React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
36
- React.createElement("select", { tabIndex: 0, ref: passRef, id: id, className: 'theia-select', value: value, onChange: onChange, title: title, disabled: disabled }, options.map(option => React.createElement("option", { value: option[0], key: option[0] }, option[1])))));
37
- exports.MWSelectWithName = MWSelectWithName;
38
- const MWInputWithSelect = ({ id, label, passRef, onKeyDown, title, options, onSelectChange, defaultValue, disabled, placeholder }) => (React.createElement(React.Fragment, null,
39
- React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
40
- React.createElement("div", { className: 'mw-input-select' },
41
- React.createElement("input", { tabIndex: 0, type: 'text', ref: passRef, id: id, className: 'theia-input t-mv-input', defaultValue: defaultValue, onKeyDown: onKeyDown, title: title, spellCheck: false, disabled: disabled, placeholder: placeholder }),
42
- React.createElement("select", { className: 'theia-select t-mv-select', onChange: onSelectChange, disabled: disabled || (options.length === 0) }, options.reverse().map(option => React.createElement("option", { key: `'mw-input-select'-${id}-${option}`, value: option }, option))))));
43
- exports.MWInputWithSelect = MWInputWithSelect;
44
- const MWMoreMemorySelect = ({ options, handler, direction }) => {
45
- const [numBytes, setNumBytes] = React.useState(options[0]);
46
- const containerRef = React.createRef();
47
- const onSelectChange = (e) => {
48
- e.stopPropagation();
49
- const { value } = e.currentTarget;
50
- setNumBytes(parseInt(value));
51
- };
52
- const loadMoreMemory = (e) => {
53
- var _a, _b;
54
- (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.blur();
55
- const doHandle = !('key' in e) || ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode) === browser_1.Key.ENTER.keyCode;
56
- if (doHandle) {
57
- handler({
58
- numBytes,
59
- direction,
60
- });
61
- }
62
- };
63
- return (React.createElement("div", { className: 'mw-more-memory-select', tabIndex: 0, role: 'button', onClick: loadMoreMemory, onKeyDown: loadMoreMemory, ref: containerRef },
64
- React.createElement("div", { className: 'mw-more-memory-select-top no-select' },
65
- "Load",
66
- React.createElement("select", { className: 'theia-select', onChange: onSelectChange, tabIndex: 0 }, options.map(option => (React.createElement("option", { key: `mw-more-memory-select-${option}`, value: option }, option)))),
67
- `more bytes ${direction}`)));
68
- };
69
- exports.MWMoreMemorySelect = MWMoreMemorySelect;
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (C) 2021 Ericsson and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.MWMoreMemorySelect = exports.MWInputWithSelect = exports.MWSelectWithName = exports.MWSelect = exports.MWInput = exports.MWLabel = void 0;
19
+ const browser_1 = require("@theia/core/lib/browser");
20
+ const React = require("@theia/core/shared/react");
21
+ const MWLabel = ({ id, label, disabled, classNames }) => {
22
+ const additionalClassNames = classNames ? classNames.join(' ') : '';
23
+ return React.createElement("label", { htmlFor: id, className: `t-mv-label theia-header no-select ${additionalClassNames}${disabled ? ' disabled' : ''}` }, label);
24
+ };
25
+ exports.MWLabel = MWLabel;
26
+ const MWInput = ({ id, label, passRef, defaultValue, onChange, title, onKeyDown, disabled }) => (React.createElement(React.Fragment, null,
27
+ React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
28
+ React.createElement("input", { tabIndex: 0, type: 'text', ref: passRef, id: id, className: 'theia-input t-mv-input', defaultValue: defaultValue, onChange: onChange, onKeyDown: onKeyDown, title: title, spellCheck: false, disabled: disabled })));
29
+ exports.MWInput = MWInput;
30
+ const MWSelect = ({ id, label, options, passRef, onChange, title, value, disabled }) => (React.createElement(React.Fragment, null,
31
+ React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
32
+ React.createElement("select", { tabIndex: 0, ref: passRef, id: id, className: 'theia-select t-mv-select', value: value, onChange: onChange, title: title, disabled: disabled }, options.map(option => React.createElement("option", { value: option, key: option }, option)))));
33
+ exports.MWSelect = MWSelect;
34
+ const MWSelectWithName = ({ id, label, options, passRef, onChange, title, value, disabled }) => (React.createElement(React.Fragment, null,
35
+ React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
36
+ React.createElement("select", { tabIndex: 0, ref: passRef, id: id, className: 'theia-select', value: value, onChange: onChange, title: title, disabled: disabled }, options.map(option => React.createElement("option", { value: option[0], key: option[0] }, option[1])))));
37
+ exports.MWSelectWithName = MWSelectWithName;
38
+ const MWInputWithSelect = ({ id, label, passRef, onKeyDown, title, options, onSelectChange, defaultValue, disabled, placeholder }) => (React.createElement(React.Fragment, null,
39
+ React.createElement(exports.MWLabel, { id: id, label: label, disabled: disabled }),
40
+ React.createElement("div", { className: 'mw-input-select' },
41
+ React.createElement("input", { tabIndex: 0, type: 'text', ref: passRef, id: id, className: 'theia-input t-mv-input', defaultValue: defaultValue, onKeyDown: onKeyDown, title: title, spellCheck: false, disabled: disabled, placeholder: placeholder }),
42
+ React.createElement("select", { className: 'theia-select t-mv-select', onChange: onSelectChange, disabled: disabled || (options.length === 0) }, options.reverse().map(option => React.createElement("option", { key: `'mw-input-select'-${id}-${option}`, value: option }, option))))));
43
+ exports.MWInputWithSelect = MWInputWithSelect;
44
+ const MWMoreMemorySelect = ({ options, handler, direction }) => {
45
+ const [numBytes, setNumBytes] = React.useState(options[0]);
46
+ const containerRef = React.createRef();
47
+ const onSelectChange = (e) => {
48
+ e.stopPropagation();
49
+ const { value } = e.currentTarget;
50
+ setNumBytes(parseInt(value));
51
+ };
52
+ const loadMoreMemory = (e) => {
53
+ var _a, _b;
54
+ (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.blur();
55
+ const doHandle = !('key' in e) || ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode) === browser_1.Key.ENTER.keyCode;
56
+ if (doHandle) {
57
+ handler({
58
+ numBytes,
59
+ direction,
60
+ });
61
+ }
62
+ };
63
+ return (React.createElement("div", { className: 'mw-more-memory-select', tabIndex: 0, role: 'button', onClick: loadMoreMemory, onKeyDown: loadMoreMemory, ref: containerRef },
64
+ React.createElement("div", { className: 'mw-more-memory-select-top no-select' },
65
+ "Load",
66
+ React.createElement("select", { className: 'theia-select', onChange: onSelectChange, tabIndex: 0 }, options.map(option => (React.createElement("option", { key: `mw-more-memory-select-${option}`, value: option }, option)))),
67
+ `more bytes ${direction}`)));
68
+ };
69
+ exports.MWMoreMemorySelect = MWMoreMemorySelect;
70
70
  //# sourceMappingURL=memory-widget-components.js.map
@@ -1,51 +1,51 @@
1
- /********************************************************************************
2
- * Copyright (C) 2021 Ericsson and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- import { Disposable, DisposableCollection, Emitter, MessageService } from '@theia/core';
17
- import { ApplicationShell, WidgetManager } from '@theia/core/lib/browser';
18
- import { MemoryDiffWidget } from '../diff-widget/memory-diff-table-widget';
19
- import { MemoryWidget } from '../memory-widget/memory-widget';
20
- import { MemoryDiffWidgetData, MemoryWidgetOptions } from './memory-widget-utils';
21
- export declare class MemoryWidgetManager implements Disposable {
22
- protected createdWidgetCount: number;
23
- protected widgetDisplayId: number;
24
- protected readonly toDispose: DisposableCollection;
25
- protected readonly widgetManager: WidgetManager;
26
- protected readonly shell: ApplicationShell;
27
- protected readonly messageService: MessageService;
28
- protected readonly onNewWidgetCreated: Emitter<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget>>;
29
- readonly onDidCreateNewWidget: import("@theia/core").Event<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget>>;
30
- protected readonly onSelectedWidgetChanged: Emitter<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget> | undefined>;
31
- readonly onDidChangeSelectedWidget: import("@theia/core").Event<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget> | undefined>;
32
- protected readonly onChangedEmitter: Emitter<void>;
33
- readonly onChanged: import("@theia/core").Event<void>;
34
- protected readonly _availableWidgets: Map<string, MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget>>;
35
- protected _focusedWidget: MemoryWidget | undefined;
36
- protected _canCompare: boolean;
37
- get availableWidgets(): MemoryWidget[];
38
- get canCompare(): boolean;
39
- protected init(): void;
40
- get focusedWidget(): MemoryWidget | undefined;
41
- set focusedWidget(title: MemoryWidget | undefined);
42
- protected setCanCompare(): void;
43
- createNewMemoryWidget<T extends MemoryWidget>(kind?: 'register' | 'memory' | 'writable' | string): Promise<T>;
44
- protected getWidgetOfKind<T extends MemoryWidget>(kind: string): Promise<T>;
45
- protected getWidgetIdForKind(kind: string): string;
46
- protected getWidgetOptionsForId(widgetId: string): MemoryWidgetOptions;
47
- dispose(): void;
48
- protected fireNewWidget(widget: MemoryWidget): void;
49
- doDiff(options: Omit<MemoryDiffWidgetData, 'dynamic' | 'identifier'>): Promise<MemoryDiffWidget | undefined>;
50
- }
1
+ /********************************************************************************
2
+ * Copyright (C) 2021 Ericsson and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Disposable, DisposableCollection, Emitter, MessageService } from '@theia/core';
17
+ import { ApplicationShell, WidgetManager } from '@theia/core/lib/browser';
18
+ import { MemoryDiffWidget } from '../diff-widget/memory-diff-table-widget';
19
+ import { MemoryWidget } from '../memory-widget/memory-widget';
20
+ import { MemoryDiffWidgetData, MemoryWidgetOptions } from './memory-widget-utils';
21
+ export declare class MemoryWidgetManager implements Disposable {
22
+ protected createdWidgetCount: number;
23
+ protected widgetDisplayId: number;
24
+ protected readonly toDispose: DisposableCollection;
25
+ protected readonly widgetManager: WidgetManager;
26
+ protected readonly shell: ApplicationShell;
27
+ protected readonly messageService: MessageService;
28
+ protected readonly onNewWidgetCreated: Emitter<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget>>;
29
+ readonly onDidCreateNewWidget: import("@theia/core").Event<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget>>;
30
+ protected readonly onSelectedWidgetChanged: Emitter<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget> | undefined>;
31
+ readonly onDidChangeSelectedWidget: import("@theia/core").Event<MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget> | undefined>;
32
+ protected readonly onChangedEmitter: Emitter<void>;
33
+ readonly onChanged: import("@theia/core").Event<void>;
34
+ protected readonly _availableWidgets: Map<string, MemoryWidget<import("../memory-widget/memory-options-widget").MemoryOptionsWidget, import("../memory-widget/memory-table-widget").MemoryTableWidget>>;
35
+ protected _focusedWidget: MemoryWidget | undefined;
36
+ protected _canCompare: boolean;
37
+ get availableWidgets(): MemoryWidget[];
38
+ get canCompare(): boolean;
39
+ protected init(): void;
40
+ get focusedWidget(): MemoryWidget | undefined;
41
+ set focusedWidget(title: MemoryWidget | undefined);
42
+ protected setCanCompare(): void;
43
+ createNewMemoryWidget<T extends MemoryWidget>(kind?: 'register' | 'memory' | 'writable' | string): Promise<T>;
44
+ protected getWidgetOfKind<T extends MemoryWidget>(kind: string): Promise<T>;
45
+ protected getWidgetIdForKind(kind: string): string;
46
+ protected getWidgetOptionsForId(widgetId: string): MemoryWidgetOptions;
47
+ dispose(): void;
48
+ protected fireNewWidget(widget: MemoryWidget): void;
49
+ doDiff(options: Omit<MemoryDiffWidgetData, 'dynamic' | 'identifier'>): Promise<MemoryDiffWidget | undefined>;
50
+ }
51
51
  //# sourceMappingURL=memory-widget-manager.d.ts.map