@agilemotion/oui-react-js 1.7.1 → 1.7.3
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/ApplicationManager.js +8 -3
- package/dist/BasicAppHome.js +1 -1
- package/dist/DynamicJS.js +5 -2
- package/dist/InteractionPortalAppHome.js +5 -0
- package/dist/RestService.js +344 -0
- package/dist/RestUtils.js +22 -8
- package/dist/Utils.js +9 -0
- package/dist/components/AlertBar.js +3 -0
- package/dist/components/DataGrid.js +72 -43
- package/dist/components/DocumentTemplateDesigner.css +2 -2
- package/dist/components/DocumentTemplateDesigner.js +43 -31
- package/dist/components/DocumentTemplateDesignerComponent.css +15 -0
- package/dist/components/DocumentTemplateDesignerComponent.js +368 -72
- package/dist/components/DocumentTemplatePlaceholderDialog.js +6 -6
- package/dist/components/DocumentViewer.css +10 -0
- package/dist/components/DocumentViewer.js +95 -45
- package/dist/components/Graph.js +12 -2
- package/dist/components/GraphNode.js +0 -2
- package/dist/components/{DocumentViewerComponent.js → PDFViewer.js} +2 -2
- package/dist/components/TabPage.js +7 -3
- package/dist/components/TabPanel.js +13 -3
- package/dist/components/TableCellContent.js +21 -4
- package/dist/components/TemplateDesigner.css +3 -2
- package/dist/components/TemplateDesigner.js +3 -1
- package/dist/components/TemplateItemEventHandler.js +30 -15
- package/dist/components/Toolbar.js +3 -1
- package/dist/components/Tree.js +5 -5
- package/dist/components/WordDocumentViewer.js +167 -0
- package/dist/components/dashboard/SideMenuModuleDashboard.js +1 -3
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +4 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +131 -159
- package/dist/components/form/AutoComplete.js +28 -6
- package/dist/components/form/BaseField.js +3 -3
- package/dist/components/form/DatePicker.js +7 -2
- package/dist/components/form/FieldSet.js +24 -8
- package/dist/components/form/Form.js +4 -3
- package/dist/components/form/GridField.js +13 -37
- package/dist/components/form/LookupField.js +23 -23
- package/dist/components/form/RadioGroup.js +2 -1
- package/dist/components/form/Section.js +4 -0
- package/dist/components/form/SelectItem.js +2 -3
- package/dist/components/form/TextField.js +6 -6
- package/dist/components/layout/Layout.js +24 -15
- package/dist/components/menu/MenuButton.js +12 -7
- package/dist/components/menu/MenuLink.js +6 -0
- package/dist/components/signatures/AgilitySignaturePanel.js +33 -14
- package/dist/components/signatures/DocumentContainer.css +26 -1
- package/dist/components/signatures/DocumentContainer.js +55 -10
- package/dist/components/signatures/SignatureInputProps.js +59 -9
- package/dist/components/signatures/SignatureTemplateDesigner.js +71 -38
- package/dist/event/ActionHandlers.js +7 -4
- package/dist/event/RouteActionHandler.js +3 -3
- package/dist/event/ScriptActionHandler.js +2 -2
- package/dist/event/ServiceCallActionHandler.js +73 -28
- package/dist/js/Docs.js +57 -10
- package/dist/view/Dashboard.js +3 -3
- package/package.json +10 -5
- package/dist/components/DocumentView.css +0 -4
|
@@ -60,6 +60,11 @@ const FieldSet = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
60
60
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
61
61
|
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
62
62
|
}, []);
|
|
63
|
+
_react.default.useEffect(() => {
|
|
64
|
+
if (!_Utils.default.isNull(props.disabled)) {
|
|
65
|
+
setDisabled(props.disabled);
|
|
66
|
+
}
|
|
67
|
+
}, [props.disabled]);
|
|
63
68
|
function fireChangeEvent() {
|
|
64
69
|
let event = new _Event.default(props.handle, props.viewId);
|
|
65
70
|
_Observable.default.fireEvent(_EventType.default.VALUE_CHANGE, event);
|
|
@@ -82,6 +87,15 @@ const FieldSet = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
82
87
|
if (!component.fieldType) {
|
|
83
88
|
console.error('ERROR RENDING COMPONENT : ' + component.id + ' - NO FIELD TYPE SPECIFIED');
|
|
84
89
|
}
|
|
90
|
+
let isDisabled = false;
|
|
91
|
+
if (!_Utils.default.isNull(props.config) && !_Utils.default.isNull(props.config.disabled)) {
|
|
92
|
+
isDisabled = _Utils.default.evaluateBooleanExpression(props.config.disabled, props.config.id);
|
|
93
|
+
}
|
|
94
|
+
if (isDisabled) {
|
|
95
|
+
if (_Utils.default.isNull(component.disabled)) {
|
|
96
|
+
component.disabled = true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
85
99
|
switch (component.fieldType) {
|
|
86
100
|
case 'LOOKUP':
|
|
87
101
|
return /*#__PURE__*/_react.default.createElement(_LookupField.default, {
|
|
@@ -484,17 +498,19 @@ const FieldSet = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
484
498
|
}
|
|
485
499
|
}
|
|
486
500
|
width = colspan / fieldGrid.maxColPerRow * 100;
|
|
501
|
+
let columnStyle = {
|
|
502
|
+
paddingLeft: '0',
|
|
503
|
+
paddingRight: '0',
|
|
504
|
+
marginLeft: '0',
|
|
505
|
+
marginRight: '0',
|
|
506
|
+
minWidth: '320px',
|
|
507
|
+
width: width + '%'
|
|
508
|
+
};
|
|
509
|
+
let style = field.attributes?.columnStyle ? _Utils.default.mergeObjects(field.attributes?.columnStyle, columnStyle) : columnStyle;
|
|
487
510
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
488
511
|
key: index,
|
|
489
512
|
className: "col-*-*",
|
|
490
|
-
style:
|
|
491
|
-
paddingLeft: '0',
|
|
492
|
-
paddingRight: '0',
|
|
493
|
-
marginLeft: '0',
|
|
494
|
-
marginRight: '0',
|
|
495
|
-
width: width + '%',
|
|
496
|
-
minWidth: '320px'
|
|
497
|
-
}, field)
|
|
513
|
+
style: style
|
|
498
514
|
}, renderComponent(field, index));
|
|
499
515
|
}));
|
|
500
516
|
}));
|
|
@@ -219,9 +219,9 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
219
219
|
if (service.type === 'rpc') {
|
|
220
220
|
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {
|
|
221
221
|
try {
|
|
222
|
-
if (!_Utils.default.isNull(result
|
|
223
|
-
parseValues(transformDataObject(result
|
|
224
|
-
setMasterValues(result
|
|
222
|
+
if (!_Utils.default.isNull(result)) {
|
|
223
|
+
parseValues(transformDataObject(result));
|
|
224
|
+
setMasterValues(result);
|
|
225
225
|
loadingRef.current = false;
|
|
226
226
|
}
|
|
227
227
|
} catch (e) {
|
|
@@ -587,6 +587,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
587
587
|
}, /*#__PURE__*/_react.default.createElement(_Section.default, {
|
|
588
588
|
keyHandler: props.keyHandler,
|
|
589
589
|
config: section,
|
|
590
|
+
disabled: props.disabled,
|
|
590
591
|
handle: createSectionHandle(section),
|
|
591
592
|
ref: /*#__PURE__*/_react.default.createRef(),
|
|
592
593
|
form: () => {
|
|
@@ -28,22 +28,16 @@ function createRecord(row, gridConfig, inbound) {
|
|
|
28
28
|
for (const column of gridConfig.columns) {
|
|
29
29
|
let property = !_Utils.default.isNull(column.dataBinding) ? column.dataBinding : column.id;
|
|
30
30
|
let val = row[property];
|
|
31
|
-
if (!inbound) {
|
|
32
|
-
let editorType = getEditorType(property, gridConfig);
|
|
33
|
-
if (!_Utils.default.isNull(val) && (editorType === 'LOOKUP' || editorType === 'SELECT')) {
|
|
34
|
-
let objectReference = {};
|
|
35
|
-
objectReference.id = val.id;
|
|
36
|
-
val = objectReference;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
31
|
record[property] = val;
|
|
40
32
|
}
|
|
41
|
-
|
|
33
|
+
|
|
34
|
+
//record.id = row.id >= 0 ? row.id : null;
|
|
35
|
+
record.id = row.id;
|
|
42
36
|
return record;
|
|
43
37
|
}
|
|
44
38
|
const GridFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
45
39
|
const base = props.base;
|
|
46
|
-
const
|
|
40
|
+
const newRowIdCounter = _react.default.useRef(-1);
|
|
47
41
|
const [selection, setSelection] = _react.default.useState([]);
|
|
48
42
|
const [rows, setRows] = _react.default.useState([]);
|
|
49
43
|
const [crudToolstripWidth, setCrudToolstripWidth] = _react.default.useState(null);
|
|
@@ -63,29 +57,14 @@ const GridFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
|
|
|
63
57
|
}, []);
|
|
64
58
|
_react.default.useEffect(() => {
|
|
65
59
|
if (!_Utils.default.isNull(base.value) && !props.initialValueSet) {
|
|
66
|
-
|
|
67
|
-
for (const item of base.value) {
|
|
68
|
-
if (!_Utils.default.isNull(item.map)) {
|
|
69
|
-
initValue.push(item.map);
|
|
70
|
-
} else {
|
|
71
|
-
let properties = Object.getOwnPropertyNames(item);
|
|
72
|
-
for (const property of properties) {
|
|
73
|
-
let val = item[property];
|
|
74
|
-
if (!_Utils.default.isNull(val) && !_Utils.default.isNull(val.map)) {
|
|
75
|
-
item[property] = val.map;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
initValue.push(item);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
setRows(initValue);
|
|
60
|
+
setRows(base.value);
|
|
82
61
|
props.loadCallback();
|
|
83
62
|
}
|
|
84
63
|
}, [base.value]);
|
|
85
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
86
65
|
className: "MuiFormControl-root MuiTextField-root MuiFormControl-marginDense",
|
|
87
66
|
style: _Utils.default.mergeStyles({}, props.config)
|
|
88
|
-
}, /*#__PURE__*/_react.default.createElement(_InputLabel.default, {
|
|
67
|
+
}, label && label.trim().length > 0 && /*#__PURE__*/_react.default.createElement(_InputLabel.default, {
|
|
89
68
|
required: base.required,
|
|
90
69
|
error: base.hasError
|
|
91
70
|
}, label), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -121,9 +100,8 @@ const GridFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
|
|
|
121
100
|
"aria-haspopup": "true",
|
|
122
101
|
onClick: () => {
|
|
123
102
|
props.gridHandle.api.addRows([{
|
|
124
|
-
id: newRowIdCounter
|
|
103
|
+
id: newRowIdCounter.current--
|
|
125
104
|
}]);
|
|
126
|
-
setNewRowIdCounter(newRowIdCounter - 1);
|
|
127
105
|
}
|
|
128
106
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
129
107
|
id: 'ADD'
|
|
@@ -206,15 +184,13 @@ const GridField = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.
|
|
|
206
184
|
let type = objectArray[0].type;
|
|
207
185
|
let nullIdRecords = 1;
|
|
208
186
|
for (const objectArrayElement of objectArray) {
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
val.push(record);
|
|
215
|
-
} else {
|
|
216
|
-
val.push(objectArrayElement);
|
|
187
|
+
if (inbound && _Utils.default.isNull(objectArrayElement.id)) {
|
|
188
|
+
objectArrayElement.id = -1 * nullIdRecords++;
|
|
189
|
+
}
|
|
190
|
+
if (!inbound && objectArrayElement.id < 0) {
|
|
191
|
+
objectArrayElement.id = null;
|
|
217
192
|
}
|
|
193
|
+
val.push(objectArrayElement);
|
|
218
194
|
}
|
|
219
195
|
}
|
|
220
196
|
setInitialValueSet(false);
|
|
@@ -21,8 +21,8 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
21
21
|
const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
22
22
|
const [currentSelection, setCurrentSelection] = _react.default.useState(null);
|
|
23
23
|
const [open, setOpen] = _react.default.useState(false);
|
|
24
|
-
const width =
|
|
25
|
-
const minWidth =
|
|
24
|
+
const width = props.config.attributes?.style?.width ? props.config.attributes.style.width : "100%";
|
|
25
|
+
const minWidth = props.config.attributes?.style?.minWidth ? props.config.attributes.style.minWidth : "240px";
|
|
26
26
|
const defaultValue = _Utils.default.isNull(props.value) ? '' : props.value;
|
|
27
27
|
const base = props.base;
|
|
28
28
|
const handleClose = () => {
|
|
@@ -37,24 +37,28 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
|
|
|
37
37
|
}
|
|
38
38
|
props.config.grid.attributes['margin'] = _Utils.default.getComponentAttribute(props.config.grid, 'margin', '16px');
|
|
39
39
|
}
|
|
40
|
-
});
|
|
40
|
+
}, []);
|
|
41
|
+
function setupVal() {
|
|
42
|
+
let val = {};
|
|
43
|
+
let row = currentSelection[0];
|
|
44
|
+
let properties = Object.getOwnPropertyNames(row);
|
|
45
|
+
let label = _Utils.default.getComponentAttribute(props.config, 'displayTemplate', 'Please specify a display template');
|
|
46
|
+
for (let i = 0; i < properties.length; i++) {
|
|
47
|
+
let property = properties[i];
|
|
48
|
+
label = label.replace('@{' + property + "}", row[property]);
|
|
49
|
+
if (property !== 'label') {
|
|
50
|
+
val[property] = row[property];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
val.__oui_label = label;
|
|
54
|
+
val.toString = () => {
|
|
55
|
+
return label;
|
|
56
|
+
};
|
|
57
|
+
return val;
|
|
58
|
+
}
|
|
41
59
|
const setSelectionAsValue = () => {
|
|
42
60
|
if (currentSelection.length > 0) {
|
|
43
|
-
let
|
|
44
|
-
let properties = Object.getOwnPropertyNames(row);
|
|
45
|
-
let label = _Utils.default.getComponentAttribute(props.config, 'displayTemplate', 'Please specify a display template');
|
|
46
|
-
let val = {};
|
|
47
|
-
for (let i = 0; i < properties.length; i++) {
|
|
48
|
-
let property = properties[i];
|
|
49
|
-
label = label.replace('@{' + property + "}", row[property]);
|
|
50
|
-
if (property !== 'label') {
|
|
51
|
-
val[property] = row[property];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
val.label = label;
|
|
55
|
-
val.toString = () => {
|
|
56
|
-
return label;
|
|
57
|
-
};
|
|
61
|
+
let val = setupVal();
|
|
58
62
|
base.handleValueChange(val);
|
|
59
63
|
handleClose();
|
|
60
64
|
}
|
|
@@ -77,7 +81,7 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
|
|
|
77
81
|
required: base.required,
|
|
78
82
|
disabled: base.disabled,
|
|
79
83
|
label: !_Utils.default.isNull(props.config.attributes) && !_Utils.default.isNull(props.config.attributes['label']) ? props.config.attributes['label'] : null,
|
|
80
|
-
value: base.value || defaultValue,
|
|
84
|
+
value: base.value?.__oui_label || base.value?.dataRecordDescription || defaultValue,
|
|
81
85
|
className: props.className,
|
|
82
86
|
error: base.hasError,
|
|
83
87
|
helperText: base.errorMessage,
|
|
@@ -160,10 +164,6 @@ const LookupField = exports.LookupField = /*#__PURE__*/_react.default.memo( /*#_
|
|
|
160
164
|
return initVal.dataRecordDescription;
|
|
161
165
|
};
|
|
162
166
|
return initVal;
|
|
163
|
-
} else {
|
|
164
|
-
let objectReference = {};
|
|
165
|
-
objectReference.id = value.id;
|
|
166
|
-
return objectReference;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
return value;
|
|
@@ -33,7 +33,7 @@ const RadioGroupWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.
|
|
|
33
33
|
}, label) : null, /*#__PURE__*/_react.default.createElement(_RadioGroup.default, {
|
|
34
34
|
row: true,
|
|
35
35
|
defaultValue: props.defaultValue,
|
|
36
|
-
"aria-label": "
|
|
36
|
+
"aria-label": "",
|
|
37
37
|
name: "radios",
|
|
38
38
|
required: base.required,
|
|
39
39
|
helperText: base.errorMessage,
|
|
@@ -46,6 +46,7 @@ const RadioGroupWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.
|
|
|
46
46
|
key: index,
|
|
47
47
|
value: option.value,
|
|
48
48
|
control: /*#__PURE__*/_react.default.createElement(_Radio.default, {
|
|
49
|
+
disabled: base.disabled,
|
|
49
50
|
checked: option.value === value
|
|
50
51
|
}),
|
|
51
52
|
label: option.label
|
|
@@ -43,6 +43,7 @@ const Section = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.fo
|
|
|
43
43
|
return component.type === 'fieldSet' ? /*#__PURE__*/_react.default.createElement(_FieldSet.default, {
|
|
44
44
|
keyHandler: props.keyHandler,
|
|
45
45
|
config: component,
|
|
46
|
+
disabled: props.disabled,
|
|
46
47
|
form: props.form,
|
|
47
48
|
handle: createComponentHandle(component),
|
|
48
49
|
ref: /*#__PURE__*/_react.default.createRef(),
|
|
@@ -53,6 +54,7 @@ const Section = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.fo
|
|
|
53
54
|
}) : component.type === 'tab' ? /*#__PURE__*/_react.default.createElement(_TabPanel.default, {
|
|
54
55
|
keyHandler: props.keyHandler,
|
|
55
56
|
config: component,
|
|
57
|
+
disabled: props.disabled,
|
|
56
58
|
form: props.form,
|
|
57
59
|
handle: createComponentHandle(component),
|
|
58
60
|
ref: /*#__PURE__*/_react.default.createRef(),
|
|
@@ -61,6 +63,7 @@ const Section = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.fo
|
|
|
61
63
|
key: componentKey++
|
|
62
64
|
}) : component.type === 'videoPlayer' ? /*#__PURE__*/_react.default.createElement(_VideoPlayer.default, {
|
|
63
65
|
config: component,
|
|
66
|
+
disabled: props.disabled,
|
|
64
67
|
handle: createComponentHandle(component),
|
|
65
68
|
ref: /*#__PURE__*/_react.default.createRef(),
|
|
66
69
|
key: componentKey++,
|
|
@@ -68,6 +71,7 @@ const Section = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.fo
|
|
|
68
71
|
}) : component.type === 'htmlPanel' ? /*#__PURE__*/_react.default.createElement(_HtmlPanel.default, {
|
|
69
72
|
config: component,
|
|
70
73
|
handle: createComponentHandle(component),
|
|
74
|
+
disabled: props.disabled,
|
|
71
75
|
ref: /*#__PURE__*/_react.default.createRef(),
|
|
72
76
|
viewId: props.viewId,
|
|
73
77
|
key: componentKey++,
|
|
@@ -32,15 +32,14 @@ const SelectItemComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
|
|
|
32
32
|
if (loadFullOptionList && !_Utils.default.isNull(props.config.dataService)) {
|
|
33
33
|
let method = props.config.dataService.type === 'rpc' ? _RestUtils.invokeRpc : _RestUtils.invokeRest;
|
|
34
34
|
method(props.config.dataService, props.handle, props.viewId, result => {
|
|
35
|
-
let data = props.config.dataService.type === 'rpc' ? result.data : result;
|
|
36
35
|
let options = [];
|
|
37
36
|
if (_Utils.default.isNull(props.validator) || props.validator.nullable) {
|
|
38
37
|
options.push({
|
|
39
38
|
id: '_EMPTY_VALUE'
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
|
-
for (let i = 0; i <
|
|
43
|
-
let record =
|
|
41
|
+
for (let i = 0; i < result.records.length; i++) {
|
|
42
|
+
let record = result.records[i];
|
|
44
43
|
options.push(record);
|
|
45
44
|
}
|
|
46
45
|
base.setSelectOptions(options);
|
|
@@ -15,10 +15,10 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
15
15
|
const TextFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
16
16
|
const base = props.base;
|
|
17
17
|
const [multiline] = _react.default.useState(props.multiline);
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
18
|
+
const width = props.config.attributes?.style?.width ? props.config.attributes.style.width : "100%";
|
|
19
|
+
const maxWidth = props.config.attributes?.style?.maxWidth ? props.config.attributes.style.maxWidth : null;
|
|
20
|
+
const minWidth = props.config.attributes?.style?.minWidth ? props.config.attributes.style.minWidth : "240px";
|
|
21
|
+
const height = props.config.attributes?.style?.height ? props.config.attributes.style.height : multiline ? '200px' : null;
|
|
22
22
|
const rows = height === null ? 4 : height.replace('px', '') / 20 - 1;
|
|
23
23
|
const secondaryColor = (0, _reactRedux.useSelector)(state => state.dashboard.secondaryThemeColor);
|
|
24
24
|
const ThemedTextField = (0, _styles.withStyles)({
|
|
@@ -57,13 +57,13 @@ const TextFieldWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
|
|
|
57
57
|
rows: rows,
|
|
58
58
|
disabled: base.disabled,
|
|
59
59
|
size: "small",
|
|
60
|
-
style:
|
|
60
|
+
style: {
|
|
61
61
|
minWidth: minWidth,
|
|
62
62
|
width: width,
|
|
63
63
|
maxWidth: maxWidth,
|
|
64
64
|
height: height,
|
|
65
65
|
color: 'secondary'
|
|
66
|
-
},
|
|
66
|
+
},
|
|
67
67
|
variant: "outlined"
|
|
68
68
|
});
|
|
69
69
|
}));
|
|
@@ -34,7 +34,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
34
34
|
const Layout = exports.Layout = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
35
35
|
const [componentHandles] = _react.default.useState({});
|
|
36
36
|
const [loadedComponents] = _react.default.useState([]);
|
|
37
|
-
const [visible, setVisible] = _react.default.useState(
|
|
37
|
+
const [visible, setVisible] = _react.default.useState(true);
|
|
38
38
|
let keyCounter = 0;
|
|
39
39
|
_react.default.useEffect(() => {
|
|
40
40
|
props.handle.api = api();
|
|
@@ -331,33 +331,42 @@ const Layout = exports.Layout = /*#__PURE__*/_react.default.forwardRef((props, r
|
|
|
331
331
|
}
|
|
332
332
|
function render(layout) {
|
|
333
333
|
setMissingComponentIds();
|
|
334
|
-
let counter = 10000;
|
|
335
334
|
return _Utils.default.isNull(layout.components) || layout.components.length === 0 ? /*#__PURE__*/_react.default.createElement("div", null, "I am a dum empty Layout") : layout.orientation === 'VERTICAL' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, layout.components.map((component, index) => {
|
|
336
335
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
337
336
|
key: index
|
|
338
337
|
}, renderComponent(component, null));
|
|
339
|
-
})) : /*#__PURE__*/_react.default.createElement(
|
|
340
|
-
style: {
|
|
341
|
-
display: 'table',
|
|
342
|
-
width: '100%',
|
|
343
|
-
height: '100%'
|
|
344
|
-
}
|
|
345
|
-
}, layout.components.map((component, index) => {
|
|
338
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, layout.components.map((component, index) => {
|
|
346
339
|
let className = _Utils.default.getComponentAttribute(component, 'className', '');
|
|
340
|
+
let style = _Utils.default.getComponentAttribute(component, 'style', null);
|
|
341
|
+
let width;
|
|
342
|
+
let height;
|
|
343
|
+
if (style) {
|
|
344
|
+
width = style.width ? style.width : 100 / (index + 1) + '%';
|
|
345
|
+
height = style.height ? style.height : '100%';
|
|
346
|
+
} else {
|
|
347
|
+
width = 100 / (index + 1) + '%';
|
|
348
|
+
height = '100%';
|
|
349
|
+
if (!component.attributes) {
|
|
350
|
+
component.attributes = {};
|
|
351
|
+
}
|
|
352
|
+
component.attributes.style = {};
|
|
353
|
+
}
|
|
354
|
+
if (component.type !== 'layout') {
|
|
355
|
+
component.attributes.style.width = '100%;';
|
|
356
|
+
}
|
|
347
357
|
return component.type === 'layout' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderComponent(component, index)) : /*#__PURE__*/_react.default.createElement("div", {
|
|
348
358
|
key: index,
|
|
349
359
|
style: {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
verticalAlign: 'middle'
|
|
360
|
+
height: height,
|
|
361
|
+
width: width
|
|
353
362
|
},
|
|
354
|
-
className: `${className}`
|
|
363
|
+
className: `${className} col-*-* no-margin no-spacing`
|
|
355
364
|
}, renderComponent(component, null));
|
|
356
365
|
}));
|
|
357
366
|
}
|
|
358
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
367
|
+
return visible && /*#__PURE__*/_react.default.createElement("div", {
|
|
359
368
|
id: props.config.id,
|
|
360
369
|
style: getLayoutStyle(props.config, 'transparent'),
|
|
361
|
-
className: `${_Utils.default.getComponentAttribute(props.config, 'className',
|
|
370
|
+
className: `${_Utils.default.getComponentAttribute(props.config, 'className', '') + (props.config.orientation === 'HORIZONTAL' ? ' row' : '')}`
|
|
362
371
|
}, render(props.config));
|
|
363
372
|
});
|
|
@@ -41,7 +41,7 @@ const MenuButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
41
41
|
const anchorRef = _react.default.useRef(null);
|
|
42
42
|
let width = !_Utils.default.isNull(props.config.attributes['width']) ? parseInt(props.config.attributes['width'].toString().replace('px', '')) : null;
|
|
43
43
|
const [disabled, setDisabled] = _react.default.useState(false);
|
|
44
|
-
const [
|
|
44
|
+
const [itemHandles] = _react.default.useState({});
|
|
45
45
|
const [config, setConfig] = _react.default.useState(null);
|
|
46
46
|
_react.default.useEffect(() => {
|
|
47
47
|
props.handle.api = api();
|
|
@@ -70,10 +70,10 @@ const MenuButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
70
70
|
}
|
|
71
71
|
setOpen(false);
|
|
72
72
|
};
|
|
73
|
-
function
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
return
|
|
73
|
+
function createItemHandle(item) {
|
|
74
|
+
let handle = {};
|
|
75
|
+
itemHandles[item.id] = handle;
|
|
76
|
+
return handle;
|
|
77
77
|
}
|
|
78
78
|
const api = () => {
|
|
79
79
|
return {
|
|
@@ -84,7 +84,12 @@ const MenuButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
84
84
|
return props.tableRow;
|
|
85
85
|
},
|
|
86
86
|
getChildren: () => {
|
|
87
|
-
|
|
87
|
+
let children = [];
|
|
88
|
+
let properties = Object.getOwnPropertyNames(itemHandles);
|
|
89
|
+
for (const property of properties) {
|
|
90
|
+
children.push(itemHandles[property]);
|
|
91
|
+
}
|
|
92
|
+
return children;
|
|
88
93
|
},
|
|
89
94
|
set disabled(disabled) {
|
|
90
95
|
setDisabled(disabled);
|
|
@@ -158,7 +163,7 @@ const MenuButton = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
158
163
|
config: item,
|
|
159
164
|
viewId: props.viewId,
|
|
160
165
|
key: item.id,
|
|
161
|
-
|
|
166
|
+
handle: createItemHandle(item)
|
|
162
167
|
}))))));
|
|
163
168
|
})));
|
|
164
169
|
});
|
|
@@ -20,6 +20,7 @@ const MenuLink = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
20
20
|
_react.default.useEffect(() => {
|
|
21
21
|
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
22
22
|
if (!_Utils.default.isNull(parsedConfig)) {
|
|
23
|
+
_Observable.default.clearComponentEventListeners(handle);
|
|
23
24
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, handle, props.viewId);
|
|
24
25
|
if (props.autoClick) {
|
|
25
26
|
if (!_Utils.default.isNull(props.clickCallback)) {
|
|
@@ -33,6 +34,11 @@ const MenuLink = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}, [props.config]);
|
|
37
|
+
_react.default.useEffect(() => {
|
|
38
|
+
return () => {
|
|
39
|
+
_Observable.default.clearComponentEventListeners(handle);
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
36
42
|
const handleClick = e => {
|
|
37
43
|
e.preventDefault();
|
|
38
44
|
let event = new _Event.default(handle, props.viewId);
|
|
@@ -35,29 +35,44 @@ const AgilitySignaturePanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_re
|
|
|
35
35
|
const [open, setOpen] = _react.default.useState(false);
|
|
36
36
|
const [signing, setSigning] = _react.default.useState(false);
|
|
37
37
|
const [signatureImage, setSignatureImage] = _react.default.useState(null);
|
|
38
|
+
const [refresher, setRefresher] = _react.default.useState(false);
|
|
38
39
|
const [initialImage, setInitialImage] = _react.default.useState(null);
|
|
39
40
|
const [systemSignatures, setSystemSignatures] = _react.default.useState(null);
|
|
40
41
|
_react.default.useEffect(() => {
|
|
41
42
|
fetchImages();
|
|
42
43
|
}, []);
|
|
44
|
+
const validate = () => {
|
|
45
|
+
let signers = props.config.documents[0].signers;
|
|
46
|
+
for (const signer of signers) {
|
|
47
|
+
if (signer.email === props.config.signatoryId) {
|
|
48
|
+
let signingInputs = signer.signatureInputs;
|
|
49
|
+
for (const signingInput of signingInputs) {
|
|
50
|
+
if (!signingInput.value) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
};
|
|
43
58
|
_react.default.useEffect(() => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
signingInput.value = initialImage;
|
|
54
|
-
}
|
|
59
|
+
let signers = props.config.documents[0].signers;
|
|
60
|
+
for (const signer of signers) {
|
|
61
|
+
if (signer.email === props.config.signatoryId) {
|
|
62
|
+
let signingInputs = signer.signatureInputs;
|
|
63
|
+
for (const signingInput of signingInputs) {
|
|
64
|
+
if ('SIGN' === signingInput.inputType) {
|
|
65
|
+
signingInput.value = signatureImage;
|
|
66
|
+
} else if ('INITIAL' === signingInput.inputType) {
|
|
67
|
+
signingInput.value = initialImage;
|
|
55
68
|
}
|
|
56
69
|
}
|
|
57
70
|
}
|
|
71
|
+
}
|
|
72
|
+
if (validate()) {
|
|
58
73
|
props.valueChangeHandler(signers);
|
|
59
74
|
}
|
|
60
|
-
}, [initialImage, signatureImage]);
|
|
75
|
+
}, [initialImage, signatureImage, refresher]);
|
|
61
76
|
const showInput = mode => {
|
|
62
77
|
setInputMode(mode);
|
|
63
78
|
setOpen(true);
|
|
@@ -125,7 +140,7 @@ const AgilitySignaturePanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_re
|
|
|
125
140
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
126
141
|
id: 'template',
|
|
127
142
|
style: {
|
|
128
|
-
font: 'italic
|
|
143
|
+
font: 'italic 32px Brush Script MT, Brush Script Std, cursive',
|
|
129
144
|
background: 'transparent',
|
|
130
145
|
padding: '8px'
|
|
131
146
|
}
|
|
@@ -202,8 +217,12 @@ const AgilitySignaturePanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_re
|
|
|
202
217
|
}
|
|
203
218
|
}, /*#__PURE__*/_react.default.createElement(_DocumentContainer.default, {
|
|
204
219
|
config: props.config,
|
|
220
|
+
onInputValueChange: sig => {
|
|
221
|
+
setRefresher(!refresher);
|
|
222
|
+
},
|
|
205
223
|
signatureImage: signatureImage,
|
|
206
|
-
initialImage: initialImage
|
|
224
|
+
initialImage: initialImage,
|
|
225
|
+
refresher: refresher
|
|
207
226
|
})));
|
|
208
227
|
}));
|
|
209
228
|
var _default = exports.default = AgilitySignaturePanel;
|
|
@@ -3,8 +3,33 @@
|
|
|
3
3
|
outline: none !important;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.signature-doc-container .dropTarget{
|
|
7
|
+
margin-top: 8px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.signature-doc-container {
|
|
11
|
+
margin-top: 8px;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
background-color: rgb(241, 241, 241);
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.signature-doc-container .dropTarget {
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.signature-doc-container ._draggable_ {
|
|
22
|
+
position: absolute;
|
|
23
|
+
border-radius: 2px;
|
|
24
|
+
display: inline-block;
|
|
25
|
+
margin-left: 4px;
|
|
26
|
+
font-style: italic;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
}
|
|
30
|
+
|
|
6
31
|
.container {
|
|
7
|
-
padding:
|
|
32
|
+
padding: 1px 0 8px 0;
|
|
8
33
|
}
|
|
9
34
|
|
|
10
35
|
.container .row {
|