@rio-cloud/rio-uikit 2.3.0-beta.1 → 2.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DayPicker.js +6 -2
- package/DayPicker.js.map +1 -1
- package/DayPickerCalendar.d.ts +2 -0
- package/DayPickerCalendar.js +5 -0
- package/DayPickerCalendar.js.map +1 -0
- package/DayPickerPrototype.d.ts +2 -0
- package/DayPickerPrototype.js +5 -0
- package/DayPickerPrototype.js.map +1 -0
- package/Marker.js +9 -5
- package/TableNext.d.ts +2 -0
- package/TableNext.js +23 -0
- package/TableNext.js.map +1 -0
- package/TableToolbar.js +3 -2
- package/TableToolbar.js.map +1 -1
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.d.ts +38 -3
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js +104 -109
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js.map +1 -1
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.d.ts +24 -5
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js +60 -56
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js.map +1 -1
- package/components/assetTree/Tree.js +13 -13
- package/components/charts/Area.d.ts +5 -3
- package/components/charts/Area.js +4 -3
- package/components/charts/Area.js.map +1 -1
- package/components/charts/AreaChart.js.map +1 -1
- package/components/charts/ComposedChart.js.map +1 -1
- package/components/clearableInput/ClearableInput.d.ts +30 -0
- package/components/clearableInput/ClearableInput.js +81 -78
- package/components/clearableInput/ClearableInput.js.map +1 -1
- package/components/datepicker/DayPicker.d.ts +4 -51
- package/components/datepicker/DayPicker.js +267 -257
- package/components/datepicker/DayPicker.js.map +1 -1
- package/components/datepicker/DayPickerCalendar.d.ts +4 -0
- package/components/datepicker/DayPickerCalendar.js +129 -0
- package/components/datepicker/DayPickerCalendar.js.map +1 -0
- package/components/datepicker/DayPickerDropdown.d.ts +19 -0
- package/components/datepicker/DayPickerDropdown.js +88 -0
- package/components/datepicker/DayPickerDropdown.js.map +1 -0
- package/components/datepicker/DayPickerDropdownFooter.d.ts +7 -0
- package/components/datepicker/DayPickerDropdownFooter.js +7 -0
- package/components/datepicker/DayPickerDropdownFooter.js.map +1 -0
- package/components/datepicker/DayPickerDropdownSidebar.d.ts +8 -0
- package/components/datepicker/DayPickerDropdownSidebar.js +7 -0
- package/components/datepicker/DayPickerDropdownSidebar.js.map +1 -0
- package/components/datepicker/DayPickerInput.d.ts +28 -0
- package/components/datepicker/DayPickerInput.js +65 -0
- package/components/datepicker/DayPickerInput.js.map +1 -0
- package/components/datepicker/DayPickerPrototype.d.ts +53 -0
- package/components/datepicker/DayPickerPrototype.js +285 -0
- package/components/datepicker/DayPickerPrototype.js.map +1 -0
- package/components/datepicker/dayPickerRangeSelectionUtils.d.ts +15 -0
- package/components/datepicker/dayPickerRangeSelectionUtils.js +31 -0
- package/components/datepicker/dayPickerRangeSelectionUtils.js.map +1 -0
- package/components/datepicker/dayPickerTypes.d.ts +517 -0
- package/components/datepicker/dayPickerTypes.js +7 -0
- package/components/datepicker/dayPickerTypes.js.map +1 -0
- package/components/datepicker/dayPickerUtils.d.ts +10 -0
- package/components/datepicker/dayPickerUtils.js +92 -0
- package/components/datepicker/dayPickerUtils.js.map +1 -0
- package/components/datepicker/useDayPickerInputState.d.ts +32 -0
- package/components/datepicker/useDayPickerInputState.js +85 -0
- package/components/datepicker/useDayPickerInputState.js.map +1 -0
- package/components/datepicker/useStackedDayPickerCalendars.d.ts +5 -0
- package/components/datepicker/useStackedDayPickerCalendars.js +39 -0
- package/components/datepicker/useStackedDayPickerCalendars.js.map +1 -0
- package/components/divider/Divider.js +6 -6
- package/components/dropdown/ButtonDropdown.d.ts +4 -0
- package/components/dropdown/ButtonDropdown.js +70 -68
- package/components/dropdown/ButtonDropdown.js.map +1 -1
- package/components/dropdown/DropdownToggleButton.d.ts +1 -0
- package/components/dropdown/DropdownToggleButton.js +17 -15
- package/components/dropdown/DropdownToggleButton.js.map +1 -1
- package/components/fade/FadeExpander.js +17 -20
- package/components/fade/FadeExpander.js.map +1 -1
- package/components/listMenu/ListMenu.d.ts +8 -0
- package/components/listMenu/ListMenu.js +74 -66
- package/components/listMenu/ListMenu.js.map +1 -1
- package/components/loadMore/LoadMoreProgress.js +6 -7
- package/components/map/components/Map.js +189 -157
- package/components/map/components/Map.js.map +1 -1
- package/components/map/components/MapContext.d.ts +1 -0
- package/components/map/components/MapContext.js +8 -7
- package/components/map/components/MapContext.js.map +1 -1
- package/components/map/components/features/Route.d.ts +65 -1
- package/components/map/components/features/Route.js +184 -98
- package/components/map/components/features/Route.js.map +1 -1
- package/components/map/components/features/basics/Marker.d.ts +21 -1
- package/components/map/components/features/basics/Marker.js +99 -40
- package/components/map/components/features/basics/Marker.js.map +1 -1
- package/components/map/components/features/basics/Polygon.d.ts +24 -1
- package/components/map/components/features/basics/Polygon.js +72 -19
- package/components/map/components/features/basics/Polygon.js.map +1 -1
- package/components/map/components/features/basics/Polyline.d.ts +29 -0
- package/components/map/components/features/basics/Polyline.js +69 -39
- package/components/map/components/features/basics/Polyline.js.map +1 -1
- package/components/map/components/features/layers/MarkerLayer.js +8 -8
- package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.js +13 -6
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
- package/components/map/utils/clustering.d.ts +1 -1
- package/components/map/utils/clustering.js +30 -30
- package/components/map/utils/clustering.js.map +1 -1
- package/components/map/utils/mapTypes.d.ts +135 -0
- package/components/map/utils/mapTypes.js.map +1 -1
- package/components/map/utils/rendering.js +5 -5
- package/components/mapMarker/ClusterMapMarker.d.ts +2 -0
- package/components/mapMarker/ClusterMapMarker.js.map +1 -1
- package/components/mapMarker/SingleMapMarker.d.ts +2 -0
- package/components/mapMarker/SingleMapMarker.js.map +1 -1
- package/components/popover/Popover.js +4 -4
- package/components/radiobutton/RadioCardGroup.js +3 -3
- package/components/rioglyph/RioglyphIconType.d.ts +1 -1
- package/components/selects/ClearButton.js +9 -7
- package/components/selects/ClearButton.js.map +1 -1
- package/components/selects/Multiselect.d.ts +6 -0
- package/components/selects/Multiselect.js +164 -150
- package/components/selects/Multiselect.js.map +1 -1
- package/components/selects/Select.js +39 -37
- package/components/selects/Select.js.map +1 -1
- package/components/table/Table.d.ts +27 -248
- package/components/table/Table.js +240 -214
- package/components/table/Table.js.map +1 -1
- package/components/table/Table.types.d.ts +302 -121
- package/components/table/TableBody.d.ts +65 -5
- package/components/table/TableBody.js +132 -2
- package/components/table/TableBody.js.map +1 -1
- package/components/table/TableCardsSorting.js +25 -32
- package/components/table/TableCardsSorting.js.map +1 -1
- package/components/table/TableColumn.d.ts +21 -6
- package/components/table/TableColumn.js +114 -2
- package/components/table/TableColumn.js.map +1 -1
- package/components/table/TableExpandedContentRow.d.ts +7 -7
- package/components/table/TableExpandedContentRow.js +107 -2
- package/components/table/TableExpandedContentRow.js.map +1 -1
- package/components/table/TableExpandedRow.d.ts +9 -4
- package/components/table/TableExpandedRow.js +147 -2
- package/components/table/TableExpandedRow.js.map +1 -1
- package/components/table/TableExpanderButton.js +13 -11
- package/components/table/TableExpanderButton.js.map +1 -1
- package/components/table/TableFooter.d.ts +10 -6
- package/components/table/TableFooter.js +49 -2
- package/components/table/TableFooter.js.map +1 -1
- package/components/table/TableGroupFooterRow.d.ts +7 -7
- package/components/table/TableGroupFooterRow.js +27 -2
- package/components/table/TableGroupFooterRow.js.map +1 -1
- package/components/table/TableGroupRow.d.ts +7 -7
- package/components/table/TableGroupRow.js +33 -2
- package/components/table/TableGroupRow.js.map +1 -1
- package/components/table/TableHeader.d.ts +26 -4
- package/components/table/TableHeader.js +117 -2
- package/components/table/TableHeader.js.map +1 -1
- package/components/table/TableHeaderColumn.d.ts +25 -9
- package/components/table/TableHeaderColumn.js +83 -2
- package/components/table/TableHeaderColumn.js.map +1 -1
- package/components/table/TableHeaderRow.d.ts +1 -1
- package/components/table/TableHeaderRow.js +11 -2
- package/components/table/TableHeaderRow.js.map +1 -1
- package/components/table/TableRow.d.ts +15 -4
- package/components/table/TableRow.js +109 -2
- package/components/table/TableRow.js.map +1 -1
- package/components/table/TableSpacerRow.d.ts +3 -2
- package/components/table/TableSpacerRow.js +26 -2
- package/components/table/TableSpacerRow.js.map +1 -1
- package/components/table/TableToolbar.d.ts +4 -23
- package/components/table/TableToolbar.js +39 -28
- package/components/table/TableToolbar.js.map +1 -1
- package/components/table/TableToolbarColumn.d.ts +31 -0
- package/components/table/TableToolbarColumn.js +33 -0
- package/components/table/TableToolbarColumn.js.map +1 -0
- package/components/table/TableViewToggles.d.ts +3 -3
- package/components/table/TableViewToggles.js.map +1 -1
- package/components/table/context/TableInteractionContext.d.ts +26 -0
- package/components/table/context/TableInteractionContext.js +7 -0
- package/components/table/context/TableInteractionContext.js.map +1 -0
- package/components/table/context/TableLayoutContext.d.ts +26 -0
- package/components/table/context/TableLayoutContext.js +7 -0
- package/components/table/context/TableLayoutContext.js.map +1 -0
- package/components/table/context/TableRenderConfigContext.d.ts +27 -0
- package/components/table/context/TableRenderConfigContext.js +7 -0
- package/components/table/context/TableRenderConfigContext.js.map +1 -0
- package/components/table/context/TableRenderContext.d.ts +85 -0
- package/components/table/context/TableRenderContext.js +7 -0
- package/components/table/context/TableRenderContext.js.map +1 -0
- package/components/table/context/TableStructureContext.d.ts +31 -0
- package/components/table/context/TableStructureContext.js +17 -0
- package/components/table/context/TableStructureContext.js.map +1 -0
- package/components/table/layout/columnSizing.d.ts +2 -2
- package/components/table/layout/columnSizing.js.map +1 -1
- package/components/table/layout/useDraggableColumns.d.ts +3 -3
- package/components/table/layout/useDraggableColumns.js +17 -17
- package/components/table/layout/useDraggableColumns.js.map +1 -1
- package/components/table/layout/useHorizontalSectionSync.d.ts +4 -1
- package/components/table/layout/useHorizontalSectionSync.js +36 -31
- package/components/table/layout/useHorizontalSectionSync.js.map +1 -1
- package/components/table/layout/useMeasuredColumnMaxWidths.d.ts +3 -3
- package/components/table/layout/useMeasuredColumnMaxWidths.js.map +1 -1
- package/components/table/layout/useResizableColumns.d.ts +5 -4
- package/components/table/layout/useResizableColumns.js +108 -67
- package/components/table/layout/useResizableColumns.js.map +1 -1
- package/components/table/layout/useTableBodyScrollBottom.d.ts +12 -0
- package/components/table/layout/useTableBodyScrollBottom.js +37 -0
- package/components/table/layout/useTableBodyScrollBottom.js.map +1 -0
- package/components/table/layout/useTableLayout.d.ts +18 -6
- package/components/table/layout/useTableLayout.js +51 -41
- package/components/table/layout/useTableLayout.js.map +1 -1
- package/components/table/layout/useTableVirtualization.d.ts +6 -6
- package/components/table/layout/useTableVirtualization.js +22 -22
- package/components/table/layout/useTableVirtualization.js.map +1 -1
- package/components/table/model/resolveRowMeta.d.ts +3 -2
- package/components/table/model/resolveRowMeta.js.map +1 -1
- package/components/table/model/resolveTableClassConfig.d.ts +2 -3
- package/components/table/model/resolveTableClassConfig.js.map +1 -1
- package/components/table/model/tableView.types.d.ts +41 -0
- package/components/table/native/TableSettingsListItem.js +1 -1
- package/components/table/native/TableSettingsListItem.js.map +1 -1
- package/components/table/render/body/TableBodyContent.d.ts +21 -0
- package/components/table/render/body/TableBodyContent.js +52 -0
- package/components/table/render/body/TableBodyContent.js.map +1 -0
- package/components/table/render/body/TableEmptyRow.js +2 -2
- package/components/table/render/body/TableEmptyRow.js.map +1 -1
- package/components/table/render/header/TableBatchDropdown.d.ts +5 -1
- package/components/table/render/header/TableBatchDropdown.js +17 -15
- package/components/table/render/header/TableBatchDropdown.js.map +1 -1
- package/components/table/render/header/TableColumnFilter.d.ts +2 -2
- package/components/table/render/header/TableColumnFilter.js +16 -14
- package/components/table/render/header/TableColumnFilter.js.map +1 -1
- package/components/table/render/header/TableDraggableHeaderCell.d.ts +2 -1
- package/components/table/render/header/TableDraggableHeaderCell.js +45 -33
- package/components/table/render/header/TableDraggableHeaderCell.js.map +1 -1
- package/components/table/render/header/TableHeader.types.d.ts +13 -9
- package/components/table/render/header/TableHeaderCellContent.d.ts +2 -1
- package/components/table/render/header/TableHeaderCellContent.js +16 -16
- package/components/table/render/header/TableHeaderCellContent.js.map +1 -1
- package/components/table/render/header/TableHeaderCellResizeHandle.d.ts +2 -1
- package/components/table/render/header/TableHeaderCellResizeHandle.js +8 -8
- package/components/table/render/header/TableHeaderCellResizeHandle.js.map +1 -1
- package/components/table/render/header/TableHeaderDragOverlay.d.ts +5 -4
- package/components/table/render/header/TableHeaderDragOverlay.js.map +1 -1
- package/components/table/render/header/TableStaticHeaderCell.d.ts +2 -1
- package/components/table/render/header/TableStaticHeaderCell.js +34 -20
- package/components/table/render/header/TableStaticHeaderCell.js.map +1 -1
- package/components/table/render/header/resolveAriaSort.d.ts +2 -1
- package/components/table/render/header/resolveAriaSort.js.map +1 -1
- package/components/table/render/header/resolveHeaderCellClassName.d.ts +5 -2
- package/components/table/render/header/resolveHeaderCellClassName.js +14 -12
- package/components/table/render/header/resolveHeaderCellClassName.js.map +1 -1
- package/components/table/render/header/resolveHeaderCellStyle.d.ts +2 -1
- package/components/table/render/header/resolveHeaderCellStyle.js.map +1 -1
- package/components/table/runtime/shouldAnimateBodyRows.d.ts +17 -0
- package/components/table/runtime/shouldAnimateBodyRows.js +5 -0
- package/components/table/runtime/shouldAnimateBodyRows.js.map +1 -0
- package/components/table/runtime/useRenderDraftState.d.ts +14 -0
- package/components/table/runtime/useRenderDraftState.js +80 -0
- package/components/table/runtime/useRenderDraftState.js.map +1 -0
- package/components/table/runtime/useResolvedRenderColumns.d.ts +43 -0
- package/components/table/runtime/useResolvedRenderColumns.js +113 -0
- package/components/table/runtime/useResolvedRenderColumns.js.map +1 -0
- package/components/table/runtime/useResolvedRenderHeader.d.ts +27 -0
- package/components/table/runtime/useResolvedRenderHeader.js +67 -0
- package/components/table/runtime/useResolvedRenderHeader.js.map +1 -0
- package/components/table/selection/useInternalTableSelectionState.d.ts +17 -0
- package/components/table/selection/useInternalTableSelectionState.js +28 -0
- package/components/table/selection/useInternalTableSelectionState.js.map +1 -0
- package/components/table/selection/useTableSelection.d.ts +3 -3
- package/components/table/selection/useTableSelection.js.map +1 -1
- package/components/table/shared/getCellContentOverflowClassName.d.ts +3 -0
- package/components/table/shared/getCellContentOverflowClassName.js +18 -0
- package/components/table/shared/getCellContentOverflowClassName.js.map +1 -0
- package/components/table/shared/getInteractiveRowProps.d.ts +3 -2
- package/components/table/shared/getInteractiveRowProps.js.map +1 -1
- package/hooks/useDraggableElement.d.ts +27 -5
- package/hooks/useDraggableElement.js +100 -23
- package/hooks/useDraggableElement.js.map +1 -1
- package/hooks/usePopperDropdown.d.ts +1 -0
- package/hooks/usePopperDropdown.js +15 -12
- package/hooks/usePopperDropdown.js.map +1 -1
- package/hooks/useUrlState.js +3 -3
- package/package.json +16 -17
- package/utils/analytics/createAnalyticsOverlayTooltip.js +57 -57
- package/utils/analytics/createAnalyticsOverlayTooltip.js.map +1 -1
- package/utils/analytics/useAnalyticsOverlayDom.js +3 -3
- package/utils/init/initConfig.js +5 -5
- package/utils/init/initConfig.js.map +1 -1
- package/utils/routeUtils.d.ts +5 -2
- package/utils/routeUtils.js +17 -17
- package/utils/routeUtils.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/components/table/TableCard.d.ts +0 -63
- package/components/table/TableCard.js +0 -150
- package/components/table/TableCard.js.map +0 -1
- package/components/table/model/buildTableViewModel.d.ts +0 -28
- package/components/table/model/buildTableViewModel.js +0 -221
- package/components/table/model/buildTableViewModel.js.map +0 -1
- package/components/table/model/resolveCellContent.d.ts +0 -2
- package/components/table/model/resolveCellContent.js +0 -5
- package/components/table/model/resolveCellContent.js.map +0 -1
- package/components/table/model/tableViewModel.types.d.ts +0 -153
- package/components/table/parse/parseBody.d.ts +0 -3
- package/components/table/parse/parseBody.js +0 -13
- package/components/table/parse/parseBody.js.map +0 -1
- package/components/table/parse/parseColumns.d.ts +0 -3
- package/components/table/parse/parseColumns.js +0 -81
- package/components/table/parse/parseColumns.js.map +0 -1
- package/components/table/parse/parseFooter.d.ts +0 -3
- package/components/table/parse/parseFooter.js +0 -39
- package/components/table/parse/parseFooter.js.map +0 -1
- package/components/table/parse/parseHeaders.d.ts +0 -4
- package/components/table/parse/parseHeaders.js +0 -89
- package/components/table/parse/parseHeaders.js.map +0 -1
- package/components/table/parse/parseRows.d.ts +0 -3
- package/components/table/parse/parseRows.js +0 -93
- package/components/table/parse/parseRows.js.map +0 -1
- package/components/table/parse/tableChildGuards.d.ts +0 -25
- package/components/table/parse/tableChildGuards.js +0 -29
- package/components/table/parse/tableChildGuards.js.map +0 -1
- package/components/table/render/body/TableBodyRow.d.ts +0 -16
- package/components/table/render/body/TableBodyRow.js +0 -84
- package/components/table/render/body/TableBodyRow.js.map +0 -1
- package/components/table/render/body/TableBodySection.d.ts +0 -20
- package/components/table/render/body/TableBodySection.js +0 -68
- package/components/table/render/body/TableBodySection.js.map +0 -1
- package/components/table/render/body/TableDataRow.d.ts +0 -15
- package/components/table/render/body/TableDataRow.js +0 -143
- package/components/table/render/body/TableDataRow.js.map +0 -1
- package/components/table/render/body/TableExpandedRow.d.ts +0 -8
- package/components/table/render/body/TableExpandedRow.js +0 -84
- package/components/table/render/body/TableExpandedRow.js.map +0 -1
- package/components/table/render/body/TableGroupRow.d.ts +0 -8
- package/components/table/render/body/TableGroupRow.js +0 -21
- package/components/table/render/body/TableGroupRow.js.map +0 -1
- package/components/table/render/body/TableSpacerRow.d.ts +0 -7
- package/components/table/render/body/TableSpacerRow.js +0 -15
- package/components/table/render/body/TableSpacerRow.js.map +0 -1
- package/components/table/render/footer/TableFooterCell.d.ts +0 -8
- package/components/table/render/footer/TableFooterCell.js +0 -31
- package/components/table/render/footer/TableFooterCell.js.map +0 -1
- package/components/table/render/footer/TableFooterSection.d.ts +0 -10
- package/components/table/render/footer/TableFooterSection.js +0 -28
- package/components/table/render/footer/TableFooterSection.js.map +0 -1
- package/components/table/render/header/TableHeaderSection.d.ts +0 -3
- package/components/table/render/header/TableHeaderSection.js +0 -104
- package/components/table/render/header/TableHeaderSection.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsAnalysisOverlay.js","sources":["../../../src/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.tsx"],"sourcesContent":["import { useCallback, useState, type CSSProperties } from 'react';\n\nimport Notification from '../../Notification';\nimport useDraggableElement from '../../hooks/useDraggableElement';\nimport {\n buildAnalyticsAnalysisData,\n hasRequiredAnalyticsHeaderRow,\n type AnalyticsReportEntry,\n} from '../../utils/analytics/analyticsAnalysisUtils';\nimport useAnalyticsOverlayDom from '../../utils/analytics/useAnalyticsOverlayDom';\nimport { AnalyticsAnalysisBanner } from './AnalyticsAnalysisBanner';\n\
|
|
1
|
+
{"version":3,"file":"AnalyticsAnalysisOverlay.js","sources":["../../../src/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.tsx"],"sourcesContent":["import { useCallback, useState, type CSSProperties } from 'react';\n\nimport Notification from '../../Notification';\nimport useDraggableElement from '../../hooks/useDraggableElement';\nimport {\n buildAnalyticsAnalysisData,\n hasRequiredAnalyticsHeaderRow,\n type AnalyticsReportEntry,\n} from '../../utils/analytics/analyticsAnalysisUtils';\nimport useAnalyticsOverlayDom from '../../utils/analytics/useAnalyticsOverlayDom';\nimport { AnalyticsAnalysisBanner } from './AnalyticsAnalysisBanner';\n\nconst DEFAULT_BANNER_POSITION = {\n top: '70px',\n left: '50%',\n transform: 'translateX(-50%)',\n};\n\ntype AnalysisBannerPosition = {\n /**\n * Initial top offset in pixels relative to the viewport.\n */\n top: number;\n\n /**\n * Initial left offset in pixels relative to the viewport.\n */\n left: number;\n};\n\ntype AnalyticsAnalysisOverlayProps = {\n /**\n * Opacity of the fullscreen analytics overlay backdrop.\n * Values are clamped to the range `0` to `1`.\n *\n * @default 0.5\n */\n overlayBackgroundOpacity?: number;\n\n /**\n * Optional initial viewport coordinates for the draggable analytics banner.\n * When omitted, the banner starts at `top: 70px`, `left: 50%` with `translateX(-50%)`.\n *\n * @default undefined\n */\n bannerStartCoordinates?: AnalysisBannerPosition;\n};\n\nexport const AnalyticsAnalysisOverlay = (props: AnalyticsAnalysisOverlayProps) => {\n const { overlayBackgroundOpacity = 0.5, bannerStartCoordinates } = props;\n\n const normalizedOverlayBackgroundOpacity = Math.min(1, Math.max(0, overlayBackgroundOpacity));\n\n const startTop = bannerStartCoordinates?.top;\n const startLeft = bannerStartCoordinates?.left;\n\n const hasCustomStartCoordinates =\n typeof startTop === 'number' &&\n Number.isFinite(startTop) &&\n typeof startLeft === 'number' &&\n Number.isFinite(startLeft);\n\n const [analyticsLookup, setAnalyticsLookup] = useState<Map<string, AnalyticsReportEntry[]>>(() => new Map());\n const [analyticsDateRangeLabel, setAnalyticsDateRangeLabel] = useState<string | null>(null);\n const [analyticsTotalUsers, setAnalyticsTotalUsers] = useState<number | null>(null);\n\n const [loadedCsvName, setLoadedCsvName] = useState<string | null>(null);\n\n const [showOverlayDetails, setShowOverlayDetails] = useState(true);\n const [showOverlayLabelText, setShowOverlayLabelText] = useState(true);\n\n const initialPosition = hasCustomStartCoordinates ? { top: startTop, left: startLeft } : undefined;\n\n const { draggableRef, isDragging, position, onDragHandleDown, renderElement } = useDraggableElement({\n initialPosition,\n });\n\n const metadataBannerHost = useAnalyticsOverlayDom({\n analyticsLookup,\n overlayBackgroundOpacity: normalizedOverlayBackgroundOpacity,\n showOverlayDetails,\n showOverlayLabelText,\n analyticsTotalUsers,\n });\n\n const handleCsvPick = useCallback(async (files: File[]) => {\n const csvFiles = files.filter(file => file.name.toLowerCase().endsWith('.csv'));\n\n if (csvFiles.length === 0) {\n setAnalyticsLookup(new Map());\n setAnalyticsDateRangeLabel(null);\n setAnalyticsTotalUsers(null);\n setLoadedCsvName(null);\n return;\n }\n\n const selectedFile = csvFiles[0];\n const csvRaw = await selectedFile.text();\n\n if (!hasRequiredAnalyticsHeaderRow(csvRaw)) {\n Notification.error(\n 'A Google Analytics CSV report based on the \"UIKIT AnalyticsAnalysisOverlay Template\" is required.',\n {\n title: 'Unsupported CSV',\n }\n );\n setAnalyticsLookup(new Map());\n setAnalyticsDateRangeLabel(null);\n setAnalyticsTotalUsers(null);\n setLoadedCsvName(null);\n return;\n }\n\n const uploads = [\n {\n reportName: selectedFile.name,\n csvRaw,\n },\n ];\n const analysisData = buildAnalyticsAnalysisData(uploads);\n\n setAnalyticsLookup(analysisData.analyticsLookup);\n setAnalyticsDateRangeLabel(analysisData.analyticsDateRangeLabel);\n setAnalyticsTotalUsers(analysisData.analyticsTotalUsers);\n setLoadedCsvName(selectedFile.name);\n }, []);\n\n const handleClearCsv = useCallback(() => {\n setAnalyticsLookup(new Map());\n setAnalyticsDateRangeLabel(null);\n setAnalyticsTotalUsers(null);\n setLoadedCsvName(null);\n }, []);\n\n const bannerStyle: CSSProperties = position.hasDragged\n ? {\n top: `${position.top}px`,\n left: `${position.left}px`,\n }\n : hasCustomStartCoordinates\n ? {\n top: `${position.top}px`,\n left: `${position.left}px`,\n }\n : DEFAULT_BANNER_POSITION;\n\n return renderElement(\n <AnalyticsAnalysisBanner\n bannerRef={draggableRef}\n bannerStyle={bannerStyle}\n analyticsDateRangeLabel={analyticsDateRangeLabel}\n loadedCsvName={loadedCsvName}\n showOverlayDetails={showOverlayDetails}\n showOverlayLabelText={showOverlayLabelText}\n isDragging={isDragging}\n onCsvPick={handleCsvPick}\n onToggleOverlayDetails={() => setShowOverlayDetails(previousState => !previousState)}\n onToggleOverlayLabelText={() => setShowOverlayLabelText(previousState => !previousState)}\n onClearCsv={handleClearCsv}\n onDragHandleDown={onDragHandleDown}\n />,\n metadataBannerHost\n );\n};\n"],"names":["DEFAULT_BANNER_POSITION","AnalyticsAnalysisOverlay","props","overlayBackgroundOpacity","bannerStartCoordinates","normalizedOverlayBackgroundOpacity","startTop","startLeft","hasCustomStartCoordinates","analyticsLookup","setAnalyticsLookup","useState","analyticsDateRangeLabel","setAnalyticsDateRangeLabel","analyticsTotalUsers","setAnalyticsTotalUsers","loadedCsvName","setLoadedCsvName","showOverlayDetails","setShowOverlayDetails","showOverlayLabelText","setShowOverlayLabelText","initialPosition","draggableRef","isDragging","position","onDragHandleDown","renderElement","useDraggableElement","metadataBannerHost","useAnalyticsOverlayDom","handleCsvPick","useCallback","files","csvFiles","file","selectedFile","csvRaw","hasRequiredAnalyticsHeaderRow","Notification","uploads","analysisData","buildAnalyticsAnalysisData","handleClearCsv","bannerStyle","jsx","AnalyticsAnalysisBanner","previousState"],"mappings":";;;;;;;AAYA,MAAMA,IAA0B;AAAA,EAC5B,KAAK;AAAA,EACL,MAAM;AAAA,EACN,WAAW;AACf,GAgCaC,IAA2B,CAACC,MAAyC;AAC9E,QAAM,EAAE,0BAAAC,IAA2B,KAAK,wBAAAC,EAAA,IAA2BF,GAE7DG,IAAqC,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGF,CAAwB,CAAC,GAEtFG,IAAWF,GAAwB,KACnCG,IAAYH,GAAwB,MAEpCI,IACF,OAAOF,KAAa,YACpB,OAAO,SAASA,CAAQ,KACxB,OAAOC,KAAc,YACrB,OAAO,SAASA,CAAS,GAEvB,CAACE,GAAiBC,CAAkB,IAAIC,EAA8C,MAAM,oBAAI,KAAK,GACrG,CAACC,GAAyBC,CAA0B,IAAIF,EAAwB,IAAI,GACpF,CAACG,GAAqBC,CAAsB,IAAIJ,EAAwB,IAAI,GAE5E,CAACK,GAAeC,CAAgB,IAAIN,EAAwB,IAAI,GAEhE,CAACO,GAAoBC,CAAqB,IAAIR,EAAS,EAAI,GAC3D,CAACS,GAAsBC,CAAuB,IAAIV,EAAS,EAAI,GAE/DW,IAAkBd,IAA4B,EAAE,KAAKF,GAAU,MAAMC,MAAc,QAEnF,EAAE,cAAAgB,GAAc,YAAAC,GAAY,UAAAC,GAAU,kBAAAC,GAAkB,eAAAC,EAAA,IAAkBC,EAAoB;AAAA,IAChG,iBAAAN;AAAA,EAAA,CACH,GAEKO,I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IACpB,MAAM,GAAGA,EAAS,IAAI;AAAA,EAAA,IAE1BjB,IACE;AAAA,IACI,KAAK,GAAGiB,EAAS,GAAG;AAAA,IACpB,MAAM,GAAGA,EAAS,IAAI;AAAA,EAAA,IAE1BzB;AAER,SAAO2B;AAAA,IACH,gBAAAkB;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,WAAWvB;AAAA,QACX,aAAAqB;AAAA,QACA,yBAAAhC;AAAA,QACA,eAAAI;AAAA,QACA,oBAAAE;AAAA,QACA,sBAAAE;AAAA,QACA,YAAAI;AAAA,QACA,WAAWO;AAAA,QACX,wBAAwB,MAAMZ,EAAsB,CAAA4B,MAAiB,CAACA,CAAa;AAAA,QACnF,0BAA0B,MAAM1B,EAAwB,CAAA0B,MAAiB,CAACA,CAAa;AAAA,QACvF,YAAYJ;AAAA,QACZ,kBAAAjB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEJG;AAAA,EAAA;AAER;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as R, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import pt, { useReducer as mt, useRef as E, useCallback as pe, useEffect as F } from "react";
|
|
3
|
-
import { noop as k, size as y, isEmpty as u, filter as H, cond as q, stubTrue as Z, map as Y, flow as ht,
|
|
3
|
+
import { noop as k, size as y, isEmpty as u, filter as H, cond as q, stubTrue as Z, map as Y, flow as ht, find as ft, without as gt, omit as St } from "es-toolkit/compat";
|
|
4
4
|
import { isNil as It, isEqual as W } from "es-toolkit/predicate";
|
|
5
5
|
import me from "../../utils/classNames.js";
|
|
6
6
|
import Tt from "./TreeSearch.js";
|
|
@@ -13,15 +13,15 @@ import fe from "./TreeNothingFound.js";
|
|
|
13
13
|
import Ct from "./TreeOptions.js";
|
|
14
14
|
import At from "./TreeRoot.js";
|
|
15
15
|
import xt from "./TypeCounter.js";
|
|
16
|
-
import {
|
|
16
|
+
import { notEqual as K, getTypeCounts as ge, debounceFn as Nt, filterOutByItemId as Q, filterAssetByType as Et, notEmpty as S, containsItemById as Ft, addOrRemoveFromList as vt, getMappedItemsToGroups as bt, sortGroupsByName as Lt, sortGroupItemsByName as Ot, filterEmptyGroups as Vt, getFlatItems as Rt, excludeFromList as kt, getListIds as Se } from "./treeUtils.js";
|
|
17
17
|
import { getSubTypeCounts as xs } from "./treeUtils.js";
|
|
18
|
-
import { treeReducer as Ht, assetCounted as Ie, allCheckedChanged as v, visibleTypeCountersChanged as wt,
|
|
18
|
+
import { treeReducer as Ht, assetCounted as Ie, allCheckedChanged as v, visibleTypeCountersChanged as wt, searchValueChanged as zt, typeFilterChanged as $t, emptyGroupsChanged as Pt, groupedItemsChanged as Bt, flatItemsChanged as jt } from "./treeReducer.js";
|
|
19
19
|
import { useTreeVirtualization as Dt } from "./useTreeVirtualization.js";
|
|
20
20
|
import { useTreeExpansion as Mt } from "./useTreeExpansion.js";
|
|
21
21
|
import { useTreeHeight as Ut } from "./useTreeHeight.js";
|
|
22
22
|
import { useTreeScrollPosition as _t } from "./useTreeScrollPosition.js";
|
|
23
23
|
import qt from "../smoothScrollbars/SmoothScrollbars.js";
|
|
24
|
-
const Te = (I) =>
|
|
24
|
+
const Te = (I) => St(I, ["expandedGroups", "onExpandGroupsChange", "onSearchChange", "onSelectionChange", "treeOptions"]), Zt = (I, c) => W(Te(I), Te(c)), Yt = 50, Jt = 5, Gs = pt.memo((I) => {
|
|
25
25
|
const {
|
|
26
26
|
groups: c = [],
|
|
27
27
|
items: m = [],
|
|
@@ -134,18 +134,18 @@ const Te = (I) => ft(I, ["expandedGroups", "onExpandGroupsChange", "onSearchChan
|
|
|
134
134
|
groups: t
|
|
135
135
|
});
|
|
136
136
|
}, ae = (e, t) => {
|
|
137
|
-
const s = e.id, a = !i.includes(s) && !t ? [...i, s] : kt(i, s), h =
|
|
137
|
+
const s = e.id, a = !i.includes(s) && !t ? [...i, s] : kt(i, s), h = ft(o.groupedItems, (_) => _.id === s), p = Y(h?.items, (_) => _.id), N = gt(f, ...p), O = c.length, M = b ? 0 : o.emptyGroups.length, V = O - M === a.length;
|
|
138
138
|
d(v(V)), A(N, a);
|
|
139
139
|
}, De = (e) => {
|
|
140
|
-
Fe(e), d(
|
|
140
|
+
Fe(e), d(zt(e)), g && setTimeout(() => {
|
|
141
141
|
ke();
|
|
142
142
|
}, 10);
|
|
143
143
|
}, Me = (e, t) => {
|
|
144
|
-
const s =
|
|
145
|
-
d(
|
|
144
|
+
const s = Rt(e, t);
|
|
145
|
+
d(jt(s));
|
|
146
146
|
}, Ue = (e, t, s) => {
|
|
147
|
-
const r =
|
|
148
|
-
d(
|
|
147
|
+
const r = bt(e, t), l = ht(Lt, Ot)(r), a = s ? l : Vt(l), h = H(l, (p) => u(p.items));
|
|
148
|
+
d(Pt(h)), d(Ie(ge(m))), d(Bt(a));
|
|
149
149
|
}, L = (e, t) => {
|
|
150
150
|
const s = o.searchValue, r = o.typeFilter, l = e, a = t, h = (V) => V && S(V), p = () => u(s) && h(l), N = () => S(s) && h(l), O = u(r) ? a : Et(a, r), M = () => Ue(l, O, b), U = () => Me(O, s);
|
|
151
151
|
q([
|
|
@@ -238,7 +238,7 @@ const Te = (I) => ft(I, ["expandedGroups", "onExpandGroupsChange", "onSearchChan
|
|
|
238
238
|
}, qe = () => {
|
|
239
239
|
const { groupedItems: e } = o;
|
|
240
240
|
return u(e) ? /* @__PURE__ */ n(fe, {}) : D.length > te ? ie() : Y(e, (s) => {
|
|
241
|
-
const r = s.id, l = s.items, a = le?.includes(r) ?? !1, h = H(l,
|
|
241
|
+
const r = s.id, l = s.items, a = le?.includes(r) ?? !1, h = H(l, Ft(f)).length, p = i.includes(r), N = !p && h > 0;
|
|
242
242
|
return /* @__PURE__ */ R(w, { groupId: r, isOpen: a, disableAnimation: x, children: [
|
|
243
243
|
/* @__PURE__ */ n(
|
|
244
244
|
he,
|
|
@@ -285,8 +285,8 @@ const Te = (I) => ft(I, ["expandedGroups", "onExpandGroupsChange", "onSearchChan
|
|
|
285
285
|
[() => C() && !T(), () => qe()],
|
|
286
286
|
[Z, () => Ze()]
|
|
287
287
|
])(), nt = (e) => {
|
|
288
|
-
const t =
|
|
289
|
-
d(
|
|
288
|
+
const t = vt(o.typeFilter, e);
|
|
289
|
+
d($t(t)), Oe(t);
|
|
290
290
|
}, lt = y(o.visibleTypeCounters) !== 1, ct = S(o.typeFilter), at = !Ce, it = !et, dt = !Ge, ut = !Ne, ue = !It(X);
|
|
291
291
|
return /* @__PURE__ */ R("div", { ...Re, className: st, ref: se, children: [
|
|
292
292
|
/* @__PURE__ */ R("div", { className: "TreeHeader", children: [
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AreaProps as RechartsAreaProps } from 'recharts';
|
|
2
2
|
import { CurveType } from 'recharts/types/shape/Curve';
|
|
3
|
-
export type AreaProps<T =
|
|
3
|
+
export type AreaProps<T = unknown> = Omit<RechartsAreaProps<T, unknown>, 'ref' | 'dataKey'> & {
|
|
4
4
|
strokeColor?: string;
|
|
5
|
-
|
|
5
|
+
fill?: string;
|
|
6
|
+
dataKey?: string | number | ((obj: T) => unknown);
|
|
6
7
|
unit?: string;
|
|
7
8
|
legendType?: string;
|
|
8
9
|
type?: CurveType;
|
|
@@ -12,9 +13,10 @@ export declare const getAreaDefaultProps: () => {
|
|
|
12
13
|
dataKey: string;
|
|
13
14
|
unit: string;
|
|
14
15
|
strokeColor: string;
|
|
16
|
+
fill: string;
|
|
15
17
|
legendType: string;
|
|
16
18
|
type: string;
|
|
17
19
|
isAnimationActive: boolean;
|
|
18
20
|
};
|
|
19
|
-
declare const Area: (
|
|
21
|
+
declare const Area: (_props: AreaProps) => null;
|
|
20
22
|
export default Area;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = () => ({
|
|
2
2
|
dataKey: "value",
|
|
3
3
|
unit: "",
|
|
4
4
|
strokeColor: "color-coldplay-fountain",
|
|
5
|
+
fill: "color-coldplay-fountain",
|
|
5
6
|
legendType: "square",
|
|
6
7
|
type: "monotone",
|
|
7
8
|
isAnimationActive: !0
|
|
8
|
-
}), t = (
|
|
9
|
+
}), t = (o) => null;
|
|
9
10
|
export {
|
|
10
11
|
t as default,
|
|
11
|
-
|
|
12
|
+
e as getAreaDefaultProps
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=Area.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Area.js","sources":["../../../src/components/charts/Area.tsx"],"sourcesContent":["import type { AreaProps as RechartsAreaProps } from 'recharts';\nimport type { CurveType } from 'recharts/types/shape/Curve';\n\
|
|
1
|
+
{"version":3,"file":"Area.js","sources":["../../../src/components/charts/Area.tsx"],"sourcesContent":["import type { AreaProps as RechartsAreaProps } from 'recharts';\nimport type { CurveType } from 'recharts/types/shape/Curve';\n\nexport type AreaProps<T = unknown> = Omit<RechartsAreaProps<T, unknown>, 'ref' | 'dataKey'> & {\n strokeColor?: string;\n fill?: string;\n dataKey?: string | number | ((obj: T) => unknown);\n unit?: string;\n legendType?: string;\n type?: CurveType;\n isAnimationActive?: boolean;\n};\n\nexport const getAreaDefaultProps = () => ({\n dataKey: 'value',\n unit: '',\n strokeColor: 'color-coldplay-fountain',\n fill: 'color-coldplay-fountain',\n legendType: 'square',\n type: 'monotone',\n isAnimationActive: true,\n});\n\nconst Area = (_props: AreaProps) => null;\n\nexport default Area;\n"],"names":["getAreaDefaultProps","Area","_props"],"mappings":"AAaO,MAAMA,IAAsB,OAAO;AAAA,EACtC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,mBAAmB;AACvB,IAEMC,IAAO,CAACC,MAAsB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.js","sources":["../../../src/components/charts/AreaChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n AreaChart as RechartsAreaChart,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport AreaGradient, { DEFAULT_ARIA_GRADIENT_ID, type AreaGradientProps } from './AreaGradient';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\n\ntype RechartsAreaChartProps = React.ComponentProps<typeof RechartsAreaChart>;\n\nexport type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n gradients?: React.ReactElement<AreaGradientProps>[];\n areas: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n showGrid?: boolean;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst AreaChart = <T extends object>(props: AreaChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n gradients = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n additionalAxes = [],\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const areasWithGradient = areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, ...remainingAreaProps } = areaPropsWithDefault;\n const gradientId = area.key;\n const stroke = getColor(strokeColor);\n return {\n area: (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps, 'ref'>)}\n key={area.key}\n stroke={stroke}\n fill={`url(#${gradientId})`}\n />\n ),\n gradient: <AreaGradient key={area.key} id={gradientId || DEFAULT_ARIA_GRADIENT_ID} color={strokeColor} />,\n };\n });\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : ({} as LegendProps);\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsAreaChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n <defs>\n {gradients}\n {areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)}\n </defs>\n\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && legendProps && (\n <>\n {/* @ts-ignore: intentionally as formatter is different. See Legend component */}\n <RechartsLegend\n wrapperStyle={\n legendProps.verticalAlign === 'bottom' ? { bottom: 0 } : legendProps.wrapperStyle\n }\n {...legendProps}\n />\n </>\n )}\n\n {areasWithGradient.map(areaWithGradient => areaWithGradient.area)}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsAreaChart>\n </ResponsiveContainer>\n );\n};\n\nexport default AreaChart;\n"],"names":["AreaChart","props","width","height","data","dataUnit","dataKey","gradients","areas","referenceLines","xAxisOptions","yAxisOptions","gridOptions","containerOptions","showXAxis","showYAxis","additionalAxes","showGrid","legend","brush","tooltip","remainingProps","areasWithGradient","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","remainingAreaProps","gradientId","stroke","getColor","createElement","RechartsArea","AreaGradient","DEFAULT_ARIA_GRADIENT_ID","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsAreaChart","areaWithGradient","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","Fragment","RechartsLegend","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;AAmDA,MAAMA,KAAY,CAAmBC,MAA6B;AAC9D,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO,CAAA;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,WAAAC,IAAY,CAAA;AAAA,IACZ,OAAAC,IAAQ,CAAA;AAAA,IACR,gBAAAC,IAAiB,CAAA;AAAA,IACjB,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,gBAAAC,IAAiB,CAAA;AAAA,IACjB,UAAAC,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,GAAGC;AAAA,EAAA,IACHpB,GAEEqB,IAAoBd,EAAM,IAAI,CAAAe,MAAQ;AACxC,UAAMC,IAAuB,EAAE,GAAGC,KAAuB,GAAGF,EAAK,MAAA,GAC3D,EAAE,aAAAG,GAAa,GAAGC,EAAA,IAAuBH,GACzCI,IAAaL,EAAK,KAClBM,IAASC,EAASJ,CAAW;AACnC,WAAO;AA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B,EAACU,GAAA,EAAc,GAAGd,EAAA,CAAc;AAAA,YAE3CjB,KAAUmB,KACP,gBAAAE,EAAAW,GAAA,EAEI,UAAA,gBAAAX;AAAA,cAACY;AAAAA,cAAA;AAAA,gBACG,cACId,EAAY,kBAAkB,WAAW,EAAE,QAAQ,EAAA,IAAMA,EAAY;AAAA,gBAExE,GAAGA;AAAA,cAAA;AAAA,YAAA,GAEZ;AAAA,YAGHf,EAAkB,IAAI,CAAAqB,MAAoBA,EAAiB,IAAI;AAAA,YAE/DlC,EAAe,IAAI2C,CAAmB;AAAA,YAEtCjC,KAAS,gBAAAoB,EAACc,GAAA,EAAM,QAAQvB,EAAS,MAAM,EAAA,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/C;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"AreaChart.js","sources":["../../../src/components/charts/AreaChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n AreaChart as RechartsAreaChart,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport AreaGradient, { DEFAULT_ARIA_GRADIENT_ID, type AreaGradientProps } from './AreaGradient';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\n\ntype RechartsAreaChartProps = React.ComponentProps<typeof RechartsAreaChart>;\n\nexport type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n gradients?: React.ReactElement<AreaGradientProps>[];\n areas: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n showGrid?: boolean;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst AreaChart = <T extends object>(props: AreaChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n gradients = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n additionalAxes = [],\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const areasWithGradient = areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, ...remainingAreaProps } = areaPropsWithDefault;\n const gradientId = area.key;\n const stroke = getColor(strokeColor);\n return {\n area: (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps<unknown, unknown>, 'ref'>)}\n key={area.key}\n stroke={stroke}\n fill={`url(#${gradientId})`}\n />\n ),\n gradient: <AreaGradient key={area.key} id={gradientId || DEFAULT_ARIA_GRADIENT_ID} color={strokeColor} />,\n };\n });\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : ({} as LegendProps);\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsAreaChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n <defs>\n {gradients}\n {areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)}\n </defs>\n\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && legendProps && (\n <>\n {/* @ts-ignore: intentionally as formatter is different. See Legend component */}\n <RechartsLegend\n wrapperStyle={\n legendProps.verticalAlign === 'bottom' ? { bottom: 0 } : legendProps.wrapperStyle\n }\n {...legendProps}\n />\n </>\n )}\n\n {areasWithGradient.map(areaWithGradient => areaWithGradient.area)}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsAreaChart>\n </ResponsiveContainer>\n );\n};\n\nexport default AreaChart;\n"],"names":["AreaChart","props","width","height","data","dataUnit","dataKey","gradients","areas","referenceLines","xAxisOptions","yAxisOptions","gridOptions","containerOptions","showXAxis","showYAxis","additionalAxes","showGrid","legend","brush","tooltip","remainingProps","areasWithGradient","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","remainingAreaProps","gradientId","stroke","getColor","createElement","RechartsArea","AreaGradient","DEFAULT_ARIA_GRADIENT_ID","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsAreaChart","areaWithGradient","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","Fragment","RechartsLegend","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;AAmDA,MAAMA,KAAY,CAAmBC,MAA6B;AAC9D,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,QAAAC;AAAA,I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["../../../src/components/charts/ComposedChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n ComposedChart as RechartsComposedChart,\n Line as RechartsLine,\n Bar as RechartsBar,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n type LineProps as RechartsLineProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getBarDefaultProps, type BarProps } from './Bar';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\nimport { getLineDefaultProps, type LineProps } from './Line';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\n\ntype RechartsComposedChartProps = React.ComponentProps<typeof RechartsComposedChart>;\n\nexport type ComposedChartProps<T extends object> = Omit<RechartsComposedChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n lines?: React.ReactElement<LineProps>[];\n bars?: React.ReactElement<BarProps>[];\n areas?: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n showGrid?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst ComposedChart = <T extends object>(props: ComposedChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n lines = [],\n bars = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n additionalAxes = [],\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : {};\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsComposedChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && <RechartsLegend {...legendProps} />}\n\n {areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, fill, ...remainingAreaProps } = areaPropsWithDefault;\n return (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps, 'ref'>)}\n key={area.key}\n stroke={getColor(strokeColor)}\n fill={getColor(fill)}\n />\n );\n })}\n\n {bars.map(bar => {\n const barPropsWithDefault = { ...getBarDefaultProps(), ...bar.props };\n const { color, ...remainingBarProps } = barPropsWithDefault;\n const cellColor = color && getColor(color);\n return <RechartsBar key={bar.key} unit={dataUnit} {...remainingBarProps} fill={cellColor} />;\n })}\n\n {lines.map(line => {\n const linePropsWithDefault = { ...getLineDefaultProps(), ...line.props };\n const { strokeColor, ...remainingLineProps } = linePropsWithDefault;\n return (\n <RechartsLine\n {...(remainingLineProps as Omit<RechartsLineProps, 'ref'>)}\n key={line.key}\n stroke={getColor(strokeColor)}\n />\n );\n })}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsComposedChart>\n </ResponsiveContainer>\n );\n};\n\nexport default ComposedChart;\n"],"names":["ComposedChart","props","width","height","data","dataUnit","dataKey","lines","bars","areas","referenceLines","xAxisOptions","yAxisOptions","additionalAxes","gridOptions","containerOptions","showXAxis","showYAxis","showGrid","legend","brush","tooltip","remainingProps","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsComposedChart","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","RechartsLegend","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","fill","remainingAreaProps","createElement","RechartsArea","getColor","bar","barPropsWithDefault","getBarDefaultProps","color","remainingBarProps","cellColor","RechartsBar","line","linePropsWithDefault","getLineDefaultProps","remainingLineProps","RechartsLine","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;;AAwDA,MAAMA,KAAgB,CAAmBC,MAAiC;AACtE,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO,CAAA;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ,CAAA;AAAA,IACR,MAAAC,IAAO,CAAA;AAAA,IACP,OAAAC,IAAQ,CAAA;AAAA,IACR,gBAAAC,IAAiB,CAAA;AAAA,IACjB,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC,IAAiB,CAAA;AAAA,IACjB,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAC,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAA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AQQ,EAASL,CAAW;AAAA,kBAC5B,MAAMK,EAASJ,CAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YAG/B,CAAC;AAAA,YAEAlC,EAAK,IAAI,CAAAuC,MAAO;AACb,oBAAMC,IAAsB,EAAE,GAAGC,KAAsB,GAAGF,EAAI,MAAA,GACxD,EAAE,OAAAG,GAAO,GAAGC,EAAA,IAAsBH,GAClCI,IAAYF,KAASJ,EAASI,CAAK;AACzC,qBAAO,gBAAAvB,EAAC0B,KAA0B,MAAMhD,GAAW,GAAG8C,GAAmB,MAAMC,KAAtDL,EAAI,GAA6D;AAAA,YAC9F,CAAC;AAAA,YAEAxC,EAAM,IAAI,CAAA+C,MAAQ;AACf,oBAAMC,IAAuB,EAAE,GAAGC,KAAuB,GAAGF,EAAK,MAAA,GAC3D,EAAE,aAAAb,GAAa,GAAGgB,EAAA,IAAuBF;AAC/C,qBACI,gBAAAX;AAAA,gBAACc;AAAAA,gBAAA;AAAA,kBACI,GAAID;AAAA,kBACL,KAAKH,EAAK;AAAA,kBACV,QAAQR,EAASL,CAAW;AAAA,gBAAA;AAAA,cAAA;AAAA,YAGxC,CAAC;AAAA,YAEA/B,EAAe,IAAIiD,CAAmB;AAAA,YAEtCvC,KAAS,gBAAAO,EAACiC,GAAA,EAAM,QAAQd,EAAS,MAAM,EAAA,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/C;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"ComposedChart.js","sources":["../../../src/components/charts/ComposedChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n ComposedChart as RechartsComposedChart,\n Line as RechartsLine,\n Bar as RechartsBar,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n type LineProps as RechartsLineProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getBarDefaultProps, type BarProps } from './Bar';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\nimport { getLineDefaultProps, type LineProps } from './Line';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\n\ntype RechartsComposedChartProps = React.ComponentProps<typeof RechartsComposedChart>;\n\nexport type ComposedChartProps<T extends object> = Omit<RechartsComposedChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n lines?: React.ReactElement<LineProps>[];\n bars?: React.ReactElement<BarProps>[];\n areas?: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n showGrid?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst ComposedChart = <T extends object>(props: ComposedChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n lines = [],\n bars = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n additionalAxes = [],\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : {};\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsComposedChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && <RechartsLegend {...legendProps} />}\n\n {areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, fill, ...remainingAreaProps } = areaPropsWithDefault;\n return (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps<unknown, unknown>, 'ref'>)}\n key={area.key}\n stroke={getColor(strokeColor)}\n fill={getColor(fill)}\n />\n );\n })}\n\n {bars.map(bar => {\n const barPropsWithDefault = { ...getBarDefaultProps(), ...bar.props };\n const { color, ...remainingBarProps } = barPropsWithDefault;\n const cellColor = color && getColor(color);\n return <RechartsBar key={bar.key} unit={dataUnit} {...remainingBarProps} fill={cellColor} />;\n })}\n\n {lines.map(line => {\n const linePropsWithDefault = { ...getLineDefaultProps(), ...line.props };\n const { strokeColor, ...remainingLineProps } = linePropsWithDefault;\n return (\n <RechartsLine\n {...(remainingLineProps as Omit<RechartsLineProps, 'ref'>)}\n key={line.key}\n stroke={getColor(strokeColor)}\n />\n );\n })}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsComposedChart>\n </ResponsiveContainer>\n );\n};\n\nexport default ComposedChart;\n"],"names":["ComposedChart","props","width","height","data","dataUnit","dataKey","lines","bars","areas","referenceLines","xAxisOptions","yAxisOptions","additionalAxes","gridOptions","containerOptions","showXAxis","showYAxis","showGrid","legend","brush","tooltip","remainingProps","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsComposedChart","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","RechartsLegend","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","fill","remainingAreaProps","createElement","RechartsArea","getColor","bar","barPropsWithDefault","getBarDefaultProps","color","remainingBarProps","cellColor","RechartsBar","line","linePropsWithDefault","getLineDefaultProps","remainingLineProps","RechartsLine","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;;AAwDA,MAAMA,KAAgB,CAAmBC,MAAiC;AACtE,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO,CAAA;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ,CAAA;AAAA,IACR,MAAAC,IAAO,CAAA;AAAA,IACP,OAAAC,IAAQ,CAAA;AAAA,IACR,gBAAAC,IAAiB,CAAA;AAAA,IACjB,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC,IAAiB,CAAA;AAAA,IACjB,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAC,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,GAAGC;AAAA,EAAA,IACHrB,GAEEsB,IAAeC,EAASH,CAAO,IAAIA,EAAQ,QAAQ,CAAA,GACnDI,IAAcD,EAASL,CAAM,IAAI,EAAE,GAAGO,EAAA,GAAyB,GAAGP,EAAO,MAAA,IAAU,CAAA;AAEzF,SACI,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,WAAW;AAAA,MACX,UAAU;AAAA,M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;AACzC,qBAAO,gBAAAvB,EAAC0B,KAA0B,MAAMhD,GAAW,GAAG8C,GAAmB,MAAMC,KAAtDL,EAAI,GAA6D;AAAA,YAC9F,CAAC;AAAA,YAEAxC,EAAM,IAAI,CAAA+C,MAAQ;AACf,oBAAMC,IAAuB,EAAE,GAAGC,KAAuB,GAAGF,EAAK,MAAA,GAC3D,EAAE,aAAAb,GAAa,GAAGgB,EAAA,IAAuBF;AAC/C,qBACI,gBAAAX;AAAA,gBAACc;AAAAA,gBAAA;AAAA,kBACI,GAAID;AAAA,kBACL,KAAKH,EAAK;AAAA,kBACV,QAAQR,EAASL,CAAW;AAAA,gBAAA;AAAA,cAAA;AAAA,YAGxC,CAAC;AAAA,YAEA/B,EAAe,IAAIiD,CAAmB;AAAA,YAEtCvC,KAAS,gBAAAO,EAACiC,GAAA,EAAM,QAAQd,EAAS,MAAM,EAAA,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/C;AAAA,EAAA;AAGZ;"}
|
|
@@ -148,6 +148,25 @@ export type ClearableInputProps = {
|
|
|
148
148
|
* Note, this function may not be an empty function, otherwise the mask selection won't work
|
|
149
149
|
*/
|
|
150
150
|
maskDispatch?: (appended: string, dynamicMasked: any) => any;
|
|
151
|
+
/**
|
|
152
|
+
* Pattern used by IMask date masks.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* 'Y-m-d'
|
|
156
|
+
*/
|
|
157
|
+
pattern?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Formats a typed date value to the masked string representation.
|
|
160
|
+
*/
|
|
161
|
+
format?: (value: Date | null, masked: unknown) => string;
|
|
162
|
+
/**
|
|
163
|
+
* Parses the masked string representation back to a typed date value.
|
|
164
|
+
*/
|
|
165
|
+
parse?: (value: string, masked: unknown) => Date | null;
|
|
166
|
+
/**
|
|
167
|
+
* Enables IMask autofix behavior for date and number masks.
|
|
168
|
+
*/
|
|
169
|
+
autofix?: boolean | 'pad';
|
|
151
170
|
/**
|
|
152
171
|
* Controls when the mask pattern is visible.
|
|
153
172
|
*
|
|
@@ -182,6 +201,17 @@ export type ClearableInputProps = {
|
|
|
182
201
|
* @default false
|
|
183
202
|
*/
|
|
184
203
|
disabled?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Makes the input read-only.
|
|
206
|
+
*/
|
|
207
|
+
readOnly?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Controls whether the clear button is rendered.
|
|
210
|
+
* This might be useful to reuse this component for other use-cases.
|
|
211
|
+
*
|
|
212
|
+
* @default true
|
|
213
|
+
*/
|
|
214
|
+
showClearButton?: boolean;
|
|
185
215
|
/**
|
|
186
216
|
* Additional classes to be set on the input element.
|
|
187
217
|
*/
|
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { omit as
|
|
4
|
-
import { isNil as
|
|
1
|
+
import { jsxs as pe, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as me, useState as d, useRef as fe } from "react";
|
|
3
|
+
import { omit as de, isEmpty as he } from "es-toolkit/compat";
|
|
4
|
+
import { isNil as Ce, isFunction as ge } from "es-toolkit/predicate";
|
|
5
5
|
import { noop as t } from "es-toolkit/function";
|
|
6
|
-
import { IMaskInput as
|
|
6
|
+
import { IMaskInput as ve } from "react-imask";
|
|
7
7
|
import h from "../../utils/classNames.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const R = "text",
|
|
8
|
+
import ke from "../../hooks/usePrevious.js";
|
|
9
|
+
import ye from "../../hooks/useMergeRefs.js";
|
|
10
|
+
const R = "text", Ie = ["text", "password", "email"], T = (i) => !he(`${i}`), De = me((i, C) => {
|
|
11
11
|
const {
|
|
12
|
-
type:
|
|
13
|
-
defaultValue:
|
|
12
|
+
type: D = R,
|
|
13
|
+
defaultValue: M,
|
|
14
14
|
value: s,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
showClearButton: g = !0,
|
|
16
|
+
maxLength: S,
|
|
17
|
+
tabIndex: O = 0,
|
|
17
18
|
hasError: L = !1,
|
|
18
19
|
inputRef: v,
|
|
19
|
-
autoComplete:
|
|
20
|
-
onChange:
|
|
21
|
-
onBlur:
|
|
22
|
-
onFocus:
|
|
23
|
-
onClear:
|
|
24
|
-
onKeyPress:
|
|
25
|
-
onClick:
|
|
26
|
-
mask:
|
|
27
|
-
maskPlaceholder:
|
|
28
|
-
maskVisibility:
|
|
29
|
-
maskOverwrite:
|
|
30
|
-
maskDefinitions:
|
|
31
|
-
maskDispatch:
|
|
32
|
-
inputClassName:
|
|
20
|
+
autoComplete: _,
|
|
21
|
+
onChange: a = t,
|
|
22
|
+
onBlur: j = t,
|
|
23
|
+
onFocus: A = t,
|
|
24
|
+
onClear: k = t,
|
|
25
|
+
onKeyPress: K = t,
|
|
26
|
+
onClick: U = t,
|
|
27
|
+
mask: y,
|
|
28
|
+
maskPlaceholder: Y = "_",
|
|
29
|
+
maskVisibility: z = "always",
|
|
30
|
+
maskOverwrite: $ = !0,
|
|
31
|
+
maskDefinitions: q,
|
|
32
|
+
maskDispatch: I,
|
|
33
|
+
inputClassName: G = "",
|
|
33
34
|
disabled: c = !1,
|
|
34
|
-
|
|
35
|
+
readOnly: H = !1,
|
|
36
|
+
className: P = "",
|
|
35
37
|
children: p,
|
|
36
|
-
...
|
|
37
|
-
} =
|
|
38
|
-
switch (
|
|
38
|
+
...J
|
|
39
|
+
} = i, w = s || M || "", [b, Q] = d(w), [N, W] = d(T(w)), [V, x] = d(!1), B = !Ce(s), o = fe(null), X = ye(o, v, C), r = !!y, Z = () => {
|
|
40
|
+
switch (z) {
|
|
39
41
|
case "always":
|
|
40
42
|
return !0;
|
|
41
43
|
case "onFocus":
|
|
42
|
-
return
|
|
44
|
+
return V;
|
|
43
45
|
case "never":
|
|
44
46
|
return !1;
|
|
45
47
|
default:
|
|
46
|
-
return
|
|
48
|
+
return V;
|
|
47
49
|
}
|
|
48
50
|
}, l = (e = "") => {
|
|
49
|
-
b !== e && (
|
|
51
|
+
b !== e && (Q(e), W(T(e)));
|
|
50
52
|
};
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
},
|
|
53
|
+
ke(s) !== s && l(s);
|
|
54
|
+
const ee = (e) => {
|
|
55
|
+
const n = e.target.value;
|
|
56
|
+
B || l(n), a(n, e);
|
|
57
|
+
}, te = (e, n, we) => {
|
|
56
58
|
if (!o.current)
|
|
57
59
|
return;
|
|
58
60
|
const f = {
|
|
@@ -73,66 +75,67 @@ const R = "text", ke = ["text", "password", "email"], T = (u) => !fe(`${u}`), Te
|
|
|
73
75
|
type: "change",
|
|
74
76
|
timeStamp: Date.now()
|
|
75
77
|
};
|
|
76
|
-
f.target.unmaskedValue =
|
|
77
|
-
}, ee = (e) => {
|
|
78
|
-
V(!0), j(e);
|
|
79
|
-
}, te = (e) => {
|
|
80
|
-
V(!1), _(e);
|
|
78
|
+
f.target.unmaskedValue = n.unmaskedValue, B || l(e), a(e, f);
|
|
81
79
|
}, se = (e) => {
|
|
82
|
-
A(e);
|
|
80
|
+
x(!0), A(e);
|
|
81
|
+
}, ae = (e) => {
|
|
82
|
+
x(!1), j(e);
|
|
83
83
|
}, ne = (e) => {
|
|
84
|
-
|
|
85
|
-
},
|
|
84
|
+
K(e);
|
|
85
|
+
}, oe = (e) => {
|
|
86
|
+
l(""), a("", e), k && k(e);
|
|
87
|
+
}, re = h(
|
|
86
88
|
"ClearableInput",
|
|
87
89
|
"input-group",
|
|
88
90
|
L && "has-error",
|
|
89
91
|
c && "pointer-events-none",
|
|
90
|
-
|
|
91
|
-
),
|
|
92
|
+
P && P
|
|
93
|
+
), le = h(
|
|
92
94
|
"form-control",
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
G,
|
|
96
|
+
N && g && "withClearButton",
|
|
95
97
|
r && "withInputMask",
|
|
96
98
|
c && "disabled"
|
|
97
|
-
),
|
|
98
|
-
...
|
|
99
|
-
className:
|
|
100
|
-
autoComplete:
|
|
101
|
-
type:
|
|
99
|
+
), ue = h("clearButton", (!N || !g) && "hide"), E = D?.toLowerCase(), ie = Ie.indexOf(E) !== -1 ? E : R, m = {
|
|
100
|
+
...de(J, ["value", "defaultValue", "onClear"]),
|
|
101
|
+
className: le,
|
|
102
|
+
autoComplete: _,
|
|
103
|
+
type: ie,
|
|
102
104
|
value: b,
|
|
103
|
-
onKeyPress:
|
|
104
|
-
onBlur:
|
|
105
|
-
onFocus:
|
|
106
|
-
onChange: r ? void 0 :
|
|
105
|
+
onKeyPress: ne,
|
|
106
|
+
onBlur: ae,
|
|
107
|
+
onFocus: se,
|
|
108
|
+
onChange: r ? void 0 : ee,
|
|
107
109
|
// In case of masked input, the onAccept callback is used
|
|
108
|
-
onClick:
|
|
110
|
+
onClick: U,
|
|
109
111
|
disabled: c,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
readOnly: H,
|
|
113
|
+
maxLength: r ? void 0 : S,
|
|
114
|
+
tabIndex: O
|
|
112
115
|
}, F = {};
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
+
I && (F.dispatch = I);
|
|
117
|
+
const ce = r ? /* @__PURE__ */ u(
|
|
118
|
+
ve,
|
|
116
119
|
{
|
|
117
120
|
...m,
|
|
118
|
-
inputRef:
|
|
119
|
-
mask:
|
|
120
|
-
definitions:
|
|
121
|
+
inputRef: X,
|
|
122
|
+
mask: y,
|
|
123
|
+
definitions: q,
|
|
121
124
|
...F,
|
|
122
|
-
placeholderChar:
|
|
123
|
-
onAccept:
|
|
124
|
-
lazy: !
|
|
125
|
-
overwrite:
|
|
125
|
+
placeholderChar: Y,
|
|
126
|
+
onAccept: te,
|
|
127
|
+
lazy: !Z(),
|
|
128
|
+
overwrite: $
|
|
126
129
|
}
|
|
127
|
-
) : /* @__PURE__ */
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
-
p &&
|
|
130
|
-
/* @__PURE__ */
|
|
130
|
+
) : /* @__PURE__ */ u("input", { ...m, ref: v || C });
|
|
131
|
+
return /* @__PURE__ */ pe("div", { className: re, children: [
|
|
132
|
+
p && ge(p) ? p(m) : ce,
|
|
133
|
+
/* @__PURE__ */ u("span", { className: ue, onClick: oe, children: /* @__PURE__ */ u("span", { className: "clearButtonIcon rioglyph rioglyph-remove-sign" }) })
|
|
131
134
|
] });
|
|
132
135
|
});
|
|
133
136
|
export {
|
|
134
137
|
R as DEFAULT_TYPE,
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
Ie as SUPPORTED_TYPES,
|
|
139
|
+
De as default
|
|
137
140
|
};
|
|
138
141
|
//# sourceMappingURL=ClearableInput.js.map
|