UNPKG

devextreme-react

Version:

DevExtreme React UI and Visualization Components

499 lines (497 loc) • 17.9 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.VectorMapTitleSubtitle = exports.VectorMapTitle = exports.TooltipBorder = exports.Tooltip = exports.Title = exports.Subtitle = exports.Source = exports.Size = exports.Shadow = exports.Projection = exports.Margin = exports.LoadingIndicator = exports.LegendTitleSubtitle = exports.LegendTitle = exports.Legend = exports.Layer = exports.Label = exports.Image = exports.Font = exports.Export = exports.ControlBar = exports.CommonAnnotationSettings = exports.Border = exports.Background = exports.AnnotationBorder = exports.Annotation = exports.VectorMap = void 0; const React = __importStar(require("react")); const react_1 = require("react"); const vector_map_1 = __importDefault(require("devextreme/viz/vector_map")); const component_1 = require("./core/component"); const nested_option_1 = __importDefault(require("./core/nested-option")); const VectorMap = (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 subscribableOptions = (0, react_1.useMemo)(() => (["loadingIndicator", "loadingIndicator.show"]), []); const independentEvents = (0, react_1.useMemo)(() => (["onClick", "onDisposing", "onDrawn", "onExported", "onExporting", "onFileSaving", "onIncidentOccurred", "onInitialized", "onTooltipHidden", "onTooltipShown"]), []); const defaults = (0, react_1.useMemo)(() => ({ defaultLoadingIndicator: "loadingIndicator", }), []); const expectedChildren = (0, react_1.useMemo)(() => ({ annotation: { optionName: "annotations", isCollectionItem: true }, background: { optionName: "background", isCollectionItem: false }, commonAnnotationSettings: { optionName: "commonAnnotationSettings", isCollectionItem: false }, controlBar: { optionName: "controlBar", isCollectionItem: false }, export: { optionName: "export", isCollectionItem: false }, layer: { optionName: "layers", isCollectionItem: true }, legend: { optionName: "legends", isCollectionItem: true }, loadingIndicator: { optionName: "loadingIndicator", isCollectionItem: false }, projection: { optionName: "projection", isCollectionItem: false }, size: { optionName: "size", isCollectionItem: false }, title: { optionName: "title", isCollectionItem: false }, tooltip: { optionName: "tooltip", isCollectionItem: false }, vectorMapTitle: { optionName: "title", isCollectionItem: false } }), []); return (React.createElement((component_1.Component), { WidgetClass: vector_map_1.default, ref: baseRef, subscribableOptions, independentEvents, defaults, expectedChildren, ...props, })); })); exports.VectorMap = VectorMap; const _componentAnnotation = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "annotations", IsCollectionItem: true, ExpectedChildren: { annotationBorder: { optionName: "border", isCollectionItem: false }, border: { optionName: "border", isCollectionItem: false }, font: { optionName: "font", isCollectionItem: false }, image: { optionName: "image", isCollectionItem: false }, shadow: { optionName: "shadow", isCollectionItem: false } }, TemplateProps: [{ tmplOption: "template", render: "render", component: "component" }, { tmplOption: "tooltipTemplate", render: "tooltipRender", component: "tooltipComponent" }], }, }); }; const Annotation = Object.assign(_componentAnnotation, { componentType: "option", }); exports.Annotation = Annotation; const _componentAnnotationBorder = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "border", }, }); }; const AnnotationBorder = Object.assign(_componentAnnotationBorder, { componentType: "option", }); exports.AnnotationBorder = AnnotationBorder; const _componentBackground = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "background", }, }); }; const Background = Object.assign(_componentBackground, { componentType: "option", }); exports.Background = Background; const _componentBorder = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "border", }, }); }; const Border = Object.assign(_componentBorder, { componentType: "option", }); exports.Border = Border; const _componentCommonAnnotationSettings = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "commonAnnotationSettings", ExpectedChildren: { annotationBorder: { optionName: "border", isCollectionItem: false }, border: { optionName: "border", isCollectionItem: false }, font: { optionName: "font", isCollectionItem: false }, image: { optionName: "image", isCollectionItem: false }, shadow: { optionName: "shadow", isCollectionItem: false } }, TemplateProps: [{ tmplOption: "template", render: "render", component: "component" }, { tmplOption: "tooltipTemplate", render: "tooltipRender", component: "tooltipComponent" }], }, }); }; const CommonAnnotationSettings = Object.assign(_componentCommonAnnotationSettings, { componentType: "option", }); exports.CommonAnnotationSettings = CommonAnnotationSettings; const _componentControlBar = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "controlBar", }, }); }; const ControlBar = Object.assign(_componentControlBar, { componentType: "option", }); exports.ControlBar = ControlBar; 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 _componentFont = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "font", }, }); }; const Font = Object.assign(_componentFont, { componentType: "option", }); exports.Font = Font; const _componentImage = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "image", }, }); }; const Image = Object.assign(_componentImage, { componentType: "option", }); exports.Image = Image; const _componentLabel = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "label", ExpectedChildren: { font: { optionName: "font", isCollectionItem: false } }, }, }); }; const Label = Object.assign(_componentLabel, { componentType: "option", }); exports.Label = Label; const _componentLayer = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "layers", IsCollectionItem: true, ExpectedChildren: { label: { optionName: "label", isCollectionItem: false } }, }, }); }; const Layer = Object.assign(_componentLayer, { componentType: "option", }); exports.Layer = Layer; const _componentLegend = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "legends", IsCollectionItem: true, ExpectedChildren: { annotationBorder: { optionName: "border", isCollectionItem: false }, border: { optionName: "border", isCollectionItem: false }, font: { optionName: "font", isCollectionItem: false }, legendTitle: { optionName: "title", isCollectionItem: false }, margin: { optionName: "margin", isCollectionItem: false }, source: { optionName: "source", isCollectionItem: false }, title: { optionName: "title", isCollectionItem: false } }, TemplateProps: [{ tmplOption: "markerTemplate", render: "markerRender", component: "markerComponent" }], }, }); }; const Legend = Object.assign(_componentLegend, { componentType: "option", }); exports.Legend = Legend; const _componentLegendTitle = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "title", ExpectedChildren: { font: { optionName: "font", isCollectionItem: false }, legendTitleSubtitle: { optionName: "subtitle", isCollectionItem: false }, margin: { optionName: "margin", isCollectionItem: false }, subtitle: { optionName: "subtitle", isCollectionItem: false } }, }, }); }; const LegendTitle = Object.assign(_componentLegendTitle, { componentType: "option", }); exports.LegendTitle = LegendTitle; const _componentLegendTitleSubtitle = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "subtitle", ExpectedChildren: { font: { optionName: "font", isCollectionItem: false } }, }, }); }; const LegendTitleSubtitle = Object.assign(_componentLegendTitleSubtitle, { componentType: "option", }); exports.LegendTitleSubtitle = LegendTitleSubtitle; const _componentLoadingIndicator = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "loadingIndicator", DefaultsProps: { defaultShow: "show" }, ExpectedChildren: { font: { optionName: "font", isCollectionItem: false } }, }, }); }; const LoadingIndicator = Object.assign(_componentLoadingIndicator, { componentType: "option", }); exports.LoadingIndicator = LoadingIndicator; const _componentMargin = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "margin", }, }); }; const Margin = Object.assign(_componentMargin, { componentType: "option", }); exports.Margin = Margin; const _componentProjection = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "projection", }, }); }; const Projection = Object.assign(_componentProjection, { componentType: "option", }); exports.Projection = Projection; const _componentShadow = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "shadow", }, }); }; const Shadow = Object.assign(_componentShadow, { componentType: "option", }); exports.Shadow = Shadow; const _componentSize = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "size", }, }); }; const Size = Object.assign(_componentSize, { componentType: "option", }); exports.Size = Size; const _componentSource = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "source", }, }); }; const Source = Object.assign(_componentSource, { componentType: "option", }); exports.Source = Source; const _componentSubtitle = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "subtitle", ExpectedChildren: { font: { optionName: "font", isCollectionItem: false } }, }, }); }; const Subtitle = Object.assign(_componentSubtitle, { componentType: "option", }); exports.Subtitle = Subtitle; const _componentTitle = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "title", ExpectedChildren: { font: { optionName: "font", isCollectionItem: false }, legendTitleSubtitle: { optionName: "subtitle", isCollectionItem: false }, margin: { optionName: "margin", isCollectionItem: false }, vectorMapTitleSubtitle: { optionName: "subtitle", isCollectionItem: false } }, }, }); }; const Title = Object.assign(_componentTitle, { componentType: "option", }); exports.Title = Title; const _componentTooltip = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "tooltip", ExpectedChildren: { border: { optionName: "border", isCollectionItem: false }, font: { optionName: "font", isCollectionItem: false }, shadow: { optionName: "shadow", isCollectionItem: false }, tooltipBorder: { optionName: "border", isCollectionItem: false } }, TemplateProps: [{ tmplOption: "contentTemplate", render: "contentRender", component: "contentComponent" }], }, }); }; const Tooltip = Object.assign(_componentTooltip, { componentType: "option", }); exports.Tooltip = Tooltip; const _componentTooltipBorder = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "border", }, }); }; const TooltipBorder = Object.assign(_componentTooltipBorder, { componentType: "option", }); exports.TooltipBorder = TooltipBorder; const _componentVectorMapTitle = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "title", ExpectedChildren: { font: { optionName: "font", isCollectionItem: false }, margin: { optionName: "margin", isCollectionItem: false }, subtitle: { optionName: "subtitle", isCollectionItem: false }, vectorMapTitleSubtitle: { optionName: "subtitle", isCollectionItem: false } }, }, }); }; const VectorMapTitle = Object.assign(_componentVectorMapTitle, { componentType: "option", }); exports.VectorMapTitle = VectorMapTitle; const _componentVectorMapTitleSubtitle = (props) => { return React.createElement((nested_option_1.default), { ...props, elementDescriptor: { OptionName: "subtitle", ExpectedChildren: { font: { optionName: "font", isCollectionItem: false } }, }, }); }; const VectorMapTitleSubtitle = Object.assign(_componentVectorMapTitleSubtitle, { componentType: "option", }); exports.VectorMapTitleSubtitle = VectorMapTitleSubtitle; exports.default = VectorMap;