@sutech_jp/raas-react-client 0.0.33 → 0.0.35
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/dist/config/ReportConfig.d.ts +2 -0
- package/dist/config/ReportConfig.js +3 -2
- package/dist/designer/ReportDesigner.d.ts +2 -0
- package/dist/designer/ReportDesigner.js +3 -2
- package/dist/form/ReportPaperForm.d.ts +1 -1
- package/dist/form/ReportPaperForm.js +3 -2
- package/dist/gallery/ReportLayoutGallery.d.ts +2 -0
- package/dist/gallery/ReportLayoutGallery.js +3 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/theme.d.ts +74 -0
- package/dist/types/theme.js +2 -0
- package/package.json +2 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { VFC } from 'react';
|
|
2
2
|
import { Session } from '../types';
|
|
3
|
+
import { ThemeOptions } from '../types/theme';
|
|
3
4
|
declare type ReportConfigProps = {
|
|
4
5
|
session: Session | undefined;
|
|
5
6
|
width?: string | number;
|
|
6
7
|
height?: string | number;
|
|
7
8
|
hideTenantInfoConfig?: boolean;
|
|
8
9
|
toolbarPosition?: 'top' | 'bottom';
|
|
10
|
+
customStyles?: ThemeOptions;
|
|
9
11
|
};
|
|
10
12
|
export declare const ReportConfig: VFC<ReportConfigProps>;
|
|
11
13
|
export {};
|
|
@@ -4,7 +4,7 @@ exports.ReportConfig = void 0;
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var ReportConfig = function (_a) {
|
|
7
|
-
var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, _d = _a.hideTenantInfoConfig, hideTenantInfoConfig = _d === void 0 ? false : _d, _e = _a.toolbarPosition, toolbarPosition = _e === void 0 ? 'bottom' : _e;
|
|
7
|
+
var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, _d = _a.hideTenantInfoConfig, hideTenantInfoConfig = _d === void 0 ? false : _d, _e = _a.toolbarPosition, toolbarPosition = _e === void 0 ? 'bottom' : _e, customStyles = _a.customStyles;
|
|
8
8
|
var iframe = (0, react_1.useRef)(null);
|
|
9
9
|
var handleMessage = (0, react_1.useCallback)(function (e) {
|
|
10
10
|
var _a;
|
|
@@ -24,10 +24,11 @@ var ReportConfig = function (_a) {
|
|
|
24
24
|
props: {
|
|
25
25
|
hideTenantInfoConfig: hideTenantInfoConfig,
|
|
26
26
|
toolbarPosition: toolbarPosition,
|
|
27
|
+
customStyles: customStyles,
|
|
27
28
|
},
|
|
28
29
|
}, '*');
|
|
29
30
|
}
|
|
30
|
-
}, [hideTenantInfoConfig, toolbarPosition]);
|
|
31
|
+
}, [customStyles, hideTenantInfoConfig, toolbarPosition]);
|
|
31
32
|
(0, react_1.useEffect)(function () {
|
|
32
33
|
window.addEventListener('message', handleMessage);
|
|
33
34
|
return function () { return window.removeEventListener('message', handleMessage); };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { VFC } from 'react';
|
|
2
2
|
import { Session } from '../types';
|
|
3
|
+
import { ThemeOptions } from '../types/theme';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
session: Session | undefined;
|
|
5
6
|
data?: Record<string, any>;
|
|
6
7
|
width?: string | number;
|
|
7
8
|
height?: string | number;
|
|
9
|
+
customStyles?: ThemeOptions;
|
|
8
10
|
onBack: () => void;
|
|
9
11
|
};
|
|
10
12
|
export declare const ReportDesigner: VFC<Props>;
|
|
@@ -4,7 +4,7 @@ exports.ReportDesigner = void 0;
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var ReportDesigner = function (_a) {
|
|
7
|
-
var session = _a.session, data = _a.data, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, onBack = _a.onBack;
|
|
7
|
+
var session = _a.session, data = _a.data, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, customStyles = _a.customStyles, onBack = _a.onBack;
|
|
8
8
|
var iframe = (0, react_1.useRef)(null);
|
|
9
9
|
var handleMessage = (0, react_1.useCallback)(function (e) {
|
|
10
10
|
var _a;
|
|
@@ -22,12 +22,13 @@ var ReportDesigner = function (_a) {
|
|
|
22
22
|
from: 'designerClient',
|
|
23
23
|
action: 'onRender',
|
|
24
24
|
data: data,
|
|
25
|
+
customStyles: customStyles,
|
|
25
26
|
}, '*');
|
|
26
27
|
}
|
|
27
28
|
else if (action === 'onBack') {
|
|
28
29
|
onBack();
|
|
29
30
|
}
|
|
30
|
-
}, [data, onBack]);
|
|
31
|
+
}, [customStyles, data, onBack]);
|
|
31
32
|
(0, react_1.useEffect)(function () {
|
|
32
33
|
window.addEventListener('message', handleMessage);
|
|
33
34
|
return function () { return window.removeEventListener('message', handleMessage); };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ReportPaperFormProps } from '../types';
|
|
3
|
-
export declare const ReportPaperForm: <D>({ session, layoutId, data, onDataUpdate, customData, onCustomDataUpdate, onRender, reportOptions, layout, onLayoutUpdate, editability, layoutEditable, version, width, height, }: ReportPaperFormProps<D>) => ReactElement;
|
|
3
|
+
export declare const ReportPaperForm: <D>({ session, layoutId, data, onDataUpdate, customData, onCustomDataUpdate, onRender, reportOptions, layout, onLayoutUpdate, editability, layoutEditable, version, width, height, customStyles, }: ReportPaperFormProps<D>) => ReactElement;
|
|
@@ -31,7 +31,7 @@ exports.ReportPaperForm = void 0;
|
|
|
31
31
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
32
32
|
var react_1 = require("react");
|
|
33
33
|
var ReportPaperForm = function (_a) {
|
|
34
|
-
var session = _a.session, layoutId = _a.layoutId, data = _a.data, onDataUpdate = _a.onDataUpdate, customData = _a.customData, onCustomDataUpdate = _a.onCustomDataUpdate, onRender = _a.onRender, reportOptions = _a.reportOptions, layout = _a.layout, onLayoutUpdate = _a.onLayoutUpdate, _b = _a.editability, editability = _b === void 0 ? 'none' : _b, _c = _a.layoutEditable, layoutEditable = _c === void 0 ? false : _c, version = _a.version, _d = _a.width, width = _d === void 0 ? '100%' : _d, _e = _a.height, height = _e === void 0 ? 0 : _e;
|
|
34
|
+
var session = _a.session, layoutId = _a.layoutId, data = _a.data, onDataUpdate = _a.onDataUpdate, customData = _a.customData, onCustomDataUpdate = _a.onCustomDataUpdate, onRender = _a.onRender, reportOptions = _a.reportOptions, layout = _a.layout, onLayoutUpdate = _a.onLayoutUpdate, _b = _a.editability, editability = _b === void 0 ? 'none' : _b, _c = _a.layoutEditable, layoutEditable = _c === void 0 ? false : _c, version = _a.version, _d = _a.width, width = _d === void 0 ? '100%' : _d, _e = _a.height, height = _e === void 0 ? 0 : _e, customStyles = _a.customStyles;
|
|
35
35
|
var _f = __read((0, react_1.useState)('unauthorized'), 2), formState = _f[0], setFormState = _f[1];
|
|
36
36
|
var _g = __read((0, react_1.useState)(), 2), contentHeight = _g[0], setContentHeight = _g[1];
|
|
37
37
|
var _h = __read((0, react_1.useState)(false), 2), layoutInitialized = _h[0], setLayoutInitialized = _h[1];
|
|
@@ -52,8 +52,9 @@ var ReportPaperForm = function (_a) {
|
|
|
52
52
|
layout: layout,
|
|
53
53
|
editability: editability,
|
|
54
54
|
layoutEditable: layoutEditable,
|
|
55
|
+
customStyles: customStyles,
|
|
55
56
|
}, '*');
|
|
56
|
-
}, [formState, layoutId, editability, layout, layoutEditable, version]);
|
|
57
|
+
}, [formState, layoutId, editability, layout, layoutEditable, version, customStyles]);
|
|
57
58
|
(0, react_1.useEffect)(function () {
|
|
58
59
|
var _a;
|
|
59
60
|
if (formState === 'unauthorized')
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Session } from '../types';
|
|
3
|
+
import { ThemeOptions } from '../types/theme';
|
|
3
4
|
declare type LayoutGalleryProps = {
|
|
4
5
|
session: Session | undefined;
|
|
5
6
|
width?: string | number;
|
|
6
7
|
height?: string | number;
|
|
8
|
+
customStyles?: ThemeOptions;
|
|
7
9
|
onSelectLayout?: (layoutId?: number) => void;
|
|
8
10
|
onEditLayout?: (layoutId: number) => void;
|
|
9
11
|
onCreateLayout?: () => void;
|
|
@@ -4,7 +4,7 @@ exports.ReportLayoutGallery = void 0;
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var ReportLayoutGallery = function (_a) {
|
|
7
|
-
var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, onSelectLayout = _a.onSelectLayout, onEditLayout = _a.onEditLayout, onCreateLayout = _a.onCreateLayout;
|
|
7
|
+
var session = _a.session, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? '100%' : _c, customStyles = _a.customStyles, onSelectLayout = _a.onSelectLayout, onEditLayout = _a.onEditLayout, onCreateLayout = _a.onCreateLayout;
|
|
8
8
|
var iframe = (0, react_1.useRef)(null);
|
|
9
9
|
var handleMessage = (0, react_1.useCallback)(function (e) {
|
|
10
10
|
var _a, _b, _c, _d, _e;
|
|
@@ -33,10 +33,11 @@ var ReportLayoutGallery = function (_a) {
|
|
|
33
33
|
selectable: onSelectLayout !== undefined,
|
|
34
34
|
creatable: onCreateLayout !== undefined,
|
|
35
35
|
editable: onEditLayout !== undefined,
|
|
36
|
+
customStyles: customStyles,
|
|
36
37
|
},
|
|
37
38
|
}, '*');
|
|
38
39
|
}
|
|
39
|
-
}, [onCreateLayout, onEditLayout, onSelectLayout]);
|
|
40
|
+
}, [customStyles, onCreateLayout, onEditLayout, onSelectLayout]);
|
|
40
41
|
(0, react_1.useEffect)(function () {
|
|
41
42
|
window.addEventListener('message', handleMessage);
|
|
42
43
|
return function () { return window.removeEventListener('message', handleMessage); };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ThemeOptions } from './theme';
|
|
1
2
|
export declare type Layout = any;
|
|
2
3
|
export declare type CustomData = any[];
|
|
3
4
|
export declare type ReportOptions = any[];
|
|
@@ -28,6 +29,7 @@ export declare type PaperFormArgs<D> = {
|
|
|
28
29
|
export declare type ReportPaperFormProps<D> = {
|
|
29
30
|
session: Session | undefined;
|
|
30
31
|
layoutId: number;
|
|
32
|
+
customStyles?: ThemeOptions;
|
|
31
33
|
} & PaperFormArgs<D>;
|
|
32
34
|
export declare type Session = {
|
|
33
35
|
application: string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare type ThemeOptions = {
|
|
2
|
+
palette?: PaletteOptions;
|
|
3
|
+
typography?: TypographyVariants;
|
|
4
|
+
};
|
|
5
|
+
export declare type PaletteOptions = {
|
|
6
|
+
primary?: ColorOptions;
|
|
7
|
+
secondary?: ColorOptions;
|
|
8
|
+
info?: ColorOptions;
|
|
9
|
+
success?: ColorOptions;
|
|
10
|
+
warning?: ColorOptions;
|
|
11
|
+
error?: ColorOptions;
|
|
12
|
+
background?: {
|
|
13
|
+
default?: string;
|
|
14
|
+
};
|
|
15
|
+
grey?: Grayscale;
|
|
16
|
+
};
|
|
17
|
+
export declare type ColorOptions = {
|
|
18
|
+
light?: string;
|
|
19
|
+
soft?: string;
|
|
20
|
+
main?: string;
|
|
21
|
+
dark?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare type Grayscale = {
|
|
24
|
+
'50'?: string;
|
|
25
|
+
'100'?: string;
|
|
26
|
+
'200'?: string;
|
|
27
|
+
'300'?: string;
|
|
28
|
+
'400'?: string;
|
|
29
|
+
'500'?: string;
|
|
30
|
+
'600'?: string;
|
|
31
|
+
'700'?: string;
|
|
32
|
+
'800'?: string;
|
|
33
|
+
'900'?: string;
|
|
34
|
+
A100?: string;
|
|
35
|
+
A200?: string;
|
|
36
|
+
A400?: string;
|
|
37
|
+
A700?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare type TypographyVariants = {
|
|
40
|
+
pageTitle?: TypographyOptions;
|
|
41
|
+
dialogTitle?: TypographyOptions;
|
|
42
|
+
subheadM?: TypographyOptions;
|
|
43
|
+
subheadL?: TypographyOptions;
|
|
44
|
+
textNormal?: TypographyOptions;
|
|
45
|
+
textStrong?: TypographyOptions;
|
|
46
|
+
textSupplement?: TypographyOptions;
|
|
47
|
+
textHint?: TypographyOptions;
|
|
48
|
+
labelNormal?: TypographyOptions;
|
|
49
|
+
labelError?: TypographyOptions;
|
|
50
|
+
labelSmall?: TypographyOptions;
|
|
51
|
+
labelSmallActive?: TypographyOptions;
|
|
52
|
+
labelSmallError?: TypographyOptions;
|
|
53
|
+
textPrimary?: TypographyOptions;
|
|
54
|
+
textStrongPrimary?: TypographyOptions;
|
|
55
|
+
textError?: TypographyOptions;
|
|
56
|
+
textStrongError?: TypographyOptions;
|
|
57
|
+
textWarning?: TypographyOptions;
|
|
58
|
+
textStrongWarning?: TypographyOptions;
|
|
59
|
+
textSuccess?: TypographyOptions;
|
|
60
|
+
textStrongSuccess?: TypographyOptions;
|
|
61
|
+
textWhite?: TypographyOptions;
|
|
62
|
+
groupHeader?: TypographyOptions;
|
|
63
|
+
caption?: TypographyOptions;
|
|
64
|
+
subtextNormal?: TypographyOptions;
|
|
65
|
+
subtextWhite?: TypographyOptions;
|
|
66
|
+
toggleNormal?: TypographyOptions;
|
|
67
|
+
togglePrimary?: TypographyOptions;
|
|
68
|
+
};
|
|
69
|
+
export declare type TypographyOptions = {
|
|
70
|
+
fontSize?: string;
|
|
71
|
+
fontWeight?: number | string;
|
|
72
|
+
lineHeight?: number | string;
|
|
73
|
+
color?: string;
|
|
74
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sutech_jp/raas-react-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "react client for raas produced by SuTech",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"pre-commit": "npm run precommit"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
+
"dependencies": {},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@testing-library/dom": "^8.11.1",
|
|
29
30
|
"@testing-library/jest-dom": "^5.15.1",
|