@agilemotion/oui-react-js 1.2.9 → 1.3.1
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/ApplicationContext.js +90 -36
- package/dist/BasicApp.js +4 -4
- package/dist/BasicAppHome.js +4 -2
- package/dist/RestUtils.js +11 -4
- package/dist/assets/css/black-dashboard-react.css +1 -2
- package/dist/assets/scss/black-dashboard-react/bootstrap/_reboot.scss +0 -1
- package/dist/components/DocumentView.css +4 -0
- package/dist/components/DocumentViewer.js +93 -37
- package/dist/components/DocumentViewerComponent.js +93 -0
- package/dist/components/ElementResizeHandler.js +232 -0
- package/dist/components/Graph.js +102 -6
- package/dist/components/GraphNode.js +1 -1
- package/dist/components/HtmlPanel.js +45 -4
- package/dist/components/StepperTitleBar.css +85 -0
- package/dist/components/StepperTitleBar.js +188 -0
- package/dist/components/TitleBar.js +1 -1
- package/dist/components/Toolbar.js +6 -3
- package/dist/components/form/Form.js +2 -2
- package/dist/components/form/UploadField.js +1 -1
- package/dist/components/layout/Layout.js +28 -14
- package/dist/components/signatures/AlertItem.js +71 -0
- package/dist/components/signatures/Card.js +39 -0
- package/dist/components/signatures/MenuButton.js +108 -0
- package/dist/components/signatures/Prompt.js +78 -0
- package/dist/components/signatures/ResponsiveTable.css +91 -0
- package/dist/components/signatures/ResponsiveTable.js +568 -0
- package/dist/components/signatures/SearchView.js +236 -0
- package/dist/components/signatures/SignatorySearch.js +115 -0
- package/dist/components/signatures/SignatorySearchForm.js +77 -0
- package/dist/components/signatures/SignatureInputProps.js +336 -0
- package/dist/components/signatures/SignatureTemplateDesigner.js +888 -0
- package/dist/components/signatures/Toolbar.js +208 -0
- package/dist/components/signatures/ViewUtils.js +309 -0
- package/dist/components/signatures/widgets.css +126 -0
- package/package.json +5 -4
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SigPropsLookupField = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
13
|
+
|
|
14
|
+
var _Search = _interopRequireDefault(require("@material-ui/icons/Search"));
|
|
15
|
+
|
|
16
|
+
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
17
|
+
|
|
18
|
+
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
19
|
+
|
|
20
|
+
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
21
|
+
|
|
22
|
+
var _core = require("@material-ui/core");
|
|
23
|
+
|
|
24
|
+
var _SignatorySearch = _interopRequireDefault(require("./SignatorySearch"));
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
29
|
+
|
|
30
|
+
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."); }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
38
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
|
+
|
|
40
|
+
const isNull = val => {
|
|
41
|
+
return val === null || typeof val === 'undefined';
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const useStyles = (0, _core.makeStyles)(theme => ({
|
|
45
|
+
button: {
|
|
46
|
+
width: "288px",
|
|
47
|
+
height: "40px",
|
|
48
|
+
backgroundColor: "#e1e1e1",
|
|
49
|
+
marginTop: "4px",
|
|
50
|
+
marginBottom: "4px",
|
|
51
|
+
textAlign: "center",
|
|
52
|
+
padding: "28px 0",
|
|
53
|
+
borderRadius: "4px"
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
const SigPropsLookupField = /*#__PURE__*/_react.default.forwardRef(props => {
|
|
58
|
+
const _React$useState = _react.default.useState(null),
|
|
59
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
60
|
+
currentSelection = _React$useState2[0],
|
|
61
|
+
setCurrentSelection = _React$useState2[1];
|
|
62
|
+
|
|
63
|
+
const _React$useState3 = _react.default.useState(props.value),
|
|
64
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
65
|
+
value = _React$useState4[0],
|
|
66
|
+
setValue = _React$useState4[1];
|
|
67
|
+
|
|
68
|
+
const _React$useState5 = _react.default.useState(false),
|
|
69
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
70
|
+
open = _React$useState6[0],
|
|
71
|
+
setOpen = _React$useState6[1];
|
|
72
|
+
|
|
73
|
+
_react.default.useEffect(() => {
|
|
74
|
+
setValue(props.value);
|
|
75
|
+
}, [props.value]);
|
|
76
|
+
|
|
77
|
+
const handleClose = () => {
|
|
78
|
+
setOpen(false);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const setSelectionAsValue = () => {
|
|
82
|
+
currentSelection.toString = () => {
|
|
83
|
+
return currentSelection.map['name'];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
setValue(currentSelection);
|
|
87
|
+
props.valueChangeHandler('signatory', currentSelection);
|
|
88
|
+
handleClose();
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const openSearch = () => {
|
|
92
|
+
setOpen(true);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
className: "w-100 lookup"
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement("table", {
|
|
98
|
+
className: "w-100"
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
100
|
+
width: "250px"
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
102
|
+
style: {
|
|
103
|
+
width: '250px'
|
|
104
|
+
},
|
|
105
|
+
InputProps: {
|
|
106
|
+
readOnly: true
|
|
107
|
+
},
|
|
108
|
+
label: 'Signatory',
|
|
109
|
+
value: value || '',
|
|
110
|
+
error: props.error,
|
|
111
|
+
disabled: props.disabled,
|
|
112
|
+
required: true,
|
|
113
|
+
size: "small",
|
|
114
|
+
margin: "normal",
|
|
115
|
+
variant: "outlined"
|
|
116
|
+
})), /*#__PURE__*/_react.default.createElement("td", {
|
|
117
|
+
valign: "middle",
|
|
118
|
+
align: "left"
|
|
119
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
120
|
+
onClick: openSearch,
|
|
121
|
+
disabled: props.disabled,
|
|
122
|
+
"aria-label": "search"
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_Search.default, null)))))), /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
124
|
+
open: open,
|
|
125
|
+
onClose: handleClose,
|
|
126
|
+
"aria-labelledby": "form-dialog-title",
|
|
127
|
+
fullWidth: true,
|
|
128
|
+
maxWidth: "md",
|
|
129
|
+
disableBackdropClick: true
|
|
130
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
131
|
+
style: {
|
|
132
|
+
overflow: "hidden"
|
|
133
|
+
}
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
135
|
+
style: {
|
|
136
|
+
height: "auto",
|
|
137
|
+
overflow: "auto"
|
|
138
|
+
}
|
|
139
|
+
}, /*#__PURE__*/_react.default.createElement(_SignatorySearch.default, {
|
|
140
|
+
signatoryUrl: props.signatoryUrl,
|
|
141
|
+
onLookupValueChange: selection => setCurrentSelection(selection[0])
|
|
142
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
143
|
+
style: {
|
|
144
|
+
paddingTop: "4px"
|
|
145
|
+
}
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
147
|
+
onClick: handleClose,
|
|
148
|
+
color: "primary"
|
|
149
|
+
}, "Cancel"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
150
|
+
onClick: setSelectionAsValue,
|
|
151
|
+
color: "primary",
|
|
152
|
+
disabled: currentSelection === null || typeof currentSelection === 'undefined'
|
|
153
|
+
}, "Ok"))))));
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
exports.SigPropsLookupField = SigPropsLookupField;
|
|
157
|
+
|
|
158
|
+
const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
159
|
+
const classes = useStyles();
|
|
160
|
+
|
|
161
|
+
const _React$useState7 = _react.default.useState(props.value),
|
|
162
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
163
|
+
value = _React$useState8[0],
|
|
164
|
+
setValue = _React$useState8[1];
|
|
165
|
+
|
|
166
|
+
const _React$useState9 = _react.default.useState(''),
|
|
167
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
168
|
+
width = _React$useState10[0],
|
|
169
|
+
setWidth = _React$useState10[1];
|
|
170
|
+
|
|
171
|
+
const _React$useState11 = _react.default.useState(''),
|
|
172
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
173
|
+
height = _React$useState12[0],
|
|
174
|
+
setHeight = _React$useState12[1];
|
|
175
|
+
|
|
176
|
+
const _React$useState13 = _react.default.useState(null),
|
|
177
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
178
|
+
signatory = _React$useState14[0],
|
|
179
|
+
setSignatory = _React$useState14[1];
|
|
180
|
+
|
|
181
|
+
const _React$useState15 = _react.default.useState(true),
|
|
182
|
+
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
183
|
+
widthValid = _React$useState16[0],
|
|
184
|
+
setWidthValid = _React$useState16[1];
|
|
185
|
+
|
|
186
|
+
const _React$useState17 = _react.default.useState(true),
|
|
187
|
+
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
188
|
+
heightValid = _React$useState18[0],
|
|
189
|
+
setHeightValid = _React$useState18[1];
|
|
190
|
+
|
|
191
|
+
const _React$useState19 = _react.default.useState(isNull(props.value) || !isNull(props.value.signatory)),
|
|
192
|
+
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
193
|
+
signatoryValid = _React$useState20[0],
|
|
194
|
+
setSignatoryValid = _React$useState20[1];
|
|
195
|
+
|
|
196
|
+
_react.default.useEffect(() => {
|
|
197
|
+
setValue(props.value);
|
|
198
|
+
|
|
199
|
+
if (props.value !== null) {
|
|
200
|
+
setWidth(props.value.width);
|
|
201
|
+
setHeight(props.value.height);
|
|
202
|
+
setSignatory(props.value.signatory);
|
|
203
|
+
setWidthValid(validateNumeric(props.value.width, 320));
|
|
204
|
+
setHeightValid(validateNumeric(props.value.height, 150));
|
|
205
|
+
setSignatoryValid(!isNull(props.value.signatory));
|
|
206
|
+
} else {
|
|
207
|
+
setWidth('');
|
|
208
|
+
setHeight('');
|
|
209
|
+
setSignatory(null);
|
|
210
|
+
}
|
|
211
|
+
}, [props.value]);
|
|
212
|
+
|
|
213
|
+
_react.default.useEffect(() => {
|
|
214
|
+
if (!isNull(value)) {
|
|
215
|
+
let widthCheck = validateNumeric(width, 320);
|
|
216
|
+
setWidthValid(widthCheck);
|
|
217
|
+
let heightCheck = validateNumeric(height, 150);
|
|
218
|
+
setHeightValid(heightCheck);
|
|
219
|
+
let signatoryCheck = !isNull(signatory);
|
|
220
|
+
setSignatoryValid(signatoryCheck);
|
|
221
|
+
|
|
222
|
+
if (!isNull(value) && widthCheck && heightCheck && signatoryCheck) {
|
|
223
|
+
save();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}, [width, height, signatory]);
|
|
227
|
+
|
|
228
|
+
const handleDelete = () => {
|
|
229
|
+
props.deleteHandler(value.id);
|
|
230
|
+
setWidth('');
|
|
231
|
+
setHeight('');
|
|
232
|
+
setSignatory(null);
|
|
233
|
+
setValue(null);
|
|
234
|
+
setSignatoryValid(true);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const handleApplyToAllPages = () => {
|
|
238
|
+
props.dublicateHandler(value.id);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const validateNumeric = (val, maxVal) => {
|
|
242
|
+
let regex = new RegExp('^[0-9]+$');
|
|
243
|
+
return !isNull(val) && regex.test(val) && parseFloat(val) <= maxVal;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
const valueChangeHandler = (field, fieldValue) => {
|
|
247
|
+
if ('width' === field) {
|
|
248
|
+
setWidth(fieldValue);
|
|
249
|
+
} else if ('height' === field) {
|
|
250
|
+
setHeight(fieldValue);
|
|
251
|
+
} else if ('signatory' === field) {
|
|
252
|
+
setSignatory(fieldValue);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const save = () => {
|
|
257
|
+
let values = {
|
|
258
|
+
width: width,
|
|
259
|
+
height: height,
|
|
260
|
+
signatory: signatory,
|
|
261
|
+
type: value.type
|
|
262
|
+
};
|
|
263
|
+
props.saveHandler(value.id, values);
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
267
|
+
className: "row"
|
|
268
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
269
|
+
className: "col",
|
|
270
|
+
style: {
|
|
271
|
+
fontSize: "16px",
|
|
272
|
+
marginTop: "16px"
|
|
273
|
+
}
|
|
274
|
+
}, "Properties"), /*#__PURE__*/_react.default.createElement("div", {
|
|
275
|
+
className: "col"
|
|
276
|
+
}, /*#__PURE__*/_react.default.createElement(SigPropsLookupField, {
|
|
277
|
+
value: signatory,
|
|
278
|
+
valueChangeHandler: valueChangeHandler,
|
|
279
|
+
disabled: value === null,
|
|
280
|
+
signatoryUrl: props.signatoryUrl,
|
|
281
|
+
error: !signatoryValid
|
|
282
|
+
}), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
283
|
+
style: {
|
|
284
|
+
width: '288px'
|
|
285
|
+
},
|
|
286
|
+
label: 'Type',
|
|
287
|
+
value: value !== null ? value.type : '',
|
|
288
|
+
disabled: true,
|
|
289
|
+
size: "small",
|
|
290
|
+
margin: "dense",
|
|
291
|
+
variant: "outlined"
|
|
292
|
+
}), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
293
|
+
style: {
|
|
294
|
+
width: '288px'
|
|
295
|
+
},
|
|
296
|
+
label: 'Width',
|
|
297
|
+
value: width,
|
|
298
|
+
disabled: value === null,
|
|
299
|
+
required: true,
|
|
300
|
+
error: !widthValid,
|
|
301
|
+
size: "small",
|
|
302
|
+
margin: "dense",
|
|
303
|
+
onChange: e => valueChangeHandler("width", e.target.value),
|
|
304
|
+
variant: "outlined"
|
|
305
|
+
}), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
306
|
+
style: {
|
|
307
|
+
width: '288px'
|
|
308
|
+
},
|
|
309
|
+
label: 'Height',
|
|
310
|
+
value: height,
|
|
311
|
+
disabled: value === null,
|
|
312
|
+
required: true,
|
|
313
|
+
error: !heightValid,
|
|
314
|
+
size: "small",
|
|
315
|
+
margin: "dense",
|
|
316
|
+
onChange: e => valueChangeHandler("height", e.target.value),
|
|
317
|
+
variant: "outlined"
|
|
318
|
+
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
319
|
+
variant: "contained",
|
|
320
|
+
component: "span",
|
|
321
|
+
className: classes.button,
|
|
322
|
+
onClick: () => handleApplyToAllPages(),
|
|
323
|
+
disabled: value === null || !widthValid || !heightValid || !signatoryValid,
|
|
324
|
+
id: "signPaletteButton"
|
|
325
|
+
}, "DUPLICATE ITEM ON ALL PAGES"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
326
|
+
variant: "contained",
|
|
327
|
+
component: "span",
|
|
328
|
+
className: classes.button,
|
|
329
|
+
disabled: value === null,
|
|
330
|
+
onClick: () => handleDelete(),
|
|
331
|
+
id: "signPaletteButton"
|
|
332
|
+
}, "DELETE ITEM")));
|
|
333
|
+
}));
|
|
334
|
+
|
|
335
|
+
var _default = SignatureInputProps;
|
|
336
|
+
exports.default = _default;
|