@stocksharp/trading-controls 1.5.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/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 +70 -19
- package/dist/sstradingcontrols.js.map +2 -2
- 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/tradefeed-widget.ts +23 -15
- package/src/watchlist-widget.ts +6 -4
- package/styles/trading-controls.css +2 -1
|
@@ -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":[],"mappings":"AA0BA,OAAO,EAAoB,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAiB,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"tradefeed-widget.d.ts","sourceRoot":"","sources":["../../src/tradefeed-widget.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAoB,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAiB,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAU1E,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,WAAW,CAAC;IAGlB,YAAY,EAAE,OAAO,CAAC;CACzB;AAoBD,qBAAa,eAAe;IACxB,MAAM,CAAC,IAAI,cAA0B;IAIrC,MAAM,CAAC,QAAQ,SAA4B;IAG3C,MAAM,CAAC,QAAQ,SAAM;IACrB,MAAM,CAAC,WAAW,SAAO;IAEzB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,MAAM,EA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GAAG,UAAU,EAAE;IAQvC,cAAc,IAAI,IAAI;IA2DtB,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,wBAAwB,EAAE,IAAI,EAAE,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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AAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAarC,cAAc,IAAI,MAAM,EAAE;IAO1B,cAAc,IAAI,IAAI;IAQtB,QAAQ,IAAI,aAAa,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
|
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
|
}
|