@reltio/components 1.4.1671 → 1.4.1673
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/editors/TypeaheadEditor/TypeaheadEditor.d.ts +2 -2
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.js +2 -2
- package/cjs/hooks/helpers/sanitizerOptions.js +5 -1
- package/cjs/hooks/useAPI/API.js +28 -0
- package/cjs/hooks/useAPI/helpers.js +1 -1
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +2 -2
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.js +2 -2
- package/esm/hooks/helpers/sanitizerOptions.js +5 -1
- package/esm/hooks/useAPI/API.js +29 -1
- package/esm/hooks/useAPI/helpers.js +1 -1
- package/package.json +2 -2
|
@@ -8,12 +8,12 @@ type CommonProps = Omit<TextFieldProps, 'onChange' | 'value'> & {
|
|
|
8
8
|
isCrossedOut?: boolean;
|
|
9
9
|
};
|
|
10
10
|
type MultipleProps = CommonProps & {
|
|
11
|
-
value
|
|
11
|
+
value?: string[];
|
|
12
12
|
onChange: (values: string[]) => void;
|
|
13
13
|
multiple: true;
|
|
14
14
|
};
|
|
15
15
|
type SingleProps = CommonProps & {
|
|
16
|
-
value
|
|
16
|
+
value?: string;
|
|
17
17
|
onChange: (value: string) => void;
|
|
18
18
|
multiple?: false;
|
|
19
19
|
};
|
|
@@ -201,7 +201,7 @@ var TypeaheadEditor = function (_a) {
|
|
|
201
201
|
case ChangeMethod.Enter: {
|
|
202
202
|
if (multiple === true) {
|
|
203
203
|
if (newValue)
|
|
204
|
-
onChange((0, ramda_1.uniq)(__spreadArray(__spreadArray([], value, true), [newValue], false)));
|
|
204
|
+
onChange((0, ramda_1.uniq)(__spreadArray(__spreadArray([], (value || []), true), [newValue], false)));
|
|
205
205
|
setInputValue('');
|
|
206
206
|
}
|
|
207
207
|
else {
|
|
@@ -242,7 +242,7 @@ var TypeaheadEditor = function (_a) {
|
|
|
242
242
|
underline: (0, classnames_1.default)((_b = {}, _b[styles.underline] = (0, mdm_sdk_1.isEmptyValue)(value), _b)),
|
|
243
243
|
input: (0, classnames_1.default)(styles['rawInput'], (0, ramda_1.path)(['classes', 'input'], InputProps))
|
|
244
244
|
};
|
|
245
|
-
return multiple === true ? (react_1.default.createElement(TextField_1.default, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value.map(function (item, index) { return (react_1.default.createElement(ValueChip_1.default, { key: item, label: item, onDelete: function () { return onChange((0, ramda_1.remove)(index, 1, value)); } })); }), inputComponent: react_input_autosize_1.default, classes: __assign(__assign({ root: (0, classnames_1.default)(styles.multipleTextFieldInput, (0, ramda_1.path)(['classes', 'root'], InputProps)) }, commonClasses), { input: (0, classnames_1.default)(styles.autosizeInput, commonClasses.input), adornedStart: styles.multipleTextFieldAdornedStart }) }), classes: { root: styles.multipleTextField } }))) : (react_1.default.createElement(TextField_1.default, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: (0, classnames_1.default)(styles.inputRoot, (0, ramda_1.path)(['classes', 'root'], InputProps), (_c = {},
|
|
245
|
+
return multiple === true ? (react_1.default.createElement(TextField_1.default, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value === null || value === void 0 ? void 0 : value.map(function (item, index) { return (react_1.default.createElement(ValueChip_1.default, { key: item, label: item, onDelete: function () { return onChange((0, ramda_1.remove)(index, 1, value)); } })); }), inputComponent: react_input_autosize_1.default, classes: __assign(__assign({ root: (0, classnames_1.default)(styles.multipleTextFieldInput, (0, ramda_1.path)(['classes', 'root'], InputProps)) }, commonClasses), { input: (0, classnames_1.default)(styles.autosizeInput, commonClasses.input), adornedStart: styles.multipleTextFieldAdornedStart }) }), classes: { root: styles.multipleTextField } }))) : (react_1.default.createElement(TextField_1.default, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: (0, classnames_1.default)(styles.inputRoot, (0, ramda_1.path)(['classes', 'root'], InputProps), (_c = {},
|
|
246
246
|
_c[styles.isCrossedOut] = isCrossedOut,
|
|
247
247
|
_c)) }, commonClasses) }) })));
|
|
248
248
|
}, renderSuggestionsContainer: function (_a) {
|
package/cjs/hooks/useAPI/API.js
CHANGED
|
@@ -103,6 +103,29 @@ var processRequest = function (_a) {
|
|
|
103
103
|
environment: environment
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
+
var processInstance = function () {
|
|
107
|
+
if (!params.processDefinitionId) {
|
|
108
|
+
return new Promise(function (resolve) { return resolve({ errorMessage: 'processDefinitionId is empty' }); });
|
|
109
|
+
}
|
|
110
|
+
if (!params.changeRequestURI) {
|
|
111
|
+
return new Promise(function (resolve) { return resolve({ errorMessage: 'changeRequestURI is empty' }); });
|
|
112
|
+
}
|
|
113
|
+
if (!workflowPath) {
|
|
114
|
+
return new Promise(function (resolve) { return resolve({ errorMessage: 'Workflow path is not defined' }); });
|
|
115
|
+
}
|
|
116
|
+
var errors = validateParams('/processInstances', permissions);
|
|
117
|
+
if (errors) {
|
|
118
|
+
return new Promise(function (resolve) { return resolve(errors); });
|
|
119
|
+
}
|
|
120
|
+
return (0, mdm_sdk_1.startProcessInstance)({
|
|
121
|
+
workflowPath: workflowPath,
|
|
122
|
+
processType: params.processDefinitionId,
|
|
123
|
+
tenant: tenant,
|
|
124
|
+
environment: environment,
|
|
125
|
+
objectURIs: [entityUri, params.changeRequestURI],
|
|
126
|
+
comment: params.comment
|
|
127
|
+
});
|
|
128
|
+
};
|
|
106
129
|
var workflowRequest = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
130
|
var errors, isExternalUrl, headers;
|
|
108
131
|
return __generator(this, function (_a) {
|
|
@@ -182,6 +205,11 @@ var processRequest = function (_a) {
|
|
|
182
205
|
handleRequest(request);
|
|
183
206
|
break;
|
|
184
207
|
}
|
|
208
|
+
case mdm_sdk_1.RequestAction.WORKFLOW_START_PROCESS_INSTANCE: {
|
|
209
|
+
var request = processInstance();
|
|
210
|
+
handleRequest(request);
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
185
213
|
case mdm_sdk_1.RequestAction.GET_CONFIGURATION: {
|
|
186
214
|
worker.postMessage(__assign({ action: 'response', result: metadata }, params));
|
|
187
215
|
break;
|
|
@@ -82,7 +82,7 @@ var processInnerHtml = function (parent, worker, setTooltip) {
|
|
|
82
82
|
worker.postMessage({
|
|
83
83
|
action: 'event',
|
|
84
84
|
type: 'uiAction',
|
|
85
|
-
data: { type: uiAction, id: id, event: __assign(__assign({}, event), { files: files }) }
|
|
85
|
+
data: { type: uiAction, id: id, event: __assign(__assign({}, event), { files: files, target: { value: target.value } }) }
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
88
|
if ((_a = target.files) === null || _a === void 0 ? void 0 : _a.length) {
|
|
@@ -8,12 +8,12 @@ type CommonProps = Omit<TextFieldProps, 'onChange' | 'value'> & {
|
|
|
8
8
|
isCrossedOut?: boolean;
|
|
9
9
|
};
|
|
10
10
|
type MultipleProps = CommonProps & {
|
|
11
|
-
value
|
|
11
|
+
value?: string[];
|
|
12
12
|
onChange: (values: string[]) => void;
|
|
13
13
|
multiple: true;
|
|
14
14
|
};
|
|
15
15
|
type SingleProps = CommonProps & {
|
|
16
|
-
value
|
|
16
|
+
value?: string;
|
|
17
17
|
onChange: (value: string) => void;
|
|
18
18
|
multiple?: false;
|
|
19
19
|
};
|
|
@@ -173,7 +173,7 @@ var TypeaheadEditor = function (_a) {
|
|
|
173
173
|
case ChangeMethod.Enter: {
|
|
174
174
|
if (multiple === true) {
|
|
175
175
|
if (newValue)
|
|
176
|
-
onChange(uniq(__spreadArray(__spreadArray([], value, true), [newValue], false)));
|
|
176
|
+
onChange(uniq(__spreadArray(__spreadArray([], (value || []), true), [newValue], false)));
|
|
177
177
|
setInputValue('');
|
|
178
178
|
}
|
|
179
179
|
else {
|
|
@@ -214,7 +214,7 @@ var TypeaheadEditor = function (_a) {
|
|
|
214
214
|
underline: classnames((_b = {}, _b[styles.underline] = isEmptyValue(value), _b)),
|
|
215
215
|
input: classnames(styles['rawInput'], path(['classes', 'input'], InputProps))
|
|
216
216
|
};
|
|
217
|
-
return multiple === true ? (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value.map(function (item, index) { return (React.createElement(ValueChip, { key: item, label: item, onDelete: function () { return onChange(remove(index, 1, value)); } })); }), inputComponent: AutosizeInput, classes: __assign(__assign({ root: classnames(styles.multipleTextFieldInput, path(['classes', 'root'], InputProps)) }, commonClasses), { input: classnames(styles.autosizeInput, commonClasses.input), adornedStart: styles.multipleTextFieldAdornedStart }) }), classes: { root: styles.multipleTextField } }))) : (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: classnames(styles.inputRoot, path(['classes', 'root'], InputProps), (_c = {},
|
|
217
|
+
return multiple === true ? (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value === null || value === void 0 ? void 0 : value.map(function (item, index) { return (React.createElement(ValueChip, { key: item, label: item, onDelete: function () { return onChange(remove(index, 1, value)); } })); }), inputComponent: AutosizeInput, classes: __assign(__assign({ root: classnames(styles.multipleTextFieldInput, path(['classes', 'root'], InputProps)) }, commonClasses), { input: classnames(styles.autosizeInput, commonClasses.input), adornedStart: styles.multipleTextFieldAdornedStart }) }), classes: { root: styles.multipleTextField } }))) : (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: classnames(styles.inputRoot, path(['classes', 'root'], InputProps), (_c = {},
|
|
218
218
|
_c[styles.isCrossedOut] = isCrossedOut,
|
|
219
219
|
_c)) }, commonClasses) }) })));
|
|
220
220
|
}, renderSuggestionsContainer: function (_a) {
|
package/esm/hooks/useAPI/API.js
CHANGED
|
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import { getAccessToken, RequestAction, sendRequestFromCustomSandbox, sendWorkflowRequest, startProcessFromQuery } from '@reltio/mdm-sdk';
|
|
48
|
+
import { getAccessToken, RequestAction, sendRequestFromCustomSandbox, sendWorkflowRequest, startProcessFromQuery, startProcessInstance } from '@reltio/mdm-sdk';
|
|
49
49
|
var validateParams = function (validationUrl, permissions) {
|
|
50
50
|
if (!validationUrl)
|
|
51
51
|
return { errorMessage: 'URL is empty' };
|
|
@@ -100,6 +100,29 @@ export var processRequest = function (_a) {
|
|
|
100
100
|
environment: environment
|
|
101
101
|
});
|
|
102
102
|
};
|
|
103
|
+
var processInstance = function () {
|
|
104
|
+
if (!params.processDefinitionId) {
|
|
105
|
+
return new Promise(function (resolve) { return resolve({ errorMessage: 'processDefinitionId is empty' }); });
|
|
106
|
+
}
|
|
107
|
+
if (!params.changeRequestURI) {
|
|
108
|
+
return new Promise(function (resolve) { return resolve({ errorMessage: 'changeRequestURI is empty' }); });
|
|
109
|
+
}
|
|
110
|
+
if (!workflowPath) {
|
|
111
|
+
return new Promise(function (resolve) { return resolve({ errorMessage: 'Workflow path is not defined' }); });
|
|
112
|
+
}
|
|
113
|
+
var errors = validateParams('/processInstances', permissions);
|
|
114
|
+
if (errors) {
|
|
115
|
+
return new Promise(function (resolve) { return resolve(errors); });
|
|
116
|
+
}
|
|
117
|
+
return startProcessInstance({
|
|
118
|
+
workflowPath: workflowPath,
|
|
119
|
+
processType: params.processDefinitionId,
|
|
120
|
+
tenant: tenant,
|
|
121
|
+
environment: environment,
|
|
122
|
+
objectURIs: [entityUri, params.changeRequestURI],
|
|
123
|
+
comment: params.comment
|
|
124
|
+
});
|
|
125
|
+
};
|
|
103
126
|
var workflowRequest = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
104
127
|
var errors, isExternalUrl, headers;
|
|
105
128
|
return __generator(this, function (_a) {
|
|
@@ -179,6 +202,11 @@ export var processRequest = function (_a) {
|
|
|
179
202
|
handleRequest(request);
|
|
180
203
|
break;
|
|
181
204
|
}
|
|
205
|
+
case RequestAction.WORKFLOW_START_PROCESS_INSTANCE: {
|
|
206
|
+
var request = processInstance();
|
|
207
|
+
handleRequest(request);
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
182
210
|
case RequestAction.GET_CONFIGURATION: {
|
|
183
211
|
worker.postMessage(__assign({ action: 'response', result: metadata }, params));
|
|
184
212
|
break;
|
|
@@ -72,7 +72,7 @@ var processInnerHtml = function (parent, worker, setTooltip) {
|
|
|
72
72
|
worker.postMessage({
|
|
73
73
|
action: 'event',
|
|
74
74
|
type: 'uiAction',
|
|
75
|
-
data: { type: uiAction, id: id, event: __assign(__assign({}, event), { files: files }) }
|
|
75
|
+
data: { type: uiAction, id: id, event: __assign(__assign({}, event), { files: files, target: { value: target.value } }) }
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
if ((_a = target.files) === null || _a === void 0 ? void 0 : _a.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1673",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
10
10
|
"@react-google-maps/api": "2.7.0",
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1673",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|