@luscii-healthtech/web-ui 46.3.1 → 46.3.3
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/index.development.js +21 -7
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/RangeCoverage/RangeCoverage.d.ts +19 -2
- package/dist/src/generated/components/RangeCoverage/RangeCoverage.d.ts +19 -2
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -6318,20 +6318,29 @@ const calculateSegments = (args) => {
|
|
|
6318
6318
|
const lower = Math.min(clampedFrom, clampedTo);
|
|
6319
6319
|
const startPos = isDescending ? (start - higher) / totalRange * 100 : (lower - start) / totalRange * 100;
|
|
6320
6320
|
const width = (higher - lower) / totalRange * 100;
|
|
6321
|
+
const visualFrom = isDescending ? higher : lower;
|
|
6322
|
+
const visualTo = isDescending ? lower : higher;
|
|
6321
6323
|
return {
|
|
6322
6324
|
startPos,
|
|
6323
6325
|
width,
|
|
6324
6326
|
color: section.color,
|
|
6325
|
-
originalSection: section
|
|
6327
|
+
originalSection: section,
|
|
6328
|
+
visualFrom,
|
|
6329
|
+
visualTo
|
|
6326
6330
|
};
|
|
6327
6331
|
}).filter((s) => s.width > 0).sort((a, b) => a.startPos - b.startPos);
|
|
6328
6332
|
let currentPos = 0;
|
|
6333
|
+
let currentValue = start;
|
|
6329
6334
|
for (const section of normalizedSections) {
|
|
6330
6335
|
if (section.startPos > currentPos) {
|
|
6331
6336
|
segments.push({
|
|
6332
6337
|
widthPercent: section.startPos - currentPos,
|
|
6333
6338
|
color: "transparent",
|
|
6334
|
-
originalSection:
|
|
6339
|
+
originalSection: {
|
|
6340
|
+
from: currentValue,
|
|
6341
|
+
to: section.visualFrom,
|
|
6342
|
+
color: "transparent"
|
|
6343
|
+
}
|
|
6335
6344
|
});
|
|
6336
6345
|
}
|
|
6337
6346
|
segments.push({
|
|
@@ -6340,13 +6349,14 @@ const calculateSegments = (args) => {
|
|
|
6340
6349
|
originalSection: section.originalSection
|
|
6341
6350
|
});
|
|
6342
6351
|
currentPos = section.startPos + section.width;
|
|
6352
|
+
currentValue = section.visualTo;
|
|
6343
6353
|
}
|
|
6344
6354
|
if (currentPos < 100) {
|
|
6345
6355
|
segments.push({
|
|
6346
6356
|
widthPercent: 100 - currentPos,
|
|
6347
6357
|
color: "transparent",
|
|
6348
6358
|
originalSection: {
|
|
6349
|
-
from:
|
|
6359
|
+
from: currentValue,
|
|
6350
6360
|
to: end,
|
|
6351
6361
|
color: "transparent"
|
|
6352
6362
|
}
|
|
@@ -6414,6 +6424,7 @@ const ticksContainerStyle = {
|
|
|
6414
6424
|
};
|
|
6415
6425
|
const RangeCoverageComponent = (_a) => {
|
|
6416
6426
|
var { sections, start, end, ticks = [], tickFormatter, title, legendSwatches, onSectionFocus, translations, className, slots } = _a, rest = __rest(_a, ["sections", "start", "end", "ticks", "tickFormatter", "title", "legendSwatches", "onSectionFocus", "translations", "className", "slots"]);
|
|
6427
|
+
const { tooltipContent } = slots !== null && slots !== void 0 ? slots : {};
|
|
6417
6428
|
if (hasSectionOverlaps(sections)) {
|
|
6418
6429
|
return jsxRuntime.jsx(Text, { variant: "strong", children: translations.sectionOverlapsMessage });
|
|
6419
6430
|
}
|
|
@@ -6426,9 +6437,9 @@ const RangeCoverageComponent = (_a) => {
|
|
|
6426
6437
|
}) : swatch.color;
|
|
6427
6438
|
return jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx("div", { style: Object.assign(Object.assign({}, legendSwatchStyle), { background }) }), jsxRuntime.jsx(Text, { as: "span", children: swatch.label })] }, swatch.label);
|
|
6428
6439
|
}) }) })] }), jsxRuntime.jsxs(Stack, { gap: "xs", width: "full", align: "stretch", children: [jsxRuntime.jsx("div", { style: barContainerStyle, children: jsxRuntime.jsx("div", { style: barStyle, children: segments.map((segment) => {
|
|
6429
|
-
var _a2;
|
|
6440
|
+
var _a2, _b;
|
|
6430
6441
|
const sectionDataWithBackground = Object.assign(Object.assign({}, segment.originalSection), { background: getSegmentStyle(segment.color).background });
|
|
6431
|
-
const renderedTooltipContent = (_a2 =
|
|
6442
|
+
const renderedTooltipContent = (_a2 = tooltipContent === null || tooltipContent === void 0 ? void 0 : tooltipContent.render) === null || _a2 === void 0 ? void 0 : _a2.call(tooltipContent, sectionDataWithBackground);
|
|
6432
6443
|
const segmentStyle = Object.assign({ flexBasis: `calc(${segment.widthPercent}% - 1px)`, flexGrow: 0, flexShrink: 0, marginRight: "1px" }, getSegmentStyle(segment.color));
|
|
6433
6444
|
const ariaLabel = `${segment.originalSection.from} - ${segment.originalSection.to}`;
|
|
6434
6445
|
if (!renderedTooltipContent && !onSectionFocus) {
|
|
@@ -6447,7 +6458,7 @@ const RangeCoverageComponent = (_a) => {
|
|
|
6447
6458
|
}
|
|
6448
6459
|
return (
|
|
6449
6460
|
// Sections cannot overlap, so from-to should be unique
|
|
6450
|
-
jsxRuntime.jsxs(Tooltip.Root, { children: [jsxRuntime.jsx(Tooltip.Trigger, { asChild: true, children: jsxRuntime.jsx("button", { "aria-label": ariaLabel, style: segmentStyle, onFocus: () => {
|
|
6461
|
+
jsxRuntime.jsxs(Tooltip.Root, { delayDuration: (_b = tooltipContent === null || tooltipContent === void 0 ? void 0 : tooltipContent.delayDuration) !== null && _b !== void 0 ? _b : 100, children: [jsxRuntime.jsx(Tooltip.Trigger, { asChild: true, children: jsxRuntime.jsx("button", { "aria-label": ariaLabel, style: segmentStyle, onFocus: () => {
|
|
6451
6462
|
onSectionFocus === null || onSectionFocus === void 0 ? void 0 : onSectionFocus(sectionDataWithBackground);
|
|
6452
6463
|
}, onBlur: () => {
|
|
6453
6464
|
onSectionFocus === null || onSectionFocus === void 0 ? void 0 : onSectionFocus(null);
|
|
@@ -6455,7 +6466,10 @@ const RangeCoverageComponent = (_a) => {
|
|
|
6455
6466
|
onSectionFocus === null || onSectionFocus === void 0 ? void 0 : onSectionFocus(sectionDataWithBackground);
|
|
6456
6467
|
}, onMouseLeave: () => {
|
|
6457
6468
|
onSectionFocus === null || onSectionFocus === void 0 ? void 0 : onSectionFocus(null);
|
|
6458
|
-
} }) }), jsxRuntime.jsx(Tooltip.Content, {
|
|
6469
|
+
} }) }), jsxRuntime.jsx(Tooltip.Content, { container: tooltipContent === null || tooltipContent === void 0 ? void 0 : tooltipContent.container, backgroundColor: "transparent", side: "bottom", sideOffset: 16, style: {
|
|
6470
|
+
minWidth: 200,
|
|
6471
|
+
maxWidth: 600
|
|
6472
|
+
}, children: jsxRuntime.jsx(Card, { border: true, elevation: "medium", width: "full", children: renderedTooltipContent }) })] }, ariaLabel)
|
|
6459
6473
|
);
|
|
6460
6474
|
}) }) }), ticks.length > 0 && jsxRuntime.jsx("div", { style: ticksContainerStyle, children: ticks.map((tick, index) => {
|
|
6461
6475
|
const totalRange = Math.abs(end - start);
|