@reltio/components 1.4.1711 → 1.4.1713
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/cjs/components/ReltioGridLayout/ReltioGridLayout.d.ts +2 -1
- package/cjs/components/ReltioGridLayout/ReltioGridLayout.js +5 -5
- package/cjs/components/workflow/components/TaskActionButtons/TaskActionButtons.js +1 -1
- package/cjs/components/workflow/components/WorkflowComments/CollapsedComments.d.ts +8 -16
- package/cjs/components/workflow/components/WorkflowComments/CollapsedComments.js +0 -10
- package/cjs/components/workflow/components/WorkflowComments/Comment.d.ts +9 -20
- package/cjs/components/workflow/components/WorkflowComments/Comment.js +3 -14
- package/cjs/components/workflow/components/WorkflowComments/ExpandedComments.d.ts +7 -14
- package/cjs/components/workflow/components/WorkflowComments/ExpandedComments.js +2 -11
- package/cjs/components/workflow/components/WorkflowComments/WorkflowComments.d.ts +1 -1
- package/cjs/components/workflow/components/WorkflowComments/WorkflowComments.js +21 -28
- package/cjs/components/workflow/components/WorkflowComments/index.d.ts +1 -1
- package/esm/components/ReltioGridLayout/ReltioGridLayout.d.ts +2 -1
- package/esm/components/ReltioGridLayout/ReltioGridLayout.js +5 -5
- package/esm/components/workflow/components/TaskActionButtons/TaskActionButtons.js +1 -1
- package/esm/components/workflow/components/WorkflowComments/CollapsedComments.d.ts +8 -16
- package/esm/components/workflow/components/WorkflowComments/CollapsedComments.js +0 -10
- package/esm/components/workflow/components/WorkflowComments/Comment.d.ts +9 -20
- package/esm/components/workflow/components/WorkflowComments/Comment.js +3 -14
- package/esm/components/workflow/components/WorkflowComments/ExpandedComments.d.ts +7 -14
- package/esm/components/workflow/components/WorkflowComments/ExpandedComments.js +2 -11
- package/esm/components/workflow/components/WorkflowComments/WorkflowComments.d.ts +1 -1
- package/esm/components/workflow/components/WorkflowComments/WorkflowComments.js +21 -28
- package/esm/components/workflow/components/WorkflowComments/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -17,9 +17,10 @@ type Props<ViewConfig = Record<string, unknown>> = {
|
|
|
17
17
|
root?: string;
|
|
18
18
|
item?: string;
|
|
19
19
|
};
|
|
20
|
+
onResize?: (layout: ReactGridLayoutItem[], oldLayoutItem: ReactGridLayoutItem, layoutItem: ReactGridLayoutItem, placeholder: ReactGridLayoutItem) => void;
|
|
20
21
|
};
|
|
21
22
|
declare const _default: React.MemoExoticComponent<{
|
|
22
|
-
({ views, layout, layoutOptions, onLayoutChanged, draggableHandle, LayoutItem, onRemove, onDrop, droppingItem, isDroppable, isStatic, classes }: Props<Record<string, unknown>>): JSX.Element;
|
|
23
|
+
({ views, layout, layoutOptions, onLayoutChanged, draggableHandle, LayoutItem, onRemove, onDrop, droppingItem, isDroppable, isStatic, classes, onResize }: Props<Record<string, unknown>>): JSX.Element;
|
|
23
24
|
displayName: string;
|
|
24
25
|
}>;
|
|
25
26
|
export default _default;
|
|
@@ -52,13 +52,13 @@ var DEFAULT_LAYOUT_OPTIONS = {
|
|
|
52
52
|
};
|
|
53
53
|
var ReltioGridLayout = function (_a) {
|
|
54
54
|
var _b;
|
|
55
|
-
var views = _a.views, layout = _a.layout, _c = _a.layoutOptions, layoutOptions = _c === void 0 ? DEFAULT_LAYOUT_OPTIONS : _c, _d = _a.onLayoutChanged, onLayoutChanged = _d === void 0 ? core_1.noop : _d, draggableHandle = _a.draggableHandle, LayoutItem = _a.LayoutItem, onRemove = _a.onRemove, onDrop = _a.onDrop, droppingItem = _a.droppingItem, isDroppable = _a.isDroppable, isStatic = _a.isStatic, classes = _a.classes;
|
|
55
|
+
var views = _a.views, layout = _a.layout, _c = _a.layoutOptions, layoutOptions = _c === void 0 ? DEFAULT_LAYOUT_OPTIONS : _c, _d = _a.onLayoutChanged, onLayoutChanged = _d === void 0 ? core_1.noop : _d, draggableHandle = _a.draggableHandle, LayoutItem = _a.LayoutItem, onRemove = _a.onRemove, onDrop = _a.onDrop, droppingItem = _a.droppingItem, isDroppable = _a.isDroppable, isStatic = _a.isStatic, classes = _a.classes, _e = _a.onResize, onResize = _e === void 0 ? core_1.noop : _e;
|
|
56
56
|
var ref = (0, react_1.useRef)();
|
|
57
57
|
var heightsMap = (0, react_1.useRef)({});
|
|
58
58
|
var styles = (0, styles_1.useStyles)();
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
59
|
+
var _f = (0, react_1.useState)(null), resizingItemId = _f[0], setResizingItemId = _f[1];
|
|
60
|
+
var _g = (0, react_1.useState)(null), fullscreenItemId = _g[0], setFullscreenItemId = _g[1];
|
|
61
|
+
var _h = (0, react_1.useState)(0), width = _h[0], setWidth = _h[1];
|
|
62
62
|
var cols = layoutOptions.cols, rowHeight = layoutOptions.rowHeight, margin = layoutOptions.margin;
|
|
63
63
|
var processedLayout = (0, react_1.useMemo)(function () { return (0, helpers_1.reltioLayoutToReactGridLayout)(layout); }, [layout]);
|
|
64
64
|
var onReltioLayoutChanged = (0, ramda_1.pipe)(helpers_1.reactGridLayoutToReltioLayout, (0, helpers_1.copyPropsFromPreviousLayout)(['autosizing'], layout), (0, ramda_1.ifElse)((0, ramda_1.always)(isStatic), (0, helpers_1.alignGroupedItemsHeights)(heightsMap.current), (0, helpers_1.calcLayoutItemsHeight)(heightsMap.current)), onLayoutChanged);
|
|
@@ -82,7 +82,7 @@ var ReltioGridLayout = function (_a) {
|
|
|
82
82
|
react_1.default.createElement(react_resize_detector_1.default, { refreshMode: "debounce", refreshRate: 50, handleWidth: true, onResize: function (width) { return setWidth(width); } }),
|
|
83
83
|
!!width && (react_1.default.createElement(react_grid_layout_1.default, { innerRef: ref, layout: processedLayout, cols: cols, draggableHandle: draggableHandle, autoSize: true, rowHeight: rowHeight, width: width, margin: margin, onLayoutChange: isStatic ? undefined : onReltioLayoutChanged, isResizable: !isStatic && !isFullscreenEnabled, isDraggable: !isStatic && !isFullscreenEnabled, className: (0, classnames_1.default)(classes === null || classes === void 0 ? void 0 : classes.root, styles.gridLayout, (_b = {},
|
|
84
84
|
_b[styles.gridFullscreen] = isFullscreenEnabled,
|
|
85
|
-
_b)), onDrop: handleDrop, droppingItem: droppingItem, isDroppable: !isStatic && isDroppable, onResizeStart: function (_, layoutItem) { return setResizingItemId(layoutItem.i); }, onResizeStop: function () { return setResizingItemId(null); }, "data-reltio-id": "reltio-grid-layout" }, processedLayout.map(function (layoutItem) {
|
|
85
|
+
_b)), onDrop: handleDrop, droppingItem: droppingItem, isDroppable: !isStatic && isDroppable, onResizeStart: function (_, layoutItem) { return setResizingItemId(layoutItem.i); }, onResizeStop: function () { return setResizingItemId(null); }, onResize: onResize, "data-reltio-id": "reltio-grid-layout" }, processedLayout.map(function (layoutItem) {
|
|
86
86
|
var _a;
|
|
87
87
|
var isItemFullscreen = fullscreenItemId === layoutItem.i;
|
|
88
88
|
var isResizing = resizingItemId === layoutItem.i;
|
|
@@ -17,7 +17,7 @@ var TaskActionButtons = function (_a) {
|
|
|
17
17
|
assignee: assignee,
|
|
18
18
|
isOpen: isOpen
|
|
19
19
|
}), actions = _b.actions, disabled = _b.actionRequestIsInProgress;
|
|
20
|
-
var _c = (0, ramda_1.partition)((0, ramda_1.propEq)('text', preferredAction.label), actions), preferredActions = _c[0], otherActions = _c[1];
|
|
20
|
+
var _c = (0, ramda_1.partition)((0, ramda_1.propEq)('text', preferredAction === null || preferredAction === void 0 ? void 0 : preferredAction.label), actions), preferredActions = _c[0], otherActions = _c[1];
|
|
21
21
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
22
22
|
otherActions.map(function (action) { return (react_1.default.createElement(Button_1.default, { variant: "outlined", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); }),
|
|
23
23
|
preferredActions.map(function (action) { return (react_1.default.createElement(Button_1.default, { variant: "contained", color: "primary", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); })));
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
id: PropTypes.Requireable<string>;
|
|
10
|
-
message: PropTypes.Requireable<string>;
|
|
11
|
-
time: PropTypes.Requireable<number>;
|
|
12
|
-
}>[]>;
|
|
13
|
-
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WorkflowComment } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
comments: WorkflowComment[];
|
|
5
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const CollapsedComments: ({ comments, onClick }: Props) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -16,7 +16,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.CollapsedComments = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
20
19
|
var IconButton_1 = __importDefault(require("@mui/material/IconButton"));
|
|
21
20
|
var Comment_1 = require("./Comment");
|
|
22
21
|
var styles_1 = require("./styles");
|
|
@@ -30,12 +29,3 @@ var CollapsedComments = function (_a) {
|
|
|
30
29
|
react_1.default.createElement(Comment_1.Comment, __assign({}, comments[comments.length - 1]))));
|
|
31
30
|
};
|
|
32
31
|
exports.CollapsedComments = CollapsedComments;
|
|
33
|
-
exports.CollapsedComments.propTypes = {
|
|
34
|
-
comments: prop_types_1.default.arrayOf(prop_types_1.default.shape({
|
|
35
|
-
author: prop_types_1.default.string,
|
|
36
|
-
id: prop_types_1.default.string,
|
|
37
|
-
message: prop_types_1.default.string,
|
|
38
|
-
time: prop_types_1.default.number
|
|
39
|
-
})),
|
|
40
|
-
onClick: prop_types_1.default.func
|
|
41
|
-
};
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
namespace propTypes {
|
|
12
|
-
const classes_1: PropTypes.Requireable<object>;
|
|
13
|
-
export { classes_1 as classes };
|
|
14
|
-
export const author: PropTypes.Requireable<string>;
|
|
15
|
-
export const id: PropTypes.Requireable<string>;
|
|
16
|
-
export const message: PropTypes.Requireable<string>;
|
|
17
|
-
export const time: PropTypes.Requireable<number>;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WorkflowComment } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = Pick<WorkflowComment, 'author' | 'message' | 'time'> & {
|
|
4
|
+
classes?: {
|
|
5
|
+
messageContainer?: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const Comment: ({ author, message, time, classes }: Props) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -5,14 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Comment = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
|
-
var Avatar_1 = __importDefault(require("@mui/material/Avatar"));
|
|
10
|
-
var Person_1 = __importDefault(require("@mui/icons-material/Person"));
|
|
11
8
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
12
9
|
var classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
var Avatar_1 = __importDefault(require("@mui/material/Avatar"));
|
|
11
|
+
var Person_1 = __importDefault(require("@mui/icons-material/Person"));
|
|
13
12
|
var styles_1 = require("./styles");
|
|
14
13
|
var Comment = function (_a) {
|
|
15
|
-
var author = _a.author,
|
|
14
|
+
var author = _a.author, message = _a.message, time = _a.time, _b = _a.classes, classes = _b === void 0 ? {} : _b;
|
|
16
15
|
var styles = (0, styles_1.useCommentStyles)();
|
|
17
16
|
return (react_1.default.createElement("div", { className: styles.comment },
|
|
18
17
|
react_1.default.createElement(Avatar_1.default, { className: styles.avatar },
|
|
@@ -24,13 +23,3 @@ var Comment = function (_a) {
|
|
|
24
23
|
react_1.default.createElement("div", { className: styles.text }, message))));
|
|
25
24
|
};
|
|
26
25
|
exports.Comment = Comment;
|
|
27
|
-
exports.Comment.defaultProps = {
|
|
28
|
-
classes: {}
|
|
29
|
-
};
|
|
30
|
-
exports.Comment.propTypes = {
|
|
31
|
-
classes: prop_types_1.default.object,
|
|
32
|
-
author: prop_types_1.default.string,
|
|
33
|
-
id: prop_types_1.default.string,
|
|
34
|
-
message: prop_types_1.default.string,
|
|
35
|
-
time: prop_types_1.default.number
|
|
36
|
-
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
id: PropTypes.Requireable<string>;
|
|
9
|
-
message: PropTypes.Requireable<string>;
|
|
10
|
-
time: PropTypes.Requireable<number>;
|
|
11
|
-
}>[]>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WorkflowComment } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
comments: WorkflowComment[];
|
|
5
|
+
};
|
|
6
|
+
export declare const ExpandedComments: ({ comments }: Props) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -5,23 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ExpandedComments = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
8
|
var Comment_1 = require("./Comment");
|
|
10
9
|
var styles_1 = require("./styles");
|
|
11
10
|
var ExpandedComments = function (_a) {
|
|
12
11
|
var comments = _a.comments;
|
|
13
12
|
var styles = (0, styles_1.useExpandedComments)();
|
|
14
|
-
return comments.map(function (_a) {
|
|
13
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, comments.map(function (_a) {
|
|
15
14
|
var author = _a.author, id = _a.id, message = _a.message, time = _a.time;
|
|
16
15
|
return (react_1.default.createElement(Comment_1.Comment, { classes: { messageContainer: styles.messageContainer }, key: id, author: author, message: message, time: time }));
|
|
17
|
-
});
|
|
16
|
+
})));
|
|
18
17
|
};
|
|
19
18
|
exports.ExpandedComments = ExpandedComments;
|
|
20
|
-
exports.ExpandedComments.propTypes = {
|
|
21
|
-
comments: prop_types_1.default.arrayOf(prop_types_1.default.shape({
|
|
22
|
-
author: prop_types_1.default.string,
|
|
23
|
-
id: prop_types_1.default.string,
|
|
24
|
-
message: prop_types_1.default.string,
|
|
25
|
-
time: prop_types_1.default.number
|
|
26
|
-
}))
|
|
27
|
-
};
|
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
processInstanceComments: WorkflowComment[];
|
|
8
8
|
taskId: string;
|
|
9
9
|
isTaskOpen: boolean;
|
|
10
|
-
preferredAction
|
|
10
|
+
preferredAction?: WorkflowAction;
|
|
11
11
|
};
|
|
12
12
|
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction }: Props) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -22,22 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
27
|
-
if (ar || !(i in from)) {
|
|
28
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
29
|
-
ar[i] = from[i];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
|
-
};
|
|
34
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
27
|
};
|
|
37
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
29
|
exports.WorkflowComments = void 0;
|
|
39
30
|
var react_1 = __importStar(require("react"));
|
|
40
|
-
var ramda_1 = require("ramda");
|
|
41
31
|
var Input_1 = __importDefault(require("@mui/material/Input"));
|
|
42
32
|
var InputAdornment_1 = __importDefault(require("@mui/material/InputAdornment"));
|
|
43
33
|
var Send_1 = __importDefault(require("@mui/icons-material/Send"));
|
|
@@ -49,13 +39,12 @@ var styles_1 = require("./styles");
|
|
|
49
39
|
var useWorkflowComments_1 = require("../../hooks/useWorkflowComments");
|
|
50
40
|
var SmallIconButton_1 = require("../../../SmallIconButton");
|
|
51
41
|
var ModeSwitcherSelect_1 = require("../../../ModeSwitcherSelect/ModeSwitcherSelect");
|
|
52
|
-
var getValue = function (e) { return e.target.value; };
|
|
53
42
|
var WorkflowComments = function (_a) {
|
|
54
43
|
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction;
|
|
55
44
|
var styles = (0, styles_1.useWorkflowStyles)();
|
|
56
45
|
var _b = (0, react_1.useState)(false), expanded = _b[0], setExpanded = _b[1];
|
|
57
46
|
var _c = (0, react_1.useState)(''), comment = _c[0], setComment = _c[1];
|
|
58
|
-
var _d = (0, react_1.useState)(preferredAction.label), currentAction = _d[0], setCurrentAction = _d[1];
|
|
47
|
+
var _d = (0, react_1.useState)(function () { var _a; return (preferredAction === null || preferredAction === void 0 ? void 0 : preferredAction.label) || ((_a = actions[0]) === null || _a === void 0 ? void 0 : _a.text); }), currentAction = _d[0], setCurrentAction = _d[1];
|
|
59
48
|
var _e = (0, useWorkflowComments_1.useWorkflowComments)({
|
|
60
49
|
processInstanceComments: processInstanceComments,
|
|
61
50
|
taskId: taskId,
|
|
@@ -65,8 +54,10 @@ var WorkflowComments = function (_a) {
|
|
|
65
54
|
writeComment(comment);
|
|
66
55
|
setComment('');
|
|
67
56
|
}, [comment, writeComment]);
|
|
68
|
-
var
|
|
69
|
-
|
|
57
|
+
var handleChange = (0, react_1.useCallback)(function (event) {
|
|
58
|
+
setComment(event.target.value);
|
|
59
|
+
}, []);
|
|
60
|
+
var handleKeyPress = (0, react_1.useCallback)(function (e) {
|
|
70
61
|
if (e.key === 'Enter') {
|
|
71
62
|
if (comment.length > 0 && !e.shiftKey) {
|
|
72
63
|
e.preventDefault();
|
|
@@ -77,18 +68,20 @@ var WorkflowComments = function (_a) {
|
|
|
77
68
|
}
|
|
78
69
|
e.preventDefault();
|
|
79
70
|
}
|
|
80
|
-
};
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
}, [comment, sendComment]);
|
|
72
|
+
var buttonsGroup = (0, react_1.useMemo)(function () {
|
|
73
|
+
return actions.map(function (_a) {
|
|
74
|
+
var text = _a.text, onClick = _a.onClick;
|
|
75
|
+
return ({
|
|
76
|
+
label: text,
|
|
77
|
+
onClick: function () {
|
|
78
|
+
setCurrentAction(text);
|
|
79
|
+
onClick(comment);
|
|
80
|
+
},
|
|
81
|
+
value: text
|
|
82
|
+
});
|
|
90
83
|
});
|
|
91
|
-
}
|
|
84
|
+
}, [actions, comment]);
|
|
92
85
|
return (react_1.default.createElement("div", { className: styles.container },
|
|
93
86
|
react_1.default.createElement("div", { className: styles.title },
|
|
94
87
|
" ",
|
|
@@ -96,9 +89,9 @@ var WorkflowComments = function (_a) {
|
|
|
96
89
|
" "),
|
|
97
90
|
react_1.default.createElement("div", { className: styles.commentsContainer }, expanded || comments.length < 3 ? (react_1.default.createElement(ExpandedComments_1.ExpandedComments, { comments: comments })) : (react_1.default.createElement(CollapsedComments_1.CollapsedComments, { onClick: function () { return setExpanded(true); }, comments: comments }))),
|
|
98
91
|
!readOnly && (react_1.default.createElement(Input_1.default, { endAdornment: react_1.default.createElement(InputAdornment_1.default, { position: "end", className: styles.sendButton },
|
|
99
|
-
react_1.default.createElement(SmallIconButton_1.SmallIconButton, { icon: Send_1.default, disabled: comment.length === 0, onClick: sendComment, "data-reltio-id": "send-button" })), classes: { root: styles.filledInputRoot }, placeholder: ui_i18n_1.default.text('Write a comment'), value: comment, onKeyPress:
|
|
92
|
+
react_1.default.createElement(SmallIconButton_1.SmallIconButton, { icon: Send_1.default, disabled: comment.length === 0, onClick: sendComment, "data-reltio-id": "send-button" })), classes: { root: styles.filledInputRoot }, placeholder: ui_i18n_1.default.text('Write a comment'), value: comment, onKeyPress: handleKeyPress, onChange: handleChange, disableUnderline: true, multiline: true })),
|
|
100
93
|
react_1.default.createElement("div", { className: styles.modeSwitcherWrapper },
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
buttonsGroup.length === 1 && (react_1.default.createElement(Button_1.default, { variant: "outlined", onClick: buttonsGroup[0].onClick, disabled: actionRequestIsInProgress }, buttonsGroup[0].label)),
|
|
95
|
+
buttonsGroup.length > 1 && (react_1.default.createElement(ModeSwitcherSelect_1.ModeSwitcherSelect, { buttonsGroup: buttonsGroup, value: currentAction, disabled: actionRequestIsInProgress })))));
|
|
103
96
|
};
|
|
104
97
|
exports.WorkflowComments = WorkflowComments;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WorkflowComments as default } from
|
|
1
|
+
export { WorkflowComments as default } from './WorkflowComments';
|
|
@@ -17,9 +17,10 @@ type Props<ViewConfig = Record<string, unknown>> = {
|
|
|
17
17
|
root?: string;
|
|
18
18
|
item?: string;
|
|
19
19
|
};
|
|
20
|
+
onResize?: (layout: ReactGridLayoutItem[], oldLayoutItem: ReactGridLayoutItem, layoutItem: ReactGridLayoutItem, placeholder: ReactGridLayoutItem) => void;
|
|
20
21
|
};
|
|
21
22
|
declare const _default: React.MemoExoticComponent<{
|
|
22
|
-
({ views, layout, layoutOptions, onLayoutChanged, draggableHandle, LayoutItem, onRemove, onDrop, droppingItem, isDroppable, isStatic, classes }: Props<Record<string, unknown>>): JSX.Element;
|
|
23
|
+
({ views, layout, layoutOptions, onLayoutChanged, draggableHandle, LayoutItem, onRemove, onDrop, droppingItem, isDroppable, isStatic, classes, onResize }: Props<Record<string, unknown>>): JSX.Element;
|
|
23
24
|
displayName: string;
|
|
24
25
|
}>;
|
|
25
26
|
export default _default;
|
|
@@ -24,13 +24,13 @@ var DEFAULT_LAYOUT_OPTIONS = {
|
|
|
24
24
|
};
|
|
25
25
|
var ReltioGridLayout = function (_a) {
|
|
26
26
|
var _b;
|
|
27
|
-
var views = _a.views, layout = _a.layout, _c = _a.layoutOptions, layoutOptions = _c === void 0 ? DEFAULT_LAYOUT_OPTIONS : _c, _d = _a.onLayoutChanged, onLayoutChanged = _d === void 0 ? noop : _d, draggableHandle = _a.draggableHandle, LayoutItem = _a.LayoutItem, onRemove = _a.onRemove, onDrop = _a.onDrop, droppingItem = _a.droppingItem, isDroppable = _a.isDroppable, isStatic = _a.isStatic, classes = _a.classes;
|
|
27
|
+
var views = _a.views, layout = _a.layout, _c = _a.layoutOptions, layoutOptions = _c === void 0 ? DEFAULT_LAYOUT_OPTIONS : _c, _d = _a.onLayoutChanged, onLayoutChanged = _d === void 0 ? noop : _d, draggableHandle = _a.draggableHandle, LayoutItem = _a.LayoutItem, onRemove = _a.onRemove, onDrop = _a.onDrop, droppingItem = _a.droppingItem, isDroppable = _a.isDroppable, isStatic = _a.isStatic, classes = _a.classes, _e = _a.onResize, onResize = _e === void 0 ? noop : _e;
|
|
28
28
|
var ref = useRef();
|
|
29
29
|
var heightsMap = useRef({});
|
|
30
30
|
var styles = useStyles();
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
31
|
+
var _f = useState(null), resizingItemId = _f[0], setResizingItemId = _f[1];
|
|
32
|
+
var _g = useState(null), fullscreenItemId = _g[0], setFullscreenItemId = _g[1];
|
|
33
|
+
var _h = useState(0), width = _h[0], setWidth = _h[1];
|
|
34
34
|
var cols = layoutOptions.cols, rowHeight = layoutOptions.rowHeight, margin = layoutOptions.margin;
|
|
35
35
|
var processedLayout = useMemo(function () { return reltioLayoutToReactGridLayout(layout); }, [layout]);
|
|
36
36
|
var onReltioLayoutChanged = pipe(reactGridLayoutToReltioLayout, copyPropsFromPreviousLayout(['autosizing'], layout), ifElse(always(isStatic), alignGroupedItemsHeights(heightsMap.current), calcLayoutItemsHeight(heightsMap.current)), onLayoutChanged);
|
|
@@ -54,7 +54,7 @@ var ReltioGridLayout = function (_a) {
|
|
|
54
54
|
React.createElement(ReactResizeDetector, { refreshMode: "debounce", refreshRate: 50, handleWidth: true, onResize: function (width) { return setWidth(width); } }),
|
|
55
55
|
!!width && (React.createElement(GridLayout, { innerRef: ref, layout: processedLayout, cols: cols, draggableHandle: draggableHandle, autoSize: true, rowHeight: rowHeight, width: width, margin: margin, onLayoutChange: isStatic ? undefined : onReltioLayoutChanged, isResizable: !isStatic && !isFullscreenEnabled, isDraggable: !isStatic && !isFullscreenEnabled, className: classnames(classes === null || classes === void 0 ? void 0 : classes.root, styles.gridLayout, (_b = {},
|
|
56
56
|
_b[styles.gridFullscreen] = isFullscreenEnabled,
|
|
57
|
-
_b)), onDrop: handleDrop, droppingItem: droppingItem, isDroppable: !isStatic && isDroppable, onResizeStart: function (_, layoutItem) { return setResizingItemId(layoutItem.i); }, onResizeStop: function () { return setResizingItemId(null); }, "data-reltio-id": "reltio-grid-layout" }, processedLayout.map(function (layoutItem) {
|
|
57
|
+
_b)), onDrop: handleDrop, droppingItem: droppingItem, isDroppable: !isStatic && isDroppable, onResizeStart: function (_, layoutItem) { return setResizingItemId(layoutItem.i); }, onResizeStop: function () { return setResizingItemId(null); }, onResize: onResize, "data-reltio-id": "reltio-grid-layout" }, processedLayout.map(function (layoutItem) {
|
|
58
58
|
var _a;
|
|
59
59
|
var isItemFullscreen = fullscreenItemId === layoutItem.i;
|
|
60
60
|
var isResizing = resizingItemId === layoutItem.i;
|
|
@@ -11,7 +11,7 @@ export var TaskActionButtons = function (_a) {
|
|
|
11
11
|
assignee: assignee,
|
|
12
12
|
isOpen: isOpen
|
|
13
13
|
}), actions = _b.actions, disabled = _b.actionRequestIsInProgress;
|
|
14
|
-
var _c = partition(propEq('text', preferredAction.label), actions), preferredActions = _c[0], otherActions = _c[1];
|
|
14
|
+
var _c = partition(propEq('text', preferredAction === null || preferredAction === void 0 ? void 0 : preferredAction.label), actions), preferredActions = _c[0], otherActions = _c[1];
|
|
15
15
|
return (React.createElement(React.Fragment, null,
|
|
16
16
|
otherActions.map(function (action) { return (React.createElement(Button, { variant: "outlined", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); }),
|
|
17
17
|
preferredActions.map(function (action) { return (React.createElement(Button, { variant: "contained", color: "primary", onClick: action.onClick, key: action.text, disabled: disabled }, action.text)); })));
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
id: PropTypes.Requireable<string>;
|
|
10
|
-
message: PropTypes.Requireable<string>;
|
|
11
|
-
time: PropTypes.Requireable<number>;
|
|
12
|
-
}>[]>;
|
|
13
|
-
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WorkflowComment } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
comments: WorkflowComment[];
|
|
5
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const CollapsedComments: ({ comments, onClick }: Props) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import IconButton from '@mui/material/IconButton';
|
|
15
14
|
import { Comment } from './Comment';
|
|
16
15
|
import { useCollapsedCommentsStyles } from './styles';
|
|
@@ -23,12 +22,3 @@ export var CollapsedComments = function (_a) {
|
|
|
23
22
|
React.createElement(IconButton, { className: styles.circleButton, onClick: onClick, size: "large" }, comments.length - 2)),
|
|
24
23
|
React.createElement(Comment, __assign({}, comments[comments.length - 1]))));
|
|
25
24
|
};
|
|
26
|
-
CollapsedComments.propTypes = {
|
|
27
|
-
comments: PropTypes.arrayOf(PropTypes.shape({
|
|
28
|
-
author: PropTypes.string,
|
|
29
|
-
id: PropTypes.string,
|
|
30
|
-
message: PropTypes.string,
|
|
31
|
-
time: PropTypes.number
|
|
32
|
-
})),
|
|
33
|
-
onClick: PropTypes.func
|
|
34
|
-
};
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
namespace propTypes {
|
|
12
|
-
const classes_1: PropTypes.Requireable<object>;
|
|
13
|
-
export { classes_1 as classes };
|
|
14
|
-
export const author: PropTypes.Requireable<string>;
|
|
15
|
-
export const id: PropTypes.Requireable<string>;
|
|
16
|
-
export const message: PropTypes.Requireable<string>;
|
|
17
|
-
export const time: PropTypes.Requireable<number>;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WorkflowComment } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = Pick<WorkflowComment, 'author' | 'message' | 'time'> & {
|
|
4
|
+
classes?: {
|
|
5
|
+
messageContainer?: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const Comment: ({ author, message, time, classes }: Props) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Avatar from '@mui/material/Avatar';
|
|
4
|
-
import Person from '@mui/icons-material/Person';
|
|
5
2
|
import i18n from 'ui-i18n';
|
|
6
3
|
import classnames from 'classnames';
|
|
4
|
+
import Avatar from '@mui/material/Avatar';
|
|
5
|
+
import Person from '@mui/icons-material/Person';
|
|
7
6
|
import { useCommentStyles } from './styles';
|
|
8
7
|
export var Comment = function (_a) {
|
|
9
|
-
var author = _a.author,
|
|
8
|
+
var author = _a.author, message = _a.message, time = _a.time, _b = _a.classes, classes = _b === void 0 ? {} : _b;
|
|
10
9
|
var styles = useCommentStyles();
|
|
11
10
|
return (React.createElement("div", { className: styles.comment },
|
|
12
11
|
React.createElement(Avatar, { className: styles.avatar },
|
|
@@ -17,13 +16,3 @@ export var Comment = function (_a) {
|
|
|
17
16
|
React.createElement("span", { className: styles.date }, i18n.date(time, 'L LT'))),
|
|
18
17
|
React.createElement("div", { className: styles.text }, message))));
|
|
19
18
|
};
|
|
20
|
-
Comment.defaultProps = {
|
|
21
|
-
classes: {}
|
|
22
|
-
};
|
|
23
|
-
Comment.propTypes = {
|
|
24
|
-
classes: PropTypes.object,
|
|
25
|
-
author: PropTypes.string,
|
|
26
|
-
id: PropTypes.string,
|
|
27
|
-
message: PropTypes.string,
|
|
28
|
-
time: PropTypes.number
|
|
29
|
-
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
id: PropTypes.Requireable<string>;
|
|
9
|
-
message: PropTypes.Requireable<string>;
|
|
10
|
-
time: PropTypes.Requireable<number>;
|
|
11
|
-
}>[]>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WorkflowComment } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
comments: WorkflowComment[];
|
|
5
|
+
};
|
|
6
|
+
export declare const ExpandedComments: ({ comments }: Props) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { Comment } from './Comment';
|
|
4
3
|
import { useExpandedComments } from './styles';
|
|
5
4
|
export var ExpandedComments = function (_a) {
|
|
6
5
|
var comments = _a.comments;
|
|
7
6
|
var styles = useExpandedComments();
|
|
8
|
-
return comments.map(function (_a) {
|
|
7
|
+
return (React.createElement(React.Fragment, null, comments.map(function (_a) {
|
|
9
8
|
var author = _a.author, id = _a.id, message = _a.message, time = _a.time;
|
|
10
9
|
return (React.createElement(Comment, { classes: { messageContainer: styles.messageContainer }, key: id, author: author, message: message, time: time }));
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
ExpandedComments.propTypes = {
|
|
14
|
-
comments: PropTypes.arrayOf(PropTypes.shape({
|
|
15
|
-
author: PropTypes.string,
|
|
16
|
-
id: PropTypes.string,
|
|
17
|
-
message: PropTypes.string,
|
|
18
|
-
time: PropTypes.number
|
|
19
|
-
}))
|
|
10
|
+
})));
|
|
20
11
|
};
|
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
processInstanceComments: WorkflowComment[];
|
|
8
8
|
taskId: string;
|
|
9
9
|
isTaskOpen: boolean;
|
|
10
|
-
preferredAction
|
|
10
|
+
preferredAction?: WorkflowAction;
|
|
11
11
|
};
|
|
12
12
|
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction }: Props) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
1
|
import React, { useCallback, useState, useMemo } from 'react';
|
|
11
|
-
import { pipe } from 'ramda';
|
|
12
2
|
import Input from '@mui/material/Input';
|
|
13
3
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
14
4
|
import SendIcon from '@mui/icons-material/Send';
|
|
@@ -20,13 +10,12 @@ import { useWorkflowStyles } from './styles';
|
|
|
20
10
|
import { useWorkflowComments } from '../../hooks/useWorkflowComments';
|
|
21
11
|
import { SmallIconButton } from '../../../SmallIconButton';
|
|
22
12
|
import { ModeSwitcherSelect } from '../../../ModeSwitcherSelect/ModeSwitcherSelect';
|
|
23
|
-
var getValue = function (e) { return e.target.value; };
|
|
24
13
|
export var WorkflowComments = function (_a) {
|
|
25
14
|
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction;
|
|
26
15
|
var styles = useWorkflowStyles();
|
|
27
16
|
var _b = useState(false), expanded = _b[0], setExpanded = _b[1];
|
|
28
17
|
var _c = useState(''), comment = _c[0], setComment = _c[1];
|
|
29
|
-
var _d = useState(preferredAction.label), currentAction = _d[0], setCurrentAction = _d[1];
|
|
18
|
+
var _d = useState(function () { var _a; return (preferredAction === null || preferredAction === void 0 ? void 0 : preferredAction.label) || ((_a = actions[0]) === null || _a === void 0 ? void 0 : _a.text); }), currentAction = _d[0], setCurrentAction = _d[1];
|
|
30
19
|
var _e = useWorkflowComments({
|
|
31
20
|
processInstanceComments: processInstanceComments,
|
|
32
21
|
taskId: taskId,
|
|
@@ -36,8 +25,10 @@ export var WorkflowComments = function (_a) {
|
|
|
36
25
|
writeComment(comment);
|
|
37
26
|
setComment('');
|
|
38
27
|
}, [comment, writeComment]);
|
|
39
|
-
var
|
|
40
|
-
|
|
28
|
+
var handleChange = useCallback(function (event) {
|
|
29
|
+
setComment(event.target.value);
|
|
30
|
+
}, []);
|
|
31
|
+
var handleKeyPress = useCallback(function (e) {
|
|
41
32
|
if (e.key === 'Enter') {
|
|
42
33
|
if (comment.length > 0 && !e.shiftKey) {
|
|
43
34
|
e.preventDefault();
|
|
@@ -48,18 +39,20 @@ export var WorkflowComments = function (_a) {
|
|
|
48
39
|
}
|
|
49
40
|
e.preventDefault();
|
|
50
41
|
}
|
|
51
|
-
};
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
}, [comment, sendComment]);
|
|
43
|
+
var buttonsGroup = useMemo(function () {
|
|
44
|
+
return actions.map(function (_a) {
|
|
45
|
+
var text = _a.text, onClick = _a.onClick;
|
|
46
|
+
return ({
|
|
47
|
+
label: text,
|
|
48
|
+
onClick: function () {
|
|
49
|
+
setCurrentAction(text);
|
|
50
|
+
onClick(comment);
|
|
51
|
+
},
|
|
52
|
+
value: text
|
|
53
|
+
});
|
|
61
54
|
});
|
|
62
|
-
}
|
|
55
|
+
}, [actions, comment]);
|
|
63
56
|
return (React.createElement("div", { className: styles.container },
|
|
64
57
|
React.createElement("div", { className: styles.title },
|
|
65
58
|
" ",
|
|
@@ -67,8 +60,8 @@ export var WorkflowComments = function (_a) {
|
|
|
67
60
|
" "),
|
|
68
61
|
React.createElement("div", { className: styles.commentsContainer }, expanded || comments.length < 3 ? (React.createElement(ExpandedComments, { comments: comments })) : (React.createElement(CollapsedComments, { onClick: function () { return setExpanded(true); }, comments: comments }))),
|
|
69
62
|
!readOnly && (React.createElement(Input, { endAdornment: React.createElement(InputAdornment, { position: "end", className: styles.sendButton },
|
|
70
|
-
React.createElement(SmallIconButton, { icon: SendIcon, disabled: comment.length === 0, onClick: sendComment, "data-reltio-id": "send-button" })), classes: { root: styles.filledInputRoot }, placeholder: i18n.text('Write a comment'), value: comment, onKeyPress:
|
|
63
|
+
React.createElement(SmallIconButton, { icon: SendIcon, disabled: comment.length === 0, onClick: sendComment, "data-reltio-id": "send-button" })), classes: { root: styles.filledInputRoot }, placeholder: i18n.text('Write a comment'), value: comment, onKeyPress: handleKeyPress, onChange: handleChange, disableUnderline: true, multiline: true })),
|
|
71
64
|
React.createElement("div", { className: styles.modeSwitcherWrapper },
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
buttonsGroup.length === 1 && (React.createElement(Button, { variant: "outlined", onClick: buttonsGroup[0].onClick, disabled: actionRequestIsInProgress }, buttonsGroup[0].label)),
|
|
66
|
+
buttonsGroup.length > 1 && (React.createElement(ModeSwitcherSelect, { buttonsGroup: buttonsGroup, value: currentAction, disabled: actionRequestIsInProgress })))));
|
|
74
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WorkflowComments as default } from
|
|
1
|
+
export { WorkflowComments as default } from './WorkflowComments';
|