@zohodesk/dot 1.0.0-temp-216 → 1.0.0-temp-218
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/README.md +5 -0
- package/es/AudioPlayer/__tests__/AudioPlayer.spec.js +186 -38
- package/es/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1851 -1
- package/es/list/SecondaryText/AccountName.js +12 -2
- package/es/list/SecondaryText/ContactName.js +12 -2
- package/es/list/SecondaryText/DepartmentText.js +12 -2
- package/es/list/SecondaryText/Email.js +13 -3
- package/es/list/SecondaryText/PhoneNumber.js +13 -3
- package/es/list/SecondaryText/PriorityText.js +12 -2
- package/es/list/SecondaryText/SecondaryText.js +12 -2
- package/es/list/SecondaryText/StatusText.js +12 -2
- package/es/list/SecondaryText/TicketId.js +13 -2
- package/es/list/SecondaryText/Website.js +13 -3
- package/es/list/SecondaryText/props/defaultProps.js +18 -0
- package/es/list/SecondaryText/props/propTypes.js +20 -0
- package/es/list/Subject/Subject.js +13 -3
- package/es/list/Subject/props/defaultProps.js +3 -1
- package/es/list/Subject/props/propTypes.js +28 -1
- package/lib/AudioPlayer/__tests__/AudioPlayer.spec.js +192 -32
- package/lib/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1851 -1
- package/lib/list/SecondaryText/AccountName.js +20 -2
- package/lib/list/SecondaryText/ContactName.js +20 -2
- package/lib/list/SecondaryText/DepartmentText.js +20 -2
- package/lib/list/SecondaryText/Email.js +21 -3
- package/lib/list/SecondaryText/PhoneNumber.js +21 -3
- package/lib/list/SecondaryText/PriorityText.js +20 -2
- package/lib/list/SecondaryText/SecondaryText.js +20 -2
- package/lib/list/SecondaryText/StatusText.js +20 -2
- package/lib/list/SecondaryText/TicketId.js +18 -2
- package/lib/list/SecondaryText/Website.js +21 -3
- package/lib/list/SecondaryText/props/defaultProps.js +18 -0
- package/lib/list/SecondaryText/props/propTypes.js +20 -0
- package/lib/list/Subject/Subject.js +21 -3
- package/lib/list/Subject/props/defaultProps.js +3 -1
- package/lib/list/Subject/props/propTypes.js +33 -1
- package/package.json +6 -12
|
@@ -7,6 +7,7 @@ import { AccountName_propTypes } from "./props/propTypes";
|
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
9
|
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
10
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
10
11
|
import Link from "../../Link/Link";
|
|
11
12
|
/**** CSS ****/
|
|
12
13
|
|
|
@@ -28,8 +29,17 @@ export default class AccountName extends Component {
|
|
|
28
29
|
secondaryAccountHref,
|
|
29
30
|
secondaryAccountClick,
|
|
30
31
|
secondaryAccountText,
|
|
32
|
+
highlights,
|
|
33
|
+
enableHighlight,
|
|
31
34
|
customProps
|
|
32
35
|
} = this.props;
|
|
36
|
+
const {
|
|
37
|
+
highlightData = []
|
|
38
|
+
} = highlights || {};
|
|
39
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
40
|
+
text,
|
|
41
|
+
...highlights
|
|
42
|
+
}) : text;
|
|
33
43
|
let {
|
|
34
44
|
LinkProps = {},
|
|
35
45
|
TextProps = {},
|
|
@@ -62,10 +72,10 @@ export default class AccountName extends Component {
|
|
|
62
72
|
ariaLabel: `Account Name ${text}`
|
|
63
73
|
}, /*#__PURE__*/React.createElement("div", {
|
|
64
74
|
className: `${style.textStyle} ${style[`font_${fontWeight}`]} ${className ? className : ''}`
|
|
65
|
-
},
|
|
75
|
+
}, displayContent)) : /*#__PURE__*/React.createElement("div", {
|
|
66
76
|
className: `${style.secondaryText} ${style[`font_${fontWeight}`]} ${className ? className : ''} ${notAccessible ? style.disable : ''}`,
|
|
67
77
|
...TextProps
|
|
68
|
-
},
|
|
78
|
+
}, displayContent)), secondaryAccountText && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Link, {
|
|
69
79
|
href: secondaryAccountHref,
|
|
70
80
|
onClick: secondaryAccountClick,
|
|
71
81
|
className: style.link
|
|
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import { ContactName_defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { ContactName_propTypes } from "./props/propTypes";
|
|
4
4
|
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
5
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
5
6
|
import Link from "../../Link/Link";
|
|
6
7
|
import SentimentStatus from "../SentimentStatus/SentimentStatus";
|
|
7
8
|
import { Icon } from '@zohodesk/icons';
|
|
@@ -23,6 +24,8 @@ export default class ContactName extends Component {
|
|
|
23
24
|
notAccessible = false,
|
|
24
25
|
fontWeight,
|
|
25
26
|
i18nKeys,
|
|
27
|
+
highlights,
|
|
28
|
+
enableHighlight,
|
|
26
29
|
customProps
|
|
27
30
|
} = this.props;
|
|
28
31
|
let {
|
|
@@ -38,6 +41,13 @@ export default class ContactName extends Component {
|
|
|
38
41
|
LinkProps = {},
|
|
39
42
|
TextProps = {}
|
|
40
43
|
} = customProps;
|
|
44
|
+
const {
|
|
45
|
+
highlightData = []
|
|
46
|
+
} = highlights || {};
|
|
47
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
48
|
+
text,
|
|
49
|
+
...highlights
|
|
50
|
+
}) : text;
|
|
41
51
|
return /*#__PURE__*/React.createElement(Container, {
|
|
42
52
|
alignBox: "row",
|
|
43
53
|
align: "baseline",
|
|
@@ -64,11 +74,11 @@ export default class ContactName extends Component {
|
|
|
64
74
|
ariaLabel: `Contact Name ${text}`
|
|
65
75
|
}, /*#__PURE__*/React.createElement("div", {
|
|
66
76
|
className: `${style.textStyle} ${style[`font_${fontWeight}`]} ${className ? className : ''}`
|
|
67
|
-
},
|
|
77
|
+
}, displayContent)) : /*#__PURE__*/React.createElement("div", {
|
|
68
78
|
className: `${style.secondaryText} ${style[`font_${fontWeight}`]} ${className ? className : ''} ${notAccessible ? style.disable : ''}`,
|
|
69
79
|
"data-title": dataTitle,
|
|
70
80
|
...TextProps
|
|
71
|
-
},
|
|
81
|
+
}, displayContent)), sentimentType && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(SentimentStatus, {
|
|
72
82
|
type: sentimentType,
|
|
73
83
|
dataTitle: sentimentDataTitle
|
|
74
84
|
})));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { DepartmentText_propTypes } from "./props/propTypes";
|
|
3
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
3
4
|
import style from "./SecondaryText.module.css";
|
|
4
5
|
export default class DepartmentText extends Component {
|
|
5
6
|
constructor(props) {
|
|
@@ -11,14 +12,23 @@ export default class DepartmentText extends Component {
|
|
|
11
12
|
className,
|
|
12
13
|
text,
|
|
13
14
|
dataTitle,
|
|
14
|
-
dataId
|
|
15
|
+
dataId,
|
|
16
|
+
enableHighlight,
|
|
17
|
+
highlights
|
|
15
18
|
} = this.props;
|
|
19
|
+
const {
|
|
20
|
+
highlightData = []
|
|
21
|
+
} = highlights || {};
|
|
22
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
23
|
+
text,
|
|
24
|
+
...highlights
|
|
25
|
+
}) : text;
|
|
16
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
27
|
className: `${style.departmentText} ${className ? className : ''}`,
|
|
18
28
|
"data-title": dataTitle,
|
|
19
29
|
"data-id": dataId,
|
|
20
30
|
"data-test-id": dataId
|
|
21
|
-
},
|
|
31
|
+
}, displayContent);
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
}
|
|
@@ -6,6 +6,7 @@ import { Email_defaultProps } from "./props/defaultProps";
|
|
|
6
6
|
import { Email_propTypes } from "./props/propTypes";
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
9
10
|
import Link from "../../Link/Link";
|
|
10
11
|
/**** CSS ****/
|
|
11
12
|
|
|
@@ -22,12 +23,21 @@ export default class Email extends Component {
|
|
|
22
23
|
isLink,
|
|
23
24
|
target,
|
|
24
25
|
fontWeight,
|
|
25
|
-
customProps
|
|
26
|
+
customProps,
|
|
27
|
+
enableHighlight,
|
|
28
|
+
highlights
|
|
26
29
|
} = this.props;
|
|
27
30
|
let {
|
|
28
31
|
LinkProps = {},
|
|
29
32
|
TextProps = {}
|
|
30
33
|
} = customProps;
|
|
34
|
+
const {
|
|
35
|
+
highlightData = []
|
|
36
|
+
} = highlights || {};
|
|
37
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
38
|
+
text,
|
|
39
|
+
...highlights
|
|
40
|
+
}) : text;
|
|
31
41
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isLink ? /*#__PURE__*/React.createElement(Link, {
|
|
32
42
|
href: href,
|
|
33
43
|
title: title,
|
|
@@ -38,11 +48,11 @@ export default class Email extends Component {
|
|
|
38
48
|
...LinkProps
|
|
39
49
|
}, /*#__PURE__*/React.createElement("div", {
|
|
40
50
|
className: `${style.textStyle} ${style[`font_${fontWeight}`]} ${className ? className : ''}`
|
|
41
|
-
},
|
|
51
|
+
}, displayContent)) : /*#__PURE__*/React.createElement("div", {
|
|
42
52
|
className: `${style.secondaryText} ${style[`font_${fontWeight}`]} ${className ? className : ''}`,
|
|
43
53
|
"data-title": title,
|
|
44
54
|
...TextProps
|
|
45
|
-
},
|
|
55
|
+
}, displayContent));
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
}
|
|
@@ -6,6 +6,7 @@ import { PhoneNumber_defaultProps } from "./props/defaultProps";
|
|
|
6
6
|
import { PhoneNumber_propTypes } from "./props/propTypes";
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
9
10
|
import Link from "../../Link/Link";
|
|
10
11
|
/**** CSS ****/
|
|
11
12
|
|
|
@@ -24,12 +25,21 @@ export default class PhoneNumber extends Component {
|
|
|
24
25
|
target,
|
|
25
26
|
hasReload,
|
|
26
27
|
fontWeight,
|
|
27
|
-
customProps
|
|
28
|
+
customProps,
|
|
29
|
+
enableHighlight,
|
|
30
|
+
highlights
|
|
28
31
|
} = this.props;
|
|
29
32
|
let {
|
|
30
33
|
LinkProps = {},
|
|
31
34
|
TextProps = {}
|
|
32
35
|
} = customProps;
|
|
36
|
+
const {
|
|
37
|
+
highlightData = []
|
|
38
|
+
} = highlights || {};
|
|
39
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
40
|
+
text,
|
|
41
|
+
...highlights
|
|
42
|
+
}) : text;
|
|
33
43
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isLink ? /*#__PURE__*/React.createElement(Link, {
|
|
34
44
|
href: href,
|
|
35
45
|
title: title,
|
|
@@ -42,11 +52,11 @@ export default class PhoneNumber extends Component {
|
|
|
42
52
|
...LinkProps
|
|
43
53
|
}, /*#__PURE__*/React.createElement("div", {
|
|
44
54
|
className: `${style.phoneNumber} ${style[`font_${fontWeight}`]} ${className ? className : ''}`
|
|
45
|
-
},
|
|
55
|
+
}, displayContent)) : /*#__PURE__*/React.createElement("div", {
|
|
46
56
|
className: `${style.secondaryText} ${style[`font_${fontWeight}`]} ${className ? className : ''}`,
|
|
47
57
|
"data-title": title,
|
|
48
58
|
...TextProps
|
|
49
|
-
},
|
|
59
|
+
}, displayContent));
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { PriorityText_defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { PriorityText_propTypes } from "./props/propTypes";
|
|
4
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
4
5
|
import style from "./SecondaryText.module.css";
|
|
5
6
|
export default class PriorityText extends Component {
|
|
6
7
|
constructor(props) {
|
|
@@ -13,14 +14,23 @@ export default class PriorityText extends Component {
|
|
|
13
14
|
color,
|
|
14
15
|
text,
|
|
15
16
|
dataTitle,
|
|
16
|
-
dataId
|
|
17
|
+
dataId,
|
|
18
|
+
enableHighlight,
|
|
19
|
+
highlights
|
|
17
20
|
} = this.props;
|
|
21
|
+
const {
|
|
22
|
+
highlightData = []
|
|
23
|
+
} = highlights || {};
|
|
24
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
25
|
+
text,
|
|
26
|
+
...highlights
|
|
27
|
+
}) : text;
|
|
18
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
19
29
|
className: `${style.priorityText} ${style[color]} ${className ? className : ''}`,
|
|
20
30
|
"data-title": dataTitle,
|
|
21
31
|
"data-id": dataId,
|
|
22
32
|
"data-test-id": dataId
|
|
23
|
-
},
|
|
33
|
+
}, displayContent);
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { SecondaryText_defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { SecondaryText_propTypes } from "./props/propTypes";
|
|
4
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
4
5
|
import style from "./SecondaryText.module.css";
|
|
5
6
|
export default class SecondaryText extends Component {
|
|
6
7
|
constructor(props) {
|
|
@@ -14,11 +15,20 @@ export default class SecondaryText extends Component {
|
|
|
14
15
|
dataTitle,
|
|
15
16
|
dataId,
|
|
16
17
|
onClick,
|
|
17
|
-
customProps
|
|
18
|
+
customProps,
|
|
19
|
+
enableHighlight,
|
|
20
|
+
highlights
|
|
18
21
|
} = this.props;
|
|
19
22
|
let {
|
|
20
23
|
SecondaryTextProps
|
|
21
24
|
} = customProps;
|
|
25
|
+
const {
|
|
26
|
+
highlightData = []
|
|
27
|
+
} = highlights || {};
|
|
28
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
29
|
+
text,
|
|
30
|
+
...highlights
|
|
31
|
+
}) : text;
|
|
22
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
33
|
className: `${style.secondaryText} ${className ? className : ''}`,
|
|
24
34
|
"data-title": dataTitle,
|
|
@@ -26,7 +36,7 @@ export default class SecondaryText extends Component {
|
|
|
26
36
|
"data-test-id": dataId,
|
|
27
37
|
onClick: onClick,
|
|
28
38
|
...SecondaryTextProps
|
|
29
|
-
},
|
|
39
|
+
}, displayContent);
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { StatusText_defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { StatusText_propTypes } from "./props/propTypes";
|
|
4
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
4
5
|
import style from "./SecondaryText.module.css";
|
|
5
6
|
export default class StatusText extends Component {
|
|
6
7
|
constructor(props) {
|
|
@@ -14,14 +15,23 @@ export default class StatusText extends Component {
|
|
|
14
15
|
text,
|
|
15
16
|
dataTitle,
|
|
16
17
|
fontWeight,
|
|
17
|
-
dataId
|
|
18
|
+
dataId,
|
|
19
|
+
enableHighlight,
|
|
20
|
+
highlights
|
|
18
21
|
} = this.props;
|
|
22
|
+
const {
|
|
23
|
+
highlightData = []
|
|
24
|
+
} = highlights || {};
|
|
25
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
26
|
+
text,
|
|
27
|
+
...highlights
|
|
28
|
+
}) : text;
|
|
19
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
30
|
className: `${style.statusText} ${style[color]} ${style[`font_${fontWeight}`]} ${className ? className : ''}`,
|
|
21
31
|
"data-title": dataTitle,
|
|
22
32
|
"data-id": dataId,
|
|
23
33
|
"data-test-id": dataId
|
|
24
|
-
},
|
|
34
|
+
}, displayContent);
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
}
|
|
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import { TicketId_defaultProps } from "./props/defaultProps";
|
|
3
3
|
import { TicketId_propTypes } from "./props/propTypes";
|
|
4
4
|
import Link from "../../Link/Link";
|
|
5
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
5
6
|
import style from "./SecondaryText.module.css";
|
|
6
7
|
export default class TicketId extends Component {
|
|
7
8
|
constructor(props) {
|
|
@@ -20,12 +21,22 @@ export default class TicketId extends Component {
|
|
|
20
21
|
target,
|
|
21
22
|
urlName,
|
|
22
23
|
urlData,
|
|
23
|
-
customProps
|
|
24
|
+
customProps,
|
|
25
|
+
enableHighlight,
|
|
26
|
+
highlights
|
|
24
27
|
} = this.props;
|
|
25
28
|
let {
|
|
26
29
|
LinkProps = {},
|
|
27
30
|
TicketIdProps = {}
|
|
28
31
|
} = customProps;
|
|
32
|
+
const {
|
|
33
|
+
highlightData = []
|
|
34
|
+
} = highlights;
|
|
35
|
+
const processedText = enableHighlight && highlightData && highlightData.length > 0 && typeof text === 'string' ? highlightText({
|
|
36
|
+
text,
|
|
37
|
+
...highlights
|
|
38
|
+
}) : text;
|
|
39
|
+
const textContent = Array.isArray(processedText) ? /*#__PURE__*/React.createElement(React.Fragment, null, processedText) : processedText;
|
|
29
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
41
|
className: `${style.ticketId} ${isLink ? style.ticketIdLink : ''} ${className ? className : ''}`,
|
|
31
42
|
"data-id": dataId,
|
|
@@ -40,7 +51,7 @@ export default class TicketId extends Component {
|
|
|
40
51
|
target: target,
|
|
41
52
|
onClick: onClick,
|
|
42
53
|
...LinkProps
|
|
43
|
-
},
|
|
54
|
+
}, textContent) : textContent);
|
|
44
55
|
}
|
|
45
56
|
|
|
46
57
|
}
|
|
@@ -6,6 +6,7 @@ import { Website_defaultProps } from "./props/defaultProps";
|
|
|
6
6
|
import { Website_propTypes } from "./props/propTypes";
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
9
10
|
import ExternalLink from "../../ExternalLink/ExternalLink";
|
|
10
11
|
/**** CSS ****/
|
|
11
12
|
|
|
@@ -19,18 +20,27 @@ export default class Website extends Component {
|
|
|
19
20
|
href,
|
|
20
21
|
dataId,
|
|
21
22
|
isLink,
|
|
22
|
-
target
|
|
23
|
+
target,
|
|
24
|
+
enableHighlight,
|
|
25
|
+
highlights
|
|
23
26
|
} = this.props;
|
|
27
|
+
const {
|
|
28
|
+
highlightData = []
|
|
29
|
+
} = highlights || {};
|
|
30
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
31
|
+
text,
|
|
32
|
+
...highlights
|
|
33
|
+
}) : text;
|
|
24
34
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isLink ? /*#__PURE__*/React.createElement(ExternalLink, {
|
|
25
35
|
className: `${style.textStyle} ${className ? className : ''}`,
|
|
26
36
|
href: href,
|
|
27
37
|
title: title,
|
|
28
38
|
dataId: dataId,
|
|
29
39
|
target: target
|
|
30
|
-
},
|
|
40
|
+
}, displayContent) : /*#__PURE__*/React.createElement("div", {
|
|
31
41
|
className: `${style.secondaryText} ${className ? className : ''}`,
|
|
32
42
|
"data-title": text
|
|
33
|
-
},
|
|
43
|
+
}, displayContent));
|
|
34
44
|
}
|
|
35
45
|
|
|
36
46
|
}
|
|
@@ -2,6 +2,8 @@ export const AccountName_defaultProps = {
|
|
|
2
2
|
isLink: true,
|
|
3
3
|
dataId: 'accountName',
|
|
4
4
|
fontWeight: 'regular',
|
|
5
|
+
enableHighlight: false,
|
|
6
|
+
highlights: {},
|
|
5
7
|
customProps: {}
|
|
6
8
|
};
|
|
7
9
|
export const ContactName_defaultProps = {
|
|
@@ -10,35 +12,51 @@ export const ContactName_defaultProps = {
|
|
|
10
12
|
dataId: 'contactName',
|
|
11
13
|
fontWeight: 'regular',
|
|
12
14
|
i18nKeys: {},
|
|
15
|
+
enableHighlight: false,
|
|
16
|
+
highlights: {},
|
|
13
17
|
customProps: {}
|
|
14
18
|
};
|
|
15
19
|
export const Email_defaultProps = {
|
|
16
20
|
isLink: true,
|
|
17
21
|
fontWeight: 'regular',
|
|
22
|
+
enableHighlight: false,
|
|
23
|
+
highlights: {},
|
|
18
24
|
customProps: {}
|
|
19
25
|
};
|
|
20
26
|
export const PhoneNumber_defaultProps = {
|
|
21
27
|
isLink: true,
|
|
22
28
|
hasReload: false,
|
|
23
29
|
fontWeight: 'regular',
|
|
30
|
+
enableHighlight: false,
|
|
31
|
+
highlights: {},
|
|
24
32
|
customProps: {}
|
|
25
33
|
};
|
|
26
34
|
export const PriorityText_defaultProps = {
|
|
27
35
|
color: 'black',
|
|
36
|
+
enableHighlight: false,
|
|
37
|
+
highlights: {},
|
|
28
38
|
dataId: 'priority'
|
|
29
39
|
};
|
|
30
40
|
export const SecondaryText_defaultProps = {
|
|
41
|
+
enableHighlight: false,
|
|
42
|
+
highlights: {},
|
|
31
43
|
customProps: {}
|
|
32
44
|
};
|
|
33
45
|
export const StatusText_defaultProps = {
|
|
34
46
|
color: 'black',
|
|
35
47
|
dataId: 'statusContainer',
|
|
48
|
+
enableHighlight: false,
|
|
49
|
+
highlights: {},
|
|
36
50
|
fontWeight: 'regular'
|
|
37
51
|
};
|
|
38
52
|
export const TicketId_defaultProps = {
|
|
39
53
|
dataId: 'ticketId',
|
|
54
|
+
enableHighlight: false,
|
|
55
|
+
highlights: {},
|
|
40
56
|
customProps: {}
|
|
41
57
|
};
|
|
42
58
|
export const Website_defaultProps = {
|
|
59
|
+
enableHighlight: false,
|
|
60
|
+
highlights: {},
|
|
43
61
|
isLink: true
|
|
44
62
|
};
|
|
@@ -14,6 +14,8 @@ export const AccountName_propTypes = {
|
|
|
14
14
|
secondaryAccountHref: PropTypes.string,
|
|
15
15
|
secondaryAccountClick: PropTypes.func,
|
|
16
16
|
secondaryAccountText: PropTypes.string,
|
|
17
|
+
enableHighlight: PropTypes.bool,
|
|
18
|
+
highlights: PropTypes.object,
|
|
17
19
|
customProps: PropTypes.shape({
|
|
18
20
|
LinkProps: PropTypes.object,
|
|
19
21
|
TextProps: PropTypes.object,
|
|
@@ -42,6 +44,8 @@ export const ContactName_propTypes = {
|
|
|
42
44
|
}),
|
|
43
45
|
paidTitle: PropTypes.string
|
|
44
46
|
}),
|
|
47
|
+
enableHighlight: PropTypes.bool,
|
|
48
|
+
highlights: PropTypes.object,
|
|
45
49
|
customProps: PropTypes.shape({
|
|
46
50
|
LinkProps: PropTypes.object,
|
|
47
51
|
TextProps: PropTypes.object
|
|
@@ -51,6 +55,8 @@ export const DepartmentText_propTypes = {
|
|
|
51
55
|
className: PropTypes.string,
|
|
52
56
|
dataId: PropTypes.string,
|
|
53
57
|
dataTitle: PropTypes.string,
|
|
58
|
+
enableHighlight: PropTypes.bool,
|
|
59
|
+
highlights: PropTypes.object,
|
|
54
60
|
text: PropTypes.string
|
|
55
61
|
};
|
|
56
62
|
export const Email_propTypes = {
|
|
@@ -63,6 +69,8 @@ export const Email_propTypes = {
|
|
|
63
69
|
title: PropTypes.string,
|
|
64
70
|
urlData: PropTypes.object,
|
|
65
71
|
urlName: PropTypes.string,
|
|
72
|
+
enableHighlight: PropTypes.bool,
|
|
73
|
+
highlights: PropTypes.object,
|
|
66
74
|
customProps: PropTypes.shape({
|
|
67
75
|
LinkProps: PropTypes.object,
|
|
68
76
|
TextProps: PropTypes.object
|
|
@@ -85,6 +93,8 @@ export const PhoneNumber_propTypes = {
|
|
|
85
93
|
title: PropTypes.string,
|
|
86
94
|
urlData: PropTypes.object,
|
|
87
95
|
urlName: PropTypes.string,
|
|
96
|
+
enableHighlight: PropTypes.bool,
|
|
97
|
+
highlights: PropTypes.object,
|
|
88
98
|
customProps: PropTypes.shape({
|
|
89
99
|
LinkProps: PropTypes.object,
|
|
90
100
|
TextProps: PropTypes.object
|
|
@@ -95,6 +105,8 @@ export const PriorityText_propTypes = {
|
|
|
95
105
|
color: PropTypes.oneOf(['red', 'green', 'gray', 'orange']),
|
|
96
106
|
dataId: PropTypes.string,
|
|
97
107
|
dataTitle: PropTypes.string,
|
|
108
|
+
enableHighlight: PropTypes.bool,
|
|
109
|
+
highlights: PropTypes.object,
|
|
98
110
|
text: PropTypes.string
|
|
99
111
|
};
|
|
100
112
|
export const SecondaryText_propTypes = {
|
|
@@ -103,6 +115,8 @@ export const SecondaryText_propTypes = {
|
|
|
103
115
|
dataTitle: PropTypes.string,
|
|
104
116
|
onClick: PropTypes.func,
|
|
105
117
|
text: PropTypes.string,
|
|
118
|
+
enableHighlight: PropTypes.bool,
|
|
119
|
+
highlights: PropTypes.object,
|
|
106
120
|
customProps: PropTypes.shape({
|
|
107
121
|
SecondaryTextProps: PropTypes.object
|
|
108
122
|
})
|
|
@@ -113,6 +127,8 @@ export const StatusText_propTypes = {
|
|
|
113
127
|
dataId: PropTypes.string,
|
|
114
128
|
dataTitle: PropTypes.string,
|
|
115
129
|
fontWeight: PropTypes.oneOf(['regular', 'semibold', 'bold']),
|
|
130
|
+
enableHighlight: PropTypes.bool,
|
|
131
|
+
highlights: PropTypes.object,
|
|
116
132
|
text: PropTypes.string
|
|
117
133
|
};
|
|
118
134
|
export const TicketId_propTypes = {
|
|
@@ -126,6 +142,8 @@ export const TicketId_propTypes = {
|
|
|
126
142
|
url: PropTypes.string,
|
|
127
143
|
urlData: PropTypes.string,
|
|
128
144
|
urlName: PropTypes.string,
|
|
145
|
+
enableHighlight: PropTypes.bool,
|
|
146
|
+
highlights: PropTypes.object,
|
|
129
147
|
customProps: PropTypes.shape({
|
|
130
148
|
TicketIdProps: PropTypes.object,
|
|
131
149
|
LinkProps: PropTypes.object
|
|
@@ -138,5 +156,7 @@ export const Website_propTypes = {
|
|
|
138
156
|
isLink: PropTypes.bool,
|
|
139
157
|
target: PropTypes.string,
|
|
140
158
|
text: PropTypes.string,
|
|
159
|
+
enableHighlight: PropTypes.bool,
|
|
160
|
+
highlights: PropTypes.object,
|
|
141
161
|
title: PropTypes.string
|
|
142
162
|
};
|
|
@@ -3,6 +3,7 @@ import { defaultProps } from "./props/defaultProps";
|
|
|
3
3
|
import { propTypes } from "./props/propTypes";
|
|
4
4
|
import Link from "../../Link/Link";
|
|
5
5
|
import { whiteSpaceClassMapping } from '@zohodesk/components/es/utils/cssUtils';
|
|
6
|
+
import { highlight as highlightText } from '@zohodesk/components/es/Typography/highlight';
|
|
6
7
|
import style from "./Subject.module.css";
|
|
7
8
|
export default class Subject extends Component {
|
|
8
9
|
constructor(props) {
|
|
@@ -24,12 +25,21 @@ export default class Subject extends Component {
|
|
|
24
25
|
isDotted,
|
|
25
26
|
children,
|
|
26
27
|
customProps,
|
|
27
|
-
whiteSpace
|
|
28
|
+
whiteSpace,
|
|
29
|
+
enableHighlight,
|
|
30
|
+
highlights
|
|
28
31
|
} = this.props;
|
|
29
32
|
let {
|
|
30
33
|
LinkProps = {},
|
|
31
34
|
TextProps = {}
|
|
32
35
|
} = customProps;
|
|
36
|
+
const {
|
|
37
|
+
highlightData = []
|
|
38
|
+
} = highlights || {};
|
|
39
|
+
const displayContent = enableHighlight && highlightData && highlightData.length > 0 && text ? highlightText({
|
|
40
|
+
text,
|
|
41
|
+
...highlights
|
|
42
|
+
}) : children ? children : text;
|
|
33
43
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isLink ? /*#__PURE__*/React.createElement(Link, {
|
|
34
44
|
urlName: urlName,
|
|
35
45
|
href: href,
|
|
@@ -41,14 +51,14 @@ export default class Subject extends Component {
|
|
|
41
51
|
target: target,
|
|
42
52
|
"data-title-wrap": whiteSpace,
|
|
43
53
|
...LinkProps
|
|
44
|
-
},
|
|
54
|
+
}, displayContent) : /*#__PURE__*/React.createElement("span", {
|
|
45
55
|
className: `${style.subject} ${isDotted ? style.dotted : ''} ${whiteSpaceClassMapping[whiteSpace]} ${className} ${style[`font_${fontWeight}`]}`,
|
|
46
56
|
"data-title": text,
|
|
47
57
|
"data-id": dataId,
|
|
48
58
|
"data-test-id": dataId,
|
|
49
59
|
"data-title-wrap": whiteSpace,
|
|
50
60
|
...TextProps
|
|
51
|
-
},
|
|
61
|
+
}, displayContent));
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
const highlightsStyleShape = PropTypes.shape({
|
|
3
|
+
weight: PropTypes.oneOf(['regular', 'light', 'semibold', 'bold']),
|
|
4
|
+
transform: PropTypes.oneOf(['default', 'upper', 'lower', 'capital']),
|
|
5
|
+
decoration: PropTypes.oneOf(['default', 'underline', 'strike', 'overline']),
|
|
6
|
+
typeFace: PropTypes.oneOf(['normal', 'italic']),
|
|
7
|
+
customClass: PropTypes.object
|
|
8
|
+
});
|
|
9
|
+
const commonHighlightProps = {
|
|
10
|
+
customStyle: PropTypes.object,
|
|
11
|
+
isExcludedIndex: PropTypes.bool,
|
|
12
|
+
isCaseSensitive: PropTypes.bool,
|
|
13
|
+
isWholeWord: PropTypes.bool,
|
|
14
|
+
tagName: PropTypes.string,
|
|
15
|
+
render: PropTypes.element,
|
|
16
|
+
highlightsStyle: PropTypes.objectOf(highlightsStyleShape)
|
|
17
|
+
};
|
|
2
18
|
export const propTypes = {
|
|
3
19
|
className: PropTypes.string,
|
|
4
20
|
dataId: PropTypes.string,
|
|
@@ -16,5 +32,16 @@ export const propTypes = {
|
|
|
16
32
|
LinkProps: PropTypes.object,
|
|
17
33
|
TextProps: PropTypes.object
|
|
18
34
|
}),
|
|
19
|
-
whiteSpace: PropTypes.oneOf(['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'])
|
|
35
|
+
whiteSpace: PropTypes.oneOf(['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']),
|
|
36
|
+
// Highlight props
|
|
37
|
+
enableHighlight: PropTypes.bool,
|
|
38
|
+
highlights: PropTypes.objectOf(PropTypes.shape({
|
|
39
|
+
text: PropTypes.string,
|
|
40
|
+
highlightData: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
41
|
+
highlightText: PropTypes.string,
|
|
42
|
+
index: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
|
|
43
|
+
...commonHighlightProps
|
|
44
|
+
})])),
|
|
45
|
+
...commonHighlightProps
|
|
46
|
+
}))
|
|
20
47
|
};
|