@mui/x-data-grid-premium 8.11.3 → 8.12.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/CHANGELOG.md +151 -6
- package/DataGridPremium/DataGridPremium.js +29 -1
- package/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
- package/DataGridPremium/useDataGridPremiumComponent.js +5 -2
- package/DataGridPremium/useDataGridPremiumProps.js +2 -1
- package/components/GridPremiumColumnMenu.d.ts +4 -4
- package/components/GridPremiumColumnMenu.js +6 -6
- package/components/GridPremiumToolbar.js +11 -0
- package/components/chartsIntegration/GridChartsIntegrationContext.d.ts +2 -0
- package/components/chartsIntegration/GridChartsIntegrationContext.js +11 -0
- package/components/chartsPanel/ChartsPanelTrigger.d.ts +33 -0
- package/components/chartsPanel/ChartsPanelTrigger.js +92 -0
- package/components/chartsPanel/GridChartsPanel.d.ts +21 -0
- package/components/chartsPanel/GridChartsPanel.js +243 -0
- package/components/chartsPanel/chart/GridChartsPanelChart.d.ts +12 -0
- package/components/chartsPanel/chart/GridChartsPanelChart.js +111 -0
- package/components/chartsPanel/customize/GridChartsPanelCustomize.d.ts +8 -0
- package/components/chartsPanel/customize/GridChartsPanelCustomize.js +147 -0
- package/components/chartsPanel/data/GridChartsPanelData.d.ts +4 -0
- package/components/chartsPanel/data/GridChartsPanelData.js +23 -0
- package/components/chartsPanel/data/GridChartsPanelDataBody.d.ts +12 -0
- package/components/chartsPanel/data/GridChartsPanelDataBody.js +380 -0
- package/components/chartsPanel/data/GridChartsPanelDataField.d.ts +25 -0
- package/components/chartsPanel/data/GridChartsPanelDataField.js +334 -0
- package/components/chartsPanel/data/GridChartsPanelDataFieldMenu.d.ts +11 -0
- package/components/chartsPanel/data/GridChartsPanelDataFieldMenu.js +179 -0
- package/components/chartsPanel/data/GridChartsPanelDataHeader.d.ts +7 -0
- package/components/chartsPanel/data/GridChartsPanelDataHeader.js +24 -0
- package/components/chartsPanel/data/GridChartsPanelDataSearch.d.ts +7 -0
- package/components/chartsPanel/data/GridChartsPanelDataSearch.js +80 -0
- package/components/chartsPanel/index.d.ts +2 -0
- package/components/chartsPanel/index.js +27 -0
- package/components/collapsible/Collapsible.d.ts +3 -1
- package/components/collapsible/Collapsible.js +4 -3
- package/components/{GridColumnMenuAggregationItem.js → columnMenu/menuItems/GridColumnMenuAggregationItem.js} +4 -4
- package/components/columnMenu/menuItems/GridColumnMenuChartsItem.d.ts +3 -0
- package/components/columnMenu/menuItems/GridColumnMenuChartsItem.js +36 -0
- package/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.d.ts +4 -0
- package/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.js +18 -0
- package/{esm/components → components/columnMenu/menuItems}/GridColumnMenuPivotItem.d.ts +1 -1
- package/components/{GridColumnMenuPivotItem.js → columnMenu/menuItems/GridColumnMenuPivotItem.js} +7 -4
- package/components/{GridColumnMenuRowGroupItem.js → columnMenu/menuItems/GridColumnMenuRowGroupItem.js} +4 -4
- package/components/{GridColumnMenuRowUngroupItem.js → columnMenu/menuItems/GridColumnMenuRowUngroupItem.js} +3 -3
- package/components/index.d.ts +3 -2
- package/components/index.js +13 -1
- package/components/pivotPanel/GridPivotPanelField.js +14 -2
- package/components/pivotPanel/GridPivotPanelHeader.js +1 -0
- package/components/pivotPanel/GridPivotPanelSearch.js +3 -0
- package/constants/columnGroups.d.ts +1 -0
- package/constants/columnGroups.js +7 -0
- package/constants/dataGridPremiumDefaultSlotsComponents.js +1 -0
- package/context/GridChartsIntegrationContextProvider.d.ts +7 -0
- package/context/GridChartsIntegrationContextProvider.js +35 -0
- package/context/GridChartsRendererProxy.d.ts +34 -0
- package/context/GridChartsRendererProxy.js +77 -0
- package/context/index.d.ts +2 -0
- package/context/index.js +27 -0
- package/esm/DataGridPremium/DataGridPremium.js +30 -2
- package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +1 -1
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +5 -2
- package/esm/DataGridPremium/useDataGridPremiumProps.js +2 -1
- package/esm/components/GridPremiumColumnMenu.d.ts +4 -4
- package/esm/components/GridPremiumColumnMenu.js +6 -6
- package/esm/components/GridPremiumToolbar.js +11 -0
- package/esm/components/chartsIntegration/GridChartsIntegrationContext.d.ts +2 -0
- package/esm/components/chartsIntegration/GridChartsIntegrationContext.js +5 -0
- package/esm/components/chartsPanel/ChartsPanelTrigger.d.ts +33 -0
- package/esm/components/chartsPanel/ChartsPanelTrigger.js +85 -0
- package/esm/components/chartsPanel/GridChartsPanel.d.ts +21 -0
- package/esm/components/chartsPanel/GridChartsPanel.js +237 -0
- package/esm/components/chartsPanel/chart/GridChartsPanelChart.d.ts +12 -0
- package/esm/components/chartsPanel/chart/GridChartsPanelChart.js +104 -0
- package/esm/components/chartsPanel/customize/GridChartsPanelCustomize.d.ts +8 -0
- package/esm/components/chartsPanel/customize/GridChartsPanelCustomize.js +139 -0
- package/esm/components/chartsPanel/data/GridChartsPanelData.d.ts +4 -0
- package/esm/components/chartsPanel/data/GridChartsPanelData.js +18 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataBody.d.ts +12 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataBody.js +374 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataField.d.ts +25 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataField.js +327 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataFieldMenu.d.ts +11 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataFieldMenu.js +173 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataHeader.d.ts +7 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataHeader.js +18 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataSearch.d.ts +7 -0
- package/esm/components/chartsPanel/data/GridChartsPanelDataSearch.js +73 -0
- package/esm/components/chartsPanel/index.d.ts +2 -0
- package/esm/components/chartsPanel/index.js +2 -0
- package/esm/components/collapsible/Collapsible.d.ts +3 -1
- package/esm/components/collapsible/Collapsible.js +4 -3
- package/esm/components/{GridColumnMenuAggregationItem.js → columnMenu/menuItems/GridColumnMenuAggregationItem.js} +4 -4
- package/esm/components/columnMenu/menuItems/GridColumnMenuChartsItem.d.ts +3 -0
- package/esm/components/columnMenu/menuItems/GridColumnMenuChartsItem.js +29 -0
- package/esm/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.d.ts +4 -0
- package/esm/components/columnMenu/menuItems/GridColumnMenuManagePanelItem.js +11 -0
- package/{components → esm/components/columnMenu/menuItems}/GridColumnMenuPivotItem.d.ts +1 -1
- package/esm/components/{GridColumnMenuPivotItem.js → columnMenu/menuItems/GridColumnMenuPivotItem.js} +7 -4
- package/esm/components/{GridColumnMenuRowGroupItem.js → columnMenu/menuItems/GridColumnMenuRowGroupItem.js} +4 -4
- package/esm/components/{GridColumnMenuRowUngroupItem.js → columnMenu/menuItems/GridColumnMenuRowUngroupItem.js} +3 -3
- package/esm/components/index.d.ts +3 -2
- package/esm/components/index.js +3 -2
- package/esm/components/pivotPanel/GridPivotPanelField.js +15 -3
- package/esm/components/pivotPanel/GridPivotPanelHeader.js +1 -0
- package/esm/components/pivotPanel/GridPivotPanelSearch.js +3 -0
- package/esm/constants/columnGroups.d.ts +1 -0
- package/esm/constants/columnGroups.js +1 -0
- package/esm/constants/dataGridPremiumDefaultSlotsComponents.js +1 -0
- package/esm/context/GridChartsIntegrationContextProvider.d.ts +7 -0
- package/esm/context/GridChartsIntegrationContextProvider.js +28 -0
- package/esm/context/GridChartsRendererProxy.d.ts +34 -0
- package/esm/context/GridChartsRendererProxy.js +71 -0
- package/esm/context/index.d.ts +2 -0
- package/esm/context/index.js +2 -0
- package/esm/hooks/features/aggregation/createAggregationLookup.js +5 -3
- package/esm/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -0
- package/esm/hooks/features/aggregation/gridAggregationSelectors.d.ts +1 -0
- package/esm/hooks/features/aggregation/gridAggregationSelectors.js +3 -0
- package/esm/hooks/features/aggregation/useGridAggregation.js +13 -1
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +2 -1
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +1 -45
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.d.ts +65 -0
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.js +1 -0
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.d.ts +17 -0
- package/esm/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.js +24 -0
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +8 -0
- package/esm/hooks/features/chartsIntegration/useGridChartsIntegration.js +525 -0
- package/esm/hooks/features/chartsIntegration/utils.d.ts +5 -0
- package/esm/hooks/features/chartsIntegration/utils.js +32 -0
- package/esm/hooks/features/pivoting/useGridPivoting.js +1 -1
- package/esm/hooks/features/pivoting/utils.js +9 -7
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +3 -1
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -0
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -2
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -0
- package/esm/hooks/features/sidebar/gridSidebarInterfaces.d.ts +1 -0
- package/esm/hooks/features/sidebar/gridSidebarInterfaces.js +1 -0
- package/esm/hooks/utils/index.d.ts +2 -1
- package/esm/hooks/utils/index.js +2 -1
- package/esm/hooks/utils/useGridChartIntegration.d.ts +2 -0
- package/esm/hooks/utils/useGridChartIntegration.js +9 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/material/icons.d.ts +4 -1
- package/esm/material/icons.js +16 -2
- package/esm/material/index.d.ts +11 -0
- package/esm/material/index.js +13 -2
- package/esm/models/dataGridPremiumProps.d.ts +22 -1
- package/esm/models/gridApiPremium.d.ts +3 -2
- package/esm/models/gridChartsIntegration.d.ts +17 -0
- package/esm/models/gridChartsIntegration.js +1 -0
- package/esm/models/gridPremiumIconSlotsComponent.d.ts +55 -0
- package/esm/models/gridPremiumSlotProps.d.ts +8 -0
- package/esm/models/gridPremiumSlotProps.js +1 -0
- package/esm/models/gridPremiumSlotsComponent.d.ts +6 -0
- package/esm/models/gridStatePremium.d.ts +5 -2
- package/esm/typeOverloads/modules.d.ts +20 -0
- package/hooks/features/aggregation/createAggregationLookup.js +5 -3
- package/hooks/features/aggregation/gridAggregationInterfaces.d.ts +1 -0
- package/hooks/features/aggregation/gridAggregationSelectors.d.ts +1 -0
- package/hooks/features/aggregation/gridAggregationSelectors.js +3 -0
- package/hooks/features/aggregation/useGridAggregation.js +12 -0
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +2 -1
- package/hooks/features/aggregation/wrapColumnWithAggregation.js +0 -44
- package/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.d.ts +65 -0
- package/hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.js +5 -0
- package/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.d.ts +17 -0
- package/hooks/features/chartsIntegration/gridChartsIntegrationSelectors.js +30 -0
- package/hooks/features/chartsIntegration/useGridChartsIntegration.d.ts +8 -0
- package/hooks/features/chartsIntegration/useGridChartsIntegration.js +534 -0
- package/hooks/features/chartsIntegration/utils.d.ts +5 -0
- package/hooks/features/chartsIntegration/utils.js +40 -0
- package/hooks/features/pivoting/useGridPivoting.js +1 -1
- package/hooks/features/pivoting/utils.js +9 -7
- package/hooks/features/rowGrouping/createGroupingColDef.js +3 -1
- package/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +1 -0
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +3 -2
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +1 -0
- package/hooks/features/sidebar/gridSidebarInterfaces.d.ts +1 -0
- package/hooks/features/sidebar/gridSidebarInterfaces.js +1 -0
- package/hooks/utils/index.d.ts +2 -1
- package/hooks/utils/index.js +11 -0
- package/hooks/utils/useGridChartIntegration.d.ts +2 -0
- package/hooks/utils/useGridChartIntegration.js +17 -0
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/material/icons.d.ts +4 -1
- package/material/icons.js +16 -2
- package/material/index.d.ts +11 -0
- package/material/index.js +12 -1
- package/models/dataGridPremiumProps.d.ts +22 -1
- package/models/gridApiPremium.d.ts +3 -2
- package/models/gridChartsIntegration.d.ts +17 -0
- package/models/gridChartsIntegration.js +5 -0
- package/models/gridPremiumIconSlotsComponent.d.ts +55 -0
- package/models/gridPremiumSlotProps.d.ts +8 -0
- package/models/gridPremiumSlotProps.js +5 -0
- package/models/gridPremiumSlotsComponent.d.ts +6 -0
- package/models/gridStatePremium.d.ts +5 -2
- package/package.json +5 -5
- package/typeOverloads/modules.d.ts +20 -0
- /package/components/{GridColumnMenuAggregationItem.d.ts → columnMenu/menuItems/GridColumnMenuAggregationItem.d.ts} +0 -0
- /package/components/{GridColumnMenuRowGroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowGroupItem.d.ts} +0 -0
- /package/components/{GridColumnMenuRowUngroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowUngroupItem.d.ts} +0 -0
- /package/esm/components/{GridColumnMenuAggregationItem.d.ts → columnMenu/menuItems/GridColumnMenuAggregationItem.d.ts} +0 -0
- /package/esm/components/{GridColumnMenuRowGroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowGroupItem.d.ts} +0 -0
- /package/esm/components/{GridColumnMenuRowUngroupItem.d.ts → columnMenu/menuItems/GridColumnMenuRowUngroupItem.d.ts} +0 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.GridChartsPanel = GridChartsPanel;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _system = require("@mui/system");
|
|
14
|
+
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
15
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
16
|
+
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
17
|
+
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
18
|
+
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
19
|
+
var _GridChartsPanelChart = require("./chart/GridChartsPanelChart");
|
|
20
|
+
var _GridChartsPanelCustomize = require("./customize/GridChartsPanelCustomize");
|
|
21
|
+
var _gridChartsIntegrationSelectors = require("../../hooks/features/chartsIntegration/gridChartsIntegrationSelectors");
|
|
22
|
+
var _useGridChartIntegration = require("../../hooks/utils/useGridChartIntegration");
|
|
23
|
+
var _GridChartsPanelData = require("./data/GridChartsPanelData");
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
const GridChartsPanelHeader = (0, _system.styled)('div', {
|
|
26
|
+
name: 'MuiDataGrid',
|
|
27
|
+
slot: 'ChartsPanelHeader'
|
|
28
|
+
})({
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
gap: _internals.vars.spacing(0.25),
|
|
32
|
+
padding: _internals.vars.spacing(1, 0.5, 0, 0.75),
|
|
33
|
+
boxSizing: 'border-box'
|
|
34
|
+
});
|
|
35
|
+
const GridChartsPanelTitle = (0, _system.styled)('div', {
|
|
36
|
+
name: 'MuiDataGrid',
|
|
37
|
+
slot: 'ChartsPanelTitle'
|
|
38
|
+
})({
|
|
39
|
+
font: _internals.vars.typography.font.large,
|
|
40
|
+
fontWeight: _internals.vars.typography.fontWeight.medium,
|
|
41
|
+
marginLeft: _internals.vars.spacing(0.5),
|
|
42
|
+
marginRight: 'auto'
|
|
43
|
+
});
|
|
44
|
+
const GridChartsPanelChartSelection = (0, _system.styled)('button', {
|
|
45
|
+
name: 'MuiDataGrid',
|
|
46
|
+
slot: 'ChartsPanelChartSelection'
|
|
47
|
+
})({
|
|
48
|
+
display: 'flex',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
gap: _internals.vars.spacing(0.25),
|
|
51
|
+
padding: _internals.vars.spacing(0.75, 0.5),
|
|
52
|
+
borderRadius: _internals.vars.radius.base,
|
|
53
|
+
font: _internals.vars.typography.font.large,
|
|
54
|
+
fontWeight: _internals.vars.typography.fontWeight.medium,
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
border: 'none',
|
|
57
|
+
background: 'none',
|
|
58
|
+
outline: 'none',
|
|
59
|
+
marginRight: 'auto',
|
|
60
|
+
'&:hover, &:focus-visible': {
|
|
61
|
+
backgroundColor: _internals.vars.colors.interactive.hover
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
function GridChartsPanelChartSelector(props) {
|
|
65
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
66
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
67
|
+
const {
|
|
68
|
+
activeChartId,
|
|
69
|
+
chartEntries
|
|
70
|
+
} = props;
|
|
71
|
+
const triggerRef = React.useRef(null);
|
|
72
|
+
const [open, setOpen] = React.useState(false);
|
|
73
|
+
const menuId = (0, _useId.default)();
|
|
74
|
+
const triggerId = (0, _useId.default)();
|
|
75
|
+
const activeChart = chartEntries.find(([chartId]) => chartId === activeChartId);
|
|
76
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(GridChartsPanelChartSelection, {
|
|
78
|
+
id: triggerId,
|
|
79
|
+
"aria-haspopup": "true",
|
|
80
|
+
"aria-controls": open ? menuId : undefined,
|
|
81
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
82
|
+
ownerState: rootProps,
|
|
83
|
+
onClick: () => setOpen(!open),
|
|
84
|
+
ref: triggerRef,
|
|
85
|
+
children: [activeChart?.[1]?.label, /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.promptChangesToggleIcon, {
|
|
86
|
+
fontSize: "small"
|
|
87
|
+
})]
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridMenu, {
|
|
89
|
+
open: open,
|
|
90
|
+
target: triggerRef.current,
|
|
91
|
+
onClose: () => setOpen(false),
|
|
92
|
+
position: "bottom-start",
|
|
93
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuList, (0, _extends2.default)({
|
|
94
|
+
id: menuId,
|
|
95
|
+
"aria-labelledby": triggerId,
|
|
96
|
+
autoFocusItem: true
|
|
97
|
+
}, rootProps.slotProps?.baseMenuList, {
|
|
98
|
+
children: chartEntries.map(([chartId, chartState]) => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, (0, _extends2.default)({
|
|
99
|
+
value: chartId,
|
|
100
|
+
onClick: () => {
|
|
101
|
+
apiRef.current.setActiveChartId(chartId);
|
|
102
|
+
setOpen(false);
|
|
103
|
+
},
|
|
104
|
+
selected: chartId === activeChartId
|
|
105
|
+
}, rootProps.slotProps?.baseMenuItem, {
|
|
106
|
+
children: chartState.label || chartId
|
|
107
|
+
}), chartId))
|
|
108
|
+
}))
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
process.env.NODE_ENV !== "production" ? GridChartsPanelChartSelector.propTypes = {
|
|
113
|
+
// ----------------------------- Warning --------------------------------
|
|
114
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
115
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
116
|
+
// ----------------------------------------------------------------------
|
|
117
|
+
activeChartId: _propTypes.default.string.isRequired,
|
|
118
|
+
chartEntries: _propTypes.default.arrayOf(_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({
|
|
119
|
+
configuration: _propTypes.default.object.isRequired,
|
|
120
|
+
dimensions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
121
|
+
data: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])).isRequired,
|
|
122
|
+
id: _propTypes.default.string.isRequired,
|
|
123
|
+
label: _propTypes.default.string.isRequired
|
|
124
|
+
})).isRequired,
|
|
125
|
+
dimensionsLabel: _propTypes.default.string,
|
|
126
|
+
label: _propTypes.default.string,
|
|
127
|
+
maxDimensions: _propTypes.default.number,
|
|
128
|
+
maxValues: _propTypes.default.number,
|
|
129
|
+
synced: _propTypes.default.bool.isRequired,
|
|
130
|
+
type: _propTypes.default.string.isRequired,
|
|
131
|
+
values: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
132
|
+
data: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,
|
|
133
|
+
id: _propTypes.default.string.isRequired,
|
|
134
|
+
label: _propTypes.default.string.isRequired
|
|
135
|
+
})).isRequired,
|
|
136
|
+
valuesLabel: _propTypes.default.string
|
|
137
|
+
}), _propTypes.default.string]).isRequired)).isRequired
|
|
138
|
+
} : void 0;
|
|
139
|
+
function GridChartsPanel(props) {
|
|
140
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
141
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
142
|
+
const {
|
|
143
|
+
schema = {}
|
|
144
|
+
} = props;
|
|
145
|
+
const activeChartId = (0, _internals.useGridSelector)(apiRef, _gridChartsIntegrationSelectors.gridChartsIntegrationActiveChartIdSelector);
|
|
146
|
+
const {
|
|
147
|
+
chartStateLookup
|
|
148
|
+
} = (0, _useGridChartIntegration.useGridChartsIntegrationContext)();
|
|
149
|
+
const [activeTab, setActiveTab] = React.useState('chart');
|
|
150
|
+
const chartEntries = React.useMemo(() => Object.entries(chartStateLookup), [chartStateLookup]);
|
|
151
|
+
const activeChartType = React.useMemo(() => chartStateLookup[activeChartId]?.type || '', [chartStateLookup, activeChartId]);
|
|
152
|
+
const currentChartConfiguration = React.useMemo(() => {
|
|
153
|
+
return schema[activeChartType] || {};
|
|
154
|
+
}, [schema, activeChartType]);
|
|
155
|
+
const handleChartSyncChange = React.useCallback(newSyncState => {
|
|
156
|
+
apiRef.current.setChartSynchronizationState(activeChartId, newSyncState);
|
|
157
|
+
}, [apiRef, activeChartId]);
|
|
158
|
+
const handleChartTypeChange = React.useCallback(type => {
|
|
159
|
+
apiRef.current.setChartType(activeChartId, type);
|
|
160
|
+
}, [apiRef, activeChartId]);
|
|
161
|
+
const tabItems = React.useMemo(() => [{
|
|
162
|
+
value: 'chart',
|
|
163
|
+
label: apiRef.current.getLocaleText('chartsTabChart'),
|
|
164
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridChartsPanelChart.GridChartsPanelChart, {
|
|
165
|
+
schema: schema,
|
|
166
|
+
selectedChartType: chartStateLookup[activeChartId]?.type,
|
|
167
|
+
onChartTypeChange: handleChartTypeChange
|
|
168
|
+
})
|
|
169
|
+
}, {
|
|
170
|
+
value: 'data',
|
|
171
|
+
label: apiRef.current.getLocaleText('chartsTabFields'),
|
|
172
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridChartsPanelData.GridChartsPanelData, {})
|
|
173
|
+
}, {
|
|
174
|
+
value: 'customize',
|
|
175
|
+
label: apiRef.current.getLocaleText('chartsTabCustomize'),
|
|
176
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridChartsPanelCustomize.GridChartsPanelCustomize, {
|
|
177
|
+
activeChartId: activeChartId,
|
|
178
|
+
sections: currentChartConfiguration.customization || []
|
|
179
|
+
})
|
|
180
|
+
}], [apiRef, activeChartId, chartStateLookup, handleChartTypeChange, schema, currentChartConfiguration]);
|
|
181
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
182
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(GridChartsPanelHeader, {
|
|
183
|
+
ownerState: rootProps,
|
|
184
|
+
children: [chartEntries.length > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(GridChartsPanelChartSelector, {
|
|
185
|
+
activeChartId: activeChartId,
|
|
186
|
+
chartEntries: chartEntries
|
|
187
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(GridChartsPanelTitle, {
|
|
188
|
+
ownerState: rootProps,
|
|
189
|
+
children: "Charts"
|
|
190
|
+
}), chartEntries.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, {
|
|
191
|
+
title: rootProps.localeText.chartsSyncButtonLabel,
|
|
192
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseToggleButton, {
|
|
193
|
+
value: "sync",
|
|
194
|
+
"aria-label": rootProps.localeText.chartsSyncButtonLabel,
|
|
195
|
+
selected: chartStateLookup[activeChartId]?.synced,
|
|
196
|
+
onClick: () => {
|
|
197
|
+
handleChartSyncChange(!chartStateLookup[activeChartId]?.synced);
|
|
198
|
+
},
|
|
199
|
+
children: chartStateLookup[activeChartId]?.synced ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.chartsSyncIcon, {
|
|
200
|
+
fontSize: "small"
|
|
201
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.chartsSyncDisabledIcon, {
|
|
202
|
+
fontSize: "small"
|
|
203
|
+
})
|
|
204
|
+
})
|
|
205
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
|
|
206
|
+
onClick: () => {
|
|
207
|
+
apiRef.current.setChartsPanelOpen(false);
|
|
208
|
+
},
|
|
209
|
+
"aria-label": apiRef.current.getLocaleText('chartsCloseButton')
|
|
210
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
211
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.sidebarCloseIcon, {
|
|
212
|
+
fontSize: "small"
|
|
213
|
+
})
|
|
214
|
+
}))]
|
|
215
|
+
}), chartEntries.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTabs, (0, _extends2.default)({
|
|
216
|
+
items: tabItems,
|
|
217
|
+
value: activeTab,
|
|
218
|
+
onChange: (_event, value) => {
|
|
219
|
+
setActiveTab(value);
|
|
220
|
+
}
|
|
221
|
+
}, rootProps.slotProps?.baseTabs)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridOverlay, {
|
|
222
|
+
children: apiRef.current.getLocaleText('chartsNoCharts')
|
|
223
|
+
})]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
process.env.NODE_ENV !== "production" ? GridChartsPanel.propTypes = {
|
|
227
|
+
// ----------------------------- Warning --------------------------------
|
|
228
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
229
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
230
|
+
// ----------------------------------------------------------------------
|
|
231
|
+
/**
|
|
232
|
+
* Override the default column name generation logic. Use field in combination with the grid state to determine the name of the column that will be shown to the user.
|
|
233
|
+
* @param {string} field The field name
|
|
234
|
+
* @returns {string | undefined} The name of the column or undefined if the column name should be determined by the grid
|
|
235
|
+
*/
|
|
236
|
+
getColumnName: _propTypes.default.func,
|
|
237
|
+
/**
|
|
238
|
+
* The schema of the charts configuration.
|
|
239
|
+
* @type {GridChartsConfigurationOptions}
|
|
240
|
+
* @default {}
|
|
241
|
+
*/
|
|
242
|
+
schema: _propTypes.default.object
|
|
243
|
+
} : void 0;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridChartsConfigurationOptions } from '@mui/x-internals/types';
|
|
3
|
+
export interface GridChartsPanelChartProps {
|
|
4
|
+
schema: GridChartsConfigurationOptions;
|
|
5
|
+
selectedChartType: string;
|
|
6
|
+
onChartTypeChange: (type: string) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function GridChartsPanelChart(props: GridChartsPanelChartProps): React.JSX.Element;
|
|
9
|
+
declare namespace GridChartsPanelChart {
|
|
10
|
+
var propTypes: any;
|
|
11
|
+
}
|
|
12
|
+
export { GridChartsPanelChart };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.GridChartsPanelChart = GridChartsPanelChart;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _system = require("@mui/system");
|
|
13
|
+
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
14
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
15
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
|
+
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
const useUtilityClasses = ownerState => {
|
|
19
|
+
const {
|
|
20
|
+
classes
|
|
21
|
+
} = ownerState;
|
|
22
|
+
const slots = {
|
|
23
|
+
root: ['chartsManagement'],
|
|
24
|
+
chartTypeRoot: ['chartTypeRoot'],
|
|
25
|
+
button: ['chartTypeSelectorButton']
|
|
26
|
+
};
|
|
27
|
+
return (0, _composeClasses.default)(slots, _xDataGridPro.getDataGridUtilityClass, classes);
|
|
28
|
+
};
|
|
29
|
+
const GridChartsManagementRoot = (0, _system.styled)('div', {
|
|
30
|
+
name: 'MuiDataGrid',
|
|
31
|
+
slot: 'ChartsManagement'
|
|
32
|
+
})({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
justifyContent: 'space-between',
|
|
36
|
+
height: '100%'
|
|
37
|
+
});
|
|
38
|
+
const GridChartTypeRoot = (0, _system.styled)('div', {
|
|
39
|
+
name: 'MuiDataGrid',
|
|
40
|
+
slot: 'ChartTypeRoot'
|
|
41
|
+
})({
|
|
42
|
+
display: 'grid',
|
|
43
|
+
gridTemplateColumns: '1fr 1fr 1fr',
|
|
44
|
+
gap: _internals.vars.spacing(1),
|
|
45
|
+
padding: _internals.vars.spacing(1)
|
|
46
|
+
});
|
|
47
|
+
const GridChartTypeButton = (0, _system.styled)('button', {
|
|
48
|
+
name: 'MuiDataGrid',
|
|
49
|
+
slot: 'ChartTypeSelectorButton',
|
|
50
|
+
shouldForwardProp: prop => prop !== 'isSelected'
|
|
51
|
+
})(({
|
|
52
|
+
isSelected
|
|
53
|
+
}) => {
|
|
54
|
+
return {
|
|
55
|
+
backgroundColor: isSelected ? `color-mix(in srgb, ${_internals.vars.colors.interactive.selected} calc(${_internals.vars.colors.interactive.selectedOpacity} * 100%), ${_internals.vars.colors.background.base})` : _internals.vars.colors.background.base,
|
|
56
|
+
color: isSelected ? _internals.vars.colors.interactive.selected : _internals.vars.colors.foreground.muted,
|
|
57
|
+
cursor: 'pointer',
|
|
58
|
+
display: 'flex',
|
|
59
|
+
flexDirection: 'column',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
gap: _internals.vars.spacing(0.5),
|
|
63
|
+
padding: _internals.vars.spacing(1.5, 1, 1),
|
|
64
|
+
border: `1px solid ${isSelected ? _internals.vars.colors.interactive.selected : _internals.vars.colors.border.base}`,
|
|
65
|
+
font: _internals.vars.typography.font.small,
|
|
66
|
+
fontWeight: _internals.vars.typography.fontWeight.medium,
|
|
67
|
+
borderRadius: _internals.vars.radius.base,
|
|
68
|
+
transition: _internals.vars.transition(['border-color', 'background-color', 'color'], {
|
|
69
|
+
duration: _internals.vars.transitions.duration.short,
|
|
70
|
+
easing: _internals.vars.transitions.easing.easeInOut
|
|
71
|
+
}),
|
|
72
|
+
'&:hover': {
|
|
73
|
+
backgroundColor: isSelected ? `color-mix(in srgb, ${_internals.vars.colors.interactive.selected} calc(${_internals.vars.colors.interactive.selectedOpacity} * 100%), ${_internals.vars.colors.background.base})` : _internals.vars.colors.interactive.hover
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
function GridChartsPanelChart(props) {
|
|
78
|
+
const {
|
|
79
|
+
schema,
|
|
80
|
+
selectedChartType,
|
|
81
|
+
onChartTypeChange
|
|
82
|
+
} = props;
|
|
83
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
84
|
+
const classes = useUtilityClasses(rootProps);
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridChartsManagementRoot, {
|
|
86
|
+
ownerState: rootProps,
|
|
87
|
+
className: classes.root,
|
|
88
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GridChartTypeRoot, {
|
|
89
|
+
className: classes.chartTypeRoot,
|
|
90
|
+
children: Object.entries(schema).map(([type, config]) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridChartTypeButton, (0, _extends2.default)({
|
|
91
|
+
className: classes.button,
|
|
92
|
+
isSelected: type === selectedChartType,
|
|
93
|
+
onClick: () => onChartTypeChange(type)
|
|
94
|
+
}, rootProps.slotProps?.baseButton, {
|
|
95
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(config.icon, {
|
|
96
|
+
style: {
|
|
97
|
+
width: 32,
|
|
98
|
+
height: 32
|
|
99
|
+
}
|
|
100
|
+
}), config.label]
|
|
101
|
+
}), type))
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
process.env.NODE_ENV !== "production" ? GridChartsPanelChart.propTypes = {
|
|
106
|
+
// ----------------------------- Warning --------------------------------
|
|
107
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
108
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
109
|
+
// ----------------------------------------------------------------------
|
|
110
|
+
schema: _propTypes.default.object
|
|
111
|
+
} : void 0;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridChartsConfigurationSection } from '@mui/x-internals/types';
|
|
3
|
+
interface GridChartsPanelCustomizeProps {
|
|
4
|
+
activeChartId: string;
|
|
5
|
+
sections: GridChartsConfigurationSection[];
|
|
6
|
+
}
|
|
7
|
+
export declare function GridChartsPanelCustomize(props: GridChartsPanelCustomizeProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.GridChartsPanelCustomize = GridChartsPanelCustomize;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _system = require("@mui/system");
|
|
12
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
13
|
+
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
14
|
+
var _useGridApiContext = require("../../../hooks/utils/useGridApiContext");
|
|
15
|
+
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
16
|
+
var _useGridChartIntegration = require("../../../hooks/utils/useGridChartIntegration");
|
|
17
|
+
var _Collapsible = require("../../collapsible/Collapsible");
|
|
18
|
+
var _CollapsibleTrigger = require("../../collapsible/CollapsibleTrigger");
|
|
19
|
+
var _CollapsiblePanel = require("../../collapsible/CollapsiblePanel");
|
|
20
|
+
var _useGridChartsIntegration = require("../../../hooks/features/chartsIntegration/useGridChartsIntegration");
|
|
21
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const GridChartsPanelCustomizeRoot = (0, _system.styled)(_xDataGridPro.GridShadowScrollArea)({
|
|
23
|
+
height: '100%'
|
|
24
|
+
});
|
|
25
|
+
const GridChartsPanelCustomizeSection = (0, _system.styled)(_Collapsible.Collapsible, {
|
|
26
|
+
name: 'MuiDataGrid',
|
|
27
|
+
slot: 'ChartsPanelCustomizeSection'
|
|
28
|
+
})({
|
|
29
|
+
margin: _internals.vars.spacing(0.5, 1)
|
|
30
|
+
});
|
|
31
|
+
const GridChartsPanelCustomizePanel = (0, _system.styled)(_CollapsiblePanel.CollapsiblePanel, {
|
|
32
|
+
name: 'MuiDataGrid',
|
|
33
|
+
slot: 'chartsPanelSection'
|
|
34
|
+
})({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
padding: _internals.vars.spacing(2, 1.5),
|
|
38
|
+
gap: _internals.vars.spacing(3)
|
|
39
|
+
});
|
|
40
|
+
const GridChartsPanelCustomizePanelTitle = (0, _system.styled)('div', {
|
|
41
|
+
name: 'MuiDataGrid',
|
|
42
|
+
slot: 'ChartsPanelCustomizePanelTitle'
|
|
43
|
+
})({
|
|
44
|
+
font: _internals.vars.typography.font.body,
|
|
45
|
+
fontWeight: _internals.vars.typography.fontWeight.medium
|
|
46
|
+
});
|
|
47
|
+
function GridChartsPanelCustomize(props) {
|
|
48
|
+
const {
|
|
49
|
+
activeChartId,
|
|
50
|
+
sections
|
|
51
|
+
} = props;
|
|
52
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
53
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
54
|
+
const {
|
|
55
|
+
chartStateLookup,
|
|
56
|
+
setChartState
|
|
57
|
+
} = (0, _useGridChartIntegration.useGridChartsIntegrationContext)();
|
|
58
|
+
const {
|
|
59
|
+
type: chartType,
|
|
60
|
+
configuration,
|
|
61
|
+
dimensions,
|
|
62
|
+
values
|
|
63
|
+
} = chartStateLookup[activeChartId] ?? _useGridChartsIntegration.EMPTY_CHART_INTEGRATION_CONTEXT_STATE;
|
|
64
|
+
const handleChange = (field, value) => {
|
|
65
|
+
setChartState(activeChartId, (0, _extends2.default)({}, configuration, {
|
|
66
|
+
configuration: (0, _extends2.default)({}, configuration, {
|
|
67
|
+
[field]: value
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
if (chartType === '') {
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGridPro.GridOverlay, {
|
|
73
|
+
children: apiRef.current.getLocaleText('chartsChartNotSelected')
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridChartsPanelCustomizeRoot, {
|
|
77
|
+
children: sections.map((section, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridChartsPanelCustomizeSection, {
|
|
78
|
+
initiallyOpen: index === 0,
|
|
79
|
+
ownerState: rootProps,
|
|
80
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CollapsibleTrigger.CollapsibleTrigger, {
|
|
81
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GridChartsPanelCustomizePanelTitle, {
|
|
82
|
+
ownerState: rootProps,
|
|
83
|
+
children: section.label
|
|
84
|
+
})
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GridChartsPanelCustomizePanel, {
|
|
86
|
+
ownerState: rootProps,
|
|
87
|
+
children: Object.entries(section.controls).map(([key, optRaw]) => {
|
|
88
|
+
const opt = optRaw;
|
|
89
|
+
const context = {
|
|
90
|
+
configuration,
|
|
91
|
+
dimensions,
|
|
92
|
+
values
|
|
93
|
+
};
|
|
94
|
+
const isHidden = opt.isHidden?.(context) ?? false;
|
|
95
|
+
if (isHidden) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const isDisabled = opt.isDisabled?.(context) ?? false;
|
|
99
|
+
if (opt.type === 'boolean') {
|
|
100
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSwitch, (0, _extends2.default)({
|
|
101
|
+
checked: Boolean(configuration[key] ?? opt.default),
|
|
102
|
+
onChange: event => handleChange(key, event.target.checked),
|
|
103
|
+
size: "small",
|
|
104
|
+
label: opt.label,
|
|
105
|
+
disabled: isDisabled
|
|
106
|
+
}, rootProps.slotProps?.baseSwitch), key);
|
|
107
|
+
}
|
|
108
|
+
if (opt.type === 'select') {
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelect, (0, _extends2.default)({
|
|
110
|
+
fullWidth: true,
|
|
111
|
+
size: "small",
|
|
112
|
+
label: opt.label,
|
|
113
|
+
value: configuration[key] ?? opt.default,
|
|
114
|
+
onChange: event => handleChange(key, event.target.value),
|
|
115
|
+
disabled: isDisabled,
|
|
116
|
+
slotProps: {
|
|
117
|
+
htmlInput: (0, _extends2.default)({}, opt.htmlAttributes)
|
|
118
|
+
}
|
|
119
|
+
}, rootProps.slotProps?.baseSelect, {
|
|
120
|
+
children: (opt.options || []).map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, {
|
|
121
|
+
value: option.value,
|
|
122
|
+
native: false,
|
|
123
|
+
children: option.content
|
|
124
|
+
}, option.value))
|
|
125
|
+
}), key);
|
|
126
|
+
}
|
|
127
|
+
// string or number
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({
|
|
129
|
+
"aria-label": opt.label,
|
|
130
|
+
placeholder: opt.label,
|
|
131
|
+
label: opt.label,
|
|
132
|
+
type: opt.type === 'number' ? 'number' : 'text',
|
|
133
|
+
size: "small",
|
|
134
|
+
fullWidth: true,
|
|
135
|
+
disabled: isDisabled,
|
|
136
|
+
slotProps: {
|
|
137
|
+
htmlInput: (0, _extends2.default)({}, opt.htmlAttributes)
|
|
138
|
+
}
|
|
139
|
+
}, rootProps.slotProps?.baseTextField, {
|
|
140
|
+
value: (configuration[key] ?? opt.default ?? '').toString(),
|
|
141
|
+
onChange: event => handleChange(key, opt.type === 'number' ? Number(event.target.value) : event.target.value)
|
|
142
|
+
}), key);
|
|
143
|
+
})
|
|
144
|
+
})]
|
|
145
|
+
}, section.id))
|
|
146
|
+
});
|
|
147
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.GridChartsPanelData = GridChartsPanelData;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _GridChartsPanelDataBody = require("./GridChartsPanelDataBody");
|
|
11
|
+
var _GridChartsPanelDataHeader = require("./GridChartsPanelDataHeader");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function GridChartsPanelData() {
|
|
14
|
+
const [searchValue, setSearchValue] = React.useState('');
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
16
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridChartsPanelDataHeader.GridChartsPanelDataHeader, {
|
|
17
|
+
searchValue: searchValue,
|
|
18
|
+
onSearchValueChange: setSearchValue
|
|
19
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridChartsPanelDataBody.GridChartsPanelDataBody, {
|
|
20
|
+
searchValue: searchValue
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridChartsIntegrationSection } from "../../../hooks/features/chartsIntegration/gridChartsIntegrationInterfaces.js";
|
|
3
|
+
export interface FieldTransferObject {
|
|
4
|
+
field: string;
|
|
5
|
+
section: GridChartsIntegrationSection;
|
|
6
|
+
}
|
|
7
|
+
export type DropPosition = 'top' | 'bottom' | null;
|
|
8
|
+
interface GridChartsPanelDataBodyProps {
|
|
9
|
+
searchValue: string;
|
|
10
|
+
}
|
|
11
|
+
declare function GridChartsPanelDataBody(props: GridChartsPanelDataBodyProps): React.JSX.Element;
|
|
12
|
+
export { GridChartsPanelDataBody };
|