@trdrs/quickcharts 1.0.1 → 1.1.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 +4 -0
- package/README.md +9 -2
- package/dist/feature-manifest.json +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +35 -18
- package/dist/index.js.map +1 -1
- package/dist/quickcharts.css +26 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @trdrs/quickcharts
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
The symbol search can name what it is limited to, with a host-painted mark, beside the asset-class filters (`search.scope`, `SearchScope`).
|
|
6
|
+
|
|
3
7
|
## 1.0.1
|
|
4
8
|
|
|
5
9
|
Emoji drawings and the picker use bundled Twemoji artwork without a host asset server.
|
package/README.md
CHANGED
|
@@ -1280,18 +1280,25 @@ in `ui`; hiding one removes the control and leaves its commands.
|
|
|
1280
1280
|
```ts
|
|
1281
1281
|
import { createChart, createUdfDatafeed } from '@trdrs/quickcharts'
|
|
1282
1282
|
|
|
1283
|
+
declare const portfolio: { name: string } | null
|
|
1284
|
+
|
|
1283
1285
|
const trimmed = createChart({
|
|
1284
1286
|
container,
|
|
1285
1287
|
datafeed: createUdfDatafeed({ baseUrl: 'https://feed.example.com/udf' }),
|
|
1286
1288
|
ui: { navigation: false, topBar: { layouts: false, image: false } },
|
|
1287
|
-
search: {
|
|
1289
|
+
search: {
|
|
1290
|
+
classNames: { future: 'Futures', crypto: 'Crypto' },
|
|
1291
|
+
scope: () => (portfolio ? { label: portfolio.name } : null),
|
|
1292
|
+
},
|
|
1288
1293
|
preferences: { savedTimeframes: ['1m', '15m', '1h', '1d'], layoutAutosave: true },
|
|
1289
1294
|
})
|
|
1290
1295
|
trimmed.on('saveNeeded', () => note('the layout has unsaved changes'))
|
|
1291
1296
|
```
|
|
1292
1297
|
|
|
1293
1298
|
The search dialog's class chips come from your datafeed's `config().classes`, named through
|
|
1294
|
-
`search.classNames`; a class you do not name wears its token.
|
|
1299
|
+
`search.classNames`; a class you do not name wears its token. `search.scope` names what your
|
|
1300
|
+
search is limited to at the far edge of that strip, with the mark its `mark` paints; your datafeed
|
|
1301
|
+
decides what is found. The range presets read your
|
|
1295
1302
|
datafeed's optional `earliestBar(symbol)`: a preset deeper than the history you serve is disabled.
|
|
1296
1303
|
|
|
1297
1304
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -4638,6 +4638,16 @@ interface IndicatorInstance {
|
|
|
4638
4638
|
title?: string;
|
|
4639
4639
|
overrides?: IndicatorOverrides;
|
|
4640
4640
|
}
|
|
4641
|
+
/** The set of symbols a search answers from, as the host names it: a portfolio, a broker, a
|
|
4642
|
+
* watchlist or any other scope its datafeed applies. `mark` paints the scope's own mark into the
|
|
4643
|
+
* box the chart owns and returns what takes it down; absent, the scope wears its initial. */
|
|
4644
|
+
interface SearchScope {
|
|
4645
|
+
readonly label: string;
|
|
4646
|
+
readonly mark?: (request: {
|
|
4647
|
+
host: HTMLElement;
|
|
4648
|
+
size: number;
|
|
4649
|
+
}) => (() => void) | void;
|
|
4650
|
+
}
|
|
4641
4651
|
/** Everything needed to construct a widget. `container` and `datafeed` are the two hard
|
|
4642
4652
|
* requirements; every other field has a working default. */
|
|
4643
4653
|
interface ChartWidgetOptions extends MarkPainterHooks {
|
|
@@ -4710,6 +4720,10 @@ interface ChartWidgetOptions extends MarkPainterHooks {
|
|
|
4710
4720
|
recents?: RecentsPort;
|
|
4711
4721
|
/** Display names for the asset-class tokens the feed's `config()` declares in `classes`. */
|
|
4712
4722
|
classNames?: Readonly<Record<string, string>>;
|
|
4723
|
+
/** What the search is limited to, named at the far edge of the asset-class strip. Read each
|
|
4724
|
+
* time the dialog opens; null names nothing. It only labels the scope: your datafeed's
|
|
4725
|
+
* `searchSymbols` decides what is found. */
|
|
4726
|
+
scope?: () => SearchScope | null;
|
|
4713
4727
|
};
|
|
4714
4728
|
/** Where the image and glyph drawing tools get their artwork, and how a picked file becomes a
|
|
4715
4729
|
* usable payload. Emoji artwork is bundled. Absent, the image tool takes no file. */
|
|
@@ -5484,4 +5498,4 @@ declare function mountSymbolSearch(options: SymbolSearchOptions & {
|
|
|
5484
5498
|
container: HTMLElement;
|
|
5485
5499
|
}): MountedSymbolSearch;
|
|
5486
5500
|
|
|
5487
|
-
export { ARRANGEMENTS, type AccessPolicy, type ActiveSubsession, type Arrangement, type AttachDrawingsOptions, BRAND_DOWN, BRAND_UP, BUILT_IN_INDICATORS, BUILT_IN_LOCALES, type BarMark, type BarsEvent, type BuiltInIndicator, CHART_ICON_IDS, CHART_STYLES, COLLAPSED_H, COMPARE_COLORS, type CanvasTheme, type Capabilities, ChartBody, type ChartChrome, type ChartCompareApi, type ChartCustomLocale, type ChartDatafeed, type ChartDictionary, type ChartDrawingsApi, type ChartEvents, type ChartExtension, type ChartExtensionChart, type ChartExtensionCommand, type ChartExtensionContext, type ChartExtensionHandle, type ChartExtensionIcon, type ChartExtensionIconPath, type ChartExtensionMenuContext, type ChartExtensionMenuItem, type ChartExtensionMenuProvider, type ChartExtensionPane, type ChartExtensionPriceLine, type ChartExtensionReplayState, type ChartExtensionScope, type ChartExtensionSeries, type ChartHandle, type ChartHistoryApi, type ChartI18n, type ChartI18nOptions, type ChartIconContext, type ChartIconDiagnostic, type ChartIconFactory, type ChartIconFailure, type ChartIconId, type ChartIcons, type ChartLocale, type ChartLocaleCode, type ChartMenuAction, type ChartMenuContext, type ChartMenuIcon, type ChartMenuRow, ChartMessageKey, ChartMeta, type ChartOverrides, type ChartPaneSyncApi, type ChartPreferences, type ChartPriceFormatter, type ChartReplayApi, ChartSaveLoadAdapter, type ChartSaveLoadApi, type ChartStorage, type ChartStyleId, type ChartTimezone, type ChartTranslate, type ChartWidget, type ChartWidgetOptions, type CommandRegistry, type CommandResult, type CommandScope, type CommandSpec, type CompareDeps, type CompareEntry, type CompareHandle, type ComparePlacement, type CompareSnapshot, type CompareSymbol, type ContextMenuHandle, type CustomThemes, DEFAULT_OVERRIDES, DEFAULT_SUBSESSION, DEFAULT_TIMEZONE, type DataStatus, type DatafeedConfig, type DrawingApplyOutcome, DrawingAssetPort, DrawingContextKind, type DrawingDocumentApi, type DrawingDocumentPort, type DrawingDocumentRefusal, type DrawingEvent, type DrawingOwner, DrawingPreferences, type DrawingPresets, type DrawingReadOutcome, type DrawingRejection, type DrawingRejectionReason, DrawingResourceContext, DrawingsBody, type DrawingsEvents, type DrawingsHandle, DrawingsMeta, type DrawingsWorkflow, EXCHANGE_TIMEZONE, type FeatureConfig, type FeedBar, FeedUnavailableError, type FetchLike, FillBetweenPrimitive, type FullscreenApi, type FullscreenOptions, type HistoryChange, type HistoryEventState, type HistoryPage, IMAGE_HEADER_H, type ImageApi, type ImageEvent, type ImageHeader, type ImageOptions, type ImageTextRun, type ImageTile, type IndicatorCategory, type IndicatorDefinition, type IndicatorEvent, type IndicatorFill, type IndicatorInstance, type IndicatorLevel, type IndicatorManifest, type IndicatorOverrides, type IndicatorPickerAction, type IndicatorPickerBuiltInState, type IndicatorPickerCollection, type IndicatorPickerItem, type IndicatorPickerSource, type IndicatorPlot, type IndicatorPlots, type IndicatorsApi, type IndicatorsRenderer, LAYOUT_MENU_ROWS, type LayoutApi, LayoutBody, type LayoutEvent, LayoutMeta, type LayoutOptions, type LayoutSaveLoadApi, type LayoutSyncFlags, type LegendUi, type LogicalRange, MAIN_MIN_H, MIN_BAR_SPACING, MIRRORED_ICONS, type ManifestFill, type ManifestInput, type ManifestLevel, type ManifestPlot, type ManifestRun, type MarkColorRole, type MarkPainters, type MarkPlacement, type MarkShape, type MarketStatus, type MatchSegment, type MountedSymbolSearch, type NumericPunctuation, type OlderPageVerdict, type OpenResource, PRICE_SCALE_MODE, type PaneOp, type PanePlan, type PaneRect, type PaneState, type PartialOverrides, type PlacedImage, type PlotPoint, type PriceFormat, type PriceFormatter, type PriceFormatterOptions, type ProviderMarkPainter, RANGE_PRESETS, RECENT_SYMBOLS_CAP, REPLAY_SPEEDS, type RangeFrameTarget, type RangePreset, type RangeSpan, type RecentsPort, type ReplayEventState, type ReplaySpeed, type ResourceLoadOutcome, ResourceRef, type ResourceRemoveOutcome, type ResourceSaveOutcome, ResourceStore, SCALE_MODES, SCALE_MODE_OPTIONS, SCROLL_STEP_BARS, SESSION_DOT, SESSION_LABEL, SESSION_STATE_TITLE, SPREAD_OPERATORS, type SaveConflictInfo, type ScaleMode, type SearchController, type SearchControllerOptions, type SearchPage, type SearchState, type SelectedDrawing, type SemanticTheme, type SessionBandsPrimitive, type SessionModel, type SessionSchedule, type SessionSegment, type SessionSource, type SessionState, type SessionTimeline, type SettingsMenuUi, ShadePrimitive, type SpreadOperator, type SubscribeHandlers, type Subsession, type SubsessionId, type SubsessionSource, type SymbolInfo, type SymbolMarkPainter, type SymbolNames, type SymbolPriceFormat, type SymbolRow, type SymbolSearchCache, type SymbolSearchHandle, type SymbolSearchOptions, THEME_ROLES, TIMEFRAME_MAX, TIMEFRAME_PRESETS, TIMEFRAME_PRESET_TOKENS, TIMEFRAME_UNITS, TIMEFRAME_UNIT_NAME, TIMEFRAME_UNIT_SECONDS, TIMEZONES, TOP_BAR_SLOTS, TemplateBody, TemplateMeta, type TextEditSession, type ThemeChangeListener, type ThemeController, type ThemeControllerOptions, type ThemeDeclaration, type ThemeDiagnostic, type ThemeDiagnosticCode, type ThemeMode, type ThemeOptions, type ThemeRole, type ThemeRoleFamily, type ThemeRoleId, type ThemeRoleKind, type ThemeRootStyle, type TickBand, type TimeRange, type Timeframe, type TimeframeGroup, type TimeframeRestrictions, type TimeframeUnit, type TimescaleMark, type TimezoneRow, type ToolbarButton, type ToolbarButtonOptions, type ToolbarButtonState, type TopBarSlot, type TopBarUi, type UdfDatafeedOptions, type UdfSymbolResponse, type UiConfig, type VenueMarkPainter, type WidgetEvents, ZOOM_FACTOR, type ZoneClock, allowedTimeframes, applyBar, applyPlotOverrides, arrangementName, arrangementOf, attachCompare, attachDrawings, attachIndicators, autoIntervalFor, buildManifestPlots, canvasTheme, canvasToBlob, chartContextMenu, chartDictionaries, clipToWindow, coerceChartStyle, coerceScaleMode, compareTimeframes, composeFormingBar, composeImage, createChart, createChartI18n, createPriceFormatter, createSearchController, createSessionBands, createSymbolSearchCache, createThemeController, createUdfDatafeed, effectivePlotColor, exchangeTimezoneText, formatClock, formatDuration, formatTimeframe, frameRange, hasExtendedHours, imageFileName, imageHeaderRuns, imageLayoutHeaderRuns, imageTileRuns, indicatorHidden, isChartStyle, isCollapsed, isIntradayTimeframe, isSymbolPair, isTimezoneChoice, latestPlotValue, layerOverrides, looksLikeSpread, makeCrosshairTimeFormatter, makeTickMarkFormatter, manifestInputDefaults, marketStatus, marketStatusFor, marketStatusText, marketStatusTitle, matchSegments, memoryChartStorage, memoryRecents, mergeOverrides, mountContextMenu, mountSymbolSearch, nextSessionChange, olderPageVerdict, openInputsEditor, openSymbolSearch, overriddenManifest, parseSessionModel, parseTickBands, parseTimeframe, pickCompareColor, placeableByWidget, planPaneOp, promoteRecent, rangeAvailable, rangePresetTip, rangeSpanSeconds, resolveDisplayTimezone, resolveInitialTf, scrolledPosition, seriesTargetOf, sessionStateAt, sessionTimeline, spreadExpression, spreadSearchQuery, subIntervalsFor, subsessionBarFilter, symbolNames, tfSeconds, tfToUdfResolution, tickBandFor, timeframeAllowed, timeframeGroupUnit, timeframeLabel, timeframeOrder, timeframeSeconds, timezoneCity, timezoneLabel, timezoneListing, toolName, tzOffsetLabel, tzOffsetMinutes, udfPriceFormat, udfResolutionToTf, udfSymbolInfo, valueShaped, withFoldedHistory, zoneClock, zoomedBarSpacing };
|
|
5501
|
+
export { ARRANGEMENTS, type AccessPolicy, type ActiveSubsession, type Arrangement, type AttachDrawingsOptions, BRAND_DOWN, BRAND_UP, BUILT_IN_INDICATORS, BUILT_IN_LOCALES, type BarMark, type BarsEvent, type BuiltInIndicator, CHART_ICON_IDS, CHART_STYLES, COLLAPSED_H, COMPARE_COLORS, type CanvasTheme, type Capabilities, ChartBody, type ChartChrome, type ChartCompareApi, type ChartCustomLocale, type ChartDatafeed, type ChartDictionary, type ChartDrawingsApi, type ChartEvents, type ChartExtension, type ChartExtensionChart, type ChartExtensionCommand, type ChartExtensionContext, type ChartExtensionHandle, type ChartExtensionIcon, type ChartExtensionIconPath, type ChartExtensionMenuContext, type ChartExtensionMenuItem, type ChartExtensionMenuProvider, type ChartExtensionPane, type ChartExtensionPriceLine, type ChartExtensionReplayState, type ChartExtensionScope, type ChartExtensionSeries, type ChartHandle, type ChartHistoryApi, type ChartI18n, type ChartI18nOptions, type ChartIconContext, type ChartIconDiagnostic, type ChartIconFactory, type ChartIconFailure, type ChartIconId, type ChartIcons, type ChartLocale, type ChartLocaleCode, type ChartMenuAction, type ChartMenuContext, type ChartMenuIcon, type ChartMenuRow, ChartMessageKey, ChartMeta, type ChartOverrides, type ChartPaneSyncApi, type ChartPreferences, type ChartPriceFormatter, type ChartReplayApi, ChartSaveLoadAdapter, type ChartSaveLoadApi, type ChartStorage, type ChartStyleId, type ChartTimezone, type ChartTranslate, type ChartWidget, type ChartWidgetOptions, type CommandRegistry, type CommandResult, type CommandScope, type CommandSpec, type CompareDeps, type CompareEntry, type CompareHandle, type ComparePlacement, type CompareSnapshot, type CompareSymbol, type ContextMenuHandle, type CustomThemes, DEFAULT_OVERRIDES, DEFAULT_SUBSESSION, DEFAULT_TIMEZONE, type DataStatus, type DatafeedConfig, type DrawingApplyOutcome, DrawingAssetPort, DrawingContextKind, type DrawingDocumentApi, type DrawingDocumentPort, type DrawingDocumentRefusal, type DrawingEvent, type DrawingOwner, DrawingPreferences, type DrawingPresets, type DrawingReadOutcome, type DrawingRejection, type DrawingRejectionReason, DrawingResourceContext, DrawingsBody, type DrawingsEvents, type DrawingsHandle, DrawingsMeta, type DrawingsWorkflow, EXCHANGE_TIMEZONE, type FeatureConfig, type FeedBar, FeedUnavailableError, type FetchLike, FillBetweenPrimitive, type FullscreenApi, type FullscreenOptions, type HistoryChange, type HistoryEventState, type HistoryPage, IMAGE_HEADER_H, type ImageApi, type ImageEvent, type ImageHeader, type ImageOptions, type ImageTextRun, type ImageTile, type IndicatorCategory, type IndicatorDefinition, type IndicatorEvent, type IndicatorFill, type IndicatorInstance, type IndicatorLevel, type IndicatorManifest, type IndicatorOverrides, type IndicatorPickerAction, type IndicatorPickerBuiltInState, type IndicatorPickerCollection, type IndicatorPickerItem, type IndicatorPickerSource, type IndicatorPlot, type IndicatorPlots, type IndicatorsApi, type IndicatorsRenderer, LAYOUT_MENU_ROWS, type LayoutApi, LayoutBody, type LayoutEvent, LayoutMeta, type LayoutOptions, type LayoutSaveLoadApi, type LayoutSyncFlags, type LegendUi, type LogicalRange, MAIN_MIN_H, MIN_BAR_SPACING, MIRRORED_ICONS, type ManifestFill, type ManifestInput, type ManifestLevel, type ManifestPlot, type ManifestRun, type MarkColorRole, type MarkPainters, type MarkPlacement, type MarkShape, type MarketStatus, type MatchSegment, type MountedSymbolSearch, type NumericPunctuation, type OlderPageVerdict, type OpenResource, PRICE_SCALE_MODE, type PaneOp, type PanePlan, type PaneRect, type PaneState, type PartialOverrides, type PlacedImage, type PlotPoint, type PriceFormat, type PriceFormatter, type PriceFormatterOptions, type ProviderMarkPainter, RANGE_PRESETS, RECENT_SYMBOLS_CAP, REPLAY_SPEEDS, type RangeFrameTarget, type RangePreset, type RangeSpan, type RecentsPort, type ReplayEventState, type ReplaySpeed, type ResourceLoadOutcome, ResourceRef, type ResourceRemoveOutcome, type ResourceSaveOutcome, ResourceStore, SCALE_MODES, SCALE_MODE_OPTIONS, SCROLL_STEP_BARS, SESSION_DOT, SESSION_LABEL, SESSION_STATE_TITLE, SPREAD_OPERATORS, type SaveConflictInfo, type ScaleMode, type SearchController, type SearchControllerOptions, type SearchPage, type SearchScope, type SearchState, type SelectedDrawing, type SemanticTheme, type SessionBandsPrimitive, type SessionModel, type SessionSchedule, type SessionSegment, type SessionSource, type SessionState, type SessionTimeline, type SettingsMenuUi, ShadePrimitive, type SpreadOperator, type SubscribeHandlers, type Subsession, type SubsessionId, type SubsessionSource, type SymbolInfo, type SymbolMarkPainter, type SymbolNames, type SymbolPriceFormat, type SymbolRow, type SymbolSearchCache, type SymbolSearchHandle, type SymbolSearchOptions, THEME_ROLES, TIMEFRAME_MAX, TIMEFRAME_PRESETS, TIMEFRAME_PRESET_TOKENS, TIMEFRAME_UNITS, TIMEFRAME_UNIT_NAME, TIMEFRAME_UNIT_SECONDS, TIMEZONES, TOP_BAR_SLOTS, TemplateBody, TemplateMeta, type TextEditSession, type ThemeChangeListener, type ThemeController, type ThemeControllerOptions, type ThemeDeclaration, type ThemeDiagnostic, type ThemeDiagnosticCode, type ThemeMode, type ThemeOptions, type ThemeRole, type ThemeRoleFamily, type ThemeRoleId, type ThemeRoleKind, type ThemeRootStyle, type TickBand, type TimeRange, type Timeframe, type TimeframeGroup, type TimeframeRestrictions, type TimeframeUnit, type TimescaleMark, type TimezoneRow, type ToolbarButton, type ToolbarButtonOptions, type ToolbarButtonState, type TopBarSlot, type TopBarUi, type UdfDatafeedOptions, type UdfSymbolResponse, type UiConfig, type VenueMarkPainter, type WidgetEvents, ZOOM_FACTOR, type ZoneClock, allowedTimeframes, applyBar, applyPlotOverrides, arrangementName, arrangementOf, attachCompare, attachDrawings, attachIndicators, autoIntervalFor, buildManifestPlots, canvasTheme, canvasToBlob, chartContextMenu, chartDictionaries, clipToWindow, coerceChartStyle, coerceScaleMode, compareTimeframes, composeFormingBar, composeImage, createChart, createChartI18n, createPriceFormatter, createSearchController, createSessionBands, createSymbolSearchCache, createThemeController, createUdfDatafeed, effectivePlotColor, exchangeTimezoneText, formatClock, formatDuration, formatTimeframe, frameRange, hasExtendedHours, imageFileName, imageHeaderRuns, imageLayoutHeaderRuns, imageTileRuns, indicatorHidden, isChartStyle, isCollapsed, isIntradayTimeframe, isSymbolPair, isTimezoneChoice, latestPlotValue, layerOverrides, looksLikeSpread, makeCrosshairTimeFormatter, makeTickMarkFormatter, manifestInputDefaults, marketStatus, marketStatusFor, marketStatusText, marketStatusTitle, matchSegments, memoryChartStorage, memoryRecents, mergeOverrides, mountContextMenu, mountSymbolSearch, nextSessionChange, olderPageVerdict, openInputsEditor, openSymbolSearch, overriddenManifest, parseSessionModel, parseTickBands, parseTimeframe, pickCompareColor, placeableByWidget, planPaneOp, promoteRecent, rangeAvailable, rangePresetTip, rangeSpanSeconds, resolveDisplayTimezone, resolveInitialTf, scrolledPosition, seriesTargetOf, sessionStateAt, sessionTimeline, spreadExpression, spreadSearchQuery, subIntervalsFor, subsessionBarFilter, symbolNames, tfSeconds, tfToUdfResolution, tickBandFor, timeframeAllowed, timeframeGroupUnit, timeframeLabel, timeframeOrder, timeframeSeconds, timezoneCity, timezoneLabel, timezoneListing, toolName, tzOffsetLabel, tzOffsetMinutes, udfPriceFormat, udfResolutionToTf, udfSymbolInfo, valueShaped, withFoldedHistory, zoneClock, zoomedBarSpacing };
|
package/dist/index.js
CHANGED
|
@@ -20909,6 +20909,7 @@ function buildSearchSurface(deps, box, frame) {
|
|
|
20909
20909
|
markDisposers = [];
|
|
20910
20910
|
for (const drop of drops) drop();
|
|
20911
20911
|
};
|
|
20912
|
+
let scopeMarkDisposer = null;
|
|
20912
20913
|
const input = h("input", { type: "text", role: "combobox", class: "qc-search-input", "aria-label": t("search.placeholder"), placeholder: t("search.placeholder"), autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": "true", "aria-controls": listId, spellcheck: "false", value: query });
|
|
20913
20914
|
const clear = button2({ label: t("search.clear"), icon: deps.icons.glyph(ICONS.clear, { size: 18 }), className: "qc-search-op", onClick: () => setQuery("") });
|
|
20914
20915
|
const rule = compare ? null : h("span", { class: "qc-search-rule", "aria-hidden": "true" });
|
|
@@ -20948,25 +20949,37 @@ function buildSearchSurface(deps, box, frame) {
|
|
|
20948
20949
|
const classes = compare ? null : deps.classes();
|
|
20949
20950
|
let strip = null;
|
|
20950
20951
|
const classChips = /* @__PURE__ */ new Map();
|
|
20951
|
-
|
|
20952
|
+
const searchScope = deps.scope?.() ?? null;
|
|
20953
|
+
if (classes && classes.length > 0 || searchScope) {
|
|
20952
20954
|
strip = h("div", { class: "qc-search-classes", role: "group", "aria-label": t("search.classFilter") });
|
|
20953
|
-
|
|
20954
|
-
|
|
20955
|
-
const
|
|
20956
|
-
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20955
|
+
if (classes && classes.length > 0) {
|
|
20956
|
+
const all = [{ id: "", label: t("search.allClasses") }, ...classes.map((id) => ({ id, label: deps.classNames?.[id] ?? id }))];
|
|
20957
|
+
for (const c of all) {
|
|
20958
|
+
const chip = button2({
|
|
20959
|
+
label: c.label,
|
|
20960
|
+
text: c.label,
|
|
20961
|
+
className: "qc-chip qc-search-class",
|
|
20962
|
+
pressed: c.id === cls,
|
|
20963
|
+
onClick: () => {
|
|
20964
|
+
cls = c.id;
|
|
20965
|
+
for (const [id, b] of classChips) b.setAttribute("aria-pressed", String(id === cls));
|
|
20966
|
+
active = -1;
|
|
20967
|
+
search2.search(serverQuery(), cls);
|
|
20968
|
+
render();
|
|
20969
|
+
}
|
|
20970
|
+
});
|
|
20971
|
+
classChips.set(c.id, chip);
|
|
20972
|
+
strip.appendChild(chip);
|
|
20973
|
+
}
|
|
20974
|
+
}
|
|
20975
|
+
if (searchScope) {
|
|
20976
|
+
const mark = h("span", { class: "qc-search-scope-mark", "aria-hidden": "true" });
|
|
20977
|
+
const drop = searchScope.mark?.({ host: mark, size: SOURCE_MARK_SIZE });
|
|
20978
|
+
if (typeof drop === "function") {
|
|
20979
|
+
mark.dataset.qcHost = "true";
|
|
20980
|
+
scopeMarkDisposer = drop;
|
|
20981
|
+
} else if (mark.childNodes.length === 0) mark.textContent = searchScope.label.charAt(0).toUpperCase();
|
|
20982
|
+
strip.appendChild(h("span", { class: "qc-search-scope", "aria-label": searchScope.label }, mark, h("span", {}, searchScope.label)));
|
|
20970
20983
|
}
|
|
20971
20984
|
}
|
|
20972
20985
|
const list = h("div", { class: "qc-search-list", role: "listbox", id: listId, "aria-label": t("search.results") });
|
|
@@ -21135,6 +21148,8 @@ function buildSearchSurface(deps, box, frame) {
|
|
|
21135
21148
|
setDisabled(clear, false);
|
|
21136
21149
|
return {
|
|
21137
21150
|
teardown() {
|
|
21151
|
+
scopeMarkDisposer?.();
|
|
21152
|
+
scopeMarkDisposer = null;
|
|
21138
21153
|
releaseMarks();
|
|
21139
21154
|
search2.dispose();
|
|
21140
21155
|
observer?.disconnect();
|
|
@@ -23138,6 +23153,7 @@ function mountChrome(deps) {
|
|
|
23138
23153
|
recents: widget.recents,
|
|
23139
23154
|
classes: () => deps.feedConfig()?.classes ?? null,
|
|
23140
23155
|
classNames: deps.classNames,
|
|
23156
|
+
scope: deps.scope,
|
|
23141
23157
|
painters: deps.painters,
|
|
23142
23158
|
curated: request.chart?.compare.symbols() ?? [],
|
|
23143
23159
|
request
|
|
@@ -23783,6 +23799,7 @@ function createChart(options) {
|
|
|
23783
23799
|
datafeed: options.datafeed,
|
|
23784
23800
|
feedConfig: () => feedConfig,
|
|
23785
23801
|
classNames: options.search?.classNames,
|
|
23802
|
+
scope: options.search?.scope,
|
|
23786
23803
|
painters,
|
|
23787
23804
|
indicatorPicker: options.indicatorPicker,
|
|
23788
23805
|
access: options.access,
|