@cloudtower/eagle 4100.0.18 → 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.style.js +2 -2
- 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 +4504 -4480
- 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.style.js +2 -2
- 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 +5086 -5060
- 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/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/coreX/DateRangePicker.stories.d.ts +1 -0
- package/dist/style.css +4515 -4491
- package/package.json +3 -3
|
@@ -37,29 +37,29 @@ const units = {
|
|
|
37
37
|
};
|
|
38
38
|
const ChartContent = /*#__PURE__*/react.styled('div')({
|
|
39
39
|
name: "ChartContent",
|
|
40
|
-
class: "
|
|
40
|
+
class: "E_4100_0_19_c18bcrac",
|
|
41
41
|
propsAsIs: false
|
|
42
42
|
});
|
|
43
43
|
const ChartTooltipContainer = /*#__PURE__*/react.styled('div')({
|
|
44
44
|
name: "ChartTooltipContainer",
|
|
45
|
-
class: "
|
|
45
|
+
class: "E_4100_0_19_cro7kg2",
|
|
46
46
|
propsAsIs: false
|
|
47
47
|
});
|
|
48
48
|
const ChartTooltipRow = /*#__PURE__*/react.styled('div')({
|
|
49
49
|
name: "ChartTooltipRow",
|
|
50
|
-
class: "
|
|
50
|
+
class: "E_4100_0_19_c14wcxf0",
|
|
51
51
|
propsAsIs: false
|
|
52
52
|
});
|
|
53
53
|
const _exp = /*#__PURE__*/() => ChartTooltipRow;
|
|
54
54
|
const ChartTooltipTitle = /*#__PURE__*/react.styled(_exp())({
|
|
55
55
|
name: "ChartTooltipTitle",
|
|
56
|
-
class: "
|
|
56
|
+
class: "E_4100_0_19_coy29mj",
|
|
57
57
|
propsAsIs: true
|
|
58
58
|
});
|
|
59
59
|
const _exp2 = /*#__PURE__*/() => props => props.color;
|
|
60
60
|
const SpaceStatus = /*#__PURE__*/react.styled('i')({
|
|
61
61
|
name: "SpaceStatus",
|
|
62
|
-
class: "
|
|
62
|
+
class: "E_4100_0_19_s11212zy",
|
|
63
63
|
propsAsIs: false,
|
|
64
64
|
vars: {
|
|
65
65
|
"s11212zy-0": [_exp2()]
|
|
@@ -67,7 +67,7 @@ const SpaceStatus = /*#__PURE__*/react.styled('i')({
|
|
|
67
67
|
});
|
|
68
68
|
const PrimaryUnit = /*#__PURE__*/react.styled('div')({
|
|
69
69
|
name: "PrimaryUnit",
|
|
70
|
-
class: "
|
|
70
|
+
class: "E_4100_0_19_p1lyky6c",
|
|
71
71
|
propsAsIs: false
|
|
72
72
|
});
|
|
73
73
|
const ChartWithUnit = props => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const CheckPointListStyle = "
|
|
4
|
-
const CheckPointItemStyle = "
|
|
5
|
-
const EmptyWrapper = "
|
|
3
|
+
const CheckPointListStyle = "E_4100_0_19_cyms3br";
|
|
4
|
+
const CheckPointItemStyle = "E_4100_0_19_c157gu4z";
|
|
5
|
+
const EmptyWrapper = "E_4100_0_19_eu1sysj";
|
|
6
6
|
|
|
7
7
|
exports.CheckPointItemStyle = CheckPointItemStyle;
|
|
8
8
|
exports.CheckPointListStyle = CheckPointListStyle;
|
|
@@ -18,10 +18,10 @@ var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
|
18
18
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
19
19
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
20
20
|
|
|
21
|
-
const CronCalendarWrapper = "
|
|
22
|
-
const Title = "
|
|
23
|
-
const Control = "
|
|
24
|
-
const Cell = "
|
|
21
|
+
const CronCalendarWrapper = "E_4100_0_19_clm1wy1";
|
|
22
|
+
const Title = "E_4100_0_19_t1tsm00v";
|
|
23
|
+
const Control = "E_4100_0_19_c167wnad";
|
|
24
|
+
const Cell = "E_4100_0_19_cxhf7dh";
|
|
25
25
|
const CronCalendar = ({
|
|
26
26
|
plans
|
|
27
27
|
}) => {
|
|
@@ -48,10 +48,10 @@ var __spreadValues = (a, b) => {
|
|
|
48
48
|
return a;
|
|
49
49
|
};
|
|
50
50
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
51
|
-
const CronPlanWrapper = "
|
|
52
|
-
const CronPlanHeader = "
|
|
53
|
-
const ModeTabs = "
|
|
54
|
-
const Wrapper = "
|
|
51
|
+
const CronPlanWrapper = "E_4100_0_19_c1up1pdz";
|
|
52
|
+
const CronPlanHeader = "E_4100_0_19_c156wh19";
|
|
53
|
+
const ModeTabs = "E_4100_0_19_m126spxy";
|
|
54
|
+
const Wrapper = "E_4100_0_19_wpbf4pq";
|
|
55
55
|
const stringifyPlan = (mode, daily, weekly, monthly, i18n) => {
|
|
56
56
|
const isZh = i18n.language === parrot.ParrotLngs.zh;
|
|
57
57
|
const mark = i18n.t("components.date_mark");
|
|
@@ -4,22 +4,22 @@ var react = require('@linaria/react');
|
|
|
4
4
|
|
|
5
5
|
const CalendarWrapper = /*#__PURE__*/react.styled('div')({
|
|
6
6
|
name: "CalendarWrapper",
|
|
7
|
-
class: "
|
|
7
|
+
class: "E_4100_0_19_c1kchka8",
|
|
8
8
|
propsAsIs: false
|
|
9
9
|
});
|
|
10
10
|
const CalendarYearWrapper = /*#__PURE__*/react.styled('div')({
|
|
11
11
|
name: "CalendarYearWrapper",
|
|
12
|
-
class: "
|
|
12
|
+
class: "E_4100_0_19_ctdb951",
|
|
13
13
|
propsAsIs: false
|
|
14
14
|
});
|
|
15
15
|
const CalendarWeekWrapper = /*#__PURE__*/react.styled('ul')({
|
|
16
16
|
name: "CalendarWeekWrapper",
|
|
17
|
-
class: "
|
|
17
|
+
class: "E_4100_0_19_cvgtyx0",
|
|
18
18
|
propsAsIs: false
|
|
19
19
|
});
|
|
20
20
|
const CalendarMonthWrapper = /*#__PURE__*/react.styled('div')({
|
|
21
21
|
name: "CalendarMonthWrapper",
|
|
22
|
-
class: "
|
|
22
|
+
class: "E_4100_0_19_crprfvb",
|
|
23
23
|
propsAsIs: false
|
|
24
24
|
});
|
|
25
25
|
const CalendarStyle = {
|
|
@@ -30,7 +30,7 @@ const CalendarStyle = {
|
|
|
30
30
|
};
|
|
31
31
|
const InputTimeWrapper = /*#__PURE__*/react.styled('div')({
|
|
32
32
|
name: "InputTimeWrapper",
|
|
33
|
-
class: "
|
|
33
|
+
class: "E_4100_0_19_ipbxcfl",
|
|
34
34
|
propsAsIs: false
|
|
35
35
|
});
|
|
36
36
|
const InputTimeStyle = {
|
|
@@ -38,12 +38,12 @@ const InputTimeStyle = {
|
|
|
38
38
|
};
|
|
39
39
|
const AbsoluteTimeWrapper = /*#__PURE__*/react.styled('div')({
|
|
40
40
|
name: "AbsoluteTimeWrapper",
|
|
41
|
-
class: "
|
|
41
|
+
class: "E_4100_0_19_a120uq8m",
|
|
42
42
|
propsAsIs: false
|
|
43
43
|
});
|
|
44
44
|
const AbsoluteTimeSectionWrapper = /*#__PURE__*/react.styled('div')({
|
|
45
45
|
name: "AbsoluteTimeSectionWrapper",
|
|
46
|
-
class: "
|
|
46
|
+
class: "E_4100_0_19_a15s9m0d",
|
|
47
47
|
propsAsIs: false
|
|
48
48
|
});
|
|
49
49
|
const AbsoluteTimeStyle = {
|
|
@@ -52,7 +52,7 @@ const AbsoluteTimeStyle = {
|
|
|
52
52
|
};
|
|
53
53
|
const RelativeTimeWrapper = /*#__PURE__*/react.styled('div')({
|
|
54
54
|
name: "RelativeTimeWrapper",
|
|
55
|
-
class: "
|
|
55
|
+
class: "E_4100_0_19_r5hl59d",
|
|
56
56
|
propsAsIs: false
|
|
57
57
|
});
|
|
58
58
|
const RelativeTimeStyle = {
|
|
@@ -60,13 +60,13 @@ const RelativeTimeStyle = {
|
|
|
60
60
|
};
|
|
61
61
|
const DateRangePickerWrapper = /*#__PURE__*/react.styled('div')({
|
|
62
62
|
name: "DateRangePickerWrapper",
|
|
63
|
-
class: "
|
|
63
|
+
class: "E_4100_0_19_dhqt3dw",
|
|
64
64
|
propsAsIs: false
|
|
65
65
|
});
|
|
66
|
-
const DateRangePickerPopover = "
|
|
66
|
+
const DateRangePickerPopover = "E_4100_0_19_d956d92";
|
|
67
67
|
const DateRangePickerHistory = /*#__PURE__*/react.styled('div')({
|
|
68
68
|
name: "DateRangePickerHistory",
|
|
69
|
-
class: "
|
|
69
|
+
class: "E_4100_0_19_d1tc7lgk",
|
|
70
70
|
propsAsIs: false
|
|
71
71
|
});
|
|
72
72
|
const DateRangePickerStyle = {
|
|
@@ -74,7 +74,7 @@ const DateRangePickerStyle = {
|
|
|
74
74
|
Popover: DateRangePickerPopover,
|
|
75
75
|
History: DateRangePickerHistory
|
|
76
76
|
};
|
|
77
|
-
const ResetPopoverStyle = "
|
|
77
|
+
const ResetPopoverStyle = "E_4100_0_19_rzaik16";
|
|
78
78
|
|
|
79
79
|
exports.AbsoluteTimeStyle = AbsoluteTimeStyle;
|
|
80
80
|
exports.CalendarStyle = CalendarStyle;
|
|
@@ -14,12 +14,13 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
15
15
|
var Highlighter__default = /*#__PURE__*/_interopDefault(Highlighter);
|
|
16
16
|
|
|
17
|
-
const HighlightKeywordStyle = "
|
|
17
|
+
const HighlightKeywordStyle = "E_4100_0_19_h1ol2wl7";
|
|
18
18
|
const RelativeTime = props => {
|
|
19
19
|
const {
|
|
20
20
|
value,
|
|
21
21
|
config,
|
|
22
22
|
search,
|
|
23
|
+
type = "past",
|
|
23
24
|
onChange
|
|
24
25
|
} = props;
|
|
25
26
|
const {
|
|
@@ -27,8 +28,9 @@ const RelativeTime = props => {
|
|
|
27
28
|
} = useParrotTranslation();
|
|
28
29
|
const configRef = React.useRef(config || common.BASIC_RELATIVE_TIME_CONFIG);
|
|
29
30
|
const [keyword, setKeyword] = React.useState("");
|
|
31
|
+
const normalizedValue = value ? common.normalizeRelativeTime(value, type) : void 0;
|
|
30
32
|
const configList = configRef.current.filter(config2 => {
|
|
31
|
-
const text = common.getDateText(config2, t);
|
|
33
|
+
const text = common.getDateText(config2, t, type);
|
|
32
34
|
return text.indexOf(keyword) > -1;
|
|
33
35
|
});
|
|
34
36
|
return /* @__PURE__ */React__default.default.createElement(DateRangePicker_style.RelativeTimeStyle.Wrapper, null, search ? /* @__PURE__ */React__default.default.createElement(index, {
|
|
@@ -39,12 +41,13 @@ const RelativeTime = props => {
|
|
|
39
41
|
}) : null, /* @__PURE__ */React__default.default.createElement("ul", {
|
|
40
42
|
className: core.cx("past-time-list", !search && "no-search")
|
|
41
43
|
}, configList.map((config2, index) => {
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
+
const normalizedConfig = common.normalizeRelativeTime(config2, type);
|
|
45
|
+
const selected = normalizedConfig.unit === (normalizedValue == null ? void 0 : normalizedValue.unit) && normalizedConfig.value === (normalizedValue == null ? void 0 : normalizedValue.value) && normalizedConfig.type === (normalizedValue == null ? void 0 : normalizedValue.type);
|
|
46
|
+
const text = common.getDateText(normalizedConfig, t, type);
|
|
44
47
|
return /* @__PURE__ */React__default.default.createElement("li", {
|
|
45
48
|
key: index,
|
|
46
|
-
className: core.cx(index$1.Typo.Label.l2_regular, selected && "selected",
|
|
47
|
-
onClick: () => onChange == null ? void 0 : onChange(
|
|
49
|
+
className: core.cx(index$1.Typo.Label.l2_regular, selected && "selected", normalizedConfig.disabled && "disabled"),
|
|
50
|
+
onClick: () => onChange == null ? void 0 : onChange(normalizedConfig)
|
|
48
51
|
}, /* @__PURE__ */React__default.default.createElement(Highlighter__default.default, {
|
|
49
52
|
highlightClassName: core.cx(HighlightKeywordStyle, "highlight"),
|
|
50
53
|
searchWords: [keyword],
|
|
@@ -8,6 +8,25 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
8
8
|
|
|
9
9
|
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
10
10
|
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __defProps = Object.defineProperties;
|
|
13
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
14
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __spreadValues = (a, b) => {
|
|
19
|
+
for (var prop in b || (b = {}))
|
|
20
|
+
if (__hasOwnProp.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
if (__getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
+
if (__propIsEnum.call(b, prop))
|
|
25
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
29
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
11
30
|
const BASIC_RELATIVE_TIME_CONFIG = [
|
|
12
31
|
{
|
|
13
32
|
unit: "m",
|
|
@@ -144,15 +163,89 @@ function time2string(time) {
|
|
|
144
163
|
return _time;
|
|
145
164
|
}
|
|
146
165
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
166
|
+
function normalizeRelativeTime(date, defaultType = "past") {
|
|
167
|
+
if (date.type) {
|
|
168
|
+
return date;
|
|
169
|
+
}
|
|
170
|
+
return __spreadProps(__spreadValues({}, date), {
|
|
171
|
+
type: defaultType
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function getRelativeTimeRange(date, defaultType = "past", nowDate = dayjs__default.default()) {
|
|
175
|
+
const normalizedDate = normalizeRelativeTime(date, defaultType);
|
|
176
|
+
const rangeEnd = normalizedDate.type === "future" ? nowDate.add(normalizedDate.value, normalizedDate.unit) : nowDate.subtract(normalizedDate.value, normalizedDate.unit);
|
|
177
|
+
return [nowDate, rangeEnd];
|
|
178
|
+
}
|
|
179
|
+
function getEffectiveAbsoluteTimeBounds(type = "past", minDate, maxDate, nowDate = dayjs__default.default()) {
|
|
180
|
+
if (type !== "future") {
|
|
181
|
+
return {
|
|
182
|
+
minDate,
|
|
183
|
+
maxDate
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
let effectiveMinDate = nowDate.startOf("day");
|
|
187
|
+
let effectiveMaxDate = nowDate.add(1, "year");
|
|
188
|
+
if (minDate) {
|
|
189
|
+
const parsedMinDate = dayjs__default.default(minDate);
|
|
190
|
+
if (parsedMinDate.isValid() && parsedMinDate.isAfter(effectiveMinDate)) {
|
|
191
|
+
effectiveMinDate = parsedMinDate;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (maxDate) {
|
|
195
|
+
const parsedMaxDate = dayjs__default.default(maxDate);
|
|
196
|
+
if (parsedMaxDate.isValid() && parsedMaxDate.isBefore(effectiveMaxDate)) {
|
|
197
|
+
effectiveMaxDate = parsedMaxDate;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
minDate: effectiveMinDate,
|
|
202
|
+
maxDate: effectiveMaxDate
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function isAbsoluteTimeRangeWithinBounds(range, minDate, maxDate) {
|
|
206
|
+
const [start, end] = range;
|
|
207
|
+
const min = minDate ? dayjs__default.default(minDate) : void 0;
|
|
208
|
+
const max = maxDate ? dayjs__default.default(maxDate) : void 0;
|
|
209
|
+
if (!(start == null ? void 0 : start.isValid()) || !(end == null ? void 0 : end.isValid()) || start.isAfter(end) || min && !min.isValid() || max && !max.isValid() || min && max && min.isAfter(max)) {
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
return (!min || !start.isBefore(min)) && (!max || !end.isAfter(max));
|
|
213
|
+
}
|
|
214
|
+
function hasAbsoluteTimeRangeIntersection(range, minDate, maxDate) {
|
|
215
|
+
const [start, end] = range;
|
|
216
|
+
const min = minDate ? dayjs__default.default(minDate) : void 0;
|
|
217
|
+
const max = maxDate ? dayjs__default.default(maxDate) : void 0;
|
|
218
|
+
if (!(start == null ? void 0 : start.isValid()) || !(end == null ? void 0 : end.isValid()) || start.isAfter(end) || min && !min.isValid() || max && !max.isValid() || min && max && min.isAfter(max)) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
return (!min || !end.isBefore(min)) && (!max || !start.isAfter(max));
|
|
222
|
+
}
|
|
223
|
+
function clampAbsoluteTimeRangeToBounds(range, minDate, maxDate) {
|
|
224
|
+
if (!hasAbsoluteTimeRangeIntersection(range, minDate, maxDate)) {
|
|
225
|
+
return void 0;
|
|
226
|
+
}
|
|
227
|
+
const [start, end] = range;
|
|
228
|
+
const min = minDate ? dayjs__default.default(minDate) : void 0;
|
|
229
|
+
const max = maxDate ? dayjs__default.default(maxDate) : void 0;
|
|
230
|
+
const clampedRange = [
|
|
231
|
+
min && start.isBefore(min) ? min : start,
|
|
232
|
+
max && end.isAfter(max) ? max : end
|
|
233
|
+
];
|
|
234
|
+
return isAbsoluteTimeRangeWithinBounds(clampedRange, minDate, maxDate) ? clampedRange : void 0;
|
|
235
|
+
}
|
|
236
|
+
function getDateText(date, t, defaultType = "past") {
|
|
237
|
+
const normalizedDate = normalizeRelativeTime(date, defaultType);
|
|
238
|
+
const count = normalizedDate.value;
|
|
149
239
|
const dateString = {
|
|
150
240
|
d: t("common.day_count", { count }),
|
|
151
241
|
h: t("common.hour_count", { count }),
|
|
152
242
|
m: t("common.minute_count", { count }),
|
|
153
|
-
M: t("common.month_measure_count", { count })
|
|
154
|
-
|
|
155
|
-
|
|
243
|
+
M: t("common.month_measure_count", { count }),
|
|
244
|
+
y: t("common.year_count", { count })
|
|
245
|
+
}[normalizedDate.unit];
|
|
246
|
+
return `${t(
|
|
247
|
+
normalizedDate.type === "future" ? "components.future" : "components.past"
|
|
248
|
+
)} ${dateString}`;
|
|
156
249
|
}
|
|
157
250
|
function checkDateNotInRange(date, minDate, maxDate) {
|
|
158
251
|
if (!minDate && !maxDate) {
|
|
@@ -190,12 +283,18 @@ function copyDay(day) {
|
|
|
190
283
|
|
|
191
284
|
exports.BASIC_RELATIVE_TIME_CONFIG = BASIC_RELATIVE_TIME_CONFIG;
|
|
192
285
|
exports.checkDateNotInRange = checkDateNotInRange;
|
|
286
|
+
exports.clampAbsoluteTimeRangeToBounds = clampAbsoluteTimeRangeToBounds;
|
|
193
287
|
exports.copyDay = copyDay;
|
|
194
288
|
exports.getClassNameForDateBlock = getClassNameForDateBlock;
|
|
195
289
|
exports.getDateText = getDateText;
|
|
196
290
|
exports.getDiffMonthAndDate = getDiffMonthAndDate;
|
|
291
|
+
exports.getEffectiveAbsoluteTimeBounds = getEffectiveAbsoluteTimeBounds;
|
|
292
|
+
exports.getRelativeTimeRange = getRelativeTimeRange;
|
|
197
293
|
exports.getTime = getTime;
|
|
294
|
+
exports.hasAbsoluteTimeRangeIntersection = hasAbsoluteTimeRangeIntersection;
|
|
295
|
+
exports.isAbsoluteTimeRangeWithinBounds = isAbsoluteTimeRangeWithinBounds;
|
|
198
296
|
exports.isSameDate = isSameDate;
|
|
297
|
+
exports.normalizeRelativeTime = normalizeRelativeTime;
|
|
199
298
|
exports.time2string = time2string;
|
|
200
299
|
exports.time2stringByUnit = time2stringByUnit;
|
|
201
300
|
exports.trimTime = trimTime;
|
|
@@ -45,7 +45,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
45
45
|
const TimeRange = (props) => {
|
|
46
46
|
const {
|
|
47
47
|
visible,
|
|
48
|
-
|
|
48
|
+
panelType,
|
|
49
|
+
direction,
|
|
49
50
|
relativeTime,
|
|
50
51
|
range,
|
|
51
52
|
mode = ["relative", "absolute"],
|
|
@@ -71,6 +72,7 @@ const TimeRange = (props) => {
|
|
|
71
72
|
RelativeTime,
|
|
72
73
|
{
|
|
73
74
|
value: relativeTime,
|
|
75
|
+
type: direction,
|
|
74
76
|
onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
|
|
75
77
|
config: relativeTimeSelectOptions
|
|
76
78
|
}
|
|
@@ -83,6 +85,7 @@ const TimeRange = (props) => {
|
|
|
83
85
|
range: range || [null, null],
|
|
84
86
|
minDate,
|
|
85
87
|
maxDate,
|
|
88
|
+
maxRange,
|
|
86
89
|
onChange: (range2) => onAbsoluteTimeChange == null ? void 0 : onAbsoluteTimeChange(range2),
|
|
87
90
|
onOk: (range2) => onAbsoluteTimeOk == null ? void 0 : onAbsoluteTimeOk(range2)
|
|
88
91
|
}
|
|
@@ -96,6 +99,7 @@ const TimeRange = (props) => {
|
|
|
96
99
|
RelativeTime,
|
|
97
100
|
{
|
|
98
101
|
value: relativeTime,
|
|
102
|
+
type: direction,
|
|
99
103
|
onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
|
|
100
104
|
config: relativeTimeSelectOptions
|
|
101
105
|
}
|
|
@@ -121,7 +125,7 @@ const TimeRange = (props) => {
|
|
|
121
125
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
122
126
|
index$2,
|
|
123
127
|
{
|
|
124
|
-
selectedKey:
|
|
128
|
+
selectedKey: panelType,
|
|
125
129
|
tabs,
|
|
126
130
|
onChange: onTypeChange,
|
|
127
131
|
size: "small"
|
|
@@ -130,23 +134,48 @@ const TimeRange = (props) => {
|
|
|
130
134
|
}
|
|
131
135
|
};
|
|
132
136
|
const TimePickerHistory = (props) => {
|
|
133
|
-
const { history, onSelect } = props;
|
|
137
|
+
const { history, type, minDate, maxDate, onSelect } = props;
|
|
134
138
|
const { t } = useParrotTranslation();
|
|
135
139
|
function contentRender() {
|
|
136
|
-
|
|
140
|
+
const filteredHistory = history.filter((item) => {
|
|
141
|
+
if (Array.isArray(item.value)) {
|
|
142
|
+
if (type !== "future") {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
if (item.value.length !== 2 || !item.value[0] || !item.value[1]) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return common.hasAbsoluteTimeRangeIntersection(
|
|
149
|
+
[dayjs__default.default(item.value[0]), dayjs__default.default(item.value[1])],
|
|
150
|
+
minDate,
|
|
151
|
+
maxDate
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return common.normalizeRelativeTime(item.value, "past").type === type;
|
|
155
|
+
}).sort((a, b) => b.timestamp - a.timestamp);
|
|
156
|
+
if (!filteredHistory.length) {
|
|
137
157
|
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, t("components.empty_search_history"));
|
|
138
158
|
}
|
|
139
|
-
return
|
|
159
|
+
return filteredHistory.map((item, index) => {
|
|
160
|
+
const normalizedRelativeTime = Array.isArray(item.value) ? void 0 : common.normalizeRelativeTime(item.value, "past");
|
|
140
161
|
const text = Array.isArray(item.value) ? `${dayjs__default.default(item.value[0]).format("YYYY-MM-DD hh:mm:ss")} - ${dayjs__default.default(
|
|
141
162
|
item.value[1]
|
|
142
|
-
).format("YYYY-MM-DD hh:mm:ss")}` : common.getDateText(
|
|
143
|
-
const obj = Array.isArray(item.value) ? [dayjs__default.default(item.value[0]), dayjs__default.default(item.value[1])] : item.value;
|
|
163
|
+
).format("YYYY-MM-DD hh:mm:ss")}` : common.getDateText(normalizedRelativeTime, t);
|
|
144
164
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
145
165
|
"li",
|
|
146
166
|
{
|
|
147
167
|
key: index,
|
|
148
168
|
className: index$3.Typo.Label.l2_regular,
|
|
149
|
-
onClick: () =>
|
|
169
|
+
onClick: () => {
|
|
170
|
+
if (Array.isArray(item.value)) {
|
|
171
|
+
onSelect([
|
|
172
|
+
dayjs__default.default(item.value[0]),
|
|
173
|
+
dayjs__default.default(item.value[1])
|
|
174
|
+
]);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
onSelect(normalizedRelativeTime);
|
|
178
|
+
}
|
|
150
179
|
},
|
|
151
180
|
text
|
|
152
181
|
);
|
|
@@ -159,6 +188,7 @@ const DateRangePicker = (props) => {
|
|
|
159
188
|
const {
|
|
160
189
|
size = "medium",
|
|
161
190
|
value,
|
|
191
|
+
type: relativeTimeType = "past",
|
|
162
192
|
history,
|
|
163
193
|
mode = ["relative", "absolute"],
|
|
164
194
|
minDate,
|
|
@@ -169,35 +199,48 @@ const DateRangePicker = (props) => {
|
|
|
169
199
|
} = props;
|
|
170
200
|
const { t } = useParrotTranslation();
|
|
171
201
|
const [datePickerVisible, setDatePickerVisible] = React.useState(false);
|
|
172
|
-
const [
|
|
202
|
+
const [panelType, setPanelType] = React.useState("relative");
|
|
173
203
|
const [range, setRange] = React.useState(
|
|
174
204
|
Array.isArray(value) ? value : void 0
|
|
175
205
|
);
|
|
176
|
-
const relativeTime = !Array.isArray(value) ? value : void 0;
|
|
177
|
-
const
|
|
206
|
+
const relativeTime = value && !Array.isArray(value) ? common.normalizeRelativeTime(value, relativeTimeType) : void 0;
|
|
207
|
+
const { minDate: effectiveMinDate, maxDate: effectiveMaxDate } = common.getEffectiveAbsoluteTimeBounds(relativeTimeType, minDate, maxDate);
|
|
178
208
|
const isAbsoluteValue = value && Array.isArray(value);
|
|
179
|
-
function handleChange(
|
|
209
|
+
function handleChange(type, time) {
|
|
180
210
|
var _a2, _b;
|
|
181
211
|
const rangeHistory = [
|
|
182
212
|
...(_a2 = history == null ? void 0 : history.dateRangeHistories[history.scope]) != null ? _a2 : []
|
|
183
213
|
];
|
|
184
|
-
if (
|
|
214
|
+
if (type === "absolute" && Array.isArray(time)) {
|
|
215
|
+
if (relativeTimeType === "future" && !common.isAbsoluteTimeRangeWithinBounds(
|
|
216
|
+
time,
|
|
217
|
+
effectiveMinDate,
|
|
218
|
+
effectiveMaxDate
|
|
219
|
+
)) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
185
222
|
const value2 = time.map((item) => (item == null ? void 0 : item.format()) || "");
|
|
186
223
|
rangeHistory.push({
|
|
187
|
-
type
|
|
224
|
+
type,
|
|
188
225
|
value: value2,
|
|
189
226
|
timestamp: Date.now()
|
|
190
227
|
});
|
|
191
|
-
onChange == null ? void 0 : onChange(
|
|
192
|
-
} else if (
|
|
228
|
+
onChange == null ? void 0 : onChange(type, time, time);
|
|
229
|
+
} else if (type === "relative" && !Array.isArray(time)) {
|
|
230
|
+
const normalizedRelativeTime = common.normalizeRelativeTime(
|
|
231
|
+
time,
|
|
232
|
+
relativeTimeType
|
|
233
|
+
);
|
|
193
234
|
rangeHistory.push({
|
|
194
|
-
type
|
|
195
|
-
value:
|
|
235
|
+
type,
|
|
236
|
+
value: normalizedRelativeTime,
|
|
196
237
|
timestamp: Date.now()
|
|
197
238
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
239
|
+
onChange == null ? void 0 : onChange(
|
|
240
|
+
type,
|
|
241
|
+
normalizedRelativeTime,
|
|
242
|
+
common.getRelativeTimeRange(normalizedRelativeTime)
|
|
243
|
+
);
|
|
201
244
|
}
|
|
202
245
|
history == null ? void 0 : history.setDateRangeHistory(__spreadProps(__spreadValues({}, (_b = history == null ? void 0 : history.dateRangeHistories) != null ? _b : {}), {
|
|
203
246
|
[history.scope]: rangeHistory
|
|
@@ -205,21 +248,19 @@ const DateRangePicker = (props) => {
|
|
|
205
248
|
setDatePickerVisible(false);
|
|
206
249
|
}
|
|
207
250
|
React.useEffect(() => {
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
onChange == null ? void 0 : onChange("relative", value, [today, pastDay]);
|
|
213
|
-
} else if (isAbsoluteValue) {
|
|
251
|
+
if (relativeTime) {
|
|
252
|
+
setPanelType("relative");
|
|
253
|
+
onChange == null ? void 0 : onChange("relative", relativeTime, common.getRelativeTimeRange(relativeTime));
|
|
254
|
+
} else if (Array.isArray(value)) {
|
|
214
255
|
setRange(value);
|
|
215
|
-
|
|
256
|
+
setPanelType("absolute");
|
|
216
257
|
onChange == null ? void 0 : onChange("absolute", value, value);
|
|
217
258
|
}
|
|
218
|
-
}, [value]);
|
|
259
|
+
}, [relativeTimeType, value]);
|
|
219
260
|
function displayRangeRender() {
|
|
220
261
|
var _a2, _b;
|
|
221
|
-
if (
|
|
222
|
-
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, common.getDateText(
|
|
262
|
+
if (relativeTime) {
|
|
263
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, common.getDateText(relativeTime, t));
|
|
223
264
|
} else if (isAbsoluteValue) {
|
|
224
265
|
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
|
|
225
266
|
index$4,
|
|
@@ -239,21 +280,36 @@ const DateRangePicker = (props) => {
|
|
|
239
280
|
}
|
|
240
281
|
}
|
|
241
282
|
function handleSelectHistory(value2) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
283
|
+
if (Array.isArray(value2)) {
|
|
284
|
+
let selectedRange = [...value2];
|
|
285
|
+
if (relativeTimeType === "future") {
|
|
286
|
+
selectedRange = common.clampAbsoluteTimeRangeToBounds(
|
|
287
|
+
value2,
|
|
288
|
+
effectiveMinDate,
|
|
289
|
+
effectiveMaxDate
|
|
290
|
+
);
|
|
291
|
+
} else {
|
|
292
|
+
const [start, end] = selectedRange;
|
|
293
|
+
if (minDate && start) {
|
|
294
|
+
const parsedMinDate = dayjs__default.default(minDate);
|
|
295
|
+
selectedRange[0] = start.isBefore(parsedMinDate) ? parsedMinDate : start;
|
|
296
|
+
}
|
|
297
|
+
if (maxDate && end) {
|
|
298
|
+
const parsedMaxDate = dayjs__default.default(maxDate);
|
|
299
|
+
selectedRange[1] = end.isAfter(parsedMaxDate) ? parsedMaxDate : end;
|
|
300
|
+
}
|
|
249
301
|
}
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
_value[1] = end.isAfter(_maxDate) ? _maxDate : end;
|
|
302
|
+
if (!selectedRange) {
|
|
303
|
+
return;
|
|
253
304
|
}
|
|
254
|
-
|
|
305
|
+
const [selectedStart, selectedEnd] = selectedRange;
|
|
306
|
+
if (!(selectedStart == null ? void 0 : selectedStart.isValid()) || !(selectedEnd == null ? void 0 : selectedEnd.isValid()) || selectedStart.isAfter(selectedEnd)) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
handleChange("absolute", selectedRange);
|
|
310
|
+
return;
|
|
255
311
|
}
|
|
256
|
-
handleChange(
|
|
312
|
+
handleChange("relative", common.normalizeRelativeTime(value2, "past"));
|
|
257
313
|
}
|
|
258
314
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
259
315
|
DateRangePicker_style.DateRangePickerStyle.Wrapper,
|
|
@@ -292,14 +348,15 @@ const DateRangePicker = (props) => {
|
|
|
292
348
|
TimeRange,
|
|
293
349
|
{
|
|
294
350
|
visible: datePickerVisible,
|
|
295
|
-
|
|
351
|
+
panelType,
|
|
352
|
+
direction: relativeTimeType,
|
|
296
353
|
range,
|
|
297
354
|
relativeTime,
|
|
298
355
|
mode,
|
|
299
|
-
minDate,
|
|
300
|
-
maxDate,
|
|
356
|
+
minDate: effectiveMinDate,
|
|
357
|
+
maxDate: effectiveMaxDate,
|
|
301
358
|
maxRange,
|
|
302
|
-
onTypeChange:
|
|
359
|
+
onTypeChange: setPanelType,
|
|
303
360
|
onRelativeTimeChange: (time) => {
|
|
304
361
|
handleChange("relative", time);
|
|
305
362
|
},
|
|
@@ -330,6 +387,9 @@ const DateRangePicker = (props) => {
|
|
|
330
387
|
TimePickerHistory,
|
|
331
388
|
{
|
|
332
389
|
history: (_a = history.dateRangeHistories[history.scope]) != null ? _a : [],
|
|
390
|
+
type: relativeTimeType,
|
|
391
|
+
minDate: effectiveMinDate,
|
|
392
|
+
maxDate: effectiveMaxDate,
|
|
333
393
|
onSelect: handleSelectHistory
|
|
334
394
|
}
|
|
335
395
|
),
|
|
@@ -10,8 +10,8 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
12
12
|
|
|
13
|
-
const ContentStyle = "
|
|
14
|
-
const SecondaryDescStyle = "
|
|
13
|
+
const ContentStyle = "E_4100_0_19_cevhqx7";
|
|
14
|
+
const SecondaryDescStyle = "E_4100_0_19_snbqlt4";
|
|
15
15
|
const DeleteDialog = props => {
|
|
16
16
|
const {
|
|
17
17
|
t
|