@reltio/components 1.4.1434 → 1.4.1436
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/BasicTableView/BasicTable/helpers/dataHelpers.js +2 -1
- package/cjs/components/attributes/DescriptionIcon/DescriptionIcon.d.ts +31 -0
- package/cjs/components/attributes/DescriptionIcon/DescriptionIcon.js +51 -0
- package/cjs/components/attributes/DescriptionIcon/index.d.ts +1 -0
- package/cjs/components/attributes/DescriptionIcon/index.js +8 -0
- package/cjs/components/attributes/DescriptionIcon/styles.d.ts +1 -0
- package/cjs/components/attributes/DescriptionIcon/styles.js +24 -0
- package/cjs/components/attributes/OvIcon/OvIcon.js +1 -1
- package/cjs/components/attributes/editMode/AttributesPager/AttributeRenderer.js +3 -1
- package/cjs/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
- package/cjs/components/attributes/editMode/AttributesPager/styles.js +3 -0
- package/cjs/components/attributes/readMode/AttributesPager/MultiLineRenderer.js +3 -1
- package/cjs/components/attributes/readMode/AttributesPager/OneLineRenderer.js +3 -1
- package/cjs/components/attributes/readMode/AttributesPager/styles.d.ts +2 -2
- package/cjs/components/attributes/readMode/AttributesPager/styles.js +5 -0
- package/cjs/components/index.d.ts +1 -0
- package/cjs/components/index.js +5 -3
- package/cjs/components/workflow/hooks/useWorkflowTasks.js +13 -1
- package/cjs/contexts/FeaturesContext/index.d.ts +6 -0
- package/cjs/contexts/FeaturesContext/index.js +9 -0
- package/cjs/contexts/index.d.ts +1 -0
- package/cjs/contexts/index.js +3 -1
- package/cjs/hooks/useAPI/API.js +14 -9
- package/cjs/hooks/useAPI/helpers.d.ts +2 -1
- package/cjs/hooks/useAPI/helpers.js +2 -2
- package/cjs/hooks/useAPI/useAPI.d.ts +1 -1
- package/cjs/hooks/useAPI/useAPI.js +49 -32
- package/cjs/hooks/useCustomScripts.js +37 -38
- package/cjs/icons/Description.d.ts +3 -0
- package/cjs/icons/Description.js +22 -0
- package/cjs/icons/index.d.ts +6 -3
- package/cjs/icons/index.js +14 -8
- package/esm/components/BasicTableView/BasicTable/helpers/dataHelpers.js +2 -1
- package/esm/components/attributes/DescriptionIcon/DescriptionIcon.d.ts +31 -0
- package/esm/components/attributes/DescriptionIcon/DescriptionIcon.js +22 -0
- package/esm/components/attributes/DescriptionIcon/index.d.ts +1 -0
- package/esm/components/attributes/DescriptionIcon/index.js +1 -0
- package/esm/components/attributes/DescriptionIcon/styles.d.ts +1 -0
- package/esm/components/attributes/DescriptionIcon/styles.js +21 -0
- package/esm/components/attributes/OvIcon/OvIcon.js +1 -1
- package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.js +3 -1
- package/esm/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
- package/esm/components/attributes/editMode/AttributesPager/styles.js +3 -0
- package/esm/components/attributes/readMode/AttributesPager/MultiLineRenderer.js +3 -1
- package/esm/components/attributes/readMode/AttributesPager/OneLineRenderer.js +3 -1
- package/esm/components/attributes/readMode/AttributesPager/styles.d.ts +2 -2
- package/esm/components/attributes/readMode/AttributesPager/styles.js +5 -0
- package/esm/components/index.d.ts +1 -0
- package/esm/components/index.js +1 -0
- package/esm/components/workflow/hooks/useWorkflowTasks.js +13 -1
- package/esm/contexts/FeaturesContext/index.d.ts +6 -0
- package/esm/contexts/FeaturesContext/index.js +3 -0
- package/esm/contexts/index.d.ts +1 -0
- package/esm/contexts/index.js +1 -0
- package/esm/hooks/useAPI/API.js +14 -9
- package/esm/hooks/useAPI/helpers.d.ts +2 -1
- package/esm/hooks/useAPI/helpers.js +2 -2
- package/esm/hooks/useAPI/useAPI.d.ts +1 -1
- package/esm/hooks/useAPI/useAPI.js +52 -35
- package/esm/hooks/useCustomScripts.js +38 -39
- package/esm/icons/Description.d.ts +3 -0
- package/esm/icons/Description.js +17 -0
- package/esm/icons/index.d.ts +6 -3
- package/esm/icons/index.js +6 -3
- package/package.json +3 -3
|
@@ -46,15 +46,15 @@ var contexts_1 = require("../../contexts");
|
|
|
46
46
|
var API_1 = require("./API");
|
|
47
47
|
var helpers_1 = require("./helpers");
|
|
48
48
|
var useAPI = function (config) {
|
|
49
|
-
var _a, _b;
|
|
49
|
+
var _a, _b, _c, _d;
|
|
50
50
|
if (config === void 0) { config = {}; }
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
51
|
+
var _e = (0, react_1.useState)(), html = _e[0], setHtml = _e[1];
|
|
52
|
+
var _f = (0, react_1.useState)([]), listenersToReset = _f[0], setListenersToReset = _f[1];
|
|
53
|
+
var _g = (0, react_1.useState)([]), popupListenersToReset = _g[0], setPopupListenersToReset = _g[1];
|
|
54
|
+
var _h = (0, react_1.useState)(true), visible = _h[0], setVisible = _h[1];
|
|
55
|
+
var _j = (0, react_1.useState)(), popup = _j[0], setPopup = _j[1];
|
|
56
|
+
var _k = (0, react_1.useState)(null), tooltip = _k[0], setTooltip = _k[1];
|
|
57
|
+
var _l = (0, react_1.useState)({}), customStyles = _l[0], setCustomStyles = _l[1];
|
|
58
58
|
var workerRef = (0, react_1.useRef)();
|
|
59
59
|
var requestListeners = (0, react_1.useRef)({});
|
|
60
60
|
var responseListeners = (0, react_1.useRef)({});
|
|
@@ -77,7 +77,7 @@ var useAPI = function (config) {
|
|
|
77
77
|
var entityUri = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getEntityUri);
|
|
78
78
|
var isEditableMode = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getIsEditableMode);
|
|
79
79
|
var environment = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
80
|
-
var
|
|
80
|
+
var _m = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getSearchProviderData) || {}, typeSearch = _m.type, search = _m.data;
|
|
81
81
|
var searchQuery = typeSearch === 'search' ? search === null || search === void 0 ? void 0 : search.query : null;
|
|
82
82
|
var isOldUI = !(0, helpers_1.isNewUI)(servicesPath);
|
|
83
83
|
var supportedInterceptHandlers = isOldUI ? qxApi.interceptors : interceptHandlers;
|
|
@@ -85,7 +85,6 @@ var useAPI = function (config) {
|
|
|
85
85
|
var innerText = '';
|
|
86
86
|
var popupText = '';
|
|
87
87
|
var process = function (_a) {
|
|
88
|
-
var _b, _c;
|
|
89
88
|
var task = _a.task, worker = _a.worker;
|
|
90
89
|
if (task) {
|
|
91
90
|
switch (task.action) {
|
|
@@ -169,40 +168,38 @@ var useAPI = function (config) {
|
|
|
169
168
|
break;
|
|
170
169
|
}
|
|
171
170
|
case mdm_sdk_1.CustomAction.REQUEST: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
body: data,
|
|
181
|
-
id: id,
|
|
182
|
-
task: task,
|
|
183
|
-
headers: headers,
|
|
184
|
-
method: method
|
|
185
|
-
});
|
|
186
|
-
requestListeners.current = (0, ramda_1.omit)([headers.requestId], requestListeners.current);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
171
|
+
var processedApiPath = isOldUI ? reltioPath : apiPath;
|
|
172
|
+
var isGlobalUrl = (0, ramda_1.startsWith)('/', (0, ramda_1.pathOr)('', ['params', 'url'], task)) &&
|
|
173
|
+
!(0, ramda_1.startsWith)(apiPath, (0, ramda_1.pathOr)('', ['params', 'url'], task));
|
|
174
|
+
var processedParams = (0, ramda_1.pipe)((0, ramda_1.evolve)({
|
|
175
|
+
url: (0, ramda_1.ifElse)((0, ramda_1.both)((0, ramda_1.always)(isGlobalUrl), (0, ramda_1.always)((0, ramda_1.pathEq)(['params', 'name'], mdm_sdk_1.RequestAction.API, task))), (0, ramda_1.concat)("".concat(processedApiPath, "/api/").concat(tenant)), (0, ramda_1.replace)(reltioPath, apiPath))
|
|
176
|
+
}), (0, ramda_1.when)((0, ramda_1.has)('url'), (0, ramda_1.assocPath)(['validationUrl'], task.params.url)))(task.params);
|
|
177
|
+
var processedTask = __assign(__assign({}, task), { params: processedParams });
|
|
178
|
+
(0, API_1.processRequest)(__assign({ name: processedTask.params.name, paramObject: processedTask, permissions: config.action.permissions, worker: worker, metadata: metadata, config: config, user: user, servicesPath: servicesPath, apiPath: processedApiPath, tenant: tenant, workflowPath: workflowPath, entity: entity, entityUri: entityUri, environment: environment, query: searchQuery, openSearch: openSearch, workflowCheckPermission: workflowCheckPermission }, qxApi));
|
|
189
179
|
break;
|
|
190
180
|
}
|
|
191
|
-
case mdm_sdk_1.CustomAction.RETURN_PROCESSED_API_RESPONSE:
|
|
192
|
-
|
|
193
|
-
var _e = task.params, id = _e.id, data = _e.data;
|
|
181
|
+
case mdm_sdk_1.CustomAction.RETURN_PROCESSED_API_RESPONSE: {
|
|
182
|
+
var _b = task.params, id = _b.id, data = _b.data;
|
|
194
183
|
if (responseListeners.current[id]) {
|
|
195
184
|
responseListeners.current[id].next(data);
|
|
196
185
|
responseListeners.current = (0, ramda_1.omit)([id], responseListeners.current);
|
|
197
186
|
}
|
|
198
187
|
break;
|
|
199
188
|
}
|
|
189
|
+
case mdm_sdk_1.CustomAction.RETURN_PROCESSED_API_REQUEST: {
|
|
190
|
+
var _c = task.params, id = _c.id, data = _c.data;
|
|
191
|
+
if (requestListeners.current[id]) {
|
|
192
|
+
requestListeners.current[id].resolve(data);
|
|
193
|
+
requestListeners.current = (0, ramda_1.omit)([id], requestListeners.current);
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
200
197
|
}
|
|
201
198
|
}
|
|
202
199
|
};
|
|
203
|
-
var setRequestListeners = function (options, next, requestId) {
|
|
200
|
+
var setRequestListeners = function (options, next, requestId, resolve) {
|
|
204
201
|
var _a;
|
|
205
|
-
requestListeners.current = __assign(__assign({}, requestListeners.current), (_a = {}, _a[requestId] = { options: options, next: next, id: requestId }, _a));
|
|
202
|
+
requestListeners.current = __assign(__assign({}, requestListeners.current), (_a = {}, _a[requestId] = { options: options, next: next, id: requestId, resolve: resolve }, _a));
|
|
206
203
|
};
|
|
207
204
|
var setResponseListeners = function (next, responseId) {
|
|
208
205
|
var _a;
|
|
@@ -229,9 +226,25 @@ var useAPI = function (config) {
|
|
|
229
226
|
var _a;
|
|
230
227
|
(_a = workerRef.current) === null || _a === void 0 ? void 0 : _a.postMessage({ action: 'event', type: type, data: data });
|
|
231
228
|
};
|
|
229
|
+
var pendingInterceptors = (0, react_1.useRef)(false);
|
|
230
|
+
var needDelayedRequestForInterceptors = !isOldUI &&
|
|
231
|
+
interceptHandlers &&
|
|
232
|
+
!(0, mdm_sdk_1.isEmptyValue)(config.action) &&
|
|
233
|
+
config.action.platform !== mdm_sdk_1.CustomScriptPlatform.CLASSIC &&
|
|
234
|
+
(((_c = config === null || config === void 0 ? void 0 : config.action) === null || _c === void 0 ? void 0 : _c.processApiRequest) || ((_d = config === null || config === void 0 ? void 0 : config.action) === null || _d === void 0 ? void 0 : _d.processApiResponse));
|
|
235
|
+
if (needDelayedRequestForInterceptors) {
|
|
236
|
+
if (!pendingInterceptors.current && !workerRef.current) {
|
|
237
|
+
interceptHandlers.startInterceptorInit();
|
|
238
|
+
pendingInterceptors.current = true;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
232
241
|
(0, react_1.useEffect)(function () {
|
|
233
242
|
if (!(0, mdm_sdk_1.isEmptyValue)(config.action) && config.action.platform !== mdm_sdk_1.CustomScriptPlatform.CLASSIC) {
|
|
234
243
|
workerRef.current = (0, mdm_sdk_1.initializeWebWorker)(workerUrl, process, config);
|
|
244
|
+
if (pendingInterceptors.current) {
|
|
245
|
+
interceptHandlers.finishInterceptorInit();
|
|
246
|
+
pendingInterceptors.current = false;
|
|
247
|
+
}
|
|
235
248
|
postEventMessage('updateEntity', entity);
|
|
236
249
|
}
|
|
237
250
|
}, [entity, config]);
|
|
@@ -270,6 +283,10 @@ var useAPI = function (config) {
|
|
|
270
283
|
else {
|
|
271
284
|
addInternalRequestInterceptor(requestInterceptor);
|
|
272
285
|
addInternalResponseInterceptor(responseInterceptor);
|
|
286
|
+
workerRef.current.onerror = function () {
|
|
287
|
+
removeInternalRequestInterceptor_1(requestInterceptor);
|
|
288
|
+
removeInternalResponseInterceptor_1(responseInterceptor);
|
|
289
|
+
};
|
|
273
290
|
return function () {
|
|
274
291
|
removeInternalRequestInterceptor_1(requestInterceptor);
|
|
275
292
|
removeInternalResponseInterceptor_1(responseInterceptor);
|
|
@@ -78,6 +78,7 @@ var getCustomViewConfig = function (config) {
|
|
|
78
78
|
return __assign({ action: { processApiResponse: processApiResponse, processApiRequest: processApiRequest, permissions: permissions, files: files } }, otherProps);
|
|
79
79
|
};
|
|
80
80
|
var useCustomScripts = function (config) {
|
|
81
|
+
var _a;
|
|
81
82
|
var customScripts = config.reduce(function (acc, customScript) {
|
|
82
83
|
if (customScript.platform !== mdm_sdk_1.CustomScriptPlatform.CLASSIC) {
|
|
83
84
|
return __spreadArray(__spreadArray([], acc, true), [__assign(__assign({}, customScript), { actionId: (0, nanoid_1.default)() })], false);
|
|
@@ -85,10 +86,10 @@ var useCustomScripts = function (config) {
|
|
|
85
86
|
return acc;
|
|
86
87
|
}, []);
|
|
87
88
|
var showSnackbarMessage = (0, react_1.useContext)(contexts_1.SnackbarContext);
|
|
88
|
-
var
|
|
89
|
+
var _b = (0, react_1.useContext)(contexts_1.InterceptHandlersContext), addInternalRequestInterceptor = _b.addInternalRequestInterceptor, addInternalResponseInterceptor = _b.addInternalResponseInterceptor, removeInternalRequestInterceptor = _b.removeInternalRequestInterceptor, removeInternalResponseInterceptor = _b.removeInternalResponseInterceptor;
|
|
89
90
|
var qxApi = (0, react_1.useContext)(contexts_1.SandboxAPIContext);
|
|
90
91
|
var dispatch = (0, react_redux_1.useDispatch)();
|
|
91
|
-
var metadata = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getMetadata)
|
|
92
|
+
var metadata = (_a = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getMetadata)) !== null && _a !== void 0 ? _a : null;
|
|
92
93
|
var entity = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getEntity) || {};
|
|
93
94
|
var uiPath = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getUIPath);
|
|
94
95
|
var servicesPath = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getServicesPath);
|
|
@@ -101,13 +102,12 @@ var useCustomScripts = function (config) {
|
|
|
101
102
|
var entityUri = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getEntityUri);
|
|
102
103
|
var environment = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
103
104
|
var workflowCheckPermission = (0, workflow_1.useWorkflowCheckPermission)();
|
|
104
|
-
var
|
|
105
|
+
var _c = (0, react_redux_1.useSelector)(mdm_module_1.default.selectors.getSearchProviderData) || {}, typeSearch = _c.type, search = _c.data;
|
|
105
106
|
var openSearch = function (search) { return dispatch(mdm_module_1.ui.actions.openSearch(search)); };
|
|
106
107
|
var requestListeners = (0, react_1.useRef)({});
|
|
107
108
|
var responseListeners = (0, react_1.useRef)({});
|
|
108
109
|
var workers = (0, react_1.useRef)({});
|
|
109
|
-
var
|
|
110
|
-
var _b, _c;
|
|
110
|
+
var processMessageFromWorker = function (_a) {
|
|
111
111
|
var task = _a.task, worker = _a.worker, config = _a.config;
|
|
112
112
|
if (task) {
|
|
113
113
|
switch (task.action) {
|
|
@@ -120,52 +120,50 @@ var useCustomScripts = function (config) {
|
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
122
|
case mdm_sdk_1.CustomAction.REQUEST: {
|
|
123
|
-
|
|
124
|
-
(0,
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var url = fakeURL.replace(reltioPath, apiPath);
|
|
129
|
-
if (requestListeners.current[headers.requestId]) {
|
|
130
|
-
requestListeners.current[headers.requestId].next(url, {
|
|
131
|
-
body: data,
|
|
132
|
-
id: id,
|
|
133
|
-
task: task,
|
|
134
|
-
headers: headers,
|
|
135
|
-
method: method
|
|
136
|
-
});
|
|
137
|
-
requestListeners.current = (0, ramda_1.omit)([headers.requestId], requestListeners.current);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
123
|
+
var processedParams = (0, ramda_1.pipe)((0, ramda_1.evolve)({
|
|
124
|
+
url: (0, ramda_1.replace)(reltioPath, apiPath)
|
|
125
|
+
}), (0, ramda_1.when)((0, ramda_1.has)('url'), (0, ramda_1.assocPath)(['validationUrl'], task.params.url)))(task.params);
|
|
126
|
+
var processedTask = __assign(__assign({}, task), { params: processedParams });
|
|
127
|
+
(0, useAPI_1.processRequest)(__assign({ name: processedTask.params.name, paramObject: processedTask, permissions: config.action.permissions, worker: worker, metadata: metadata, config: config, user: user, apiPath: apiPath, servicesPath: servicesPath, tenant: tenant, workflowPath: workflowPath, entity: entity, entityUri: entityUri, environment: environment, query: typeSearch === 'search' ? search === null || search === void 0 ? void 0 : search.query : null, openSearch: openSearch, workflowCheckPermission: workflowCheckPermission }, qxApi));
|
|
140
128
|
break;
|
|
141
129
|
}
|
|
142
|
-
case mdm_sdk_1.CustomAction.RETURN_PROCESSED_API_RESPONSE:
|
|
143
|
-
|
|
144
|
-
var _e = task.params, id = _e.id, data = _e.data;
|
|
130
|
+
case mdm_sdk_1.CustomAction.RETURN_PROCESSED_API_RESPONSE: {
|
|
131
|
+
var _b = task.params, id = _b.id, data = _b.data;
|
|
145
132
|
if (responseListeners.current[id]) {
|
|
146
133
|
responseListeners.current[id].next(data);
|
|
147
134
|
responseListeners.current = (0, ramda_1.omit)([id], responseListeners.current);
|
|
148
135
|
}
|
|
149
136
|
break;
|
|
150
137
|
}
|
|
138
|
+
case mdm_sdk_1.CustomAction.RETURN_PROCESSED_API_REQUEST: {
|
|
139
|
+
var _c = task.params, id = _c.id, data = _c.data;
|
|
140
|
+
if (requestListeners.current[id]) {
|
|
141
|
+
requestListeners.current[id].resolve(data);
|
|
142
|
+
requestListeners.current = (0, ramda_1.omit)([id], requestListeners.current);
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
151
146
|
}
|
|
152
147
|
}
|
|
153
148
|
};
|
|
154
149
|
(0, react_1.useEffect)(function () {
|
|
150
|
+
if (metadata === null) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
155
153
|
workers.current = customScripts.reduce(function (acc, customScript) {
|
|
156
154
|
var _a;
|
|
157
155
|
var customViewConfig = getCustomViewConfig(customScript);
|
|
158
|
-
return __assign(__assign({}, acc), (_a = {}, _a[customScript.actionId] = (0, mdm_sdk_1.initializeWebWorker)(workerUrl,
|
|
156
|
+
return __assign(__assign({}, acc), (_a = {}, _a[customScript.actionId] = (0, mdm_sdk_1.initializeWebWorker)(workerUrl, processMessageFromWorker, customViewConfig), _a));
|
|
159
157
|
}, workers.current);
|
|
160
158
|
return function () {
|
|
161
159
|
Object.keys(workers.current).forEach(function (actionId) {
|
|
162
160
|
workers.current[actionId].terminate();
|
|
163
161
|
});
|
|
164
162
|
};
|
|
165
|
-
}, [config]);
|
|
163
|
+
}, [config, metadata]);
|
|
166
164
|
var customScriptRequestInterceptor = function (_a) {
|
|
167
165
|
var _b;
|
|
168
|
-
var _c = _a.options, options = _c === void 0 ? {} : _c, url = _a.url, next = _a.next;
|
|
166
|
+
var _c = _a.options, options = _c === void 0 ? {} : _c, url = _a.url, next = _a.next, resolve = _a.resolve;
|
|
169
167
|
var fakeURL = url.startsWith('/') && !url.startsWith(apiPath)
|
|
170
168
|
? "".concat(reltioPath, "/api/").concat(tenant).concat(url)
|
|
171
169
|
: "".concat(reltioPath).concat(url.replace(apiPath, ''));
|
|
@@ -175,7 +173,7 @@ var useCustomScripts = function (config) {
|
|
|
175
173
|
}), (0, ramda_1.prop)('actionId'))(customScripts);
|
|
176
174
|
if (actionId) {
|
|
177
175
|
var requestId = (0, nanoid_1.default)();
|
|
178
|
-
requestListeners.current = __assign(__assign({}, requestListeners.current), (_b = {}, _b[requestId] = { options: options, next: next, id: requestId }, _b));
|
|
176
|
+
requestListeners.current = __assign(__assign({}, requestListeners.current), (_b = {}, _b[requestId] = { options: options, next: next, id: requestId, resolve: resolve }, _b));
|
|
179
177
|
workers.current[actionId].postMessage({
|
|
180
178
|
action: 'apiRequest',
|
|
181
179
|
id: requestId,
|
|
@@ -201,7 +199,7 @@ var useCustomScripts = function (config) {
|
|
|
201
199
|
responseListeners.current = __assign(__assign({}, responseListeners.current), (_a = {}, _a[options.headers.requestId] = { next: next }, _a));
|
|
202
200
|
workers.current[(_b = options.headers) === null || _b === void 0 ? void 0 : _b.actionId].postMessage({
|
|
203
201
|
action: 'response',
|
|
204
|
-
result: { data: data },
|
|
202
|
+
result: { data: data, status: response.status },
|
|
205
203
|
id: options === null || options === void 0 ? void 0 : options.id,
|
|
206
204
|
name: (_d = (_c = options === null || options === void 0 ? void 0 : options.task) === null || _c === void 0 ? void 0 : _c.params) === null || _d === void 0 ? void 0 : _d.name
|
|
207
205
|
});
|
|
@@ -241,14 +239,15 @@ var useCustomScripts = function (config) {
|
|
|
241
239
|
}
|
|
242
240
|
};
|
|
243
241
|
(0, react_1.useEffect)(function () {
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
addInternalResponseInterceptor(customScriptResponseInterceptor);
|
|
247
|
-
return function () {
|
|
248
|
-
removeInternalRequestInterceptor(customScriptRequestInterceptor);
|
|
249
|
-
removeInternalResponseInterceptor(customScriptResponseInterceptor);
|
|
250
|
-
};
|
|
242
|
+
if ((0, mdm_sdk_1.isEmptyValue)(customScripts) || !metadata) {
|
|
243
|
+
return;
|
|
251
244
|
}
|
|
252
|
-
|
|
245
|
+
addInternalRequestInterceptor(customScriptRequestInterceptor);
|
|
246
|
+
addInternalResponseInterceptor(customScriptResponseInterceptor);
|
|
247
|
+
return function () {
|
|
248
|
+
removeInternalRequestInterceptor(customScriptRequestInterceptor);
|
|
249
|
+
removeInternalResponseInterceptor(customScriptResponseInterceptor);
|
|
250
|
+
};
|
|
251
|
+
}, [config, metadata]);
|
|
253
252
|
};
|
|
254
253
|
exports.useCustomScripts = useCustomScripts;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var SvgDescription = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
20
|
+
react_1.default.createElement("path", { d: "M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z", fill: "#000", fillOpacity: 0.54 })));
|
|
21
|
+
};
|
|
22
|
+
exports.default = SvgDescription;
|
package/cjs/icons/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { default as DcrTaskIcon } from './DcrTaskIcon';
|
|
|
11
11
|
export { default as DefaultImage } from './DefaultImage';
|
|
12
12
|
export { default as DefaultTaskIcon } from './DefaultTaskIcon';
|
|
13
13
|
export { default as DeleteRequestTaskIcon } from './DeleteRequestTaskIcon';
|
|
14
|
+
export { default as Description } from './Description';
|
|
14
15
|
export { default as Details } from './Details';
|
|
15
16
|
export { default as Download } from './Download';
|
|
16
17
|
export { default as Draw } from './Draw';
|
|
@@ -22,20 +23,22 @@ export { default as Ignored } from './Ignored';
|
|
|
22
23
|
export { default as IgnoredOutlined } from './IgnoredOutlined';
|
|
23
24
|
export { default as LogIn } from './LogIn';
|
|
24
25
|
export { default as LogOut } from './LogOut';
|
|
25
|
-
export { default as MlMatch } from './MlMatch';
|
|
26
26
|
export { default as Merge } from './Merge';
|
|
27
27
|
export { default as MergeDark } from './MergeDark';
|
|
28
|
+
export { default as MlMatch } from './MlMatch';
|
|
29
|
+
export { default as NegativeRuleIcon } from './NegativeRuleIcon';
|
|
30
|
+
export { default as NegativeRuleTooltipIcon } from './NegativeRuleTooltipIcon';
|
|
28
31
|
export { default as NestedAttribute } from './NestedAttribute';
|
|
29
32
|
export { default as NoData } from './NoData';
|
|
30
33
|
export { default as NoDataSearch } from './NoDataSearch';
|
|
31
34
|
export { default as NoMatches } from './NoMatches';
|
|
32
35
|
export { default as NotMatchDark } from './NotMatchDark';
|
|
33
36
|
export { default as NotMatchRule } from './NotMatchRule';
|
|
34
|
-
export { default as PmIcon } from './PmIcon';
|
|
35
|
-
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
36
37
|
export { default as Pin } from './Pin';
|
|
37
38
|
export { default as PinOutlined } from './PinOutlined';
|
|
38
39
|
export { default as PivotingIcon } from './PivotingIcon';
|
|
40
|
+
export { default as PmIcon } from './PmIcon';
|
|
41
|
+
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
39
42
|
export { default as Polygon } from './Polygon';
|
|
40
43
|
export { default as PotentialMatch } from './PotentialMatch';
|
|
41
44
|
export { default as Profile } from './Profile';
|
package/cjs/icons/index.js
CHANGED
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.UploadIcon = exports.UnMerge = void 0;
|
|
6
|
+
exports.Search = exports.ResizeIconInline = exports.Remove = exports.ReferenceAttribute = exports.Recommended = exports.Radius = exports.Profile = exports.PotentialMatch = exports.Polygon = exports.PmTaskIcon = exports.PmIcon = exports.PivotingIcon = exports.PinOutlined = exports.Pin = exports.NotMatchRule = exports.NotMatchDark = exports.NoMatches = exports.NoDataSearch = exports.NoData = exports.NestedAttribute = exports.NegativeRuleTooltipIcon = exports.NegativeRuleIcon = exports.MlMatch = exports.MergeDark = exports.Merge = exports.LogOut = exports.LogIn = exports.IgnoredOutlined = exports.Ignored = exports.Filter = exports.Error = exports.EmptySearchResults = exports.Duplicate = exports.Draw = exports.Download = exports.Details = exports.Description = exports.DeleteRequestTaskIcon = exports.DefaultTaskIcon = exports.DefaultImage = exports.DcrTaskIcon = exports.Create = exports.Copy = exports.CommentBubble = exports.Comment = exports.CollaborationIcon = exports.Calendar = exports.AttributesList = exports.AddComment = exports.Add = void 0;
|
|
7
|
+
exports.UploadIcon = exports.UnMerge = exports.Table = exports.SimpleAttribute = exports.SelectAttributes = void 0;
|
|
8
8
|
var Add_1 = require("./Add");
|
|
9
9
|
Object.defineProperty(exports, "Add", { enumerable: true, get: function () { return __importDefault(Add_1).default; } });
|
|
10
10
|
var AddComment_1 = require("./AddComment");
|
|
@@ -31,6 +31,8 @@ var DefaultTaskIcon_1 = require("./DefaultTaskIcon");
|
|
|
31
31
|
Object.defineProperty(exports, "DefaultTaskIcon", { enumerable: true, get: function () { return __importDefault(DefaultTaskIcon_1).default; } });
|
|
32
32
|
var DeleteRequestTaskIcon_1 = require("./DeleteRequestTaskIcon");
|
|
33
33
|
Object.defineProperty(exports, "DeleteRequestTaskIcon", { enumerable: true, get: function () { return __importDefault(DeleteRequestTaskIcon_1).default; } });
|
|
34
|
+
var Description_1 = require("./Description");
|
|
35
|
+
Object.defineProperty(exports, "Description", { enumerable: true, get: function () { return __importDefault(Description_1).default; } });
|
|
34
36
|
var Details_1 = require("./Details");
|
|
35
37
|
Object.defineProperty(exports, "Details", { enumerable: true, get: function () { return __importDefault(Details_1).default; } });
|
|
36
38
|
var Download_1 = require("./Download");
|
|
@@ -53,12 +55,16 @@ var LogIn_1 = require("./LogIn");
|
|
|
53
55
|
Object.defineProperty(exports, "LogIn", { enumerable: true, get: function () { return __importDefault(LogIn_1).default; } });
|
|
54
56
|
var LogOut_1 = require("./LogOut");
|
|
55
57
|
Object.defineProperty(exports, "LogOut", { enumerable: true, get: function () { return __importDefault(LogOut_1).default; } });
|
|
56
|
-
var MlMatch_1 = require("./MlMatch");
|
|
57
|
-
Object.defineProperty(exports, "MlMatch", { enumerable: true, get: function () { return __importDefault(MlMatch_1).default; } });
|
|
58
58
|
var Merge_1 = require("./Merge");
|
|
59
59
|
Object.defineProperty(exports, "Merge", { enumerable: true, get: function () { return __importDefault(Merge_1).default; } });
|
|
60
60
|
var MergeDark_1 = require("./MergeDark");
|
|
61
61
|
Object.defineProperty(exports, "MergeDark", { enumerable: true, get: function () { return __importDefault(MergeDark_1).default; } });
|
|
62
|
+
var MlMatch_1 = require("./MlMatch");
|
|
63
|
+
Object.defineProperty(exports, "MlMatch", { enumerable: true, get: function () { return __importDefault(MlMatch_1).default; } });
|
|
64
|
+
var NegativeRuleIcon_1 = require("./NegativeRuleIcon");
|
|
65
|
+
Object.defineProperty(exports, "NegativeRuleIcon", { enumerable: true, get: function () { return __importDefault(NegativeRuleIcon_1).default; } });
|
|
66
|
+
var NegativeRuleTooltipIcon_1 = require("./NegativeRuleTooltipIcon");
|
|
67
|
+
Object.defineProperty(exports, "NegativeRuleTooltipIcon", { enumerable: true, get: function () { return __importDefault(NegativeRuleTooltipIcon_1).default; } });
|
|
62
68
|
var NestedAttribute_1 = require("./NestedAttribute");
|
|
63
69
|
Object.defineProperty(exports, "NestedAttribute", { enumerable: true, get: function () { return __importDefault(NestedAttribute_1).default; } });
|
|
64
70
|
var NoData_1 = require("./NoData");
|
|
@@ -71,16 +77,16 @@ var NotMatchDark_1 = require("./NotMatchDark");
|
|
|
71
77
|
Object.defineProperty(exports, "NotMatchDark", { enumerable: true, get: function () { return __importDefault(NotMatchDark_1).default; } });
|
|
72
78
|
var NotMatchRule_1 = require("./NotMatchRule");
|
|
73
79
|
Object.defineProperty(exports, "NotMatchRule", { enumerable: true, get: function () { return __importDefault(NotMatchRule_1).default; } });
|
|
74
|
-
var PmIcon_1 = require("./PmIcon");
|
|
75
|
-
Object.defineProperty(exports, "PmIcon", { enumerable: true, get: function () { return __importDefault(PmIcon_1).default; } });
|
|
76
|
-
var PmTaskIcon_1 = require("./PmTaskIcon");
|
|
77
|
-
Object.defineProperty(exports, "PmTaskIcon", { enumerable: true, get: function () { return __importDefault(PmTaskIcon_1).default; } });
|
|
78
80
|
var Pin_1 = require("./Pin");
|
|
79
81
|
Object.defineProperty(exports, "Pin", { enumerable: true, get: function () { return __importDefault(Pin_1).default; } });
|
|
80
82
|
var PinOutlined_1 = require("./PinOutlined");
|
|
81
83
|
Object.defineProperty(exports, "PinOutlined", { enumerable: true, get: function () { return __importDefault(PinOutlined_1).default; } });
|
|
82
84
|
var PivotingIcon_1 = require("./PivotingIcon");
|
|
83
85
|
Object.defineProperty(exports, "PivotingIcon", { enumerable: true, get: function () { return __importDefault(PivotingIcon_1).default; } });
|
|
86
|
+
var PmIcon_1 = require("./PmIcon");
|
|
87
|
+
Object.defineProperty(exports, "PmIcon", { enumerable: true, get: function () { return __importDefault(PmIcon_1).default; } });
|
|
88
|
+
var PmTaskIcon_1 = require("./PmTaskIcon");
|
|
89
|
+
Object.defineProperty(exports, "PmTaskIcon", { enumerable: true, get: function () { return __importDefault(PmTaskIcon_1).default; } });
|
|
84
90
|
var Polygon_1 = require("./Polygon");
|
|
85
91
|
Object.defineProperty(exports, "Polygon", { enumerable: true, get: function () { return __importDefault(Polygon_1).default; } });
|
|
86
92
|
var PotentialMatch_1 = require("./PotentialMatch");
|
|
@@ -83,10 +83,11 @@ var getTableRowsData = function (rowValues, columnsData, renderRowCell, getRowCe
|
|
|
83
83
|
};
|
|
84
84
|
var getTableHeadData = function (columnsData, filters, onFilter) {
|
|
85
85
|
return columnsData.map(function (_a) {
|
|
86
|
-
var id = _a.id, label = _a.label, sortable = _a.sortable, _b = _a.filterable, filterable = _b === void 0 ? true : _b, resizable = _a.resizable, draggable = _a.draggable, _c = _a.autoResize, autoResize = _c === void 0 ? true : _c, initialWidth = _a.initialWidth, minWidth = _a.minWidth, dataTypeDefinition = _a.dataTypeDefinition, filterOptions = _a.filterOptions, _d = _a.headCellRenderer, headCellRenderer = _d === void 0 ? withFilterAtBottom(DefaultHeadCellRenderer) : _d;
|
|
86
|
+
var id = _a.id, label = _a.label, description = _a.description, sortable = _a.sortable, _b = _a.filterable, filterable = _b === void 0 ? true : _b, resizable = _a.resizable, draggable = _a.draggable, _c = _a.autoResize, autoResize = _c === void 0 ? true : _c, initialWidth = _a.initialWidth, minWidth = _a.minWidth, dataTypeDefinition = _a.dataTypeDefinition, filterOptions = _a.filterOptions, _d = _a.headCellRenderer, headCellRenderer = _d === void 0 ? withFilterAtBottom(DefaultHeadCellRenderer) : _d;
|
|
87
87
|
return ({
|
|
88
88
|
id: id,
|
|
89
89
|
label: label,
|
|
90
|
+
description: description,
|
|
90
91
|
sortable: sortable,
|
|
91
92
|
resizable: resizable,
|
|
92
93
|
draggable: draggable,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ChipWithTooltip: React.ForwardRefExoticComponent<import("prop-types").InferPropsInner<Pick<{
|
|
3
|
+
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
4
|
+
tooltipPlacement: import("prop-types").Requireable<string>;
|
|
5
|
+
showForDisabled: import("prop-types").Requireable<boolean>;
|
|
6
|
+
}, never>> & Partial<import("prop-types").InferPropsInner<Pick<{
|
|
7
|
+
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
8
|
+
tooltipPlacement: import("prop-types").Requireable<string>;
|
|
9
|
+
showForDisabled: import("prop-types").Requireable<boolean>;
|
|
10
|
+
}, "tooltipTitle" | "tooltipPlacement" | "showForDisabled">>> & {
|
|
11
|
+
avatar?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
12
|
+
children?: null;
|
|
13
|
+
clickable?: boolean;
|
|
14
|
+
color?: "default" | "primary" | "secondary";
|
|
15
|
+
deleteIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
18
|
+
label?: React.ReactNode;
|
|
19
|
+
onDelete?: (event: any) => void;
|
|
20
|
+
size?: "medium" | "small";
|
|
21
|
+
variant?: "default" | "outlined";
|
|
22
|
+
} & import("@material-ui/core/OverridableComponent").CommonProps<import("@material-ui/core/Chip").ChipTypeMap<{}, "div">> & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
23
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
24
|
+
}, "translate" | "hidden" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key">>;
|
|
25
|
+
declare type Props = {
|
|
26
|
+
className?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
showDescription?: boolean;
|
|
29
|
+
};
|
|
30
|
+
declare const DescriptionIcon: ({ className, description }: Props) => JSX.Element;
|
|
31
|
+
export default DescriptionIcon;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import Chip from '@material-ui/core/Chip';
|
|
4
|
+
import { FeaturesContext } from '../../../contexts';
|
|
5
|
+
import { withTooltip } from '../../../HOCs';
|
|
6
|
+
import Description from '../../../icons/Description';
|
|
7
|
+
import { useStyles } from './styles';
|
|
8
|
+
export var ChipWithTooltip = withTooltip(Chip);
|
|
9
|
+
var DescriptionIcon = function (_a) {
|
|
10
|
+
var className = _a.className, description = _a.description;
|
|
11
|
+
var showDescription = useContext(FeaturesContext).showDescription;
|
|
12
|
+
var styles = useStyles();
|
|
13
|
+
if (!description || !showDescription) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (React.createElement(ChipWithTooltip, { tooltipTitle: description, tooltipPlacement: "bottom", icon: React.createElement(Description, null), classes: {
|
|
17
|
+
root: classnames(styles.container, className),
|
|
18
|
+
label: styles.label,
|
|
19
|
+
icon: styles.icon
|
|
20
|
+
} }));
|
|
21
|
+
};
|
|
22
|
+
export default DescriptionIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./DescriptionIcon";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DescriptionIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "label" | "container">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
export var useStyles = makeStyles(function () { return ({
|
|
3
|
+
container: {
|
|
4
|
+
height: '15px',
|
|
5
|
+
backgroundColor: 'transparent',
|
|
6
|
+
'&:hover': {
|
|
7
|
+
backgroundColor: 'transparent'
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
label: {
|
|
11
|
+
paddingLeft: '4px',
|
|
12
|
+
paddingRight: '4px',
|
|
13
|
+
fontSize: '10px',
|
|
14
|
+
lineHeight: '11px'
|
|
15
|
+
},
|
|
16
|
+
icon: {
|
|
17
|
+
width: '12px',
|
|
18
|
+
height: '12px',
|
|
19
|
+
marginRight: 0
|
|
20
|
+
}
|
|
21
|
+
}); });
|
|
@@ -24,7 +24,7 @@ var OvIcon = function (_a) {
|
|
|
24
24
|
var tooltipTitle = nonOvValues.length
|
|
25
25
|
? nonOvValues.map(function (value, i) { return (React.createElement("div", { key: i }, isComplexAttribute(attributeType) ? (getLabel(value.label)) : (React.createElement(DataTypeValue, { value: getAttributeValue(value), dataTypeDefinition: getAttrDataTypeDefinition(attributeType), rich: false })))); })
|
|
26
26
|
: null;
|
|
27
|
-
return (React.createElement(ChipWithTooltip, { tooltipTitle: tooltipTitle, tooltipPlacement: "
|
|
27
|
+
return (React.createElement(ChipWithTooltip, { tooltipTitle: tooltipTitle, tooltipPlacement: "bottom", label: "+ ".concat(nonOvTotal), variant: "outlined", onClick: onClick, classes: {
|
|
28
28
|
root: classnames(styles.container, className),
|
|
29
29
|
label: styles.label
|
|
30
30
|
} }));
|
|
@@ -15,13 +15,14 @@ import { withContext } from '../../../../HOCs';
|
|
|
15
15
|
import { PinnedAttributesContext } from '../contexts/PinnedAttributesContext';
|
|
16
16
|
import { useScrollToAttributeError } from '../../../../hooks';
|
|
17
17
|
import { ScrollToErrorContext } from '../../../../contexts';
|
|
18
|
+
import DescriptionIcon from '../../DescriptionIcon/DescriptionIcon';
|
|
18
19
|
import { useStyles } from './styles';
|
|
19
20
|
var AttributeRenderer = function (_a) {
|
|
20
21
|
var max = _a.max, values = _a.values, attributeType = _a.attributeType, parentUri = _a.parentUri, mode = _a.mode, drawLines = _a.drawLines, showEmptyEditors = _a.showEmptyEditors, errorMessage = _a.errorMessage, errors = _a.errors, paging = _a.paging, crosswalks = _a.crosswalks, showNonOv = _a.showNonOv, nonVisibleValues = _a.nonVisibleValues, highlightedError = _a.highlightedError, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, onDeactivateError = _a.onDeactivateError, additionalControlsRenderer = _a.additionalControlsRenderer, requestNextPageOfAttributeValues = _a.requestNextPageOfAttributeValues;
|
|
21
22
|
var styles = useStyles();
|
|
22
23
|
var _b = useState(max), visibleValuesCount = _b[0], setVisibleValuesCount = _b[1];
|
|
23
24
|
var _c = useState(false), hadDeletions = _c[0], setHadDeletions = _c[1];
|
|
24
|
-
var label = attributeType.label, isRequired = attributeType.required, cardinality = attributeType.cardinality, name = attributeType.name, attributeTypeUri = attributeType.uri;
|
|
25
|
+
var label = attributeType.label, isRequired = attributeType.required, cardinality = attributeType.cardinality, name = attributeType.name, attributeTypeUri = attributeType.uri, description = attributeType.description;
|
|
25
26
|
var isEditableMode = checkIsEditableMode(mode);
|
|
26
27
|
var _d = useScrollToAttributeError({ highlightedError: highlightedError }), ref = _d.ref, errorClassName = _d.errorClassName;
|
|
27
28
|
var pinnedAttributes = useContext(PinnedAttributesContext);
|
|
@@ -82,6 +83,7 @@ var AttributeRenderer = function (_a) {
|
|
|
82
83
|
React.createElement("div", { ref: ref, className: classNames(styles.wrapper, errorClassName) },
|
|
83
84
|
React.createElement("div", { className: styles.titleWrapper },
|
|
84
85
|
React.createElement(Title, { label: label, isRequired: isRequired, className: styles.title, "data-reltio-id": "reltio-attribute-label" }),
|
|
86
|
+
React.createElement(DescriptionIcon, { description: description, className: styles.description }),
|
|
85
87
|
React.createElement(OvIcon, { nonOvValues: nonVisibleValues, attributeType: attributeType, className: styles.ovIcon, nonOvTotal: totalNonVisibleValues })),
|
|
86
88
|
isEditableMode && React.createElement(Cardinality, { cardinality: cardinality }),
|
|
87
89
|
isEditableMode && React.createElement(ErrorMessage, { message: errorMessage, className: styles.typeError }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"caption" | "title" | "link" | "wrapper" | "ovIcon" | "svg-icon__root" | "attributesWrapper" | "typeError" | "titleWrapper">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"caption" | "title" | "link" | "description" | "wrapper" | "ovIcon" | "svg-icon__root" | "attributesWrapper" | "typeError" | "titleWrapper">;
|