@tradecanvas/chart 1.36.0 → 1.37.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 +1 -1
- package/dist/Chart.d.ts +4 -0
- package/dist/Chart.d.ts.map +1 -1
- package/dist/LayoutSession-CHx7F_fj.cjs +2 -0
- package/dist/LayoutSession-CHx7F_fj.cjs.map +1 -0
- package/dist/{LayoutSession-C9eUKUDB.js → LayoutSession-DCTwvtwp.js} +10 -2
- package/dist/LayoutSession-DCTwvtwp.js.map +1 -0
- package/dist/i18n-BXzSqL8c.cjs +2 -0
- package/dist/i18n-BXzSqL8c.cjs.map +1 -0
- package/dist/{i18n-BSyBRGty.js → i18n-CCRcUMIR.js} +15 -1
- package/dist/i18n-CCRcUMIR.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/widget/ChartWidget.d.ts +6 -0
- package/dist/widget/ChartWidget.d.ts.map +1 -1
- package/dist/widget/WidgetContextMenu.d.ts +46 -6
- package/dist/widget/WidgetContextMenu.d.ts.map +1 -1
- package/dist/widget/WidgetHotkeySheet.d.ts.map +1 -1
- package/dist/widget/WidgetSettings.d.ts +3 -1
- package/dist/widget/WidgetSettings.d.ts.map +1 -1
- package/dist/widget/chartMenu.d.ts +40 -1
- package/dist/widget/chartMenu.d.ts.map +1 -1
- package/dist/widget/index.cjs +36 -17
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.js +1709 -1433
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/locales/ar.d.ts.map +1 -1
- package/dist/widget/locales/cs.d.ts.map +1 -1
- package/dist/widget/locales/da.d.ts.map +1 -1
- package/dist/widget/locales/de.d.ts.map +1 -1
- package/dist/widget/locales/el.d.ts.map +1 -1
- package/dist/widget/locales/en.d.ts +7 -0
- package/dist/widget/locales/en.d.ts.map +1 -1
- package/dist/widget/locales/es.d.ts.map +1 -1
- package/dist/widget/locales/et.d.ts.map +1 -1
- package/dist/widget/locales/fa.d.ts.map +1 -1
- package/dist/widget/locales/fr.d.ts.map +1 -1
- package/dist/widget/locales/he.d.ts.map +1 -1
- package/dist/widget/locales/hu.d.ts.map +1 -1
- package/dist/widget/locales/id.d.ts.map +1 -1
- package/dist/widget/locales/index.cjs +1 -1
- package/dist/widget/locales/index.cjs.map +1 -1
- package/dist/widget/locales/index.js +197 -1
- package/dist/widget/locales/index.js.map +1 -1
- package/dist/widget/locales/it.d.ts.map +1 -1
- package/dist/widget/locales/ja.d.ts.map +1 -1
- package/dist/widget/locales/ko.d.ts.map +1 -1
- package/dist/widget/locales/ms.d.ts.map +1 -1
- package/dist/widget/locales/nb.d.ts.map +1 -1
- package/dist/widget/locales/nl.d.ts.map +1 -1
- package/dist/widget/locales/pl.d.ts.map +1 -1
- package/dist/widget/locales/pt.d.ts.map +1 -1
- package/dist/widget/locales/ro.d.ts.map +1 -1
- package/dist/widget/locales/ru.d.ts.map +1 -1
- package/dist/widget/locales/sk.d.ts.map +1 -1
- package/dist/widget/locales/sv.d.ts.map +1 -1
- package/dist/widget/locales/th.d.ts.map +1 -1
- package/dist/widget/locales/tr.d.ts.map +1 -1
- package/dist/widget/locales/vi.d.ts.map +1 -1
- package/dist/widget/locales/zh.d.ts.map +1 -1
- package/dist/widget/locales/zhHant.d.ts.map +1 -1
- package/dist/widget/widgetFeatures.d.ts +4 -3
- package/dist/widget/widgetFeatures.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/LayoutSession-C9eUKUDB.js.map +0 -1
- package/dist/LayoutSession-D_uCeAHr.cjs +0 -2
- package/dist/LayoutSession-D_uCeAHr.cjs.map +0 -1
- package/dist/i18n-BSyBRGty.js.map +0 -1
- package/dist/i18n-Bj6tLaRp.cjs +0 -2
- package/dist/i18n-Bj6tLaRp.cjs.map +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type ContextMenuEntry =
|
|
2
2
|
/**
|
|
3
|
-
* `checked` makes it a switch (ticked when on)
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* `checked` makes it a switch (ticked when on); with `radio` it is one
|
|
4
|
+
* choice among the radios beside it. `shortcut` ("Alt+I") is written at
|
|
5
|
+
* the row's end. `submenu` opens more entries beside this one. `remove`
|
|
6
|
+
* (its action's name, "Delete template Swing") gives it a remove button
|
|
7
|
+
* and the Delete key; the menu's `onRemove` hears it.
|
|
6
8
|
*/
|
|
7
9
|
{
|
|
8
10
|
id: string;
|
|
@@ -10,25 +12,43 @@ export type ContextMenuEntry =
|
|
|
10
12
|
icon?: string;
|
|
11
13
|
danger?: boolean;
|
|
12
14
|
checked?: boolean;
|
|
15
|
+
radio?: boolean;
|
|
16
|
+
shortcut?: string;
|
|
17
|
+
submenu?: readonly ContextMenuEntry[];
|
|
13
18
|
remove?: string;
|
|
14
19
|
} | 'separator';
|
|
15
20
|
/**
|
|
16
21
|
* A small menu opened at a point (a right-click on a drawing, say): arrow
|
|
17
22
|
* keys, Home and End move through it, Enter picks, Escape, Tab or a click
|
|
18
|
-
* outside close it. Focus returns to where it was.
|
|
23
|
+
* outside close it. Focus returns to where it was. An entry with a submenu
|
|
24
|
+
* opens it beside itself on a click, Enter, the right arrow (the left one
|
|
25
|
+
* right to left) or a rest of the pointer; the other arrow or Escape closes
|
|
26
|
+
* it again.
|
|
19
27
|
*/
|
|
20
28
|
export declare class WidgetContextMenu {
|
|
21
29
|
private readonly host;
|
|
30
|
+
private readonly backLabel;
|
|
22
31
|
private el;
|
|
23
32
|
private onPick;
|
|
24
33
|
private onRemove;
|
|
25
34
|
private returnFocus;
|
|
26
35
|
/** The button that opened it: pressing it again is its click's to handle (a toggle). */
|
|
27
36
|
private anchor;
|
|
37
|
+
/** The submenu, made the first time an entry opens one. */
|
|
38
|
+
private child;
|
|
39
|
+
/** The menu this one is the submenu of. */
|
|
40
|
+
private parent;
|
|
41
|
+
private hoverTimer;
|
|
28
42
|
private readonly onDocPointer;
|
|
29
|
-
/** Scrolling
|
|
43
|
+
/** Scrolling a long menu keeps it; scrolling anywhere else moves the chart from under it. */
|
|
44
|
+
private readonly onWheel;
|
|
45
|
+
/** Resizing or leaving the window moves the chart from under the menu. */
|
|
30
46
|
private readonly onAway;
|
|
31
|
-
|
|
47
|
+
/**
|
|
48
|
+
* `backLabel` ("Back") names the first entry of a submenu on a phone, which
|
|
49
|
+
* leads back to the menu under it.
|
|
50
|
+
*/
|
|
51
|
+
constructor(host: HTMLElement, label: string, backLabel?: string);
|
|
32
52
|
/**
|
|
33
53
|
* Open at (`x`, `y`) in the host's coordinates. It opens up or to the left
|
|
34
54
|
* of the point when there is no room below or to the right, and stays
|
|
@@ -38,7 +58,27 @@ export declare class WidgetContextMenu {
|
|
|
38
58
|
close(): void;
|
|
39
59
|
isOpen(): boolean;
|
|
40
60
|
destroy(): void;
|
|
61
|
+
private show;
|
|
62
|
+
/**
|
|
63
|
+
* A long list of choices (the time zones) opens scrolled to the one made,
|
|
64
|
+
* returned to take the keyboard; null when it is in sight already.
|
|
65
|
+
*/
|
|
66
|
+
private revealChoice;
|
|
67
|
+
/** The widget reads right to left (`dir="rtl"`): submenus open to the left, and the arrows swap. */
|
|
68
|
+
private rtl;
|
|
69
|
+
/** Whether `node` is in this menu or its open submenu. */
|
|
70
|
+
private holds;
|
|
41
71
|
private entry;
|
|
72
|
+
/** The shortcut, or the mark of a submenu, at the row's end. */
|
|
73
|
+
private appendEnd;
|
|
74
|
+
/** The keyboard removes it with Delete; the button is for a pointer. */
|
|
75
|
+
private removableRow;
|
|
76
|
+
/** Open `entries` beside `item`, after it (to its right, or left in RTL) or, without room there, before it. */
|
|
77
|
+
private openSubmenu;
|
|
78
|
+
private makeChild;
|
|
79
|
+
/** After a rest on `item`: open its submenu, or close the one open for another entry. */
|
|
80
|
+
private hover;
|
|
81
|
+
private clearHover;
|
|
42
82
|
/** Take an entry out (its `onRemove` told), the keyboard on the one after it; the menu closes when none is left. */
|
|
43
83
|
private remove;
|
|
44
84
|
private pick;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetContextMenu.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetContextMenu.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB;AAC1B
|
|
1
|
+
{"version":3,"file":"WidgetContextMenu.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetContextMenu.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB;AAC1B;;;;;;GAMG;AACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD,WAAW,CAAC;AAoDhB;;;;;;;GAOG;AACH,qBAAa,iBAAiB;IA4BhB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAA8B,OAAO,CAAC,QAAQ,CAAC,SAAS;IA3BzF,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,QAAQ,CAAuC;IACvD,OAAO,CAAC,WAAW,CAA4B;IAC/C,wFAAwF;IACxF,OAAO,CAAC,MAAM,CAA4B;IAC1C,2DAA2D;IAC3D,OAAO,CAAC,KAAK,CAAkC;IAC/C,2CAA2C;IAC3C,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,UAAU,CAA8C;IAChE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAI3B;IACF,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAEtB;IACF,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAE7C;;;OAGG;gBAC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,IAAI;IASb,MAAM,IAAI,OAAO;IAIjB,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChartType } from '@tradecanvas/commons';
|
|
2
2
|
import { ChartSettingsState, SettingsCallbacks } from './types.js';
|
|
3
3
|
import { Translator } from './i18n.js';
|
|
4
|
+
export type SettingsTab = 'symbol' | 'statusLine' | 'scales' | 'appearance' | 'layers' | 'trading';
|
|
4
5
|
/**
|
|
5
6
|
* The chart's settings: tabs down the side (Symbol, Status line, Scales,
|
|
6
7
|
* Appearance, Layers, Trading), each change shown at once. Cancel (Escape,
|
|
@@ -41,7 +42,8 @@ export declare class WidgetSettings {
|
|
|
41
42
|
},
|
|
42
43
|
/** Where the panel mounts (the widget's portal: themed, and inside it when fullscreen). */
|
|
43
44
|
host?: () => HTMLElement);
|
|
44
|
-
|
|
45
|
+
/** Open on `tab` (the Symbol tab unless asked: the price axis's menu asks for Scales). */
|
|
46
|
+
open(currentSettings: ChartSettingsState, chartType?: ChartType | null, tab?: SettingsTab): void;
|
|
45
47
|
isOpen(): boolean;
|
|
46
48
|
/** The settings as they are now (after an undo, a template), on the tab that's open; `chartType` when it changed. */
|
|
47
49
|
refresh(settings: ChartSettingsState, chartType?: ChartType | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetSettings.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAyC,MAAM,sBAAsB,CAAC;AAC/G,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAsB,MAAM,YAAY,CAAC;AAY5F,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetSettings.d.ts","sourceRoot":"","sources":["../../src/widget/WidgetSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAyC,MAAM,sB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|
+
import { WidgetFeature } from './widgetFeatures.js';
|
|
3
4
|
import { Translator } from './i18n.js';
|
|
4
5
|
/** What a menu on the chart (a right-click, or the "+" by the price axis) can do. */
|
|
5
|
-
export type ChartMenuAction = 'alert' | 'buyLimit' | 'buyStop' | 'sellLimit' | 'sellStop' | 'orderTicket' | 'horizontalLine' | 'resetView' | 'hideDrawings' | 'showDrawings' | 'removeDrawings' | 'settings' | 'exportData' | 'autoScale' | 'logScale' | 'percentScale' | '
|
|
6
|
+
export type ChartMenuAction = 'alert' | 'buyLimit' | 'buyStop' | 'sellLimit' | 'sellStop' | 'orderTicket' | 'horizontalLine' | 'resetView' | 'paste' | 'hideDrawings' | 'showDrawings' | 'removeDrawings' | 'removeIndicators' | 'settings' | 'exportData' | 'resetPriceScale' | 'autoScale' | 'invertScale' | 'leftScale' | 'regularScale' | 'logScale' | 'percentScale' | 'indexedScale' | 'indicatorValueLabels' | 'barCountdown' | 'highLowLines' | 'lastPriceLine' | 'goToDate' | 'paneLog' | 'paneInvert' | 'panePercent' | 'labels' | 'lines' | 'timezone';
|
|
7
|
+
/** A time zone's entry is this before its setting ('tz:UTC'). */
|
|
8
|
+
export declare const TIMEZONE_ENTRY = "tz:";
|
|
9
|
+
/** The widget's own keys for what the chart menus do, written beside the entries while their switches are on. */
|
|
10
|
+
export declare const CHART_MENU_KEYS: readonly {
|
|
11
|
+
action: ChartMenuAction;
|
|
12
|
+
keys: string;
|
|
13
|
+
feature: WidgetFeature;
|
|
14
|
+
}[];
|
|
15
|
+
/** The scale mode an entry chooses, if it is one of them. */
|
|
16
|
+
export declare function scaleModeOf(action: string): PriceScaleMode | undefined;
|
|
6
17
|
/** What the widget can do here, and how the chart is set now. */
|
|
7
18
|
export interface ChartMenuContext {
|
|
8
19
|
/** The price at the click (the price pane, the price axis, the "+"). */
|
|
@@ -17,12 +28,40 @@ export interface ChartMenuContext {
|
|
|
17
28
|
canDraw: boolean;
|
|
18
29
|
hasDrawings: boolean;
|
|
19
30
|
drawingsHidden: boolean;
|
|
31
|
+
/** Drawings copied, here or on another chart of the page, to paste. */
|
|
32
|
+
canPaste: boolean;
|
|
33
|
+
/** Indicators on the chart; a comparison with another symbol has its own dialog and isn't counted. */
|
|
34
|
+
hasIndicators: boolean;
|
|
20
35
|
canGoToDate: boolean;
|
|
21
36
|
/** A download of the bars and indicator lines (`features.dataExport`). */
|
|
22
37
|
canExport?: boolean;
|
|
23
38
|
autoScale: boolean;
|
|
24
39
|
scaleMode: PriceScaleMode;
|
|
40
|
+
/** A logarithmic scale is on offer (`features.logScale`). */
|
|
41
|
+
canLog: boolean;
|
|
25
42
|
inverted: boolean;
|
|
43
|
+
/** The price scale is on the left. */
|
|
44
|
+
leftScale: boolean;
|
|
45
|
+
/** The labels on the price scale; no `countdown` when the chart has none. */
|
|
46
|
+
labels: {
|
|
47
|
+
values: boolean;
|
|
48
|
+
countdown?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** The lines across the chart. */
|
|
51
|
+
lines: {
|
|
52
|
+
highLow: boolean;
|
|
53
|
+
lastPrice: boolean;
|
|
54
|
+
};
|
|
55
|
+
/** The time zone now, and those on offer (none: no entry for it). */
|
|
56
|
+
timezone: {
|
|
57
|
+
current: string;
|
|
58
|
+
options: readonly {
|
|
59
|
+
value: string;
|
|
60
|
+
label: string;
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
/** The widget's shortcuts that are on, by what they do ("Alt+R"). */
|
|
64
|
+
keys: Partial<Record<ChartMenuAction, string>>;
|
|
26
65
|
/** For a pane's menu: its scale switches. */
|
|
27
66
|
pane?: {
|
|
28
67
|
log: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chartMenu.d.ts","sourceRoot":"","sources":["../../src/widget/chartMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,w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