@antscorp/antsomi-ui 1.3.5-beta.920 → 1.3.5-beta.921

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.
@@ -39,8 +39,12 @@ export const getValuesReplace = (objectReplace, data) => {
39
39
  });
40
40
  return values;
41
41
  };
42
- const sliceName = (name, positionSlice) => {
43
- const validateName = (name || 'N/A').replace(/https|http|www|\/\/|:/gi, '');
42
+ const parseUrl = (params) => {
43
+ const { name = 'N/A', positionSlice = 0 } = params;
44
+ const validateName = name.replace(/https|http|www|\/\/|:/gi, '');
45
+ if (positionSlice === 0 && validateName !== 'N/A') {
46
+ return validateName;
47
+ }
44
48
  if (positionSlice === 0 ||
45
49
  validateName === 'N/A' ||
46
50
  (positionSlice > validateName.length && validateName !== 'N/A') ||
@@ -63,7 +67,7 @@ export const getStringHtmlByType = (item, eType = 'product') => {
63
67
  return `<span class="title-no-url">${label}</span>`;
64
68
  }
65
69
  if (label === 'N/A') {
66
- return `<a class="title-have-url" href=${encodeURI(url)} target="_blank">${sliceName(url, 20)}</a>`;
70
+ return `<a class="title-have-url" href=${encodeURI(url)} target="_blank">${parseUrl({ name: url })}</a>`;
67
71
  }
68
72
  return `<a class="title-have-url" href=${url} target="_blank">${url}</a>`;
69
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.920",
3
+ "version": "1.3.5-beta.921",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",