@reltio/components 1.4.896 → 1.4.897
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/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +6 -12
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +8 -0
- package/cjs/components/workflow/components/AttributesChanges/AttributesChanges.js +47 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +11 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js +27 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/styles.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +55 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +7 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +25 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +15 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +61 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +5 -0
- package/cjs/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +18 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.d.ts +9 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.js +18 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.js +12 -0
- package/cjs/components/workflow/components/AttributesChanges/constants/operations.d.ts +25 -0
- package/cjs/components/workflow/components/AttributesChanges/constants/operations.js +30 -0
- package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +3 -0
- package/cjs/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.js +9 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +2 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +89 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/contextHelpers.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/contextHelpers.js +5 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +12 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/helpers.js +88 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +4 -0
- package/cjs/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +137 -0
- package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +6 -0
- package/cjs/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +18 -0
- package/cjs/components/workflow/components/AttributesChanges/styles.d.ts +1 -0
- package/cjs/components/workflow/components/AttributesChanges/styles.js +27 -0
- package/cjs/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts +63 -0
- package/cjs/components/workflow/components/AttributesChanges/types/DCRTypes.js +2 -0
- package/cjs/components/workflow/components/LineDecorator/styles.js +4 -2
- package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +7 -13
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.d.ts +8 -0
- package/esm/components/workflow/components/AttributesChanges/AttributesChanges.js +23 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts +11 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js +22 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/styles.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/components/ChangeView/styles.js +52 -0
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +7 -0
- package/esm/components/workflow/components/AttributesChanges/components/DCRChangesList/DCRChangesList.js +20 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +15 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js +37 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.d.ts +5 -0
- package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js +15 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.d.ts +9 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/ShowMoreLink.js +13 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/components/ShowMoreLink/styles.js +9 -0
- package/esm/components/workflow/components/AttributesChanges/constants/operations.d.ts +25 -0
- package/esm/components/workflow/components/AttributesChanges/constants/operations.js +27 -0
- package/esm/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.d.ts +3 -0
- package/esm/components/workflow/components/AttributesChanges/contexts/AttributesChangesContext.js +3 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.d.ts +2 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/attributesHelpers.js +86 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/contextHelpers.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/contextHelpers.js +2 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.d.ts +12 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/helpers.js +77 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.d.ts +4 -0
- package/esm/components/workflow/components/AttributesChanges/helpers/mergeHelpers.js +134 -0
- package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.d.ts +6 -0
- package/esm/components/workflow/components/AttributesChanges/hooks/useCollapsibleList.js +14 -0
- package/esm/components/workflow/components/AttributesChanges/styles.d.ts +1 -0
- package/esm/components/workflow/components/AttributesChanges/styles.js +24 -0
- package/esm/components/workflow/components/AttributesChanges/types/DCRTypes.d.ts +63 -0
- package/esm/components/workflow/components/AttributesChanges/types/DCRTypes.js +1 -0
- package/esm/components/workflow/components/LineDecorator/styles.js +4 -2
- package/package.json +3 -3
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.getDataTypeDefinition = exports.extractObjectsFromChangeRequest = exports.getAttributeDescription = exports.getOperationLabel = exports.getOperationType = void 0;
|
|
18
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
19
|
+
var ramda_1 = require("ramda");
|
|
20
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
21
|
+
var operations_1 = require("../constants/operations");
|
|
22
|
+
var getOperationType = function (type, oldValue) {
|
|
23
|
+
switch (type) {
|
|
24
|
+
case operations_1.DCRTypes.CREATE_RELATIONSHIP:
|
|
25
|
+
case operations_1.DCRTypes.INSERT_ATTRIBUTE:
|
|
26
|
+
return operations_1.OperationTypes.ADDED;
|
|
27
|
+
case operations_1.DCRTypes.UPDATE_TAGS:
|
|
28
|
+
case operations_1.DCRTypes.UPDATE_ROLES:
|
|
29
|
+
case operations_1.DCRTypes.UPDATE_ATTRIBUTE:
|
|
30
|
+
return operations_1.OperationTypes.EDITED;
|
|
31
|
+
case operations_1.DCRTypes.DELETE_ATTRIBUTE:
|
|
32
|
+
case operations_1.DCRTypes.DELETE_RELATIONSHIP:
|
|
33
|
+
return operations_1.OperationTypes.DELETED;
|
|
34
|
+
case operations_1.DCRTypes.PIN_ATTRIBUTE:
|
|
35
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.pin) ? operations_1.OperationTypes.PIN_DELETED : operations_1.OperationTypes.PINNED;
|
|
36
|
+
case operations_1.DCRTypes.IGNORE_ATTRIBUTE:
|
|
37
|
+
return (oldValue === null || oldValue === void 0 ? void 0 : oldValue.ignored) ? operations_1.OperationTypes.IGNORE_DELETED : operations_1.OperationTypes.IGNORED;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.getOperationType = getOperationType;
|
|
41
|
+
var getOperationLabel = function (operation) {
|
|
42
|
+
var _a;
|
|
43
|
+
var labels = (_a = {},
|
|
44
|
+
_a[operations_1.OperationTypes.ADDED] = ui_i18n_1.default.text('added'),
|
|
45
|
+
_a[operations_1.OperationTypes.EDITED] = ui_i18n_1.default.text('edited'),
|
|
46
|
+
_a[operations_1.OperationTypes.DELETED] = ui_i18n_1.default.text('deleted'),
|
|
47
|
+
_a[operations_1.OperationTypes.PINNED] = ui_i18n_1.default.text('pinned'),
|
|
48
|
+
_a[operations_1.OperationTypes.PIN_DELETED] = ui_i18n_1.default.text('pin deleted'),
|
|
49
|
+
_a[operations_1.OperationTypes.IGNORED] = ui_i18n_1.default.text('ignored'),
|
|
50
|
+
_a[operations_1.OperationTypes.IGNORE_DELETED] = ui_i18n_1.default.text('ignore deleted'),
|
|
51
|
+
_a);
|
|
52
|
+
return labels[operation] || '';
|
|
53
|
+
};
|
|
54
|
+
exports.getOperationLabel = getOperationLabel;
|
|
55
|
+
var getAttributeDescription = function (attrType, value, currentEntityUri, objectsInfo) {
|
|
56
|
+
if (objectsInfo === void 0) { objectsInfo = {}; }
|
|
57
|
+
var objectLabel, objectUri, entityTypeUri;
|
|
58
|
+
var relation = objectsInfo[value.refObjectURI];
|
|
59
|
+
if (relation) {
|
|
60
|
+
objectUri = currentEntityUri === relation.startObjectUri ? relation.endObjectUri : relation.startObjectUri;
|
|
61
|
+
objectLabel =
|
|
62
|
+
currentEntityUri === relation.startObjectUri ? relation.endObjectLabel : relation.startObjectLabel;
|
|
63
|
+
}
|
|
64
|
+
else if (value.refEntity) {
|
|
65
|
+
objectUri = value.refEntity.objectURI;
|
|
66
|
+
objectLabel = objectsInfo[objectUri].label;
|
|
67
|
+
}
|
|
68
|
+
if (objectUri && objectLabel) {
|
|
69
|
+
var objectInfo = objectsInfo[objectUri];
|
|
70
|
+
entityTypeUri = objectInfo ? objectInfo.type : attrType.referencedEntityTypeURI;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
objectUri: objectUri,
|
|
74
|
+
objectLabel: objectLabel,
|
|
75
|
+
entityTypeUri: entityTypeUri
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
exports.getAttributeDescription = getAttributeDescription;
|
|
79
|
+
var extractObjectsFromChangeRequest = function (_a) {
|
|
80
|
+
var _b = _a.objectsInfo, objectsInfo = _b === void 0 ? {} : _b, _c = _a.changes, changes = _c === void 0 ? {} : _c;
|
|
81
|
+
var getChange = function (key) { return ramda_1.prop([key], changes); };
|
|
82
|
+
return ramda_1.pipe(ramda_1.keys, ramda_1.filter(getChange), ramda_1.map(function (key) { return (__assign(__assign({}, objectsInfo[key]), { uri: key })); }))(objectsInfo);
|
|
83
|
+
};
|
|
84
|
+
exports.extractObjectsFromChangeRequest = extractObjectsFromChangeRequest;
|
|
85
|
+
var getDataTypeDefinition = function (attributeType, attributeValue) {
|
|
86
|
+
return ramda_1.when(ramda_1.allPass([ramda_1.pipe(ramda_1.prop('type'), ramda_1.equals(mdm_sdk_1.DataTypes.TYPE_STRING)), function () { return mdm_sdk_1.isUrl(attributeValue); }]), ramda_1.evolve({ type: ramda_1.always(mdm_sdk_1.DataTypes.TYPE_URL) }))(mdm_sdk_1.getAttrDataTypeDefinition(attributeType));
|
|
87
|
+
};
|
|
88
|
+
exports.getDataTypeDefinition = getDataTypeDefinition;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeChanges = void 0;
|
|
4
|
+
var ramda_1 = require("ramda");
|
|
5
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
6
|
+
var operations_1 = require("../constants/operations");
|
|
7
|
+
var attributesHelpers_1 = require("./attributesHelpers");
|
|
8
|
+
var ATTRIBUTE_DELIMITER = '/';
|
|
9
|
+
var SPECIAL_ATTRIBUTES_NAMES = [
|
|
10
|
+
'defaultProfilePicValue',
|
|
11
|
+
mdm_sdk_1.EntityAttrTypes.tags.name,
|
|
12
|
+
mdm_sdk_1.EntityAttrTypes.roles.name,
|
|
13
|
+
mdm_sdk_1.EntityAttrTypes.startDate.name,
|
|
14
|
+
mdm_sdk_1.EntityAttrTypes.endDate.name
|
|
15
|
+
];
|
|
16
|
+
var prepareStartOrEndDate = function (_a) {
|
|
17
|
+
var newValue = _a.newValue, oldValue = _a.oldValue;
|
|
18
|
+
var parseValue = function (value) { return (ramda_1.is(String) ? parseInt(value) : value); };
|
|
19
|
+
var isExistedValue = function (value) { return (value === null || value === void 0 ? void 0 : value.length) && !mdm_sdk_1.isEmptyValue(value); };
|
|
20
|
+
var isExistNewValue = isExistedValue(newValue);
|
|
21
|
+
var isExistOldValue = isExistedValue(oldValue);
|
|
22
|
+
if (isExistNewValue && isExistOldValue) {
|
|
23
|
+
return {
|
|
24
|
+
type: operations_1.DCRTypes.UPDATE_ATTRIBUTE,
|
|
25
|
+
oldValue: { value: parseValue(oldValue[0]) },
|
|
26
|
+
newValue: { value: parseValue(newValue[0]) }
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
else if (isExistNewValue) {
|
|
30
|
+
return {
|
|
31
|
+
type: operations_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
32
|
+
newValue: { value: parseValue(newValue[0]) }
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else if (isExistOldValue) {
|
|
36
|
+
return {
|
|
37
|
+
type: operations_1.DCRTypes.DELETE_ATTRIBUTE,
|
|
38
|
+
oldValue: { value: parseValue(oldValue[0]) }
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var prepareRolesOrTags = function (change, metadata) {
|
|
43
|
+
var _a = change.newValue, newValue = _a === void 0 ? [] : _a, _b = change.oldValue, oldValue = _b === void 0 ? [] : _b, type = change.type;
|
|
44
|
+
var getLabel = type === operations_1.DCRTypes.UPDATE_ROLES ? mdm_sdk_1.getRoleLabel(metadata) : ramda_1.identity;
|
|
45
|
+
var diffNewValue = ramda_1.difference(newValue, oldValue);
|
|
46
|
+
var diffOldValue = ramda_1.difference(oldValue, newValue);
|
|
47
|
+
var items = [];
|
|
48
|
+
if (diffNewValue.length) {
|
|
49
|
+
items.push({
|
|
50
|
+
type: operations_1.DCRTypes.INSERT_ATTRIBUTE,
|
|
51
|
+
newValue: { value: diffNewValue.map(getLabel).join(', ') }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (diffOldValue.length) {
|
|
55
|
+
items.push({
|
|
56
|
+
type: operations_1.DCRTypes.DELETE_ATTRIBUTE,
|
|
57
|
+
oldValue: { value: diffOldValue.map(getLabel).join(', ') }
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return items;
|
|
61
|
+
};
|
|
62
|
+
var getPath = function (change) {
|
|
63
|
+
var type = change.type, attributePath = change.attributePath, refObjectURI = change.refObjectURI, refAttributeType = change.refAttributeType;
|
|
64
|
+
var path = type === operations_1.DCRTypes.INSERT_ATTRIBUTE ? mdm_sdk_1.generateTempUri(attributePath) : attributePath;
|
|
65
|
+
if (refObjectURI) {
|
|
66
|
+
var typePath = refAttributeType.split('/attributes/');
|
|
67
|
+
var id = refObjectURI.split(ATTRIBUTE_DELIMITER)[1];
|
|
68
|
+
return [typePath[1], id, path].join(ATTRIBUTE_DELIMITER);
|
|
69
|
+
}
|
|
70
|
+
return path;
|
|
71
|
+
};
|
|
72
|
+
var prepareAttribute = function (container, change) {
|
|
73
|
+
var _a;
|
|
74
|
+
var changePath = getPath(change);
|
|
75
|
+
var pathArray = changePath.split(ATTRIBUTE_DELIMITER);
|
|
76
|
+
var holder = container;
|
|
77
|
+
for (var i = 0; i < pathArray.length - 1; i = i + 2) {
|
|
78
|
+
var key = pathArray[i];
|
|
79
|
+
var id = pathArray[i + 1];
|
|
80
|
+
var currentValue = (holder[key] || []).find(ramda_1.propEq('id', id));
|
|
81
|
+
var newValue = pathArray.length === i + 2 ? change : {};
|
|
82
|
+
var value = currentValue ? currentValue : { id: id, value: newValue };
|
|
83
|
+
var refObjectURI = ((_a = change.refObjectURI) === null || _a === void 0 ? void 0 : _a.indexOf(id)) >= 0 && change.refObjectURI;
|
|
84
|
+
if (refObjectURI) {
|
|
85
|
+
value.refObjectURI = refObjectURI;
|
|
86
|
+
}
|
|
87
|
+
if (ramda_1.isNil(currentValue)) {
|
|
88
|
+
holder[key] = (holder[key] || []).concat(value);
|
|
89
|
+
}
|
|
90
|
+
holder = value.value;
|
|
91
|
+
}
|
|
92
|
+
return container;
|
|
93
|
+
};
|
|
94
|
+
var mergeAttributesInChange = function (metadata, objectInfo, change, container) {
|
|
95
|
+
if (container === void 0) { container = {}; }
|
|
96
|
+
var type = change.type;
|
|
97
|
+
switch (type) {
|
|
98
|
+
case operations_1.DCRTypes.UPDATE_PROFILE_PIC_BY_URL:
|
|
99
|
+
container['defaultProfilePicValue'] = [change.newValue];
|
|
100
|
+
break;
|
|
101
|
+
case operations_1.DCRTypes.UPDATE_TAGS:
|
|
102
|
+
container[mdm_sdk_1.EntityAttrTypes.tags.name] = prepareRolesOrTags(change, metadata);
|
|
103
|
+
break;
|
|
104
|
+
case operations_1.DCRTypes.UPDATE_ROLES: {
|
|
105
|
+
container[mdm_sdk_1.EntityAttrTypes.roles.name] = prepareRolesOrTags(change, metadata);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case operations_1.DCRTypes.UPDATE_START_DATE:
|
|
109
|
+
container[mdm_sdk_1.EntityAttrTypes.startDate.name] = [prepareStartOrEndDate(change)];
|
|
110
|
+
break;
|
|
111
|
+
case operations_1.DCRTypes.UPDATE_END_DATE:
|
|
112
|
+
container[mdm_sdk_1.EntityAttrTypes.endDate.name] = [prepareStartOrEndDate(change)];
|
|
113
|
+
break;
|
|
114
|
+
default: {
|
|
115
|
+
prepareAttribute(container, change);
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return container;
|
|
120
|
+
};
|
|
121
|
+
var mergeChanges = function (metadata, changes, objectInfo) {
|
|
122
|
+
var getAttributeChanges = function (attributeName) { return ramda_1.pipe(ramda_1.pick([attributeName]), attributesHelpers_1.getChanges(metadata, objectInfo)); };
|
|
123
|
+
var concatChanges = ramda_1.curry(function (getters, attributesTree) {
|
|
124
|
+
return ramda_1.reduce(function (acc, getter) { return ramda_1.concat(acc, getter(attributesTree)); }, [], getters);
|
|
125
|
+
});
|
|
126
|
+
var changesTree = changes.reduce(function (result, change) {
|
|
127
|
+
return mergeAttributesInChange(metadata, objectInfo, change, result);
|
|
128
|
+
}, {});
|
|
129
|
+
return concatChanges([
|
|
130
|
+
ramda_1.pipe(ramda_1.omit(SPECIAL_ATTRIBUTES_NAMES), attributesHelpers_1.getChanges(metadata, objectInfo)),
|
|
131
|
+
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.roles.name),
|
|
132
|
+
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.tags.name),
|
|
133
|
+
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.startDate.name),
|
|
134
|
+
getAttributeChanges(mdm_sdk_1.EntityAttrTypes.endDate.name)
|
|
135
|
+
], changesTree);
|
|
136
|
+
};
|
|
137
|
+
exports.mergeChanges = mergeChanges;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCollapsibleList = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var contextHelpers_1 = require("../helpers/contextHelpers");
|
|
6
|
+
var DEFAULT_VISIBLE_ITEMS_COUNT = 3;
|
|
7
|
+
var useCollapsibleList = function (changes, limit) {
|
|
8
|
+
if (limit === void 0) { limit = DEFAULT_VISIBLE_ITEMS_COUNT; }
|
|
9
|
+
var _a = react_1.useState(false), isExpanded = _a[0], setIsExpanded = _a[1];
|
|
10
|
+
var onToggle = react_1.useCallback(function () { return setIsExpanded(function (value) { return !value; }); }, []);
|
|
11
|
+
var collapsedItems = react_1.useMemo(function () { return changes.slice(0, limit); }, [changes, limit]);
|
|
12
|
+
var suggestionsCount = react_1.useMemo(function () { return contextHelpers_1.getSuggestionsCount(changes); }, [changes]);
|
|
13
|
+
var visibleSuggestionsCount = react_1.useMemo(function () { return contextHelpers_1.getSuggestionsCount(collapsedItems); }, [collapsedItems]);
|
|
14
|
+
var itemsToShow = isExpanded ? changes : collapsedItems;
|
|
15
|
+
var collapsedSuggestionsCount = suggestionsCount - visibleSuggestionsCount;
|
|
16
|
+
return { isExpanded: isExpanded, onToggle: onToggle, itemsToShow: itemsToShow, collapsedSuggestionsCount: collapsedSuggestionsCount };
|
|
17
|
+
};
|
|
18
|
+
exports.useCollapsibleList = useCollapsibleList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"uri" | "label" | "container" | "showMoreLink">;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles(function (theme) { return ({
|
|
6
|
+
container: {
|
|
7
|
+
boxSizing: 'border-box',
|
|
8
|
+
border: '1px solid rgba(0,0,0,0.03)',
|
|
9
|
+
borderRadius: '3px',
|
|
10
|
+
backgroundColor: 'rgba(0,0,0,0.03)',
|
|
11
|
+
padding: '10px',
|
|
12
|
+
margin: '12px 16px 12px 0'
|
|
13
|
+
},
|
|
14
|
+
uri: {
|
|
15
|
+
color: theme.palette.primary.main,
|
|
16
|
+
textDecoration: 'none',
|
|
17
|
+
cursor: 'pointer'
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
fontSize: '12px',
|
|
21
|
+
letterSpacing: 0,
|
|
22
|
+
lineHeight: '16px'
|
|
23
|
+
},
|
|
24
|
+
showMoreLink: {
|
|
25
|
+
marginTop: '8px'
|
|
26
|
+
}
|
|
27
|
+
}); });
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Crosswalk, NestedAttributeValue, ReferenceAttributeValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { DCRTypes } from '../constants/operations';
|
|
3
|
+
export declare type EntityInfo = {
|
|
4
|
+
isExist: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
secondaryLabel: string;
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type RelationInfo = {
|
|
10
|
+
type: string;
|
|
11
|
+
startObjectLabel: string;
|
|
12
|
+
startObjectUri: string;
|
|
13
|
+
endObjectLabel: string;
|
|
14
|
+
endObjectUri: string;
|
|
15
|
+
isExist: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type DCRObjectInfo = EntityInfo | RelationInfo;
|
|
18
|
+
export declare type DCRObjectsInfo = {
|
|
19
|
+
[key: string]: DCRObjectInfo;
|
|
20
|
+
};
|
|
21
|
+
export declare type Value = DCRAttributes | DCRChange | string | boolean | number;
|
|
22
|
+
export declare type DCRAttributeValue = Omit<SimpleAttributeValue | NestedAttributeValue | ReferenceAttributeValue, 'uri' | 'value'> & {
|
|
23
|
+
value: Value;
|
|
24
|
+
refObjectURI?: string;
|
|
25
|
+
refEntity?: {
|
|
26
|
+
objectURI: string;
|
|
27
|
+
};
|
|
28
|
+
uri?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type DCRAttributes = {
|
|
31
|
+
[attributeName: string]: DCRAttributeValue[];
|
|
32
|
+
};
|
|
33
|
+
export declare type ChangeValue = DCRAttributeValue | string[];
|
|
34
|
+
export declare type DCRChange = {
|
|
35
|
+
attributePath?: string;
|
|
36
|
+
attributeType?: string;
|
|
37
|
+
conflict?: string;
|
|
38
|
+
conflictDetails?: string;
|
|
39
|
+
createdBy?: string;
|
|
40
|
+
createdTime?: string;
|
|
41
|
+
crosswalk?: Crosswalk;
|
|
42
|
+
id?: string;
|
|
43
|
+
newPinOrIgnoreValue?: boolean;
|
|
44
|
+
newValue?: ChangeValue;
|
|
45
|
+
oldValue?: ChangeValue;
|
|
46
|
+
type?: DCRTypes;
|
|
47
|
+
refAttributeType?: string;
|
|
48
|
+
refObjectURI?: string;
|
|
49
|
+
};
|
|
50
|
+
export declare type DCRChanges = {
|
|
51
|
+
[key: string]: DCRChange[];
|
|
52
|
+
};
|
|
53
|
+
export declare type ChangeRequest = {
|
|
54
|
+
changes: DCRChanges;
|
|
55
|
+
createdBy: string;
|
|
56
|
+
createdTime: number;
|
|
57
|
+
objectsInfo: DCRObjectsInfo;
|
|
58
|
+
state: string;
|
|
59
|
+
type: string;
|
|
60
|
+
updatedBy: string;
|
|
61
|
+
updatedTime: number;
|
|
62
|
+
uri: string;
|
|
63
|
+
};
|
|
@@ -14,7 +14,8 @@ exports.useStyles = styles_1.makeStyles({
|
|
|
14
14
|
alignItems: 'stretch'
|
|
15
15
|
},
|
|
16
16
|
lineBlock: {
|
|
17
|
-
width: blockWidth + "px"
|
|
17
|
+
width: blockWidth + "px",
|
|
18
|
+
flexShrink: 0
|
|
18
19
|
},
|
|
19
20
|
withLinePadding: {
|
|
20
21
|
'& $noLine': {
|
|
@@ -55,7 +56,8 @@ exports.useStyles = styles_1.makeStyles({
|
|
|
55
56
|
}
|
|
56
57
|
},
|
|
57
58
|
content: {
|
|
58
|
-
flex: 1
|
|
59
|
+
flex: 1,
|
|
60
|
+
minWidth: 0
|
|
59
61
|
},
|
|
60
62
|
plain: {},
|
|
61
63
|
last: {}
|
package/esm/components/workflow/cards/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { getDataChangeRequest } from '@reltio/mdm-sdk';
|
|
3
3
|
import GenericWorkflowTaskCard from '../GenericWorkflowTaskCard/GenericWorkflowTaskCard';
|
|
4
4
|
import LineDecorator from '../../components/LineDecorator/LineDecorator';
|
|
5
5
|
import { getDCRUri } from '../../helpers';
|
|
6
6
|
import DcrTaskIcon from '../../../../icons/DcrTaskIcon';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return (React.createElement("span", null,
|
|
11
|
-
"AttributesChanges",
|
|
12
|
-
React.createElement("br", null),
|
|
13
|
-
"AttributesChanges",
|
|
14
|
-
React.createElement("br", null),
|
|
15
|
-
"AttributesChanges"));
|
|
16
|
-
};
|
|
7
|
+
import { AttributesChangesContext } from '../../components/AttributesChanges/contexts/AttributesChangesContext';
|
|
8
|
+
import { extractObjectsFromChangeRequest } from '../../components/AttributesChanges/helpers/helpers';
|
|
9
|
+
import AttributesChanges from '../../components/AttributesChanges/AttributesChanges';
|
|
17
10
|
var DataChangeRequestTaskCard = function (_a) {
|
|
18
11
|
var task = _a.task;
|
|
19
12
|
var objectURIs = task.objectURIs;
|
|
@@ -22,7 +15,8 @@ var DataChangeRequestTaskCard = function (_a) {
|
|
|
22
15
|
useEffect(function () {
|
|
23
16
|
getDataChangeRequest(dcrUri).then(setDcr);
|
|
24
17
|
}, [dcrUri]);
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
var objectsWithChanges = useMemo(function () { return (dcr ? extractObjectsFromChangeRequest(dcr) : []); }, [dcr]);
|
|
19
|
+
return (React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DcrTaskIcon }, dcr && (React.createElement(AttributesChangesContext.Provider, { value: dcr.objectsInfo },
|
|
20
|
+
React.createElement(LineDecorator, { last: true }, objectsWithChanges.map(function (object) { return (React.createElement(AttributesChanges, { key: object.uri, changes: dcr.changes[object.uri], objectInfo: object })); }))))));
|
|
27
21
|
};
|
|
28
22
|
export default DataChangeRequestTaskCard;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DCRChange, EntityInfo } from './types/DCRTypes';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
changes: DCRChange[];
|
|
5
|
+
objectInfo: EntityInfo;
|
|
6
|
+
};
|
|
7
|
+
declare const AttributesChanges: ({ changes, objectInfo }: Props) => JSX.Element;
|
|
8
|
+
export default AttributesChanges;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import mdmModule from '@reltio/mdm-module';
|
|
4
|
+
import { getEntityUriForLink, getLabel } from '@reltio/mdm-sdk';
|
|
5
|
+
import { mergeChanges } from './helpers/mergeHelpers';
|
|
6
|
+
import EntityUriLink from '../../../EntityUriLink/EntityUriLink';
|
|
7
|
+
import ShowMoreLink from './components/ShowMoreLink/ShowMoreLink';
|
|
8
|
+
import DCRChangesList from './components/DCRChangesList/DCRChangesList';
|
|
9
|
+
import { useCollapsibleList } from './hooks/useCollapsibleList';
|
|
10
|
+
import { useStyles } from './styles';
|
|
11
|
+
var AttributesChanges = function (_a) {
|
|
12
|
+
var changes = _a.changes, objectInfo = _a.objectInfo;
|
|
13
|
+
var styles = useStyles();
|
|
14
|
+
var metadata = useSelector(mdmModule.selectors.getMetadata);
|
|
15
|
+
var mergedChanges = useMemo(function () { return mergeChanges(metadata, changes, objectInfo); }, [metadata, changes, objectInfo]);
|
|
16
|
+
var _b = useCollapsibleList(mergedChanges), isExpanded = _b.isExpanded, onToggle = _b.onToggle, itemsToShow = _b.itemsToShow, collapsedSuggestionsCount = _b.collapsedSuggestionsCount;
|
|
17
|
+
return (React.createElement("div", { className: styles.container },
|
|
18
|
+
React.createElement(EntityUriLink, { className: styles.uri, value: getEntityUriForLink(objectInfo) },
|
|
19
|
+
React.createElement("div", { className: styles.label }, getLabel(objectInfo.label))),
|
|
20
|
+
React.createElement(DCRChangesList, { changes: itemsToShow }),
|
|
21
|
+
collapsedSuggestionsCount > 0 && (React.createElement(ShowMoreLink, { onClick: onToggle, suggestionsCount: collapsedSuggestionsCount, isExpanded: isExpanded, className: styles.showMoreLink }))));
|
|
22
|
+
};
|
|
23
|
+
export default AttributesChanges;
|
package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OperationTypes } from '../../constants/operations';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
label: React.ReactElement;
|
|
5
|
+
oldValue?: React.ReactElement;
|
|
6
|
+
newValue?: React.ReactElement;
|
|
7
|
+
operation?: OperationTypes;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const ChangeView: ({ label, oldValue, newValue, operation, className }: Props) => JSX.Element;
|
|
11
|
+
export default ChangeView;
|
package/esm/components/workflow/components/AttributesChanges/components/ChangeView/ChangeView.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt';
|
|
4
|
+
import Chip from '@material-ui/core/Chip';
|
|
5
|
+
import { getOperationLabel } from '../../helpers/helpers';
|
|
6
|
+
import { useStyles } from './styles';
|
|
7
|
+
var ChangeView = function (_a) {
|
|
8
|
+
var label = _a.label, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation, className = _a.className;
|
|
9
|
+
var styles = useStyles();
|
|
10
|
+
var value = oldValue || newValue;
|
|
11
|
+
return (React.createElement("div", { className: classnames(styles.field, className) },
|
|
12
|
+
React.createElement("span", { className: styles.fieldName },
|
|
13
|
+
label,
|
|
14
|
+
":"),
|
|
15
|
+
React.createElement("span", { className: styles.difference },
|
|
16
|
+
value,
|
|
17
|
+
newValue && oldValue && (React.createElement(React.Fragment, null,
|
|
18
|
+
React.createElement(ArrowRightAltIcon, { className: styles.arrow }),
|
|
19
|
+
newValue))),
|
|
20
|
+
operation && (React.createElement(Chip, { variant: "outlined", label: getOperationLabel(operation), className: classnames(styles.chip, operation) }))));
|
|
21
|
+
};
|
|
22
|
+
export default ChangeView;
|
package/esm/components/workflow/components/AttributesChanges/components/ChangeView/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"fieldName" | "difference" | "field" | "arrow" | "chip">;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
export var useStyles = makeStyles(function (theme) { return ({
|
|
3
|
+
field: {
|
|
4
|
+
fontSize: '12px',
|
|
5
|
+
lineHeight: '20px',
|
|
6
|
+
color: theme.palette.text.primary,
|
|
7
|
+
marginTop: '6px',
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexWrap: 'wrap',
|
|
10
|
+
overflow: 'hidden'
|
|
11
|
+
},
|
|
12
|
+
fieldName: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
color: theme.palette.text.secondary,
|
|
16
|
+
marginRight: '8px'
|
|
17
|
+
},
|
|
18
|
+
difference: {
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
flexDirection: 'row'
|
|
22
|
+
},
|
|
23
|
+
arrow: {
|
|
24
|
+
margin: '0 4px',
|
|
25
|
+
fontSize: '12px',
|
|
26
|
+
color: theme.palette.text.primary
|
|
27
|
+
},
|
|
28
|
+
chip: {
|
|
29
|
+
height: '20px',
|
|
30
|
+
fontSize: '10px',
|
|
31
|
+
fontWeight: 500,
|
|
32
|
+
lineHeight: '16px',
|
|
33
|
+
letterSpacing: 0,
|
|
34
|
+
marginLeft: '8px',
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
textTransform: 'capitalize',
|
|
37
|
+
color: theme.palette.primary.main,
|
|
38
|
+
borderColor: theme.palette.primary.main,
|
|
39
|
+
'&.edited': {
|
|
40
|
+
color: '#CC7500',
|
|
41
|
+
borderColor: '#CC7500'
|
|
42
|
+
},
|
|
43
|
+
'&.added': {
|
|
44
|
+
color: '#599E0E',
|
|
45
|
+
borderColor: '#599E0E'
|
|
46
|
+
},
|
|
47
|
+
'&.deleted': {
|
|
48
|
+
color: '#CF0E26',
|
|
49
|
+
borderColor: '#CF0E26'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}); });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import DiffRenderer from '../DiffRenderer/DiffRenderer';
|
|
14
|
+
var DCRChangesList = function (_a) {
|
|
15
|
+
var changes = _a.changes;
|
|
16
|
+
return (React.createElement(React.Fragment, null, changes.map(function (change, index) {
|
|
17
|
+
return React.createElement(DiffRenderer, __assign({}, change, { key: index }));
|
|
18
|
+
})));
|
|
19
|
+
};
|
|
20
|
+
export default DCRChangesList;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AttributeType } from '@reltio/mdm-sdk';
|
|
3
|
+
import { OperationTypes } from '../../constants/operations';
|
|
4
|
+
import { ChangeValue, DCRAttributeValue } from '../../types/DCRTypes';
|
|
5
|
+
export declare type Props = {
|
|
6
|
+
level: number;
|
|
7
|
+
label: string;
|
|
8
|
+
attributeType: AttributeType;
|
|
9
|
+
attributeValue?: DCRAttributeValue;
|
|
10
|
+
newValue?: ChangeValue;
|
|
11
|
+
oldValue?: ChangeValue;
|
|
12
|
+
operation?: OperationTypes;
|
|
13
|
+
};
|
|
14
|
+
declare const DiffRenderer: ({ label, level, attributeType, attributeValue, oldValue, newValue, operation }: Props) => JSX.Element;
|
|
15
|
+
export default DiffRenderer;
|
package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/DiffRenderer.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useCallback, useContext, useMemo } from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import { anyPass, ifElse, hasPath, path, when } from 'ramda';
|
|
4
|
+
import { getAttributeValue, getLabel, isReference } from '@reltio/mdm-sdk';
|
|
5
|
+
import mdmModule from '@reltio/mdm-module';
|
|
6
|
+
import ChangeView from '../ChangeView/ChangeView';
|
|
7
|
+
import { getAttributeDescription, getDataTypeDefinition } from '../../helpers/helpers';
|
|
8
|
+
import EntityUriLink from '../../../../../EntityUriLink/EntityUriLink';
|
|
9
|
+
import { AttributesChangesContext } from '../../contexts/AttributesChangesContext';
|
|
10
|
+
import DataTypeValue from '../../../../../DataTypeValue/DataTypeValue';
|
|
11
|
+
import { useStyles } from './styles';
|
|
12
|
+
var DiffRenderer = function (_a) {
|
|
13
|
+
var label = _a.label, level = _a.level, attributeType = _a.attributeType, attributeValue = _a.attributeValue, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation;
|
|
14
|
+
var styles = useStyles({ level: level });
|
|
15
|
+
var entity = useSelector(mdmModule.selectors.getEntity);
|
|
16
|
+
var objectsInfo = useContext(AttributesChangesContext);
|
|
17
|
+
var renderLink = useCallback(function () {
|
|
18
|
+
if (isReference(attributeType)) {
|
|
19
|
+
var value = when(anyPass([hasPath(['value', 'newValue']), hasPath(['value', 'oldValue'])]), ifElse(hasPath(['value', 'newValue']), path(['value', 'newValue']), path(['value', 'oldValue'])))(attributeValue);
|
|
20
|
+
var _a = getAttributeDescription(attributeType, value, entity.uri, objectsInfo), objectUri = _a.objectUri, objectLabel = _a.objectLabel;
|
|
21
|
+
return (React.createElement(EntityUriLink, { value: objectUri, className: styles.uri },
|
|
22
|
+
React.createElement("span", null, getLabel(objectLabel))));
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}, [attributeType, attributeValue, entity.uri, objectsInfo, styles.uri]);
|
|
26
|
+
var changeLabel = useMemo(function () {
|
|
27
|
+
return (React.createElement("div", null,
|
|
28
|
+
label,
|
|
29
|
+
renderLink()));
|
|
30
|
+
}, [label, renderLink]);
|
|
31
|
+
var renderValue = useCallback(function (value) {
|
|
32
|
+
var attrValue = getAttributeValue(value);
|
|
33
|
+
return (React.createElement(DataTypeValue, { value: attrValue, dataTypeDefinition: getDataTypeDefinition(attributeType, attrValue) }));
|
|
34
|
+
}, [attributeType]);
|
|
35
|
+
return (React.createElement(ChangeView, { className: styles.change, label: changeLabel, oldValue: oldValue && renderValue(oldValue), newValue: newValue && renderValue(newValue), operation: operation }));
|
|
36
|
+
};
|
|
37
|
+
export default DiffRenderer;
|
package/esm/components/workflow/components/AttributesChanges/components/DiffRenderer/styles.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
export var useStyles = makeStyles(function (theme) { return ({
|
|
3
|
+
uri: {
|
|
4
|
+
color: theme.palette.primary.main,
|
|
5
|
+
textDecoration: 'none',
|
|
6
|
+
cursor: 'pointer',
|
|
7
|
+
marginLeft: '4px'
|
|
8
|
+
},
|
|
9
|
+
change: function (_a) {
|
|
10
|
+
var _b = _a.level, level = _b === void 0 ? 0 : _b;
|
|
11
|
+
return ({
|
|
12
|
+
marginLeft: level * 16 + "px"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}); });
|