devexpress-reporting-react 24.1.2-beta → 24.1.4
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/README.md +1 -1
- package/core/options-manager.js +1 -2
- package/dx-report-designer/DxReportDesigner.d.ts +6 -2
- package/dx-report-designer/DxReportDesigner.js +21 -8
- package/dx-report-designer/index.d.ts +6 -4
- package/dx-report-designer/index.js +4 -3
- package/dx-report-designer/options/Callbacks.d.ts +34 -33
- package/dx-report-designer/options/Callbacks.js +2 -1
- package/dx-report-designer/options/DesignerModelSettings.js +2 -2
- package/dx-report-designer/options/ParameterEditingSettings.d.ts +2 -2
- package/dx-report-designer/options/ParameterEditingSettings.js +4 -4
- package/dx-report-designer/options/RequestOptions.d.ts +8 -0
- package/dx-report-designer/options/{RequestSettings.js → RequestOptions.js} +4 -4
- package/dx-report-viewer/DxReportViewer.d.ts +6 -2
- package/dx-report-viewer/DxReportViewer.js +32 -15
- package/dx-report-viewer/components/analytics/Actions/Actions.js +5 -8
- package/dx-report-viewer/components/analytics/Designer/Designer.js +2 -3
- package/dx-report-viewer/components/analytics/Properties/CollectionEditor/CollectionEditor.js +1 -1
- package/dx-report-viewer/components/analytics/Properties/Editors/EditorBase/EditorBase.js +1 -2
- package/dx-report-viewer/components/analytics/Properties/Editors/SelectBox/SelectBoxEditor.js +5 -8
- package/dx-report-viewer/components/analytics/Properties/Editors/editorHooks.js +1 -1
- package/dx-report-viewer/components/analytics/TabPanel/TabPanel.js +1 -1
- package/dx-report-viewer/components/analytics/Widgets/Treelist/Treelist.js +11 -7
- package/dx-report-viewer/components/core/LazyTemplate/LazyTemplate.js +2 -4
- package/dx-report-viewer/components/core/Template/Template.js +2 -4
- package/dx-report-viewer/components/core/TemplateEngineProvider/TemplateEngineProvider.js +1 -2
- package/dx-report-viewer/components/reporting/DocumentMap/DocumentMap.js +2 -3
- package/dx-report-viewer/components/reporting/Editing/CharacterComb/CharacterComb.js +10 -3
- package/dx-report-viewer/components/reporting/Editing/ExportTool/ExportTool.js +1 -1
- package/dx-report-viewer/components/reporting/Editing/TextField/Container/EditingFieldContainer.js +1 -12
- package/dx-report-viewer/components/reporting/Mobile/Actions/MobileActionsExport/MobileActionsExport.js +1 -1
- package/dx-report-viewer/components/reporting/Mobile/Gallery/MobileGallery.js +4 -2
- package/dx-report-viewer/components/reporting/Mobile/Parameters/MobileParametersDateRange/MobileParametersDateRange.js +1 -1
- package/dx-report-viewer/components/reporting/Mobile/Parameters/MobileParametersPopup/MobileParametersPopup.js +1 -2
- package/dx-report-viewer/components/reporting/Mobile/Search/MobileSearch.js +1 -1
- package/dx-report-viewer/components/reporting/ParametersPanel/DateRange/DateRange/DateRange.js +1 -1
- package/dx-report-viewer/components/reporting/ParametersPanel/DateRange/Mobile/DateRangeMobile.js +1 -2
- package/dx-report-viewer/components/reporting/ParametersPanel/DateRange/PopupContainer/PopupContainer.js +1 -2
- package/dx-report-viewer/components/reporting/ParametersPanel/Editor/Editor/Editor.js +1 -2
- package/dx-report-viewer/components/reporting/ParametersPanel/MultiValue/MultiValue/MultiValue.js +5 -6
- package/dx-report-viewer/components/reporting/ReportPreview/Breadcrumbs/Breadcrumbs.js +6 -3
- package/dx-report-viewer/components/reporting/ReportPreview/BrickClickable/BrickClickable.js +2 -2
- package/dx-report-viewer/components/reporting/ReportPreview/ProgressBar/ProgressBar.js +1 -1
- package/dx-report-viewer/components/reporting/ReportPreview/Surface/Surface.js +1 -2
- package/dx-report-viewer/components/reporting/Search/Search.js +1 -2
- package/dx-report-viewer/components/reporting/Toolbar/Pager/Pager.js +5 -2
- package/dx-report-viewer/components/reporting/Widgets/PictureEditor/Painter/Painter.js +5 -7
- package/dx-report-viewer/components/reporting/Widgets/PictureEditor/PictureEditor.js +3 -5
- package/dx-report-viewer/core/processStyles.d.ts +1 -0
- package/dx-report-viewer/core/processStyles.js +9 -0
- package/dx-report-viewer/core/template-engine.js +1 -1
- package/dx-report-viewer/hooks/dxEllipsisEditor.js +1 -1
- package/dx-report-viewer/hooks/dxMutationObserver.d.ts +1 -1
- package/dx-report-viewer/hooks/dxMutationObserver.js +2 -2
- package/dx-report-viewer/hooks/dxResizable.js +3 -3
- package/dx-report-viewer/index.d.ts +4 -3
- package/dx-report-viewer/index.js +2 -2
- package/dx-report-viewer/options/RequestOptions.d.ts +8 -0
- package/dx-report-viewer/options/{RequestSettings.js → RequestOptions.js} +5 -5
- package/package.json +4 -4
- package/dx-report-designer/options/RequestSettings.d.ts +0 -8
- package/dx-report-viewer/options/RequestSettings.d.ts +0 -8
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Take a look at the [DevExpress Reporting web demos]
|
|
|
23
23
|
|
|
24
24
|
## License
|
|
25
25
|
|
|
26
|
-
A commercial license for DevExpress
|
|
26
|
+
A [commercial license](https://www.devexpress.com/support/eulas/) for the DevExpress Reporting Web UI components (Document Viewer, Report Designer) is required to use this package. Please review [the Reporting section on this page](https://www.devexpress.com/subscriptions/reporting/web/#Pricing) to determine which subscription includes a license for the Web UI components you plan to use in your application.
|
|
27
27
|
|
|
28
28
|
## Support
|
|
29
29
|
|
package/core/options-manager.js
CHANGED
|
@@ -8,8 +8,7 @@ const getComponentOptions = (props, propTypes, defaultProps) => {
|
|
|
8
8
|
}, {});
|
|
9
9
|
};
|
|
10
10
|
const getControlOptions = (props, propTypes, defaultProps, validChildComponents) => {
|
|
11
|
-
|
|
12
|
-
const controlOptions = (_a = getComponentOptions(props, propTypes, defaultProps)) !== null && _a !== void 0 ? _a : {};
|
|
11
|
+
const controlOptions = getComponentOptions(props, propTypes, defaultProps) ?? {};
|
|
13
12
|
const childReactElements = React.Children.toArray(props.children)
|
|
14
13
|
.filter(x => React.isValidElement(x));
|
|
15
14
|
validChildComponents && Object.keys(validChildComponents).forEach(optionsComponentkey => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { JSReportDesigner } from 'devexpress-reporting/dx-reportdesigner';
|
|
3
|
+
export type DxReportDesignerProps = {
|
|
3
4
|
reportUrl?: string;
|
|
4
5
|
height?: string;
|
|
5
6
|
width?: string;
|
|
@@ -7,5 +8,8 @@ type DxReportDesignerPropsType = {
|
|
|
7
8
|
developmentMode?: boolean;
|
|
8
9
|
children?: React.ReactNode | React.ReactNode[];
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
export type DxReportDesignerRef = {
|
|
12
|
+
instance: () => JSReportDesigner;
|
|
13
|
+
};
|
|
14
|
+
declare const DxReportDesigner: React.ForwardRefExoticComponent<DxReportDesignerProps & React.RefAttributes<DxReportDesignerRef>>;
|
|
11
15
|
export default DxReportDesigner;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Callbacks from './options/Callbacks';
|
|
4
|
-
import
|
|
4
|
+
import RequestOptions from './options/RequestOptions';
|
|
5
5
|
import DesignerModelSettings from './options/DesignerModelSettings';
|
|
6
6
|
import OptionsManager from '../core/options-manager';
|
|
7
7
|
import { validChildComponents as designerModelSettingsValidChildren } from './options/DesignerModelSettings';
|
|
@@ -9,30 +9,43 @@ import { JSReportDesignerBinding } from 'devexpress-reporting/dx-reportdesigner'
|
|
|
9
9
|
import * as ko from 'knockout';
|
|
10
10
|
const validChildComponents = {
|
|
11
11
|
'callbacks': { component: Callbacks },
|
|
12
|
-
'requestOptions': { component:
|
|
12
|
+
'requestOptions': { component: RequestOptions },
|
|
13
13
|
'designerModelSettings': { component: DesignerModelSettings, children: designerModelSettingsValidChildren },
|
|
14
14
|
};
|
|
15
|
-
const DxReportDesigner = (props) => {
|
|
15
|
+
const DxReportDesigner = React.forwardRef(({ reportUrl, ...props }, ref) => {
|
|
16
16
|
const designerRef = React.useRef(null);
|
|
17
|
+
const [designerBinding, setDesignerBinding] = React.useState(null);
|
|
18
|
+
React.useImperativeHandle(ref, () => ({
|
|
19
|
+
instance() {
|
|
20
|
+
return designerBinding?.sender;
|
|
21
|
+
}
|
|
22
|
+
}), [designerBinding]);
|
|
17
23
|
React.useEffect(() => {
|
|
18
|
-
|
|
24
|
+
if (designerBinding) {
|
|
25
|
+
designerBinding.sender.OpenReport(reportUrl);
|
|
26
|
+
}
|
|
27
|
+
}, [reportUrl]);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
const options = OptionsManager.getControlOptions({ ...props, reportUrl }, DxReportDesigner.propTypes, DxReportDesignerDefaultProps, validChildComponents);
|
|
19
30
|
const callbacks = options.callbacks;
|
|
20
31
|
options.callbacks = { designer: {}, preview: {} };
|
|
21
|
-
const binding = new JSReportDesignerBinding(options, OptionsManager.getEventRaiser(callbacks, () => binding
|
|
32
|
+
const binding = new JSReportDesignerBinding(options, OptionsManager.getEventRaiser(callbacks, () => binding?.sender));
|
|
22
33
|
binding.applyBindings(designerRef.current);
|
|
34
|
+
setDesignerBinding(binding);
|
|
23
35
|
return () => {
|
|
24
|
-
ko.cleanNode(designerRef.current);
|
|
36
|
+
designerRef.current && ko.cleanNode(designerRef.current);
|
|
25
37
|
};
|
|
26
|
-
}, [
|
|
38
|
+
}, []);
|
|
27
39
|
return (React.createElement("div", { ref: designerRef, className: props.cssClass, style: { width: props.width || DxReportDesignerDefaultProps.width, height: props.height || DxReportDesignerDefaultProps.height } },
|
|
28
40
|
React.createElement("div", { "data-bind": "dxReportDesigner: $data" })));
|
|
29
|
-
};
|
|
41
|
+
});
|
|
30
42
|
DxReportDesigner.displayName = 'DxReportDesigner';
|
|
31
43
|
DxReportDesigner.propTypes = {
|
|
32
44
|
height: PropTypes.string,
|
|
33
45
|
width: PropTypes.string,
|
|
34
46
|
cssClass: PropTypes.string,
|
|
35
47
|
developmentMode: PropTypes.bool,
|
|
48
|
+
reportUrl: PropTypes.string,
|
|
36
49
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
|
|
37
50
|
};
|
|
38
51
|
const DxReportDesignerDefaultProps = {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import DxReportDesigner from './DxReportDesigner';
|
|
1
|
+
import DxReportDesigner, { DxReportDesignerRef, DxReportDesignerProps } from './DxReportDesigner';
|
|
2
2
|
import Callbacks from './options/Callbacks';
|
|
3
|
-
import
|
|
3
|
+
import DataSourceSettings from './options/DataSourceSettings';
|
|
4
4
|
import DesignerModelSettings from './options/DesignerModelSettings';
|
|
5
5
|
import PreviewSettings from './options/PreviewSettings';
|
|
6
|
-
import
|
|
6
|
+
import RequestOptions from './options/RequestOptions';
|
|
7
7
|
import WizardSettings from './options/WizardSettings';
|
|
8
|
-
|
|
8
|
+
import ParameterEditingSettings from './options/ParameterEditingSettings';
|
|
9
|
+
export { Callbacks, DataSourceSettings, DesignerModelSettings, PreviewSettings, RequestOptions, WizardSettings, ParameterEditingSettings, DxReportDesigner };
|
|
10
|
+
export type { DxReportDesignerRef, DxReportDesignerProps };
|
|
9
11
|
export default DxReportDesigner;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import DxReportDesigner from './DxReportDesigner';
|
|
2
2
|
import Callbacks from './options/Callbacks';
|
|
3
|
-
import
|
|
3
|
+
import DataSourceSettings from './options/DataSourceSettings';
|
|
4
4
|
import DesignerModelSettings from './options/DesignerModelSettings';
|
|
5
5
|
import PreviewSettings from './options/PreviewSettings';
|
|
6
|
-
import
|
|
6
|
+
import RequestOptions from './options/RequestOptions';
|
|
7
7
|
import WizardSettings from './options/WizardSettings';
|
|
8
|
-
|
|
8
|
+
import ParameterEditingSettings from './options/ParameterEditingSettings';
|
|
9
|
+
export { Callbacks, DataSourceSettings, DesignerModelSettings, PreviewSettings, RequestOptions, WizardSettings, ParameterEditingSettings, DxReportDesigner };
|
|
9
10
|
export default DxReportDesigner;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
type CallbacksPropsType = {
|
|
3
|
-
CustomizeElements?: () => void;
|
|
4
|
-
ExitDesigner?: () => void;
|
|
5
|
-
ReportSaving?: () => void;
|
|
6
|
-
ReportSaved?: () => void;
|
|
7
|
-
ReportOpened?: () => void;
|
|
8
|
-
ReportOpening?: () => void;
|
|
9
|
-
TabChanged?: () => void;
|
|
10
|
-
ReportTabClosing?: () => void;
|
|
11
|
-
ReportTabClosed?: () => void;
|
|
12
|
-
ComponentAdded?: () => void;
|
|
13
|
-
CustomizeParameterEditors?: () => void;
|
|
14
|
-
|
|
15
|
-
CustomizeSaveDialog?: () => void;
|
|
16
|
-
CustomizeSaveAsDialog?: () => void;
|
|
17
|
-
CustomizeOpenDialog?: () => void;
|
|
18
|
-
CustomizeToolbox?: () => void;
|
|
19
|
-
CustomizeFieldListActions?: () => void;
|
|
20
|
-
CustomizeMenuActions?: () => void;
|
|
21
|
-
CustomizeLocalization?: () => void;
|
|
22
|
-
OnInitializing?: () => void;
|
|
23
|
-
BeforeRender?: () => void;
|
|
24
|
-
OnServerError?: () => void;
|
|
25
|
-
CustomizeWizard?: () => void;
|
|
26
|
-
PreviewClick?: () => void;
|
|
27
|
-
PreviewCustomizeElements?: () => void;
|
|
28
|
-
PreviewCustomizeMenuActions?: () => void;
|
|
29
|
-
PreviewEditingFieldChanged?: () => void;
|
|
30
|
-
PreviewDocumentReady?: () => void;
|
|
31
|
-
PreviewParametersReset?: () => void;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
3
|
+
CustomizeElements?: (args: any) => void;
|
|
4
|
+
ExitDesigner?: (args: any) => void;
|
|
5
|
+
ReportSaving?: (args: any) => void;
|
|
6
|
+
ReportSaved?: (args: any) => void;
|
|
7
|
+
ReportOpened?: (args: any) => void;
|
|
8
|
+
ReportOpening?: (args: any) => void;
|
|
9
|
+
TabChanged?: (args: any) => void;
|
|
10
|
+
ReportTabClosing?: (args: any) => void;
|
|
11
|
+
ReportTabClosed?: (args: any) => void;
|
|
12
|
+
ComponentAdded?: (args: any) => void;
|
|
13
|
+
CustomizeParameterEditors?: (args: any) => void;
|
|
14
|
+
CustomizeParameterProperties?: (args: any) => void;
|
|
15
|
+
CustomizeSaveDialog?: (args: any) => void;
|
|
16
|
+
CustomizeSaveAsDialog?: (args: any) => void;
|
|
17
|
+
CustomizeOpenDialog?: (args: any) => void;
|
|
18
|
+
CustomizeToolbox?: (args: any) => void;
|
|
19
|
+
CustomizeFieldListActions?: (args: any) => void;
|
|
20
|
+
CustomizeMenuActions?: (args: any) => void;
|
|
21
|
+
CustomizeLocalization?: (args: any) => void;
|
|
22
|
+
OnInitializing?: (args: any) => void;
|
|
23
|
+
BeforeRender?: (args: any) => void;
|
|
24
|
+
OnServerError?: (args: any) => void;
|
|
25
|
+
CustomizeWizard?: (args: any) => void;
|
|
26
|
+
PreviewClick?: (args: any) => void;
|
|
27
|
+
PreviewCustomizeElements?: (args: any) => void;
|
|
28
|
+
PreviewCustomizeMenuActions?: (args: any) => void;
|
|
29
|
+
PreviewEditingFieldChanged?: (args: any) => void;
|
|
30
|
+
PreviewDocumentReady?: (args: any) => void;
|
|
31
|
+
PreviewParametersReset?: (args: any) => void;
|
|
32
|
+
PreviewCustomizeParameterLookUpSource?: (args: any) => void;
|
|
33
|
+
PreviewParametersInitialized?: (args: any) => void;
|
|
34
|
+
PreviewCustomizeExportOptions?: (args: any) => void;
|
|
35
|
+
PreviewParametersSubmitted?: (args: any) => void;
|
|
36
|
+
PreviewOnExport?: (args: any) => void;
|
|
36
37
|
};
|
|
37
38
|
declare const Callbacks: FunctionComponent<CallbacksPropsType>;
|
|
38
39
|
export default Callbacks;
|
|
@@ -13,7 +13,7 @@ Callbacks.propTypes = {
|
|
|
13
13
|
ReportTabClosed: PropTypes.func,
|
|
14
14
|
ComponentAdded: PropTypes.func,
|
|
15
15
|
CustomizeParameterEditors: PropTypes.func,
|
|
16
|
-
|
|
16
|
+
CustomizeParameterProperties: PropTypes.func,
|
|
17
17
|
CustomizeSaveDialog: PropTypes.func,
|
|
18
18
|
CustomizeSaveAsDialog: PropTypes.func,
|
|
19
19
|
CustomizeOpenDialog: PropTypes.func,
|
|
@@ -31,6 +31,7 @@ Callbacks.propTypes = {
|
|
|
31
31
|
PreviewEditingFieldChanged: PropTypes.func,
|
|
32
32
|
PreviewDocumentReady: PropTypes.func,
|
|
33
33
|
PreviewParametersReset: PropTypes.func,
|
|
34
|
+
PreviewCustomizeParameterLookUpSource: PropTypes.func,
|
|
34
35
|
PreviewParametersInitialized: PropTypes.func,
|
|
35
36
|
PreviewCustomizeExportOptions: PropTypes.func,
|
|
36
37
|
PreviewParametersSubmitted: PropTypes.func,
|
|
@@ -3,12 +3,12 @@ import PreviewSettings from './PreviewSettings';
|
|
|
3
3
|
import WizardSettings from './WizardSettings';
|
|
4
4
|
import DataSourceSettings from './DataSourceSettings';
|
|
5
5
|
import { validChildComponents as reportPreviewValidChildrenComponents } from './PreviewSettings';
|
|
6
|
-
import
|
|
6
|
+
import ParameterEditingSettings from './ParameterEditingSettings';
|
|
7
7
|
export const validChildComponents = {
|
|
8
8
|
'reportPreviewSettings': { component: PreviewSettings, children: reportPreviewValidChildrenComponents },
|
|
9
9
|
'wizardSettings': { component: WizardSettings },
|
|
10
10
|
'dataSourceSettings': { component: DataSourceSettings },
|
|
11
|
-
'parameterEditingSettings': { component:
|
|
11
|
+
'parameterEditingSettings': { component: ParameterEditingSettings },
|
|
12
12
|
};
|
|
13
13
|
const DesignerModelSettings = () => null;
|
|
14
14
|
DesignerModelSettings.displayName = 'DxReportDesignerDesignerModelSettings';
|
|
@@ -6,5 +6,5 @@ type ParameterEditingSettingsPropsType = {
|
|
|
6
6
|
allowEditParameterGroups?: boolean;
|
|
7
7
|
allowEditParameterSeparators?: boolean;
|
|
8
8
|
};
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const ParameterEditingSettings: FunctionComponent<ParameterEditingSettingsPropsType>;
|
|
10
|
+
export default ParameterEditingSettings;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const ParameterEditingSettings = () => null;
|
|
3
|
+
ParameterEditingSettings.displayName = 'DxReportDesignerParameterEditingSettings';
|
|
4
|
+
ParameterEditingSettings.propTypes = {
|
|
5
5
|
allowReorderParameters: PropTypes.bool,
|
|
6
6
|
allowEditParameterCollection: PropTypes.bool,
|
|
7
7
|
allowEditProperties: PropTypes.bool,
|
|
8
8
|
allowEditParameterGroups: PropTypes.bool,
|
|
9
9
|
allowEditParameterSeparators: PropTypes.bool,
|
|
10
10
|
};
|
|
11
|
-
export default
|
|
11
|
+
export default ParameterEditingSettings;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
export type RequestOptionsPropsType = {
|
|
3
|
+
getDesignerModelAction: string;
|
|
4
|
+
getLocalizationAction?: string;
|
|
5
|
+
host: string;
|
|
6
|
+
};
|
|
7
|
+
declare const RequestOptions: FunctionComponent<RequestOptionsPropsType>;
|
|
8
|
+
export default RequestOptions;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const RequestOptions = () => null;
|
|
3
|
+
RequestOptions.displayName = 'DxReportDesignerRequestOptions';
|
|
4
|
+
RequestOptions.propTypes = {
|
|
5
5
|
getDesignerModelAction: PropTypes.string.isRequired,
|
|
6
6
|
getLocalizationAction: PropTypes.string,
|
|
7
7
|
host: PropTypes.string.isRequired
|
|
8
8
|
};
|
|
9
|
-
export default
|
|
9
|
+
export default RequestOptions;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { JSReportViewer } from 'devexpress-reporting/viewer/binding/jsReportViewer';
|
|
2
3
|
import { TemplateEngine } from './core/template-engine';
|
|
3
4
|
import '@devexpress/analytics-core/dx-analytics-core-svg-templates';
|
|
4
5
|
import 'devexpress-reporting/dx-reporting-svg-templates';
|
|
5
|
-
type
|
|
6
|
+
export type DxReportViewerProps = {
|
|
6
7
|
height?: string;
|
|
7
8
|
width?: string;
|
|
8
9
|
cssClass?: string;
|
|
@@ -15,5 +16,8 @@ type DxReportViewerPropsType = {
|
|
|
15
16
|
developmentMode?: boolean;
|
|
16
17
|
children?: React.ReactNode;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
export type DxReportViewerRef = {
|
|
20
|
+
instance: () => JSReportViewer;
|
|
21
|
+
};
|
|
22
|
+
declare const DxReportViewer: React.ForwardRefExoticComponent<DxReportViewerProps & React.RefAttributes<DxReportViewerRef>>;
|
|
19
23
|
export default DxReportViewer;
|
|
@@ -5,7 +5,7 @@ import ExportSettings from './options/ExportSettings';
|
|
|
5
5
|
import MobileModeSettings from './options/MobileModeSettings';
|
|
6
6
|
import ProgressBarSettings from './options/ProgressBarSettings';
|
|
7
7
|
import RemoteSettings from './options/RemoteSettings';
|
|
8
|
-
import
|
|
8
|
+
import RequestOptions from './options/RequestOptions';
|
|
9
9
|
import SearchSettings from './options/SearchSettings';
|
|
10
10
|
import TabPanelSettings from './options/TabPanelSettings';
|
|
11
11
|
import OptionsManager from '../core/options-manager';
|
|
@@ -23,26 +23,39 @@ const validChildComponents = {
|
|
|
23
23
|
'mobileModeSettings': { component: MobileModeSettings },
|
|
24
24
|
'progressBarSettings': { component: ProgressBarSettings },
|
|
25
25
|
'remoteSettings': { component: RemoteSettings },
|
|
26
|
-
'requestOptions': { component:
|
|
26
|
+
'requestOptions': { component: RequestOptions },
|
|
27
27
|
'searchSettings': { component: SearchSettings },
|
|
28
28
|
'tabPanelSettings': { component: TabPanelSettings },
|
|
29
29
|
};
|
|
30
|
-
const DxReportViewer = (props) => {
|
|
30
|
+
const DxReportViewer = React.forwardRef(({ reportUrl, ...props }, ref) => {
|
|
31
31
|
const viewerRef = React.useRef(null);
|
|
32
32
|
const [viewModel, setViewModel] = React.useState(null);
|
|
33
|
+
const [viewerBinding, setViewerBinding] = React.useState(null);
|
|
34
|
+
React.useImperativeHandle(ref, () => ({
|
|
35
|
+
instance() {
|
|
36
|
+
return viewerBinding?.sender;
|
|
37
|
+
}
|
|
38
|
+
}), [viewerBinding]);
|
|
33
39
|
viewModelGeneratorSettings.ensureChangesImmutable = false;
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
if (viewerBinding && viewModel) {
|
|
42
|
+
viewerBinding.sender.OpenReport(reportUrl);
|
|
43
|
+
setViewModel({ ...viewModel });
|
|
44
|
+
}
|
|
45
|
+
}, [reportUrl]);
|
|
34
46
|
React.useEffect(() => {
|
|
35
47
|
let disposeViewModelSubscription;
|
|
36
48
|
const updateViewModel = (model) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setViewModel(Object.assign({}, viewModel));
|
|
49
|
+
const viewModel = model.GetPreviewModel()?.getViewModel();
|
|
50
|
+
setViewModel({ ...viewModel });
|
|
40
51
|
disposeViewModelSubscription && disposeViewModelSubscription();
|
|
41
|
-
disposeViewModelSubscription =
|
|
52
|
+
disposeViewModelSubscription = viewModel?._viewModelEvents?.on(ViewModelChangedEvent, () => setViewModel({ ...viewModel }));
|
|
42
53
|
};
|
|
43
|
-
const controlOptions = OptionsManager.getControlOptions(props, DxReportViewer.propTypes, DxReportViewerDefaultProps, validChildComponents);
|
|
44
|
-
|
|
54
|
+
const controlOptions = OptionsManager.getControlOptions({ ...props, reportUrl }, DxReportViewer.propTypes, DxReportViewerDefaultProps, validChildComponents);
|
|
55
|
+
let binding;
|
|
56
|
+
binding = new JSReportViewerBinding({ ...controlOptions, callbacks: {} }, OptionsManager.getEventRaiser(controlOptions.callbacks, () => binding?.sender), false);
|
|
45
57
|
binding.applyBindings(viewerRef.current);
|
|
58
|
+
setViewerBinding(binding);
|
|
46
59
|
const model = binding.sender;
|
|
47
60
|
updateViewModel(model);
|
|
48
61
|
const disposeModelSubscription = model.events.on('propertyChanged', (args) => {
|
|
@@ -51,16 +64,20 @@ const DxReportViewer = (props) => {
|
|
|
51
64
|
}
|
|
52
65
|
});
|
|
53
66
|
return () => {
|
|
54
|
-
binding.dispose();
|
|
55
67
|
disposeModelSubscription && disposeModelSubscription();
|
|
56
68
|
disposeViewModelSubscription && disposeViewModelSubscription();
|
|
69
|
+
setViewModel(null);
|
|
70
|
+
setViewerBinding(null);
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
binding && binding.dispose();
|
|
73
|
+
});
|
|
57
74
|
};
|
|
58
|
-
}, [
|
|
59
|
-
return (React.createElement(TemplateEngineProvider, { templateEngine: props.templateEngine },
|
|
60
|
-
React.createElement(AccessibilitySettingsProvider, { value: { accessibilityCompliant: viewModel
|
|
61
|
-
React.createElement("div", { ref: viewerRef, className: props.cssClass, style: { width: props.width || DxReportViewerDefaultProps.width, height: DxReportViewerDefaultProps.height } },
|
|
75
|
+
}, []);
|
|
76
|
+
return (React.createElement(TemplateEngineProvider, { templateEngine: props.templateEngine ?? new TemplateEngine() },
|
|
77
|
+
React.createElement(AccessibilitySettingsProvider, { value: { accessibilityCompliant: !!viewModel?.accessibilityCompliant } },
|
|
78
|
+
React.createElement("div", { ref: viewerRef, className: props.cssClass, style: { width: props.width || DxReportViewerDefaultProps.width, height: props.height || DxReportViewerDefaultProps.height } },
|
|
62
79
|
React.createElement("div", { className: "dx-designer" }, !!viewModel && React.createElement(Template, { template: "dx-designer", data: viewModel }))))));
|
|
63
|
-
};
|
|
80
|
+
});
|
|
64
81
|
DxReportViewer.displayName = 'DxReportViewer';
|
|
65
82
|
DxReportViewer.propTypes = {
|
|
66
83
|
height: PropTypes.string,
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Template from '../../core/Template';
|
|
3
|
-
const DefaultAction = ({ action }) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
React.createElement(Template, { template: action.image.templateName, data: null })),
|
|
9
|
-
React.createElement("div", { className: "dxrd-toolbar-item-separator dxd-toolbar-separator-color dxd-border-secondary", hidden: !action.hasSeparator }))));
|
|
10
|
-
};
|
|
3
|
+
const DefaultAction = ({ action }) => (React.createElement("div", { style: { display: action.visible ? '' : 'none' }, className: `dxrd-toolbar-item ${action.actionClass}` },
|
|
4
|
+
React.createElement("div", { role: "button", className: "dx-accessibility-toolbar-item dx-accessibility-focus-border-accented", "aria-label": action.block?.attr['aria-label'], "aria-disabled": action.block?.attr['aria-disabled'], "aria-pressed": action.block?.attr['aria-pressed'] },
|
|
5
|
+
React.createElement("div", { className: action.image.class, title: action.displayText, onClick: action.click },
|
|
6
|
+
React.createElement(Template, { template: action.image.templateName, data: null })),
|
|
7
|
+
React.createElement("div", { className: "dxrd-toolbar-item-separator dxd-toolbar-separator-color dxd-border-secondary", hidden: !action.hasSeparator }))));
|
|
11
8
|
const Action = ({ action }) => {
|
|
12
9
|
if (!action.templateName)
|
|
13
10
|
return React.createElement(DefaultAction, { action: action });
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Template from '../../core/Template';
|
|
3
3
|
const Designer = ({ data }) => {
|
|
4
|
-
var _a, _b;
|
|
5
4
|
const rootElt = React.useRef();
|
|
6
5
|
const [surfaceClassName, setSurfaceClassName] = React.useState('');
|
|
7
6
|
React.useEffect(() => {
|
|
@@ -10,8 +9,8 @@ const Designer = ({ data }) => {
|
|
|
10
9
|
}
|
|
11
10
|
}, [data, rootElt.current, setSurfaceClassName]);
|
|
12
11
|
return (React.createElement("div", { ref: rootElt, tabIndex: -1, className: `dx-designer-viewport ${surfaceClassName} ${data.accessibilityCompliant ? 'dx-accessibility' : ''}` },
|
|
13
|
-
React.createElement("div", { className: `dxrd-designer-wrapper dx-editors dxd-surface-back-color dxd-scrollbar-color ${data.rtl ? 'dx-rtl' : 'dx-ltr'} ${data.rootStyle}`, hidden: data.designMode && data.designMode() },
|
|
14
|
-
React.createElement("div", null,
|
|
12
|
+
React.createElement("div", { className: `dxrd-designer-wrapper dx-editors dxd-surface-back-color dxd-scrollbar-color ${data.rtl ? 'dx-rtl' : 'dx-ltr'} ${data.rootStyle}`, hidden: data.designMode && data.designMode() }, data.parts?.map(part => React.createElement(Template, { key: part.id, template: part.templateName, data: part.viewModel || part.model }))),
|
|
13
|
+
React.createElement("div", null, data.addOns?.map(addon => React.createElement(Template, { key: addon.id, template: addon.templateName, data: addon.model }))),
|
|
15
14
|
React.createElement("div", { id: "dxrd-designer-last-focus-item-blank", className: "dxrd-visually-hidden", tabIndex: -1 })));
|
|
16
15
|
};
|
|
17
16
|
export default Designer;
|
package/dx-report-viewer/components/analytics/Properties/CollectionEditor/CollectionEditor.js
CHANGED
|
@@ -34,7 +34,7 @@ const CollectionEditorWrapper = ({ data, contentTemplate }) => {
|
|
|
34
34
|
setViewModel(editorViewModel);
|
|
35
35
|
return () => {
|
|
36
36
|
subscription && subscription();
|
|
37
|
-
editorModel
|
|
37
|
+
editorModel?.dispose();
|
|
38
38
|
setViewModel(null);
|
|
39
39
|
};
|
|
40
40
|
}, []);
|
|
@@ -9,9 +9,8 @@ React.createElement("div", null,
|
|
|
9
9
|
React.createElement(Template, { className: `dx-collapsing-image dxrd-display-inline-block ${!data.collapsed ? 'dx-image-expanded' : ''}`, template: "dxrd-svg-collapsed" }),
|
|
10
10
|
React.createElement("div", { className: "dx-group-header-font", title: data.displayName, "data-bind": data.textToSearch ? `searchHighlighting: { text: displayName, textToSearch: ${data.textToSearch} }` : undefined }, !data.textToSearch ? data.displayName : undefined)));
|
|
11
11
|
const EditorLabel = ({ data }) => {
|
|
12
|
-
var _a;
|
|
13
12
|
const buttonWithTemplateRef = React.useRef();
|
|
14
|
-
useDxButtonWithTemplate(buttonWithTemplateRef, { onClick:
|
|
13
|
+
useDxButtonWithTemplate(buttonWithTemplateRef, { onClick: data.editorDescriptionAddon?.data.onClick, icon: 'dxrd-svg-tabs-description_info' });
|
|
15
14
|
return (React.createElement(React.Fragment, null,
|
|
16
15
|
React.createElement("label", { className: `propertygrid-editor-displayName ${data.isRequired ? ' dx-field-label-required' : ''}`, title: data.displayName, htmlFor: data.editorInputId, style: { fontWeight: data.isPropertyModified ? 'Bold' : '' }, "data-bind": data.textToSearch ? `searchHighlighting: { text: displayName, textToSearch: ${data.textToSearch} }` : undefined }, !data.textToSearch ? data.displayName : undefined),
|
|
17
16
|
data.editorDescriptionAddon && React.createElement("div", { className: "propertygrid-editor-description", ref: buttonWithTemplateRef })));
|
package/dx-report-viewer/components/analytics/Properties/Editors/SelectBox/SelectBoxEditor.js
CHANGED
|
@@ -7,14 +7,11 @@ export const SelectBoxEditorBase = (getEditorOptions) => ({ data }) => {
|
|
|
7
7
|
const selectBoxRef = React.useRef();
|
|
8
8
|
const args = {
|
|
9
9
|
getEditorOptions,
|
|
10
|
-
getPrivateWidgetOptions: () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
encodeNoDataText: true,
|
|
16
|
-
});
|
|
17
|
-
},
|
|
10
|
+
getPrivateWidgetOptions: () => ({
|
|
11
|
+
allowClearing: data.editorOptions?.allowClearing,
|
|
12
|
+
displayCustomValue: true,
|
|
13
|
+
encodeNoDataText: true,
|
|
14
|
+
}),
|
|
18
15
|
};
|
|
19
16
|
const options = useEditorOptions(selectBoxRef, data, args);
|
|
20
17
|
const dropDownOptions = useDropDownOptions(selectBoxRef, ({ container }) => ({ container }));
|
|
@@ -25,7 +25,7 @@ const useEditorExtendedOptions = (ref, data, getPrivateWidgetOptions) => {
|
|
|
25
25
|
}, [data.extendedOptions]);
|
|
26
26
|
};
|
|
27
27
|
const onPropertyChanged = (expectedWidgetOptions, widgetOptionsState, setWidgetOptionsState) => {
|
|
28
|
-
const nextWidgetState =
|
|
28
|
+
const nextWidgetState = { ...widgetOptionsState };
|
|
29
29
|
for (const name in expectedWidgetOptions) {
|
|
30
30
|
if (typeof expectedWidgetOptions[name] !== 'function' && expectedWidgetOptions[name] !== widgetOptionsState[name]) {
|
|
31
31
|
if (Array.isArray(expectedWidgetOptions[name])) {
|
|
@@ -21,7 +21,7 @@ const TabPanel = ({ data }) => {
|
|
|
21
21
|
const TabPanelItem = ({ tab }) => {
|
|
22
22
|
const btnRef = React.useRef(null);
|
|
23
23
|
useDxAction(btnRef, tab.click, tab);
|
|
24
|
-
return (React.createElement("div", { ref: btnRef, role: "button", className: `dxrd-tab-item dx-accessibility-rightpanel-button dxd-side-panel-tab-back-color dxd-back-highlighted dx-accessibility-focus-border-accented ${tab.css.class}`, title: tab.text, "aria-label": tab.text, "aria-expanded": tab.active, hidden: !tab.visible },
|
|
24
|
+
return (React.createElement("div", { ref: btnRef, role: "button", className: `dxrd-tab-item dx-accessibility-rightpanel-button dxd-side-panel-tab-back-color dxd-back-highlighted dx-accessibility-focus-border-accented ${tab.css.class}`, title: tab.text, "aria-label": tab.text, "aria-expanded": !tab.collapsed && tab.active ? 'true' : 'false', hidden: !tab.visible },
|
|
25
25
|
React.createElement("div", { className: `dxrd-image-padding ${tab.image.class}` },
|
|
26
26
|
React.createElement(Template, { template: tab.image.templateName }))));
|
|
27
27
|
};
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import TreelistGroup from './TreelistGroup';
|
|
4
3
|
import { initTreeListBinding } from '@devexpress/analytics-core/widgets/treelist/_binding';
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { ViewModelChangedEvent } from '@devexpress/analytics-core/serializer/native/viewModels/viewModelGenerator';
|
|
5
|
+
const Treelist = ({ options, ...delegatedProps }) => {
|
|
7
6
|
const htmlRef = React.useRef();
|
|
8
7
|
const [viewModel, setViewModel] = React.useState();
|
|
9
8
|
React.useEffect(() => {
|
|
10
9
|
if (!htmlRef.current)
|
|
11
10
|
return () => { };
|
|
12
|
-
|
|
11
|
+
const disposables = [];
|
|
12
|
+
disposables.push(initTreeListBinding({
|
|
13
13
|
values: options,
|
|
14
14
|
element: htmlRef.current,
|
|
15
|
-
createChildContext: (vm) =>
|
|
16
|
-
|
|
15
|
+
createChildContext: (vm) => {
|
|
16
|
+
disposables.push(vm?._viewModelEvents?.on(ViewModelChangedEvent, () => setViewModel({ ...vm })));
|
|
17
|
+
setViewModel({ ...vm });
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
20
|
+
return () => disposables.forEach(disposable => disposable && disposable());
|
|
17
21
|
}, [options, htmlRef.current]);
|
|
18
|
-
return React.createElement("div",
|
|
22
|
+
return React.createElement("div", { ref: htmlRef, ...delegatedProps }, viewModel ? React.createElement(TreelistGroup, { data: viewModel }) : null);
|
|
19
23
|
};
|
|
20
24
|
export default Treelist;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { globalResolver } from '@devexpress/analytics-core/property-grid/internal/_codeResolver';
|
|
4
3
|
import Template from '../Template';
|
|
5
|
-
const LazyTemplate = (
|
|
6
|
-
var { template, data, resolver, isResolved } = _a, delegatedProps = __rest(_a, ["template", "data", "resolver", "isResolved"]);
|
|
4
|
+
const LazyTemplate = ({ template, data, resolver, isResolved, ...delegatedProps }) => {
|
|
7
5
|
const [isReady, setIsReady] = React.useState(false);
|
|
8
6
|
React.useEffect(() => {
|
|
9
7
|
let isDisposed = false;
|
|
@@ -21,6 +19,6 @@ const LazyTemplate = (_a) => {
|
|
|
21
19
|
}, []);
|
|
22
20
|
if (!isReady)
|
|
23
21
|
return null;
|
|
24
|
-
return React.createElement(Template,
|
|
22
|
+
return React.createElement(Template, { template: template, data: data, ...delegatedProps });
|
|
25
23
|
};
|
|
26
24
|
export default LazyTemplate;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { SvgTemplatesEngine } from '@devexpress/analytics-core/property-grid/widgets/internal/_svgTemplateEngine';
|
|
4
3
|
import { getTemplate } from '@devexpress/analytics-core/property-grid/widgets/templateUtils';
|
|
5
4
|
import { TemplateEngineContext } from '../TemplateEngineProvider/TemplateEngineProvider';
|
|
6
|
-
const Template = (
|
|
7
|
-
var { template, data } = _a, delegatedProps = __rest(_a, ["template", "data"]);
|
|
5
|
+
const Template = ({ template, data, ...delegatedProps }) => {
|
|
8
6
|
const templateEngine = React.useContext(TemplateEngineContext);
|
|
9
7
|
const component = templateEngine.getTemplate(template);
|
|
10
8
|
if (!!component) {
|
|
11
9
|
return React.createElement(component, { data });
|
|
12
10
|
}
|
|
13
11
|
else if (!!SvgTemplatesEngine.getExistingTemplate(template)) {
|
|
14
|
-
return React.createElement("div",
|
|
12
|
+
return React.createElement("div", { ...delegatedProps, dangerouslySetInnerHTML: { __html: getTemplate(template) } });
|
|
15
13
|
}
|
|
16
14
|
else {
|
|
17
15
|
console.log(`${template} is not found`);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TemplateEngine } from '../../../core/template-engine';
|
|
3
2
|
export const TemplateEngineContext = React.createContext(null);
|
|
4
|
-
const TemplateEngineProvider = ({ templateEngine, children }) => (React.createElement(TemplateEngineContext.Provider, { value: templateEngine
|
|
3
|
+
const TemplateEngineProvider = ({ templateEngine, children }) => (React.createElement(TemplateEngineContext.Provider, { value: templateEngine }, children));
|
|
5
4
|
export default TemplateEngineProvider;
|
|
@@ -9,9 +9,8 @@ const DocumentMap = ({ data }) => {
|
|
|
9
9
|
const htmlRef = React.useRef();
|
|
10
10
|
const [viewModel, setViewModel] = React.useState();
|
|
11
11
|
React.useEffect(() => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
setViewModel((_b = data.model) === null || _b === void 0 ? void 0 : _b.getViewModel());
|
|
12
|
+
htmlRef.current = scrollViewRef.current?.instance().element();
|
|
13
|
+
setViewModel(data.model?.getViewModel());
|
|
15
14
|
}, []);
|
|
16
15
|
useDxMutationObserver(htmlRef, data.keyboardHelper);
|
|
17
16
|
return (React.createElement("div", { className: "dxrd-preview-document-map dxrd-height-100 dxrd-overflow-hidden", hidden: !(data.active && data.visible) },
|