@zohodesk/components 1.6.26 → 1.6.28
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/CHANGELOG.md +12 -0
- package/es/DateTime/DateWidget.js +1 -1
- package/es/DateTime/DateWidget.module.css +3 -0
- package/es/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/es/DividerLine/DividerLine.js +40 -0
- package/es/DividerLine/__tests__/DividerLine.spec.js +81 -0
- package/es/DividerLine/__tests__/__snapshots__/DividerLine.spec.js.snap +131 -0
- package/es/DividerLine/constants/index.js +29 -0
- package/es/DividerLine/css/DividerLine.module.css +52 -0
- package/es/DividerLine/css/cssJSLogic.js +1 -0
- package/es/DividerLine/css/dividerLine.cva.js +42 -0
- package/es/DividerLine/props/defaultProps.js +11 -0
- package/es/DividerLine/props/propTypes.js +19 -0
- package/es/DropDown/DropDownSeparator.js +9 -4
- package/es/DropDown/DropDownSeparator.module.css +0 -4
- package/es/DropDown/__tests__/DropDownSeparator.spec.js +8 -0
- package/es/DropDown/__tests__/__snapshots__/DropDownSeparator.spec.js.snap +12 -2
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +1 -0
- package/es/MultiSelect/AdvancedMultiSelect.js +1 -0
- package/es/MultiSelect/SelectedOptions.js +3 -3
- package/es/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +42 -0
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +10 -0
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +10 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +121 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +97 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +157 -0
- package/es/Select/SelectWithAvatar.js +14 -3
- package/es/Select/SelectWithIcon.js +23 -1
- package/es/Select/__tests__/SelectWithAvatar.spec.js +17 -0
- package/es/Select/__tests__/SelectWithIcon.spec.js +18 -0
- package/es/Select/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +47 -0
- package/es/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +19 -0
- package/es/Select/props/propTypes.js +1 -0
- package/es/Tooltip/Tooltip.js +4 -1
- package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +51 -51
- package/lib/DateTime/DateWidget.js +1 -1
- package/lib/DateTime/DateWidget.module.css +3 -0
- package/lib/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/lib/DividerLine/DividerLine.js +50 -0
- package/lib/DividerLine/__tests__/DividerLine.spec.js +88 -0
- package/lib/DividerLine/__tests__/__snapshots__/DividerLine.spec.js.snap +131 -0
- package/lib/DividerLine/constants/index.js +39 -0
- package/lib/DividerLine/css/DividerLine.module.css +52 -0
- package/lib/DividerLine/css/cssJSLogic.js +13 -0
- package/lib/DividerLine/css/dividerLine.cva.js +57 -0
- package/lib/DividerLine/props/defaultProps.js +21 -0
- package/lib/DividerLine/props/propTypes.js +31 -0
- package/lib/DropDown/DropDownSeparator.js +9 -4
- package/lib/DropDown/DropDownSeparator.module.css +0 -4
- package/lib/DropDown/__tests__/DropDownSeparator.spec.js +8 -0
- package/lib/DropDown/__tests__/__snapshots__/DropDownSeparator.spec.js.snap +12 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +1 -0
- package/lib/MultiSelect/AdvancedMultiSelect.js +1 -0
- package/lib/MultiSelect/SelectedOptions.js +3 -3
- package/lib/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +42 -0
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +10 -0
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +10 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +121 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +97 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +157 -0
- package/lib/Select/SelectWithAvatar.js +15 -3
- package/lib/Select/SelectWithIcon.js +26 -1
- package/lib/Select/__tests__/SelectWithAvatar.spec.js +20 -0
- package/lib/Select/__tests__/SelectWithIcon.spec.js +21 -0
- package/lib/Select/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +47 -0
- package/lib/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +19 -0
- package/lib/Select/props/propTypes.js +1 -0
- package/lib/Tooltip/Tooltip.js +6 -1
- package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +51 -51
- package/package.json +10 -10
|
@@ -1,5 +1,126 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
+
exports[`AdvancedGroupMultiSelect Should render as disabled 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="wrapper disabled"
|
|
7
|
+
data-id="multiSelect_disabled"
|
|
8
|
+
data-selector-id="advancedGroupMultiSelect"
|
|
9
|
+
data-test-id="multiSelect_disabled"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="d-flex d-h-full d-w-full d-flex-row d-flex-wrap d-items-center container medium hasBorder borderColor_default"
|
|
13
|
+
data-id="containerComponent"
|
|
14
|
+
data-selector-id="container"
|
|
15
|
+
data-test-id="containerComponent"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="d-flex-shrink-0 tag medium"
|
|
19
|
+
data-id="multiSelect_selectedOptions"
|
|
20
|
+
data-selector-id="box"
|
|
21
|
+
data-test-id="multiSelect_selectedOptions"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
aria-labelledby="3"
|
|
25
|
+
class="container effect medium lgRadius danger disabled pointer"
|
|
26
|
+
data-id="tag_Tag"
|
|
27
|
+
data-selector-id="tag"
|
|
28
|
+
data-test-id="tag_Tag"
|
|
29
|
+
data-title="Str_Group1_Str_group11"
|
|
30
|
+
tabindex="-1"
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
aria-hidden="true"
|
|
34
|
+
class="text mediumtext"
|
|
35
|
+
id="3"
|
|
36
|
+
>
|
|
37
|
+
Str_Group1_Str_group11
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
class="d-flex-shrink-0 tag medium"
|
|
43
|
+
data-id="multiSelect_selectedOptions"
|
|
44
|
+
data-selector-id="box"
|
|
45
|
+
data-test-id="multiSelect_selectedOptions"
|
|
46
|
+
>
|
|
47
|
+
<div
|
|
48
|
+
aria-labelledby="4"
|
|
49
|
+
class="container effect medium lgRadius danger disabled pointer"
|
|
50
|
+
data-id="tag_Tag"
|
|
51
|
+
data-selector-id="tag"
|
|
52
|
+
data-test-id="tag_Tag"
|
|
53
|
+
data-title="Str_Group2_Str_group22"
|
|
54
|
+
tabindex="-1"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
class="text mediumtext"
|
|
59
|
+
id="4"
|
|
60
|
+
>
|
|
61
|
+
Str_Group2_Str_group22
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div
|
|
66
|
+
class="d-min-h-0 d-flex-grow d-basis-auto d-min-w-0 d-flex-shrink wrapper"
|
|
67
|
+
data-id="boxComponent"
|
|
68
|
+
data-selector-id="box"
|
|
69
|
+
data-test-id="boxComponent"
|
|
70
|
+
>
|
|
71
|
+
<span
|
|
72
|
+
class="custmSpan custmSpanMedium"
|
|
73
|
+
/>
|
|
74
|
+
<div
|
|
75
|
+
class="d-flex d-flex-row varClass customContainer disabled container custmInputWrapper"
|
|
76
|
+
data-selector-id="textBoxIcon"
|
|
77
|
+
data-title=""
|
|
78
|
+
>
|
|
79
|
+
<div
|
|
80
|
+
class="d-min-h-0 d-min-w-0 d-flex-grow d-basis-0 d-flex-shrink-0"
|
|
81
|
+
data-id="boxComponent"
|
|
82
|
+
data-selector-id="box"
|
|
83
|
+
data-test-id="boxComponent"
|
|
84
|
+
>
|
|
85
|
+
<input
|
|
86
|
+
aria-controls="1"
|
|
87
|
+
aria-describedby="2"
|
|
88
|
+
aria-expanded="false"
|
|
89
|
+
aria-haspopup="true"
|
|
90
|
+
aria-owns="1"
|
|
91
|
+
autocomplete="off"
|
|
92
|
+
class="container medium default effect borderColor_default"
|
|
93
|
+
data-id="multiSelect_textBox"
|
|
94
|
+
data-selector-id="textBoxIcon"
|
|
95
|
+
data-test-id="multiSelect_textBox"
|
|
96
|
+
disabled=""
|
|
97
|
+
maxlength="250"
|
|
98
|
+
placeholder=""
|
|
99
|
+
role="combobox"
|
|
100
|
+
type="text"
|
|
101
|
+
value=""
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
<div
|
|
105
|
+
class="d-flex-shrink-0 iconContainer"
|
|
106
|
+
data-id="boxComponent"
|
|
107
|
+
data-selector-id="box"
|
|
108
|
+
data-test-id="boxComponent"
|
|
109
|
+
>
|
|
110
|
+
<div
|
|
111
|
+
class="d-flex d-h-full d-w-full d-flex-row"
|
|
112
|
+
data-id="containerComponent"
|
|
113
|
+
data-selector-id="container"
|
|
114
|
+
data-test-id="containerComponent"
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</DocumentFragment>
|
|
122
|
+
`;
|
|
123
|
+
|
|
3
124
|
exports[`AdvancedGroupMultiSelect rendering the defult props 1`] = `
|
|
4
125
|
<DocumentFragment>
|
|
5
126
|
<div
|
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
+
exports[`AdvancedMultiSelect Should render as disabled 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="wrapper disabled"
|
|
7
|
+
data-id="multiSelectComp"
|
|
8
|
+
data-selector-id="advancedMultiSelect"
|
|
9
|
+
data-test-id="multiSelectComp"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="d-flex d-h-full d-w-full d-flex-row d-flex-wrap d-items-center container medium hasBorder borderColor_transparent"
|
|
13
|
+
data-id="containerComponent"
|
|
14
|
+
data-selector-id="container"
|
|
15
|
+
data-test-id="containerComponent"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="d-flex-shrink-0 tag medium"
|
|
19
|
+
data-id="multiSelectComp_selectedOptions"
|
|
20
|
+
data-selector-id="box"
|
|
21
|
+
data-test-id="multiSelectComp_selectedOptions"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
aria-labelledby="3"
|
|
25
|
+
class="container effect medium lgRadius danger disabled pointer"
|
|
26
|
+
data-id="tag_Tag"
|
|
27
|
+
data-selector-id="tag"
|
|
28
|
+
data-test-id="tag_Tag"
|
|
29
|
+
data-title="Apple"
|
|
30
|
+
tabindex="-1"
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
aria-hidden="true"
|
|
34
|
+
class="text mediumtext"
|
|
35
|
+
id="3"
|
|
36
|
+
>
|
|
37
|
+
Apple
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
class="d-min-h-0 d-flex-grow d-basis-auto d-min-w-0 d-flex-shrink wrapper"
|
|
43
|
+
data-id="multiSelectComp_textBox"
|
|
44
|
+
data-selector-id="box"
|
|
45
|
+
data-test-id="multiSelectComp_textBox"
|
|
46
|
+
>
|
|
47
|
+
<span
|
|
48
|
+
class="custmSpan custmSpanMedium"
|
|
49
|
+
/>
|
|
50
|
+
<div
|
|
51
|
+
class="d-flex d-flex-row varClass customContainer disabled container custmInputWrapper"
|
|
52
|
+
data-selector-id="textBoxIcon"
|
|
53
|
+
data-title=""
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
class="d-min-h-0 d-min-w-0 d-flex-grow d-basis-0 d-flex-shrink-0"
|
|
57
|
+
data-id="boxComponent"
|
|
58
|
+
data-selector-id="box"
|
|
59
|
+
data-test-id="boxComponent"
|
|
60
|
+
>
|
|
61
|
+
<input
|
|
62
|
+
aria-controls="1"
|
|
63
|
+
aria-describedby="2"
|
|
64
|
+
aria-expanded="false"
|
|
65
|
+
aria-haspopup="true"
|
|
66
|
+
aria-owns="1"
|
|
67
|
+
autocomplete="off"
|
|
68
|
+
class="container medium default effect borderColor_default"
|
|
69
|
+
data-id="textBoxIcon"
|
|
70
|
+
data-selector-id="textBoxIcon"
|
|
71
|
+
data-test-id="textBoxIcon"
|
|
72
|
+
disabled=""
|
|
73
|
+
maxlength="250"
|
|
74
|
+
placeholder=""
|
|
75
|
+
role="combobox"
|
|
76
|
+
type="text"
|
|
77
|
+
value=""
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
<div
|
|
81
|
+
class="d-flex-shrink-0 iconContainer"
|
|
82
|
+
data-id="boxComponent"
|
|
83
|
+
data-selector-id="box"
|
|
84
|
+
data-test-id="boxComponent"
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
class="d-flex d-h-full d-w-full d-flex-row"
|
|
88
|
+
data-id="containerComponent"
|
|
89
|
+
data-selector-id="container"
|
|
90
|
+
data-test-id="containerComponent"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</DocumentFragment>
|
|
98
|
+
`;
|
|
99
|
+
|
|
3
100
|
exports[`AdvancedMultiSelect rendering the defult props 1`] = `
|
|
4
101
|
<DocumentFragment>
|
|
5
102
|
<div
|
|
@@ -1,5 +1,162 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
+
exports[`MultiSelect Should render as disabled 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="wrapper disabled"
|
|
7
|
+
data-id="multiSelect_disabled"
|
|
8
|
+
data-selector-id="multiSelect"
|
|
9
|
+
data-test-id="multiSelect_disabled"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="d-flex d-h-full d-w-full d-flex-row d-flex-wrap d-items-center container medium borderColor_default hasBorder"
|
|
13
|
+
data-id="containerComponent"
|
|
14
|
+
data-selector-id="container"
|
|
15
|
+
data-test-id="containerComponent"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="d-flex-shrink-0 tag medium"
|
|
19
|
+
data-id="multiSelect_selectedOptions"
|
|
20
|
+
data-selector-id="box"
|
|
21
|
+
data-test-id="multiSelect_selectedOptions"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
aria-labelledby="3"
|
|
25
|
+
class="container effect medium lgRadius danger disabled pointer"
|
|
26
|
+
data-id="tag_Tag"
|
|
27
|
+
data-selector-id="tag"
|
|
28
|
+
data-test-id="tag_Tag"
|
|
29
|
+
data-title="text1"
|
|
30
|
+
tabindex="-1"
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
aria-hidden="true"
|
|
34
|
+
class="text mediumtext"
|
|
35
|
+
id="3"
|
|
36
|
+
>
|
|
37
|
+
text1
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
class="d-flex-shrink-0 tag medium"
|
|
43
|
+
data-id="multiSelect_selectedOptions"
|
|
44
|
+
data-selector-id="box"
|
|
45
|
+
data-test-id="multiSelect_selectedOptions"
|
|
46
|
+
>
|
|
47
|
+
<div
|
|
48
|
+
aria-labelledby="4"
|
|
49
|
+
class="container effect medium lgRadius danger disabled pointer"
|
|
50
|
+
data-id="tag_Tag"
|
|
51
|
+
data-selector-id="tag"
|
|
52
|
+
data-test-id="tag_Tag"
|
|
53
|
+
data-title="text2"
|
|
54
|
+
tabindex="-1"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
class="text mediumtext"
|
|
59
|
+
id="4"
|
|
60
|
+
>
|
|
61
|
+
text2
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div
|
|
66
|
+
class="d-flex-shrink-0 tag medium"
|
|
67
|
+
data-id="multiSelect_selectedOptions"
|
|
68
|
+
data-selector-id="box"
|
|
69
|
+
data-test-id="multiSelect_selectedOptions"
|
|
70
|
+
>
|
|
71
|
+
<div
|
|
72
|
+
aria-labelledby="5"
|
|
73
|
+
class="container effect medium lgRadius danger disabled pointer"
|
|
74
|
+
data-id="tag_Tag"
|
|
75
|
+
data-selector-id="tag"
|
|
76
|
+
data-test-id="tag_Tag"
|
|
77
|
+
data-title="text3"
|
|
78
|
+
tabindex="-1"
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
aria-hidden="true"
|
|
82
|
+
class="text mediumtext"
|
|
83
|
+
id="5"
|
|
84
|
+
>
|
|
85
|
+
text3
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<div
|
|
90
|
+
class="d-min-h-0 d-flex-grow d-basis-auto d-min-w-0 d-flex-shrink wrapper"
|
|
91
|
+
data-id="boxComponent"
|
|
92
|
+
data-selector-id="box"
|
|
93
|
+
data-test-id="boxComponent"
|
|
94
|
+
>
|
|
95
|
+
<span
|
|
96
|
+
class="custmSpan custmSpanMedium"
|
|
97
|
+
/>
|
|
98
|
+
<div
|
|
99
|
+
class="d-flex d-flex-row varClass customContainer disabled container custmInputWrapper"
|
|
100
|
+
data-selector-id="textBoxIcon"
|
|
101
|
+
data-title=""
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
class="d-min-h-0 d-min-w-0 d-flex-grow d-basis-0 d-flex-shrink-0"
|
|
105
|
+
data-id="boxComponent"
|
|
106
|
+
data-selector-id="box"
|
|
107
|
+
data-test-id="boxComponent"
|
|
108
|
+
>
|
|
109
|
+
<input
|
|
110
|
+
aria-expanded="false"
|
|
111
|
+
aria-haspopup="true"
|
|
112
|
+
aria-required="true"
|
|
113
|
+
autocomplete="off"
|
|
114
|
+
class="container medium default effect borderColor_default"
|
|
115
|
+
data-id="multiSelect_textBox"
|
|
116
|
+
data-selector-id="textBoxIcon"
|
|
117
|
+
data-test-id="multiSelect_textBox"
|
|
118
|
+
disabled=""
|
|
119
|
+
maxlength="250"
|
|
120
|
+
placeholder=""
|
|
121
|
+
role="combobox"
|
|
122
|
+
type="text"
|
|
123
|
+
value=""
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
<div
|
|
127
|
+
class="d-flex-shrink-0 iconContainer"
|
|
128
|
+
data-id="boxComponent"
|
|
129
|
+
data-selector-id="box"
|
|
130
|
+
data-test-id="boxComponent"
|
|
131
|
+
>
|
|
132
|
+
<div
|
|
133
|
+
class="d-flex d-h-full d-w-full d-flex-row"
|
|
134
|
+
data-id="containerComponent"
|
|
135
|
+
data-selector-id="container"
|
|
136
|
+
data-test-id="containerComponent"
|
|
137
|
+
>
|
|
138
|
+
<div
|
|
139
|
+
class="d-flex-shrink-0 icon"
|
|
140
|
+
data-id="boxComponent"
|
|
141
|
+
data-selector-id="box"
|
|
142
|
+
data-test-id="boxComponent"
|
|
143
|
+
>
|
|
144
|
+
<div
|
|
145
|
+
class="d-inline-flex d-flex-row d-items-center rightPlaceholder"
|
|
146
|
+
data-id="containerComponent"
|
|
147
|
+
data-selector-id="container"
|
|
148
|
+
data-test-id="containerComponent"
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</DocumentFragment>
|
|
158
|
+
`;
|
|
159
|
+
|
|
3
160
|
exports[`MultiSelect Should render with renderCustomSelectedValue 1`] = `
|
|
4
161
|
<DocumentFragment>
|
|
5
162
|
<div
|
|
@@ -20,6 +20,7 @@ import { getUniqueId } from "../Provider/IdProvider";
|
|
|
20
20
|
import ResponsiveDropBox from "../ResponsiveDropBox/ResponsiveDropBox";
|
|
21
21
|
import { ResponsiveReceiver } from "../Responsive/CustomResponsive";
|
|
22
22
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
23
|
+
import { isRenderable, renderNode } from '@zohodesk/utils';
|
|
23
24
|
/**** CSS ****/
|
|
24
25
|
|
|
25
26
|
import { cn } from "@dot-system/css-utility";
|
|
@@ -175,7 +176,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
175
176
|
dataSelectorId,
|
|
176
177
|
getTargetRef,
|
|
177
178
|
customProps,
|
|
178
|
-
customClass
|
|
179
|
+
customClass,
|
|
180
|
+
renderCustomSelectedValue
|
|
179
181
|
} = this.props;
|
|
180
182
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
181
183
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
@@ -219,7 +221,16 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
219
221
|
className: `${style.container} ${style[size]} ${style[`borderColor_${borderColor}`]} ${isActive && needBorder ? style.active : ''} ${needBorder ? style.hasBorder : ''} ${textBoxClass ? textBoxClass : ''}`,
|
|
220
222
|
eleRef: getTargetRef,
|
|
221
223
|
onClick: !isDisabled && this.togglePopup
|
|
222
|
-
}, selectedId ? /*#__PURE__*/React.createElement(
|
|
224
|
+
}, selectedId ? /*#__PURE__*/React.createElement(React.Fragment, null, isRenderable(renderCustomSelectedValue) ? renderNode(renderCustomSelectedValue, {
|
|
225
|
+
avatarPalette,
|
|
226
|
+
id,
|
|
227
|
+
imageURL: photoURL,
|
|
228
|
+
onRemove,
|
|
229
|
+
text,
|
|
230
|
+
dataId: `${dataId}_SelectTag`,
|
|
231
|
+
isReadOnly,
|
|
232
|
+
isDisabled
|
|
233
|
+
}) : /*#__PURE__*/React.createElement(Box, {
|
|
223
234
|
className: style.tag,
|
|
224
235
|
"data-id": `${dataId}_SelectTag`,
|
|
225
236
|
"data-test-id": `${dataId}_SelectTag`,
|
|
@@ -234,7 +245,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
234
245
|
text: text,
|
|
235
246
|
disabled: isReadOnly || isDisabled,
|
|
236
247
|
size: tagSize
|
|
237
|
-
})) : null, /*#__PURE__*/React.createElement(Box, {
|
|
248
|
+
}))) : null, /*#__PURE__*/React.createElement(Box, {
|
|
238
249
|
flexible: true,
|
|
239
250
|
className: style.textBox,
|
|
240
251
|
dataId: `${dataId}_textBox`
|
|
@@ -20,6 +20,7 @@ import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
|
20
20
|
|
|
21
21
|
import { scrollTo, findScrollEnd, getSearchString } from "../utils/Common.js";
|
|
22
22
|
import { isObjectContainsSearchString } from "../utils/dropDownUtils.js";
|
|
23
|
+
import { isRenderable, renderNode } from '@zohodesk/utils';
|
|
23
24
|
/**** CSS ****/
|
|
24
25
|
|
|
25
26
|
import { cn } from "@dot-system/css-utility";
|
|
@@ -351,6 +352,7 @@ class SelectWithIcon extends Component {
|
|
|
351
352
|
dropBoxSize,
|
|
352
353
|
emptyMessage,
|
|
353
354
|
renderCustomEmptyState,
|
|
355
|
+
renderCustomSelectedValue,
|
|
354
356
|
needIcon,
|
|
355
357
|
iconName,
|
|
356
358
|
iconSize,
|
|
@@ -396,7 +398,27 @@ class SelectWithIcon extends Component {
|
|
|
396
398
|
ref: getTargetRef,
|
|
397
399
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
398
400
|
"data-test-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`
|
|
399
|
-
},
|
|
401
|
+
}, isRenderable(renderCustomSelectedValue) ? renderNode(renderCustomSelectedValue, {
|
|
402
|
+
iconName,
|
|
403
|
+
iconSize,
|
|
404
|
+
iconClass,
|
|
405
|
+
needIcon,
|
|
406
|
+
isDisabled,
|
|
407
|
+
isReadOnly,
|
|
408
|
+
isPopupOpen,
|
|
409
|
+
isActive: isPopupReady,
|
|
410
|
+
size,
|
|
411
|
+
option: this.props.options.find(option => option[idKey] === selectedId) || DUMMY_OBJECT,
|
|
412
|
+
selectedId,
|
|
413
|
+
selectedValue,
|
|
414
|
+
placeHolder,
|
|
415
|
+
htmlId,
|
|
416
|
+
maxLength,
|
|
417
|
+
dataId,
|
|
418
|
+
getRef: this.inputRef,
|
|
419
|
+
onKeyDown: this.handleKeyDown,
|
|
420
|
+
ariaControlsId: setAriaId
|
|
421
|
+
}) : /*#__PURE__*/React.createElement(Container, {
|
|
400
422
|
alignBox: "row"
|
|
401
423
|
}, needIcon ? /*#__PURE__*/React.createElement(Container, {
|
|
402
424
|
align: "both",
|
|
@@ -9,4 +9,21 @@ describe('SelectWithAvatar', () => {
|
|
|
9
9
|
} = render( /*#__PURE__*/React.createElement(SelectWithAvatar, null));
|
|
10
10
|
expect(asFragment()).toMatchSnapshot();
|
|
11
11
|
});
|
|
12
|
+
test('Should render with renderCustomSelectedValue', () => {
|
|
13
|
+
const options = [{
|
|
14
|
+
id: '1',
|
|
15
|
+
text: 'Option 1'
|
|
16
|
+
}, {
|
|
17
|
+
id: '2',
|
|
18
|
+
text: 'Option 2'
|
|
19
|
+
}];
|
|
20
|
+
const {
|
|
21
|
+
asFragment
|
|
22
|
+
} = render( /*#__PURE__*/React.createElement(SelectWithAvatar, {
|
|
23
|
+
options: options,
|
|
24
|
+
selectedValue: "1",
|
|
25
|
+
renderCustomSelectedValue: tagProps => /*#__PURE__*/React.createElement("div", null, tagProps.text, " - Custom Tag")
|
|
26
|
+
}));
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
12
29
|
});
|
|
@@ -11,4 +11,22 @@ describe('SelectWithIcon', () => {
|
|
|
11
11
|
}));
|
|
12
12
|
expect(asFragment()).toMatchSnapshot();
|
|
13
13
|
});
|
|
14
|
+
test('Should render with renderCustomSelectedValue', () => {
|
|
15
|
+
const options = [{
|
|
16
|
+
id: '1',
|
|
17
|
+
value: 'Option 1'
|
|
18
|
+
}, {
|
|
19
|
+
id: '2',
|
|
20
|
+
value: 'Option 2'
|
|
21
|
+
}];
|
|
22
|
+
const {
|
|
23
|
+
asFragment
|
|
24
|
+
} = render( /*#__PURE__*/React.createElement(SelectWithIcon, {
|
|
25
|
+
options: options,
|
|
26
|
+
selectedId: "1",
|
|
27
|
+
selectedValue: "Option 1",
|
|
28
|
+
renderCustomSelectedValue: valueProps => /*#__PURE__*/React.createElement("div", null, valueProps.selectedValue, " - Custom Value")
|
|
29
|
+
}));
|
|
30
|
+
expect(asFragment()).toMatchSnapshot();
|
|
31
|
+
});
|
|
14
32
|
});
|
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
+
exports[`SelectWithAvatar Should render with renderCustomSelectedValue 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="wrapper effect"
|
|
7
|
+
data-id="selectWithAvatar"
|
|
8
|
+
data-selector-id="selectWithAvatar"
|
|
9
|
+
data-test-id="selectWithAvatar"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="d-flex d-h-full d-w-full d-flex-row d-items-center container medium borderColor_default hasBorder"
|
|
13
|
+
data-id="containerComponent"
|
|
14
|
+
data-selector-id="container"
|
|
15
|
+
data-test-id="containerComponent"
|
|
16
|
+
>
|
|
17
|
+
<div>
|
|
18
|
+
Option 1 - Custom Tag
|
|
19
|
+
</div>
|
|
20
|
+
<div
|
|
21
|
+
class="d-min-h-0 d-min-w-0 d-flex-grow d-basis-0 d-flex-shrink-0"
|
|
22
|
+
data-id="selectWithAvatar_textBox"
|
|
23
|
+
data-selector-id="box"
|
|
24
|
+
data-test-id="selectWithAvatar_textBox"
|
|
25
|
+
>
|
|
26
|
+
<input
|
|
27
|
+
aria-activedescendant="1"
|
|
28
|
+
aria-controls="1"
|
|
29
|
+
aria-expanded="false"
|
|
30
|
+
aria-haspopup="true"
|
|
31
|
+
aria-owns="1"
|
|
32
|
+
aria-readonly="true"
|
|
33
|
+
autocomplete="off"
|
|
34
|
+
class="pointer container medium default effect borderColor_default"
|
|
35
|
+
data-id="textBox"
|
|
36
|
+
data-selector-id="textBox"
|
|
37
|
+
data-test-id="textBox"
|
|
38
|
+
placeholder=""
|
|
39
|
+
readonly=""
|
|
40
|
+
role="combobox"
|
|
41
|
+
type="text"
|
|
42
|
+
value=""
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</DocumentFragment>
|
|
48
|
+
`;
|
|
49
|
+
|
|
3
50
|
exports[`SelectWithAvatar rendering the defult props 1`] = `
|
|
4
51
|
<DocumentFragment>
|
|
5
52
|
<div
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
+
exports[`SelectWithIcon Should render with renderCustomSelectedValue 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="container box_medium"
|
|
7
|
+
data-selector-id="selectWithIcon"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class=""
|
|
11
|
+
data-id="selectWithIcon"
|
|
12
|
+
data-test-id="selectWithIcon"
|
|
13
|
+
>
|
|
14
|
+
<div>
|
|
15
|
+
Option 1 - Custom Value
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</DocumentFragment>
|
|
20
|
+
`;
|
|
21
|
+
|
|
3
22
|
exports[`SelectWithIcon rendering the defult props 1`] = `
|
|
4
23
|
<DocumentFragment>
|
|
5
24
|
<div
|
|
@@ -329,6 +329,7 @@ export const SelectWithIcon_propTypes = {
|
|
|
329
329
|
boxSize: PropTypes.string,
|
|
330
330
|
emptyMessage: PropTypes.string,
|
|
331
331
|
renderCustomEmptyState: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
332
|
+
renderCustomSelectedValue: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
332
333
|
isAbsolutePositioningNeeded: PropTypes.bool,
|
|
333
334
|
isRestrictScroll: PropTypes.bool,
|
|
334
335
|
positionsOffset: PropTypes.object,
|
package/es/Tooltip/Tooltip.js
CHANGED
|
@@ -136,7 +136,10 @@ export default class Tooltip extends React.Component {
|
|
|
136
136
|
handleOver(e, targetElement) {
|
|
137
137
|
let containerElement = this.tooltipContainerEl;
|
|
138
138
|
let element = e.target;
|
|
139
|
-
|
|
139
|
+
|
|
140
|
+
let hasTitleValue = el => el.hasAttribute('data-title') && el.getAttribute('data-title') !== '' || el.hasAttribute('title') && el.getAttribute('title') !== '';
|
|
141
|
+
|
|
142
|
+
let titleDiv = hasTitleValue(element) ? element : element.closest('[data-title]:not([data-title=""])') || element.closest('[title]:not([title=""])');
|
|
140
143
|
|
|
141
144
|
if (titleDiv) {
|
|
142
145
|
let title = titleDiv.getAttribute('data-title') || titleDiv.getAttribute('title');
|