@topconsultnpm/sdkui-react-beta 6.12.19 → 6.12.20

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.
@@ -15,7 +15,7 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
15
15
  return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px' }, children: [values && values.length > 0 && _jsx(TMUserIdViewer, { userId: values?.[0], showIcon: true, noneSelectionText: '' }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
16
16
  };
17
17
  return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { disabled: disabled, placeHolder: placeHolder, readOnly: readOnly, labelColor: labelColor, icon: icon, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
18
- _jsx(TMUserChooserForm, { allowMultipleSelection: allowMultipleSelection, title: titleForm, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
18
+ _jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: allowMultipleSelection, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, onClose: () => setShowChooser(false), onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
19
19
  };
20
20
  export default TMUserChooser;
21
21
  export const TMUserChooserForm = ({ allowMultipleSelection, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose }) => {
@@ -28,9 +28,15 @@ const highlightSearchText = (markup, searchText) => {
28
28
  return text.replace(regex, '<span class="highlight">$1</span>');
29
29
  });
30
30
  };
31
+ const convertLinksToAnchors = (markup) => {
32
+ const urlRegex = /(?<!["'>])(https?:\/\/[^\s<]+)/g;
33
+ return markup.replace(urlRegex, (url) => {
34
+ return `<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`;
35
+ });
36
+ };
31
37
  const TMHtmlContentDisplay = (props) => {
32
38
  const { markup, searchText, isSelected } = props;
33
- let updatedMarkup = markup;
39
+ let updatedMarkup = convertLinksToAnchors(markup);
34
40
  if (searchText) {
35
41
  updatedMarkup = highlightSearchText(updatedMarkup, searchText);
36
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.12.19",
3
+ "version": "6.12.20",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",