@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.
Files changed (276) hide show
  1. package/dist/cjs/core/AccordionCard/index.js +1 -1
  2. package/dist/cjs/core/Alert/alert.style.js +2 -2
  3. package/dist/cjs/core/Antd5Tree/Antd5Tree.style.js +1 -1
  4. package/dist/cjs/core/Avatar/index.js +1 -1
  5. package/dist/cjs/core/Banner/banner.style.js +4 -4
  6. package/dist/cjs/core/BasicCTError/BasicCTError.style.js +1 -1
  7. package/dist/cjs/core/BlankState/style.js +1 -1
  8. package/dist/cjs/core/Breadcrumb/index.js +1 -1
  9. package/dist/cjs/core/Button/index.js +1 -1
  10. package/dist/cjs/core/ButtonGroup/index.js +2 -2
  11. package/dist/cjs/core/Card/CardBody.js +1 -1
  12. package/dist/cjs/core/Card/CardTitle.js +1 -1
  13. package/dist/cjs/core/Card/CardWrapper.js +2 -2
  14. package/dist/cjs/core/Cascader/cascader.style.js +11 -11
  15. package/dist/cjs/core/Checkbox/checkbox.style.js +1 -1
  16. package/dist/cjs/core/DetailCard/index.js +1 -1
  17. package/dist/cjs/core/DonutChart/index.js +2 -2
  18. package/dist/cjs/core/DropdownMenu/index.js +1 -1
  19. package/dist/cjs/core/ExpandableList/ExpandIcon.js +1 -1
  20. package/dist/cjs/core/ExpandableList/ExpandableContainer.js +1 -1
  21. package/dist/cjs/core/ExpandableList/ExpandableItem.js +2 -2
  22. package/dist/cjs/core/ExpandableList/RoundOrder.js +1 -1
  23. package/dist/cjs/core/FailedLoad/index.js +1 -1
  24. package/dist/cjs/core/FormItem/index.js +1 -1
  25. package/dist/cjs/core/Icon/index.js +1 -1
  26. package/dist/cjs/core/ImmersiveDialog/styles.js +14 -14
  27. package/dist/cjs/core/Input/index.js +1 -1
  28. package/dist/cjs/core/InputGroup/index.js +1 -1
  29. package/dist/cjs/core/InputInteger/index.js +1 -1
  30. package/dist/cjs/core/InputNumber/index.js +1 -1
  31. package/dist/cjs/core/InputPassword/index.js +1 -1
  32. package/dist/cjs/core/InputTagItem/index.js +1 -1
  33. package/dist/cjs/core/LegacySelect/select.style.js +1 -1
  34. package/dist/cjs/core/Legend/index.js +5 -5
  35. package/dist/cjs/core/LineChart/AreaHighlightLayer.js +122 -0
  36. package/dist/cjs/core/LineChart/ForecastLineLayer.js +134 -0
  37. package/dist/cjs/core/LineChart/LineChartActions.js +2 -2
  38. package/dist/cjs/core/LineChart/RenderChart.js +274 -20
  39. package/dist/cjs/core/LineChart/ThresholdIntersectionLayer.js +144 -0
  40. package/dist/cjs/core/LineChart/TooltipFormatter.js +44 -39
  41. package/dist/cjs/core/LineChart/areaHighlightUtils.js +89 -0
  42. package/dist/cjs/core/LineChart/index.js +20 -2
  43. package/dist/cjs/core/LineChart/lineChartDisplayUtils.js +32 -0
  44. package/dist/cjs/core/LineChart/lineSegments.js +90 -0
  45. package/dist/cjs/core/LineChart/styled.js +21 -9
  46. package/dist/cjs/core/LineChart/utils.js +93 -4
  47. package/dist/cjs/core/Link/index.js +1 -1
  48. package/dist/cjs/core/Loading/style.js +4 -4
  49. package/dist/cjs/core/LocalUpload/LocalUpload.hooks.js +5 -2
  50. package/dist/cjs/core/LocalUpload/LocalUpload.js +53 -45
  51. package/dist/cjs/core/LocalUpload/LocalUpload.style.js +2 -2
  52. package/dist/cjs/core/LocalUpload/LocalUpload.widget.js +156 -133
  53. package/dist/cjs/core/LogView/LogView.style.js +5 -5
  54. package/dist/cjs/core/MediumDialog/MediumDialog.js +1 -1
  55. package/dist/cjs/core/Metric/styled.js +8 -8
  56. package/dist/cjs/core/Nav/index.js +1 -1
  57. package/dist/cjs/core/Nav/style.js +2 -2
  58. package/dist/cjs/core/Overflow/index.js +2 -2
  59. package/dist/cjs/core/Pagination/index.js +2 -2
  60. package/dist/cjs/core/Progress/components.js +2 -2
  61. package/dist/cjs/core/Progress/index.js +2 -2
  62. package/dist/cjs/core/Progress/progress.style.js +4 -4
  63. package/dist/cjs/core/Progress/progress.widgets.js +2 -2
  64. package/dist/cjs/core/Radio/index.js +3 -3
  65. package/dist/cjs/core/SearchInput/SearchInput.style.js +5 -5
  66. package/dist/cjs/core/SegmentControl/index.js +4 -4
  67. package/dist/cjs/core/Select/select.style.js +4 -4
  68. package/dist/cjs/core/Select/select.widgets.js +3 -3
  69. package/dist/cjs/core/SimplePagination/index.js +2 -2
  70. package/dist/cjs/core/Skeleton/Content.js +1 -1
  71. package/dist/cjs/core/SmallDialog/SmallDialog.style.js +7 -7
  72. package/dist/cjs/core/StatusCapsule/index.js +2 -2
  73. package/dist/cjs/core/StepProgress/index.js +1 -1
  74. package/dist/cjs/core/Steps/style.js +5 -5
  75. package/dist/cjs/core/Styled/index.js +40 -40
  76. package/dist/cjs/core/Switch/index.js +2 -2
  77. package/dist/cjs/core/Tab/Tab.js +1 -1
  78. package/dist/cjs/core/Tab/Tab.style.js +4 -4
  79. package/dist/cjs/core/Table/TableSkeleton.js +1 -1
  80. package/dist/cjs/core/Table/TableWidget.js +1 -1
  81. package/dist/cjs/core/Table/index.js +3 -3
  82. package/dist/cjs/core/TableForm/Columns/FormItem.js +1 -1
  83. package/dist/cjs/core/TableForm/style.js +7 -7
  84. package/dist/cjs/core/Tag/SplitTag.js +1 -1
  85. package/dist/cjs/core/Tag/style.js +5 -5
  86. package/dist/cjs/core/Time/index.js +1 -1
  87. package/dist/cjs/core/TimeZoneSelect/index.js +7 -7
  88. package/dist/cjs/core/Timeline/Timeline.style.js +5 -5
  89. package/dist/cjs/core/Token/index.js +4 -4
  90. package/dist/cjs/core/Token/style.js +1 -1
  91. package/dist/cjs/core/Tooltip/EllipsisTooltipContent.js +1 -1
  92. package/dist/cjs/core/Tooltip/index.js +1 -1
  93. package/dist/cjs/core/Truncate/index.js +1 -1
  94. package/dist/cjs/core/Typo/index.js +58 -58
  95. package/dist/cjs/core/WizardDialog/styles.js +4 -4
  96. package/dist/cjs/coreX/BarChart/index.js +1 -1
  97. package/dist/cjs/coreX/BatchOperation/index.js +2 -2
  98. package/dist/cjs/coreX/ChartWithTooltip/index.js +6 -6
  99. package/dist/cjs/coreX/CheckPointList/checkpointlist.style.js +3 -3
  100. package/dist/cjs/coreX/CircleLoading/index.js +1 -1
  101. package/dist/cjs/coreX/CronCalendar/index.js +4 -4
  102. package/dist/cjs/coreX/CronPlan/index.js +4 -4
  103. package/dist/cjs/coreX/DateRangePicker/DateRangePicker.style.js +12 -12
  104. package/dist/cjs/coreX/DateRangePicker/RelativeTime.js +9 -6
  105. package/dist/cjs/coreX/DateRangePicker/common.js +104 -5
  106. package/dist/cjs/coreX/DateRangePicker/index.js +107 -47
  107. package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +2 -2
  108. package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +6 -6
  109. package/dist/cjs/coreX/GoBackButton/index.js +1 -1
  110. package/dist/cjs/coreX/I18nNameTag/index.js +1 -1
  111. package/dist/cjs/coreX/InfoRowList/InfoRow.js +1 -1
  112. package/dist/cjs/coreX/InfoRowList/InfoRowList.js +4 -4
  113. package/dist/cjs/coreX/KubeConfigModal/KubeConfigModal.style.js +8 -8
  114. package/dist/cjs/coreX/NamesTooltip/index.js +3 -3
  115. package/dist/cjs/coreX/OverflowTooltip/index.js +4 -4
  116. package/dist/cjs/coreX/Sider/index.js +3 -3
  117. package/dist/cjs/coreX/SummaryTable/index.js +5 -5
  118. package/dist/cjs/coreX/SwitchWithText/index.js +1 -1
  119. package/dist/cjs/coreX/TabMenu/index.js +2 -2
  120. package/dist/cjs/coreX/UnderlineTootip/index.js +1 -1
  121. package/dist/cjs/coreX/UnitWithChart/index.js +3 -3
  122. package/dist/cjs/index.js +13 -0
  123. package/dist/cjs/stats1.html +1 -1
  124. package/dist/components.css +3935 -3863
  125. package/dist/esm/core/AccordionCard/index.js +1 -1
  126. package/dist/esm/core/Alert/alert.style.js +2 -2
  127. package/dist/esm/core/Antd5Tree/Antd5Tree.style.js +1 -1
  128. package/dist/esm/core/Avatar/index.js +1 -1
  129. package/dist/esm/core/Banner/banner.style.js +4 -4
  130. package/dist/esm/core/BasicCTError/BasicCTError.style.js +1 -1
  131. package/dist/esm/core/BlankState/style.js +1 -1
  132. package/dist/esm/core/Breadcrumb/index.js +1 -1
  133. package/dist/esm/core/Button/index.js +1 -1
  134. package/dist/esm/core/ButtonGroup/index.js +2 -2
  135. package/dist/esm/core/Card/CardBody.js +1 -1
  136. package/dist/esm/core/Card/CardTitle.js +1 -1
  137. package/dist/esm/core/Card/CardWrapper.js +2 -2
  138. package/dist/esm/core/Cascader/cascader.style.js +11 -11
  139. package/dist/esm/core/Checkbox/checkbox.style.js +1 -1
  140. package/dist/esm/core/DetailCard/index.js +1 -1
  141. package/dist/esm/core/DonutChart/index.js +2 -2
  142. package/dist/esm/core/DropdownMenu/index.js +1 -1
  143. package/dist/esm/core/ExpandableList/ExpandIcon.js +1 -1
  144. package/dist/esm/core/ExpandableList/ExpandableContainer.js +1 -1
  145. package/dist/esm/core/ExpandableList/ExpandableItem.js +2 -2
  146. package/dist/esm/core/ExpandableList/RoundOrder.js +1 -1
  147. package/dist/esm/core/FailedLoad/index.js +1 -1
  148. package/dist/esm/core/FormItem/index.js +1 -1
  149. package/dist/esm/core/Icon/index.js +1 -1
  150. package/dist/esm/core/ImmersiveDialog/styles.js +14 -14
  151. package/dist/esm/core/Input/index.js +1 -1
  152. package/dist/esm/core/InputGroup/index.js +1 -1
  153. package/dist/esm/core/InputInteger/index.js +1 -1
  154. package/dist/esm/core/InputNumber/index.js +1 -1
  155. package/dist/esm/core/InputPassword/index.js +1 -1
  156. package/dist/esm/core/InputTagItem/index.js +1 -1
  157. package/dist/esm/core/LegacySelect/select.style.js +1 -1
  158. package/dist/esm/core/Legend/index.js +5 -5
  159. package/dist/esm/core/LineChart/AreaHighlightLayer.js +115 -0
  160. package/dist/esm/core/LineChart/ForecastLineLayer.js +124 -0
  161. package/dist/esm/core/LineChart/LineChartActions.js +2 -2
  162. package/dist/esm/core/LineChart/RenderChart.js +276 -23
  163. package/dist/esm/core/LineChart/ThresholdIntersectionLayer.js +134 -0
  164. package/dist/esm/core/LineChart/TooltipFormatter.js +41 -39
  165. package/dist/esm/core/LineChart/areaHighlightUtils.js +87 -0
  166. package/dist/esm/core/LineChart/index.js +21 -3
  167. package/dist/esm/core/LineChart/lineChartDisplayUtils.js +26 -0
  168. package/dist/esm/core/LineChart/lineSegments.js +87 -0
  169. package/dist/esm/core/LineChart/styled.js +20 -10
  170. package/dist/esm/core/LineChart/utils.js +91 -5
  171. package/dist/esm/core/Link/index.js +1 -1
  172. package/dist/esm/core/Loading/style.js +4 -4
  173. package/dist/esm/core/LocalUpload/LocalUpload.hooks.js +6 -3
  174. package/dist/esm/core/LocalUpload/LocalUpload.js +52 -45
  175. package/dist/esm/core/LocalUpload/LocalUpload.style.js +2 -2
  176. package/dist/esm/core/LocalUpload/LocalUpload.widget.js +154 -131
  177. package/dist/esm/core/LogView/LogView.style.js +5 -5
  178. package/dist/esm/core/MediumDialog/MediumDialog.js +1 -1
  179. package/dist/esm/core/Metric/styled.js +8 -8
  180. package/dist/esm/core/Nav/index.js +1 -1
  181. package/dist/esm/core/Nav/style.js +2 -2
  182. package/dist/esm/core/Overflow/index.js +2 -2
  183. package/dist/esm/core/Pagination/index.js +2 -2
  184. package/dist/esm/core/Progress/components.js +2 -2
  185. package/dist/esm/core/Progress/index.js +2 -2
  186. package/dist/esm/core/Progress/progress.style.js +4 -4
  187. package/dist/esm/core/Progress/progress.widgets.js +2 -2
  188. package/dist/esm/core/Radio/index.js +3 -3
  189. package/dist/esm/core/SearchInput/SearchInput.style.js +5 -5
  190. package/dist/esm/core/SegmentControl/index.js +4 -4
  191. package/dist/esm/core/Select/select.style.js +4 -4
  192. package/dist/esm/core/Select/select.widgets.js +3 -3
  193. package/dist/esm/core/SimplePagination/index.js +2 -2
  194. package/dist/esm/core/Skeleton/Content.js +1 -1
  195. package/dist/esm/core/SmallDialog/SmallDialog.style.js +7 -7
  196. package/dist/esm/core/StatusCapsule/index.js +2 -2
  197. package/dist/esm/core/StepProgress/index.js +1 -1
  198. package/dist/esm/core/Steps/style.js +5 -5
  199. package/dist/esm/core/Styled/index.js +40 -40
  200. package/dist/esm/core/Switch/index.js +2 -2
  201. package/dist/esm/core/Tab/Tab.js +1 -1
  202. package/dist/esm/core/Tab/Tab.style.js +4 -4
  203. package/dist/esm/core/Table/TableSkeleton.js +1 -1
  204. package/dist/esm/core/Table/TableWidget.js +1 -1
  205. package/dist/esm/core/Table/index.js +3 -3
  206. package/dist/esm/core/TableForm/Columns/FormItem.js +1 -1
  207. package/dist/esm/core/TableForm/style.js +7 -7
  208. package/dist/esm/core/Tag/SplitTag.js +1 -1
  209. package/dist/esm/core/Tag/style.js +5 -5
  210. package/dist/esm/core/Time/index.js +1 -1
  211. package/dist/esm/core/TimeZoneSelect/index.js +7 -7
  212. package/dist/esm/core/Timeline/Timeline.style.js +5 -5
  213. package/dist/esm/core/Token/index.js +4 -4
  214. package/dist/esm/core/Token/style.js +1 -1
  215. package/dist/esm/core/Tooltip/EllipsisTooltipContent.js +1 -1
  216. package/dist/esm/core/Tooltip/index.js +1 -1
  217. package/dist/esm/core/Truncate/index.js +1 -1
  218. package/dist/esm/core/Typo/index.js +58 -58
  219. package/dist/esm/core/WizardDialog/styles.js +4 -4
  220. package/dist/esm/coreX/BarChart/index.js +1 -1
  221. package/dist/esm/coreX/BatchOperation/index.js +2 -2
  222. package/dist/esm/coreX/ChartWithTooltip/index.js +6 -6
  223. package/dist/esm/coreX/CheckPointList/checkpointlist.style.js +3 -3
  224. package/dist/esm/coreX/CircleLoading/index.js +1 -1
  225. package/dist/esm/coreX/CronCalendar/index.js +4 -4
  226. package/dist/esm/coreX/CronPlan/index.js +4 -4
  227. package/dist/esm/coreX/DateRangePicker/DateRangePicker.style.js +12 -12
  228. package/dist/esm/coreX/DateRangePicker/RelativeTime.js +10 -7
  229. package/dist/esm/coreX/DateRangePicker/common.js +99 -6
  230. package/dist/esm/coreX/DateRangePicker/index.js +108 -48
  231. package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +2 -2
  232. package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +6 -6
  233. package/dist/esm/coreX/GoBackButton/index.js +1 -1
  234. package/dist/esm/coreX/I18nNameTag/index.js +1 -1
  235. package/dist/esm/coreX/InfoRowList/InfoRow.js +1 -1
  236. package/dist/esm/coreX/InfoRowList/InfoRowList.js +4 -4
  237. package/dist/esm/coreX/KubeConfigModal/KubeConfigModal.style.js +8 -8
  238. package/dist/esm/coreX/NamesTooltip/index.js +3 -3
  239. package/dist/esm/coreX/OverflowTooltip/index.js +4 -4
  240. package/dist/esm/coreX/Sider/index.js +3 -3
  241. package/dist/esm/coreX/SummaryTable/index.js +5 -5
  242. package/dist/esm/coreX/SwitchWithText/index.js +1 -1
  243. package/dist/esm/coreX/TabMenu/index.js +2 -2
  244. package/dist/esm/coreX/UnderlineTootip/index.js +1 -1
  245. package/dist/esm/coreX/UnitWithChart/index.js +3 -3
  246. package/dist/esm/index.js +4 -1
  247. package/dist/esm/stats1.html +1 -1
  248. package/dist/linaria.merged.scss +4544 -4465
  249. package/dist/src/core/LineChart/AreaHighlightLayer.d.ts +31 -0
  250. package/dist/src/core/LineChart/ForecastLineLayer.d.ts +24 -0
  251. package/dist/src/core/LineChart/RenderChart.d.ts +5 -1
  252. package/dist/src/core/LineChart/ThresholdIntersectionLayer.d.ts +19 -0
  253. package/dist/src/core/LineChart/TooltipFormatter.d.ts +10 -0
  254. package/dist/src/core/LineChart/__test__/AreaHighlightLayer.test.d.ts +1 -0
  255. package/dist/src/core/LineChart/__test__/ForecastLineLayer.test.d.ts +1 -0
  256. package/dist/src/core/LineChart/__test__/utils.test.d.ts +1 -0
  257. package/dist/src/core/LineChart/areaHighlightUtils.d.ts +6 -0
  258. package/dist/src/core/LineChart/lineChartDisplayUtils.d.ts +7 -0
  259. package/dist/src/core/LineChart/lineSegments.d.ts +16 -0
  260. package/dist/src/core/LineChart/styled.d.ts +2 -0
  261. package/dist/src/core/LineChart/type.d.ts +94 -8
  262. package/dist/src/core/LineChart/utils.d.ts +31 -4
  263. package/dist/src/core/LocalUpload/LocalUpload.type.d.ts +12 -4
  264. package/dist/src/core/LocalUpload/LocalUpload.widget.d.ts +1 -0
  265. package/dist/src/core/LocalUpload/__test__/LocalUpload.test.d.ts +1 -0
  266. package/dist/src/coreX/DateRangePicker/__tests__/AbsoluteDate.test.d.ts +1 -0
  267. package/dist/src/coreX/DateRangePicker/__tests__/DateRangePicker.test.d.ts +1 -0
  268. package/dist/src/coreX/DateRangePicker/__tests__/RelativeTime.test.d.ts +1 -0
  269. package/dist/src/coreX/DateRangePicker/__tests__/common.test.d.ts +1 -0
  270. package/dist/src/coreX/DateRangePicker/common.d.ts +12 -3
  271. package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +5 -1
  272. package/dist/stories/docs/core/LineChart.stories.d.ts +4 -0
  273. package/dist/stories/docs/core/LocalUpload.stories.d.ts +32 -13
  274. package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
  275. package/dist/style.css +3936 -3864
  276. package/package.json +3 -3
@@ -12,7 +12,7 @@ import useParrotTranslation from '../../hooks/useParrotTranslation.js';
12
12
  import { Popover } from 'antd';
13
13
  import dayjs from 'dayjs';
14
14
  import React__default, { useState, useEffect, useRef } from 'react';
15
- import { getDateText } from './common.js';
15
+ import { normalizeRelativeTime, getEffectiveAbsoluteTimeBounds, getRelativeTimeRange, isAbsoluteTimeRangeWithinBounds, getDateText, clampAbsoluteTimeRangeToBounds, hasAbsoluteTimeRangeIntersection } from './common.js';
16
16
 
17
17
  var __defProp = Object.defineProperty;
18
18
  var __defProps = Object.defineProperties;
@@ -36,7 +36,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
36
36
  const TimeRange = (props) => {
37
37
  const {
38
38
  visible,
39
- type,
39
+ panelType,
40
+ direction,
40
41
  relativeTime,
41
42
  range,
42
43
  mode = ["relative", "absolute"],
@@ -62,6 +63,7 @@ const TimeRange = (props) => {
62
63
  RelativeTime,
63
64
  {
64
65
  value: relativeTime,
66
+ type: direction,
65
67
  onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
66
68
  config: relativeTimeSelectOptions
67
69
  }
@@ -74,6 +76,7 @@ const TimeRange = (props) => {
74
76
  range: range || [null, null],
75
77
  minDate,
76
78
  maxDate,
79
+ maxRange,
77
80
  onChange: (range2) => onAbsoluteTimeChange == null ? void 0 : onAbsoluteTimeChange(range2),
78
81
  onOk: (range2) => onAbsoluteTimeOk == null ? void 0 : onAbsoluteTimeOk(range2)
79
82
  }
@@ -87,6 +90,7 @@ const TimeRange = (props) => {
87
90
  RelativeTime,
88
91
  {
89
92
  value: relativeTime,
93
+ type: direction,
90
94
  onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
91
95
  config: relativeTimeSelectOptions
92
96
  }
@@ -112,7 +116,7 @@ const TimeRange = (props) => {
112
116
  return /* @__PURE__ */ React__default.createElement(
113
117
  TabMenu,
114
118
  {
115
- selectedKey: type,
119
+ selectedKey: panelType,
116
120
  tabs,
117
121
  onChange: onTypeChange,
118
122
  size: "small"
@@ -121,23 +125,48 @@ const TimeRange = (props) => {
121
125
  }
122
126
  };
123
127
  const TimePickerHistory = (props) => {
124
- const { history, onSelect } = props;
128
+ const { history, type, minDate, maxDate, onSelect } = props;
125
129
  const { t } = useParrotTranslation();
126
130
  function contentRender() {
127
- if (!history.length) {
131
+ const filteredHistory = history.filter((item) => {
132
+ if (Array.isArray(item.value)) {
133
+ if (type !== "future") {
134
+ return true;
135
+ }
136
+ if (item.value.length !== 2 || !item.value[0] || !item.value[1]) {
137
+ return false;
138
+ }
139
+ return hasAbsoluteTimeRangeIntersection(
140
+ [dayjs(item.value[0]), dayjs(item.value[1])],
141
+ minDate,
142
+ maxDate
143
+ );
144
+ }
145
+ return normalizeRelativeTime(item.value, "past").type === type;
146
+ }).sort((a, b) => b.timestamp - a.timestamp);
147
+ if (!filteredHistory.length) {
128
148
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, t("components.empty_search_history"));
129
149
  }
130
- return history.sort((a, b) => b.timestamp - a.timestamp).map((item, index) => {
150
+ return filteredHistory.map((item, index) => {
151
+ const normalizedRelativeTime = Array.isArray(item.value) ? void 0 : normalizeRelativeTime(item.value, "past");
131
152
  const text = Array.isArray(item.value) ? `${dayjs(item.value[0]).format("YYYY-MM-DD hh:mm:ss")} - ${dayjs(
132
153
  item.value[1]
133
- ).format("YYYY-MM-DD hh:mm:ss")}` : getDateText(item.value, t);
134
- const obj = Array.isArray(item.value) ? [dayjs(item.value[0]), dayjs(item.value[1])] : item.value;
154
+ ).format("YYYY-MM-DD hh:mm:ss")}` : getDateText(normalizedRelativeTime, t);
135
155
  return /* @__PURE__ */ React__default.createElement(
136
156
  "li",
137
157
  {
138
158
  key: index,
139
159
  className: Typo.Label.l2_regular,
140
- onClick: () => onSelect(obj)
160
+ onClick: () => {
161
+ if (Array.isArray(item.value)) {
162
+ onSelect([
163
+ dayjs(item.value[0]),
164
+ dayjs(item.value[1])
165
+ ]);
166
+ return;
167
+ }
168
+ onSelect(normalizedRelativeTime);
169
+ }
141
170
  },
142
171
  text
143
172
  );
@@ -150,6 +179,7 @@ const DateRangePicker = (props) => {
150
179
  const {
151
180
  size = "medium",
152
181
  value,
182
+ type: relativeTimeType = "past",
153
183
  history,
154
184
  mode = ["relative", "absolute"],
155
185
  minDate,
@@ -160,35 +190,48 @@ const DateRangePicker = (props) => {
160
190
  } = props;
161
191
  const { t } = useParrotTranslation();
162
192
  const [datePickerVisible, setDatePickerVisible] = useState(false);
163
- const [type, setType] = useState("relative");
193
+ const [panelType, setPanelType] = useState("relative");
164
194
  const [range, setRange] = useState(
165
195
  Array.isArray(value) ? value : void 0
166
196
  );
167
- const relativeTime = !Array.isArray(value) ? value : void 0;
168
- const isRelativeValue = value && !Array.isArray(value);
197
+ const relativeTime = value && !Array.isArray(value) ? normalizeRelativeTime(value, relativeTimeType) : void 0;
198
+ const { minDate: effectiveMinDate, maxDate: effectiveMaxDate } = getEffectiveAbsoluteTimeBounds(relativeTimeType, minDate, maxDate);
169
199
  const isAbsoluteValue = value && Array.isArray(value);
170
- function handleChange(type2, time) {
200
+ function handleChange(type, time) {
171
201
  var _a2, _b;
172
202
  const rangeHistory = [
173
203
  ...(_a2 = history == null ? void 0 : history.dateRangeHistories[history.scope]) != null ? _a2 : []
174
204
  ];
175
- if (type2 === "absolute" && Array.isArray(time)) {
205
+ if (type === "absolute" && Array.isArray(time)) {
206
+ if (relativeTimeType === "future" && !isAbsoluteTimeRangeWithinBounds(
207
+ time,
208
+ effectiveMinDate,
209
+ effectiveMaxDate
210
+ )) {
211
+ return;
212
+ }
176
213
  const value2 = time.map((item) => (item == null ? void 0 : item.format()) || "");
177
214
  rangeHistory.push({
178
- type: type2,
215
+ type,
179
216
  value: value2,
180
217
  timestamp: Date.now()
181
218
  });
182
- onChange == null ? void 0 : onChange(type2, time, time);
183
- } else if (type2 === "relative" && !Array.isArray(time)) {
219
+ onChange == null ? void 0 : onChange(type, time, time);
220
+ } else if (type === "relative" && !Array.isArray(time)) {
221
+ const normalizedRelativeTime = normalizeRelativeTime(
222
+ time,
223
+ relativeTimeType
224
+ );
184
225
  rangeHistory.push({
185
- type: type2,
186
- value: time,
226
+ type,
227
+ value: normalizedRelativeTime,
187
228
  timestamp: Date.now()
188
229
  });
189
- const today = dayjs();
190
- const pastDay = dayjs().subtract(time.value, time.unit);
191
- onChange == null ? void 0 : onChange(type2, time, [today, pastDay]);
230
+ onChange == null ? void 0 : onChange(
231
+ type,
232
+ normalizedRelativeTime,
233
+ getRelativeTimeRange(normalizedRelativeTime)
234
+ );
192
235
  }
193
236
  history == null ? void 0 : history.setDateRangeHistory(__spreadProps(__spreadValues({}, (_b = history == null ? void 0 : history.dateRangeHistories) != null ? _b : {}), {
194
237
  [history.scope]: rangeHistory
@@ -196,21 +239,19 @@ const DateRangePicker = (props) => {
196
239
  setDatePickerVisible(false);
197
240
  }
198
241
  useEffect(() => {
199
- if (isRelativeValue) {
200
- const today = dayjs();
201
- const pastDay = dayjs().subtract(value.value, value.unit);
202
- setType("relative");
203
- onChange == null ? void 0 : onChange("relative", value, [today, pastDay]);
204
- } else if (isAbsoluteValue) {
242
+ if (relativeTime) {
243
+ setPanelType("relative");
244
+ onChange == null ? void 0 : onChange("relative", relativeTime, getRelativeTimeRange(relativeTime));
245
+ } else if (Array.isArray(value)) {
205
246
  setRange(value);
206
- setType("absolute");
247
+ setPanelType("absolute");
207
248
  onChange == null ? void 0 : onChange("absolute", value, value);
208
249
  }
209
- }, [value]);
250
+ }, [relativeTimeType, value]);
210
251
  function displayRangeRender() {
211
252
  var _a2, _b;
212
- if (isRelativeValue) {
213
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, getDateText(value, t));
253
+ if (relativeTime) {
254
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, getDateText(relativeTime, t));
214
255
  } else if (isAbsoluteValue) {
215
256
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
216
257
  Input,
@@ -230,21 +271,36 @@ const DateRangePicker = (props) => {
230
271
  }
231
272
  }
232
273
  function handleSelectHistory(value2) {
233
- const type2 = Array.isArray(value2) ? "absolute" : "relative";
234
- if (type2 === "absolute" && Array.isArray(value2)) {
235
- const _value = [...value2];
236
- const [start, end] = _value;
237
- if (minDate && start) {
238
- const _minDate = dayjs(minDate);
239
- _value[0] = start.isBefore(_minDate) ? _minDate : start;
274
+ if (Array.isArray(value2)) {
275
+ let selectedRange = [...value2];
276
+ if (relativeTimeType === "future") {
277
+ selectedRange = clampAbsoluteTimeRangeToBounds(
278
+ value2,
279
+ effectiveMinDate,
280
+ effectiveMaxDate
281
+ );
282
+ } else {
283
+ const [start, end] = selectedRange;
284
+ if (minDate && start) {
285
+ const parsedMinDate = dayjs(minDate);
286
+ selectedRange[0] = start.isBefore(parsedMinDate) ? parsedMinDate : start;
287
+ }
288
+ if (maxDate && end) {
289
+ const parsedMaxDate = dayjs(maxDate);
290
+ selectedRange[1] = end.isAfter(parsedMaxDate) ? parsedMaxDate : end;
291
+ }
240
292
  }
241
- if (maxDate && end) {
242
- const _maxDate = dayjs(maxDate);
243
- _value[1] = end.isAfter(_maxDate) ? _maxDate : end;
293
+ if (!selectedRange) {
294
+ return;
244
295
  }
245
- handleChange(type2, _value);
296
+ const [selectedStart, selectedEnd] = selectedRange;
297
+ if (!(selectedStart == null ? void 0 : selectedStart.isValid()) || !(selectedEnd == null ? void 0 : selectedEnd.isValid()) || selectedStart.isAfter(selectedEnd)) {
298
+ return;
299
+ }
300
+ handleChange("absolute", selectedRange);
301
+ return;
246
302
  }
247
- handleChange(type2, value2);
303
+ handleChange("relative", normalizeRelativeTime(value2, "past"));
248
304
  }
249
305
  return /* @__PURE__ */ React__default.createElement(
250
306
  DateRangePickerStyle.Wrapper,
@@ -283,14 +339,15 @@ const DateRangePicker = (props) => {
283
339
  TimeRange,
284
340
  {
285
341
  visible: datePickerVisible,
286
- type,
342
+ panelType,
343
+ direction: relativeTimeType,
287
344
  range,
288
345
  relativeTime,
289
346
  mode,
290
- minDate,
291
- maxDate,
347
+ minDate: effectiveMinDate,
348
+ maxDate: effectiveMaxDate,
292
349
  maxRange,
293
- onTypeChange: setType,
350
+ onTypeChange: setPanelType,
294
351
  onRelativeTimeChange: (time) => {
295
352
  handleChange("relative", time);
296
353
  },
@@ -321,6 +378,9 @@ const DateRangePicker = (props) => {
321
378
  TimePickerHistory,
322
379
  {
323
380
  history: (_a = history.dateRangeHistories[history.scope]) != null ? _a : [],
381
+ type: relativeTimeType,
382
+ minDate: effectiveMinDate,
383
+ maxDate: effectiveMaxDate,
324
384
  onSelect: handleSelectHistory
325
385
  }
326
386
  ),
@@ -4,8 +4,8 @@ import { Typo } from '../../../core/Typo/index.js';
4
4
  import useParrotTranslation from '../../../hooks/useParrotTranslation.js';
5
5
  import React__default from 'react';
6
6
 
7
- const ContentStyle = "E_4100_0_17_cevhqx7";
8
- const SecondaryDescStyle = "E_4100_0_17_snbqlt4";
7
+ const ContentStyle = "E_4100_0_19_cevhqx7";
8
+ const SecondaryDescStyle = "E_4100_0_19_snbqlt4";
9
9
  const DeleteDialog = props => {
10
10
  const {
11
11
  t
@@ -22,12 +22,12 @@ var __spreadValues = (a, b) => {
22
22
  }
23
23
  return a;
24
24
  };
25
- const ContentList = "E_4100_0_17_c1ss4prm";
26
- const MultiRejectContentList = "E_4100_0_17_ms3tlei";
27
- const Description = "E_4100_0_17_du44iy7";
28
- const PartialDescription = "E_4100_0_17_p1qmhanr";
29
- const SecondaryDesc = "E_4100_0_17_srje1h0";
30
- const Divider = "E_4100_0_17_di3zi7v";
25
+ const ContentList = "E_4100_0_19_c1ss4prm";
26
+ const MultiRejectContentList = "E_4100_0_19_ms3tlei";
27
+ const Description = "E_4100_0_19_du44iy7";
28
+ const PartialDescription = "E_4100_0_19_p1qmhanr";
29
+ const SecondaryDesc = "E_4100_0_19_srje1h0";
30
+ const Divider = "E_4100_0_19_di3zi7v";
31
31
  const SingleRejectContent = ({
32
32
  content,
33
33
  listType = "ordered",
@@ -4,7 +4,7 @@ import Icon from '../../core/Icon/index.js';
4
4
  import { Typo } from '../../core/Typo/index.js';
5
5
  import React__default from 'react';
6
6
 
7
- const GobackButtonStyle = "E_4100_0_17_gmyahx3";
7
+ const GobackButtonStyle = "E_4100_0_19_gmyahx3";
8
8
  const GobackButton = props => {
9
9
  const {
10
10
  onClick,
@@ -13,7 +13,7 @@ var __objRest = (source, exclude) => {
13
13
  }
14
14
  return target;
15
15
  };
16
- const tagStyle = "E_4100_0_17_tqjc4ui";
16
+ const tagStyle = "E_4100_0_19_tqjc4ui";
17
17
  const I18nNameTag = props => {
18
18
  const _a = props,
19
19
  {
@@ -18,7 +18,7 @@ const InfoRow = ({
18
18
  };
19
19
  const Col = /*#__PURE__*/styled('div')({
20
20
  name: "Col",
21
- class: "E_4100_0_17_c14ouk5o",
21
+ class: "E_4100_0_19_c14ouk5o",
22
22
  propsAsIs: false
23
23
  });
24
24
 
@@ -4,16 +4,16 @@ import Loading from '../../core/Loading/index.js';
4
4
  import React__default from 'react';
5
5
  import { InfoRow } from './InfoRow.js';
6
6
 
7
- const InfoListRowStyle = "E_4100_0_17_i5w779o";
8
- const LooseStyle = "E_4100_0_17_l18dja44";
7
+ const InfoListRowStyle = "E_4100_0_19_i5w779o";
8
+ const LooseStyle = "E_4100_0_19_l18dja44";
9
9
  const ContentWrapper = /*#__PURE__*/styled('div')({
10
10
  name: "ContentWrapper",
11
- class: "E_4100_0_17_c8c2hys",
11
+ class: "E_4100_0_19_c8c2hys",
12
12
  propsAsIs: false
13
13
  });
14
14
  const NullText = /*#__PURE__*/styled('div')({
15
15
  name: "NullText",
16
- class: "E_4100_0_17_n4m6c4d",
16
+ class: "E_4100_0_19_n4m6c4d",
17
17
  propsAsIs: false
18
18
  });
19
19
  const InfoRowList = React__default.forwardRef(function InfoList(props, ref) {
@@ -1,19 +1,19 @@
1
1
  import { styled } from '@linaria/react';
2
2
 
3
- const KubeConfigModalStyle = "E_4100_0_17_kr6am0s";
4
- const KubeConfigWrapperStyle = "E_4100_0_17_k1h3cl5q";
5
- const KubeConfigTitleStyle = "E_4100_0_17_k1a6j97w";
6
- const KubeConfigTipStyle = "E_4100_0_17_k1uim1fg";
7
- const KubeConfigContentStyle = "E_4100_0_17_kobelzt";
8
- const KubeConfigFooterStyle = "E_4100_0_17_kxzv3id";
3
+ const KubeConfigModalStyle = "E_4100_0_19_kr6am0s";
4
+ const KubeConfigWrapperStyle = "E_4100_0_19_k1h3cl5q";
5
+ const KubeConfigTitleStyle = "E_4100_0_19_k1a6j97w";
6
+ const KubeConfigTipStyle = "E_4100_0_19_k1uim1fg";
7
+ const KubeConfigContentStyle = "E_4100_0_19_kobelzt";
8
+ const KubeConfigFooterStyle = "E_4100_0_19_kxzv3id";
9
9
  const ErrorWrapper = /*#__PURE__*/styled('div')({
10
10
  name: "ErrorWrapper",
11
- class: "E_4100_0_17_eld9lt",
11
+ class: "E_4100_0_19_eld9lt",
12
12
  propsAsIs: false
13
13
  });
14
14
  const ErrorContentWrapper = /*#__PURE__*/styled('div')({
15
15
  name: "ErrorContentWrapper",
16
- class: "E_4100_0_17_e1505fqc",
16
+ class: "E_4100_0_19_e1505fqc",
17
17
  propsAsIs: false
18
18
  });
19
19
 
@@ -4,15 +4,15 @@ import React__default from 'react';
4
4
 
5
5
  const NameItem = /*#__PURE__*/styled('div')({
6
6
  name: "NameItem",
7
- class: "E_4100_0_17_n12mqh7z",
7
+ class: "E_4100_0_19_n12mqh7z",
8
8
  propsAsIs: false
9
9
  });
10
10
  const TooltipText = /*#__PURE__*/styled('span')({
11
11
  name: "TooltipText",
12
- class: "E_4100_0_17_tf5bynu",
12
+ class: "E_4100_0_19_tf5bynu",
13
13
  propsAsIs: false
14
14
  });
15
- const ToolTipStyle = "E_4100_0_17_tcckoz1";
15
+ const ToolTipStyle = "E_4100_0_19_tcckoz1";
16
16
  const NamesTooltip = props => {
17
17
  const {
18
18
  names,
@@ -32,20 +32,20 @@ var __objRest = (source, exclude) => {
32
32
  }
33
33
  return target;
34
34
  };
35
- const OverflowText = "E_4100_0_17_ou7iq30";
36
- const SingleLineStyle = "E_4100_0_17_s1tui002";
35
+ const OverflowText = "E_4100_0_19_ou7iq30";
36
+ const SingleLineStyle = "E_4100_0_19_s1tui002";
37
37
  const _exp = /*#__PURE__*/() => ({
38
38
  lineClamp = 2
39
39
  }) => lineClamp;
40
40
  const MultipleLine = /*#__PURE__*/styled('div')({
41
41
  name: "MultipleLine",
42
- class: "E_4100_0_17_mxrc2zg",
42
+ class: "E_4100_0_19_mxrc2zg",
43
43
  propsAsIs: false,
44
44
  vars: {
45
45
  "mxrc2zg-0": [_exp()]
46
46
  }
47
47
  });
48
- const TooltipDefaultClass = "E_4100_0_17_t1vv6d68";
48
+ const TooltipDefaultClass = "E_4100_0_19_t1vv6d68";
49
49
  const OverflowTooltip = props => {
50
50
  const _a = props,
51
51
  {
@@ -22,9 +22,9 @@ var __spreadValues = (a, b) => {
22
22
  }
23
23
  return a;
24
24
  };
25
- const SiderStyle = "E_4100_0_17_s1at6qmn";
26
- const ShrinkStyle = "E_4100_0_17_s1wu0lms";
27
- const NavLinkStyle = "E_4100_0_17_n1ugzfva";
25
+ const SiderStyle = "E_4100_0_19_s1at6qmn";
26
+ const ShrinkStyle = "E_4100_0_19_s1wu0lms";
27
+ const NavLinkStyle = "E_4100_0_19_n1ugzfva";
28
28
  const NormalWidth = 256;
29
29
  const ShrinkWidth = 52;
30
30
  const Sider = ({
@@ -7,28 +7,28 @@ import React__default from 'react';
7
7
 
8
8
  const Table = /*#__PURE__*/styled('div')({
9
9
  name: "Table",
10
- class: "E_4100_0_17_t1sqg15u",
10
+ class: "E_4100_0_19_t1sqg15u",
11
11
  propsAsIs: false
12
12
  });
13
13
  const TableHeader = /*#__PURE__*/styled('header')({
14
14
  name: "TableHeader",
15
- class: "E_4100_0_17_t4zczcp",
15
+ class: "E_4100_0_19_t4zczcp",
16
16
  propsAsIs: false
17
17
  });
18
18
  const TableContent = /*#__PURE__*/styled('div')({
19
19
  name: "TableContent",
20
- class: "E_4100_0_17_t1s7goww",
20
+ class: "E_4100_0_19_t1s7goww",
21
21
  propsAsIs: false
22
22
  });
23
23
  const TableRow = /*#__PURE__*/styled('div')({
24
24
  name: "TableRow",
25
- class: "E_4100_0_17_t93e4cf",
25
+ class: "E_4100_0_19_t93e4cf",
26
26
  propsAsIs: false
27
27
  });
28
28
  const _exp = /*#__PURE__*/() => props => props.width;
29
29
  const RowLabel = /*#__PURE__*/styled('label')({
30
30
  name: "RowLabel",
31
- class: "E_4100_0_17_rhz2uv5",
31
+ class: "E_4100_0_19_rhz2uv5",
32
32
  propsAsIs: false,
33
33
  vars: {
34
34
  "rhz2uv5-0": [_exp()]
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
30
30
  };
31
31
  const SwitchWrapper = /*#__PURE__*/styled('span')({
32
32
  name: "SwitchWrapper",
33
- class: "E_4100_0_17_s1iv0tp1",
33
+ class: "E_4100_0_19_s1iv0tp1",
34
34
  propsAsIs: false
35
35
  });
36
36
  const SwitchWithText = props => {
@@ -4,8 +4,8 @@ import { Dropdown, Menu } from 'antd';
4
4
  import cs from 'classnames';
5
5
  import React__default, { useRef, useMemo, useState, useEffect } from 'react';
6
6
 
7
- const TabMenuStyle = "E_4100_0_17_t160l1cm";
8
- const TabMenuSubMenu = "E_4100_0_17_t14npdqr";
7
+ const TabMenuStyle = "E_4100_0_19_t160l1cm";
8
+ const TabMenuSubMenu = "E_4100_0_19_t14npdqr";
9
9
  const renderExpandArrow = (size, isBold) => {
10
10
  if (size === "medium" && !isBold) return /* @__PURE__ */React__default.createElement(ArrowChevronDown16BlueIcon, {
11
11
  className: "expand-arrow"
@@ -27,7 +27,7 @@ var __objRest = (source, exclude) => {
27
27
  }
28
28
  return target;
29
29
  };
30
- const UnderlineTooltipStyle = "E_4100_0_17_u15heuvq";
30
+ const UnderlineTooltipStyle = "E_4100_0_19_u15heuvq";
31
31
  const UnderlineTooltip = props => {
32
32
  const _a = props,
33
33
  {
@@ -43,11 +43,11 @@ const units = {
43
43
  };
44
44
  const Wrapper = /*#__PURE__*/styled('div')({
45
45
  name: "Wrapper",
46
- class: "E_4100_0_17_wg1tsps",
46
+ class: "E_4100_0_19_wg1tsps",
47
47
  propsAsIs: false
48
48
  });
49
- const BarChartWrapper = "E_4100_0_17_b1ctd5xy";
50
- const UnitWrapper = "E_4100_0_17_u1p8acpn";
49
+ const BarChartWrapper = "E_4100_0_19_b1ctd5xy";
50
+ const UnitWrapper = "E_4100_0_19_u1p8acpn";
51
51
  const Sizes = {
52
52
  small: {
53
53
  width: 22,
package/dist/esm/index.js CHANGED
@@ -100,7 +100,10 @@ export { default as RoundOrder } from './core/ExpandableList/RoundOrder.js';
100
100
  export { ImmersiveDialog } from './core/ImmersiveDialog/index.js';
101
101
  export { LineChartColorBlock, default as LineChartLegend } from './core/LineChart/LineChartLegend.js';
102
102
  export { ILineChartGraphType, ILineChartMetricUnit, ILineChartTimeUnit } from './core/LineChart/type.js';
103
- export { UNIT_FORMATTER, addMissingDataWithZero, convertLineChartDataStruct, convertLineChartUnit, deletePointsOutOfRange, filterLineChartDataOverlapping, filterLineChartOverlappingMetric, filterLineChartPointsByDateRange, getFirstExpectedTimestamp, getLineChartRangeTimestamp, getLineChartStep, getLineChartXAxisDomain, getLineChartYDataMax, getYAxisDomain, getYAxisUpperBound, lineChartTickFormatter, lineChartXaxisCal, lineChartYaxisTickFormatter, parseLineChartRange } from './core/LineChart/utils.js';
103
+ export { DEFAULT_LINE_CHART_STROKE, getLineChartDefaultYAxisTicks, getLineChartLegacyThresholdTooltipInfo, getLineChartStreamStroke } from './core/LineChart/lineChartDisplayUtils.js';
104
+ export { getLineChartAreaHighlightRuns } from './core/LineChart/areaHighlightUtils.js';
105
+ export { getLineChartLinePath, getLineChartLineSegments } from './core/LineChart/lineSegments.js';
106
+ export { UNIT_FORMATTER, addMissingDataWithZero, convertLineChartDataStruct, convertLineChartUnit, deletePointsOutOfRange, filterLineChartDataOverlapping, filterLineChartOverlappingMetric, filterLineChartPointsByDateRange, getFirstExpectedTimestamp, getLineChartAreaHighlightRanges, getLineChartMetricPayloadMatches, getLineChartRangeTimestamp, getLineChartStep, getLineChartThresholdIntersections, getLineChartXAxisDomain, getLineChartYDataMax, getYAxisDomain, getYAxisUpperBound, lineChartTickFormatter, lineChartXaxisCal, lineChartYaxisTickFormatter, parseLineChartRange } from './core/LineChart/utils.js';
104
107
  export { LocalUpload } from './core/LocalUpload/LocalUpload.js';
105
108
  export { LogView } from './core/LogView/LogView.js';
106
109
  export { MediumDialog } from './core/MediumDialog/MediumDialog.js';