@gravity-ui/chartkit 5.17.1 → 5.18.0
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/build/components/ChartKit.css +0 -1
- package/build/components/SplitPane/Pane.d.ts +14 -0
- package/build/components/SplitPane/Pane.js +26 -0
- package/build/components/SplitPane/Resizer.d.ts +18 -0
- package/build/components/SplitPane/Resizer.js +26 -0
- package/build/components/SplitPane/SplitPane.d.ts +59 -0
- package/build/components/SplitPane/SplitPane.js +235 -0
- package/build/{plugins/highcharts/renderer/components/StyledSplitPane → components/SplitPane}/StyledSplitPane.css +0 -1
- package/build/{plugins/highcharts/renderer/components/StyledSplitPane → components/SplitPane}/StyledSplitPane.d.ts +1 -1
- package/build/{plugins/highcharts/renderer/components/StyledSplitPane → components/SplitPane}/StyledSplitPane.js +3 -3
- package/build/components/SplitPane/constants.d.ts +4 -0
- package/build/components/SplitPane/constants.js +4 -0
- package/build/components/SplitPane/index.d.ts +8 -0
- package/build/components/SplitPane/index.js +18 -0
- package/build/components/SplitPane/types.d.ts +2 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/misc.d.ts +10 -0
- package/build/constants/misc.js +19 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/misc.d.ts +1 -0
- package/build/hooks/misc.js +8 -0
- package/build/plugins/d3/index.d.ts +1 -1
- package/build/plugins/d3/index.js +2 -1
- package/build/plugins/d3/renderer/D3Widget.d.ts +5 -1
- package/build/plugins/d3/renderer/D3Widget.js +31 -66
- package/build/plugins/d3/renderer/withSplitPane/TooltipContent.d.ts +8 -0
- package/build/plugins/d3/renderer/withSplitPane/TooltipContent.js +12 -0
- package/build/plugins/d3/renderer/withSplitPane/useWithSplitPaneState.d.ts +19 -0
- package/build/plugins/d3/renderer/withSplitPane/useWithSplitPaneState.js +46 -0
- package/build/plugins/d3/renderer/withSplitPane/withSplitPane.d.ts +4 -0
- package/build/plugins/d3/renderer/withSplitPane/withSplitPane.js +100 -0
- package/build/plugins/d3/types.d.ts +2 -2
- package/build/plugins/highcharts/renderer/HighchartsWidget.d.ts +2 -2
- package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.js +1 -1
- package/build/types/index.js +1 -0
- package/build/types/widget-data/pie.d.ts +1 -1
- package/build/types/widget.d.ts +6 -3
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/misc.d.ts +2 -0
- package/build/utils/misc.js +7 -0
- package/package.json +4 -4
- package/build/plugins/d3/examples/ExampleWrapper.d.ts +0 -7
- package/build/plugins/d3/examples/ExampleWrapper.js +0 -5
- package/build/plugins/d3/examples/area/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/area/Basic.js +0 -34
- package/build/plugins/d3/examples/area/NegativeValues.d.ts +0 -2
- package/build/plugins/d3/examples/area/NegativeValues.js +0 -24
- package/build/plugins/d3/examples/area/PercentStacking.d.ts +0 -2
- package/build/plugins/d3/examples/area/PercentStacking.js +0 -47
- package/build/plugins/d3/examples/area/StackedArea.d.ts +0 -2
- package/build/plugins/d3/examples/area/StackedArea.js +0 -47
- package/build/plugins/d3/examples/area/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/area/TwoYAxis.js +0 -58
- package/build/plugins/d3/examples/bar-x/Basic.d.ts +0 -4
- package/build/plugins/d3/examples/bar-x/Basic.js +0 -88
- package/build/plugins/d3/examples/bar-x/DataLabels.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/DataLabels.js +0 -48
- package/build/plugins/d3/examples/bar-x/GroupedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/GroupedColumns.js +0 -48
- package/build/plugins/d3/examples/bar-x/NegativeValues.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/NegativeValues.js +0 -41
- package/build/plugins/d3/examples/bar-x/PercentStack.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/PercentStack.js +0 -47
- package/build/plugins/d3/examples/bar-x/StackedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/StackedColumns.js +0 -47
- package/build/plugins/d3/examples/bar-x/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/TwoYAxis.js +0 -58
- package/build/plugins/d3/examples/bar-y/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/Basic.js +0 -45
- package/build/plugins/d3/examples/bar-y/GroupedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/GroupedColumns.js +0 -50
- package/build/plugins/d3/examples/bar-y/NegativeValues.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/NegativeValues.js +0 -40
- package/build/plugins/d3/examples/bar-y/PercentStacking.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/PercentStacking.js +0 -49
- package/build/plugins/d3/examples/bar-y/StackedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/StackedColumns.js +0 -49
- package/build/plugins/d3/examples/combined/LineAndBarX.d.ts +0 -2
- package/build/plugins/d3/examples/combined/LineAndBarX.js +0 -63
- package/build/plugins/d3/examples/line/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/line/Basic.js +0 -68
- package/build/plugins/d3/examples/line/DataLabels.d.ts +0 -2
- package/build/plugins/d3/examples/line/DataLabels.js +0 -91
- package/build/plugins/d3/examples/line/LineWithMarkers.d.ts +0 -2
- package/build/plugins/d3/examples/line/LineWithMarkers.js +0 -69
- package/build/plugins/d3/examples/line/LogarithmicAxis.d.ts +0 -2
- package/build/plugins/d3/examples/line/LogarithmicAxis.js +0 -38
- package/build/plugins/d3/examples/line/Shapes.d.ts +0 -2
- package/build/plugins/d3/examples/line/Shapes.js +0 -93
- package/build/plugins/d3/examples/line/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/line/TwoYAxis.js +0 -58
- package/build/plugins/d3/examples/mars-weather.d.ts +0 -13
- package/build/plugins/d3/examples/mars-weather.js +0 -1203
- package/build/plugins/d3/examples/nintendoGames.d.ts +0 -92
- package/build/plugins/d3/examples/nintendoGames.js +0 -12264
- package/build/plugins/d3/examples/pie/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/pie/Basic.js +0 -32
- package/build/plugins/d3/examples/pie/Donut.d.ts +0 -2
- package/build/plugins/d3/examples/pie/Donut.js +0 -33
- package/build/plugins/d3/examples/pie/DonutWithTotals.d.ts +0 -2
- package/build/plugins/d3/examples/pie/DonutWithTotals.js +0 -36
- package/build/plugins/d3/examples/scatter/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/scatter/Basic.js +0 -47
- package/build/plugins/d3/examples/scatter/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/scatter/TwoYAxis.js +0 -58
- package/build/plugins/d3/renderer/components/AxisX.d.ts +0 -19
- package/build/plugins/d3/renderer/components/AxisX.js +0 -108
- package/build/plugins/d3/renderer/components/AxisY.d.ts +0 -11
- package/build/plugins/d3/renderer/components/AxisY.js +0 -199
- package/build/plugins/d3/renderer/components/Chart.d.ts +0 -10
- package/build/plugins/d3/renderer/components/Chart.js +0 -145
- package/build/plugins/d3/renderer/components/Legend.d.ts +0 -12
- package/build/plugins/d3/renderer/components/Legend.js +0 -278
- package/build/plugins/d3/renderer/components/PlotTitle.d.ts +0 -7
- package/build/plugins/d3/renderer/components/PlotTitle.js +0 -12
- package/build/plugins/d3/renderer/components/Title.d.ts +0 -7
- package/build/plugins/d3/renderer/components/Title.js +0 -8
- package/build/plugins/d3/renderer/components/Tooltip/DefaultContent.d.ts +0 -10
- package/build/plugins/d3/renderer/components/Tooltip/DefaultContent.js +0 -102
- package/build/plugins/d3/renderer/components/Tooltip/index.d.ts +0 -12
- package/build/plugins/d3/renderer/components/Tooltip/index.js +0 -28
- package/build/plugins/d3/renderer/components/index.d.ts +0 -1
- package/build/plugins/d3/renderer/components/index.js +0 -1
- package/build/plugins/d3/renderer/components/styles.css +0 -140
- package/build/plugins/d3/renderer/constants/defaults/axis.d.ts +0 -14
- package/build/plugins/d3/renderer/constants/defaults/axis.js +0 -18
- package/build/plugins/d3/renderer/constants/defaults/index.d.ts +0 -3
- package/build/plugins/d3/renderer/constants/defaults/index.js +0 -3
- package/build/plugins/d3/renderer/constants/defaults/legend.d.ts +0 -12
- package/build/plugins/d3/renderer/constants/defaults/legend.js +0 -12
- package/build/plugins/d3/renderer/constants/defaults/series-options.d.ts +0 -24
- package/build/plugins/d3/renderer/constants/defaults/series-options.js +0 -106
- package/build/plugins/d3/renderer/constants/index.d.ts +0 -3
- package/build/plugins/d3/renderer/constants/index.js +0 -24
- package/build/plugins/d3/renderer/d3-dispatcher.d.ts +0 -1
- package/build/plugins/d3/renderer/d3-dispatcher.js +0 -4
- package/build/plugins/d3/renderer/hooks/index.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/index.js +0 -10
- package/build/plugins/d3/renderer/hooks/useAxisScales/index.d.ts +0 -25
- package/build/plugins/d3/renderer/hooks/useAxisScales/index.js +0 -183
- package/build/plugins/d3/renderer/hooks/useChartDimensions/index.d.ts +0 -16
- package/build/plugins/d3/renderer/hooks/useChartDimensions/index.js +0 -34
- package/build/plugins/d3/renderer/hooks/useChartDimensions/utils.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useChartDimensions/utils.js +0 -32
- package/build/plugins/d3/renderer/hooks/useChartOptions/chart.d.ts +0 -6
- package/build/plugins/d3/renderer/hooks/useChartOptions/chart.js +0 -28
- package/build/plugins/d3/renderer/hooks/useChartOptions/index.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useChartOptions/index.js +0 -21
- package/build/plugins/d3/renderer/hooks/useChartOptions/title.d.ts +0 -5
- package/build/plugins/d3/renderer/hooks/useChartOptions/title.js +0 -18
- package/build/plugins/d3/renderer/hooks/useChartOptions/tooltip.d.ts +0 -5
- package/build/plugins/d3/renderer/hooks/useChartOptions/tooltip.js +0 -5
- package/build/plugins/d3/renderer/hooks/useChartOptions/types.d.ts +0 -47
- package/build/plugins/d3/renderer/hooks/useChartOptions/x-axis.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useChartOptions/x-axis.js +0 -114
- package/build/plugins/d3/renderer/hooks/useChartOptions/y-axis.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useChartOptions/y-axis.js +0 -116
- package/build/plugins/d3/renderer/hooks/useSeries/constants.d.ts +0 -8
- package/build/plugins/d3/renderer/hooks/useSeries/constants.js +0 -19
- package/build/plugins/d3/renderer/hooks/useSeries/index.d.ts +0 -29
- package/build/plugins/d3/renderer/hooks/useSeries/index.js +0 -82
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.d.ts +0 -19
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.js +0 -63
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-x.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-x.js +0 -38
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-y.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-y.js +0 -49
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-legend.d.ts +0 -27
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-legend.js +0 -144
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-line.d.ts +0 -22
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-line.js +0 -82
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-options.d.ts +0 -3
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-options.js +0 -5
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-pie.d.ts +0 -9
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-pie.js +0 -62
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-scatter.d.ts +0 -11
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-scatter.js +0 -47
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-treemap.d.ts +0 -11
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-treemap.js +0 -38
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-waterfall.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-waterfall.js +0 -37
- package/build/plugins/d3/renderer/hooks/useSeries/prepareSeries.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepareSeries.js +0 -65
- package/build/plugins/d3/renderer/hooks/useSeries/types.d.ts +0 -254
- package/build/plugins/d3/renderer/hooks/useSeries/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useSeries/utils.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useSeries/utils.js +0 -33
- package/build/plugins/d3/renderer/hooks/useShapes/HtmlLayer.d.ts +0 -8
- package/build/plugins/d3/renderer/hooks/useShapes/HtmlLayer.js +0 -22
- package/build/plugins/d3/renderer/hooks/useShapes/area/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/area/index.js +0 -144
- package/build/plugins/d3/renderer/hooks/useShapes/area/prepare-data.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/area/prepare-data.js +0 -158
- package/build/plugins/d3/renderer/hooks/useShapes/area/types.d.ts +0 -28
- package/build/plugins/d3/renderer/hooks/useShapes/area/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/index.js +0 -96
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/prepare-data.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/prepare-data.js +0 -160
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/types.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/index.js +0 -84
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/prepare-data.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/prepare-data.js +0 -169
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/types.d.ts +0 -14
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/constants.d.ts +0 -3
- package/build/plugins/d3/renderer/hooks/useShapes/constants.js +0 -3
- package/build/plugins/d3/renderer/hooks/useShapes/index.d.ts +0 -33
- package/build/plugins/d3/renderer/hooks/useShapes/index.js +0 -153
- package/build/plugins/d3/renderer/hooks/useShapes/line/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/line/index.js +0 -131
- package/build/plugins/d3/renderer/hooks/useShapes/line/prepare-data.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/line/prepare-data.js +0 -91
- package/build/plugins/d3/renderer/hooks/useShapes/line/types.d.ts +0 -30
- package/build/plugins/d3/renderer/hooks/useShapes/line/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/marker.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/marker.js +0 -76
- package/build/plugins/d3/renderer/hooks/useShapes/pie/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/pie/index.js +0 -172
- package/build/plugins/d3/renderer/hooks/useShapes/pie/prepare-data.d.ts +0 -9
- package/build/plugins/d3/renderer/hooks/useShapes/pie/prepare-data.js +0 -186
- package/build/plugins/d3/renderer/hooks/useShapes/pie/types.d.ts +0 -42
- package/build/plugins/d3/renderer/hooks/useShapes/pie/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/pie/utils.d.ts +0 -4
- package/build/plugins/d3/renderer/hooks/useShapes/pie/utils.js +0 -15
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/index.js +0 -69
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.d.ts +0 -11
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.js +0 -31
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/types.d.ts +0 -18
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/styles.css +0 -36
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/index.js +0 -99
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/prepare-data.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/prepare-data.js +0 -114
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/types.d.ts +0 -17
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/utils.d.ts +0 -29
- package/build/plugins/d3/renderer/hooks/useShapes/utils.js +0 -53
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/index.js +0 -128
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/prepare-data.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/prepare-data.js +0 -133
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/types.d.ts +0 -15
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useSplit/index.d.ts +0 -14
- package/build/plugins/d3/renderer/hooks/useSplit/index.js +0 -57
- package/build/plugins/d3/renderer/hooks/useSplit/types.d.ts +0 -17
- package/build/plugins/d3/renderer/hooks/useSplit/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useTooltip/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useTooltip/index.js +0 -17
- package/build/plugins/d3/renderer/hooks/useTooltip/types.d.ts +0 -1
- package/build/plugins/d3/renderer/hooks/useTooltip/types.js +0 -1
- package/build/plugins/d3/renderer/types/index.d.ts +0 -24
- package/build/plugins/d3/renderer/types/index.js +0 -1
- package/build/plugins/d3/renderer/utils/axis-generators/bottom.d.ts +0 -24
- package/build/plugins/d3/renderer/utils/axis-generators/bottom.js +0 -126
- package/build/plugins/d3/renderer/utils/axis-generators/index.d.ts +0 -1
- package/build/plugins/d3/renderer/utils/axis-generators/index.js +0 -1
- package/build/plugins/d3/renderer/utils/axis.d.ts +0 -31
- package/build/plugins/d3/renderer/utils/axis.js +0 -71
- package/build/plugins/d3/renderer/utils/color.d.ts +0 -10
- package/build/plugins/d3/renderer/utils/color.js +0 -43
- package/build/plugins/d3/renderer/utils/get-closest-data.d.ts +0 -15
- package/build/plugins/d3/renderer/utils/get-closest-data.js +0 -172
- package/build/plugins/d3/renderer/utils/index.d.ts +0 -78
- package/build/plugins/d3/renderer/utils/index.js +0 -211
- package/build/plugins/d3/renderer/utils/labels.d.ts +0 -6
- package/build/plugins/d3/renderer/utils/labels.js +0 -44
- package/build/plugins/d3/renderer/utils/legend.d.ts +0 -8
- package/build/plugins/d3/renderer/utils/legend.js +0 -23
- package/build/plugins/d3/renderer/utils/math.d.ts +0 -25
- package/build/plugins/d3/renderer/utils/math.js +0 -51
- package/build/plugins/d3/renderer/utils/series/index.d.ts +0 -1
- package/build/plugins/d3/renderer/utils/series/index.js +0 -1
- package/build/plugins/d3/renderer/utils/series/waterfall.d.ts +0 -4
- package/build/plugins/d3/renderer/utils/series/waterfall.js +0 -25
- package/build/plugins/d3/renderer/utils/symbol.d.ts +0 -3
- package/build/plugins/d3/renderer/utils/symbol.js +0 -36
- package/build/plugins/d3/renderer/utils/text.d.ts +0 -29
- package/build/plugins/d3/renderer/utils/text.js +0 -139
- package/build/plugins/d3/renderer/utils/time.d.ts +0 -3
- package/build/plugins/d3/renderer/utils/time.js +0 -34
- package/build/plugins/d3/renderer/validation/__mocks__/index.d.ts +0 -3
- package/build/plugins/d3/renderer/validation/__mocks__/index.js +0 -44
- package/build/plugins/d3/renderer/validation/index.d.ts +0 -2
- package/build/plugins/d3/renderer/validation/index.js +0 -221
- package/build/plugins/d3/utils/index.d.ts +0 -4
- package/build/plugins/d3/utils/index.js +0 -4
- package/build/plugins/d3/utils/pie-center-text.d.ts +0 -7
- package/build/plugins/d3/utils/pie-center-text.js +0 -23
- /package/build/{plugins/d3/renderer/hooks/useChartOptions → components/SplitPane}/types.js +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SplitLayoutType } from './types';
|
|
3
|
+
type Props = {
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
size?: number | string;
|
|
7
|
+
split?: SplitLayoutType;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
eleRef?: (node: HTMLDivElement) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare class Pane extends React.PureComponent<Props> {
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright 2015 tomkp
|
|
2
|
+
// Copyright 2022 YANDEX LLC
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export class Pane extends React.PureComponent {
|
|
5
|
+
render() {
|
|
6
|
+
const { children, className, split, style: styleProps, size, eleRef } = this.props;
|
|
7
|
+
const classes = ['Pane', split, className];
|
|
8
|
+
let style = {
|
|
9
|
+
flex: 1,
|
|
10
|
+
position: 'relative',
|
|
11
|
+
outline: 'none',
|
|
12
|
+
};
|
|
13
|
+
if (size !== undefined) {
|
|
14
|
+
if (split === 'vertical') {
|
|
15
|
+
style.width = size;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
style.height = size;
|
|
19
|
+
style.display = 'flex';
|
|
20
|
+
}
|
|
21
|
+
style.flex = 'none';
|
|
22
|
+
}
|
|
23
|
+
style = Object.assign({}, style, styleProps || {});
|
|
24
|
+
return (React.createElement("div", { ref: eleRef, className: classes.join(' '), style: style }, children));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SplitLayoutType } from './types';
|
|
3
|
+
export declare const RESIZER_DEFAULT_CLASSNAME = "Resizer";
|
|
4
|
+
type Props = {
|
|
5
|
+
onMouseDown: React.MouseEventHandler;
|
|
6
|
+
onTouchStart: React.TouchEventHandler;
|
|
7
|
+
onTouchEnd: React.TouchEventHandler;
|
|
8
|
+
className?: string;
|
|
9
|
+
split?: SplitLayoutType;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
resizerClassName?: string;
|
|
12
|
+
onClick?: React.MouseEventHandler;
|
|
13
|
+
onDoubleClick?: React.MouseEventHandler;
|
|
14
|
+
};
|
|
15
|
+
export declare class Resizer extends React.Component<Props> {
|
|
16
|
+
render(): React.JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright 2015 tomkp
|
|
2
|
+
// Copyright 2022 YANDEX LLC
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export const RESIZER_DEFAULT_CLASSNAME = 'Resizer';
|
|
5
|
+
export class Resizer extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
const { className, onClick, onDoubleClick, onMouseDown, onTouchEnd, onTouchStart, resizerClassName = RESIZER_DEFAULT_CLASSNAME, split, style, } = this.props;
|
|
8
|
+
const classes = [resizerClassName, split, className];
|
|
9
|
+
return (React.createElement("span", { role: "presentation", className: classes.join(' '), style: style, onMouseDown: (event) => onMouseDown(event), onTouchStart: (event) => {
|
|
10
|
+
onTouchStart(event);
|
|
11
|
+
}, onTouchEnd: (event) => {
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
onTouchEnd(event);
|
|
14
|
+
}, onClick: (event) => {
|
|
15
|
+
if (onClick) {
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
onClick(event);
|
|
18
|
+
}
|
|
19
|
+
}, onDoubleClick: (event) => {
|
|
20
|
+
if (onDoubleClick) {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
onDoubleClick(event);
|
|
23
|
+
}
|
|
24
|
+
} }));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SplitLayoutType } from './types';
|
|
3
|
+
export type SplitPaneProps = {
|
|
4
|
+
allowResize?: boolean;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
primary?: 'first' | 'second';
|
|
8
|
+
minSize?: number;
|
|
9
|
+
maxSize?: number;
|
|
10
|
+
defaultSize?: number;
|
|
11
|
+
size?: number | string;
|
|
12
|
+
split?: SplitLayoutType;
|
|
13
|
+
onDragStarted?: () => void;
|
|
14
|
+
onDragFinished?: (size?: number | string) => void;
|
|
15
|
+
onChange?: (size: number) => void;
|
|
16
|
+
onResizerClick?: React.MouseEventHandler;
|
|
17
|
+
onResizerDoubleClick?: React.MouseEventHandler;
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
resizerStyle?: React.CSSProperties;
|
|
20
|
+
paneClassName?: string;
|
|
21
|
+
pane1ClassName?: string;
|
|
22
|
+
pane2ClassName?: string;
|
|
23
|
+
paneStyle?: React.CSSProperties;
|
|
24
|
+
pane1Style?: React.CSSProperties;
|
|
25
|
+
pane2Style?: React.CSSProperties;
|
|
26
|
+
resizerClassName?: string;
|
|
27
|
+
step?: number;
|
|
28
|
+
};
|
|
29
|
+
type DefaultProps = Required<Pick<SplitPaneProps, 'allowResize' | 'minSize' | 'primary' | 'split' | 'paneClassName' | 'pane1ClassName' | 'pane2ClassName'>>;
|
|
30
|
+
type Props = Omit<SplitPaneProps, 'allowResize' | 'minSize' | 'primary' | 'split' | 'paneClassName' | 'pane1ClassName' | 'pane2ClassName'> & DefaultProps;
|
|
31
|
+
type State = {
|
|
32
|
+
active: boolean;
|
|
33
|
+
position: number;
|
|
34
|
+
resized: boolean;
|
|
35
|
+
draggedSize?: number | string;
|
|
36
|
+
pane1Size?: number | string;
|
|
37
|
+
pane2Size?: number | string;
|
|
38
|
+
instanceProps: {
|
|
39
|
+
size?: number | string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare class SplitPane extends React.Component<Props, State> {
|
|
43
|
+
static defaultProps: DefaultProps;
|
|
44
|
+
static getDerivedStateFromProps(nextProps: Props, prevState: State): {};
|
|
45
|
+
static getSizeUpdate(props: Props, state: State): {};
|
|
46
|
+
splitPane: HTMLDivElement | null;
|
|
47
|
+
private pane1;
|
|
48
|
+
private pane2;
|
|
49
|
+
constructor(props: Props);
|
|
50
|
+
componentDidMount(): void;
|
|
51
|
+
componentWillUnmount(): void;
|
|
52
|
+
render(): React.JSX.Element;
|
|
53
|
+
private onMouseDown;
|
|
54
|
+
private onTouchStart;
|
|
55
|
+
private onMouseMove;
|
|
56
|
+
private onTouchMove;
|
|
57
|
+
private onMouseUp;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// Copyright 2015 tomkp
|
|
2
|
+
// Copyright 2022 YANDEX LLC
|
|
3
|
+
/* eslint-disable radix */
|
|
4
|
+
/* eslint-disable complexity */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Pane } from './Pane';
|
|
7
|
+
import { RESIZER_DEFAULT_CLASSNAME, Resizer } from './Resizer';
|
|
8
|
+
function unFocus() {
|
|
9
|
+
var _a;
|
|
10
|
+
(_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
11
|
+
}
|
|
12
|
+
function getDefaultSize(defaultSize, minSize, maxSize, draggedSize) {
|
|
13
|
+
if (typeof draggedSize === 'number') {
|
|
14
|
+
const min = typeof minSize === 'number' ? minSize : 0;
|
|
15
|
+
const max = typeof maxSize === 'number' && maxSize >= 0 ? maxSize : Infinity;
|
|
16
|
+
return Math.max(min, Math.min(max, draggedSize));
|
|
17
|
+
}
|
|
18
|
+
if (defaultSize !== undefined) {
|
|
19
|
+
return defaultSize;
|
|
20
|
+
}
|
|
21
|
+
return minSize;
|
|
22
|
+
}
|
|
23
|
+
function removeNullChildren(children) {
|
|
24
|
+
return React.Children.toArray(children).filter((c) => c);
|
|
25
|
+
}
|
|
26
|
+
// TODO: https://github.com/gravity-ui/charts/issues/14
|
|
27
|
+
export class SplitPane extends React.Component {
|
|
28
|
+
static getDerivedStateFromProps(nextProps, prevState) {
|
|
29
|
+
return SplitPane.getSizeUpdate(nextProps, prevState);
|
|
30
|
+
}
|
|
31
|
+
// we have to check values since gDSFP is called on every render and more in StrictMode
|
|
32
|
+
static getSizeUpdate(props, state) {
|
|
33
|
+
const newState = {};
|
|
34
|
+
const { instanceProps } = state;
|
|
35
|
+
if (instanceProps.size === props.size && props.size !== undefined) {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
const newSize = props.size === undefined
|
|
39
|
+
? getDefaultSize(props.defaultSize, props.minSize, props.maxSize, state.draggedSize)
|
|
40
|
+
: props.size;
|
|
41
|
+
if (props.size !== undefined) {
|
|
42
|
+
newState.draggedSize = newSize;
|
|
43
|
+
}
|
|
44
|
+
const isPanel1Primary = props.primary === 'first';
|
|
45
|
+
newState[isPanel1Primary ? 'pane1Size' : 'pane2Size'] = newSize;
|
|
46
|
+
newState[isPanel1Primary ? 'pane2Size' : 'pane1Size'] = undefined;
|
|
47
|
+
newState.instanceProps = { size: props.size };
|
|
48
|
+
return newState;
|
|
49
|
+
}
|
|
50
|
+
constructor(props) {
|
|
51
|
+
super(props);
|
|
52
|
+
this.splitPane = null;
|
|
53
|
+
this.pane1 = null;
|
|
54
|
+
this.pane2 = null;
|
|
55
|
+
this.onMouseDown = (event) => {
|
|
56
|
+
const eventWithTouches = Object.assign({}, event, {
|
|
57
|
+
touches: [{ clientX: event.clientX, clientY: event.clientY }],
|
|
58
|
+
});
|
|
59
|
+
this.onTouchStart(eventWithTouches);
|
|
60
|
+
};
|
|
61
|
+
this.onTouchStart = (event) => {
|
|
62
|
+
const { allowResize, onDragStarted, split } = this.props;
|
|
63
|
+
if (allowResize) {
|
|
64
|
+
unFocus();
|
|
65
|
+
const position = split === 'vertical' ? event.touches[0].clientX : event.touches[0].clientY;
|
|
66
|
+
if (typeof onDragStarted === 'function') {
|
|
67
|
+
onDragStarted();
|
|
68
|
+
}
|
|
69
|
+
this.setState({
|
|
70
|
+
active: true,
|
|
71
|
+
position,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
this.onMouseMove = (event) => {
|
|
76
|
+
const eventWithTouches = Object.assign({}, event, {
|
|
77
|
+
touches: [{ clientX: event.clientX, clientY: event.clientY }],
|
|
78
|
+
});
|
|
79
|
+
this.onTouchMove(eventWithTouches);
|
|
80
|
+
};
|
|
81
|
+
this.onTouchMove = (event) => {
|
|
82
|
+
const { allowResize, maxSize, minSize, onChange, split, step } = this.props;
|
|
83
|
+
const { active, position } = this.state;
|
|
84
|
+
if (allowResize && active) {
|
|
85
|
+
unFocus();
|
|
86
|
+
const isPrimaryFirst = this.props.primary === 'first';
|
|
87
|
+
const ref = isPrimaryFirst ? this.pane1 : this.pane2;
|
|
88
|
+
const ref2 = isPrimaryFirst ? this.pane2 : this.pane1;
|
|
89
|
+
if (ref) {
|
|
90
|
+
const node = ref;
|
|
91
|
+
const node2 = ref2;
|
|
92
|
+
if (node.getBoundingClientRect) {
|
|
93
|
+
const width = node.getBoundingClientRect().width;
|
|
94
|
+
const height = node.getBoundingClientRect().height;
|
|
95
|
+
const current = split === 'vertical' ? event.touches[0].clientX : event.touches[0].clientY;
|
|
96
|
+
const size = split === 'vertical' ? width : height;
|
|
97
|
+
let positionDelta = position - current;
|
|
98
|
+
if (step) {
|
|
99
|
+
if (Math.abs(positionDelta) < step) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Integer division
|
|
103
|
+
// eslint-disable-next-line no-bitwise
|
|
104
|
+
positionDelta = ~~(positionDelta / step) * step;
|
|
105
|
+
}
|
|
106
|
+
let sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;
|
|
107
|
+
const pane1Order = parseInt(window.getComputedStyle(node).order);
|
|
108
|
+
const pane2Order = parseInt(window.getComputedStyle(node2).order);
|
|
109
|
+
if (pane1Order > pane2Order) {
|
|
110
|
+
sizeDelta = -sizeDelta;
|
|
111
|
+
}
|
|
112
|
+
let newMaxSize = maxSize;
|
|
113
|
+
if (maxSize !== undefined && maxSize <= 0) {
|
|
114
|
+
const splitPane = this.splitPane;
|
|
115
|
+
if (split === 'vertical') {
|
|
116
|
+
newMaxSize = splitPane.getBoundingClientRect().width + maxSize;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
newMaxSize = splitPane.getBoundingClientRect().height + maxSize;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
let newSize = size - sizeDelta;
|
|
123
|
+
const newPosition = position - positionDelta;
|
|
124
|
+
if (newSize < minSize) {
|
|
125
|
+
newSize = minSize;
|
|
126
|
+
}
|
|
127
|
+
else if (maxSize !== undefined && newSize > newMaxSize) {
|
|
128
|
+
newSize = newMaxSize;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
this.setState({
|
|
132
|
+
position: newPosition,
|
|
133
|
+
resized: true,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (onChange)
|
|
137
|
+
onChange(newSize);
|
|
138
|
+
this.setState({
|
|
139
|
+
draggedSize: newSize,
|
|
140
|
+
[isPrimaryFirst ? 'pane1Size' : 'pane2Size']: newSize,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
this.onMouseUp = () => {
|
|
147
|
+
const { allowResize, onDragFinished } = this.props;
|
|
148
|
+
const { active, draggedSize } = this.state;
|
|
149
|
+
if (allowResize && active) {
|
|
150
|
+
if (typeof onDragFinished === 'function') {
|
|
151
|
+
onDragFinished(draggedSize);
|
|
152
|
+
}
|
|
153
|
+
this.setState({ active: false });
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
// order of setting panel sizes.
|
|
157
|
+
// 1. size
|
|
158
|
+
// 2. getDefaultSize(defaultSize, minsize, maxSize)
|
|
159
|
+
const { size, defaultSize, minSize, maxSize, primary } = props;
|
|
160
|
+
const initialSize = size === undefined ? getDefaultSize(defaultSize, minSize, maxSize) : size;
|
|
161
|
+
this.state = {
|
|
162
|
+
active: false,
|
|
163
|
+
resized: false,
|
|
164
|
+
position: 0,
|
|
165
|
+
draggedSize: 0,
|
|
166
|
+
pane1Size: primary === 'first' ? initialSize : undefined,
|
|
167
|
+
pane2Size: primary === 'second' ? initialSize : undefined,
|
|
168
|
+
// these are props that are needed in static functions. ie: gDSFP
|
|
169
|
+
instanceProps: {
|
|
170
|
+
size,
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
componentDidMount() {
|
|
175
|
+
document.addEventListener('mouseup', this.onMouseUp);
|
|
176
|
+
document.addEventListener('mousemove', this.onMouseMove);
|
|
177
|
+
document.addEventListener('touchmove', this.onTouchMove);
|
|
178
|
+
this.setState(SplitPane.getSizeUpdate(this.props, this.state));
|
|
179
|
+
}
|
|
180
|
+
componentWillUnmount() {
|
|
181
|
+
document.removeEventListener('mouseup', this.onMouseUp);
|
|
182
|
+
document.removeEventListener('mousemove', this.onMouseMove);
|
|
183
|
+
document.removeEventListener('touchmove', this.onTouchMove);
|
|
184
|
+
}
|
|
185
|
+
render() {
|
|
186
|
+
const { allowResize, children, className, onResizerClick, onResizerDoubleClick, paneClassName, pane1ClassName, pane2ClassName, paneStyle, pane1Style: pane1StyleProps, pane2Style: pane2StyleProps, resizerClassName, resizerStyle, split, style: styleProps, } = this.props;
|
|
187
|
+
const { pane1Size, pane2Size } = this.state;
|
|
188
|
+
const disabledClass = allowResize ? '' : 'disabled';
|
|
189
|
+
const resizerClassNamesIncludingDefault = resizerClassName
|
|
190
|
+
? `${resizerClassName} ${RESIZER_DEFAULT_CLASSNAME}`
|
|
191
|
+
: resizerClassName;
|
|
192
|
+
const notNullChildren = removeNullChildren(children);
|
|
193
|
+
const style = Object.assign({ display: 'flex', flex: 1, height: '100%', position: 'absolute', outline: 'none', overflow: 'hidden', MozUserSelect: 'text', WebkitUserSelect: 'text', msUserSelect: 'text', userSelect: 'text' }, styleProps);
|
|
194
|
+
if (split === 'vertical') {
|
|
195
|
+
Object.assign(style, {
|
|
196
|
+
flexDirection: 'row',
|
|
197
|
+
left: 0,
|
|
198
|
+
right: 0,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
Object.assign(style, {
|
|
203
|
+
bottom: 0,
|
|
204
|
+
flexDirection: 'column',
|
|
205
|
+
minHeight: '100%',
|
|
206
|
+
top: 0,
|
|
207
|
+
width: '100%',
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const classes = ['SplitPane', className, split, disabledClass];
|
|
211
|
+
const pane1Style = Object.assign(Object.assign({}, paneStyle), pane1StyleProps);
|
|
212
|
+
const pane2Style = Object.assign(Object.assign({}, paneStyle), pane2StyleProps);
|
|
213
|
+
const pane1Classes = ['Pane1', paneClassName, pane1ClassName].join(' ');
|
|
214
|
+
const pane2Classes = ['Pane2', paneClassName, pane2ClassName].join(' ');
|
|
215
|
+
return (React.createElement("div", { className: classes.join(' '), ref: (node) => {
|
|
216
|
+
this.splitPane = node;
|
|
217
|
+
}, style: style },
|
|
218
|
+
React.createElement(Pane, { className: pane1Classes, key: "pane1", eleRef: (node) => {
|
|
219
|
+
this.pane1 = node;
|
|
220
|
+
}, size: pane1Size, split: split, style: pane1Style }, notNullChildren[0]),
|
|
221
|
+
React.createElement(Resizer, { className: disabledClass, onClick: onResizerClick, onDoubleClick: onResizerDoubleClick, onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart, onTouchEnd: this.onMouseUp, key: "resizer", resizerClassName: resizerClassNamesIncludingDefault, split: split, style: resizerStyle || {} }),
|
|
222
|
+
React.createElement(Pane, { className: pane2Classes, key: "pane2", eleRef: (node) => {
|
|
223
|
+
this.pane2 = node;
|
|
224
|
+
}, size: pane2Size, split: split, style: pane2Style }, notNullChildren[1])));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
SplitPane.defaultProps = {
|
|
228
|
+
allowResize: true,
|
|
229
|
+
minSize: 50,
|
|
230
|
+
primary: 'first',
|
|
231
|
+
split: 'vertical',
|
|
232
|
+
paneClassName: '',
|
|
233
|
+
pane1ClassName: '',
|
|
234
|
+
pane2ClassName: '',
|
|
235
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { cn } from '../../utils/cn';
|
|
4
|
+
import { Pane } from './Pane';
|
|
5
|
+
import { SplitPane } from './SplitPane';
|
|
5
6
|
import './StyledSplitPane.css';
|
|
6
7
|
const b = cn('styled-split-pane');
|
|
7
8
|
const resizerClassName = b('pane-resizer');
|
|
8
9
|
export const StyledSplitPane = (_a) => {
|
|
9
10
|
var { paneOneRender, paneTwoRender } = _a, splitPaneProps = __rest(_a, ["paneOneRender", "paneTwoRender"]);
|
|
10
|
-
// https://github.com/tomkp/react-split-pane/blob/master/src/SplitPane.js#L307
|
|
11
11
|
const splitPaneRef = React.useRef(null);
|
|
12
12
|
React.useEffect(() => {
|
|
13
13
|
var _a, _b;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScreenOrientationType } from '../../constants';
|
|
2
|
+
import { SplitLayoutType } from './types';
|
|
3
|
+
export { SplitLayout } from './constants';
|
|
4
|
+
export * from './Pane';
|
|
5
|
+
export * from './SplitPane';
|
|
6
|
+
export * from './StyledSplitPane';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export declare function mapScreenOrientationTypeToSplitLayout(type: ScreenOrientationType): SplitLayoutType;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { SplitLayout } from './constants';
|
|
2
|
+
export * from './Pane';
|
|
3
|
+
export * from './SplitPane';
|
|
4
|
+
export * from './StyledSplitPane';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export function mapScreenOrientationTypeToSplitLayout(type) {
|
|
7
|
+
switch (type) {
|
|
8
|
+
case 'landscape-primary':
|
|
9
|
+
case 'landscape-secondary': {
|
|
10
|
+
return 'vertical';
|
|
11
|
+
}
|
|
12
|
+
case 'portrait-primary':
|
|
13
|
+
case 'portrait-secondary':
|
|
14
|
+
default: {
|
|
15
|
+
return 'horizontal';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/build/constants/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const IS_WINDOW_AVAILABLE: boolean;
|
|
2
|
+
export declare const IS_SCREEN_ORIENTATION_AVAILABLE: boolean;
|
|
3
|
+
export declare const ScreenOrientation: {
|
|
4
|
+
readonly PORTRAIT_PRIMARY: "portrait-primary";
|
|
5
|
+
readonly PORTRAIT_SECONDARY: "portrait-secondary";
|
|
6
|
+
readonly LANDSCAPE_PRIMARY: "landscape-primary";
|
|
7
|
+
readonly LANDSCAPE_SECONDARY: "landscape-secondary";
|
|
8
|
+
};
|
|
9
|
+
export type ScreenOrientationType = (typeof ScreenOrientation)[keyof typeof ScreenOrientation];
|
|
10
|
+
export declare const AVAILABLE_SCREEN_ORIENTATIONS: ("landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary")[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function checkWindowAvailability() {
|
|
2
|
+
return typeof window === 'object';
|
|
3
|
+
}
|
|
4
|
+
export const IS_WINDOW_AVAILABLE = checkWindowAvailability();
|
|
5
|
+
function checkScreenOrientationAvailability() {
|
|
6
|
+
// W3C spec implementation
|
|
7
|
+
return (IS_WINDOW_AVAILABLE &&
|
|
8
|
+
typeof window.ScreenOrientation === 'function' &&
|
|
9
|
+
typeof screen.orientation.addEventListener === 'function' &&
|
|
10
|
+
typeof screen.orientation.type === 'string');
|
|
11
|
+
}
|
|
12
|
+
export const IS_SCREEN_ORIENTATION_AVAILABLE = checkScreenOrientationAvailability();
|
|
13
|
+
export const ScreenOrientation = {
|
|
14
|
+
PORTRAIT_PRIMARY: 'portrait-primary',
|
|
15
|
+
PORTRAIT_SECONDARY: 'portrait-secondary',
|
|
16
|
+
LANDSCAPE_PRIMARY: 'landscape-primary',
|
|
17
|
+
LANDSCAPE_SECONDARY: 'landscape-secondary',
|
|
18
|
+
};
|
|
19
|
+
export const AVAILABLE_SCREEN_ORIENTATIONS = Object.values(ScreenOrientation);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './misc';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './misc';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export { CustomShapeRenderer } from '@gravity-ui/charts';
|
|
2
3
|
export * from './types';
|
|
3
|
-
export * from './utils';
|
|
4
4
|
/**
|
|
5
5
|
* It is an experemental plugin
|
|
6
6
|
*
|
|
7
7
|
* DO NOT USE IT IN YOUR PRODUCTION
|
|
8
8
|
* */
|
|
9
9
|
export const D3Plugin = {
|
|
10
|
+
// TODO: rename to 'gravity-chart' in the next major
|
|
10
11
|
type: 'd3',
|
|
11
12
|
renderer: React.lazy(() => import('./renderer/D3Widget')),
|
|
12
13
|
};
|
|
@@ -11,5 +11,9 @@ declare const D3Widget: React.ForwardRefExoticComponent<{
|
|
|
11
11
|
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
12
12
|
renderError?: import("../../../types").RenderError | undefined;
|
|
13
13
|
renderPluginLoader?: import("../../../types").ChartKitRenderPluginLoader | undefined;
|
|
14
|
-
} & {
|
|
14
|
+
} & {
|
|
15
|
+
tooltip?: {
|
|
16
|
+
splitted?: boolean | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
} & React.RefAttributes<ChartKitWidgetRef | undefined>>;
|
|
15
19
|
export default D3Widget;
|