@cloudtower/eagle 4100.0.17 → 4100.0.19
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/cjs/core/AccordionCard/index.js +1 -1
- package/dist/cjs/core/Alert/alert.style.js +2 -2
- package/dist/cjs/core/Antd5Tree/Antd5Tree.style.js +1 -1
- package/dist/cjs/core/Avatar/index.js +1 -1
- package/dist/cjs/core/Banner/banner.style.js +4 -4
- package/dist/cjs/core/BasicCTError/BasicCTError.style.js +1 -1
- package/dist/cjs/core/BlankState/style.js +1 -1
- package/dist/cjs/core/Breadcrumb/index.js +1 -1
- package/dist/cjs/core/Button/index.js +1 -1
- package/dist/cjs/core/ButtonGroup/index.js +2 -2
- package/dist/cjs/core/Card/CardBody.js +1 -1
- package/dist/cjs/core/Card/CardTitle.js +1 -1
- package/dist/cjs/core/Card/CardWrapper.js +2 -2
- package/dist/cjs/core/Cascader/cascader.style.js +11 -11
- package/dist/cjs/core/Checkbox/checkbox.style.js +1 -1
- package/dist/cjs/core/DetailCard/index.js +1 -1
- package/dist/cjs/core/DonutChart/index.js +2 -2
- package/dist/cjs/core/DropdownMenu/index.js +1 -1
- package/dist/cjs/core/ExpandableList/ExpandIcon.js +1 -1
- package/dist/cjs/core/ExpandableList/ExpandableContainer.js +1 -1
- package/dist/cjs/core/ExpandableList/ExpandableItem.js +2 -2
- package/dist/cjs/core/ExpandableList/RoundOrder.js +1 -1
- package/dist/cjs/core/FailedLoad/index.js +1 -1
- package/dist/cjs/core/FormItem/index.js +1 -1
- package/dist/cjs/core/Icon/index.js +1 -1
- package/dist/cjs/core/ImmersiveDialog/styles.js +14 -14
- package/dist/cjs/core/Input/index.js +1 -1
- package/dist/cjs/core/InputGroup/index.js +1 -1
- package/dist/cjs/core/InputInteger/index.js +1 -1
- package/dist/cjs/core/InputNumber/index.js +1 -1
- package/dist/cjs/core/InputPassword/index.js +1 -1
- package/dist/cjs/core/InputTagItem/index.js +1 -1
- package/dist/cjs/core/LegacySelect/select.style.js +1 -1
- package/dist/cjs/core/Legend/index.js +5 -5
- package/dist/cjs/core/LineChart/AreaHighlightLayer.js +122 -0
- package/dist/cjs/core/LineChart/ForecastLineLayer.js +134 -0
- package/dist/cjs/core/LineChart/LineChartActions.js +2 -2
- package/dist/cjs/core/LineChart/RenderChart.js +274 -20
- package/dist/cjs/core/LineChart/ThresholdIntersectionLayer.js +144 -0
- package/dist/cjs/core/LineChart/TooltipFormatter.js +44 -39
- package/dist/cjs/core/LineChart/areaHighlightUtils.js +89 -0
- package/dist/cjs/core/LineChart/index.js +20 -2
- package/dist/cjs/core/LineChart/lineChartDisplayUtils.js +32 -0
- package/dist/cjs/core/LineChart/lineSegments.js +90 -0
- package/dist/cjs/core/LineChart/styled.js +21 -9
- package/dist/cjs/core/LineChart/utils.js +93 -4
- package/dist/cjs/core/Link/index.js +1 -1
- package/dist/cjs/core/Loading/style.js +4 -4
- package/dist/cjs/core/LocalUpload/LocalUpload.hooks.js +5 -2
- package/dist/cjs/core/LocalUpload/LocalUpload.js +53 -45
- package/dist/cjs/core/LocalUpload/LocalUpload.style.js +2 -2
- package/dist/cjs/core/LocalUpload/LocalUpload.widget.js +156 -133
- package/dist/cjs/core/LogView/LogView.style.js +5 -5
- package/dist/cjs/core/MediumDialog/MediumDialog.js +1 -1
- package/dist/cjs/core/Metric/styled.js +8 -8
- package/dist/cjs/core/Nav/index.js +1 -1
- package/dist/cjs/core/Nav/style.js +2 -2
- package/dist/cjs/core/Overflow/index.js +2 -2
- package/dist/cjs/core/Pagination/index.js +2 -2
- package/dist/cjs/core/Progress/components.js +2 -2
- package/dist/cjs/core/Progress/index.js +2 -2
- package/dist/cjs/core/Progress/progress.style.js +4 -4
- package/dist/cjs/core/Progress/progress.widgets.js +2 -2
- package/dist/cjs/core/Radio/index.js +3 -3
- package/dist/cjs/core/SearchInput/SearchInput.style.js +5 -5
- package/dist/cjs/core/SegmentControl/index.js +4 -4
- package/dist/cjs/core/Select/select.style.js +4 -4
- package/dist/cjs/core/Select/select.widgets.js +3 -3
- package/dist/cjs/core/SimplePagination/index.js +2 -2
- package/dist/cjs/core/Skeleton/Content.js +1 -1
- package/dist/cjs/core/SmallDialog/SmallDialog.style.js +7 -7
- package/dist/cjs/core/StatusCapsule/index.js +2 -2
- package/dist/cjs/core/StepProgress/index.js +1 -1
- package/dist/cjs/core/Steps/style.js +5 -5
- package/dist/cjs/core/Styled/index.js +40 -40
- package/dist/cjs/core/Switch/index.js +2 -2
- package/dist/cjs/core/Tab/Tab.js +1 -1
- package/dist/cjs/core/Tab/Tab.style.js +4 -4
- package/dist/cjs/core/Table/TableSkeleton.js +1 -1
- package/dist/cjs/core/Table/TableWidget.js +1 -1
- package/dist/cjs/core/Table/index.js +3 -3
- package/dist/cjs/core/TableForm/Columns/FormItem.js +1 -1
- package/dist/cjs/core/TableForm/style.js +7 -7
- package/dist/cjs/core/Tag/SplitTag.js +1 -1
- package/dist/cjs/core/Tag/style.js +5 -5
- package/dist/cjs/core/Time/index.js +1 -1
- package/dist/cjs/core/TimeZoneSelect/index.js +7 -7
- package/dist/cjs/core/Timeline/Timeline.style.js +5 -5
- package/dist/cjs/core/Token/index.js +4 -4
- package/dist/cjs/core/Token/style.js +1 -1
- package/dist/cjs/core/Tooltip/EllipsisTooltipContent.js +1 -1
- package/dist/cjs/core/Tooltip/index.js +1 -1
- package/dist/cjs/core/Truncate/index.js +1 -1
- package/dist/cjs/core/Typo/index.js +58 -58
- package/dist/cjs/core/WizardDialog/styles.js +4 -4
- package/dist/cjs/coreX/BarChart/index.js +1 -1
- package/dist/cjs/coreX/BatchOperation/index.js +2 -2
- package/dist/cjs/coreX/ChartWithTooltip/index.js +6 -6
- package/dist/cjs/coreX/CheckPointList/checkpointlist.style.js +3 -3
- package/dist/cjs/coreX/CircleLoading/index.js +1 -1
- package/dist/cjs/coreX/CronCalendar/index.js +4 -4
- package/dist/cjs/coreX/CronPlan/index.js +4 -4
- package/dist/cjs/coreX/DateRangePicker/DateRangePicker.style.js +12 -12
- package/dist/cjs/coreX/DateRangePicker/RelativeTime.js +9 -6
- package/dist/cjs/coreX/DateRangePicker/common.js +104 -5
- package/dist/cjs/coreX/DateRangePicker/index.js +107 -47
- package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +2 -2
- package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +6 -6
- package/dist/cjs/coreX/GoBackButton/index.js +1 -1
- package/dist/cjs/coreX/I18nNameTag/index.js +1 -1
- package/dist/cjs/coreX/InfoRowList/InfoRow.js +1 -1
- package/dist/cjs/coreX/InfoRowList/InfoRowList.js +4 -4
- package/dist/cjs/coreX/KubeConfigModal/KubeConfigModal.style.js +8 -8
- package/dist/cjs/coreX/NamesTooltip/index.js +3 -3
- package/dist/cjs/coreX/OverflowTooltip/index.js +4 -4
- package/dist/cjs/coreX/Sider/index.js +3 -3
- package/dist/cjs/coreX/SummaryTable/index.js +5 -5
- package/dist/cjs/coreX/SwitchWithText/index.js +1 -1
- package/dist/cjs/coreX/TabMenu/index.js +2 -2
- package/dist/cjs/coreX/UnderlineTootip/index.js +1 -1
- package/dist/cjs/coreX/UnitWithChart/index.js +3 -3
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +3935 -3863
- package/dist/esm/core/AccordionCard/index.js +1 -1
- package/dist/esm/core/Alert/alert.style.js +2 -2
- package/dist/esm/core/Antd5Tree/Antd5Tree.style.js +1 -1
- package/dist/esm/core/Avatar/index.js +1 -1
- package/dist/esm/core/Banner/banner.style.js +4 -4
- package/dist/esm/core/BasicCTError/BasicCTError.style.js +1 -1
- package/dist/esm/core/BlankState/style.js +1 -1
- package/dist/esm/core/Breadcrumb/index.js +1 -1
- package/dist/esm/core/Button/index.js +1 -1
- package/dist/esm/core/ButtonGroup/index.js +2 -2
- package/dist/esm/core/Card/CardBody.js +1 -1
- package/dist/esm/core/Card/CardTitle.js +1 -1
- package/dist/esm/core/Card/CardWrapper.js +2 -2
- package/dist/esm/core/Cascader/cascader.style.js +11 -11
- package/dist/esm/core/Checkbox/checkbox.style.js +1 -1
- package/dist/esm/core/DetailCard/index.js +1 -1
- package/dist/esm/core/DonutChart/index.js +2 -2
- package/dist/esm/core/DropdownMenu/index.js +1 -1
- package/dist/esm/core/ExpandableList/ExpandIcon.js +1 -1
- package/dist/esm/core/ExpandableList/ExpandableContainer.js +1 -1
- package/dist/esm/core/ExpandableList/ExpandableItem.js +2 -2
- package/dist/esm/core/ExpandableList/RoundOrder.js +1 -1
- package/dist/esm/core/FailedLoad/index.js +1 -1
- package/dist/esm/core/FormItem/index.js +1 -1
- package/dist/esm/core/Icon/index.js +1 -1
- package/dist/esm/core/ImmersiveDialog/styles.js +14 -14
- package/dist/esm/core/Input/index.js +1 -1
- package/dist/esm/core/InputGroup/index.js +1 -1
- package/dist/esm/core/InputInteger/index.js +1 -1
- package/dist/esm/core/InputNumber/index.js +1 -1
- package/dist/esm/core/InputPassword/index.js +1 -1
- package/dist/esm/core/InputTagItem/index.js +1 -1
- package/dist/esm/core/LegacySelect/select.style.js +1 -1
- package/dist/esm/core/Legend/index.js +5 -5
- package/dist/esm/core/LineChart/AreaHighlightLayer.js +115 -0
- package/dist/esm/core/LineChart/ForecastLineLayer.js +124 -0
- package/dist/esm/core/LineChart/LineChartActions.js +2 -2
- package/dist/esm/core/LineChart/RenderChart.js +276 -23
- package/dist/esm/core/LineChart/ThresholdIntersectionLayer.js +134 -0
- package/dist/esm/core/LineChart/TooltipFormatter.js +41 -39
- package/dist/esm/core/LineChart/areaHighlightUtils.js +87 -0
- package/dist/esm/core/LineChart/index.js +21 -3
- package/dist/esm/core/LineChart/lineChartDisplayUtils.js +26 -0
- package/dist/esm/core/LineChart/lineSegments.js +87 -0
- package/dist/esm/core/LineChart/styled.js +20 -10
- package/dist/esm/core/LineChart/utils.js +91 -5
- package/dist/esm/core/Link/index.js +1 -1
- package/dist/esm/core/Loading/style.js +4 -4
- package/dist/esm/core/LocalUpload/LocalUpload.hooks.js +6 -3
- package/dist/esm/core/LocalUpload/LocalUpload.js +52 -45
- package/dist/esm/core/LocalUpload/LocalUpload.style.js +2 -2
- package/dist/esm/core/LocalUpload/LocalUpload.widget.js +154 -131
- package/dist/esm/core/LogView/LogView.style.js +5 -5
- package/dist/esm/core/MediumDialog/MediumDialog.js +1 -1
- package/dist/esm/core/Metric/styled.js +8 -8
- package/dist/esm/core/Nav/index.js +1 -1
- package/dist/esm/core/Nav/style.js +2 -2
- package/dist/esm/core/Overflow/index.js +2 -2
- package/dist/esm/core/Pagination/index.js +2 -2
- package/dist/esm/core/Progress/components.js +2 -2
- package/dist/esm/core/Progress/index.js +2 -2
- package/dist/esm/core/Progress/progress.style.js +4 -4
- package/dist/esm/core/Progress/progress.widgets.js +2 -2
- package/dist/esm/core/Radio/index.js +3 -3
- package/dist/esm/core/SearchInput/SearchInput.style.js +5 -5
- package/dist/esm/core/SegmentControl/index.js +4 -4
- package/dist/esm/core/Select/select.style.js +4 -4
- package/dist/esm/core/Select/select.widgets.js +3 -3
- package/dist/esm/core/SimplePagination/index.js +2 -2
- package/dist/esm/core/Skeleton/Content.js +1 -1
- package/dist/esm/core/SmallDialog/SmallDialog.style.js +7 -7
- package/dist/esm/core/StatusCapsule/index.js +2 -2
- package/dist/esm/core/StepProgress/index.js +1 -1
- package/dist/esm/core/Steps/style.js +5 -5
- package/dist/esm/core/Styled/index.js +40 -40
- package/dist/esm/core/Switch/index.js +2 -2
- package/dist/esm/core/Tab/Tab.js +1 -1
- package/dist/esm/core/Tab/Tab.style.js +4 -4
- package/dist/esm/core/Table/TableSkeleton.js +1 -1
- package/dist/esm/core/Table/TableWidget.js +1 -1
- package/dist/esm/core/Table/index.js +3 -3
- package/dist/esm/core/TableForm/Columns/FormItem.js +1 -1
- package/dist/esm/core/TableForm/style.js +7 -7
- package/dist/esm/core/Tag/SplitTag.js +1 -1
- package/dist/esm/core/Tag/style.js +5 -5
- package/dist/esm/core/Time/index.js +1 -1
- package/dist/esm/core/TimeZoneSelect/index.js +7 -7
- package/dist/esm/core/Timeline/Timeline.style.js +5 -5
- package/dist/esm/core/Token/index.js +4 -4
- package/dist/esm/core/Token/style.js +1 -1
- package/dist/esm/core/Tooltip/EllipsisTooltipContent.js +1 -1
- package/dist/esm/core/Tooltip/index.js +1 -1
- package/dist/esm/core/Truncate/index.js +1 -1
- package/dist/esm/core/Typo/index.js +58 -58
- package/dist/esm/core/WizardDialog/styles.js +4 -4
- package/dist/esm/coreX/BarChart/index.js +1 -1
- package/dist/esm/coreX/BatchOperation/index.js +2 -2
- package/dist/esm/coreX/ChartWithTooltip/index.js +6 -6
- package/dist/esm/coreX/CheckPointList/checkpointlist.style.js +3 -3
- package/dist/esm/coreX/CircleLoading/index.js +1 -1
- package/dist/esm/coreX/CronCalendar/index.js +4 -4
- package/dist/esm/coreX/CronPlan/index.js +4 -4
- package/dist/esm/coreX/DateRangePicker/DateRangePicker.style.js +12 -12
- package/dist/esm/coreX/DateRangePicker/RelativeTime.js +10 -7
- package/dist/esm/coreX/DateRangePicker/common.js +99 -6
- package/dist/esm/coreX/DateRangePicker/index.js +108 -48
- package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +2 -2
- package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +6 -6
- package/dist/esm/coreX/GoBackButton/index.js +1 -1
- package/dist/esm/coreX/I18nNameTag/index.js +1 -1
- package/dist/esm/coreX/InfoRowList/InfoRow.js +1 -1
- package/dist/esm/coreX/InfoRowList/InfoRowList.js +4 -4
- package/dist/esm/coreX/KubeConfigModal/KubeConfigModal.style.js +8 -8
- package/dist/esm/coreX/NamesTooltip/index.js +3 -3
- package/dist/esm/coreX/OverflowTooltip/index.js +4 -4
- package/dist/esm/coreX/Sider/index.js +3 -3
- package/dist/esm/coreX/SummaryTable/index.js +5 -5
- package/dist/esm/coreX/SwitchWithText/index.js +1 -1
- package/dist/esm/coreX/TabMenu/index.js +2 -2
- package/dist/esm/coreX/UnderlineTootip/index.js +1 -1
- package/dist/esm/coreX/UnitWithChart/index.js +3 -3
- package/dist/esm/index.js +4 -1
- package/dist/esm/stats1.html +1 -1
- package/dist/linaria.merged.scss +4544 -4465
- package/dist/src/core/LineChart/AreaHighlightLayer.d.ts +31 -0
- package/dist/src/core/LineChart/ForecastLineLayer.d.ts +24 -0
- package/dist/src/core/LineChart/RenderChart.d.ts +5 -1
- package/dist/src/core/LineChart/ThresholdIntersectionLayer.d.ts +19 -0
- package/dist/src/core/LineChart/TooltipFormatter.d.ts +10 -0
- package/dist/src/core/LineChart/__test__/AreaHighlightLayer.test.d.ts +1 -0
- package/dist/src/core/LineChart/__test__/ForecastLineLayer.test.d.ts +1 -0
- package/dist/src/core/LineChart/__test__/utils.test.d.ts +1 -0
- package/dist/src/core/LineChart/areaHighlightUtils.d.ts +6 -0
- package/dist/src/core/LineChart/lineChartDisplayUtils.d.ts +7 -0
- package/dist/src/core/LineChart/lineSegments.d.ts +16 -0
- package/dist/src/core/LineChart/styled.d.ts +2 -0
- package/dist/src/core/LineChart/type.d.ts +94 -8
- package/dist/src/core/LineChart/utils.d.ts +31 -4
- package/dist/src/core/LocalUpload/LocalUpload.type.d.ts +12 -4
- package/dist/src/core/LocalUpload/LocalUpload.widget.d.ts +1 -0
- package/dist/src/core/LocalUpload/__test__/LocalUpload.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/__tests__/AbsoluteDate.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/__tests__/DateRangePicker.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/__tests__/RelativeTime.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/__tests__/common.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/common.d.ts +12 -3
- package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +5 -1
- package/dist/stories/docs/core/LineChart.stories.d.ts +4 -0
- package/dist/stories/docs/core/LocalUpload.stories.d.ts +32 -13
- package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
- package/dist/style.css +3936 -3864
- package/package.json +3 -3
|
@@ -96,10 +96,92 @@ function getLineChartXAxisDomain(dateRange, xaxisLastTime) {
|
|
|
96
96
|
const [startDate, endDate] = dateRange;
|
|
97
97
|
return [startDate.valueOf(), xaxisLastTime != null ? xaxisLastTime : endDate.valueOf()];
|
|
98
98
|
}
|
|
99
|
+
const getLineChartMetricPayloadMatches = (payload, legends = []) => {
|
|
100
|
+
if (!(payload == null ? void 0 : payload.length)) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
return payload.flatMap((item) => {
|
|
104
|
+
const legend = legends.find((_legend, index) => `v${index}` === item.name);
|
|
105
|
+
if (!legend) {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
return [{ payload: item, legend }];
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
const getLineChartAreaHighlightRanges = (ranges = [], xDomain) => {
|
|
112
|
+
const [domainStart, domainEnd] = xDomain;
|
|
113
|
+
return ranges.map((range) => __spreadProps(__spreadValues({}, range), {
|
|
114
|
+
start: Math.max(range.start, domainStart),
|
|
115
|
+
end: Math.min(range.end, domainEnd)
|
|
116
|
+
})).filter((range) => range.start < range.end);
|
|
117
|
+
};
|
|
99
118
|
const getLineChartRangeTimestamp = (dateRange) => {
|
|
100
119
|
const [startDate, endDate] = dateRange;
|
|
101
120
|
return endDate.valueOf() - startDate.valueOf();
|
|
102
121
|
};
|
|
122
|
+
const isSameIntersectionPoint = (prev, next) => {
|
|
123
|
+
if (!prev) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
return prev.streamIndex === next.streamIndex && Math.abs(prev.timestamp - next.timestamp) < 1e-6 && Math.abs(prev.value - next.value) < 1e-6;
|
|
127
|
+
};
|
|
128
|
+
const pushLineChartIntersection = (intersections, next) => {
|
|
129
|
+
if (!isSameIntersectionPoint(intersections[intersections.length - 1], next)) {
|
|
130
|
+
intersections.push(next);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const isValidLineChartValue = (value) => {
|
|
134
|
+
return ___default.default.isNumber(value) && Number.isFinite(value);
|
|
135
|
+
};
|
|
136
|
+
const getLineChartThresholdIntersections = (streams, thresholdValue, xDomain) => {
|
|
137
|
+
const [domainStart, domainEnd] = xDomain != null ? xDomain : [-Infinity, Infinity];
|
|
138
|
+
return streams.flatMap((stream, streamIndex) => {
|
|
139
|
+
const intersections = [];
|
|
140
|
+
for (let index = 0; index < stream.points.length - 1; index++) {
|
|
141
|
+
const currentPoint = stream.points[index];
|
|
142
|
+
const nextPoint = stream.points[index + 1];
|
|
143
|
+
if (!isValidLineChartValue(currentPoint == null ? void 0 : currentPoint.v) || !isValidLineChartValue(nextPoint == null ? void 0 : nextPoint.v) || currentPoint.t === nextPoint.t) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const currentDiff = currentPoint.v - thresholdValue;
|
|
147
|
+
const nextDiff = nextPoint.v - thresholdValue;
|
|
148
|
+
if (currentDiff === 0 && nextDiff === 0) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (currentDiff === 0 && currentPoint.t >= domainStart && currentPoint.t <= domainEnd) {
|
|
152
|
+
pushLineChartIntersection(intersections, {
|
|
153
|
+
timestamp: currentPoint.t,
|
|
154
|
+
value: thresholdValue,
|
|
155
|
+
legend: stream.legend,
|
|
156
|
+
streamIndex
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (currentDiff * nextDiff < 0) {
|
|
160
|
+
const ratio = currentDiff / (currentDiff - nextDiff);
|
|
161
|
+
const timestamp = currentPoint.t + (nextPoint.t - currentPoint.t) * ratio;
|
|
162
|
+
if (timestamp >= domainStart && timestamp <= domainEnd) {
|
|
163
|
+
pushLineChartIntersection(intersections, {
|
|
164
|
+
timestamp,
|
|
165
|
+
value: thresholdValue,
|
|
166
|
+
legend: stream.legend,
|
|
167
|
+
streamIndex
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (nextDiff === 0 && nextPoint.t >= domainStart && nextPoint.t <= domainEnd) {
|
|
172
|
+
pushLineChartIntersection(intersections, {
|
|
173
|
+
timestamp: nextPoint.t,
|
|
174
|
+
value: thresholdValue,
|
|
175
|
+
legend: stream.legend,
|
|
176
|
+
streamIndex
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return intersections.filter(
|
|
181
|
+
(intersection) => intersection.timestamp >= domainStart && intersection.timestamp <= domainEnd
|
|
182
|
+
);
|
|
183
|
+
});
|
|
184
|
+
};
|
|
103
185
|
const getLineChartStep = (dateRange) => {
|
|
104
186
|
const [startDate, endDate] = dateRange;
|
|
105
187
|
const range = endDate.valueOf() - startDate.valueOf();
|
|
@@ -292,7 +374,7 @@ const UNIT_FORMATTER = {
|
|
|
292
374
|
[type.ILineChartMetricUnit.Temperature]: [tower.formatTemperature, "\u2103"],
|
|
293
375
|
[type.ILineChartMetricUnit.Load]: [tower.formatCount, ""]
|
|
294
376
|
};
|
|
295
|
-
const getLineChartYDataMax = (dataPoints, type$1) => {
|
|
377
|
+
const getLineChartYDataMax = (dataPoints, type$1, extraValues = []) => {
|
|
296
378
|
const values = dataPoints.map((p) => {
|
|
297
379
|
if (___default.default.isNumber(p == null ? void 0 : p.v)) {
|
|
298
380
|
return p.v;
|
|
@@ -316,7 +398,11 @@ const getLineChartYDataMax = (dataPoints, type$1) => {
|
|
|
316
398
|
return max;
|
|
317
399
|
}
|
|
318
400
|
});
|
|
319
|
-
return Math.max(
|
|
401
|
+
return Math.max(
|
|
402
|
+
...values,
|
|
403
|
+
0,
|
|
404
|
+
...extraValues.filter((value) => Number.isFinite(value))
|
|
405
|
+
);
|
|
320
406
|
};
|
|
321
407
|
const getYAxisUpperBound = (max, type$1) => {
|
|
322
408
|
const DIVISOR = 2;
|
|
@@ -350,8 +436,8 @@ const getYAxisUpperBound = (max, type$1) => {
|
|
|
350
436
|
return 2;
|
|
351
437
|
}
|
|
352
438
|
};
|
|
353
|
-
const getYAxisDomain = (dataPoints, graphType, unitType) => {
|
|
354
|
-
const max = getLineChartYDataMax(dataPoints, graphType);
|
|
439
|
+
const getYAxisDomain = (dataPoints, graphType, unitType, extraValues = []) => {
|
|
440
|
+
const max = getLineChartYDataMax(dataPoints, graphType, extraValues);
|
|
355
441
|
if (!max) {
|
|
356
442
|
if (unitType === type.ILineChartMetricUnit.Ratio) {
|
|
357
443
|
return [0, 1];
|
|
@@ -382,8 +468,11 @@ exports.filterLineChartDataOverlapping = filterLineChartDataOverlapping;
|
|
|
382
468
|
exports.filterLineChartOverlappingMetric = filterLineChartOverlappingMetric;
|
|
383
469
|
exports.filterLineChartPointsByDateRange = filterLineChartPointsByDateRange;
|
|
384
470
|
exports.getFirstExpectedTimestamp = getFirstExpectedTimestamp;
|
|
471
|
+
exports.getLineChartAreaHighlightRanges = getLineChartAreaHighlightRanges;
|
|
472
|
+
exports.getLineChartMetricPayloadMatches = getLineChartMetricPayloadMatches;
|
|
385
473
|
exports.getLineChartRangeTimestamp = getLineChartRangeTimestamp;
|
|
386
474
|
exports.getLineChartStep = getLineChartStep;
|
|
475
|
+
exports.getLineChartThresholdIntersections = getLineChartThresholdIntersections;
|
|
387
476
|
exports.getLineChartXAxisDomain = getLineChartXAxisDomain;
|
|
388
477
|
exports.getLineChartYDataMax = getLineChartYDataMax;
|
|
389
478
|
exports.getYAxisDomain = getYAxisDomain;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const LoadingWrapper = "
|
|
4
|
-
const LoadingLine1 = "
|
|
5
|
-
const LoadingLine2 = "
|
|
6
|
-
const LoadingLine3 = "
|
|
3
|
+
const LoadingWrapper = "E_4100_0_19_lht19u8";
|
|
4
|
+
const LoadingLine1 = "E_4100_0_19_lk3gkp4";
|
|
5
|
+
const LoadingLine2 = "E_4100_0_19_ll4n94n";
|
|
6
|
+
const LoadingLine3 = "E_4100_0_19_l17lbdo6";
|
|
7
7
|
|
|
8
8
|
exports.LoadingLine1 = LoadingLine1;
|
|
9
9
|
exports.LoadingLine2 = LoadingLine2;
|
|
@@ -8,13 +8,16 @@ const useFileValidation = ({
|
|
|
8
8
|
validate,
|
|
9
9
|
createNewFile = false
|
|
10
10
|
}) => {
|
|
11
|
+
const latestFileList = React.useRef(fileList);
|
|
11
12
|
React.useEffect(() => {
|
|
13
|
+
latestFileList.current = fileList;
|
|
12
14
|
if (!validate)
|
|
13
15
|
return;
|
|
14
16
|
const updateFile = (fileId, file) => {
|
|
15
|
-
const
|
|
17
|
+
const currentList = latestFileList.current;
|
|
18
|
+
const index = currentList.findIndex((f) => f.uid === fileId);
|
|
16
19
|
if (index !== -1) {
|
|
17
|
-
const newList = [...
|
|
20
|
+
const newList = [...currentList];
|
|
18
21
|
const fileToUpdate = createNewFile ? (() => {
|
|
19
22
|
const newFile = new File([file], file.name, { type: file.type });
|
|
20
23
|
Object.assign(newFile, file);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
|
|
4
|
+
var cs = require('classnames');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var LocalUpload_style = require('./LocalUpload.style.js');
|
|
6
7
|
var LocalUpload_widget = require('./LocalUpload.widget.js');
|
|
7
8
|
|
|
8
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
10
|
|
|
11
|
+
var cs__default = /*#__PURE__*/_interopDefault(cs);
|
|
10
12
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
13
|
|
|
12
14
|
var __defProp = Object.defineProperty;
|
|
@@ -30,6 +32,7 @@ const UploadComp = React__default.default.forwardRef(
|
|
|
30
32
|
className,
|
|
31
33
|
"data-testid": dataTestId,
|
|
32
34
|
label,
|
|
35
|
+
labelPosition = "top",
|
|
33
36
|
description,
|
|
34
37
|
type = "dragger",
|
|
35
38
|
multiple = false,
|
|
@@ -41,66 +44,71 @@ const UploadComp = React__default.default.forwardRef(
|
|
|
41
44
|
setFileList,
|
|
42
45
|
validate,
|
|
43
46
|
buttonProps,
|
|
44
|
-
listType = "list",
|
|
45
47
|
disableRemoveList = false,
|
|
46
|
-
onRemove
|
|
48
|
+
onRemove,
|
|
49
|
+
error
|
|
47
50
|
}, ref) => {
|
|
48
51
|
const { t } = useParrotTranslation();
|
|
49
52
|
const removeFile = (id) => {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
fileList.splice(index, 1);
|
|
54
|
-
setFileList([...fileList]);
|
|
55
|
-
onRemove == null ? void 0 : onRemove(file);
|
|
53
|
+
const nextFileList = fileList.filter((file) => file.uid !== id);
|
|
54
|
+
if (nextFileList.length !== fileList.length) {
|
|
55
|
+
setFileList(nextFileList);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
const _maxCount = multiple ? maxCount || Infinity : 1;
|
|
59
59
|
const isSingleSelect = _maxCount === 1;
|
|
60
|
+
const shouldShowDescriptionAbove = !!description && !!label && labelPosition === "top";
|
|
61
|
+
const shouldShowDescriptionBelow = !!description && !shouldShowDescriptionAbove;
|
|
62
|
+
const shouldDisableRemove = disabled || disableRemoveList;
|
|
63
|
+
const uploadContent = /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, shouldShowDescriptionAbove ? /* @__PURE__ */ React__default.default.createElement(UploadComp.Description, null, description) : null, type === "button" ? /* @__PURE__ */ React__default.default.createElement(
|
|
64
|
+
UploadComp.Button,
|
|
65
|
+
__spreadValues({}, __spreadValues({
|
|
66
|
+
accept,
|
|
67
|
+
multiple,
|
|
68
|
+
disabled,
|
|
69
|
+
maxCount,
|
|
70
|
+
fileList,
|
|
71
|
+
setFileList,
|
|
72
|
+
validate,
|
|
73
|
+
error
|
|
74
|
+
}, buttonProps)),
|
|
75
|
+
t("components.select_file")
|
|
76
|
+
) : /* @__PURE__ */ React__default.default.createElement(
|
|
77
|
+
UploadComp.Dragger,
|
|
78
|
+
__spreadValues({}, {
|
|
79
|
+
accept,
|
|
80
|
+
multiple,
|
|
81
|
+
disabled,
|
|
82
|
+
maxCount,
|
|
83
|
+
fileList,
|
|
84
|
+
setFileList,
|
|
85
|
+
validate,
|
|
86
|
+
disableRemove: shouldDisableRemove,
|
|
87
|
+
onRemove,
|
|
88
|
+
error
|
|
89
|
+
})
|
|
90
|
+
), shouldShowDescriptionBelow ? /* @__PURE__ */ React__default.default.createElement(UploadComp.Description, { className: "description-below" }, description) : null, info, type === "button" || !isSingleSelect ? /* @__PURE__ */ React__default.default.createElement(
|
|
91
|
+
UploadComp.FileList,
|
|
92
|
+
{
|
|
93
|
+
fileList,
|
|
94
|
+
removeFile,
|
|
95
|
+
disableRemove: shouldDisableRemove,
|
|
96
|
+
onRemove
|
|
97
|
+
}
|
|
98
|
+
) : null);
|
|
60
99
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
61
100
|
UploadComp.Wrapper,
|
|
62
101
|
{
|
|
63
|
-
className
|
|
102
|
+
className: cs__default.default(
|
|
103
|
+
className,
|
|
104
|
+
label && labelPosition === "left" ? "label-left" : "label-top",
|
|
105
|
+
!label && "no-label"
|
|
106
|
+
),
|
|
64
107
|
ref,
|
|
65
108
|
"data-testid": dataTestId
|
|
66
109
|
},
|
|
67
110
|
label ? /* @__PURE__ */ React__default.default.createElement(UploadComp.Label, null, label) : null,
|
|
68
|
-
|
|
69
|
-
type === "button" ? /* @__PURE__ */ React__default.default.createElement(
|
|
70
|
-
UploadComp.Button,
|
|
71
|
-
__spreadValues({}, __spreadValues({
|
|
72
|
-
accept,
|
|
73
|
-
multiple,
|
|
74
|
-
disabled,
|
|
75
|
-
maxCount,
|
|
76
|
-
fileList,
|
|
77
|
-
setFileList,
|
|
78
|
-
validate
|
|
79
|
-
}, buttonProps)),
|
|
80
|
-
t("components.select_file")
|
|
81
|
-
) : /* @__PURE__ */ React__default.default.createElement(
|
|
82
|
-
UploadComp.Dragger,
|
|
83
|
-
__spreadValues({}, {
|
|
84
|
-
accept,
|
|
85
|
-
multiple,
|
|
86
|
-
disabled,
|
|
87
|
-
maxCount,
|
|
88
|
-
fileList,
|
|
89
|
-
setFileList,
|
|
90
|
-
validate
|
|
91
|
-
})
|
|
92
|
-
),
|
|
93
|
-
info != null ? info : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null),
|
|
94
|
-
type === "button" || !isSingleSelect ? /* @__PURE__ */ React__default.default.createElement(
|
|
95
|
-
UploadComp.FileList,
|
|
96
|
-
{
|
|
97
|
-
fileList,
|
|
98
|
-
removeFile,
|
|
99
|
-
type: listType,
|
|
100
|
-
disableRemove: disableRemoveList,
|
|
101
|
-
onRemove
|
|
102
|
-
}
|
|
103
|
-
) : null
|
|
111
|
+
labelPosition === "left" && label ? /* @__PURE__ */ React__default.default.createElement("div", { className: "upload-main" }, uploadContent) : uploadContent
|
|
104
112
|
);
|
|
105
113
|
}
|
|
106
114
|
);
|
|
@@ -4,10 +4,10 @@ var react = require('@linaria/react');
|
|
|
4
4
|
|
|
5
5
|
const UploadWrapper = /*#__PURE__*/react.styled('div')({
|
|
6
6
|
name: "UploadWrapper",
|
|
7
|
-
class: "
|
|
7
|
+
class: "E_4100_0_19_u3l9ivi",
|
|
8
8
|
propsAsIs: false
|
|
9
9
|
});
|
|
10
|
-
const FileInfoWrapperStyle = "
|
|
10
|
+
const FileInfoWrapperStyle = "E_4100_0_19_ftdwz1g";
|
|
11
11
|
|
|
12
12
|
exports.FileInfoWrapperStyle = FileInfoWrapperStyle;
|
|
13
13
|
exports.UploadWrapper = UploadWrapper;
|