devextreme-react
Version:
DevExtreme React UI and Visualization Components
196 lines (194 loc) • 6.06 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 dxLoadPanel from "devextreme/ui/load_panel";
import { Component as BaseComponent } from "./core/component";
import NestedOption from "./core/nested-option";
const LoadPanel = memo(forwardRef((props, ref) => {
const baseRef = useRef(null);
useImperativeHandle(ref, () => ({
instance() {
return baseRef.current?.getInstance();
}
}), [baseRef.current]);
const subscribableOptions = useMemo(() => (["position", "visible"]), []);
const independentEvents = useMemo(() => (["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onShowing", "onShown"]), []);
const defaults = useMemo(() => ({
defaultPosition: "position",
defaultVisible: "visible",
}), []);
const expectedChildren = useMemo(() => ({
animation: { optionName: "animation", isCollectionItem: false },
position: { optionName: "position", isCollectionItem: false }
}), []);
return (React.createElement((BaseComponent), {
WidgetClass: dxLoadPanel,
ref: baseRef,
isPortalComponent: true,
subscribableOptions,
independentEvents,
defaults,
expectedChildren,
...props,
}));
}));
const _componentAnimation = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "animation",
ExpectedChildren: {
hide: { optionName: "hide", isCollectionItem: false },
show: { optionName: "show", isCollectionItem: false }
},
},
});
};
const Animation = Object.assign(_componentAnimation, {
componentType: "option",
});
const _componentAt = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "at",
},
});
};
const At = Object.assign(_componentAt, {
componentType: "option",
});
const _componentBoundaryOffset = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "boundaryOffset",
},
});
};
const BoundaryOffset = Object.assign(_componentBoundaryOffset, {
componentType: "option",
});
const _componentCollision = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "collision",
},
});
};
const Collision = Object.assign(_componentCollision, {
componentType: "option",
});
const _componentFrom = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "from",
ExpectedChildren: {
position: { optionName: "position", isCollectionItem: false }
},
},
});
};
const From = Object.assign(_componentFrom, {
componentType: "option",
});
const _componentHide = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "hide",
ExpectedChildren: {
from: { optionName: "from", isCollectionItem: false },
to: { optionName: "to", isCollectionItem: false }
},
},
});
};
const Hide = Object.assign(_componentHide, {
componentType: "option",
});
const _componentMy = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "my",
},
});
};
const My = Object.assign(_componentMy, {
componentType: "option",
});
const _componentOffset = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "offset",
},
});
};
const Offset = Object.assign(_componentOffset, {
componentType: "option",
});
const _componentPosition = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "position",
ExpectedChildren: {
at: { optionName: "at", isCollectionItem: false },
boundaryOffset: { optionName: "boundaryOffset", isCollectionItem: false },
collision: { optionName: "collision", isCollectionItem: false },
my: { optionName: "my", isCollectionItem: false },
offset: { optionName: "offset", isCollectionItem: false }
},
},
});
};
const Position = Object.assign(_componentPosition, {
componentType: "option",
});
const _componentShow = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "show",
ExpectedChildren: {
from: { optionName: "from", isCollectionItem: false },
to: { optionName: "to", isCollectionItem: false }
},
},
});
};
const Show = Object.assign(_componentShow, {
componentType: "option",
});
const _componentTo = (props) => {
return React.createElement((NestedOption), {
...props,
elementDescriptor: {
OptionName: "to",
ExpectedChildren: {
position: { optionName: "position", isCollectionItem: false }
},
},
});
};
const To = Object.assign(_componentTo, {
componentType: "option",
});
export default LoadPanel;
export { LoadPanel, Animation, At, BoundaryOffset, Collision, From, Hide, My, Offset, Position, Show, To };