@agilemotion/oui-react-js 1.3.0 → 1.3.2

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.
Files changed (71) hide show
  1. package/dist/ApplicationContext.js +151 -38
  2. package/dist/BasicApp.js +16 -9
  3. package/dist/BasicAppHome.js +6 -4
  4. package/dist/BusinessPortalApp.css +37 -0
  5. package/dist/BusinessPortalApp.js +115 -0
  6. package/dist/BusinessPortalAppHome.js +167 -0
  7. package/dist/RestUtils.js +12 -9
  8. package/dist/assets/css/black-dashboard-react.css +1 -2
  9. package/dist/assets/jss/components/footerStyle.js +7 -4
  10. package/dist/assets/jss/views/loginBasicStyle.js +0 -1
  11. package/dist/assets/jss/views/loginBusinessPortalStyle.js +76 -0
  12. package/dist/assets/scss/black-dashboard-react/bootstrap/_reboot.scss +0 -1
  13. package/dist/components/DocumentView.css +4 -0
  14. package/dist/components/DocumentViewer.js +93 -37
  15. package/dist/components/DocumentViewerComponent.js +93 -0
  16. package/dist/components/ElementResizeHandler.js +232 -0
  17. package/dist/components/Graph.js +120 -16
  18. package/dist/components/GraphNode.js +0 -2
  19. package/dist/components/HtmlPanel.js +45 -4
  20. package/dist/components/Icon.js +8 -0
  21. package/dist/components/SignaturePanel.js +118 -0
  22. package/dist/components/StepperTitleBar.css +85 -0
  23. package/dist/components/StepperTitleBar.js +190 -0
  24. package/dist/components/TitleBar.js +1 -1
  25. package/dist/components/Toolbar.js +6 -3
  26. package/dist/components/dashboard/{BasicBusinessApp.js → BasicBusinessAppDashboard.js} +17 -16
  27. package/dist/components/dashboard/BusinessPortalAppDashboard.css +5 -0
  28. package/dist/components/dashboard/BusinessPortalAppDashboard.js +191 -0
  29. package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +23 -12
  30. package/dist/components/dashboard/components/portal/Timeline.js +17 -0
  31. package/dist/components/dashboard/components/portal/Workspace.css +25 -0
  32. package/dist/components/dashboard/components/portal/Workspace.js +48 -0
  33. package/dist/components/dashboard/components/portal/portal-dashboard.css +25 -0
  34. package/dist/components/footer/Footer.js +43 -10
  35. package/dist/components/form/BaseField.js +11 -2
  36. package/dist/components/form/DatePicker.js +62 -1
  37. package/dist/components/form/FieldSet.js +1 -1
  38. package/dist/components/form/Form.js +28 -8
  39. package/dist/components/form/SelectItem.js +10 -3
  40. package/dist/components/form/UploadField.js +122 -44
  41. package/dist/components/layout/Layout.js +30 -15
  42. package/dist/components/layout/ViewPort.js +3 -2
  43. package/dist/components/menu/MenuLink.js +7 -0
  44. package/dist/components/navbars/HomeNavbar.js +0 -10
  45. package/dist/components/navbars/PortalNavbar.css +75 -0
  46. package/dist/components/navbars/PortalNavbar.js +138 -0
  47. package/dist/components/signatures/AlertItem.js +71 -0
  48. package/dist/components/signatures/Card.js +39 -0
  49. package/dist/components/signatures/MenuButton.js +108 -0
  50. package/dist/components/signatures/Prompt.js +78 -0
  51. package/dist/components/signatures/ResponsiveTable.css +91 -0
  52. package/dist/components/signatures/ResponsiveTable.js +568 -0
  53. package/dist/components/signatures/SearchView.js +236 -0
  54. package/dist/components/signatures/SignatorySearch.js +115 -0
  55. package/dist/components/signatures/SignatorySearchForm.js +77 -0
  56. package/dist/components/signatures/SignatureInputProps.js +336 -0
  57. package/dist/components/signatures/SignatureTemplateDesigner.js +890 -0
  58. package/dist/components/signatures/Toolbar.js +208 -0
  59. package/dist/components/signatures/ViewUtils.js +309 -0
  60. package/dist/components/signatures/widgets.css +126 -0
  61. package/dist/event/RouteActionHandler.js +1 -1
  62. package/dist/view/Dashboard.js +17 -13
  63. package/dist/view/PortalDashboard.js +33 -0
  64. package/dist/view/security/ChangePasswordBasic.js +1 -0
  65. package/dist/view/security/ForgotPasswordBasic.js +1 -0
  66. package/dist/view/security/LoginBasic.js +6 -1
  67. package/dist/view/security/LoginBusinessPortal.js +267 -0
  68. package/dist/view/security/ResetPasswordBasic.js +1 -0
  69. package/package.json +26 -24
  70. package/dist/assets/img/flogo.png +0 -0
  71. package/dist/components/SignatureTemplateDesigner.js +0 -168
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ElementResizeHandler = void 0;
7
+
8
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+
10
+ const MIN_WIDTH = 60;
11
+ const MIN_HEIGHT = 40;
12
+ const FULLSCREEN_MARGINS = -10;
13
+ const MARGINS = 4;
14
+
15
+ class ElementResizeHandler {
16
+ constructor(pane, ghostPane) {
17
+ _defineProperty(this, "setBounds", (element, x, y, w, h) => {
18
+ element.style.left = x + 'px';
19
+ element.style.top = y + 'px';
20
+ element.style.width = w + 'px';
21
+ element.style.height = h + 'px';
22
+ });
23
+
24
+ _defineProperty(this, "hintHide", () => {
25
+ this.setBounds(this.ghostPane, this.b.left, this.b.top, this.b.width, this.b.height);
26
+ this.ghostPane.style.opacity = 0;
27
+ });
28
+
29
+ _defineProperty(this, "onTouchDown", e => {
30
+ alert(1);
31
+ this.onDown(e.touches[0]);
32
+ e.preventDefault();
33
+ });
34
+
35
+ _defineProperty(this, "onTouchMove", e => {
36
+ alert(1);
37
+ this.onMove(e.touches[0]);
38
+ });
39
+
40
+ _defineProperty(this, "onTouchEnd", e => {
41
+ alert(1);
42
+
43
+ if (e.touches.length === 0) {
44
+ this.onUp(e.changedTouches[0]);
45
+ }
46
+ });
47
+
48
+ _defineProperty(this, "onMouseDown", e => {
49
+ this.onDown(e);
50
+ e.preventDefault();
51
+ });
52
+
53
+ _defineProperty(this, "onDown", e => {
54
+ this.calc(e);
55
+ var isResizing = this.onRightEdge || this.onBottomEdge || this.onTopEdge || this.onLeftEdge;
56
+ this.clicked = {
57
+ x: this.x,
58
+ y: this.y,
59
+ cx: e.clientX,
60
+ cy: e.clientY,
61
+ w: this.b.width,
62
+ h: this.b.height,
63
+ isResizing: this.isResizing,
64
+ isMoving: !this.isResizing && this.canMove(),
65
+ onTopEdge: this.onTopEdge,
66
+ onLeftEdge: this.onLeftEdge,
67
+ onRightEdge: this.onRightEdge,
68
+ onBottomEdge: this.onBottomEdge
69
+ };
70
+ });
71
+
72
+ _defineProperty(this, "canMove", () => {
73
+ return this.x > 0 && this.x < this.b.width && this.y > 0 && this.y < this.b.height && this.y < 30;
74
+ });
75
+
76
+ _defineProperty(this, "calc", e => {
77
+ this.b = this.pane.getBoundingClientRect();
78
+ this.x = e.clientX - this.b.left;
79
+ this.y = e.clientY - this.b.top;
80
+ this.onTopEdge = this.y < MARGINS;
81
+ this.onLeftEdge = this.x < MARGINS;
82
+ this.onRightEdge = this.x >= this.b.width - MARGINS;
83
+ this.onBottomEdge = this.y >= this.b.height - MARGINS;
84
+ this.rightScreenEdge = window.innerWidth - MARGINS;
85
+ this.bottomScreenEdge = window.innerHeight - MARGINS;
86
+ });
87
+
88
+ _defineProperty(this, "onMove", ee => {
89
+ this.calc(ee);
90
+ this.e = ee;
91
+ this.redraw = true;
92
+ });
93
+
94
+ _defineProperty(this, "animate", () => {
95
+ requestAnimationFrame(this.animate);
96
+ if (!this.redraw) return;
97
+ this.redraw = false;
98
+
99
+ if (this.clicked && this.clicked.isResizing) {
100
+ if (this.clicked.onRightEdge) this.pane.style.width = Math.max(this.x, MIN_WIDTH) + 'px';
101
+ if (this.clicked.onBottomEdge) this.pane.style.height = Math.max(this.y, MIN_HEIGHT) + 'px';
102
+
103
+ if (this.clicked.onLeftEdge) {
104
+ var currentWidth = Math.max(this.clicked.cx - this.e.clientX + this.clicked.w, MIN_WIDTH);
105
+
106
+ if (currentWidth > MIN_WIDTH) {
107
+ this.pane.style.width = currentWidth + 'px';
108
+ this.pane.style.left = this.e.clientX + 'px';
109
+ }
110
+ }
111
+
112
+ if (this.clicked.onTopEdge) {
113
+ var currentHeight = Math.max(this.clicked.cy - this.e.clientY + this.clicked.h, MIN_HEIGHT);
114
+
115
+ if (currentHeight > MIN_HEIGHT) {
116
+ this.pane.style.height = currentHeight + 'px';
117
+ this.pane.style.top = this.e.clientY + 'px';
118
+ }
119
+ }
120
+
121
+ this.hintHide();
122
+ return;
123
+ }
124
+
125
+ if (this.clicked && this.clicked.isMoving) {
126
+ if (this.b.top < FULLSCREEN_MARGINS || this.b.left < FULLSCREEN_MARGINS || this.b.right > window.innerWidth - FULLSCREEN_MARGINS || this.b.bottom > window.innerHeight - FULLSCREEN_MARGINS) {
127
+ // hintFull();
128
+ this.setBounds(this.ghostPane, 0, 0, window.innerWidth, window.innerHeight);
129
+ this.ghostPane.style.opacity = 0.2;
130
+ } else if (this.b.top < MARGINS) {
131
+ // hintTop();
132
+ this.setBounds(this.ghostPane, 0, 0, window.innerWidth, window.innerHeight / 2);
133
+ this.ghostPane.style.opacity = 0.2;
134
+ } else if (this.b.left < MARGINS) {
135
+ // hintLeft();
136
+ this.setBounds(this.ghostPane, 0, 0, window.innerWidth / 2, window.innerHeight);
137
+ this.ghostPane.style.opacity = 0.2;
138
+ } else if (this.b.right > this.rightScreenEdge) {
139
+ // hintRight();
140
+ this.setBounds(this.ghostPane, window.innerWidth / 2, 0, window.innerWidth / 2, window.innerHeight);
141
+ this.ghostPane.style.opacity = 0.2;
142
+ } else if (this.b.bottom > this.bottomScreenEdge) {
143
+ // hintBottom();
144
+ this.setBounds(this.ghostPane, 0, window.innerHeight / 2, window.innerWidth, window.innerWidth / 2);
145
+ this.ghostPane.style.opacity = 0.2;
146
+ } else {
147
+ this.hintHide();
148
+ }
149
+
150
+ if (this.preSnapped) {
151
+ this.setBounds(this.pane, this.e.clientX - this.preSnapped.width / 2, this.e.clientY - Math.min(this.clicked.y, this.preSnapped.height), this.preSnapped.width, this.preSnapped.height);
152
+ return;
153
+ } // moving
154
+
155
+
156
+ this.pane.style.top = this.e.clientY - this.clicked.y + 'px';
157
+ this.pane.style.left = this.e.clientX - this.clicked.x + 'px';
158
+ return;
159
+ } // This code executes when mouse moves without clicking
160
+ // style cursor
161
+
162
+
163
+ if (this.onRightEdge && this.onBottomEdge || this.onLeftEdge && this.onTopEdge) {
164
+ this.pane.style.cursor = 'nwse-resize';
165
+ } else if (this.onRightEdge && this.onTopEdge || this.onBottomEdge && this.onLeftEdge) {
166
+ this.pane.style.cursor = 'nesw-resize';
167
+ } else if (this.onRightEdge || this.onLeftEdge) {
168
+ this.pane.style.cursor = 'ew-resize';
169
+ } else if (this.onBottomEdge || this.onTopEdge) {
170
+ this.pane.style.cursor = 'ns-resize';
171
+ } else if (this.canMove()) {
172
+ this.pane.style.cursor = 'move';
173
+ } else {
174
+ this.pane.style.cursor = 'default';
175
+ }
176
+ });
177
+
178
+ _defineProperty(this, "onUp", e => {
179
+ this.calc(e);
180
+
181
+ if (this.clicked && this.clicked.isMoving) {
182
+ // Snap
183
+ var snapped = {
184
+ width: this.b.width,
185
+ height: this.b.height
186
+ };
187
+
188
+ if (this.b.top < FULLSCREEN_MARGINS || this.b.left < FULLSCREEN_MARGINS || this.b.right > window.innerWidth - FULLSCREEN_MARGINS || this.b.bottom > window.innerHeight - FULLSCREEN_MARGINS) {
189
+ // hintFull();
190
+ this.setBounds(this.pane, 0, 0, window.innerWidth, window.innerHeight);
191
+ this.preSnapped = snapped;
192
+ } else if (this.b.top < MARGINS) {
193
+ // hintTop();
194
+ this.setBounds(this.pane, 0, 0, window.innerWidth, window.innerHeight / 2);
195
+ this.preSnapped = snapped;
196
+ } else if (this.b.left < MARGINS) {
197
+ // hintLeft();
198
+ this.setBounds(this.pane, 0, 0, window.innerWidth / 2, window.innerHeight);
199
+ this.preSnapped = snapped;
200
+ } else if (this.b.right > this.rightScreenEdge) {
201
+ // hintRight();
202
+ this.setBounds(this.pane, window.innerWidth / 2, 0, window.innerWidth / 2, window.innerHeight);
203
+ this.preSnapped = snapped;
204
+ } else if (this.b.bottom > this.bottomScreenEdge) {
205
+ // hintBottom();
206
+ this.setBounds(this.pane, 0, window.innerHeight / 2, window.innerWidth, window.innerWidth / 2);
207
+ this.preSnapped = snapped;
208
+ } else {
209
+ this.preSnapped = null;
210
+ }
211
+
212
+ this.hintHide();
213
+ }
214
+
215
+ this.clicked = null;
216
+ });
217
+
218
+ this.clicked = null;
219
+ pane.addEventListener('mousedown', this.onMouseDown);
220
+ document.addEventListener('mousemove', this.onMove);
221
+ document.addEventListener('mouseup', this.onUp);
222
+ pane.addEventListener('touchstart', this.onTouchDown);
223
+ document.addEventListener('touchmove', this.onTouchMove);
224
+ document.addEventListener('touchend', this.onTouchEnd);
225
+ this.pane = pane;
226
+ this.ghostPane = ghostPane;
227
+ this.animate();
228
+ }
229
+
230
+ }
231
+
232
+ exports.ElementResizeHandler = ElementResizeHandler;
@@ -25,9 +25,36 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
25
25
 
26
26
  class Graph {
27
27
  constructor(config) {
28
+ _defineProperty(this, "getCurrentNodeIndex", () => {
29
+ let index = 0;
30
+ let collection = this.config.stepperMode === null || this.config.stepperMode === "DYNAMIC" ? this.path : this.config.nodes;
31
+
32
+ var _iterator = _createForOfIteratorHelper(collection),
33
+ _step;
34
+
35
+ try {
36
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
37
+ const element = _step.value;
38
+
39
+ if (this.current.config.name === element.name) {
40
+ return index;
41
+ }
42
+
43
+ index++;
44
+ }
45
+ } catch (err) {
46
+ _iterator.e(err);
47
+ } finally {
48
+ _iterator.f();
49
+ }
50
+
51
+ return null;
52
+ });
53
+
28
54
  _defineProperty(this, "init", () => {
29
55
  let root = this.config.nodes[0];
30
56
  this.current = new _GraphNode.default(this.config.nodes[0]);
57
+ this.addNodeToPath(this.current);
31
58
 
32
59
  _ActionHandlers.default.invokeHandler(root.action, null, null, this.config.id);
33
60
  });
@@ -35,37 +62,110 @@ class Graph {
35
62
  _defineProperty(this, "signal", event => {
36
63
  let nextNodeName = this.current.getNextNode(event);
37
64
 
38
- if (!_Utils.default.isNull(nextNodeName)) {
39
- var _iterator = _createForOfIteratorHelper(this.config.nodes),
40
- _step;
65
+ if (this.current.config.last && nextNodeName === null) {
66
+ _ApplicationContext.default.removeLoadedGraph();
67
+ } else {
68
+ if (!_Utils.default.isNull(nextNodeName)) {
69
+ var _iterator2 = _createForOfIteratorHelper(this.config.nodes),
70
+ _step2;
41
71
 
42
- try {
43
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
44
- const node = _step.value;
72
+ try {
73
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
74
+ const node = _step2.value;
45
75
 
46
- if (node.name === nextNodeName) {
47
- this.current = new _GraphNode.default(node);
76
+ if (node.name === nextNodeName) {
77
+ this.current = new _GraphNode.default(node);
78
+ this.addNodeToPath(this.current);
48
79
 
49
- _ActionHandlers.default.invokeHandler(node.action, null, null, this.config.id);
80
+ _ActionHandlers.default.invokeHandler(node.action, null, null, this.config.id);
50
81
 
51
- break;
82
+ break;
83
+ }
52
84
  }
85
+ } catch (err) {
86
+ _iterator2.e(err);
87
+ } finally {
88
+ _iterator2.f();
53
89
  }
54
- } catch (err) {
55
- _iterator.e(err);
56
- } finally {
57
- _iterator.f();
58
90
  }
91
+
92
+ if (this.current === null) {
93
+ console.error("Node name could not be found : " + nextNodeName);
94
+ }
95
+ }
96
+ });
97
+
98
+ _defineProperty(this, "setCurrentNodeTitle", title => {
99
+ if (this.current !== null) {
100
+ this.current.title = title;
59
101
  }
102
+ });
103
+
104
+ _defineProperty(this, "addNodeToPath", node => {
105
+ if (this.path.length === 0) {
106
+ this.path.push(node);
107
+ } else {
108
+ let lastNode = this.path[this.path.length - 1];
60
109
 
61
- if (this.current === null) {
62
- console.error("Node name could not be found : " + nextNodeName);
110
+ if (lastNode.config.name === node.config.name) {
111
+ this.path.pop();
112
+ } else {
113
+ this.path.push(node);
114
+ }
63
115
  }
64
116
  });
65
117
 
66
118
  this.config = config;
67
119
  this.modelData = {};
68
120
  this.current = null;
121
+ this.path = [];
122
+ }
123
+
124
+ getTitleStack() {
125
+ let titleStack = [];
126
+ let index = 0;
127
+
128
+ if (this.config.stepperMode === null || this.config.stepperMode === "DYNAMIC") {
129
+ var _iterator3 = _createForOfIteratorHelper(this.path),
130
+ _step3;
131
+
132
+ try {
133
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
134
+ const pathElement = _step3.value;
135
+ let stackItem = {};
136
+ stackItem.title = pathElement.title;
137
+ stackItem.index = index++;
138
+ titleStack.push(stackItem);
139
+ }
140
+ } catch (err) {
141
+ _iterator3.e(err);
142
+ } finally {
143
+ _iterator3.f();
144
+ }
145
+ } else {
146
+ var _iterator4 = _createForOfIteratorHelper(this.config.nodes),
147
+ _step4;
148
+
149
+ try {
150
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
151
+ const node = _step4.value;
152
+ let stackItem = {};
153
+ stackItem.title = node.title;
154
+ stackItem.index = index++;
155
+ titleStack.push(stackItem);
156
+ }
157
+ } catch (err) {
158
+ _iterator4.e(err);
159
+ } finally {
160
+ _iterator4.f();
161
+ }
162
+ }
163
+
164
+ return titleStack;
165
+ }
166
+
167
+ get title() {
168
+ return this.config.title;
69
169
  }
70
170
 
71
171
  get value() {
@@ -88,6 +188,10 @@ class Graph {
88
188
  return this.modelData;
89
189
  }
90
190
 
191
+ set model(model) {
192
+ this.modelData = model;
193
+ }
194
+
91
195
  get id() {
92
196
  return this.config.id;
93
197
  }
@@ -81,8 +81,6 @@ class GraphNode {
81
81
 
82
82
  if (activeEdge !== null) {
83
83
  return activeEdge.targetNodeName;
84
- } else {
85
- console.error("Could not evaulate next link : " + JSON.stringify(this.config));
86
84
  }
87
85
 
88
86
  return null;
@@ -11,14 +11,55 @@ var _Utils = _interopRequireDefault(require("../Utils"));
11
11
 
12
12
  var _reactHtmlRenderer = _interopRequireDefault(require("react-html-renderer"));
13
13
 
14
+ var _Observable = _interopRequireDefault(require("../event/Observable"));
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
18
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
+
20
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
21
+
22
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
23
+
24
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
25
+
26
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
27
+
28
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
+
16
30
  const HtmlPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
17
- _react.default.useImperativeHandle(ref, () => ({
18
- getId: () => {
19
- return props.config.id;
31
+ const _React$useState = _react.default.useState(true),
32
+ _React$useState2 = _slicedToArray(_React$useState, 2),
33
+ initializing = _React$useState2[0],
34
+ setInitializing = _React$useState2[1];
35
+
36
+ _react.default.useEffect(() => {
37
+ props.handle.api = api();
38
+
39
+ if (initializing) {
40
+ let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
41
+
42
+ _Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
43
+
44
+ _Observable.default.addSystemSubscriptions(parsedConfig);
45
+
46
+ setInitializing(false);
47
+
48
+ if (!_Utils.default.isNull(props.loadCompleteHandler)) {
49
+ props.loadCompleteHandler(props.config.id);
50
+ }
20
51
  }
21
- }));
52
+ });
53
+
54
+ const api = () => {
55
+ return {
56
+ get id() {
57
+ return props.config.id;
58
+ },
59
+
60
+ loadData: actionConfig => {}
61
+ };
62
+ };
22
63
 
23
64
  return /*#__PURE__*/_react.default.createElement("div", {
24
65
  ref: ref
@@ -23,6 +23,10 @@ var _Error = _interopRequireDefault(require("@material-ui/icons/Error"));
23
23
 
24
24
  var _CloudDownload = _interopRequireDefault(require("@material-ui/icons/CloudDownload"));
25
25
 
26
+ var _Work = _interopRequireDefault(require("@material-ui/icons/Work"));
27
+
28
+ var _Person = _interopRequireDefault(require("@material-ui/icons/Person"));
29
+
26
30
  var _react = _interopRequireWildcard(require("react"));
27
31
 
28
32
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
@@ -53,6 +57,10 @@ class Icon extends _react.Component {
53
57
  return /*#__PURE__*/_react.default.createElement(_CloudDownload.default, null);
54
58
  } else if (this.props.id === 'SEARCH') {
55
59
  return /*#__PURE__*/_react.default.createElement(_Search.default, null);
60
+ } else if (this.props.id === 'WORK') {
61
+ return /*#__PURE__*/_react.default.createElement(_Work.default, null);
62
+ } else if (this.props.id === 'PERSON') {
63
+ return /*#__PURE__*/_react.default.createElement(_Person.default, null);
56
64
  } else if (this.props.id === 'ERROR') {
57
65
  return /*#__PURE__*/_react.default.createElement(_Error.default, {
58
66
  style: {
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Utils = _interopRequireDefault(require("../Utils"));
11
+
12
+ var _Observable = _interopRequireDefault(require("../event/Observable"));
13
+
14
+ var _RestUtils = require("../RestUtils");
15
+
16
+ var _ServiceCallActionHandler = _interopRequireDefault(require("../event/ServiceCallActionHandler"));
17
+
18
+ var _DocumentContainer = _interopRequireDefault(require("@agilemotion/signi-vault-ui/dist/DocumentContainer"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
+
24
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
+
26
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
+
28
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
29
+
30
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
31
+
32
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
+
34
+ const SignaturePanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
35
+ const _React$useState = _react.default.useState(true),
36
+ _React$useState2 = _slicedToArray(_React$useState, 2),
37
+ initializing = _React$useState2[0],
38
+ setInitializing = _React$useState2[1];
39
+
40
+ const _React$useState3 = _react.default.useState(null),
41
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
42
+ value = _React$useState4[0],
43
+ setValue = _React$useState4[1];
44
+
45
+ const _React$useState5 = _react.default.useState({}),
46
+ _React$useState6 = _slicedToArray(_React$useState5, 1),
47
+ handle = _React$useState6[0];
48
+
49
+ _react.default.useEffect(() => {
50
+ props.handle.api = api();
51
+
52
+ if (initializing) {
53
+ let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
54
+
55
+ _Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
56
+
57
+ _Observable.default.addSystemSubscriptions(parsedConfig);
58
+
59
+ setInitializing(false);
60
+
61
+ if (!_Utils.default.isNull(props.loadCompleteHandler)) {
62
+ props.loadCompleteHandler(props.config.id);
63
+ }
64
+ }
65
+ });
66
+
67
+ const api = () => {
68
+ return {
69
+ get id() {
70
+ return props.config.id;
71
+ },
72
+
73
+ get value() {
74
+ if (!_Utils.default.isNull(handle.api)) {
75
+ return handle.api.value;
76
+ }
77
+
78
+ return null;
79
+ },
80
+
81
+ loadData: actionConfig => {
82
+ let service = !_Utils.default.isNull(props.config.dataService) ? props.config.dataService : actionConfig !== null ? actionConfig.dataService : null;
83
+
84
+ if (!_Utils.default.isNull(service)) {
85
+ if (service.type === 'remoteObjectProxy') {
86
+ (0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {
87
+ setValue(result);
88
+ }, e => {}, parameter => {});
89
+ } else {
90
+ if (_Utils.default.isNull(actionConfig)) {
91
+ actionConfig = {};
92
+ }
93
+
94
+ actionConfig.service = service;
95
+
96
+ _ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
97
+ setValue(data);
98
+ }, () => {});
99
+ }
100
+ }
101
+ }
102
+ };
103
+ };
104
+
105
+ return /*#__PURE__*/_react.default.createElement("div", {
106
+ ref: ref
107
+ }, value !== null ? /*#__PURE__*/_react.default.createElement(_DocumentContainer.default, {
108
+ handle: handle,
109
+ config: value
110
+ }) : /*#__PURE__*/_react.default.createElement("div", {
111
+ style: {
112
+ padding: '32px 0 32px 48px'
113
+ }
114
+ }, "Loading..."));
115
+ }));
116
+
117
+ var _default = SignaturePanel;
118
+ exports.default = _default;