devextreme-react
Version:
DevExtreme React UI and Visualization Components
205 lines (203 loc) • 6.63 kB
JavaScript
/*!
* devextreme-react
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file in the root of the project for details.
*
* https://github.com/DevExpress/devextreme-react
*/
"use client";
import * as React from "react";
import { memo, forwardRef, useImperativeHandle, useRef, useMemo } from "react";
import dxPivotGrid from "devextreme/ui/pivot_grid";
import { Component as BaseComponent } from "./core/component";
import NestedOption from "./core/nested-option";
const PivotGrid = memo(forwardRef((props, ref) => {
const baseRef = useRef(null);
useImperativeHandle(ref, () => ({
instance() {
return baseRef.current?.getInstance();
}
}), [baseRef.current]);
const independentEvents = useMemo(() => (["onCellClick", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDisposing", "onExporting", "onInitialized"]), []);
const expectedChildren = useMemo(() => ({
export: { optionName: "export", isCollectionItem: false },
fieldChooser: { optionName: "fieldChooser", isCollectionItem: false },
fieldPanel: { optionName: "fieldPanel", isCollectionItem: false },
headerFilter: { optionName: "headerFilter", isCollectionItem: false },
loadPanel: { optionName: "loadPanel", isCollectionItem: false },
pivotGridTexts: { optionName: "texts", isCollectionItem: false },
scrolling: { optionName: "scrolling", isCollectionItem: false },
stateStoring: { optionName: "stateStoring", isCollectionItem: false },
texts: { optionName: "texts", isCollectionItem: false }
}), []);
return (React.createElement((BaseComponent), {
WidgetClass: dxPivotGrid,
ref: baseRef,
independentEvents,
expectedChildren,
...props,
}));
}));
const _componentExport = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "export",
},
});
};
const Export = Object.assign(_componentExport, {
componentType: "option",
});
const _componentFieldChooser = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "fieldChooser",
ExpectedChildren: {
fieldChooserTexts: { optionName: "texts", isCollectionItem: false },
texts: { optionName: "texts", isCollectionItem: false }
},
},
});
};
const FieldChooser = Object.assign(_componentFieldChooser, {
componentType: "option",
});
const _componentFieldChooserTexts = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "texts",
},
});
};
const FieldChooserTexts = Object.assign(_componentFieldChooserTexts, {
componentType: "option",
});
const _componentFieldPanel = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "fieldPanel",
ExpectedChildren: {
fieldPanelTexts: { optionName: "texts", isCollectionItem: false },
texts: { optionName: "texts", isCollectionItem: false }
},
},
});
};
const FieldPanel = Object.assign(_componentFieldPanel, {
componentType: "option",
});
const _componentFieldPanelTexts = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "texts",
},
});
};
const FieldPanelTexts = Object.assign(_componentFieldPanelTexts, {
componentType: "option",
});
const _componentHeaderFilter = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "headerFilter",
ExpectedChildren: {
headerFilterTexts: { optionName: "texts", isCollectionItem: false },
search: { optionName: "search", isCollectionItem: false },
texts: { optionName: "texts", isCollectionItem: false }
},
},
});
};
const HeaderFilter = Object.assign(_componentHeaderFilter, {
componentType: "option",
});
const _componentHeaderFilterTexts = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "texts",
},
});
};
const HeaderFilterTexts = Object.assign(_componentHeaderFilterTexts, {
componentType: "option",
});
const _componentLoadPanel = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "loadPanel",
},
});
};
const LoadPanel = Object.assign(_componentLoadPanel, {
componentType: "option",
});
const _componentPivotGridTexts = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "texts",
},
});
};
const PivotGridTexts = Object.assign(_componentPivotGridTexts, {
componentType: "option",
});
const _componentScrolling = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "scrolling",
},
});
};
const Scrolling = Object.assign(_componentScrolling, {
componentType: "option",
});
const _componentSearch = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "search",
},
});
};
const Search = Object.assign(_componentSearch, {
componentType: "option",
});
const _componentStateStoring = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "stateStoring",
},
});
};
const StateStoring = Object.assign(_componentStateStoring, {
componentType: "option",
});
const _componentTexts = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "texts",
},
});
};
const Texts = Object.assign(_componentTexts, {
componentType: "option",
});
export default PivotGrid;
export { PivotGrid, Export, FieldChooser, FieldChooserTexts, FieldPanel, FieldPanelTexts, HeaderFilter, HeaderFilterTexts, LoadPanel, PivotGridTexts, Scrolling, Search, StateStoring, Texts };