@zohodesk/dot 1.0.0-temp-226 → 1.0.0-temp-227
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 +10 -0
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +593 -0
- package/assets/Appearance/dark/themes/blue/blue_DotTheme_DarkTheme.module.css +26 -0
- package/assets/Appearance/dark/themes/green/green_DotTheme_DarkTheme.module.css +26 -0
- package/assets/Appearance/dark/themes/orange/orange_DotTheme_DarkTheme.module.css +26 -0
- package/assets/Appearance/dark/themes/red/red_DotTheme_DarkTheme.module.css +26 -0
- package/assets/Appearance/dark/themes/yellow/yellow_DotTheme_DarkTheme.module.css +26 -0
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +593 -0
- package/assets/Appearance/light/themes/blue/blue_DotTheme_LightTheme.module.css +26 -0
- package/assets/Appearance/light/themes/green/green_DotTheme_LightTheme.module.css +26 -0
- package/assets/Appearance/light/themes/orange/orange_DotTheme_LightTheme.module.css +26 -0
- package/assets/Appearance/light/themes/red/red_DotTheme_LightTheme.module.css +26 -0
- package/assets/Appearance/light/themes/yellow/yellow_DotTheme_LightTheme.module.css +26 -0
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +593 -0
- package/assets/Appearance/pureDark/themes/blue/blue_DotTheme_PureDarkTheme.module.css +26 -0
- package/assets/Appearance/pureDark/themes/green/green_DotTheme_PureDarkTheme.module.css +26 -0
- package/assets/Appearance/pureDark/themes/orange/orange_DotTheme_PureDarkTheme.module.css +26 -0
- package/assets/Appearance/pureDark/themes/red/red_DotTheme_PureDarkTheme.module.css +26 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_DotTheme_PureDarkTheme.module.css +26 -0
- package/es/DotProvider/hooks/useDotProvider.js +3 -3
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +2 -0
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +2 -0
- package/es/DotProvider/utils/constants.js +1 -2
- package/es/DotProvider/utils/themeAppearanceAssetsConfig.js +1 -15
- package/es/DotProvider/utils/themeColorAssetsConfig.js +1 -73
- package/es/list/Comment/Comment.module.css +29 -29
- package/es/list/Dot/Dot.module.css +15 -15
- package/es/list/ListLayout/ListLayout.module.css +79 -79
- package/es/lookup/Lookup/Lookup.js +6 -4
- package/es/lookup/Lookup/__tests__/Lookup.spec.js +101 -4
- package/es/lookup/Lookup/__tests__/__snapshots__/Lookup.spec.js.snap +223 -2
- package/es/lookup/Lookup/props/propTypes.js +6 -1
- package/es/lookup/header/ModuleHeader/ModuleHeader.js +12 -5
- package/es/lookup/header/ModuleHeader/__tests__/ModuleHeader.spec.js +87 -3
- package/es/lookup/header/ModuleHeader/props/defaultProps.js +2 -0
- package/es/lookup/header/ModuleHeader/props/propTypes.js +6 -0
- package/es/version2/lookup/AlertHeader/AlertHeader.js +19 -9
- package/es/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +122 -3
- package/es/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +1728 -3
- package/es/version2/lookup/AlertHeader/css/cssJSLogic.js +6 -1
- package/es/version2/lookup/AlertHeader/props/defaultProps.js +2 -0
- package/es/version2/lookup/AlertHeader/props/propTypes.js +10 -0
- package/lib/DotProvider/hooks/useDotProvider.js +3 -3
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +4 -0
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +4 -0
- package/lib/DotProvider/utils/constants.js +2 -4
- package/lib/DotProvider/utils/themeAppearanceAssetsConfig.js +2 -17
- package/lib/DotProvider/utils/themeColorAssetsConfig.js +2 -77
- package/lib/list/Comment/Comment.module.css +29 -29
- package/lib/list/Dot/Dot.module.css +15 -15
- package/lib/list/ListLayout/ListLayout.module.css +79 -79
- package/lib/lookup/Lookup/Lookup.js +6 -4
- package/lib/lookup/Lookup/__tests__/Lookup.spec.js +101 -4
- package/lib/lookup/Lookup/__tests__/__snapshots__/Lookup.spec.js.snap +223 -2
- package/lib/lookup/Lookup/props/propTypes.js +8 -1
- package/lib/lookup/header/ModuleHeader/ModuleHeader.js +13 -5
- package/lib/lookup/header/ModuleHeader/__tests__/ModuleHeader.spec.js +86 -2
- package/lib/lookup/header/ModuleHeader/props/defaultProps.js +2 -0
- package/lib/lookup/header/ModuleHeader/props/propTypes.js +6 -0
- package/lib/version2/lookup/AlertHeader/AlertHeader.js +19 -8
- package/lib/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +121 -2
- package/lib/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +1728 -3
- package/lib/version2/lookup/AlertHeader/css/cssJSLogic.js +4 -2
- package/lib/version2/lookup/AlertHeader/props/defaultProps.js +2 -0
- package/lib/version2/lookup/AlertHeader/props/propTypes.js +10 -0
- package/package.json +6 -6
- package/es/DotProvider/libraryChunks/appearance/variables/Dark_Variables.js +0 -1
- package/es/DotProvider/libraryChunks/appearance/variables/Light_Variables.js +0 -1
- package/es/DotProvider/libraryChunks/appearance/variables/PureDark_Variables.js +0 -1
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_Dark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_Light_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_PureDark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_Dark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_Light_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_PureDark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_Dark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_Light_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_PureDark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_Dark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_Light_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_PureDark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Dark_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Light_Variables.js +0 -2
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_PureDark_Variables.js +0 -2
- package/lib/DotProvider/libraryChunks/appearance/variables/Dark_Variables.js +0 -3
- package/lib/DotProvider/libraryChunks/appearance/variables/Light_Variables.js +0 -3
- package/lib/DotProvider/libraryChunks/appearance/variables/PureDark_Variables.js +0 -3
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_Dark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_Light_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_PureDark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_Dark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_Light_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_PureDark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_Dark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_Light_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_PureDark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_Dark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_Light_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_PureDark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Dark_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Light_Variables.js +0 -5
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_PureDark_Variables.js +0 -5
|
@@ -70,7 +70,8 @@ export default class Lookup extends Component {
|
|
|
70
70
|
...a11yAttributes
|
|
71
71
|
} = a11y;
|
|
72
72
|
const {
|
|
73
|
-
focusScopeProps = {}
|
|
73
|
+
focusScopeProps = {},
|
|
74
|
+
freezeLayerProps
|
|
74
75
|
} = customProps;
|
|
75
76
|
const {
|
|
76
77
|
needAutoFocus = true,
|
|
@@ -97,16 +98,17 @@ export default class Lookup extends Component {
|
|
|
97
98
|
isCover: false,
|
|
98
99
|
className: `${isMinHeight ? style.wrapper : style.coverwrap} ${style.containerWidth} ${containerClass}`
|
|
99
100
|
}, children));
|
|
100
|
-
return /*#__PURE__*/React.createElement(FreezeLayer, {
|
|
101
|
+
return /*#__PURE__*/React.createElement(FreezeLayer, _extends({
|
|
101
102
|
align: "horizontal",
|
|
102
103
|
animationName: "fade",
|
|
104
|
+
palette: "snow"
|
|
105
|
+
}, freezeLayerProps, {
|
|
103
106
|
childAnimationName: childAnimationName,
|
|
104
107
|
isActive: isActive,
|
|
105
|
-
palette: "snow",
|
|
106
108
|
forwardRef: forwardRef,
|
|
107
109
|
onClick: onClick,
|
|
108
110
|
customClass: customClass
|
|
109
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
111
|
+
}), /*#__PURE__*/React.createElement(Container, {
|
|
110
112
|
alignBox: "row",
|
|
111
113
|
className: style.container,
|
|
112
114
|
dataId: "fldValue"
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { cleanup, render } from '@testing-library/react';
|
|
3
3
|
import Lookup from "../Lookup";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const SIZE_VALUES = ['small', 'xmedium', 'large', 'xlarge', 'full'];
|
|
5
|
+
const CHILD_ANIMATION_NAME_VALUES = ['expand'];
|
|
6
|
+
afterEach(() => {
|
|
7
|
+
cleanup();
|
|
8
|
+
});
|
|
9
|
+
describe('Lookup snapshot - ', () => {
|
|
10
|
+
test('Render with default props', () => {
|
|
6
11
|
const {
|
|
7
12
|
asFragment
|
|
8
13
|
} = render( /*#__PURE__*/React.createElement(Lookup, null));
|
|
9
14
|
expect(asFragment()).toMatchSnapshot();
|
|
10
15
|
});
|
|
11
|
-
test('
|
|
16
|
+
test.each(SIZE_VALUES)('Render with size=%s', size => {
|
|
17
|
+
const {
|
|
18
|
+
asFragment
|
|
19
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
20
|
+
isActive: true,
|
|
21
|
+
size: size
|
|
22
|
+
}));
|
|
23
|
+
expect(asFragment()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
test.each(CHILD_ANIMATION_NAME_VALUES)('Render with childAnimationName=%s', childAnimationName => {
|
|
26
|
+
const {
|
|
27
|
+
asFragment
|
|
28
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
29
|
+
isActive: true,
|
|
30
|
+
childAnimationName: childAnimationName
|
|
31
|
+
}));
|
|
32
|
+
expect(asFragment()).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
test('Render with isActive=true', () => {
|
|
12
35
|
const {
|
|
13
36
|
asFragment
|
|
14
37
|
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
@@ -16,4 +39,78 @@ describe('Lookup', () => {
|
|
|
16
39
|
}));
|
|
17
40
|
expect(asFragment()).toMatchSnapshot();
|
|
18
41
|
});
|
|
42
|
+
test('Render with isMinHeight=true', () => {
|
|
43
|
+
const {
|
|
44
|
+
asFragment
|
|
45
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
46
|
+
isActive: true,
|
|
47
|
+
isMinHeight: true
|
|
48
|
+
}));
|
|
49
|
+
expect(asFragment()).toMatchSnapshot();
|
|
50
|
+
});
|
|
51
|
+
test('Render with children', () => {
|
|
52
|
+
const {
|
|
53
|
+
asFragment
|
|
54
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
55
|
+
isActive: true
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", null, "Lookup child content")));
|
|
57
|
+
expect(asFragment()).toMatchSnapshot();
|
|
58
|
+
});
|
|
59
|
+
test('Render with custom classes', () => {
|
|
60
|
+
const {
|
|
61
|
+
asFragment
|
|
62
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
63
|
+
isActive: true,
|
|
64
|
+
customClass: "lookup-freeze-layer",
|
|
65
|
+
containerClass: "lookup-container",
|
|
66
|
+
lookupClass: "lookup-box"
|
|
67
|
+
}));
|
|
68
|
+
expect(asFragment()).toMatchSnapshot();
|
|
69
|
+
});
|
|
70
|
+
test('Render with customProps', () => {
|
|
71
|
+
const {
|
|
72
|
+
asFragment
|
|
73
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
74
|
+
isActive: true,
|
|
75
|
+
customProps: {
|
|
76
|
+
freezeLayerProps: {
|
|
77
|
+
palette: 'plain'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
expect(asFragment()).toMatchSnapshot();
|
|
82
|
+
});
|
|
83
|
+
test('Render with dataId', () => {
|
|
84
|
+
const {
|
|
85
|
+
asFragment
|
|
86
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
87
|
+
isActive: true,
|
|
88
|
+
dataId: "lookup-data-id"
|
|
89
|
+
}));
|
|
90
|
+
expect(asFragment()).toMatchSnapshot();
|
|
91
|
+
});
|
|
92
|
+
test('Render with htmlId', () => {
|
|
93
|
+
const {
|
|
94
|
+
asFragment
|
|
95
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
96
|
+
isActive: true,
|
|
97
|
+
htmlId: "lookup-html-id"
|
|
98
|
+
}));
|
|
99
|
+
expect(asFragment()).toMatchSnapshot();
|
|
100
|
+
});
|
|
101
|
+
test('Render with a11y attributes', () => {
|
|
102
|
+
const {
|
|
103
|
+
asFragment
|
|
104
|
+
} = render( /*#__PURE__*/React.createElement(Lookup, {
|
|
105
|
+
isActive: true,
|
|
106
|
+
a11y: {
|
|
107
|
+
role: 'region',
|
|
108
|
+
ariaLabelledby: 'lookup-title',
|
|
109
|
+
ariaDescribedby: 'lookup-description',
|
|
110
|
+
ariaLabel: 'Lookup Dialog',
|
|
111
|
+
ariaModal: true
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
expect(asFragment()).toMatchSnapshot();
|
|
115
|
+
});
|
|
19
116
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Lookup
|
|
3
|
+
exports[`Lookup snapshot - Render with a11y attributes 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
6
|
class="container index5 snow"
|
|
@@ -17,4 +17,225 @@ exports[`Lookup rendering isActive is true 1`] = `
|
|
|
17
17
|
</DocumentFragment>
|
|
18
18
|
`;
|
|
19
19
|
|
|
20
|
-
exports[`Lookup
|
|
20
|
+
exports[`Lookup snapshot - Render with childAnimationName=expand 1`] = `
|
|
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
|
+
`;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import FocusScopePropTypes from '@zohodesk/a11y/es/FocusScope/props/propTypes';
|
|
3
|
+
import FreezeLayerPropTypes from "../../../FreezeLayer/props/propTypes";
|
|
2
4
|
export const propTypes = {
|
|
3
5
|
children: PropTypes.node,
|
|
4
6
|
customClass: PropTypes.string,
|
|
@@ -15,7 +17,10 @@ export const propTypes = {
|
|
|
15
17
|
onKeyDown: PropTypes.func,
|
|
16
18
|
childAnimationName: PropTypes.oneOf(['expand', 'flyDown']),
|
|
17
19
|
needFocusScope: PropTypes.bool,
|
|
18
|
-
customProps: PropTypes.
|
|
20
|
+
customProps: PropTypes.shape({
|
|
21
|
+
focusScopeProps: PropTypes.shape(FocusScopePropTypes),
|
|
22
|
+
freezeLayerProps: PropTypes.shape(FreezeLayerPropTypes)
|
|
23
|
+
}),
|
|
19
24
|
forwardRef: PropTypes.object,
|
|
20
25
|
onClick: PropTypes.func,
|
|
21
26
|
onClose: PropTypes.func,
|
|
@@ -32,31 +32,38 @@ function ModuleHeader(props) {
|
|
|
32
32
|
closeTitle,
|
|
33
33
|
onSearchKeyDown,
|
|
34
34
|
palette,
|
|
35
|
+
isDraggable,
|
|
35
36
|
dragBoundaryLimit,
|
|
36
37
|
children,
|
|
38
|
+
customClass,
|
|
37
39
|
childNearTitle
|
|
38
40
|
} = props;
|
|
39
41
|
const dragRef = useRef(null); //dragRef
|
|
40
42
|
|
|
41
43
|
useDragger({
|
|
42
|
-
isActive:
|
|
44
|
+
isActive: isDraggable,
|
|
43
45
|
ChildRef: dragRef,
|
|
44
46
|
boundaryLimit: dragBoundaryLimit
|
|
45
47
|
}); //custom Hook
|
|
46
48
|
|
|
49
|
+
const {
|
|
50
|
+
container: customContainerClass = '',
|
|
51
|
+
title: customTitleClass = '',
|
|
52
|
+
close: customCloseClass = ''
|
|
53
|
+
} = customClass;
|
|
47
54
|
return /*#__PURE__*/React.createElement(Container, {
|
|
48
55
|
align: "vertical",
|
|
49
56
|
alignBox: "row",
|
|
50
|
-
className: `${commonStyle.container} ${commonStyle[`${palette}`]}`,
|
|
57
|
+
className: `${commonStyle.container} ${commonStyle[`${palette}`]} ${customContainerClass}`,
|
|
51
58
|
isCover: false,
|
|
52
59
|
wrap: "wrap",
|
|
53
60
|
dataId: dataId,
|
|
54
|
-
"data-drag-hook":
|
|
61
|
+
"data-drag-hook": isDraggable ? 'true' : 'false',
|
|
55
62
|
eleRef: dragRef
|
|
56
63
|
}, childNearTitle ? childNearTitle : '', /*#__PURE__*/React.createElement(Box, {
|
|
57
64
|
flexible: true
|
|
58
65
|
}, /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: commonStyle.title
|
|
66
|
+
className: `${commonStyle.title} ${customTitleClass}`
|
|
60
67
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
61
68
|
text: title
|
|
62
69
|
})), miniDescription && /*#__PURE__*/React.createElement("div", {
|
|
@@ -73,7 +80,7 @@ function ModuleHeader(props) {
|
|
|
73
80
|
getRef: getSearchBoxRef,
|
|
74
81
|
onKeyDown: onSearchKeyDown
|
|
75
82
|
})), children ? children : '', onLookupClose ? /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: commonStyle.closeContainer
|
|
83
|
+
className: `${commonStyle.closeContainer} ${customCloseClass}`
|
|
77
84
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
78
85
|
dataId: "close",
|
|
79
86
|
onClose: onLookupClose,
|
|
@@ -1,11 +1,95 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
3
|
import ModuleHeader from "../ModuleHeader";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const PALETTE_VALUES = ['default', 'white'];
|
|
5
|
+
afterEach(() => {
|
|
6
|
+
cleanup();
|
|
7
|
+
});
|
|
8
|
+
describe('ModuleHeader snapshot - ', () => {
|
|
9
|
+
test('Render with default props', () => {
|
|
6
10
|
const {
|
|
7
11
|
asFragment
|
|
8
12
|
} = render( /*#__PURE__*/React.createElement(ModuleHeader, null));
|
|
9
13
|
expect(asFragment()).toMatchSnapshot();
|
|
10
14
|
});
|
|
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
|
+
});
|
|
11
95
|
});
|
|
@@ -16,5 +16,11 @@ 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,
|
|
19
25
|
dragBoundaryLimit: PropTypes.object
|
|
20
26
|
};
|
|
@@ -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 } from '@zohodesk/utils'; //customHooks
|
|
9
|
+
import { mergeStyle, isRenderable, renderNode } from '@zohodesk/utils'; //customHooks
|
|
10
10
|
|
|
11
11
|
import useDragger from "../../../Hooks/Dragger/useDragger"; //Props
|
|
12
12
|
|
|
@@ -23,10 +23,20 @@ export default function AlertHeader(props) {
|
|
|
23
23
|
dataId,
|
|
24
24
|
type,
|
|
25
25
|
htmlId,
|
|
26
|
+
isDraggable,
|
|
27
|
+
customClass,
|
|
28
|
+
renderCustomIcon,
|
|
29
|
+
renderSecondaryContent,
|
|
30
|
+
renderRightActions,
|
|
26
31
|
customStyle,
|
|
27
32
|
dragBoundaryLimit
|
|
28
33
|
} = props;
|
|
29
34
|
const finalStyle = mergeStyle(style, customStyle);
|
|
35
|
+
const {
|
|
36
|
+
title: titleClass = '',
|
|
37
|
+
iconContainer: iconContainerClass = '',
|
|
38
|
+
close: closeClass = ''
|
|
39
|
+
} = customClass;
|
|
30
40
|
const {
|
|
31
41
|
alertHeaderContainerClass
|
|
32
42
|
} = cssJSLogic({
|
|
@@ -36,7 +46,7 @@ export default function AlertHeader(props) {
|
|
|
36
46
|
const dragRef = useRef(null); //dragRef
|
|
37
47
|
|
|
38
48
|
useDragger({
|
|
39
|
-
isActive:
|
|
49
|
+
isActive: isDraggable,
|
|
40
50
|
ChildRef: dragRef,
|
|
41
51
|
boundaryLimit: dragBoundaryLimit
|
|
42
52
|
}); //custom Hook
|
|
@@ -47,26 +57,26 @@ export default function AlertHeader(props) {
|
|
|
47
57
|
className: `${alertHeaderContainerClass}`,
|
|
48
58
|
isCover: false,
|
|
49
59
|
wrap: "wrap",
|
|
50
|
-
"data-drag-hook":
|
|
60
|
+
"data-drag-hook": isDraggable ? 'true' : 'false',
|
|
51
61
|
eleRef: dragRef
|
|
52
|
-
}, needIcon && /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
className: finalStyle.iconContainer
|
|
62
|
+
}, needIcon && !isRenderable(renderCustomIcon) ? /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: `${finalStyle.iconContainer} ${iconContainerClass}`
|
|
54
64
|
}, /*#__PURE__*/React.createElement(AlertIcons, {
|
|
55
65
|
type: type
|
|
56
|
-
})), (title || children) && /*#__PURE__*/React.createElement(Box, {
|
|
66
|
+
})) : renderNode(renderCustomIcon), (title || children) && /*#__PURE__*/React.createElement(Box, {
|
|
57
67
|
flexible: true
|
|
58
68
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
59
69
|
alignBox: "row",
|
|
60
70
|
wrap: breakChildren ? 'wrap' : null
|
|
61
71
|
}, title && /*#__PURE__*/React.createElement(Box, {
|
|
62
|
-
className: finalStyle.title
|
|
72
|
+
className: `${finalStyle.title} ${titleClass}`,
|
|
63
73
|
shrink: true,
|
|
64
74
|
id: htmlId
|
|
65
75
|
}, title), children && /*#__PURE__*/React.createElement(Box, {
|
|
66
76
|
adjust: true,
|
|
67
77
|
flexible: true
|
|
68
|
-
}, children))), onClose && /*#__PURE__*/React.createElement(Box, {
|
|
69
|
-
className: style.close
|
|
78
|
+
}, children)), renderNode(renderSecondaryContent)), renderNode(renderRightActions), onClose && /*#__PURE__*/React.createElement(Box, {
|
|
79
|
+
className: `${style.close} ${closeClass}`
|
|
70
80
|
}, /*#__PURE__*/React.createElement(AlertClose, {
|
|
71
81
|
onClose: onClose,
|
|
72
82
|
dataTitle: closeTitle,
|