@zohodesk/dot 1.0.0-temp-200.1 → 1.0.0-temp-187.3
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/.cli/propValidation_report.html +1 -1
- package/README.md +0 -4
- package/es/Attachment/Attachment.js +1 -2
- package/es/Attachment/Attachment.module.css +3 -7
- package/es/AttachmentViewer/Attachment.js +1 -60
- package/es/AttachmentViewer/AttachmentViewer.js +14 -148
- package/es/AttachmentViewer/AttachmentViewer.module.css +4 -124
- package/es/common/dot_common.module.css +2 -37
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +4 -2
- package/es/list/DepartmentDropDown/DepartmentDropDown.js +7 -2
- package/es/list/DepartmentDropDown/props/defaultProps.js +2 -1
- package/es/list/DepartmentDropDown/props/propTypes.js +2 -1
- package/es/list/status/StatusListItem/StatusListItem.module.css +35 -5
- package/es/lookup/header/Search/LookupSearch.module.css +27 -33
- package/es/lookup/header/Search/Search.js +40 -58
- package/es/lookup/header/Search/__tests__/Search.spec.js +1 -67
- package/es/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +3 -316
- package/es/lookup/header/Search/props/defaultProps.js +1 -3
- package/es/lookup/header/Search/props/propTypes.js +1 -6
- package/lib/Attachment/Attachment.js +1 -3
- package/lib/Attachment/Attachment.module.css +3 -7
- package/lib/AttachmentViewer/Attachment.js +1 -88
- package/lib/AttachmentViewer/AttachmentViewer.js +15 -148
- package/lib/AttachmentViewer/AttachmentViewer.module.css +4 -124
- package/lib/common/dot_common.module.css +2 -37
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +5 -3
- package/lib/list/DepartmentDropDown/DepartmentDropDown.js +8 -3
- package/lib/list/DepartmentDropDown/props/defaultProps.js +2 -1
- package/lib/list/DepartmentDropDown/props/propTypes.js +1 -1
- package/lib/list/status/StatusListItem/StatusListItem.module.css +35 -5
- package/lib/lookup/header/Search/LookupSearch.module.css +27 -33
- package/lib/lookup/header/Search/Search.js +66 -76
- package/lib/lookup/header/Search/__tests__/Search.spec.js +0 -65
- package/lib/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +3 -316
- package/lib/lookup/header/Search/props/defaultProps.js +1 -3
- package/lib/lookup/header/Search/props/propTypes.js +1 -6
- package/package.json +4 -4
- package/result.json +1 -1
- package/unittest/index.html +1 -1
- /package/images/{audio_thumbnail_old.png → audio_thumbnail.png} +0 -0
|
@@ -6,43 +6,58 @@
|
|
|
6
6
|
min-height: var(--zd_size35) ;
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
}
|
|
9
|
+
|
|
9
10
|
[dir=ltr] .withBorder {
|
|
10
11
|
border-left: 1px solid var(--zdt_statuslistitem_default_border);
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
[dir=rtl] .withBorder {
|
|
13
15
|
border-right: 1px solid var(--zdt_statuslistitem_default_border);
|
|
14
16
|
}
|
|
17
|
+
|
|
15
18
|
[dir=ltr] .small {
|
|
16
19
|
padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5) ;
|
|
17
20
|
}
|
|
21
|
+
|
|
18
22
|
[dir=rtl] .small {
|
|
19
23
|
padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size3) ;
|
|
20
24
|
}
|
|
25
|
+
|
|
21
26
|
.medium {
|
|
22
27
|
padding: var(--zd_size7) var(--zd_size20) ;
|
|
23
28
|
}
|
|
29
|
+
|
|
24
30
|
.large {
|
|
25
31
|
height: var(--zd_size48) ;
|
|
26
32
|
}
|
|
33
|
+
|
|
27
34
|
[dir=ltr] .large {
|
|
28
35
|
padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25) ;
|
|
29
36
|
}
|
|
37
|
+
|
|
30
38
|
[dir=rtl] .large {
|
|
31
39
|
padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3) ;
|
|
32
40
|
}
|
|
33
|
-
|
|
41
|
+
|
|
42
|
+
.value,
|
|
43
|
+
.multiLineValue {
|
|
34
44
|
line-height: 1.5385;
|
|
35
45
|
}
|
|
46
|
+
|
|
36
47
|
.value {
|
|
37
48
|
composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
|
|
38
49
|
}
|
|
39
|
-
|
|
50
|
+
|
|
51
|
+
.multiLineValue {
|
|
40
52
|
word-break: break-word;
|
|
53
|
+
-webkit-line-clamp: 3;
|
|
41
54
|
composes: clamp from '~@zohodesk/components/lib/common/common.module.css';
|
|
42
55
|
}
|
|
56
|
+
|
|
43
57
|
[dir=ltr] .withBorder.active {
|
|
44
58
|
border-left-color: var(--zdt_statuslistitem_default_active_border);
|
|
45
59
|
}
|
|
60
|
+
|
|
46
61
|
[dir=rtl] .withBorder.active {
|
|
47
62
|
border-right-color: var(--zdt_statuslistitem_default_active_border);
|
|
48
63
|
}
|
|
@@ -50,44 +65,56 @@
|
|
|
50
65
|
.default.hover, .default.effect:hover {
|
|
51
66
|
background-color: var(--zdt_statuslistitem_default_effect_bg);
|
|
52
67
|
}
|
|
68
|
+
|
|
53
69
|
.primary.hover, .primary.effect:hover, .selected {
|
|
54
70
|
background-color: var(--zdt_statuslistitem_primary_efffect_bg);
|
|
55
71
|
}
|
|
72
|
+
|
|
56
73
|
.secondary.hover, .secondary.effect:hover {
|
|
57
74
|
background-color: var(--zdt_statuslistitem_secondary_effect_bg);
|
|
58
75
|
}
|
|
76
|
+
|
|
59
77
|
.list.active.default, .list.active.primary {
|
|
60
78
|
background-color: var(--zdt_statuslistitem_primary_efffect_bg);
|
|
61
79
|
}
|
|
80
|
+
|
|
62
81
|
.list.active.secondary {
|
|
63
82
|
background-color: var(--zdt_statuslistitem_secondary_effect_bg);
|
|
64
83
|
}
|
|
84
|
+
|
|
65
85
|
.secondary.hover,
|
|
66
86
|
.secondary.effect:hover,
|
|
67
87
|
.list.active.secondary {
|
|
68
88
|
color: var(--zdt_statuslistitem_secondary_effect_text);
|
|
69
89
|
}
|
|
90
|
+
|
|
70
91
|
.tickIcon {
|
|
71
92
|
color: var(--zdt_statuslistitem_tickicon);
|
|
72
93
|
position: absolute;
|
|
73
|
-
top:50% ;
|
|
94
|
+
top: 50% ;
|
|
74
95
|
transform: translateY(-50%);
|
|
75
96
|
}
|
|
97
|
+
|
|
76
98
|
[dir=ltr] .tickIcon {
|
|
77
99
|
right: var(--zd_size20) ;
|
|
78
100
|
}
|
|
101
|
+
|
|
79
102
|
[dir=rtl] .tickIcon {
|
|
80
103
|
left: var(--zd_size20) ;
|
|
81
104
|
}
|
|
82
|
-
|
|
105
|
+
|
|
106
|
+
.tickIcon>i {
|
|
83
107
|
display: block;
|
|
84
108
|
}
|
|
109
|
+
|
|
85
110
|
[dir=ltr] .active.withTick {
|
|
86
111
|
padding-right: var(--zd_size39) ;
|
|
87
112
|
}
|
|
113
|
+
|
|
88
114
|
[dir=rtl] .active.withTick {
|
|
89
115
|
padding-left: var(--zd_size39) ;
|
|
90
116
|
}
|
|
117
|
+
|
|
91
118
|
/* Status Type */
|
|
92
119
|
.statusType {
|
|
93
120
|
width: var(--zd_size8) ;
|
|
@@ -100,12 +127,15 @@
|
|
|
100
127
|
[dir=rtl] .statusType {
|
|
101
128
|
margin-left: var(--zd_size13) ;
|
|
102
129
|
}
|
|
130
|
+
|
|
103
131
|
.black {
|
|
104
132
|
background-color: var(--zdt_statuslistitem_black_bg);
|
|
105
133
|
}
|
|
134
|
+
|
|
106
135
|
.orange {
|
|
107
136
|
background-color: var(--zdt_statuslistitem_orange_bg);
|
|
108
137
|
}
|
|
138
|
+
|
|
109
139
|
.green {
|
|
110
140
|
background-color: var(--zdt_statuslistitem_green_bg);
|
|
111
|
-
}
|
|
141
|
+
}
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
.
|
|
1
|
+
.searchStyle,
|
|
2
|
+
.boxStyle {
|
|
2
3
|
transition: var(--zd_transition1);
|
|
3
|
-
width: var(--
|
|
4
|
+
width: var(--zd_size96) ;
|
|
4
5
|
height: var(--zd_size28) ;
|
|
5
6
|
position: relative;
|
|
7
|
+
}.searchStyle, .boxStyle {
|
|
8
|
+
background: none;
|
|
6
9
|
}
|
|
7
|
-
.
|
|
8
|
-
|
|
10
|
+
.boxStyle {
|
|
11
|
+
width: var(--zd_size160) ;
|
|
9
12
|
border-radius: 4px;
|
|
13
|
+
border: 1px solid var(--zdt_lookupsearch_boxstyle_border);
|
|
10
14
|
}
|
|
11
|
-
.
|
|
12
|
-
border-bottom: 1px solid transparent;
|
|
13
|
-
}
|
|
14
|
-
.boxType, .borderType {
|
|
15
|
-
border-color: var(--zdt_lookupsearch_boxstyle_border);
|
|
16
|
-
}
|
|
17
|
-
.boxType:hover, .borderType:hover {
|
|
15
|
+
.searchStyle:hover, .boxStyle:hover {
|
|
18
16
|
border-color: var(--zdt_lookupsearch_boxstyle_hover_border);
|
|
19
17
|
}
|
|
20
|
-
.boxType.active, .borderType.active {
|
|
21
|
-
border-color: var(--zdt_lookupsearch_boxstyle_activer_border);
|
|
22
|
-
}
|
|
23
18
|
.focusWidth {
|
|
24
19
|
width: var(--zd_size220) ;
|
|
25
20
|
}
|
|
@@ -28,36 +23,35 @@
|
|
|
28
23
|
height: var(--zd_size28) ;
|
|
29
24
|
cursor: pointer;
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
.drpSearchBox::after {
|
|
27
|
+
content: '';
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: var(--zd_size8) ;
|
|
30
|
+
bottom: var(--zd_size8) ;
|
|
33
31
|
}
|
|
34
|
-
[dir=
|
|
35
|
-
|
|
32
|
+
[dir=ltr] .drpSearchBox::after {
|
|
33
|
+
right: calc( var(--zd_size1) * -1 ) ;
|
|
34
|
+
border-right: 1px solid var(--zdt_lookupsearch_boxstyle_border);
|
|
36
35
|
}
|
|
37
|
-
[dir=
|
|
38
|
-
|
|
36
|
+
[dir=rtl] .drpSearchBox::after {
|
|
37
|
+
left: calc( var(--zd_size1) * -1 ) ;
|
|
38
|
+
border-left: 1px solid var(--zdt_lookupsearch_boxstyle_border);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
padding
|
|
40
|
+
.inputBox, .drpSearchBox {
|
|
41
|
+
padding: 0 var(--zd_size9) ;
|
|
42
42
|
}
|
|
43
43
|
[dir=ltr] .searchIconBox {
|
|
44
|
-
padding
|
|
44
|
+
padding: var(--zd_size4) 0 var(--zd_size4) var(--zd_size9) ;
|
|
45
45
|
}
|
|
46
46
|
[dir=rtl] .searchIconBox {
|
|
47
|
-
padding
|
|
47
|
+
padding: var(--zd_size4) var(--zd_size9) var(--zd_size4) 0 ;
|
|
48
48
|
}
|
|
49
49
|
.active, .boxStyle.active, .lineActive.drpSearchBox::after {
|
|
50
50
|
border-color: var(--zdt_lookupsearch_boxstyle_activer_border);
|
|
51
51
|
}
|
|
52
52
|
[dir=ltr] .iconArrow {
|
|
53
|
-
margin-left: var(--
|
|
53
|
+
margin-left: var(--zd_size5) ;
|
|
54
54
|
}
|
|
55
55
|
[dir=rtl] .iconArrow {
|
|
56
|
-
margin-right: var(--
|
|
57
|
-
}
|
|
58
|
-
.separator {
|
|
59
|
-
width: var(--zd_size1) ;
|
|
60
|
-
height: var(--zd_size16) ;
|
|
61
|
-
margin: 0 var(--zd_size12) ;
|
|
62
|
-
background-color: var(--zdt_lookupsearch_boxstyle_border);
|
|
63
|
-
}
|
|
56
|
+
margin-right: var(--zd_size5) ;
|
|
57
|
+
}
|
|
@@ -8,7 +8,6 @@ import { Search_propTypes, SearchUI_propTypes } from "./props/propTypes";
|
|
|
8
8
|
|
|
9
9
|
import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
|
|
10
10
|
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
11
|
-
import { mergeStyle } from '@zohodesk/utils';
|
|
12
11
|
import { Icon } from '@zohodesk/icons';
|
|
13
12
|
import ToggleDropDown from "../../../dropdown/ToggleDropDown/ToggleDropDown";
|
|
14
13
|
/** * Methods ** */
|
|
@@ -17,19 +16,33 @@ import { debounce } from '@zohodesk/components/lib/utils/debounce';
|
|
|
17
16
|
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
18
17
|
/** * CSS ** */
|
|
19
18
|
|
|
20
|
-
import
|
|
19
|
+
import style from "./LookupSearch.module.css";
|
|
21
20
|
export default class Search extends Component {
|
|
22
21
|
constructor(props) {
|
|
23
22
|
super(props);
|
|
23
|
+
this.handleDropDownOpen = this.handleDropDownOpen.bind(this);
|
|
24
|
+
this.handleDropDownClose = this.handleDropDownClose.bind(this);
|
|
24
25
|
this.handleTextBoxFocus = this.handleTextBoxFocus.bind(this);
|
|
25
26
|
this.handleTextBoxBlur = this.handleTextBoxBlur.bind(this);
|
|
26
27
|
this.handleGetTextBoxRef = this.handleGetTextBoxRef.bind(this);
|
|
27
|
-
this.handleRenderChildren = this.handleRenderChildren.bind(this);
|
|
28
28
|
this.state = {
|
|
29
|
-
isFocus: false
|
|
29
|
+
isFocus: false,
|
|
30
|
+
isDropDownOpen: false
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
handleDropDownOpen() {
|
|
35
|
+
this.setState({
|
|
36
|
+
isDropDownOpen: true
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
handleDropDownClose() {
|
|
41
|
+
this.setState({
|
|
42
|
+
isDropDownOpen: false
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
33
46
|
handleTextBoxFocus(e) {
|
|
34
47
|
const {
|
|
35
48
|
onFocus
|
|
@@ -58,42 +71,22 @@ export default class Search extends Component {
|
|
|
58
71
|
getRef && getRef(el);
|
|
59
72
|
}
|
|
60
73
|
|
|
61
|
-
handleRenderChildren(_ref) {
|
|
62
|
-
let {
|
|
63
|
-
isActive,
|
|
64
|
-
isFocus
|
|
65
|
-
} = _ref;
|
|
66
|
-
const {
|
|
67
|
-
value,
|
|
68
|
-
selectedId,
|
|
69
|
-
renderChildren
|
|
70
|
-
} = this.props;
|
|
71
|
-
return renderChildren({
|
|
72
|
-
isActive,
|
|
73
|
-
isFocus,
|
|
74
|
-
value,
|
|
75
|
-
selectedId
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
74
|
render() {
|
|
80
75
|
const {
|
|
81
76
|
options,
|
|
82
77
|
onSelect,
|
|
83
78
|
value,
|
|
84
|
-
selectedId
|
|
85
|
-
renderChildren
|
|
79
|
+
selectedId
|
|
86
80
|
} = this.props;
|
|
87
81
|
const {
|
|
88
|
-
isFocus
|
|
82
|
+
isFocus,
|
|
83
|
+
isDropDownOpen
|
|
89
84
|
} = this.state;
|
|
90
85
|
const searchUIExtraProps = {
|
|
91
|
-
isFocus: isFocus,
|
|
86
|
+
isFocus: isFocus || isDropDownOpen,
|
|
92
87
|
onFocus: this.handleTextBoxFocus,
|
|
93
88
|
onBlur: this.handleTextBoxBlur,
|
|
94
|
-
getRef: this.handleGetTextBoxRef
|
|
95
|
-
value: value,
|
|
96
|
-
renderChildren: typeof renderChildren == 'function' ? this.handleRenderChildren : undefined
|
|
89
|
+
getRef: this.handleGetTextBoxRef
|
|
97
90
|
};
|
|
98
91
|
return options ? /*#__PURE__*/React.createElement(ToggleDropDown, {
|
|
99
92
|
value: value,
|
|
@@ -102,7 +95,9 @@ export default class Search extends Component {
|
|
|
102
95
|
needTick: true,
|
|
103
96
|
isArrow: false,
|
|
104
97
|
isToggleStateNeeded: true,
|
|
105
|
-
selectedId: selectedId
|
|
98
|
+
selectedId: selectedId,
|
|
99
|
+
onDropDownOpen: this.handleDropDownOpen,
|
|
100
|
+
onDropDownClose: this.handleDropDownClose
|
|
106
101
|
}, /*#__PURE__*/React.createElement(SearchUI, { ...this.props,
|
|
107
102
|
...searchUIExtraProps
|
|
108
103
|
})) : /*#__PURE__*/React.createElement(SearchUI, { ...this.props,
|
|
@@ -176,29 +171,15 @@ class SearchUI extends Component {
|
|
|
176
171
|
activeClass,
|
|
177
172
|
isFocus,
|
|
178
173
|
onFocus,
|
|
179
|
-
onBlur
|
|
180
|
-
renderChildren,
|
|
181
|
-
isActive,
|
|
182
|
-
hasSeparator,
|
|
183
|
-
customStyle
|
|
174
|
+
onBlur
|
|
184
175
|
} = this.props;
|
|
185
|
-
const isActiveState = isFocus || isActive;
|
|
186
|
-
const isFocusWidth = isActiveState || searchStr;
|
|
187
|
-
const style = mergeStyle(defaultStyle, customStyle);
|
|
188
176
|
return /*#__PURE__*/React.createElement(Container, {
|
|
189
177
|
isCover: false,
|
|
190
178
|
alignBox: "row",
|
|
191
179
|
align: "vertical",
|
|
192
|
-
className: `
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
${isFocusWidth ? style.focusWidth : ''}
|
|
196
|
-
`
|
|
197
|
-
}, typeof renderChildren == 'function' ? renderChildren({
|
|
198
|
-
isActive,
|
|
199
|
-
isFocus
|
|
200
|
-
}) : options ? /*#__PURE__*/React.createElement(Container, {
|
|
201
|
-
className: `${style.drpSearchBox} ${isActiveState ? style.lineActive : ''}`,
|
|
180
|
+
className: `${style.searchStyle} ${isBoxed ? style.boxStyle : ''} ${isFocus ? `${style.active} ${activeClass ? activeClass : ''} ` : ''} ${searchStr || isFocus ? style.focusWidth : ''}`
|
|
181
|
+
}, options && /*#__PURE__*/React.createElement(Container, {
|
|
182
|
+
className: `${style.drpSearchBox} ${isFocus ? style.lineActive : ''}`,
|
|
202
183
|
isCover: false,
|
|
203
184
|
align: "vertical",
|
|
204
185
|
alignBox: "row",
|
|
@@ -210,16 +191,17 @@ class SearchUI extends Component {
|
|
|
210
191
|
name: "ZD-down",
|
|
211
192
|
size: "7",
|
|
212
193
|
iconClass: style.iconArrow
|
|
213
|
-
}))
|
|
194
|
+
})), isSearchIconNeed && /*#__PURE__*/React.createElement(Box, {
|
|
195
|
+
className: style.searchIconBox
|
|
196
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
214
197
|
name: "ZD-search",
|
|
215
|
-
size: "11"
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
className: style.separator
|
|
219
|
-
}) : null, /*#__PURE__*/React.createElement(Box, {
|
|
220
|
-
flexible: true,
|
|
221
|
-
onClick: cancelBubblingEffect
|
|
198
|
+
size: "11"
|
|
199
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
200
|
+
flexible: true
|
|
222
201
|
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
202
|
+
customClass: {
|
|
203
|
+
customTextBox: `${isBoxed ? style.inputBox : ''}`
|
|
204
|
+
},
|
|
223
205
|
customProps: {
|
|
224
206
|
TextBoxProps: {
|
|
225
207
|
'data-a11y-autofocus': true
|
|
@@ -228,6 +210,7 @@ class SearchUI extends Component {
|
|
|
228
210
|
placeHolder: placeHolder,
|
|
229
211
|
value: searchStr,
|
|
230
212
|
onChange: this.handleChange,
|
|
213
|
+
onClick: cancelBubblingEffect,
|
|
231
214
|
onFocus: onFocus,
|
|
232
215
|
onBlur: onBlur,
|
|
233
216
|
onKeyDown: this.handleKeyDown,
|
|
@@ -236,8 +219,7 @@ class SearchUI extends Component {
|
|
|
236
219
|
size: "small",
|
|
237
220
|
inputRef: getRef,
|
|
238
221
|
onClear: this.handleClear,
|
|
239
|
-
onClearMouseDown: cancelBubblingEffect
|
|
240
|
-
needBorder: false
|
|
222
|
+
onClearMouseDown: cancelBubblingEffect
|
|
241
223
|
})));
|
|
242
224
|
}
|
|
243
225
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import Search from "../Search";
|
|
4
|
-
afterEach(cleanup);
|
|
5
4
|
describe('Search', () => {
|
|
6
5
|
test('rendering the defult props', () => {
|
|
7
6
|
const {
|
|
@@ -9,69 +8,4 @@ describe('Search', () => {
|
|
|
9
8
|
} = render( /*#__PURE__*/React.createElement(Search, null));
|
|
10
9
|
expect(asFragment()).toMatchSnapshot();
|
|
11
10
|
});
|
|
12
|
-
test('rendering the search active', () => {
|
|
13
|
-
const {
|
|
14
|
-
asFragment,
|
|
15
|
-
getByRole
|
|
16
|
-
} = render( /*#__PURE__*/React.createElement(Search, null));
|
|
17
|
-
fireEvent.focus(getByRole('textbox'));
|
|
18
|
-
expect(asFragment()).toMatchSnapshot();
|
|
19
|
-
});
|
|
20
|
-
test('rendering the prop hasSeparator is true', () => {
|
|
21
|
-
const {
|
|
22
|
-
asFragment
|
|
23
|
-
} = render( /*#__PURE__*/React.createElement(Search, {
|
|
24
|
-
hasSeparator: true
|
|
25
|
-
}));
|
|
26
|
-
expect(asFragment()).toMatchSnapshot();
|
|
27
|
-
});
|
|
28
|
-
test('rendering the prop hasSeparator is false', () => {
|
|
29
|
-
const {
|
|
30
|
-
asFragment
|
|
31
|
-
} = render( /*#__PURE__*/React.createElement(Search, {
|
|
32
|
-
hasSeparator: false
|
|
33
|
-
}));
|
|
34
|
-
expect(asFragment()).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
test('rendering the renderChildren props via function', () => {
|
|
37
|
-
const options = [{
|
|
38
|
-
value: 'All Fields',
|
|
39
|
-
id: '1'
|
|
40
|
-
}, {
|
|
41
|
-
value: 'Account',
|
|
42
|
-
id: '3'
|
|
43
|
-
}, {
|
|
44
|
-
value: 'Customer Place',
|
|
45
|
-
id: '4'
|
|
46
|
-
}, {
|
|
47
|
-
value: 'Conatct ID',
|
|
48
|
-
id: '5'
|
|
49
|
-
}];
|
|
50
|
-
|
|
51
|
-
function renderChildren(_ref) {
|
|
52
|
-
let {
|
|
53
|
-
value
|
|
54
|
-
} = _ref;
|
|
55
|
-
return /*#__PURE__*/React.createElement("div", null, value);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const {
|
|
59
|
-
asFragment
|
|
60
|
-
} = render( /*#__PURE__*/React.createElement(Search, {
|
|
61
|
-
value: "All Fields",
|
|
62
|
-
renderChildren: renderChildren,
|
|
63
|
-
options: options
|
|
64
|
-
}));
|
|
65
|
-
expect(asFragment()).toMatchSnapshot();
|
|
66
|
-
});
|
|
67
|
-
test('rendering the customized style search', () => {
|
|
68
|
-
const {
|
|
69
|
-
asFragment
|
|
70
|
-
} = render( /*#__PURE__*/React.createElement(Search, {
|
|
71
|
-
customStyle: {
|
|
72
|
-
wrapper: "searchWrapperClass"
|
|
73
|
-
}
|
|
74
|
-
}));
|
|
75
|
-
expect(asFragment()).toMatchSnapshot();
|
|
76
|
-
});
|
|
77
11
|
});
|