@funnest/charts-ui 0.10.0 → 0.10.2
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/dist/i18n.d.ts +10 -0
- package/dist/index.js +174 -24
- package/package.json +2 -2
package/dist/i18n.d.ts
CHANGED
|
@@ -200,6 +200,11 @@ export declare const STRINGS: {
|
|
|
200
200
|
saveDefaults: string;
|
|
201
201
|
forgetDefaults: string;
|
|
202
202
|
ok: string;
|
|
203
|
+
moreToolsUp: string;
|
|
204
|
+
moreToolsDown: string;
|
|
205
|
+
lockView: string;
|
|
206
|
+
unlockView: string;
|
|
207
|
+
lockRatio: string;
|
|
203
208
|
levelValuesLabel: string;
|
|
204
209
|
note: string;
|
|
205
210
|
noteText: string;
|
|
@@ -484,6 +489,11 @@ export declare const STRINGS: {
|
|
|
484
489
|
saveDefaults: string;
|
|
485
490
|
forgetDefaults: string;
|
|
486
491
|
ok: string;
|
|
492
|
+
moreToolsUp: string;
|
|
493
|
+
moreToolsDown: string;
|
|
494
|
+
lockView: string;
|
|
495
|
+
unlockView: string;
|
|
496
|
+
lockRatio: string;
|
|
487
497
|
levelValuesLabel: string;
|
|
488
498
|
note: string;
|
|
489
499
|
noteText: string;
|
package/dist/index.js
CHANGED
|
@@ -629,6 +629,11 @@ var STRINGS = {
|
|
|
629
629
|
saveDefaults: "\uAE30\uBCF8\uAC12\uC73C\uB85C \uC800\uC7A5",
|
|
630
630
|
forgetDefaults: "\uC800\uC7A5\uD55C \uAE30\uBCF8\uAC12 \uC9C0\uC6B0\uAE30",
|
|
631
631
|
ok: "\uD655\uC778",
|
|
632
|
+
moreToolsUp: "\uC704 \uB3C4\uAD6C \uB354 \uBCF4\uAE30",
|
|
633
|
+
moreToolsDown: "\uC544\uB798 \uB3C4\uAD6C \uB354 \uBCF4\uAE30",
|
|
634
|
+
lockView: "\uCC28\uD2B8 \uACE0\uC815",
|
|
635
|
+
unlockView: "\uCC28\uD2B8 \uACE0\uC815 \uD480\uAE30",
|
|
636
|
+
lockRatio: "\uAC00\uACA9 \uCD95 \uBE44\uC728 \uACE0\uC815",
|
|
632
637
|
levelValuesLabel: "\uAE30\uC900\uC120 \uAC12",
|
|
633
638
|
note: "\uD14D\uC2A4\uD2B8",
|
|
634
639
|
noteText: "\uD14D\uC2A4\uD2B8 \uC785\uB825",
|
|
@@ -915,6 +920,11 @@ var STRINGS = {
|
|
|
915
920
|
saveDefaults: "Save as default",
|
|
916
921
|
forgetDefaults: "Forget saved default",
|
|
917
922
|
ok: "Ok",
|
|
923
|
+
moreToolsUp: "More tools above",
|
|
924
|
+
moreToolsDown: "More tools below",
|
|
925
|
+
lockView: "Lock chart",
|
|
926
|
+
unlockView: "Unlock chart",
|
|
927
|
+
lockRatio: "Lock price to bar ratio",
|
|
918
928
|
levelValuesLabel: "Level values",
|
|
919
929
|
note: "Text",
|
|
920
930
|
noteText: "Type text",
|
|
@@ -1506,20 +1516,31 @@ function DrawingToolbar({ ctx }) {
|
|
|
1506
1516
|
const t3 = stringsOf(s3);
|
|
1507
1517
|
const [openGroup, setOpenGroup] = d2(null);
|
|
1508
1518
|
const barRef = T2(null);
|
|
1519
|
+
const [more, setMore] = d2({ up: false, down: false });
|
|
1520
|
+
const checkMore = () => {
|
|
1521
|
+
const el = barRef.current;
|
|
1522
|
+
if (!el) return;
|
|
1523
|
+
const scrolls = el.dataset.fit === "scroll";
|
|
1524
|
+
const next = { up: scrolls && el.scrollTop > 2, down: scrolls && el.scrollTop + el.clientHeight < el.scrollHeight - 2 };
|
|
1525
|
+
setMore((m3) => m3.up === next.up && m3.down === next.down ? m3 : next);
|
|
1526
|
+
};
|
|
1509
1527
|
F2(() => {
|
|
1510
1528
|
const el = barRef.current;
|
|
1511
1529
|
if (!el) return;
|
|
1512
1530
|
const fit2 = () => {
|
|
1513
1531
|
el.removeAttribute("data-fit");
|
|
1514
|
-
if (el.scrollHeight
|
|
1515
|
-
|
|
1516
|
-
|
|
1532
|
+
if (el.scrollHeight > el.clientHeight) {
|
|
1533
|
+
el.dataset.fit = "compact";
|
|
1534
|
+
if (el.scrollHeight > el.clientHeight) el.dataset.fit = "scroll";
|
|
1535
|
+
}
|
|
1536
|
+
checkMore();
|
|
1517
1537
|
};
|
|
1518
1538
|
fit2();
|
|
1519
1539
|
const ro = new ResizeObserver(fit2);
|
|
1520
1540
|
ro.observe(el);
|
|
1521
1541
|
return () => ro.disconnect();
|
|
1522
1542
|
}, []);
|
|
1543
|
+
const scrollBar = (by) => barRef.current?.scrollBy({ top: by, behavior: "smooth" });
|
|
1523
1544
|
const defs = ctx.chart.drawingDefinitions();
|
|
1524
1545
|
const groups = toolGroups(defs);
|
|
1525
1546
|
const favorites = s3.favoriteTools.map((type) => defs.find((d3) => d3.type === type)).filter((d3) => !!d3);
|
|
@@ -1541,7 +1562,9 @@ function DrawingToolbar({ ctx }) {
|
|
|
1541
1562
|
"aria-orientation": "vertical",
|
|
1542
1563
|
"data-open": s3.drawbarOpen,
|
|
1543
1564
|
"data-collapsed": s3.drawbarCollapsed,
|
|
1565
|
+
onScroll: checkMore,
|
|
1544
1566
|
children: [
|
|
1567
|
+
more.up && /* @__PURE__ */ a3("button", { class: "fnc-drawbar-more is-up", "aria-label": t3.moreToolsUp, onClick: () => scrollBar(-160), children: /* @__PURE__ */ a3(ChevronUpIcon, {}) }),
|
|
1545
1568
|
/* @__PURE__ */ a3(CursorGroup, { ctx, open: openGroup === "__cursor", onOpen: (open) => setOpenGroup(open ? "__cursor" : null), onPick: () => pick(null) }),
|
|
1546
1569
|
favorites.length > 0 && /* @__PURE__ */ a3($, { children: [
|
|
1547
1570
|
favorites.map((def) => /* @__PURE__ */ a3(
|
|
@@ -1627,7 +1650,8 @@ function DrawingToolbar({ ctx }) {
|
|
|
1627
1650
|
onClick: () => ctx.setDrawbarCollapsed(true),
|
|
1628
1651
|
children: /* @__PURE__ */ a3(ChevronLeftIcon, {})
|
|
1629
1652
|
}
|
|
1630
|
-
)
|
|
1653
|
+
),
|
|
1654
|
+
more.down && /* @__PURE__ */ a3("button", { class: "fnc-drawbar-more is-down", "aria-label": t3.moreToolsDown, onClick: () => scrollBar(160), children: /* @__PURE__ */ a3(ChevronDownIcon, {}) })
|
|
1631
1655
|
]
|
|
1632
1656
|
}
|
|
1633
1657
|
)
|
|
@@ -2855,7 +2879,9 @@ var SECTIONS = [
|
|
|
2855
2879
|
{ key: "extendedPriceLine", label: "settingExtendedPrice" },
|
|
2856
2880
|
{ key: "volume", label: "settingVolume" },
|
|
2857
2881
|
{ key: "navigationButtons", label: "settingNavButtons" },
|
|
2858
|
-
{ key: "smoothScroll", label: "smoothScroll" }
|
|
2882
|
+
{ key: "smoothScroll", label: "smoothScroll" },
|
|
2883
|
+
{ key: "lockView", label: "lockView" },
|
|
2884
|
+
{ key: "lockRatio", label: "lockRatio" }
|
|
2859
2885
|
]
|
|
2860
2886
|
},
|
|
2861
2887
|
{
|
|
@@ -4054,12 +4080,14 @@ function ContextMenu({ ctx }) {
|
|
|
4054
4080
|
onSelect: () => ctx.chart.addDrawing({ type: "horizontal", points: [{ time, price }] })
|
|
4055
4081
|
});
|
|
4056
4082
|
}
|
|
4057
|
-
const smooth = ctx.chart.settings
|
|
4083
|
+
const { smoothScroll: smooth, lockView, lockRatio } = ctx.chart.settings;
|
|
4058
4084
|
items.push(
|
|
4059
4085
|
{ label: t3.goToDateMore, onSelect: () => ctx.store.set({ dialog: { kind: "goToDate" } }) },
|
|
4060
4086
|
{ label: t3.smoothScroll, checked: smooth, onSelect: () => ctx.chart.setSettings({ smoothScroll: !smooth }) },
|
|
4087
|
+
{ label: t3.lockView, checked: lockView, onSelect: () => ctx.chart.setSettings({ lockView: !lockView }) },
|
|
4088
|
+
{ label: t3.lockRatio, checked: lockRatio, onSelect: () => ctx.chart.setSettings({ lockRatio: !lockRatio }) },
|
|
4061
4089
|
"separator",
|
|
4062
|
-
{ label: t3.resetChart, onSelect: () => ctx.chart.resetView() },
|
|
4090
|
+
{ label: t3.resetChart, disabled: lockView, onSelect: () => ctx.chart.resetView() },
|
|
4063
4091
|
{ label: t3.chartSettingsMore, onSelect: () => ctx.store.set({ dialog: { kind: "chartSettings" } }) }
|
|
4064
4092
|
);
|
|
4065
4093
|
return /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-ctx-menu", role: "menu", ref, onContextMenu: (e3) => e3.preventDefault(), children: items.map(
|
|
@@ -4170,7 +4198,7 @@ function PriceAxisPlus({ ctx }) {
|
|
|
4170
4198
|
var ZOOM_STEP = 1.25;
|
|
4171
4199
|
var CONTROL_OFFSET = 52;
|
|
4172
4200
|
var dirClass = (v3) => v3 > 0 ? "fnc-up" : v3 < 0 ? "fnc-down" : "fnc-flat";
|
|
4173
|
-
function IndicatorItem({ ctx, item }) {
|
|
4201
|
+
function IndicatorItem({ ctx, item, values = true }) {
|
|
4174
4202
|
const t3 = stringsOf(ctx.store.get());
|
|
4175
4203
|
return /* @__PURE__ */ a3(
|
|
4176
4204
|
"div",
|
|
@@ -4200,7 +4228,7 @@ function IndicatorItem({ ctx, item }) {
|
|
|
4200
4228
|
}
|
|
4201
4229
|
),
|
|
4202
4230
|
/* @__PURE__ */ a3("span", { class: "fnc-ind-title", children: item.title }),
|
|
4203
|
-
item.visible && item.values.map((v3) => /* @__PURE__ */ a3("b", { style: { color: v3.color }, "data-tip": v3.label, children: v3.value })),
|
|
4231
|
+
values && item.visible && item.values.map((v3) => /* @__PURE__ */ a3("b", { style: { color: v3.color }, "data-tip": v3.label, children: v3.value })),
|
|
4204
4232
|
/* @__PURE__ */ a3("span", { class: "fnc-ind-actions", children: [
|
|
4205
4233
|
ctx.chart.canMoveIndicator(item.id, -1) && /* @__PURE__ */ a3("button", { class: "fnc-ind-btn", "data-tip": t3.moveIndicatorUp, "aria-label": `${item.title} ${t3.moveIndicatorUp}`, onClick: (e3) => {
|
|
4206
4234
|
e3.stopPropagation();
|
|
@@ -4310,10 +4338,13 @@ function Legend({ ctx }) {
|
|
|
4310
4338
|
return () => offs.forEach((off) => off());
|
|
4311
4339
|
}, [ctx.chart]);
|
|
4312
4340
|
const ref = T2(null);
|
|
4341
|
+
const tracking = T2(false);
|
|
4342
|
+
tracking.current = ctx.legendValues === "crosshair" && !!hover;
|
|
4313
4343
|
A2(() => {
|
|
4314
4344
|
const el = ref.current;
|
|
4315
4345
|
if (!el) return;
|
|
4316
4346
|
const update = () => {
|
|
4347
|
+
if (tracking.current) return;
|
|
4317
4348
|
const floating = ctx.legendValues === "crosshair" ? el.querySelector(".fnc-legend-values") : null;
|
|
4318
4349
|
ctx.chart.setTopInset(el.offsetTop + el.offsetHeight - (floating ? floating.offsetHeight + 2 : 0) + 4);
|
|
4319
4350
|
};
|
|
@@ -4369,11 +4400,12 @@ function Legend({ ctx }) {
|
|
|
4369
4400
|
] });
|
|
4370
4401
|
}
|
|
4371
4402
|
const items = s3.indicators.length ? ctx.chart.indicatorLegend(hover?.index) : [];
|
|
4403
|
+
const showValues = ctx.legendValues === "always" || !!hover;
|
|
4372
4404
|
const overlayItems = items.filter((i3) => i3.overlay);
|
|
4373
4405
|
const paneLegends = s3.layout.panes.filter((p3) => p3.kind === "indicator").map((pane) => ({ pane, item: items.find((i3) => i3.id === pane.id), kids: items.filter((i3) => i3.parent === pane.id) }));
|
|
4374
4406
|
const volumePane = s3.layout.panes.find((p3) => p3.kind === "volume");
|
|
4375
4407
|
return /* @__PURE__ */ a3($, { children: [
|
|
4376
|
-
/* @__PURE__ */ a3("div", { class: "fnc-legend", ref, children: [
|
|
4408
|
+
/* @__PURE__ */ a3("div", { class: tracking.current ? "fnc-legend is-tracking" : "fnc-legend", ref, children: [
|
|
4377
4409
|
/* @__PURE__ */ a3("div", { class: "fnc-legend-title", children: [
|
|
4378
4410
|
ctx.showLogo && /* @__PURE__ */ a3(SymbolAvatar, { info: s3.symbol, size: 18 }),
|
|
4379
4411
|
/* @__PURE__ */ a3("b", { children: s3.symbol.name }),
|
|
@@ -4399,15 +4431,15 @@ function Legend({ ctx }) {
|
|
|
4399
4431
|
}
|
|
4400
4432
|
)
|
|
4401
4433
|
] })),
|
|
4402
|
-
!collapsed && overlayItems.map((item) => /* @__PURE__ */ a3(IndicatorItem, { ctx, item })),
|
|
4434
|
+
!collapsed && overlayItems.map((item) => /* @__PURE__ */ a3(IndicatorItem, { ctx, item, values: showValues })),
|
|
4403
4435
|
!collapsed && s3.legendItems.map((item) => /* @__PURE__ */ a3(AppItem, { ctx, item })),
|
|
4404
4436
|
overlayItems.length + s3.legendItems.length > 0 && (collapsed ? /* @__PURE__ */ a3("button", { class: "fnc-ind-handle", "aria-expanded": "false", "aria-label": t3.expand, "data-tip": t3.expand, onClick: () => setCollapsed(false), children: /* @__PURE__ */ a3("span", {}) }) : /* @__PURE__ */ a3("button", { class: "fnc-ind-collapse", "aria-expanded": "true", "aria-label": t3.collapse, "data-tip": t3.collapse, onClick: () => setCollapsed(true), children: /* @__PURE__ */ a3(ChevronUpIcon, {}) }))
|
|
4405
4437
|
] }),
|
|
4406
4438
|
volumePane && /* @__PURE__ */ a3("div", { class: "fnc-legend fnc-pane-legend", style: { top: `${volumePane.top + 4}px` }, children: /* @__PURE__ */ a3(VolumeItem, { ctx, value: bar?.volume !== void 0 ? formatCompact(bar.volume, s3.locale) : null }) }),
|
|
4407
4439
|
paneLegends.map(
|
|
4408
|
-
({ pane, item, kids }) => item && /* @__PURE__ */ a3("div", { class: "fnc-legend fnc-pane-legend", style: { top: `${pane.top + 4}px` }, children: [
|
|
4409
|
-
/* @__PURE__ */ a3(IndicatorItem, { ctx, item }),
|
|
4410
|
-
kids.map((kid) => /* @__PURE__ */ a3(IndicatorItem, { ctx, item: kid }))
|
|
4440
|
+
({ pane, item, kids }) => item && /* @__PURE__ */ a3("div", { class: tracking.current ? "fnc-legend fnc-pane-legend is-tracking" : "fnc-legend fnc-pane-legend", style: { top: `${pane.top + 4}px` }, children: [
|
|
4441
|
+
/* @__PURE__ */ a3(IndicatorItem, { ctx, item, values: showValues }),
|
|
4442
|
+
kids.map((kid) => /* @__PURE__ */ a3(IndicatorItem, { ctx, item: kid, values: showValues }))
|
|
4411
4443
|
] })
|
|
4412
4444
|
)
|
|
4413
4445
|
] });
|
|
@@ -4416,7 +4448,14 @@ function NavControls({ ctx }) {
|
|
|
4416
4448
|
const s3 = useStore(ctx.store);
|
|
4417
4449
|
const t3 = stringsOf(s3);
|
|
4418
4450
|
const [showButtons, setShowButtons] = d2(ctx.chart.settings.navigationButtons);
|
|
4419
|
-
|
|
4451
|
+
const [locked, setLocked] = d2(ctx.chart.settings.lockView);
|
|
4452
|
+
A2(
|
|
4453
|
+
() => ctx.chart.on("settingsChange", (settings) => {
|
|
4454
|
+
setShowButtons(settings.navigationButtons);
|
|
4455
|
+
setLocked(settings.lockView);
|
|
4456
|
+
}),
|
|
4457
|
+
[ctx.chart]
|
|
4458
|
+
);
|
|
4420
4459
|
const { plotWidth, panesHeight } = s3.layout;
|
|
4421
4460
|
if (plotWidth <= 0) return null;
|
|
4422
4461
|
const top = panesHeight - CONTROL_OFFSET;
|
|
@@ -4424,12 +4463,23 @@ function NavControls({ ctx }) {
|
|
|
4424
4463
|
const button = (label, onClick, icon) => /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": label, "aria-label": label, onClick, children: icon });
|
|
4425
4464
|
const replaying = s3.replay.active || s3.replay.selecting;
|
|
4426
4465
|
return /* @__PURE__ */ a3($, { children: [
|
|
4427
|
-
showButtons && !replaying && /* @__PURE__ */ a3("div", { class: "fnc-nav", style: { left: `${plotWidth / 2}px`, top: `${top}px` }, children: [
|
|
4428
|
-
button(t3.zoomOut, () => ctx.chart.zoom(1 / ZOOM_STEP), /* @__PURE__ */ a3(MinusIcon, {})),
|
|
4429
|
-
button(t3.zoomIn, () => ctx.chart.zoom(ZOOM_STEP), /* @__PURE__ */ a3(PlusIcon, {})),
|
|
4430
|
-
button(t3.scrollBack, () => ctx.chart.scrollBars(-page()), /* @__PURE__ */ a3(ChevronLeftIcon, {})),
|
|
4431
|
-
button(t3.scrollForward, () => ctx.chart.scrollBars(page()), /* @__PURE__ */ a3(ChevronRightIcon, {})),
|
|
4432
|
-
button(t3.resetView, () => ctx.chart.resetView(), /* @__PURE__ */ a3(ResetIcon, {}))
|
|
4466
|
+
(showButtons || locked) && !replaying && /* @__PURE__ */ a3("div", { class: locked ? "fnc-nav fnc-nav-locked" : "fnc-nav", style: { left: `${plotWidth / 2}px`, top: `${top}px` }, children: [
|
|
4467
|
+
!locked && button(t3.zoomOut, () => ctx.chart.zoom(1 / ZOOM_STEP), /* @__PURE__ */ a3(MinusIcon, {})),
|
|
4468
|
+
!locked && button(t3.zoomIn, () => ctx.chart.zoom(ZOOM_STEP), /* @__PURE__ */ a3(PlusIcon, {})),
|
|
4469
|
+
!locked && button(t3.scrollBack, () => ctx.chart.scrollBars(-page()), /* @__PURE__ */ a3(ChevronLeftIcon, {})),
|
|
4470
|
+
!locked && button(t3.scrollForward, () => ctx.chart.scrollBars(page()), /* @__PURE__ */ a3(ChevronRightIcon, {})),
|
|
4471
|
+
!locked && button(t3.resetView, () => ctx.chart.resetView(), /* @__PURE__ */ a3(ResetIcon, {})),
|
|
4472
|
+
/* @__PURE__ */ a3(
|
|
4473
|
+
"button",
|
|
4474
|
+
{
|
|
4475
|
+
class: locked ? "fnc-btn fnc-btn-on" : "fnc-btn",
|
|
4476
|
+
"data-tip": locked ? t3.unlockView : t3.lockView,
|
|
4477
|
+
"aria-label": locked ? t3.unlockView : t3.lockView,
|
|
4478
|
+
"aria-pressed": locked,
|
|
4479
|
+
onClick: () => ctx.chart.setSettings({ lockView: !locked }),
|
|
4480
|
+
children: /* @__PURE__ */ a3(LockIcon, { open: !locked })
|
|
4481
|
+
}
|
|
4482
|
+
)
|
|
4433
4483
|
] }),
|
|
4434
4484
|
!s3.atRealtime && /* @__PURE__ */ a3(
|
|
4435
4485
|
"button",
|
|
@@ -4838,6 +4888,22 @@ var CSS = (
|
|
|
4838
4888
|
.fnc-drawbar[data-fit] .fnc-hsep { margin: 2px 0; }
|
|
4839
4889
|
.fnc-drawbar[data-fit='scroll'] { overflow-y: auto; scrollbar-width: none; }
|
|
4840
4890
|
.fnc-drawbar[data-fit='scroll']::-webkit-scrollbar { display: none; }
|
|
4891
|
+
/* More tools that way: a strip stuck to the bar's top / bottom edge, fading the tools under it. */
|
|
4892
|
+
.fnc-drawbar-more {
|
|
4893
|
+
position: sticky;
|
|
4894
|
+
z-index: 1;
|
|
4895
|
+
flex: none;
|
|
4896
|
+
display: grid;
|
|
4897
|
+
place-items: center;
|
|
4898
|
+
width: 100%;
|
|
4899
|
+
height: 24px;
|
|
4900
|
+
margin: -4px 0;
|
|
4901
|
+
color: var(--fnc-text-2);
|
|
4902
|
+
background: var(--fnc-bg);
|
|
4903
|
+
}
|
|
4904
|
+
.fnc-drawbar-more.is-up { top: -4px; box-shadow: 0 6px 8px -4px var(--fnc-bg); }
|
|
4905
|
+
.fnc-drawbar-more.is-down { bottom: -4px; box-shadow: 0 -6px 8px -4px var(--fnc-bg); }
|
|
4906
|
+
.fnc-drawbar-more:hover { color: var(--fnc-text); }
|
|
4841
4907
|
|
|
4842
4908
|
/* Selected drawing: floating color/delete bar */
|
|
4843
4909
|
.fnc-selbar {
|
|
@@ -4907,6 +4973,14 @@ var CSS = (
|
|
|
4907
4973
|
border-radius: 6px;
|
|
4908
4974
|
background: color-mix(in srgb, var(--fnc-bg) 88%, transparent);
|
|
4909
4975
|
}
|
|
4976
|
+
/* \u2026and the indicator rows' values with it: each row gets the same backing while they show. */
|
|
4977
|
+
.fnc-legend.is-tracking .fnc-ind {
|
|
4978
|
+
width: fit-content;
|
|
4979
|
+
margin-left: -4px;
|
|
4980
|
+
padding: 0 4px;
|
|
4981
|
+
border-radius: 6px;
|
|
4982
|
+
background: color-mix(in srgb, var(--fnc-bg) 88%, transparent);
|
|
4983
|
+
}
|
|
4910
4984
|
/* Indicator legend rows */
|
|
4911
4985
|
.fnc-ind {
|
|
4912
4986
|
display: flex;
|
|
@@ -5483,9 +5557,16 @@ var CSS = (
|
|
|
5483
5557
|
.fnc-coords { display: flex; flex-direction: column; gap: 8px; }
|
|
5484
5558
|
.fnc-coord-row { display: flex; align-items: center; gap: 6px; }
|
|
5485
5559
|
.fnc-coord-name { width: 40px; flex: none; font-size: 12px; color: var(--fnc-text-2); }
|
|
5486
|
-
.fnc-coord-price { flex:
|
|
5487
|
-
.fnc-coord-time { flex:
|
|
5560
|
+
.fnc-coord-price { flex: 1 1 96px; min-width: 0; height: 32px; font-size: 13px; }
|
|
5561
|
+
.fnc-coord-time { flex: 1.6 1 150px; min-width: 0; height: 32px; font-size: 13px; }
|
|
5562
|
+
/* Narrow phones: the time goes under the price (a date-time field needs the width). */
|
|
5563
|
+
@media (max-width: 400px) {
|
|
5564
|
+
.fnc-coord-row { flex-wrap: wrap; row-gap: 4px; }
|
|
5565
|
+
.fnc-coord-time { flex: 1 1 100%; margin-left: 46px; }
|
|
5566
|
+
}
|
|
5488
5567
|
.fnc-btn-on { color: var(--fnc-accent); }
|
|
5568
|
+
/* \uCC28\uD2B8 \uACE0\uC815: the bar shows just the lock, always (not only on hover). */
|
|
5569
|
+
.fnc-nav.fnc-nav-locked { opacity: 1; display: flex; }
|
|
5489
5570
|
.fnc-color-field { display: flex; align-items: center; gap: 6px; flex: none; }
|
|
5490
5571
|
.fnc-opacity { width: 64px; accent-color: var(--fnc-accent); }
|
|
5491
5572
|
.fnc-level-values { flex-wrap: wrap; row-gap: 6px; }
|
|
@@ -5901,7 +5982,53 @@ var CSS = (
|
|
|
5901
5982
|
.fnc-ind-search { height: 48px; padding: 0 16px; }
|
|
5902
5983
|
.fnc-ind-search input { font-size: 15px; }
|
|
5903
5984
|
|
|
5985
|
+
/* Touch: the legend's small buttons and the \xD7s in lists are hard to hit with a finger \u2014 a larger
|
|
5986
|
+
invisible area around each (they look the same); the period chips grow a little. */
|
|
5987
|
+
@media (pointer: coarse) {
|
|
5988
|
+
.fnc-ind-btn, .fnc-ind-collapse { position: relative; }
|
|
5989
|
+
.fnc-ind-btn::after, .fnc-ind-collapse::after { content: ''; position: absolute; inset: -6px; }
|
|
5990
|
+
.fnc-ranges { height: 40px; }
|
|
5991
|
+
.fnc-range { height: 32px; }
|
|
5992
|
+
}
|
|
5993
|
+
|
|
5904
5994
|
/* \u2500\u2500 Mobile \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5995
|
+
/* A phone turned sideways (short, touch): the tool bar slides in from the pencil instead of
|
|
5996
|
+
taking the chart's width all the time. */
|
|
5997
|
+
@media (max-height: 500px) and (pointer: coarse) {
|
|
5998
|
+
.fnc-btn-drawbar { display: flex; }
|
|
5999
|
+
.fnc-drawbar-tab, .fnc-drawbar-collapse { display: none; }
|
|
6000
|
+
.fnc-drawbar[data-collapsed='true'] { display: flex; }
|
|
6001
|
+
.fnc-drawbar-host { position: absolute; left: 0; top: 0; bottom: 0; z-index: 5; pointer-events: none; }
|
|
6002
|
+
.fnc-drawbar {
|
|
6003
|
+
pointer-events: auto;
|
|
6004
|
+
transform: translateX(-100%);
|
|
6005
|
+
transition: transform 0.18s ease;
|
|
6006
|
+
box-shadow: 4px 0 16px rgb(0 0 0 / 0.08);
|
|
6007
|
+
}
|
|
6008
|
+
.fnc-drawbar[data-open='true'] { transform: none; }
|
|
6009
|
+
.fnc-selbar-menu { position: static; }
|
|
6010
|
+
.fnc-selbar-pop {
|
|
6011
|
+
left: 0;
|
|
6012
|
+
right: 0;
|
|
6013
|
+
transform: none;
|
|
6014
|
+
min-width: 0;
|
|
6015
|
+
/* Ends above the period bar under the chart. */
|
|
6016
|
+
max-height: max(120px, calc(100dvh - 210px));
|
|
6017
|
+
overflow-y: auto;
|
|
6018
|
+
z-index: 30;
|
|
6019
|
+
}
|
|
6020
|
+
.fnc-levels-list { max-height: none; }
|
|
6021
|
+
/* Thin indicator panes: their legend stays on one line (not over the pane below). */
|
|
6022
|
+
.fnc-pane-legend .fnc-ind { flex-wrap: nowrap; white-space: nowrap; }
|
|
6023
|
+
.fnc-backdrop { padding: 0; align-items: stretch; }
|
|
6024
|
+
.fnc-dialog { max-height: none; height: 100%; border-radius: 0; }
|
|
6025
|
+
.fnc-dialog-head { height: 44px; }
|
|
6026
|
+
.fnc-settings-tabs { padding: 4px 16px; }
|
|
6027
|
+
.fnc-form { padding: 12px 16px; gap: 10px; }
|
|
6028
|
+
.fnc-form-actions { bottom: -12px; margin: 4px -16px -12px; padding: 8px 16px; }
|
|
6029
|
+
.fnc-action { height: 40px; }
|
|
6030
|
+
}
|
|
6031
|
+
|
|
5905
6032
|
@media (max-width: 640px) {
|
|
5906
6033
|
.fnc-toolbar { padding: 0 4px; gap: 2px; }
|
|
5907
6034
|
.fnc-toolbar .fnc-btn { width: 32px; height: 32px; }
|
|
@@ -5927,7 +6054,30 @@ var CSS = (
|
|
|
5927
6054
|
box-shadow: 4px 0 16px rgb(0 0 0 / 0.08);
|
|
5928
6055
|
}
|
|
5929
6056
|
.fnc-drawbar[data-open='true'] { transform: none; }
|
|
5930
|
-
|
|
6057
|
+
/* The selected drawing's bar: the width of the chart, at its bottom, in as many rows as it takes;
|
|
6058
|
+
its menus open upward over the chart, as wide as the bar. */
|
|
6059
|
+
.fnc-selbar {
|
|
6060
|
+
top: auto !important;
|
|
6061
|
+
bottom: 56px;
|
|
6062
|
+
left: 8px !important;
|
|
6063
|
+
right: 8px;
|
|
6064
|
+
transform: none;
|
|
6065
|
+
flex-wrap: wrap;
|
|
6066
|
+
justify-content: center;
|
|
6067
|
+
row-gap: 4px;
|
|
6068
|
+
}
|
|
6069
|
+
.fnc-selbar-grip { display: none; }
|
|
6070
|
+
.fnc-selbar-menu { position: static; }
|
|
6071
|
+
.fnc-selbar-pop {
|
|
6072
|
+
top: auto;
|
|
6073
|
+
bottom: calc(100% + 6px);
|
|
6074
|
+
left: 0;
|
|
6075
|
+
right: 0;
|
|
6076
|
+
transform: none;
|
|
6077
|
+
min-width: 0;
|
|
6078
|
+
max-height: 55vh;
|
|
6079
|
+
overflow-y: auto;
|
|
6080
|
+
}
|
|
5931
6081
|
.fnc-legend { left: 10px; right: 64px; }
|
|
5932
6082
|
.fnc-backdrop { padding: 0; align-items: stretch; }
|
|
5933
6083
|
.fnc-dialog { width: 100%; max-height: none; border-radius: 0; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnest/charts-ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Pro trading UI (toolbar, drawing tools, sheets) for Funnest Charts. Framework-agnostic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chart",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"NOTICE"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@funnest/charts": "0.10.
|
|
45
|
+
"@funnest/charts": "0.10.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"preact": "^11.2.0"
|