@zohodesk/dot 1.0.0-temp-227 → 1.0.0-temp-228
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 +2 -7
- package/es/ActionButton/ActionButton.js +19 -9
- package/es/ActionButton/props/defaultProps.js +2 -1
- package/es/ActionButton/props/propTypes.js +4 -1
- package/es/DotProvider/hooks/useDotProvider.js +3 -3
- package/es/DotProvider/libraryChunks/appearance/variables/Dark_Variables.js +1 -0
- package/es/DotProvider/libraryChunks/appearance/variables/Light_Variables.js +1 -0
- package/es/DotProvider/libraryChunks/appearance/variables/PureDark_Variables.js +1 -0
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_Dark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_Light_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_PureDark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_Dark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_Light_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_PureDark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_Dark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_Light_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_PureDark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_Dark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_Light_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_PureDark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Dark_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Light_Variables.js +2 -0
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_PureDark_Variables.js +2 -0
- package/es/DotProvider/utils/constants.js +2 -1
- package/es/DotProvider/utils/themeAppearanceAssetsConfig.js +15 -1
- package/es/DotProvider/utils/themeColorAssetsConfig.js +73 -1
- package/es/lookup/Lookup/Lookup.js +4 -6
- package/es/lookup/Lookup/__tests__/Lookup.spec.js +4 -101
- package/es/lookup/Lookup/__tests__/__snapshots__/Lookup.spec.js.snap +2 -223
- package/es/lookup/Lookup/props/propTypes.js +1 -6
- package/es/lookup/header/ModuleHeader/ModuleHeader.js +5 -12
- package/es/lookup/header/ModuleHeader/__tests__/ModuleHeader.spec.js +3 -87
- package/es/lookup/header/ModuleHeader/props/defaultProps.js +0 -2
- package/es/lookup/header/ModuleHeader/props/propTypes.js +0 -6
- package/es/version2/lookup/AlertHeader/AlertHeader.js +9 -19
- package/es/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +3 -122
- package/es/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +3 -1728
- package/es/version2/lookup/AlertHeader/css/cssJSLogic.js +1 -6
- package/es/version2/lookup/AlertHeader/props/defaultProps.js +0 -2
- package/es/version2/lookup/AlertHeader/props/propTypes.js +0 -10
- package/lib/ActionButton/ActionButton.js +18 -9
- package/lib/ActionButton/props/defaultProps.js +2 -1
- package/lib/ActionButton/props/propTypes.js +4 -1
- package/lib/DotProvider/hooks/useDotProvider.js +3 -3
- package/lib/DotProvider/libraryChunks/appearance/variables/Dark_Variables.js +3 -0
- package/lib/DotProvider/libraryChunks/appearance/variables/Light_Variables.js +3 -0
- package/lib/DotProvider/libraryChunks/appearance/variables/PureDark_Variables.js +3 -0
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +0 -4
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_Dark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_Light_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_PureDark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_Dark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_Light_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_PureDark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_Dark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_Light_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_PureDark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_Dark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_Light_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_PureDark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Dark_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Light_Variables.js +5 -0
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_PureDark_Variables.js +5 -0
- package/lib/DotProvider/utils/constants.js +4 -2
- package/lib/DotProvider/utils/themeAppearanceAssetsConfig.js +17 -2
- package/lib/DotProvider/utils/themeColorAssetsConfig.js +77 -2
- package/lib/lookup/Lookup/Lookup.js +4 -6
- package/lib/lookup/Lookup/__tests__/Lookup.spec.js +4 -101
- package/lib/lookup/Lookup/__tests__/__snapshots__/Lookup.spec.js.snap +2 -223
- package/lib/lookup/Lookup/props/propTypes.js +1 -8
- package/lib/lookup/header/ModuleHeader/ModuleHeader.js +5 -13
- package/lib/lookup/header/ModuleHeader/__tests__/ModuleHeader.spec.js +2 -86
- package/lib/lookup/header/ModuleHeader/props/defaultProps.js +0 -2
- package/lib/lookup/header/ModuleHeader/props/propTypes.js +0 -6
- package/lib/version2/lookup/AlertHeader/AlertHeader.js +8 -19
- package/lib/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +2 -121
- package/lib/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +3 -1728
- package/lib/version2/lookup/AlertHeader/css/cssJSLogic.js +2 -4
- package/lib/version2/lookup/AlertHeader/props/defaultProps.js +0 -2
- package/lib/version2/lookup/AlertHeader/props/propTypes.js +0 -10
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Lookup
|
|
3
|
+
exports[`Lookup rendering isActive is true 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
6
|
class="container index5 snow"
|
|
@@ -17,225 +17,4 @@ exports[`Lookup snapshot - Render with a11y attributes 1`] = `
|
|
|
17
17
|
</DocumentFragment>
|
|
18
18
|
`;
|
|
19
19
|
|
|
20
|
-
exports[`Lookup
|
|
21
|
-
<DocumentFragment>
|
|
22
|
-
<div
|
|
23
|
-
class="container index5 snow"
|
|
24
|
-
data-drag-parent="true"
|
|
25
|
-
style="z-index: 4;"
|
|
26
|
-
>
|
|
27
|
-
<div
|
|
28
|
-
class="flex cover rowdir hCenter"
|
|
29
|
-
data-id="reactFreezeLayer"
|
|
30
|
-
data-selector-id="container"
|
|
31
|
-
data-test-id="reactFreezeLayer"
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
</DocumentFragment>
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
exports[`Lookup snapshot - Render with children 1`] = `
|
|
38
|
-
<DocumentFragment>
|
|
39
|
-
<div
|
|
40
|
-
class="container index5 snow"
|
|
41
|
-
data-drag-parent="true"
|
|
42
|
-
style="z-index: 4;"
|
|
43
|
-
>
|
|
44
|
-
<div
|
|
45
|
-
class="flex cover rowdir hCenter"
|
|
46
|
-
data-id="reactFreezeLayer"
|
|
47
|
-
data-selector-id="container"
|
|
48
|
-
data-test-id="reactFreezeLayer"
|
|
49
|
-
/>
|
|
50
|
-
</div>
|
|
51
|
-
</DocumentFragment>
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
exports[`Lookup snapshot - Render with custom classes 1`] = `
|
|
55
|
-
<DocumentFragment>
|
|
56
|
-
<div
|
|
57
|
-
class="container lookup-freeze-layer index5 snow"
|
|
58
|
-
data-drag-parent="true"
|
|
59
|
-
style="z-index: 4;"
|
|
60
|
-
>
|
|
61
|
-
<div
|
|
62
|
-
class="flex cover rowdir hCenter"
|
|
63
|
-
data-id="reactFreezeLayer"
|
|
64
|
-
data-selector-id="container"
|
|
65
|
-
data-test-id="reactFreezeLayer"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
</DocumentFragment>
|
|
69
|
-
`;
|
|
70
|
-
|
|
71
|
-
exports[`Lookup snapshot - Render with customProps 1`] = `
|
|
72
|
-
<DocumentFragment>
|
|
73
|
-
<div
|
|
74
|
-
class="container index5 plain"
|
|
75
|
-
data-drag-parent="true"
|
|
76
|
-
style="z-index: 4;"
|
|
77
|
-
>
|
|
78
|
-
<div
|
|
79
|
-
class="flex cover rowdir hCenter"
|
|
80
|
-
data-id="reactFreezeLayer"
|
|
81
|
-
data-selector-id="container"
|
|
82
|
-
data-test-id="reactFreezeLayer"
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
85
|
-
</DocumentFragment>
|
|
86
|
-
`;
|
|
87
|
-
|
|
88
|
-
exports[`Lookup snapshot - Render with dataId 1`] = `
|
|
89
|
-
<DocumentFragment>
|
|
90
|
-
<div
|
|
91
|
-
class="container index5 snow"
|
|
92
|
-
data-drag-parent="true"
|
|
93
|
-
style="z-index: 4;"
|
|
94
|
-
>
|
|
95
|
-
<div
|
|
96
|
-
class="flex cover rowdir hCenter"
|
|
97
|
-
data-id="reactFreezeLayer"
|
|
98
|
-
data-selector-id="container"
|
|
99
|
-
data-test-id="reactFreezeLayer"
|
|
100
|
-
/>
|
|
101
|
-
</div>
|
|
102
|
-
</DocumentFragment>
|
|
103
|
-
`;
|
|
104
|
-
|
|
105
|
-
exports[`Lookup snapshot - Render with default props 1`] = `<DocumentFragment />`;
|
|
106
|
-
|
|
107
|
-
exports[`Lookup snapshot - Render with htmlId 1`] = `
|
|
108
|
-
<DocumentFragment>
|
|
109
|
-
<div
|
|
110
|
-
class="container index5 snow"
|
|
111
|
-
data-drag-parent="true"
|
|
112
|
-
style="z-index: 4;"
|
|
113
|
-
>
|
|
114
|
-
<div
|
|
115
|
-
class="flex cover rowdir hCenter"
|
|
116
|
-
data-id="reactFreezeLayer"
|
|
117
|
-
data-selector-id="container"
|
|
118
|
-
data-test-id="reactFreezeLayer"
|
|
119
|
-
/>
|
|
120
|
-
</div>
|
|
121
|
-
</DocumentFragment>
|
|
122
|
-
`;
|
|
123
|
-
|
|
124
|
-
exports[`Lookup snapshot - Render with isActive=true 1`] = `
|
|
125
|
-
<DocumentFragment>
|
|
126
|
-
<div
|
|
127
|
-
class="container index5 snow"
|
|
128
|
-
data-drag-parent="true"
|
|
129
|
-
style="z-index: 4;"
|
|
130
|
-
>
|
|
131
|
-
<div
|
|
132
|
-
class="flex cover rowdir hCenter"
|
|
133
|
-
data-id="reactFreezeLayer"
|
|
134
|
-
data-selector-id="container"
|
|
135
|
-
data-test-id="reactFreezeLayer"
|
|
136
|
-
/>
|
|
137
|
-
</div>
|
|
138
|
-
</DocumentFragment>
|
|
139
|
-
`;
|
|
140
|
-
|
|
141
|
-
exports[`Lookup snapshot - Render with isMinHeight=true 1`] = `
|
|
142
|
-
<DocumentFragment>
|
|
143
|
-
<div
|
|
144
|
-
class="container index5 snow"
|
|
145
|
-
data-drag-parent="true"
|
|
146
|
-
style="z-index: 4;"
|
|
147
|
-
>
|
|
148
|
-
<div
|
|
149
|
-
class="flex cover rowdir hCenter"
|
|
150
|
-
data-id="reactFreezeLayer"
|
|
151
|
-
data-selector-id="container"
|
|
152
|
-
data-test-id="reactFreezeLayer"
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
</DocumentFragment>
|
|
156
|
-
`;
|
|
157
|
-
|
|
158
|
-
exports[`Lookup snapshot - Render with size=full 1`] = `
|
|
159
|
-
<DocumentFragment>
|
|
160
|
-
<div
|
|
161
|
-
class="container index5 snow"
|
|
162
|
-
data-drag-parent="true"
|
|
163
|
-
style="z-index: 4;"
|
|
164
|
-
>
|
|
165
|
-
<div
|
|
166
|
-
class="flex cover rowdir hCenter"
|
|
167
|
-
data-id="reactFreezeLayer"
|
|
168
|
-
data-selector-id="container"
|
|
169
|
-
data-test-id="reactFreezeLayer"
|
|
170
|
-
/>
|
|
171
|
-
</div>
|
|
172
|
-
</DocumentFragment>
|
|
173
|
-
`;
|
|
174
|
-
|
|
175
|
-
exports[`Lookup snapshot - Render with size=large 1`] = `
|
|
176
|
-
<DocumentFragment>
|
|
177
|
-
<div
|
|
178
|
-
class="container index5 snow"
|
|
179
|
-
data-drag-parent="true"
|
|
180
|
-
style="z-index: 4;"
|
|
181
|
-
>
|
|
182
|
-
<div
|
|
183
|
-
class="flex cover rowdir hCenter"
|
|
184
|
-
data-id="reactFreezeLayer"
|
|
185
|
-
data-selector-id="container"
|
|
186
|
-
data-test-id="reactFreezeLayer"
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
189
|
-
</DocumentFragment>
|
|
190
|
-
`;
|
|
191
|
-
|
|
192
|
-
exports[`Lookup snapshot - Render with size=small 1`] = `
|
|
193
|
-
<DocumentFragment>
|
|
194
|
-
<div
|
|
195
|
-
class="container index5 snow"
|
|
196
|
-
data-drag-parent="true"
|
|
197
|
-
style="z-index: 4;"
|
|
198
|
-
>
|
|
199
|
-
<div
|
|
200
|
-
class="flex cover rowdir hCenter"
|
|
201
|
-
data-id="reactFreezeLayer"
|
|
202
|
-
data-selector-id="container"
|
|
203
|
-
data-test-id="reactFreezeLayer"
|
|
204
|
-
/>
|
|
205
|
-
</div>
|
|
206
|
-
</DocumentFragment>
|
|
207
|
-
`;
|
|
208
|
-
|
|
209
|
-
exports[`Lookup snapshot - Render with size=xlarge 1`] = `
|
|
210
|
-
<DocumentFragment>
|
|
211
|
-
<div
|
|
212
|
-
class="container index5 snow"
|
|
213
|
-
data-drag-parent="true"
|
|
214
|
-
style="z-index: 4;"
|
|
215
|
-
>
|
|
216
|
-
<div
|
|
217
|
-
class="flex cover rowdir hCenter"
|
|
218
|
-
data-id="reactFreezeLayer"
|
|
219
|
-
data-selector-id="container"
|
|
220
|
-
data-test-id="reactFreezeLayer"
|
|
221
|
-
/>
|
|
222
|
-
</div>
|
|
223
|
-
</DocumentFragment>
|
|
224
|
-
`;
|
|
225
|
-
|
|
226
|
-
exports[`Lookup snapshot - Render with size=xmedium 1`] = `
|
|
227
|
-
<DocumentFragment>
|
|
228
|
-
<div
|
|
229
|
-
class="container index5 snow"
|
|
230
|
-
data-drag-parent="true"
|
|
231
|
-
style="z-index: 4;"
|
|
232
|
-
>
|
|
233
|
-
<div
|
|
234
|
-
class="flex cover rowdir hCenter"
|
|
235
|
-
data-id="reactFreezeLayer"
|
|
236
|
-
data-selector-id="container"
|
|
237
|
-
data-test-id="reactFreezeLayer"
|
|
238
|
-
/>
|
|
239
|
-
</div>
|
|
240
|
-
</DocumentFragment>
|
|
241
|
-
`;
|
|
20
|
+
exports[`Lookup rendering the defult props 1`] = `<DocumentFragment />`;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import FocusScopePropTypes from '@zohodesk/a11y/es/FocusScope/props/propTypes';
|
|
3
|
-
import FreezeLayerPropTypes from "../../../FreezeLayer/props/propTypes";
|
|
4
2
|
export const propTypes = {
|
|
5
3
|
children: PropTypes.node,
|
|
6
4
|
customClass: PropTypes.string,
|
|
@@ -17,10 +15,7 @@ export const propTypes = {
|
|
|
17
15
|
onKeyDown: PropTypes.func,
|
|
18
16
|
childAnimationName: PropTypes.oneOf(['expand', 'flyDown']),
|
|
19
17
|
needFocusScope: PropTypes.bool,
|
|
20
|
-
customProps: PropTypes.
|
|
21
|
-
focusScopeProps: PropTypes.shape(FocusScopePropTypes),
|
|
22
|
-
freezeLayerProps: PropTypes.shape(FreezeLayerPropTypes)
|
|
23
|
-
}),
|
|
18
|
+
customProps: PropTypes.object,
|
|
24
19
|
forwardRef: PropTypes.object,
|
|
25
20
|
onClick: PropTypes.func,
|
|
26
21
|
onClose: PropTypes.func,
|
|
@@ -32,38 +32,31 @@ function ModuleHeader(props) {
|
|
|
32
32
|
closeTitle,
|
|
33
33
|
onSearchKeyDown,
|
|
34
34
|
palette,
|
|
35
|
-
isDraggable,
|
|
36
35
|
dragBoundaryLimit,
|
|
37
36
|
children,
|
|
38
|
-
customClass,
|
|
39
37
|
childNearTitle
|
|
40
38
|
} = props;
|
|
41
39
|
const dragRef = useRef(null); //dragRef
|
|
42
40
|
|
|
43
41
|
useDragger({
|
|
44
|
-
isActive:
|
|
42
|
+
isActive: true,
|
|
45
43
|
ChildRef: dragRef,
|
|
46
44
|
boundaryLimit: dragBoundaryLimit
|
|
47
45
|
}); //custom Hook
|
|
48
46
|
|
|
49
|
-
const {
|
|
50
|
-
container: customContainerClass = '',
|
|
51
|
-
title: customTitleClass = '',
|
|
52
|
-
close: customCloseClass = ''
|
|
53
|
-
} = customClass;
|
|
54
47
|
return /*#__PURE__*/React.createElement(Container, {
|
|
55
48
|
align: "vertical",
|
|
56
49
|
alignBox: "row",
|
|
57
|
-
className: `${commonStyle.container} ${commonStyle[`${palette}`]}
|
|
50
|
+
className: `${commonStyle.container} ${commonStyle[`${palette}`]}`,
|
|
58
51
|
isCover: false,
|
|
59
52
|
wrap: "wrap",
|
|
60
53
|
dataId: dataId,
|
|
61
|
-
"data-drag-hook":
|
|
54
|
+
"data-drag-hook": "true",
|
|
62
55
|
eleRef: dragRef
|
|
63
56
|
}, childNearTitle ? childNearTitle : '', /*#__PURE__*/React.createElement(Box, {
|
|
64
57
|
flexible: true
|
|
65
58
|
}, /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className:
|
|
59
|
+
className: commonStyle.title
|
|
67
60
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
68
61
|
text: title
|
|
69
62
|
})), miniDescription && /*#__PURE__*/React.createElement("div", {
|
|
@@ -80,7 +73,7 @@ function ModuleHeader(props) {
|
|
|
80
73
|
getRef: getSearchBoxRef,
|
|
81
74
|
onKeyDown: onSearchKeyDown
|
|
82
75
|
})), children ? children : '', onLookupClose ? /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className:
|
|
76
|
+
className: commonStyle.closeContainer
|
|
84
77
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
85
78
|
dataId: "close",
|
|
86
79
|
onClose: onLookupClose,
|
|
@@ -1,95 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import ModuleHeader from "../ModuleHeader";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
cleanup();
|
|
7
|
-
});
|
|
8
|
-
describe('ModuleHeader snapshot - ', () => {
|
|
9
|
-
test('Render with default props', () => {
|
|
4
|
+
describe('ModuleHeader', () => {
|
|
5
|
+
test('rendering the defult props', () => {
|
|
10
6
|
const {
|
|
11
7
|
asFragment
|
|
12
8
|
} = render( /*#__PURE__*/React.createElement(ModuleHeader, null));
|
|
13
9
|
expect(asFragment()).toMatchSnapshot();
|
|
14
10
|
});
|
|
15
|
-
test.each(PALETTE_VALUES)('Render with palette=%s', palette => {
|
|
16
|
-
const {
|
|
17
|
-
asFragment
|
|
18
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
19
|
-
palette: palette
|
|
20
|
-
}));
|
|
21
|
-
expect(asFragment()).toMatchSnapshot();
|
|
22
|
-
});
|
|
23
|
-
test('Render with needSearch=true', () => {
|
|
24
|
-
const {
|
|
25
|
-
asFragment
|
|
26
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
27
|
-
needSearch: true
|
|
28
|
-
}));
|
|
29
|
-
expect(asFragment()).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
test('Render with isDraggable=false', () => {
|
|
32
|
-
const {
|
|
33
|
-
asFragment
|
|
34
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
35
|
-
isDraggable: false
|
|
36
|
-
}));
|
|
37
|
-
expect(asFragment()).toMatchSnapshot();
|
|
38
|
-
});
|
|
39
|
-
test('Render with onLookupClose', () => {
|
|
40
|
-
const {
|
|
41
|
-
asFragment
|
|
42
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
43
|
-
onLookupClose: jest.fn()
|
|
44
|
-
}));
|
|
45
|
-
expect(asFragment()).toMatchSnapshot();
|
|
46
|
-
});
|
|
47
|
-
test('Render with miniDescription', () => {
|
|
48
|
-
const {
|
|
49
|
-
asFragment
|
|
50
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
51
|
-
miniDescription: "A brief description"
|
|
52
|
-
}));
|
|
53
|
-
expect(asFragment()).toMatchSnapshot();
|
|
54
|
-
});
|
|
55
|
-
test('Render with customClass', () => {
|
|
56
|
-
const {
|
|
57
|
-
asFragment
|
|
58
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
59
|
-
onLookupClose: jest.fn(),
|
|
60
|
-
title: "Header Title",
|
|
61
|
-
customClass: {
|
|
62
|
-
container: 'custom-container',
|
|
63
|
-
title: 'custom-title',
|
|
64
|
-
close: 'custom-close'
|
|
65
|
-
}
|
|
66
|
-
}));
|
|
67
|
-
expect(asFragment()).toMatchSnapshot();
|
|
68
|
-
});
|
|
69
|
-
test('Render with children', () => {
|
|
70
|
-
const {
|
|
71
|
-
asFragment
|
|
72
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
73
|
-
title: "Header Title"
|
|
74
|
-
}, /*#__PURE__*/React.createElement("div", null, "Child content")));
|
|
75
|
-
expect(asFragment()).toMatchSnapshot();
|
|
76
|
-
});
|
|
77
|
-
test('Render with childNearTitle', () => {
|
|
78
|
-
const {
|
|
79
|
-
asFragment
|
|
80
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
81
|
-
title: "Header Title",
|
|
82
|
-
childNearTitle: /*#__PURE__*/React.createElement("span", null, "Near title")
|
|
83
|
-
}));
|
|
84
|
-
expect(asFragment()).toMatchSnapshot();
|
|
85
|
-
});
|
|
86
|
-
test('Render with dataId', () => {
|
|
87
|
-
const {
|
|
88
|
-
asFragment
|
|
89
|
-
} = render( /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
90
|
-
title: "Header Title",
|
|
91
|
-
dataId: "module-header-dataId"
|
|
92
|
-
}));
|
|
93
|
-
expect(asFragment()).toMatchSnapshot();
|
|
94
|
-
});
|
|
95
11
|
});
|
|
@@ -16,11 +16,5 @@ export const propTypes = {
|
|
|
16
16
|
palette: PropTypes.oneOf(['default', 'white']),
|
|
17
17
|
children: PropTypes.any,
|
|
18
18
|
childNearTitle: PropTypes.any,
|
|
19
|
-
customClass: PropTypes.shape({
|
|
20
|
-
container: PropTypes.string,
|
|
21
|
-
title: PropTypes.string,
|
|
22
|
-
close: PropTypes.string
|
|
23
|
-
}),
|
|
24
|
-
isDraggable: PropTypes.bool,
|
|
25
19
|
dragBoundaryLimit: PropTypes.object
|
|
26
20
|
};
|
|
@@ -6,7 +6,7 @@ import AlertIcons from "../../alertIcons/AlertIcons"; //CSS
|
|
|
6
6
|
|
|
7
7
|
import style from "./css/AlertHeaderNew.module.css";
|
|
8
8
|
import cssJSLogic from "./css/cssJSLogic";
|
|
9
|
-
import { mergeStyle
|
|
9
|
+
import { mergeStyle } from '@zohodesk/utils'; //customHooks
|
|
10
10
|
|
|
11
11
|
import useDragger from "../../../Hooks/Dragger/useDragger"; //Props
|
|
12
12
|
|
|
@@ -23,20 +23,10 @@ export default function AlertHeader(props) {
|
|
|
23
23
|
dataId,
|
|
24
24
|
type,
|
|
25
25
|
htmlId,
|
|
26
|
-
isDraggable,
|
|
27
|
-
customClass,
|
|
28
|
-
renderCustomIcon,
|
|
29
|
-
renderSecondaryContent,
|
|
30
|
-
renderRightActions,
|
|
31
26
|
customStyle,
|
|
32
27
|
dragBoundaryLimit
|
|
33
28
|
} = props;
|
|
34
29
|
const finalStyle = mergeStyle(style, customStyle);
|
|
35
|
-
const {
|
|
36
|
-
title: titleClass = '',
|
|
37
|
-
iconContainer: iconContainerClass = '',
|
|
38
|
-
close: closeClass = ''
|
|
39
|
-
} = customClass;
|
|
40
30
|
const {
|
|
41
31
|
alertHeaderContainerClass
|
|
42
32
|
} = cssJSLogic({
|
|
@@ -46,7 +36,7 @@ export default function AlertHeader(props) {
|
|
|
46
36
|
const dragRef = useRef(null); //dragRef
|
|
47
37
|
|
|
48
38
|
useDragger({
|
|
49
|
-
isActive:
|
|
39
|
+
isActive: true,
|
|
50
40
|
ChildRef: dragRef,
|
|
51
41
|
boundaryLimit: dragBoundaryLimit
|
|
52
42
|
}); //custom Hook
|
|
@@ -57,26 +47,26 @@ export default function AlertHeader(props) {
|
|
|
57
47
|
className: `${alertHeaderContainerClass}`,
|
|
58
48
|
isCover: false,
|
|
59
49
|
wrap: "wrap",
|
|
60
|
-
"data-drag-hook":
|
|
50
|
+
"data-drag-hook": "true",
|
|
61
51
|
eleRef: dragRef
|
|
62
|
-
}, needIcon &&
|
|
63
|
-
className:
|
|
52
|
+
}, needIcon && /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: finalStyle.iconContainer
|
|
64
54
|
}, /*#__PURE__*/React.createElement(AlertIcons, {
|
|
65
55
|
type: type
|
|
66
|
-
}))
|
|
56
|
+
})), (title || children) && /*#__PURE__*/React.createElement(Box, {
|
|
67
57
|
flexible: true
|
|
68
58
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
69
59
|
alignBox: "row",
|
|
70
60
|
wrap: breakChildren ? 'wrap' : null
|
|
71
61
|
}, title && /*#__PURE__*/React.createElement(Box, {
|
|
72
|
-
className:
|
|
62
|
+
className: finalStyle.title,
|
|
73
63
|
shrink: true,
|
|
74
64
|
id: htmlId
|
|
75
65
|
}, title), children && /*#__PURE__*/React.createElement(Box, {
|
|
76
66
|
adjust: true,
|
|
77
67
|
flexible: true
|
|
78
|
-
}, children))
|
|
79
|
-
className:
|
|
68
|
+
}, children))), onClose && /*#__PURE__*/React.createElement(Box, {
|
|
69
|
+
className: style.close
|
|
80
70
|
}, /*#__PURE__*/React.createElement(AlertClose, {
|
|
81
71
|
onClose: onClose,
|
|
82
72
|
dataTitle: closeTitle,
|
|
@@ -1,130 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
import AlertHeader from "../AlertHeader";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
cleanup();
|
|
7
|
-
});
|
|
8
|
-
describe('AlertHeader snapshot - ', () => {
|
|
9
|
-
test('Render with default props', () => {
|
|
4
|
+
describe('AlertHeader', () => {
|
|
5
|
+
test('rendering the defult props', () => {
|
|
10
6
|
const {
|
|
11
7
|
asFragment
|
|
12
8
|
} = render( /*#__PURE__*/React.createElement(AlertHeader, null));
|
|
13
9
|
expect(asFragment()).toMatchSnapshot();
|
|
14
10
|
});
|
|
15
|
-
test.each(TYPE_VALUES)('Render with type=%s', type => {
|
|
16
|
-
const {
|
|
17
|
-
asFragment
|
|
18
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
19
|
-
title: "Alert Title",
|
|
20
|
-
type: type
|
|
21
|
-
}));
|
|
22
|
-
expect(asFragment()).toMatchSnapshot();
|
|
23
|
-
});
|
|
24
|
-
test('Render with needIcon=false', () => {
|
|
25
|
-
const {
|
|
26
|
-
asFragment
|
|
27
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
28
|
-
title: "Alert Title",
|
|
29
|
-
needIcon: false
|
|
30
|
-
}));
|
|
31
|
-
expect(asFragment()).toMatchSnapshot();
|
|
32
|
-
});
|
|
33
|
-
test('Render with breakChildren=true', () => {
|
|
34
|
-
const {
|
|
35
|
-
asFragment
|
|
36
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
37
|
-
title: "Alert Title",
|
|
38
|
-
breakChildren: true
|
|
39
|
-
}));
|
|
40
|
-
expect(asFragment()).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
test('Render with onClose', () => {
|
|
43
|
-
const {
|
|
44
|
-
asFragment
|
|
45
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
46
|
-
title: "Alert Title",
|
|
47
|
-
onClose: () => {}
|
|
48
|
-
}));
|
|
49
|
-
expect(asFragment()).toMatchSnapshot();
|
|
50
|
-
});
|
|
51
|
-
test('Render with title', () => {
|
|
52
|
-
const {
|
|
53
|
-
asFragment
|
|
54
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
55
|
-
title: "Alert Title"
|
|
56
|
-
}));
|
|
57
|
-
expect(asFragment()).toMatchSnapshot();
|
|
58
|
-
});
|
|
59
|
-
test('Render with isDraggable=false', () => {
|
|
60
|
-
const {
|
|
61
|
-
asFragment
|
|
62
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
63
|
-
title: "Alert Title",
|
|
64
|
-
isDraggable: false
|
|
65
|
-
}));
|
|
66
|
-
expect(asFragment()).toMatchSnapshot();
|
|
67
|
-
});
|
|
68
|
-
test('Render with children', () => {
|
|
69
|
-
const {
|
|
70
|
-
asFragment
|
|
71
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
72
|
-
title: "Alert Title"
|
|
73
|
-
}, /*#__PURE__*/React.createElement("span", null, "Child content")));
|
|
74
|
-
expect(asFragment()).toMatchSnapshot();
|
|
75
|
-
});
|
|
76
|
-
test('Render with customClass', () => {
|
|
77
|
-
const {
|
|
78
|
-
asFragment
|
|
79
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
80
|
-
title: "Alert Title",
|
|
81
|
-
onClose: () => {},
|
|
82
|
-
customClass: {
|
|
83
|
-
title: 'custom-title-class',
|
|
84
|
-
iconContainer: 'custom-icon-class',
|
|
85
|
-
close: 'custom-close-class'
|
|
86
|
-
}
|
|
87
|
-
}));
|
|
88
|
-
expect(asFragment()).toMatchSnapshot();
|
|
89
|
-
});
|
|
90
|
-
test('Render with renderCustomIcon', () => {
|
|
91
|
-
const {
|
|
92
|
-
asFragment
|
|
93
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
94
|
-
title: "Alert Title",
|
|
95
|
-
renderCustomIcon: /*#__PURE__*/React.createElement("span", null, "Custom Icon")
|
|
96
|
-
}));
|
|
97
|
-
expect(asFragment()).toMatchSnapshot();
|
|
98
|
-
});
|
|
99
|
-
test('Render with renderSecondaryContent', () => {
|
|
100
|
-
const {
|
|
101
|
-
asFragment
|
|
102
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
103
|
-
title: "Alert Title",
|
|
104
|
-
renderSecondaryContent: /*#__PURE__*/React.createElement("span", null, "Secondary")
|
|
105
|
-
}));
|
|
106
|
-
expect(asFragment()).toMatchSnapshot();
|
|
107
|
-
});
|
|
108
|
-
test('Render with renderRightActions', () => {
|
|
109
|
-
const {
|
|
110
|
-
asFragment
|
|
111
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
112
|
-
title: "Alert Title",
|
|
113
|
-
renderRightActions: /*#__PURE__*/React.createElement("button", {
|
|
114
|
-
type: "button"
|
|
115
|
-
}, "Action")
|
|
116
|
-
}));
|
|
117
|
-
expect(asFragment()).toMatchSnapshot();
|
|
118
|
-
});
|
|
119
|
-
test('Render with dataId and htmlId', () => {
|
|
120
|
-
const {
|
|
121
|
-
asFragment
|
|
122
|
-
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
123
|
-
title: "Alert Title",
|
|
124
|
-
htmlId: "alert-header-title",
|
|
125
|
-
dataId: "alert-header",
|
|
126
|
-
onClose: () => {}
|
|
127
|
-
}));
|
|
128
|
-
expect(asFragment()).toMatchSnapshot();
|
|
129
|
-
});
|
|
130
11
|
});
|