UNPKG

devextreme-react

Version:

DevExtreme React UI and Visualization Components

247 lines (245 loc) • 8.73 kB
/*! * 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"; "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Texts = exports.StateStoring = exports.Search = exports.Scrolling = exports.PivotGridTexts = exports.LoadPanel = exports.HeaderFilterTexts = exports.HeaderFilter = exports.FieldPanelTexts = exports.FieldPanel = exports.FieldChooserTexts = exports.FieldChooser = exports.Export = exports.PivotGrid = void 0; const React = __importStar(require("react")); const react_1 = require("react"); const pivot_grid_1 = __importDefault(require("devextreme/ui/pivot_grid")); const component_1 = require("./core/component"); const nested_option_1 = __importDefault(require("./core/nested-option")); const PivotGrid = (0, react_1.memo)((0, react_1.forwardRef)((props, ref) => { const baseRef = (0, react_1.useRef)(null); (0, react_1.useImperativeHandle)(ref, () => ({ instance() { return baseRef.current?.getInstance(); } }), [baseRef.current]); const independentEvents = (0, react_1.useMemo)(() => (["onCellClick", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDisposing", "onExporting", "onInitialized"]), []); const expectedChildren = (0, react_1.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((component_1.Component), { WidgetClass: pivot_grid_1.default, ref: baseRef, independentEvents, expectedChildren, ...props, })); })); exports.PivotGrid = PivotGrid; const _componentExport = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "export", }, }); }; const Export = Object.assign(_componentExport, { componentType: "option", }); exports.Export = Export; const _componentFieldChooser = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "fieldChooser", ExpectedChildren: { fieldChooserTexts: { optionName: "texts", isCollectionItem: false }, texts: { optionName: "texts", isCollectionItem: false } }, }, }); }; const FieldChooser = Object.assign(_componentFieldChooser, { componentType: "option", }); exports.FieldChooser = FieldChooser; const _componentFieldChooserTexts = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "texts", }, }); }; const FieldChooserTexts = Object.assign(_componentFieldChooserTexts, { componentType: "option", }); exports.FieldChooserTexts = FieldChooserTexts; const _componentFieldPanel = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "fieldPanel", ExpectedChildren: { fieldPanelTexts: { optionName: "texts", isCollectionItem: false }, texts: { optionName: "texts", isCollectionItem: false } }, }, }); }; const FieldPanel = Object.assign(_componentFieldPanel, { componentType: "option", }); exports.FieldPanel = FieldPanel; const _componentFieldPanelTexts = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "texts", }, }); }; const FieldPanelTexts = Object.assign(_componentFieldPanelTexts, { componentType: "option", }); exports.FieldPanelTexts = FieldPanelTexts; const _componentHeaderFilter = (props) => { return React.createElement((nested_option_1.default), { ...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", }); exports.HeaderFilter = HeaderFilter; const _componentHeaderFilterTexts = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "texts", }, }); }; const HeaderFilterTexts = Object.assign(_componentHeaderFilterTexts, { componentType: "option", }); exports.HeaderFilterTexts = HeaderFilterTexts; const _componentLoadPanel = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "loadPanel", }, }); }; const LoadPanel = Object.assign(_componentLoadPanel, { componentType: "option", }); exports.LoadPanel = LoadPanel; const _componentPivotGridTexts = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "texts", }, }); }; const PivotGridTexts = Object.assign(_componentPivotGridTexts, { componentType: "option", }); exports.PivotGridTexts = PivotGridTexts; const _componentScrolling = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "scrolling", }, }); }; const Scrolling = Object.assign(_componentScrolling, { componentType: "option", }); exports.Scrolling = Scrolling; const _componentSearch = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "search", }, }); }; const Search = Object.assign(_componentSearch, { componentType: "option", }); exports.Search = Search; const _componentStateStoring = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "stateStoring", }, }); }; const StateStoring = Object.assign(_componentStateStoring, { componentType: "option", }); exports.StateStoring = StateStoring; const _componentTexts = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "texts", }, }); }; const Texts = Object.assign(_componentTexts, { componentType: "option", }); exports.Texts = Texts; exports.default = PivotGrid;