@cloudtower/eagle 0.0.0-config-rc-9 → 0.0.0-data-testid
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/__test__/mockLineChart.d.ts +4 -0
- package/dist/cjs/UIKitProvider/index.js +15 -40
- package/dist/cjs/antd.js +14 -14
- package/dist/cjs/core/AccordionCard/index.js +4 -1
- package/dist/cjs/core/Alert/index.js +12 -4
- package/dist/cjs/core/Arch/index.js +5 -3
- package/dist/cjs/core/AutoComplete/AutoComplete.js +42 -0
- package/dist/cjs/core/Avatar/index.js +3 -1
- package/dist/cjs/core/Banner/banner.style.js +11 -0
- package/dist/cjs/core/Banner/index.js +45 -0
- package/dist/cjs/core/BasicCTError/BasicCTError.style.js +5 -0
- package/dist/cjs/core/BasicCTError/index.js +53 -0
- package/dist/cjs/core/Bit/index.js +5 -3
- package/dist/cjs/core/BitPerSecond/index.js +8 -6
- package/dist/cjs/core/BlankState/index.js +91 -0
- package/dist/cjs/core/BlankState/style.js +5 -0
- package/dist/cjs/core/Bps/index.js +5 -3
- package/dist/cjs/core/Breadcrumb/index.js +4 -1
- package/dist/cjs/core/Button/index.js +1 -2
- package/dist/cjs/core/ButtonGroup/index.js +3 -1
- package/dist/cjs/core/Byte/index.js +7 -5
- package/dist/cjs/core/BytePerSecond/index.js +46 -0
- package/dist/cjs/core/Card/index.js +7 -3
- package/dist/cjs/core/Cascader/cascader.widget.js +12 -11
- package/dist/cjs/core/Cascader/index.js +1 -1
- package/dist/cjs/core/Checkbox/index.js +1 -1
- package/dist/cjs/core/ConfigProvider/index.js +45 -7
- package/dist/cjs/core/DetailCard/index.js +7 -3
- package/dist/cjs/core/DonutChart/index.js +3 -1
- package/dist/cjs/core/DropdownMenu/index.js +9 -4
- package/dist/cjs/core/Duration/index.js +79 -0
- package/dist/cjs/core/Empty/index.js +6 -3
- package/dist/cjs/core/Error/index.js +4 -1
- package/dist/cjs/core/FailedLoad/index.js +4 -1
- package/dist/cjs/core/Fields/FieldsBoolean/index.js +11 -2
- package/dist/cjs/core/Fields/FieldsDateTime/index.js +5 -1
- package/dist/cjs/core/Fields/FieldsDateTimeRange/index.js +25 -5
- package/dist/cjs/core/Fields/FieldsEnum/index.js +6 -4
- package/dist/cjs/core/Fields/FieldsFloat/index.js +6 -3
- package/dist/cjs/core/Fields/FieldsInt/index.js +6 -3
- package/dist/cjs/core/Fields/FieldsInteger/index.js +6 -3
- package/dist/cjs/core/Fields/FieldsString/index.js +14 -4
- package/dist/cjs/core/Fields/FieldsTextArea/index.js +6 -3
- package/dist/cjs/core/Fields/FieldsTimePicker/index.js +10 -6
- package/dist/cjs/core/FormItem/index.js +15 -1
- package/dist/cjs/core/Frequency/index.js +5 -3
- package/dist/cjs/core/ImmersiveDialog/index.js +230 -0
- package/dist/cjs/core/ImmersiveDialog/styles.js +31 -0
- package/dist/cjs/core/Input/index.js +15 -3
- package/dist/cjs/core/InputInteger/index.js +15 -3
- package/dist/cjs/core/InputNumber/index.js +15 -3
- package/dist/cjs/core/InputPassword/index.js +15 -3
- package/dist/cjs/core/KitStoreProvider/index.js +10 -0
- package/dist/cjs/core/{Modal → LegacyModal}/index.js +60 -45
- package/dist/cjs/core/LegacySelect/index.js +203 -0
- package/dist/cjs/core/LegacySelect/select.style.js +5 -0
- package/dist/cjs/core/Legend/index.js +128 -0
- package/dist/cjs/core/LineChart/LineChartActions.js +52 -0
- package/dist/cjs/core/LineChart/LineChartLegend.js +120 -0
- package/dist/cjs/core/LineChart/LineChartToolBar.js +56 -0
- package/dist/cjs/core/LineChart/Pointer.js +45 -0
- package/dist/cjs/core/LineChart/RenderChart.js +317 -0
- package/dist/cjs/core/LineChart/TooltipFormatter.js +71 -0
- package/dist/cjs/core/LineChart/index.js +68 -0
- package/dist/cjs/core/LineChart/styled.js +35 -0
- package/dist/cjs/core/LineChart/type.js +30 -0
- package/dist/cjs/core/LineChart/utils.js +394 -0
- package/dist/cjs/core/Loading/index.js +23 -2
- package/dist/cjs/core/LocalUpload/LocalUpload.hooks.js +66 -0
- package/dist/cjs/core/LocalUpload/LocalUpload.js +116 -0
- package/dist/cjs/core/LocalUpload/LocalUpload.style.js +13 -0
- package/dist/cjs/core/LocalUpload/LocalUpload.widget.js +379 -0
- package/dist/cjs/core/MediumDialog/MediumDialog.js +57 -0
- package/dist/cjs/core/Metric/index.js +3 -1
- package/dist/cjs/core/ModalStack/index.js +6 -0
- package/dist/cjs/core/Nav/index.js +5 -2
- package/dist/cjs/core/Pagination/index.js +7 -1
- package/dist/cjs/core/Percent/index.js +4 -3
- package/dist/cjs/core/Progress/index.js +6 -4
- package/dist/cjs/core/Progress/progress.widgets.js +6 -7
- package/dist/cjs/core/Radio/index.js +15 -7
- package/dist/cjs/core/SearchInput/SearchInput.hook.js +124 -0
- package/dist/cjs/core/SearchInput/SearchInput.js +253 -0
- package/dist/cjs/core/SearchInput/SearchInput.style.js +13 -0
- package/dist/cjs/core/SearchInput/index.js +137 -28
- package/dist/cjs/core/Second/index.js +16 -5
- package/dist/cjs/core/SegmentControl/index.js +1 -1
- package/dist/cjs/core/Select/index.js +106 -117
- package/dist/cjs/core/Select/select.style.js +11 -0
- package/dist/cjs/core/Select/select.widgets.js +63 -0
- package/dist/cjs/core/SidebarMenu/SidebarMenu.js +1 -7
- package/dist/cjs/core/SimplePagination/index.js +8 -2
- package/dist/cjs/core/Skeleton/Content.js +30 -0
- package/dist/cjs/core/Skeleton/index.js +13 -0
- package/dist/cjs/core/SmallDialog/SmallDialog.js +172 -0
- package/dist/cjs/core/SmallDialog/SmallDialog.style.js +17 -0
- package/dist/cjs/core/SmallDialog/SmallDialog.widget.js +28 -0
- package/dist/cjs/core/Speed/index.js +5 -3
- package/dist/cjs/core/StepProgress/index.js +3 -1
- package/dist/cjs/core/Styled/index.js +2 -0
- package/dist/cjs/core/Switch/index.js +5 -3
- package/dist/cjs/core/Tab/Tab.js +118 -0
- package/dist/cjs/core/Tab/Tab.style.js +17 -0
- package/dist/cjs/core/Tab/Tab.type.js +9 -0
- package/dist/cjs/core/Tab/useTabAdaptiveLayout.js +73 -0
- package/dist/cjs/core/Table/index.js +7 -3
- package/dist/cjs/core/TableForm/AddRowButton.js +13 -5
- package/dist/cjs/core/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/cjs/core/TableForm/TableFormBodyCell.js +13 -17
- package/dist/cjs/core/TableForm/TableFormBodyRows.js +8 -3
- package/dist/cjs/core/TableForm/TableFormHeaderCell.js +42 -20
- package/dist/cjs/core/TableForm/index.js +41 -21
- package/dist/cjs/core/TextArea/index.js +21 -3
- package/dist/cjs/core/Time/index.js +9 -8
- package/dist/cjs/core/TimePicker/index.js +1 -9
- package/dist/cjs/core/TimeZoneSelect/index.js +4 -2
- package/dist/cjs/core/Timeline/Timeline.style.js +13 -0
- package/dist/cjs/core/Timeline/Timeline.widget.js +114 -0
- package/dist/cjs/core/Timeline/index.js +143 -0
- package/dist/cjs/core/Tooltip/EllipsisTooltipContent.js +55 -0
- package/dist/cjs/core/Tooltip/index.js +4 -1
- package/dist/cjs/core/Truncate/index.js +3 -1
- package/dist/cjs/core/WizardDialog/index.js +175 -0
- package/dist/cjs/core/WizardDialog/styles.js +11 -0
- package/dist/cjs/core/index.js +24 -18
- package/dist/cjs/core/message/index.js +5 -210
- package/dist/cjs/core/message/message.js +245 -0
- package/dist/cjs/core/message/useMessage.js +12 -0
- package/dist/cjs/core/message-group/index.js +3 -1
- package/dist/cjs/coreX/BarChart/index.js +77 -18
- package/dist/cjs/coreX/BatchOperation/index.js +4 -1
- package/dist/cjs/coreX/ChartWithTooltip/index.js +14 -12
- package/dist/cjs/coreX/CheckPointList/checkpointlist.style.js +9 -0
- package/dist/cjs/coreX/CheckPointList/index.js +118 -0
- package/dist/cjs/coreX/CircleLoading/index.js +66 -0
- package/dist/cjs/coreX/Copy/CopyButton.js +40 -0
- package/dist/cjs/coreX/Copy/CopyTooltip.js +66 -0
- package/dist/cjs/coreX/DateRangePicker/AbsoluteDate.js +2 -1
- package/dist/cjs/coreX/DateRangePicker/Calendar.js +82 -61
- package/dist/cjs/coreX/DateRangePicker/common.js +7 -5
- package/dist/cjs/coreX/DateRangePicker/index.js +25 -8
- package/dist/cjs/coreX/DateRangePicker/utils.js +5 -0
- package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +53 -0
- package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +137 -0
- package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.type.js +11 -0
- package/dist/cjs/coreX/InfoRowList/InfoRow.js +31 -0
- package/dist/cjs/coreX/InfoRowList/InfoRowList.js +60 -0
- package/dist/cjs/coreX/KubeConfigModal/KubeConfigModal.style.js +29 -0
- package/dist/cjs/coreX/KubeConfigModal/index.js +102 -0
- package/dist/cjs/coreX/KubeConfigModal/utils.js +25 -0
- package/dist/cjs/coreX/OverflowTooltip/index.js +21 -8
- package/dist/cjs/coreX/Show/index.js +20 -0
- package/dist/cjs/coreX/Sider/index.js +109 -0
- package/dist/cjs/coreX/SummaryTable/index.js +6 -3
- package/dist/cjs/coreX/UnderlineTootip/index.js +70 -0
- package/dist/cjs/coreX/UnitWithChart/index.js +14 -12
- package/dist/cjs/hooks/useAntdPatchEnLocales.js +35 -0
- package/dist/cjs/hooks/useCTErrorMsg.js +25 -0
- package/dist/cjs/hooks/useFormatDuration.js +35 -0
- package/dist/cjs/hooks/useLegacyComponentWarning.js +16 -0
- package/dist/cjs/index.js +376 -260
- package/dist/cjs/legacy-antd.js +58 -54
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/store/modal.js +3 -0
- package/dist/cjs/styles/token/animation.js +22 -1
- package/dist/cjs/styles/token/color.js +24 -0
- package/dist/cjs/utils/constants.js +10 -6
- package/dist/cjs/utils/cterror.js +64 -0
- package/dist/cjs/utils/formatDuration.js +67 -0
- package/dist/cjs/utils/tower.js +98 -0
- package/dist/cjs/utils/unit.js +19 -0
- package/dist/components.css +6532 -61924
- package/dist/esm/UIKitProvider/index.js +9 -28
- package/dist/esm/antd.js +3 -3
- package/dist/esm/core/AccordionCard/index.js +4 -1
- package/dist/esm/core/Alert/index.js +12 -4
- package/dist/esm/core/Arch/index.js +5 -3
- package/dist/esm/core/AutoComplete/AutoComplete.js +35 -0
- package/dist/esm/core/Avatar/index.js +3 -1
- package/dist/esm/core/Banner/banner.style.js +6 -0
- package/dist/esm/core/Banner/index.js +38 -0
- package/dist/esm/core/BasicCTError/BasicCTError.style.js +3 -0
- package/dist/esm/core/BasicCTError/index.js +47 -0
- package/dist/esm/core/Bit/index.js +5 -3
- package/dist/esm/core/BitPerSecond/index.js +8 -6
- package/dist/esm/core/BlankState/index.js +85 -0
- package/dist/esm/core/BlankState/style.js +3 -0
- package/dist/esm/core/Bps/index.js +5 -3
- package/dist/esm/core/Breadcrumb/index.js +4 -1
- package/dist/esm/core/Button/index.js +1 -2
- package/dist/esm/core/ButtonGroup/index.js +3 -1
- package/dist/esm/core/Byte/index.js +7 -5
- package/dist/esm/core/BytePerSecond/index.js +40 -0
- package/dist/esm/core/Card/index.js +7 -3
- package/dist/esm/core/Cascader/cascader.widget.js +3 -2
- package/dist/esm/core/Cascader/index.js +2 -2
- package/dist/esm/core/Checkbox/index.js +1 -1
- package/dist/esm/core/ConfigProvider/index.js +40 -9
- package/dist/esm/core/DetailCard/index.js +7 -3
- package/dist/esm/core/DonutChart/index.js +3 -1
- package/dist/esm/core/DropdownMenu/index.js +9 -4
- package/dist/esm/core/Duration/index.js +73 -0
- package/dist/esm/core/Empty/index.js +6 -3
- package/dist/esm/core/Error/index.js +4 -1
- package/dist/esm/core/FailedLoad/index.js +4 -1
- package/dist/esm/core/Fields/FieldsBoolean/index.js +11 -2
- package/dist/esm/core/Fields/FieldsDateTime/index.js +5 -1
- package/dist/esm/core/Fields/FieldsDateTimeRange/index.js +25 -5
- package/dist/esm/core/Fields/FieldsEnum/index.js +8 -6
- package/dist/esm/core/Fields/FieldsFloat/index.js +6 -3
- package/dist/esm/core/Fields/FieldsInt/index.js +6 -3
- package/dist/esm/core/Fields/FieldsInteger/index.js +6 -3
- package/dist/esm/core/Fields/FieldsString/index.js +14 -4
- package/dist/esm/core/Fields/FieldsTextArea/index.js +6 -3
- package/dist/esm/core/Fields/FieldsTimePicker/index.js +8 -4
- package/dist/esm/core/FormItem/index.js +15 -1
- package/dist/esm/core/Frequency/index.js +5 -3
- package/dist/esm/core/ImmersiveDialog/index.js +223 -0
- package/dist/esm/core/ImmersiveDialog/styles.js +16 -0
- package/dist/esm/core/Input/index.js +15 -3
- package/dist/esm/core/InputInteger/index.js +15 -3
- package/dist/esm/core/InputNumber/index.js +15 -3
- package/dist/esm/core/InputPassword/index.js +15 -3
- package/dist/esm/core/KitStoreProvider/index.js +10 -1
- package/dist/esm/core/{Modal → LegacyModal}/index.js +62 -47
- package/dist/esm/core/LegacySelect/index.js +195 -0
- package/dist/esm/core/LegacySelect/select.style.js +3 -0
- package/dist/esm/core/Legend/index.js +117 -0
- package/dist/esm/core/LineChart/LineChartActions.js +46 -0
- package/dist/esm/core/LineChart/LineChartLegend.js +110 -0
- package/dist/esm/core/LineChart/LineChartToolBar.js +50 -0
- package/dist/esm/core/LineChart/Pointer.js +38 -0
- package/dist/esm/core/LineChart/RenderChart.js +309 -0
- package/dist/esm/core/LineChart/TooltipFormatter.js +64 -0
- package/dist/esm/core/LineChart/index.js +59 -0
- package/dist/esm/core/LineChart/styled.js +25 -0
- package/dist/esm/core/LineChart/type.js +26 -0
- package/dist/esm/core/LineChart/utils.js +369 -0
- package/dist/esm/core/Loading/index.js +22 -2
- package/dist/esm/core/LocalUpload/LocalUpload.hooks.js +63 -0
- package/dist/esm/core/LocalUpload/LocalUpload.js +110 -0
- package/dist/esm/core/LocalUpload/LocalUpload.style.js +10 -0
- package/dist/esm/core/LocalUpload/LocalUpload.widget.js +365 -0
- package/dist/esm/core/MediumDialog/MediumDialog.js +51 -0
- package/dist/esm/core/Metric/index.js +3 -1
- package/dist/esm/core/ModalStack/index.js +7 -1
- package/dist/esm/core/Nav/index.js +5 -2
- package/dist/esm/core/Pagination/index.js +7 -1
- package/dist/esm/core/Percent/index.js +4 -3
- package/dist/esm/core/Progress/index.js +7 -5
- package/dist/esm/core/Progress/progress.widgets.js +5 -6
- package/dist/esm/core/Radio/index.js +15 -7
- package/dist/esm/core/SearchInput/SearchInput.hook.js +117 -0
- package/dist/esm/core/SearchInput/SearchInput.js +247 -0
- package/dist/esm/core/SearchInput/SearchInput.style.js +7 -0
- package/dist/esm/core/SearchInput/index.js +137 -28
- package/dist/esm/core/Second/index.js +16 -5
- package/dist/esm/core/SegmentControl/index.js +2 -2
- package/dist/esm/core/Select/index.js +104 -116
- package/dist/esm/core/Select/select.style.js +6 -0
- package/dist/esm/core/Select/select.widgets.js +57 -0
- package/dist/esm/core/SidebarMenu/SidebarMenu.js +2 -8
- package/dist/esm/core/SimplePagination/index.js +8 -2
- package/dist/esm/core/Skeleton/Content.js +23 -0
- package/dist/esm/core/Skeleton/index.js +7 -0
- package/dist/esm/core/SmallDialog/SmallDialog.js +165 -0
- package/dist/esm/core/SmallDialog/SmallDialog.style.js +9 -0
- package/dist/esm/core/SmallDialog/SmallDialog.widget.js +20 -0
- package/dist/esm/core/Speed/index.js +5 -3
- package/dist/esm/core/StepProgress/index.js +3 -1
- package/dist/esm/core/Styled/index.js +2 -1
- package/dist/esm/core/Switch/index.js +5 -3
- package/dist/esm/core/Tab/Tab.js +112 -0
- package/dist/esm/core/Tab/Tab.style.js +12 -0
- package/dist/esm/core/Tab/Tab.type.js +7 -0
- package/dist/esm/core/Tab/useTabAdaptiveLayout.js +71 -0
- package/dist/esm/core/Table/index.js +7 -3
- package/dist/esm/core/TableForm/AddRowButton.js +13 -5
- package/dist/esm/core/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/esm/core/TableForm/TableFormBodyCell.js +14 -18
- package/dist/esm/core/TableForm/TableFormBodyRows.js +8 -3
- package/dist/esm/core/TableForm/TableFormHeaderCell.js +39 -17
- package/dist/esm/core/TableForm/index.js +42 -22
- package/dist/esm/core/TextArea/index.js +21 -3
- package/dist/esm/core/Time/index.js +9 -8
- package/dist/esm/core/TimePicker/index.js +1 -9
- package/dist/esm/core/TimeZoneSelect/index.js +5 -3
- package/dist/esm/core/Timeline/Timeline.style.js +7 -0
- package/dist/esm/core/Timeline/Timeline.widget.js +107 -0
- package/dist/esm/core/Timeline/index.js +136 -0
- package/dist/esm/core/Tooltip/EllipsisTooltipContent.js +49 -0
- package/dist/esm/core/Tooltip/index.js +4 -1
- package/dist/esm/core/Truncate/index.js +3 -1
- package/dist/esm/core/WizardDialog/index.js +169 -0
- package/dist/esm/core/WizardDialog/styles.js +6 -0
- package/dist/esm/core/index.js +6 -2
- package/dist/esm/core/message/index.js +4 -180
- package/dist/esm/core/message/message.js +209 -0
- package/dist/esm/core/message/useMessage.js +9 -0
- package/dist/esm/core/message-group/index.js +3 -1
- package/dist/esm/coreX/BarChart/index.js +77 -19
- package/dist/esm/coreX/BatchOperation/index.js +4 -1
- package/dist/esm/coreX/ChartWithTooltip/index.js +2 -0
- package/dist/esm/coreX/CheckPointList/checkpointlist.style.js +5 -0
- package/dist/esm/coreX/CheckPointList/index.js +110 -0
- package/dist/esm/coreX/CircleLoading/index.js +59 -0
- package/dist/esm/coreX/Copy/CopyButton.js +34 -0
- package/dist/esm/coreX/Copy/CopyTooltip.js +59 -0
- package/dist/esm/coreX/DateRangePicker/AbsoluteDate.js +2 -1
- package/dist/esm/coreX/DateRangePicker/Calendar.js +83 -62
- package/dist/esm/coreX/DateRangePicker/common.js +7 -5
- package/dist/esm/coreX/DateRangePicker/index.js +26 -9
- package/dist/esm/coreX/DateRangePicker/utils.js +3 -0
- package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +47 -0
- package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +131 -0
- package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.type.js +9 -0
- package/dist/esm/coreX/InfoRowList/InfoRow.js +25 -0
- package/dist/esm/coreX/InfoRowList/InfoRowList.js +54 -0
- package/dist/esm/coreX/KubeConfigModal/KubeConfigModal.style.js +20 -0
- package/dist/esm/coreX/KubeConfigModal/index.js +96 -0
- package/dist/esm/coreX/KubeConfigModal/utils.js +22 -0
- package/dist/esm/coreX/OverflowTooltip/index.js +21 -8
- package/dist/esm/coreX/Show/index.js +14 -0
- package/dist/esm/coreX/Sider/index.js +102 -0
- package/dist/esm/coreX/SummaryTable/index.js +6 -3
- package/dist/esm/coreX/UnderlineTootip/index.js +61 -0
- package/dist/esm/coreX/UnitWithChart/index.js +2 -0
- package/dist/esm/hooks/useAntdPatchEnLocales.js +29 -0
- package/dist/esm/hooks/useCTErrorMsg.js +23 -0
- package/dist/esm/hooks/useFormatDuration.js +33 -0
- package/dist/esm/hooks/useLegacyComponentWarning.js +14 -0
- package/dist/esm/index.js +47 -10
- package/dist/esm/legacy-antd.js +10 -6
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/store/modal.js +3 -0
- package/dist/esm/styles/token/animation.js +22 -2
- package/dist/esm/styles/token/color.js +24 -0
- package/dist/esm/utils/constants.js +6 -6
- package/dist/esm/utils/cterror.js +58 -0
- package/dist/esm/utils/formatDuration.js +65 -0
- package/dist/esm/utils/tower.js +93 -1
- package/dist/esm/utils/unit.js +17 -0
- package/dist/linaria.merged.scss +8642 -0
- package/dist/src/UIKitProvider/UIKitProvider.stories.d.ts +1 -2
- package/dist/src/UIKitProvider/index.d.ts +4 -6
- package/dist/src/antd.d.ts +3 -2
- package/dist/src/core/AccordionCard/accordionCard.type.d.ts +1 -0
- package/dist/src/core/Alert/alert.type.d.ts +6 -4
- package/dist/src/core/Antd5Flex/index.d.ts +2 -0
- package/dist/src/core/Antd5Tree/Antd5Tree.d.ts +1 -0
- package/dist/src/core/Antd5Tree/Antd5Tree.type.d.ts +4 -0
- package/dist/src/core/Antd5Tree/index.d.ts +2 -0
- package/dist/src/core/Arch/arch.type.d.ts +1 -0
- package/dist/src/core/AutoComplete/AutoComplete.d.ts +6 -0
- package/dist/src/core/AutoComplete/index.d.ts +1 -0
- package/dist/src/core/Avatar/avatar.type.d.ts +1 -0
- package/dist/src/core/Banner/banner.style.d.ts +4 -0
- package/dist/src/core/Banner/banner.types.d.ts +29 -0
- package/dist/src/core/Banner/index.d.ts +3 -0
- package/dist/src/core/BasicCTError/BasicCTError.style.d.ts +1 -0
- package/dist/src/core/BasicCTError/BasicCTError.type.d.ts +62 -0
- package/dist/src/core/BasicCTError/index.d.ts +3 -0
- package/dist/src/core/BitPerSecond/index.d.ts +2 -2
- package/dist/src/core/BlankState/index.d.ts +4 -0
- package/dist/src/core/BlankState/style.d.ts +1 -0
- package/dist/src/core/BlankState/type.d.ts +50 -0
- package/dist/src/core/Breadcrumb/breadcrumb.type.d.ts +2 -0
- package/dist/src/core/Button/button.type.d.ts +1 -0
- package/dist/src/core/BytePerSecond/index.d.ts +3 -0
- package/dist/src/core/Card/index.d.ts +8 -0
- package/dist/src/core/Cascader/cascader.type.d.ts +3 -1
- package/dist/src/core/Checkbox/index.d.ts +1 -1
- package/dist/src/core/ConfigProvider/index.d.ts +9 -2
- package/dist/src/core/DetailCard/detailCard.type.d.ts +1 -0
- package/dist/src/core/DonutChart/index.d.ts +1 -0
- package/dist/src/core/DropdownMenu/dropdownMenu.type.d.ts +2 -0
- package/dist/src/core/DropdownMenu/index.d.ts +1 -0
- package/dist/src/core/Duration/duration.type.d.ts +50 -0
- package/dist/src/core/Duration/index.d.ts +4 -0
- package/dist/src/core/Empty/index.d.ts +2 -1
- package/dist/src/core/Error/index.d.ts +2 -1
- package/dist/src/core/FailedLoad/index.d.ts +1 -0
- package/dist/src/core/Fields/FieldsBoolean/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsDateTime/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsEnum/fieldsEnum.type.d.ts +1 -0
- package/dist/src/core/Fields/FieldsEnum/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsFloat/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsInt/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsInteger/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsString/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsTextArea/index.d.ts +1 -1
- package/dist/src/core/Fields/FieldsTimePicker/index.d.ts +1 -1
- package/dist/src/core/Fields/__test__/data-testid.test.d.ts +1 -0
- package/dist/src/core/Fields/fields.type.d.ts +2 -1
- package/dist/src/core/Fields/index.d.ts +13 -9
- package/dist/src/core/FormItem/index.d.ts +3 -1
- package/dist/src/core/ImmersiveDialog/index.d.ts +3 -0
- package/dist/src/core/ImmersiveDialog/styles.d.ts +14 -0
- package/dist/src/core/ImmersiveDialog/type.d.ts +156 -0
- package/dist/src/core/Input/index.d.ts +2 -4
- package/dist/src/core/Input/input.type.d.ts +9 -0
- package/dist/src/core/InputPassword/index.d.ts +7 -2
- package/dist/src/core/KitStoreProvider/index.d.ts +1 -0
- package/dist/src/core/LegacyModal/LegacyModal.type.d.ts +71 -0
- package/dist/src/core/LegacyModal/index.d.ts +16 -0
- package/dist/src/core/LegacySelect/index.d.ts +4 -0
- package/dist/src/core/LegacySelect/select.style.d.ts +1 -0
- package/dist/src/core/LegacySelect/select.type.d.ts +32 -0
- package/dist/src/core/Legend/__test__/h5_css.test.d.ts +1 -0
- package/dist/src/core/Legend/index.d.ts +9 -0
- package/dist/src/core/Legend/legend.type.d.ts +27 -0
- package/dist/src/core/LineChart/LineChartActions.d.ts +7 -0
- package/dist/src/core/LineChart/LineChartLegend.d.ts +18 -0
- package/dist/src/core/LineChart/LineChartToolBar.d.ts +20 -0
- package/dist/src/core/LineChart/Pointer.d.ts +6 -0
- package/dist/src/core/LineChart/RenderChart.d.ts +45 -0
- package/dist/src/core/LineChart/TooltipFormatter.d.ts +10 -0
- package/dist/src/core/LineChart/__test__/h5_css.test.d.ts +1 -0
- package/dist/src/core/LineChart/index.d.ts +8 -0
- package/dist/src/core/LineChart/styled.d.ts +12 -0
- package/dist/src/core/LineChart/type.d.ts +196 -0
- package/dist/src/core/LineChart/utils.d.ts +56 -0
- package/dist/src/core/Loading/loading.type.d.ts +2 -2
- package/dist/src/core/LocalUpload/LocalUpload.d.ts +15 -0
- package/dist/src/core/LocalUpload/LocalUpload.hooks.d.ts +32 -0
- package/dist/src/core/LocalUpload/LocalUpload.style.d.ts +3 -0
- package/dist/src/core/LocalUpload/LocalUpload.type.d.ts +179 -0
- package/dist/src/core/LocalUpload/LocalUpload.widget.d.ts +23 -0
- package/dist/src/core/LocalUpload/index.d.ts +2 -0
- package/dist/src/core/MediumDialog/MediumDialog.d.ts +3 -0
- package/dist/src/core/MediumDialog/MediumDialog.type.d.ts +53 -0
- package/dist/src/core/MediumDialog/index.d.ts +1 -0
- package/dist/src/core/Metric/index.d.ts +1 -0
- package/dist/src/core/Metric/metric.d.ts +1 -1
- package/dist/src/core/Nav/nav.type.d.ts +2 -0
- package/dist/src/core/Pagination/pagination.type.d.ts +1 -0
- package/dist/src/core/Progress/progress.type.d.ts +4 -0
- package/dist/src/core/Radio/index.d.ts +3 -1
- package/dist/src/core/Radio/radio.type.d.ts +2 -0
- package/dist/src/core/SearchInput/SearchInput.d.ts +2 -0
- package/dist/src/core/SearchInput/SearchInput.hook.d.ts +9 -0
- package/dist/src/core/SearchInput/SearchInput.style.d.ts +5 -0
- package/dist/src/core/SearchInput/__test__/SearchInput.hook.test.d.ts +1 -0
- package/dist/src/core/SearchInput/index.d.ts +2 -4
- package/dist/src/core/SearchInput/searchInput.type.d.ts +149 -2
- package/dist/src/core/SegmentControl/__test__/data-testid.test.d.ts +1 -0
- package/dist/src/core/SegmentControl/segmentControl.type.d.ts +2 -0
- package/dist/src/core/Select/index.d.ts +1 -0
- package/dist/src/core/Select/select.style.d.ts +4 -0
- package/dist/src/core/Select/select.type.d.ts +6 -31
- package/dist/src/core/Select/select.widgets.d.ts +7 -0
- package/dist/src/core/SimplePagination/simplePagination.type.d.ts +1 -0
- package/dist/src/core/Skeleton/Content.d.ts +8 -0
- package/dist/src/core/Skeleton/index.d.ts +8 -0
- package/dist/src/core/SmallDialog/SmallDialog.d.ts +3 -0
- package/dist/src/core/SmallDialog/SmallDialog.style.d.ts +7 -0
- package/dist/src/core/SmallDialog/SmallDialog.type.d.ts +183 -0
- package/dist/src/core/SmallDialog/SmallDialog.widget.d.ts +8 -0
- package/dist/src/core/SmallDialog/index.d.ts +3 -0
- package/dist/src/core/StepProgress/stepProgress.type.d.ts +1 -0
- package/dist/src/core/Steps/steps.type.d.ts +1 -0
- package/dist/src/core/Styled/index.d.ts +7 -0
- package/dist/src/core/Switch/switch.type.d.ts +1 -0
- package/dist/src/core/Tab/Tab.d.ts +3 -0
- package/dist/src/core/Tab/Tab.style.d.ts +5 -0
- package/dist/src/core/Tab/Tab.type.d.ts +46 -0
- package/dist/src/core/Tab/index.d.ts +1 -0
- package/dist/src/core/Tab/useTabAdaptiveLayout.d.ts +23 -0
- package/dist/src/core/Table/table.type.d.ts +166 -7
- package/dist/src/core/TableForm/types.d.ts +260 -10
- package/dist/src/core/TextArea/textArea.type.d.ts +1 -0
- package/dist/src/core/Time/index.d.ts +1 -1
- package/dist/src/core/Time/time.type.d.ts +5 -0
- package/dist/src/core/TimePicker/index.d.ts +2 -0
- package/dist/src/core/TimeZoneSelect/timeZoneSelect.type.d.ts +1 -0
- package/dist/src/core/Timeline/Timeline.style.d.ts +5 -0
- package/dist/src/core/Timeline/Timeline.type.d.ts +231 -0
- package/dist/src/core/Timeline/Timeline.widget.d.ts +5 -0
- package/dist/src/core/Timeline/index.d.ts +14 -0
- package/dist/src/core/Tooltip/EllipsisTooltipContent.d.ts +4 -0
- package/dist/src/core/Tooltip/index.d.ts +7 -1
- package/dist/src/core/Tooltip/tooltip.type.d.ts +22 -0
- package/dist/src/core/Truncate/index.d.ts +1 -0
- package/dist/src/core/Units/units.type.d.ts +76 -0
- package/dist/src/core/WizardDialog/index.d.ts +3 -0
- package/dist/src/core/WizardDialog/styles.d.ts +4 -0
- package/dist/src/core/WizardDialog/type.d.ts +167 -0
- package/dist/src/core/__test__/data-testid.test.d.ts +1 -0
- package/dist/src/core/index.d.ts +31 -15
- package/dist/src/core/message/index.d.ts +4 -52
- package/dist/src/core/message/message.d.ts +58 -0
- package/dist/src/core/message/useMessage.d.ts +4 -0
- package/dist/src/coreX/BarChart/index.d.ts +2 -0
- package/dist/src/coreX/CheckPointList/checkpointlist.style.d.ts +3 -0
- package/dist/src/coreX/CheckPointList/checkpointlist.type.d.ts +113 -0
- package/dist/src/coreX/CheckPointList/index.d.ts +8 -0
- package/dist/src/coreX/CircleLoading/index.d.ts +3 -0
- package/dist/src/coreX/Copy/CopyButton.d.ts +5 -0
- package/dist/src/coreX/Copy/CopyButton.type.d.ts +8 -0
- package/dist/src/coreX/Copy/CopyTooltip.d.ts +5 -0
- package/dist/src/coreX/Copy/CopyTooltip.typs.d.ts +16 -0
- package/dist/src/coreX/Copy/index.d.ts +2 -0
- package/dist/src/coreX/DateRangePicker/__tests__/utils.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +14 -1
- package/dist/src/coreX/DateRangePicker/utils.d.ts +7 -0
- package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.d.ts +3 -0
- package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +116 -0
- package/dist/src/coreX/Dialogs/DeleteDialog/index.d.ts +2 -0
- package/dist/src/coreX/Dialogs/RejectDialog/RejectDialog.d.ts +3 -0
- package/dist/src/coreX/Dialogs/RejectDialog/RejectDialog.type.d.ts +181 -0
- package/dist/src/coreX/Dialogs/RejectDialog/index.d.ts +2 -0
- package/dist/src/coreX/Dialogs/index.d.ts +2 -0
- package/dist/src/coreX/InfoRowList/InfoRow.d.ts +7 -0
- package/dist/src/coreX/InfoRowList/InfoRowList.d.ts +3 -0
- package/dist/src/coreX/InfoRowList/InfoRowList.type.d.ts +63 -0
- package/dist/src/coreX/InfoRowList/index.d.ts +1 -0
- package/dist/src/coreX/KubeConfigModal/KubeConfigModal.style.d.ts +9 -0
- package/dist/src/coreX/KubeConfigModal/KubeConfigModal.type.d.ts +21 -0
- package/dist/src/coreX/KubeConfigModal/index.d.ts +4 -0
- package/dist/src/coreX/KubeConfigModal/utils.d.ts +2 -0
- package/dist/src/coreX/OverflowTooltip/overflowTooltip.type.d.ts +2 -1
- package/dist/src/coreX/Show/index.d.ts +3 -0
- package/dist/src/coreX/Show/show.type.d.ts +13 -0
- package/dist/src/coreX/Sider/Sider.type.d.ts +42 -0
- package/dist/src/coreX/Sider/index.d.ts +5 -0
- package/dist/src/coreX/SummaryTable/index.d.ts +1 -0
- package/dist/src/coreX/UnderlineTootip/index.d.ts +43 -0
- package/dist/src/coreX/UnitWithChart/index.d.ts +1 -0
- package/dist/src/coreX/index.d.ts +15 -0
- package/dist/src/hooks/__tests__/useCTErrorMsg.test.d.ts +1 -0
- package/dist/src/hooks/__tests__/useFormatDuration.test.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/useAntdPatchEnLocales.d.ts +431 -0
- package/dist/src/hooks/useCTErrorMsg.d.ts +7 -0
- package/dist/src/hooks/useFormatDuration.d.ts +31 -0
- package/dist/src/hooks/useLegacyComponentWarning.d.ts +2 -0
- package/dist/src/spec/base.d.ts +4 -2
- package/dist/src/store/modal.d.ts +8 -2
- package/dist/src/styles/token/animation.d.ts +6 -0
- package/dist/src/styles/token/color.d.ts +24 -0
- package/dist/src/utils/__test__/cterror.test.d.ts +1 -0
- package/dist/src/utils/__test__/formatDuration.spec.d.ts +1 -0
- package/dist/src/utils/__test__/unit.spec.d.ts +1 -0
- package/dist/src/utils/constants.d.ts +2 -6
- package/dist/src/utils/cterror.d.ts +29 -0
- package/dist/src/utils/formatDuration.d.ts +28 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/tower.d.ts +13 -0
- package/dist/src/utils/type.d.ts +32 -0
- package/dist/src/utils/unit.d.ts +14 -0
- package/dist/stories/docs/core/Alert.stories.d.ts +1 -0
- package/dist/stories/docs/core/Antd5Tree.stories.d.ts +44 -0
- package/dist/stories/docs/core/Arch.stories.d.ts +3 -0
- package/dist/stories/docs/core/AutoComplete.stories.d.ts +43 -0
- package/dist/stories/docs/core/Banner.stories.d.ts +53 -0
- package/dist/stories/docs/core/BasicCTError.stories.d.ts +47 -0
- package/dist/stories/docs/core/Bit.stories.d.ts +3 -0
- package/dist/stories/docs/core/BitPerSecond.stories.d.ts +3 -0
- package/dist/stories/docs/core/BlankState.stories.d.ts +43 -0
- package/dist/stories/docs/core/Bps.stories.d.ts +3 -0
- package/dist/stories/docs/core/Button.stories.d.ts +11 -0
- package/dist/stories/docs/core/Byte.stories.d.ts +3 -0
- package/dist/stories/docs/core/BytePerSecond.stories.d.ts +20 -0
- package/dist/stories/docs/core/Card.stories.d.ts +1 -0
- package/dist/stories/docs/core/Duration.stories.d.ts +88 -0
- package/dist/stories/docs/core/EllipsisTooltipContent.stories.d.ts +24 -0
- package/dist/stories/docs/core/FieldsBoolean.stories.d.ts +2 -0
- package/dist/stories/docs/core/FieldsDateTimeRange.stories.d.ts +1 -0
- package/dist/stories/docs/core/FieldsString.stories.d.ts +4 -0
- package/dist/stories/docs/core/FieldsTimePicker.stories.d.ts +2 -0
- package/dist/stories/docs/core/Frequency.stories.d.ts +3 -0
- package/dist/stories/docs/core/ImmersiveDialog.stories.d.ts +180 -0
- package/dist/stories/docs/core/Input.simple.stories.d.ts +1 -3
- package/dist/stories/docs/core/InputPassword.stories.d.ts +1 -3
- package/dist/stories/docs/core/KitStoreProvider.stories.d.ts +1 -1
- package/dist/stories/docs/core/LegacyModal.stories.d.ts +23 -0
- package/dist/stories/docs/core/{Select.Simple.stories.d.ts → LegacySelect.Simple.stories.d.ts} +3 -3
- package/dist/stories/docs/core/LegacySelect.stories.d.ts +16 -0
- package/dist/stories/docs/core/Legend.stories.d.ts +19 -0
- package/dist/stories/docs/core/LineChart.stories.d.ts +17 -0
- package/dist/stories/docs/core/Loading.stories.d.ts +2 -2
- package/dist/stories/docs/core/LocalUpload.stories.d.ts +74 -0
- package/dist/stories/docs/core/MediumDialog.stories.d.ts +85 -0
- package/dist/stories/docs/core/Percent.stories.d.ts +5 -0
- package/dist/stories/docs/core/SearchInput.stories.d.ts +52 -14
- package/dist/stories/docs/core/Second.stories.d.ts +57 -22
- package/dist/stories/docs/core/Select.stories.d.ts +94 -13
- package/dist/stories/docs/core/Sider.stories.d.ts +21 -0
- package/dist/stories/docs/core/SmallDialog.stories.d.ts +124 -0
- package/dist/stories/docs/core/Speed.stories.d.ts +3 -0
- package/dist/stories/docs/core/StatusCapsule.stories.d.ts +8 -0
- package/dist/stories/docs/core/Tab.stories.d.ts +65 -0
- package/dist/stories/docs/core/Table.stories.d.ts +35 -34
- package/dist/stories/docs/core/TableForm.stories.d.ts +61 -12
- package/dist/stories/docs/core/Timeline.stories.d.ts +41 -0
- package/dist/stories/docs/core/Tooltip.stories.d.ts +3 -1
- package/dist/stories/docs/core/WizardDialog.stories.d.ts +175 -0
- package/dist/stories/docs/core/message-group.stories.d.ts +5 -0
- package/dist/stories/docs/core/skeleton.stories.d.ts +13 -0
- package/dist/stories/docs/coreX/BarChart.stories.d.ts +1 -0
- package/dist/stories/docs/coreX/Calendar.stories.d.ts +11 -0
- package/dist/stories/docs/coreX/CheckPointList.stories.d.ts +82 -0
- package/dist/stories/docs/coreX/CircleLoading.stories.d.ts +20 -0
- package/dist/stories/docs/coreX/Copy/CopyButton.stories.d.ts +66 -0
- package/dist/stories/docs/coreX/Copy/CopyTooltip.stories.d.ts +66 -0
- package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +2 -0
- package/dist/stories/docs/coreX/Dialogs/DeleteDialog.stories.d.ts +49 -0
- package/dist/stories/docs/coreX/Dialogs/RejectDialog.stories.d.ts +103 -0
- package/dist/stories/docs/coreX/I18nNameTag.stories.d.ts +8 -0
- package/dist/stories/docs/coreX/InfoRowList.stories.d.ts +36 -0
- package/dist/stories/docs/coreX/KubeConfigModal.stories.d.ts +83 -0
- package/dist/stories/docs/coreX/OverflowTooltip.stories.d.ts +5 -0
- package/dist/stories/docs/coreX/Show.stories.d.ts +31 -0
- package/dist/stories/docs/coreX/UnserlineTooltip.stories.d.ts +11 -0
- package/dist/stories/utils.d.ts +12 -0
- package/dist/style.css +6894 -32876
- package/dist/token.css +20 -26
- package/dist/variables.scss +26 -0
- package/docs/core/ImmersiveDialog/guide.md +298 -0
- package/docs/core/LegacyModal/migrate-guide.md +422 -0
- package/docs/core/MediumDialog/guide.md +263 -0
- package/docs/core/SearchInput/guide.md +125 -0
- package/docs/core/SmallDialog/guide.md +224 -0
- package/docs/core/Table/guide.md +199 -0
- package/docs/core/TableForm/guide.md +195 -0
- package/docs/core/WizardDialog/guide.md +322 -0
- package/docs/coreX/DeleteDialog/guide.md +161 -0
- package/docs/coreX/RejectDialog/guide.md +185 -0
- package/docs/llms.txt +169 -0
- package/package.json +16 -12
- package/README.md +0 -64
- package/dist/src/core/Modal/index.d.ts +0 -5
- package/dist/src/core/Modal/modal.type.d.ts +0 -37
- package/dist/stories/docs/core/Modal.stories.d.ts +0 -16
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { ILineChartMetricUnit, ILineChartGraphType } from './type.js';
|
|
2
|
+
import { HOUR, DAY, SECOND, MINUTE, unitRules, formatPercent, formatCount, formatBytes, formatBps, formatBitPerSecond, formatNanoSecond, formatFrequency, formatTemperature } from '../../utils/tower.js';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defProps = Object.defineProperties;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
function filterLineChartPointsByDateRange(points, dateRange) {
|
|
38
|
+
const [startDate, endDate] = dateRange != null ? dateRange : [dayjs(), dayjs()];
|
|
39
|
+
return points == null ? void 0 : points.filter((point) => {
|
|
40
|
+
const pointDate = dayjs(point.t);
|
|
41
|
+
if (startDate && pointDate.isBefore(startDate)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (endDate && pointDate.isAfter(endDate)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const parseLineChartRange = (range) => {
|
|
51
|
+
const span = parseInt(range.slice(0, range.length - 1));
|
|
52
|
+
const unit = range.slice(range.length - 1);
|
|
53
|
+
return { span, unit };
|
|
54
|
+
};
|
|
55
|
+
function getRangeTimestamp(dateRange) {
|
|
56
|
+
const [startDate, endDate] = dateRange;
|
|
57
|
+
return endDate.valueOf() - startDate.valueOf();
|
|
58
|
+
}
|
|
59
|
+
const lineChartXaxisCal = (lastTime, dateRange, width) => {
|
|
60
|
+
const tangeTime = getRangeTimestamp(dateRange);
|
|
61
|
+
const baseline = lastTime || dateRange[1].valueOf();
|
|
62
|
+
if (width < 290) {
|
|
63
|
+
const tick = tangeTime / 4;
|
|
64
|
+
return [baseline - tick * 3, baseline - tick];
|
|
65
|
+
} else if (width < 380) {
|
|
66
|
+
const tick = tangeTime / 6;
|
|
67
|
+
return [baseline - tick * 5, baseline - tick * 3, baseline - tick];
|
|
68
|
+
} else {
|
|
69
|
+
const tick = tangeTime / 8;
|
|
70
|
+
return [
|
|
71
|
+
baseline - tick * 7,
|
|
72
|
+
baseline - tick * 5,
|
|
73
|
+
baseline - tick * 3,
|
|
74
|
+
baseline - tick
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const lineChartTickFormatter = (tick, dateRange) => {
|
|
79
|
+
const rangeTime = getLineChartRangeTimestamp(dateRange);
|
|
80
|
+
if (rangeTime <= 2 * HOUR * 1e3) {
|
|
81
|
+
return dayjs(tick).format("HH:mm:ss");
|
|
82
|
+
}
|
|
83
|
+
if (rangeTime <= 4 * DAY * 1e3) {
|
|
84
|
+
return dayjs(tick).format("MM/DD HH:mm:ss");
|
|
85
|
+
}
|
|
86
|
+
return dayjs(tick).format("MM/DD");
|
|
87
|
+
};
|
|
88
|
+
function getLineChartXAxisDomain(dateRange, xaxisLastTime) {
|
|
89
|
+
const [startDate, endDate] = dateRange;
|
|
90
|
+
return [startDate.valueOf(), xaxisLastTime != null ? xaxisLastTime : endDate.valueOf()];
|
|
91
|
+
}
|
|
92
|
+
const getLineChartRangeTimestamp = (dateRange) => {
|
|
93
|
+
const [startDate, endDate] = dateRange;
|
|
94
|
+
return endDate.valueOf() - startDate.valueOf();
|
|
95
|
+
};
|
|
96
|
+
const getLineChartStep = (dateRange) => {
|
|
97
|
+
const [startDate, endDate] = dateRange;
|
|
98
|
+
const range = endDate.valueOf() - startDate.valueOf();
|
|
99
|
+
if (range <= 2 * 60 * 60 * 1e3) {
|
|
100
|
+
return SECOND * 30 * 1e3;
|
|
101
|
+
}
|
|
102
|
+
if (range <= 24 * 60 * 60 * 1e3) {
|
|
103
|
+
return MINUTE * 5 * 1e3;
|
|
104
|
+
}
|
|
105
|
+
if (range <= 7 * 24 * 60 * 60 * 1e3) {
|
|
106
|
+
return MINUTE * 30 * 1e3;
|
|
107
|
+
}
|
|
108
|
+
if (range <= 30 * 24 * 60 * 60 * 1e3) {
|
|
109
|
+
return DAY * 1e3;
|
|
110
|
+
}
|
|
111
|
+
return DAY * 1e3;
|
|
112
|
+
};
|
|
113
|
+
const filterLineChartDataOverlapping = (data, startTimestamp, length, step, tolerance) => {
|
|
114
|
+
const points = [...new Array(Math.round(length))].map((_2, index) => {
|
|
115
|
+
return startTimestamp + index * step;
|
|
116
|
+
}).map((timestamp) => {
|
|
117
|
+
const closestPoint = _.minBy(
|
|
118
|
+
data.filter((value) => {
|
|
119
|
+
return Math.abs(value.t - timestamp) < tolerance;
|
|
120
|
+
}),
|
|
121
|
+
(value) => {
|
|
122
|
+
return Math.abs(value.t - timestamp);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
if (closestPoint == null) {
|
|
126
|
+
return {
|
|
127
|
+
t: timestamp,
|
|
128
|
+
v: -Infinity
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return closestPoint;
|
|
132
|
+
});
|
|
133
|
+
return points;
|
|
134
|
+
};
|
|
135
|
+
const convertLineChartDataStruct = (streams) => {
|
|
136
|
+
const points = streams.flatMap((points2, index) => {
|
|
137
|
+
return points2.map((point) => {
|
|
138
|
+
return __spreadProps(__spreadValues({}, point), { [`v${index}`]: point.v });
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
const groupedPoints = _.groupBy(points, (point) => {
|
|
142
|
+
return point.t;
|
|
143
|
+
});
|
|
144
|
+
const combinedPoints = Object.entries(groupedPoints).map(([key, values]) => {
|
|
145
|
+
return values.reduce((p, c) => {
|
|
146
|
+
const _a = __spreadValues(__spreadValues({}, p), c), values2 = __objRest(_a, ["v"]);
|
|
147
|
+
return values2;
|
|
148
|
+
}, {});
|
|
149
|
+
});
|
|
150
|
+
return combinedPoints;
|
|
151
|
+
};
|
|
152
|
+
const filterLineChartOverlappingMetric = (metric, dateRange) => {
|
|
153
|
+
const range = getLineChartRangeTimestamp(dateRange);
|
|
154
|
+
return __spreadProps(__spreadValues({}, metric), {
|
|
155
|
+
sample_streams: metric.sample_streams.map((stream) => __spreadProps(__spreadValues({}, stream), {
|
|
156
|
+
points: filterLineChartDataOverlapping(
|
|
157
|
+
stream.points,
|
|
158
|
+
dateRange[0].valueOf(),
|
|
159
|
+
range / stream.step,
|
|
160
|
+
stream.step,
|
|
161
|
+
stream.tolerance
|
|
162
|
+
)
|
|
163
|
+
}))
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
const deletePointsOutOfRange = (data, timeRange, now) => {
|
|
167
|
+
const first = now - getLineChartRangeTimestamp(timeRange);
|
|
168
|
+
return (data == null ? void 0 : data.filter((item) => {
|
|
169
|
+
return item.t >= first && item.t <= now;
|
|
170
|
+
})) || [];
|
|
171
|
+
};
|
|
172
|
+
const getFirstExpectedTimestamp = (data, timeRange, now, step, dateRange) => {
|
|
173
|
+
const first = timeRange ? now - getLineChartRangeTimestamp(timeRange) : dayjs(dateRange == null ? void 0 : dateRange[0]).valueOf();
|
|
174
|
+
const firstRealTimestamp = data[0].t;
|
|
175
|
+
return firstRealTimestamp - Math.floor((firstRealTimestamp - first) / step) * step;
|
|
176
|
+
};
|
|
177
|
+
const getFaultToleranceTime = (timeRange) => {
|
|
178
|
+
const [startDate, endDate] = timeRange;
|
|
179
|
+
const range = endDate.valueOf() - startDate.valueOf();
|
|
180
|
+
switch (range) {
|
|
181
|
+
case 5 * MINUTE:
|
|
182
|
+
return 5 * 1e3;
|
|
183
|
+
case 15 * MINUTE:
|
|
184
|
+
return 15 * 1e3;
|
|
185
|
+
case 1 * HOUR:
|
|
186
|
+
return 60 * 1e3;
|
|
187
|
+
case 2 * HOUR:
|
|
188
|
+
return 120 * 1e3;
|
|
189
|
+
case 24 * HOUR:
|
|
190
|
+
return 10 * 60 * 1e3;
|
|
191
|
+
case 7 * DAY:
|
|
192
|
+
case 30 * DAY:
|
|
193
|
+
return 60 * 60 * 1e3;
|
|
194
|
+
case 182 * DAY:
|
|
195
|
+
return 24 * 60 * 60 * 1e3;
|
|
196
|
+
}
|
|
197
|
+
return 120 * 1e3;
|
|
198
|
+
};
|
|
199
|
+
const addMissingDataWithZero = (data, timeRange, unit, step, dateRange) => {
|
|
200
|
+
const now = Date.now();
|
|
201
|
+
const inRangePoints = deletePointsOutOfRange(data, timeRange, now);
|
|
202
|
+
if (!inRangePoints.length) {
|
|
203
|
+
return [];
|
|
204
|
+
}
|
|
205
|
+
const firsExpectedTimestamp = getFirstExpectedTimestamp(
|
|
206
|
+
inRangePoints,
|
|
207
|
+
timeRange,
|
|
208
|
+
now,
|
|
209
|
+
step,
|
|
210
|
+
dateRange
|
|
211
|
+
);
|
|
212
|
+
const expectedPoints = [];
|
|
213
|
+
const tolerance = getFaultToleranceTime(timeRange);
|
|
214
|
+
if (inRangePoints[0].t - firsExpectedTimestamp > tolerance + step) {
|
|
215
|
+
inRangePoints.unshift({
|
|
216
|
+
t: firsExpectedTimestamp,
|
|
217
|
+
v: -Infinity
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (now - inRangePoints[inRangePoints.length - 1].t > tolerance + step) {
|
|
221
|
+
inRangePoints.push({
|
|
222
|
+
t: now,
|
|
223
|
+
v: -Infinity
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
inRangePoints.forEach((item, index) => {
|
|
227
|
+
var _a;
|
|
228
|
+
expectedPoints.push({
|
|
229
|
+
t: item == null ? void 0 : item.t,
|
|
230
|
+
v: item == null ? void 0 : item.v
|
|
231
|
+
});
|
|
232
|
+
if (index + 1 <= inRangePoints.length - 1) {
|
|
233
|
+
const nowTimeRange = ((_a = inRangePoints[index + 1]) == null ? void 0 : _a.t) - (item == null ? void 0 : item.t);
|
|
234
|
+
if (nowTimeRange > tolerance + step) {
|
|
235
|
+
const n = Math.floor(nowTimeRange / step);
|
|
236
|
+
for (let i = 1; i < n; i++) {
|
|
237
|
+
expectedPoints.push({
|
|
238
|
+
t: (item == null ? void 0 : item.t) + step * i,
|
|
239
|
+
v: -Infinity
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
return filterLineChartPointsByDateRange(
|
|
246
|
+
expectedPoints.map((p) => __spreadProps(__spreadValues({}, p), { unit })),
|
|
247
|
+
dateRange
|
|
248
|
+
);
|
|
249
|
+
};
|
|
250
|
+
const convertLineChartUnit = (value, from, to, decimals) => {
|
|
251
|
+
if (from === to || !value)
|
|
252
|
+
return value;
|
|
253
|
+
const ruleIndex = unitRules.findIndex((rule) => rule.unit.includes(from));
|
|
254
|
+
if (ruleIndex === -1) {
|
|
255
|
+
return value;
|
|
256
|
+
}
|
|
257
|
+
const { unit, divider } = unitRules[ruleIndex];
|
|
258
|
+
let fromIdx = unit.indexOf(from);
|
|
259
|
+
const toIdx = unit.indexOf(to);
|
|
260
|
+
if (toIdx === -1) {
|
|
261
|
+
return value;
|
|
262
|
+
}
|
|
263
|
+
if (fromIdx < toIdx) {
|
|
264
|
+
while (fromIdx < toIdx) {
|
|
265
|
+
value /= divider[fromIdx];
|
|
266
|
+
fromIdx++;
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
269
|
+
while (fromIdx > toIdx) {
|
|
270
|
+
value *= divider[fromIdx - 1];
|
|
271
|
+
fromIdx--;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return _.isInteger(value) ? value : _.isNil(decimals) ? value : parseFloat(value.toFixed(decimals));
|
|
275
|
+
};
|
|
276
|
+
const UNIT_FORMATTER = {
|
|
277
|
+
[ILineChartMetricUnit.Percent]: [formatPercent, "%", 2, false],
|
|
278
|
+
[ILineChartMetricUnit.Ratio]: [formatPercent, "%"],
|
|
279
|
+
[ILineChartMetricUnit.Count]: [formatCount, ""],
|
|
280
|
+
[ILineChartMetricUnit.DataSize]: [formatBytes, "B"],
|
|
281
|
+
[ILineChartMetricUnit.DataRateByte]: [formatBps, "Bps"],
|
|
282
|
+
[ILineChartMetricUnit.DataRateBit]: [formatBitPerSecond, "bps"],
|
|
283
|
+
[ILineChartMetricUnit.Time]: [formatNanoSecond, "ns"],
|
|
284
|
+
[ILineChartMetricUnit.Frequency]: [formatFrequency, "Hz"],
|
|
285
|
+
[ILineChartMetricUnit.Temperature]: [formatTemperature, "\u2103"],
|
|
286
|
+
[ILineChartMetricUnit.Load]: [formatCount, ""]
|
|
287
|
+
};
|
|
288
|
+
const getLineChartYDataMax = (dataPoints, type) => {
|
|
289
|
+
const values = dataPoints.map((p) => {
|
|
290
|
+
if (_.isNumber(p == null ? void 0 : p.v)) {
|
|
291
|
+
return p.v;
|
|
292
|
+
}
|
|
293
|
+
const entries = Object.entries(p);
|
|
294
|
+
if (type === ILineChartGraphType.Stack) {
|
|
295
|
+
let sum = 0;
|
|
296
|
+
for (const [key, value] of entries) {
|
|
297
|
+
if (/^v(\d*)$/.test(key) && _.isNumber(value)) {
|
|
298
|
+
sum += value;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return sum;
|
|
302
|
+
} else {
|
|
303
|
+
let max = 0;
|
|
304
|
+
for (const [key, value] of entries) {
|
|
305
|
+
if (/^v(\d*)$/.test(key) && _.isNumber(value) && value > max) {
|
|
306
|
+
max = value;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return max;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
return Math.max(...values, 0);
|
|
313
|
+
};
|
|
314
|
+
const getYAxisUpperBound = (max, type) => {
|
|
315
|
+
const DIVISOR = 2;
|
|
316
|
+
switch (type) {
|
|
317
|
+
case ILineChartMetricUnit.Count:
|
|
318
|
+
case ILineChartMetricUnit.Load:
|
|
319
|
+
case ILineChartMetricUnit.DataSize:
|
|
320
|
+
case ILineChartMetricUnit.DataRateByte:
|
|
321
|
+
case ILineChartMetricUnit.Time:
|
|
322
|
+
case ILineChartMetricUnit.Frequency:
|
|
323
|
+
case ILineChartMetricUnit.DataRateBit:
|
|
324
|
+
case ILineChartMetricUnit.Temperature: {
|
|
325
|
+
const [format, base] = UNIT_FORMATTER[type];
|
|
326
|
+
const { value, unit } = format(max);
|
|
327
|
+
const _value = Math.ceil(Number(value) / DIVISOR) * DIVISOR;
|
|
328
|
+
return convertLineChartUnit(_value, unit, base);
|
|
329
|
+
}
|
|
330
|
+
case ILineChartMetricUnit.Percent: {
|
|
331
|
+
const [format, base, decimals, saturated] = UNIT_FORMATTER[type];
|
|
332
|
+
const { value, unit } = format(max, decimals, saturated);
|
|
333
|
+
const _value = Math.ceil(Number(value) / DIVISOR) * DIVISOR;
|
|
334
|
+
return convertLineChartUnit(_value, unit, base);
|
|
335
|
+
}
|
|
336
|
+
case ILineChartMetricUnit.Ratio: {
|
|
337
|
+
const [format, base] = UNIT_FORMATTER[type];
|
|
338
|
+
const { value, unit } = format(max * 100);
|
|
339
|
+
const _value = Math.ceil(Number(value) / DIVISOR) * DIVISOR;
|
|
340
|
+
return convertLineChartUnit(_value, unit, base) / 100;
|
|
341
|
+
}
|
|
342
|
+
default:
|
|
343
|
+
return 2;
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
const getYAxisDomain = (dataPoints, graphType, unitType) => {
|
|
347
|
+
const max = getLineChartYDataMax(dataPoints, graphType);
|
|
348
|
+
if (!max) {
|
|
349
|
+
if (unitType === ILineChartMetricUnit.Ratio) {
|
|
350
|
+
return [0, 1];
|
|
351
|
+
} else {
|
|
352
|
+
return [0, 2];
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return [0, getYAxisUpperBound(max, unitType)];
|
|
356
|
+
};
|
|
357
|
+
function lineChartYaxisTickFormatter(value, unit) {
|
|
358
|
+
if (_.isNil(unit)) {
|
|
359
|
+
return `${value}`;
|
|
360
|
+
}
|
|
361
|
+
if (_.isNil(value)) {
|
|
362
|
+
return "0";
|
|
363
|
+
}
|
|
364
|
+
const [format] = UNIT_FORMATTER[unit];
|
|
365
|
+
const { value: _value, unit: _unit } = format(value);
|
|
366
|
+
return `${_value} ${_unit}`;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export { UNIT_FORMATTER, addMissingDataWithZero, convertLineChartDataStruct, convertLineChartUnit, deletePointsOutOfRange, filterLineChartDataOverlapping, filterLineChartOverlappingMetric, filterLineChartPointsByDateRange, getFirstExpectedTimestamp, getLineChartRangeTimestamp, getLineChartStep, getLineChartXAxisDomain, getLineChartYDataMax, getYAxisDomain, getYAxisUpperBound, lineChartTickFormatter, lineChartXaxisCal, lineChartYaxisTickFormatter, parseLineChartRange };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LoadingWrapper, LoadingLine1, LoadingLine2, LoadingLine3 } from './style.js';
|
|
2
2
|
import { FullView } from '../Styled/index.js';
|
|
3
|
+
import cs from 'classnames';
|
|
3
4
|
import React__default, { Fragment } from 'react';
|
|
4
5
|
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
@@ -21,10 +22,29 @@ var __spreadValues = (a, b) => {
|
|
|
21
22
|
return a;
|
|
22
23
|
};
|
|
23
24
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
const Loading = (_a) => {
|
|
38
|
+
var _b = _a, {
|
|
39
|
+
fullView = true,
|
|
40
|
+
className
|
|
41
|
+
} = _b, restProps = __objRest(_b, [
|
|
42
|
+
"fullView",
|
|
43
|
+
"className"
|
|
44
|
+
]);
|
|
25
45
|
const Wrapper = fullView ? FullView : Fragment;
|
|
26
46
|
const props = fullView ? { className: "loading-full-view" } : {};
|
|
27
|
-
return /* @__PURE__ */ React__default.createElement(Wrapper, __spreadProps(__spreadValues({}, props), { "data-testid": "loading" }), /* @__PURE__ */ React__default.createElement("div", { className: LoadingWrapper }, /* @__PURE__ */ React__default.createElement("div", { className: LoadingLine1 }), /* @__PURE__ */ React__default.createElement("div", { className: LoadingLine2 }), /* @__PURE__ */ React__default.createElement("div", { className: LoadingLine3 })));
|
|
47
|
+
return /* @__PURE__ */ React__default.createElement(Wrapper, __spreadProps(__spreadValues({}, props), { "data-testid": "loading" }), /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: cs(LoadingWrapper, className) }, restProps), /* @__PURE__ */ React__default.createElement("div", { className: LoadingLine1 }), /* @__PURE__ */ React__default.createElement("div", { className: LoadingLine2 }), /* @__PURE__ */ React__default.createElement("div", { className: LoadingLine3 })));
|
|
28
48
|
};
|
|
29
49
|
var Loading$1 = Loading;
|
|
30
50
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
const useFileValidation = ({
|
|
4
|
+
fileList,
|
|
5
|
+
setFileList,
|
|
6
|
+
validate,
|
|
7
|
+
createNewFile = false
|
|
8
|
+
}) => {
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!validate)
|
|
11
|
+
return;
|
|
12
|
+
const updateFile = (fileId, file) => {
|
|
13
|
+
const index = fileList.findIndex((f) => f.uid === fileId);
|
|
14
|
+
if (index !== -1) {
|
|
15
|
+
const newList = [...fileList];
|
|
16
|
+
const fileToUpdate = createNewFile ? (() => {
|
|
17
|
+
const newFile = new File([file], file.name, { type: file.type });
|
|
18
|
+
Object.assign(newFile, file);
|
|
19
|
+
return newFile;
|
|
20
|
+
})() : file;
|
|
21
|
+
newList.splice(index, 1, fileToUpdate);
|
|
22
|
+
setFileList(newList);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
for (const _file of fileList) {
|
|
26
|
+
if (_file.fileStatus !== "need-validate") {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
_file.fileStatus = "validating";
|
|
30
|
+
updateFile(_file.uid, _file);
|
|
31
|
+
validate(_file, fileList).then((result) => {
|
|
32
|
+
if (result.error) {
|
|
33
|
+
_file.error = result.error;
|
|
34
|
+
_file.fileStatus = "error";
|
|
35
|
+
} else {
|
|
36
|
+
_file.error = void 0;
|
|
37
|
+
_file.fileStatus = "success";
|
|
38
|
+
_file.data = result.data;
|
|
39
|
+
}
|
|
40
|
+
updateFile(_file.uid, _file);
|
|
41
|
+
return;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}, [fileList, setFileList, validate, createNewFile]);
|
|
45
|
+
};
|
|
46
|
+
const useFileCountErrorClear = ({
|
|
47
|
+
fileList,
|
|
48
|
+
maxCount,
|
|
49
|
+
setError
|
|
50
|
+
}) => {
|
|
51
|
+
const fileCountRef = useRef(fileList.length);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (fileList.length === fileCountRef.current) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
fileCountRef.current = fileList.length;
|
|
57
|
+
if (fileCountRef.current <= maxCount) {
|
|
58
|
+
setError("");
|
|
59
|
+
}
|
|
60
|
+
}, [fileList.length, maxCount, setError]);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { useFileCountErrorClear, useFileValidation };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { UploadWrapper } from './LocalUpload.style.js';
|
|
4
|
+
import { UploadLabel, UploadDescription, UploadButton, UploadDragger, UploadFileList, UploadFileInfo } from './LocalUpload.widget.js';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
const UploadComp = React__default.forwardRef(
|
|
23
|
+
({
|
|
24
|
+
className,
|
|
25
|
+
"data-testid": dataTestId,
|
|
26
|
+
label,
|
|
27
|
+
description,
|
|
28
|
+
type = "dragger",
|
|
29
|
+
multiple = false,
|
|
30
|
+
accept,
|
|
31
|
+
disabled,
|
|
32
|
+
maxCount,
|
|
33
|
+
info,
|
|
34
|
+
fileList,
|
|
35
|
+
setFileList,
|
|
36
|
+
validate,
|
|
37
|
+
buttonProps,
|
|
38
|
+
listType = "list",
|
|
39
|
+
disableRemoveList = false,
|
|
40
|
+
onRemove
|
|
41
|
+
}, ref) => {
|
|
42
|
+
const { t } = useParrotTranslation();
|
|
43
|
+
const removeFile = (id) => {
|
|
44
|
+
const index = fileList.findIndex((f) => f.uid === id);
|
|
45
|
+
if (index !== -1) {
|
|
46
|
+
const file = fileList[index];
|
|
47
|
+
fileList.splice(index, 1);
|
|
48
|
+
setFileList([...fileList]);
|
|
49
|
+
onRemove == null ? void 0 : onRemove(file);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const _maxCount = multiple ? maxCount || Infinity : 1;
|
|
53
|
+
const isSingleSelect = _maxCount === 1;
|
|
54
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
55
|
+
UploadComp.Wrapper,
|
|
56
|
+
{
|
|
57
|
+
className,
|
|
58
|
+
ref,
|
|
59
|
+
"data-testid": dataTestId
|
|
60
|
+
},
|
|
61
|
+
label ? /* @__PURE__ */ React__default.createElement(UploadComp.Label, null, label) : null,
|
|
62
|
+
description ? /* @__PURE__ */ React__default.createElement(UploadComp.Description, null, description) : null,
|
|
63
|
+
type === "button" ? /* @__PURE__ */ React__default.createElement(
|
|
64
|
+
UploadComp.Button,
|
|
65
|
+
__spreadValues({}, __spreadValues({
|
|
66
|
+
accept,
|
|
67
|
+
multiple,
|
|
68
|
+
disabled,
|
|
69
|
+
maxCount,
|
|
70
|
+
fileList,
|
|
71
|
+
setFileList,
|
|
72
|
+
validate
|
|
73
|
+
}, buttonProps)),
|
|
74
|
+
t("components.select_file")
|
|
75
|
+
) : /* @__PURE__ */ React__default.createElement(
|
|
76
|
+
UploadComp.Dragger,
|
|
77
|
+
__spreadValues({}, {
|
|
78
|
+
accept,
|
|
79
|
+
multiple,
|
|
80
|
+
disabled,
|
|
81
|
+
maxCount,
|
|
82
|
+
fileList,
|
|
83
|
+
setFileList,
|
|
84
|
+
validate
|
|
85
|
+
})
|
|
86
|
+
),
|
|
87
|
+
info != null ? info : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null),
|
|
88
|
+
type === "button" || !isSingleSelect ? /* @__PURE__ */ React__default.createElement(
|
|
89
|
+
UploadComp.FileList,
|
|
90
|
+
{
|
|
91
|
+
fileList,
|
|
92
|
+
removeFile,
|
|
93
|
+
type: listType,
|
|
94
|
+
disableRemove: disableRemoveList,
|
|
95
|
+
onRemove
|
|
96
|
+
}
|
|
97
|
+
) : null
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
UploadComp.Wrapper = UploadWrapper;
|
|
102
|
+
UploadComp.Label = UploadLabel;
|
|
103
|
+
UploadComp.Description = UploadDescription;
|
|
104
|
+
UploadComp.Button = UploadButton;
|
|
105
|
+
UploadComp.Dragger = UploadDragger;
|
|
106
|
+
UploadComp.FileList = UploadFileList;
|
|
107
|
+
UploadComp.FileInfo = UploadFileInfo;
|
|
108
|
+
const LocalUpload = UploadComp;
|
|
109
|
+
|
|
110
|
+
export { LocalUpload };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { styled } from '@linaria/react';
|
|
2
|
+
|
|
3
|
+
const UploadWrapper = /*#__PURE__*/styled('div')({
|
|
4
|
+
name: "UploadWrapper",
|
|
5
|
+
class: "E_u3l9ivi",
|
|
6
|
+
propsAsIs: false
|
|
7
|
+
});
|
|
8
|
+
const FileInfoWrapperStyle = "E_ftdwz1g";
|
|
9
|
+
|
|
10
|
+
export { FileInfoWrapperStyle, UploadWrapper };
|