@stocksharp/trading-controls 1.4.0 → 1.6.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.
- package/README.md +8 -4
- package/dist/esm/log-monitor-widget.js +29 -8
- package/dist/esm/log-monitor-widget.js.map +1 -1
- package/dist/esm/tradefeed-widget.js +17 -11
- package/dist/esm/tradefeed-widget.js.map +1 -1
- package/dist/esm/watchlist-widget.js +6 -4
- package/dist/esm/watchlist-widget.js.map +1 -1
- package/dist/sstradingcontrols.js +97 -27
- package/dist/sstradingcontrols.js.map +2 -2
- package/dist/types/log-monitor-widget.d.ts +5 -1
- package/dist/types/log-monitor-widget.d.ts.map +1 -1
- package/dist/types/tradefeed-widget.d.ts +2 -1
- package/dist/types/tradefeed-widget.d.ts.map +1 -1
- package/dist/types/watchlist-widget.d.ts +1 -1
- package/dist/types/watchlist-widget.d.ts.map +1 -1
- package/package.json +2 -2
- package/screenshots/optimization-surface.png +0 -0
- package/screenshots/optimization.png +0 -0
- package/src/log-monitor-widget.ts +38 -6
- package/src/tradefeed-widget.ts +23 -15
- package/src/watchlist-widget.ts +6 -4
- package/styles/trading-controls.css +8 -1
|
@@ -4,6 +4,8 @@ import { DataGrid, GridColumn } from '@stocksharp/grids/data-grid';
|
|
|
4
4
|
export interface LogMonitorDeps {
|
|
5
5
|
host: TradingHost;
|
|
6
6
|
maxMessages?: number;
|
|
7
|
+
chrome?: boolean;
|
|
8
|
+
sources?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export declare class LogMonitorWidget {
|
|
9
11
|
static TYPE: "logMonitor";
|
|
@@ -23,12 +25,14 @@ export declare class LogMonitorWidget {
|
|
|
23
25
|
_selected: string | null;
|
|
24
26
|
_grid: DataGrid<LogMessageRow> | null;
|
|
25
27
|
static create(hostEl: HTMLElement, state: Record<string, unknown>, deps: LogMonitorDeps): LogMonitorWidget;
|
|
26
|
-
static _buildRoot(host: TradingHost): HTMLElement;
|
|
28
|
+
static _buildRoot(host: TradingHost, chrome: boolean, sources: boolean): HTMLElement;
|
|
27
29
|
constructor(rootEl: HTMLElement, _state: Record<string, unknown>, deps: LogMonitorDeps);
|
|
28
30
|
dispose(): void;
|
|
29
31
|
setSources(sources: LogSourceNode[]): void;
|
|
30
32
|
append(messages: LogMessageRow[]): void;
|
|
31
33
|
clear(): void;
|
|
34
|
+
sourcesShown(): boolean;
|
|
35
|
+
showSources(on: boolean): void;
|
|
32
36
|
select(sourceId: string | null): void;
|
|
33
37
|
visible(): LogMessageRow[];
|
|
34
38
|
_render(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-monitor-widget.d.ts","sourceRoot":"","sources":["../../src/log-monitor-widget.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAEY,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAC1E,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAG1E,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,WAAW,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"log-monitor-widget.d.ts","sourceRoot":"","sources":["../../src/log-monitor-widget.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAEY,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAC1E,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAG1E,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,WAAW,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,MAAM,CAAC,EAAE,OAAO,CAAC;IAKjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAC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E,EAAE,OAAO,GAAG,IAAI;IAK9B,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAOrC,OAAO,IAAI,aAAa,EAAE;IAK1B,OAAO,IAAI,IAAI;IAIf,WAAW,IAAI,IAAI;IASnB,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IAOvD,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW;IAc3D,OAAO,IAAI,IAAI;IAIf,QAAQ,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE;IAsCvC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;CAGlC"}
|
|
@@ -5,6 +5,7 @@ import { type BubbleLane, type BubbleShape } from './tradefeed-bubbles.js';
|
|
|
5
5
|
import { DataGrid, GridColumn } from '@stocksharp/grids/data-grid';
|
|
6
6
|
export interface TradeFeedDeps {
|
|
7
7
|
host: TradingHost;
|
|
8
|
+
ownTradesTab: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare class TradeFeedWidget {
|
|
10
11
|
static TYPE: "tradefeed";
|
|
@@ -40,7 +41,7 @@ export declare class TradeFeedWidget {
|
|
|
40
41
|
_activeSymbol: string | null;
|
|
41
42
|
_extraSymbols: Set<string>;
|
|
42
43
|
static create(hostEl: HTMLElement, state: Record<string, unknown>, deps: TradeFeedDeps): TradeFeedWidget;
|
|
43
|
-
static _buildRoot(host: TradingHost): HTMLElement;
|
|
44
|
+
static _buildRoot(host: TradingHost, ownTradesTab: boolean): HTMLElement;
|
|
44
45
|
constructor(rootEl: HTMLElement, state: Record<string, unknown>, deps: TradeFeedDeps);
|
|
45
46
|
dispose(): void;
|
|
46
47
|
setActiveSymbol(symbol: string | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tradefeed-widget.d.ts","sourceRoot":"","sources":["../../src/tradefeed-widget.ts"],"names":[],"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,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAOtF,gBAAgB,IAAI,IAAI;IAiBxB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAWlD,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAkC5D,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW;IAS3E,YAAY,IAAI,IAAI;CAGvB"}
|
|
@@ -9,7 +9,7 @@ export declare class WatchlistWidget {
|
|
|
9
9
|
static FAVORITES_KEY: string;
|
|
10
10
|
static BASELINE_KEY_PREFIX: string;
|
|
11
11
|
static VISIBLE_CAP: number;
|
|
12
|
-
static
|
|
12
|
+
static RENDER_PAGE: number;
|
|
13
13
|
static TYPE: "watchlist";
|
|
14
14
|
rootEl: HTMLElement;
|
|
15
15
|
api: TradingApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchlist-widget.d.ts","sourceRoot":"","sources":["../../src/watchlist-widget.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAoB,UAAU,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAC5G,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAK1E,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,qBAAa,eAAe;IACxB,MAAM,CAAC,aAAa,SAAkC;IAQtD,MAAM,CAAC,mBAAmB,SAAiB;IAC3C,MAAM,CAAC,WAAW,SAAM;
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Aa,EAAE;IAS3B,SAAS,IAAI,IAAI;IA6BjB,eAAe,IAAI,IAAI;IAKvB,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;IAQ3D,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;IAM7D,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;CAKjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stocksharp/trading-controls",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Browser trading controls for StockSharp: order blotters, positions, trade history, watchlist and trade feed, each built against one host port and rendering its own DOM.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
"release:major": "npm version major -m \"chore: release v%s\""
|
|
185
185
|
},
|
|
186
186
|
"dependencies": {
|
|
187
|
-
"@stocksharp/grids": "^1.
|
|
187
|
+
"@stocksharp/grids": "^1.3.0"
|
|
188
188
|
},
|
|
189
189
|
"devDependencies": {
|
|
190
190
|
"@stocksharp/chart": "^2.4.0",
|
|
Binary file
|
|
Binary file
|
|
@@ -24,6 +24,15 @@ export interface LogMonitorDeps {
|
|
|
24
24
|
/// How many messages to keep. Older ones fall off the front. Defaults to 5000 - enough to
|
|
25
25
|
/// scroll back through a session, small enough that a chatty connector cannot fill a tab.
|
|
26
26
|
maxMessages?: number;
|
|
27
|
+
/// Whether the panel draws its own title bar and close button. Defaults to true. A host that
|
|
28
|
+
/// already titles the panel and closes it from elsewhere - a dock tab, say - turns this off,
|
|
29
|
+
/// so the title is not said twice and no button offers a close that leads somewhere else.
|
|
30
|
+
chrome?: boolean;
|
|
31
|
+
/// Whether the source tree starts out shown. Defaults to true. A consumer whose log has one
|
|
32
|
+
/// writer has nothing to choose between, and the fixed-width column is space the messages
|
|
33
|
+
/// need. This is the initial state only — the reader can bring the tree back from the grid's
|
|
34
|
+
/// context menu, so a session that grows a second writer is not stuck without it.
|
|
35
|
+
sources?: boolean;
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
const DEFAULT_MAX = 5_000;
|
|
@@ -65,7 +74,7 @@ export class LogMonitorWidget {
|
|
|
65
74
|
|
|
66
75
|
static create(hostEl: HTMLElement, state: Record<string, unknown>, deps: LogMonitorDeps): LogMonitorWidget {
|
|
67
76
|
const host = assertHost(deps?.host, 'LogMonitorWidget');
|
|
68
|
-
const root = LogMonitorWidget._buildRoot(host);
|
|
77
|
+
const root = LogMonitorWidget._buildRoot(host, deps?.chrome !== false, deps?.sources !== false);
|
|
69
78
|
root.id = makePanelId(LogMonitorWidget.TYPE);
|
|
70
79
|
hostEl.appendChild(root);
|
|
71
80
|
return new LogMonitorWidget(root, state || {}, deps);
|
|
@@ -74,13 +83,16 @@ export class LogMonitorWidget {
|
|
|
74
83
|
// The panel's markup: a source tree, a toolbar of level toggles and a text box, and the
|
|
75
84
|
// message table. The level toggles are buttons rather than checkboxes because they are read
|
|
76
85
|
// as a row of states, and each carries its letter so the toolbar and the column agree.
|
|
77
|
-
static _buildRoot(host: TradingHost): HTMLElement {
|
|
86
|
+
static _buildRoot(host: TradingHost, chrome: boolean, sources: boolean): HTMLElement {
|
|
78
87
|
const title = host.t('LogMonitor');
|
|
79
|
-
|
|
80
|
-
makeElement('div', 'panel-header', {}, [
|
|
88
|
+
const header = chrome
|
|
89
|
+
? [makeElement('div', 'panel-header', {}, [
|
|
81
90
|
makeElement('span', '', {}, [title]),
|
|
82
91
|
makeIconButton('bt-icon-btn bt-icon-cancel panel-close-btn', host.t('ClosePanel'), 'bi-x', { type: 'button' }),
|
|
83
|
-
])
|
|
92
|
+
])]
|
|
93
|
+
: [];
|
|
94
|
+
return makePanelRoot(`log-monitor-panel${sources ? '' : ' log-sources-off'}`, title, [
|
|
95
|
+
...header,
|
|
84
96
|
makeElement('div', 'panel-body log-monitor-body', {}, [
|
|
85
97
|
makeElement('div', 'log-sources', { role: 'tree', 'aria-label': host.t('LogSources') }, []),
|
|
86
98
|
makeElement('div', 'log-messages', {}, [
|
|
@@ -164,7 +176,16 @@ export class LogMonitorWidget {
|
|
|
164
176
|
rowKey: (m) => String(m.id),
|
|
165
177
|
emptyText: this._host.t('NoLogMessages'),
|
|
166
178
|
rowClass: (m) => `log-row log-row-${m.level}`,
|
|
167
|
-
contextMenu:
|
|
179
|
+
contextMenu: {
|
|
180
|
+
...makeGridMenu<LogMessageRow>(this._host),
|
|
181
|
+
// The tree is worth its width when several things write to the log and worth
|
|
182
|
+
// nothing when one does, and which of those is true changes with the session.
|
|
183
|
+
// So it is a choice the reader makes here, next to the other column choices.
|
|
184
|
+
items: (_context, defaults) => [
|
|
185
|
+
...defaults,
|
|
186
|
+
{ label: this._host.t('LogSources'), checked: this.sourcesShown(), run: () => this.showSources(!this.sourcesShown()) },
|
|
187
|
+
],
|
|
188
|
+
},
|
|
168
189
|
selection: 'multi',
|
|
169
190
|
})
|
|
170
191
|
: null;
|
|
@@ -202,6 +223,17 @@ export class LogMonitorWidget {
|
|
|
202
223
|
this._render();
|
|
203
224
|
}
|
|
204
225
|
|
|
226
|
+
/// Whether the source tree is currently drawn.
|
|
227
|
+
sourcesShown(): boolean {
|
|
228
|
+
return !this.rootEl.classList.contains('log-sources-off');
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/// Show or hide the source tree. Hiding it does not drop the filter that is set: the
|
|
232
|
+
/// messages stay filtered by whatever was selected, which is what the reader last asked for.
|
|
233
|
+
showSources(on: boolean): void {
|
|
234
|
+
this.rootEl.classList.toggle('log-sources-off', !on);
|
|
235
|
+
}
|
|
236
|
+
|
|
205
237
|
/// Show one source's subtree, or everything when given null.
|
|
206
238
|
select(sourceId: string | null): void {
|
|
207
239
|
this._selected = sourceId;
|
package/src/tradefeed-widget.ts
CHANGED
|
@@ -35,12 +35,14 @@ import { DataGrid, GridColumn } from '@stocksharp/grids/source/data-grid';
|
|
|
35
35
|
// no identities to diff, select or flash by.
|
|
36
36
|
type KeyedTrade = TradeRow & { _k?: number };
|
|
37
37
|
|
|
38
|
-
/// The panel
|
|
39
|
-
///
|
|
40
|
-
///
|
|
41
|
-
/// `spawn`.
|
|
38
|
+
/// The panel reports no application action: a tape is read, and the two
|
|
39
|
+
/// gestures it does make — pin an instrument, open another feed — are the
|
|
40
|
+
/// host's own `pickInstrument` and `spawn`.
|
|
42
41
|
export interface TradeFeedDeps {
|
|
43
42
|
host: TradingHost;
|
|
43
|
+
/// Whether the feed carries a second tab with the account's own fills. A host
|
|
44
|
+
/// that lists them beside its orders and positions shows the tape alone.
|
|
45
|
+
ownTradesTab: boolean;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
// Opacity, not colour. The hue of every stroke below is the host's
|
|
@@ -108,7 +110,9 @@ export class TradeFeedWidget {
|
|
|
108
110
|
// host, so a missing host has to fail here rather than render a panel
|
|
109
111
|
// captioned with raw English keys.
|
|
110
112
|
const host = assertHost(deps?.host, 'TradeFeedWidget');
|
|
111
|
-
|
|
113
|
+
if (typeof deps.ownTradesTab !== 'boolean')
|
|
114
|
+
throw new Error('TradeFeedWidget: dep "ownTradesTab" is required');
|
|
115
|
+
const root = TradeFeedWidget._buildRoot(host, deps.ownTradesTab);
|
|
112
116
|
root.id = makePanelId(TradeFeedWidget.TYPE);
|
|
113
117
|
hostEl.appendChild(root);
|
|
114
118
|
return new TradeFeedWidget(root, state || {}, deps);
|
|
@@ -121,7 +125,7 @@ export class TradeFeedWidget {
|
|
|
121
125
|
// pins another instrument to THIS feed, the one beside it asks the host for
|
|
122
126
|
// another feed panel. The tooltips are what tell them apart, so neither is
|
|
123
127
|
// an icon on its own.
|
|
124
|
-
static _buildRoot(host: TradingHost): HTMLElement {
|
|
128
|
+
static _buildRoot(host: TradingHost, ownTradesTab: boolean): HTMLElement {
|
|
125
129
|
const addInstrument = host.t('AddInstrument');
|
|
126
130
|
const marketTrades = host.t('MarketTrades');
|
|
127
131
|
return makePanelRoot('tradefeed-panel tf-tab-market tf-view-list', host.t('TradeFeed'), [
|
|
@@ -135,10 +139,12 @@ export class TradeFeedWidget {
|
|
|
135
139
|
]),
|
|
136
140
|
makeIconButton('bt-icon-btn bt-icon-cancel panel-close-btn', host.t('ClosePanel'), 'bi-x', { type: 'button' }),
|
|
137
141
|
]),
|
|
138
|
-
|
|
139
|
-
makeElement('
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
...(ownTradesTab ? [
|
|
143
|
+
makeElement('div', 'tf-tabs', { role: 'tablist', 'aria-label': host.t('Trade feed tabs') }, [
|
|
144
|
+
makeElement('button', 'tf-tab active', { type: 'button', role: 'tab', 'aria-selected': 'true', 'data-tab': 'market' }, [marketTrades]),
|
|
145
|
+
makeElement('button', 'tf-tab', { type: 'button', role: 'tab', 'aria-selected': 'false', 'data-tab': 'my' }, [host.t('My trades')]),
|
|
146
|
+
]),
|
|
147
|
+
] : []),
|
|
142
148
|
makeElement('div', 'tf-extras', { role: 'list', 'aria-label': host.t('ExtraInstruments'), hidden: '' }, []),
|
|
143
149
|
// Each tape is a DataGrid over the shared table skin: the <thead>
|
|
144
150
|
// is left empty for the grid to fill, which is also what makes the
|
|
@@ -149,12 +155,14 @@ export class TradeFeedWidget {
|
|
|
149
155
|
makeElement('tbody', '', {}, []),
|
|
150
156
|
]),
|
|
151
157
|
]),
|
|
152
|
-
|
|
153
|
-
makeElement('
|
|
154
|
-
makeElement('
|
|
155
|
-
|
|
158
|
+
...(ownTradesTab ? [
|
|
159
|
+
makeElement('div', 'tradefeed-content tf-my', {}, [
|
|
160
|
+
makeElement('table', 'terminal-table tradefeed-table', { role: 'table', 'aria-label': host.t('My trades') }, [
|
|
161
|
+
makeElement('thead', '', {}, []),
|
|
162
|
+
makeElement('tbody', '', {}, []),
|
|
163
|
+
]),
|
|
156
164
|
]),
|
|
157
|
-
]),
|
|
165
|
+
] : []),
|
|
158
166
|
makeElement('canvas', 'tradefeed-bubbles tf-bubbles', { 'aria-hidden': 'true' }, []),
|
|
159
167
|
makeElement('div', 'tf-bubble-tooltip', { role: 'tooltip', hidden: '' }, []),
|
|
160
168
|
]);
|
package/src/watchlist-widget.ts
CHANGED
|
@@ -37,7 +37,8 @@ export class WatchlistWidget {
|
|
|
37
37
|
// day is scratch, not a setting worth syncing.
|
|
38
38
|
static BASELINE_KEY_PREFIX = 'wlBaseline:';
|
|
39
39
|
static VISIBLE_CAP = 30;
|
|
40
|
-
|
|
40
|
+
// Rows painted at a time: scrolling the list towards its end paints the next page.
|
|
41
|
+
static RENDER_PAGE = 300;
|
|
41
42
|
static TYPE = ControlTypes.Watchlist;
|
|
42
43
|
|
|
43
44
|
rootEl: HTMLElement;
|
|
@@ -156,8 +157,9 @@ export class WatchlistWidget {
|
|
|
156
157
|
emptyText: this._host.t('No instruments'),
|
|
157
158
|
rowClass: (i) => (i.symbol === this.currentSymbol ? 'wl-row wl-current' : 'wl-row'),
|
|
158
159
|
bindRow: (tr, i) => tr.addEventListener('click', () => this._deps.onSelect(i.symbol!)),
|
|
159
|
-
// Paint a
|
|
160
|
-
renderLimit: WatchlistWidget.
|
|
160
|
+
// Paint a page at a time as the list is scrolled; export over the whole filtered set.
|
|
161
|
+
renderLimit: WatchlistWidget.RENDER_PAGE,
|
|
162
|
+
scroller: this.rootEl.querySelector('.watchlist-pane') as HTMLElement,
|
|
161
163
|
// A header click re-renders through the grid, so this is the only
|
|
162
164
|
// place that sees every change to the visible set — including a sort
|
|
163
165
|
// the widget was never told about.
|
|
@@ -395,7 +397,7 @@ export class WatchlistWidget {
|
|
|
395
397
|
}
|
|
396
398
|
|
|
397
399
|
// Export the current filtered+sorted view to .xlsx — every matching
|
|
398
|
-
// instrument,
|
|
400
|
+
// instrument, painted or not.
|
|
399
401
|
_export(): void {
|
|
400
402
|
this._grid?.download('watchlist', this._host.t('Markets'));
|
|
401
403
|
}
|
|
@@ -531,7 +531,8 @@
|
|
|
531
531
|
border-color: var(--t-accent);
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
|
|
534
|
+
/* The list scrolls in the pane around its table: a table body cannot be a scroll container. */
|
|
535
|
+
.watchlist-pane {
|
|
535
536
|
flex: 1;
|
|
536
537
|
min-height: 0;
|
|
537
538
|
overflow-y: auto;
|
|
@@ -1398,6 +1399,12 @@
|
|
|
1398
1399
|
overflow: hidden;
|
|
1399
1400
|
}
|
|
1400
1401
|
|
|
1402
|
+
/* The tree is hidden rather than dropped, so the menu can bring it back without the panel
|
|
1403
|
+
being rebuilt and the selection it holds surviving the round trip. */
|
|
1404
|
+
.log-monitor-panel.log-sources-off .log-sources {
|
|
1405
|
+
display: none;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1401
1408
|
.log-sources {
|
|
1402
1409
|
flex: 0 0 14rem;
|
|
1403
1410
|
min-height: 0;
|