@trdrs/quickcharts 5.10.0 → 5.11.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/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ A pane's own buttons at its top right are where a pane is moved, collapsed and m
6
6
 
7
7
  The indicator settings dialog stands in the drawing dialog's frame, with its fields: Inputs, Style and Visibility pages, then a Defaults menu, Cancel and Ok. Every edit previews on the chart at once, and Ok commits the session as one `chart.indicators.update`, so it is one step of the chart's history; Cancel, Escape, the corner close and a press outside put the indicator back. The dialog lays out any definition from its manifest. `ManifestInput` gains `title`, the words it is labelled with, `group`, the heading it stands under with the inputs beside it that name the same group, `step`, `enabledWhen`, the values of another input under which it applies (it stands disabled under the others), and the kind `bool`, a switch held as 1 or 0. `ManifestPlot`, `ManifestLevel` and `ManifestFill` gain `title`. The Style page shows every plot, level and fill behind the checkbox that shows it, with its color and its line, a level with its value and a plot drawn in two colors with a row for each, then the values the indicator writes on the price scale and in the status line. The Visibility page holds the drawing dialog's timeframe ranges, and `IndicatorOverrides.visibility` keeps an indicator off the timeframes it leaves out while its legend row stays. The Defaults menu resets the indicator to its definition's own settings, or keeps its inputs and look, in the chart's storage, as the ones the definition's next instance opens with when it is added with no inputs and no overrides of its own. The built-ins title and group their inputs as their settings show them, hold a switch where they held a No and Yes list, and read their sources as Close, Open, High, Low, (H + L)/2, (H + L + C)/3 and (O + H + L + C)/4. The legend's input readout leaves out a switch and an input that does not apply, and the inputs-only editor holds the dialog's Inputs page. The catalog gains `settings.growing`, `settings.falling`, `settings.outputValues`, `settings.inputValues`, `settings.valuesInStatusLine`, `settings.inputsInStatusLine`, `settings.defaults`, `settings.resetSettings`, `settings.saveAsDefault` and `settings.indicatorPinnedNote`.
8
8
 
9
+ ## 5.11.0
10
+
11
+ `SymbolSearchOptions.scope`: the symbol search a page opens on its own, `openSymbolSearch` and `mountSymbolSearch`, offers a search scope as a chart's `search.scope` does, a toggle chip at the far edge of the class strip that limits the search to the scope's `search` and lists its `recents`. It is read once as the picker opens, and null offers none.
12
+
9
13
  ## 5.10.0
10
14
 
11
15
  The legend's market status, its popup, the session shading and the trading-hours choice read each market from its own session facts. A `24x7` symbol is always open, offers no choice and shades nothing. A symbol with no subsessions has one weekly session: it offers no choice and shades nothing, and its status is open or closed with a countdown. An electronic day, a `regular` subsession that differs from the symbol's `session`, which then states the whole electronic trading day (`SessionModel.electronic`), classifies every stretch outside regular hours as `extended` and reads the whole day as open in the status, the timeline and the countdown; it offers Electronic trading hours and Regular trading hours, and shades every stretch outside regular hours in the one color of `symbol.electronicColor`. A split day states its regular hours as `session` with pre-market and post-market around them, and offers Regular, Extended and, for a symbol that declares the new `overnight` subsession (`SubsessionId`, read from a UDF feed too), 24 hours, which is `symbol.session` of `allHours` and shades the overnight stretch in the night color. A closed trading day the symbol lists in `sessionHolidays` with no correction is a holiday (`MarketStatus.holiday`).
package/README.md CHANGED
@@ -2950,7 +2950,8 @@ the dialog searches your datafeed and leads with the chart's recents.
2950
2950
  Pressing the chip asks the other source the query and classes the dialog holds, and an answer that
2951
2951
  arrives for the state the viewer left is dropped. A pick is recorded in `search.recents` either way,
2952
2952
  and in the scope's `recents` too while the chip is on. The compare dialog, adding a comparison or
2953
- changing one, offers no scope and searches your datafeed.
2953
+ changing one, offers no scope and searches your datafeed. `openSymbolSearch` and `mountSymbolSearch`
2954
+ take the same `scope`, read once as the picker opens.
2954
2955
 
2955
2956
  | Field | What it is |
2956
2957
  |---|---|
@@ -3058,17 +3059,18 @@ A page that picks a market where no chart is mounted opens the same dialog the c
3058
3059
  opens, over the same controller, grammar, recents rule and symbol names. `openSymbolSearch` stands
3059
3060
  it over the page; `mountSymbolSearch` builds it bare into a box you own and position. Both take what
3060
3061
  you already give a chart: the feed, the mode, the language, the classes and their names, the marks,
3061
- and where recents are kept. Picking hands the symbol back and closes, because there is no chart here
3062
- to set.
3062
+ where recents are kept, and a search scope. Picking hands the symbol back and closes, because there
3063
+ is no chart here to set.
3063
3064
 
3064
3065
  `createSymbolSearchCache` keeps one feed's catalog warm between opens, so the next picker a page
3065
3066
  opens stands on pages the viewer already saw rather than on a loading line.
3066
3067
 
3067
3068
  ```ts
3068
- import { createSymbolSearchCache, createUdfDatafeed, mountSymbolSearch, openSymbolSearch } from '@trdrs/quickcharts'
3069
+ import { createSymbolSearchCache, createUdfDatafeed, mountSymbolSearch, openSymbolSearch, type SearchScope } from '@trdrs/quickcharts'
3069
3070
 
3070
3071
  declare const pickerBox: HTMLElement
3071
3072
  declare const form: { setInstrument(symbol: string): void }
3073
+ declare const selectedWatchlist: () => SearchScope | null
3072
3074
 
3073
3075
  const searchFeed = createUdfDatafeed({ baseUrl: 'https://feed.example.com/udf' })
3074
3076
  const catalog = createSymbolSearchCache({ datafeed: searchFeed, pageSize: 50 })
@@ -3081,6 +3083,7 @@ const picker = openSymbolSearch({
3081
3083
  classes: ['future', 'crypto'],
3082
3084
  classNames: { future: 'Futures', crypto: 'Crypto' },
3083
3085
  query: 'ES', // opens holding it, selected
3086
+ scope: selectedWatchlist, // a chip that limits the search to the watchlist, read as the picker opens
3084
3087
  onPick: (symbol) => form.setInstrument(symbol),
3085
3088
  })
3086
3089
  picker.close() // or the viewer closes it: the X, the scrim, Escape
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.10.0",
2
+ "version": "5.11.0",
3
3
  "styles": [
4
4
  {
5
5
  "id": "candles",
package/dist/index.d.ts CHANGED
@@ -6873,6 +6873,10 @@ interface SymbolSearchOptions extends MarkPainterHooks, SearchDisplayOptions {
6873
6873
  classes?: readonly (string | SearchClassNode)[] | null;
6874
6874
  /** Display names for those classes. A class without one wears its token. */
6875
6875
  classNames?: Readonly<Record<string, string>>;
6876
+ /** A part of the catalog the viewer can limit the search to, offered as a toggle chip at the far
6877
+ * edge of the class strip, as a chart's `search.scope` is. Read once as the search opens; null
6878
+ * offers none. */
6879
+ scope?: () => SearchScope | null;
6876
6880
  /** The query the field opens holding, selected so that typing replaces it. */
6877
6881
  query?: string;
6878
6882
  /** Called once the dialog is gone, however it went. */
package/dist/index.js CHANGED
@@ -32261,6 +32261,7 @@ function openSymbolSearch(options2) {
32261
32261
  classes: () => options2.classes ?? null,
32262
32262
  ...options2.classNames ? { classNames: options2.classNames } : {},
32263
32263
  display: searchDisplay(options2),
32264
+ ...options2.scope ? { scope: options2.scope } : {},
32264
32265
  painters: resolveMarkPainters(options2),
32265
32266
  request: {
32266
32267
  mode: "pick",
@@ -32296,6 +32297,7 @@ function mountSymbolSearch(options2) {
32296
32297
  classes: () => options2.classes ?? null,
32297
32298
  ...options2.classNames ? { classNames: options2.classNames } : {},
32298
32299
  display: searchDisplay(options2),
32300
+ ...options2.scope ? { scope: options2.scope } : {},
32299
32301
  painters: resolveMarkPainters(options2),
32300
32302
  request: {
32301
32303
  mode: "pick",