@tradecanvas/chart 1.17.0 → 1.18.1

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.
@@ -1,4 +1,4 @@
1
- import { C as e, a as t, c as n, i as r, n as i, o as a, r as o, t as s } from "../LayoutSession-DW5fcwzw.js";
1
+ import { C as e, a as t, c as n, i as r, n as i, o as a, r as o, t as s } from "../LayoutSession-B_rgyCMe.js";
2
2
  import { a as c, c as l, i as u, n as d, o as f, r as p, s as m, t as h } from "../i18n-BH0McEvQ.js";
3
3
  import { CHART_STYLE_KEYS as g, DARK_THEME as _, DEFAULT_SIGNAL_STYLE as v, DEFAULT_TRADE_ZONE_STYLE as y, DEFAULT_TRADING_CONFIG as b, LIGHT_THEME as x, PRICE_SOURCES as ee, formatPrice as te, indicatorSource as ne, isTimeFrame as re, isValidTimeZone as ie, marketStatus as ae, offsetAt as oe, parseIndicatorSource as se, readChartTypeOptions as ce, readNews as le, readQuote as ue, sanitizeDrawingOptions as de, sanitizeDrawingStyle as fe, tickBarCount as S, timeParts as pe, timeframeBucketStart as me, timeframeToMs as C, tzLabel as he, wallToUtc as ge, zoneOffsetMinutes as _e } from "@tradecanvas/commons";
4
4
  import { ChartStateManager as ve, MAX_ALERT_BARS as ye, MIN_ALERT_BARS as be, RANGE_PRESETS as xe, indicatorValuePrecision as Se, plotColor as Ce, plotShown as we, servesTimeframe as Te, sourceParam as Ee, withResampling as De } from "@tradecanvas/core";
@@ -5926,9 +5926,16 @@ var _r = class {
5926
5926
  let e = this.callbacks.fromWallTime(a.value, o.value);
5927
5927
  e !== null && this.setAnchor(n, { time: e });
5928
5928
  };
5929
- a.addEventListener("change", s), o.addEventListener("change", s), e.appendChild(N(this.t("drawingSettings.date"), a)), e.appendChild(N(this.t("drawingSettings.time"), o)), e.appendChild(N(this.t("drawingSettings.price"), Vt(t.price, { step: "any" }, (e) => this.setAnchor(n, { price: e }))));
5929
+ a.addEventListener("change", s), o.addEventListener("change", s), e.appendChild(N(this.t("drawingSettings.date"), a)), e.appendChild(N(this.t("drawingSettings.time"), o)), e.appendChild(N(this.t("drawingSettings.price"), this.priceInput(t.price, (e) => this.setAnchor(n, { price: e }))));
5930
5930
  });
5931
5931
  }
5932
+ priceInput(e, t) {
5933
+ let n = this.callbacks.roundPrice ?? ((e) => e), r = this.callbacks.priceStep?.(), i = Vt(n(e), { step: r !== void 0 && r > 0 ? r : "any" }, (e) => {
5934
+ let r = n(e);
5935
+ i.value = String(r), t(r);
5936
+ });
5937
+ return i;
5938
+ }
5932
5939
  setAnchor(e, t) {
5933
5940
  this.anchors = this.anchors.map((n, r) => r === e ? {
5934
5941
  ...n,
@@ -8527,6 +8534,8 @@ var ka = [
8527
8534
  let n = ki(e, t, this.displayTimezone());
8528
8535
  return n === null ? null : n / Ba(this.chart.getData());
8529
8536
  },
8537
+ roundPrice: (e) => this.chart.roundPrice(e),
8538
+ priceStep: () => this.chart.getPriceStep(),
8530
8539
  onAddAlert: (e) => this.addDrawingAlert(e),
8531
8540
  onSaveDefault: (e, t) => {
8532
8541
  this.chart.setDrawingToolDefaults(e, t), y.set(e, this.chart.getDrawingToolDefaults(e)), this.say(p(this.t("drawingSettings.defaultSaved"), { name: this.drawingToolName(e) }));