@zohodesk/components 1.4.16 → 1.4.18
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 +35 -2
- package/es/Card/__tests__/Card.spec.js +48 -0
- package/es/Card/__tests__/CardContent.spec.js +61 -0
- package/es/Card/__tests__/CardHeader.spec.js +33 -0
- package/es/Card/__tests__/__snapshots__/Card.spec.js.snap +125 -0
- package/es/Card/__tests__/__snapshots__/CardContent.spec.js.snap +177 -0
- package/es/Card/__tests__/__snapshots__/CardHeader.spec.js.snap +51 -0
- package/es/ListItem/ListItem.js +10 -3
- package/es/ListItem/ListItemWithAvatar.js +15 -6
- package/es/ListItem/ListItemWithCheckBox.js +13 -6
- package/es/ListItem/ListItemWithIcon.js +14 -5
- package/es/ListItem/ListItemWithRadio.js +13 -6
- package/es/ListItem/__tests__/ListItem.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +19 -0
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +17 -0
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +19 -0
- package/es/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +78 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
- package/es/ListItem/props/propTypes.js +15 -5
- package/es/MultiSelect/MultiSelect.js +55 -23
- package/es/MultiSelect/Suggestions.js +2 -1
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +6 -6
- package/es/MultiSelect/props/propTypes.js +2 -3
- package/es/Select/GroupSelect.js +4 -2
- package/es/Select/Select.js +50 -22
- package/es/Select/SelectWithAvatar.js +17 -4
- package/es/Select/SelectWithIcon.js +15 -5
- package/es/Select/props/defaultProps.js +3 -0
- package/es/Select/props/propTypes.js +6 -0
- package/es/Typography/__tests__/Typography.spec.js +225 -0
- package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +1226 -0
- package/es/utils/dropDownUtils.js +13 -4
- package/es/v1/Switch/__tests__/Switch.spec.js +41 -6
- package/es/v1/Switch/__tests__/__snapshots__/Switch.spec.js.snap +176 -5
- package/es/v1/Switch/css/Switch_v1.module.css +7 -1
- package/lib/Card/__tests__/Card.spec.js +54 -6
- package/lib/Card/__tests__/CardContent.spec.js +68 -0
- package/lib/Card/__tests__/CardHeader.spec.js +40 -0
- package/lib/Card/__tests__/__snapshots__/Card.spec.js.snap +125 -0
- package/lib/Card/__tests__/__snapshots__/CardContent.spec.js.snap +177 -0
- package/lib/Card/__tests__/__snapshots__/CardHeader.spec.js.snap +51 -0
- package/lib/ListItem/ListItem.js +10 -3
- package/lib/ListItem/ListItemWithAvatar.js +15 -6
- package/lib/ListItem/ListItemWithCheckBox.js +15 -6
- package/lib/ListItem/ListItemWithIcon.js +13 -5
- package/lib/ListItem/ListItemWithRadio.js +15 -6
- package/lib/ListItem/__tests__/ListItem.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +23 -0
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +21 -0
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +23 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +78 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +140 -46
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +251 -49
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +144 -50
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +252 -52
- package/lib/ListItem/props/propTypes.js +15 -6
- package/lib/MultiSelect/MultiSelect.js +50 -24
- package/lib/MultiSelect/Suggestions.js +2 -1
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +6 -6
- package/lib/MultiSelect/props/propTypes.js +3 -4
- package/lib/Select/GroupSelect.js +4 -3
- package/lib/Select/Select.js +45 -20
- package/lib/Select/SelectWithAvatar.js +17 -7
- package/lib/Select/SelectWithIcon.js +15 -5
- package/lib/Select/props/defaultProps.js +3 -1
- package/lib/Select/props/propTypes.js +6 -0
- package/lib/Typography/__tests__/Typography.spec.js +232 -0
- package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +1226 -0
- package/lib/utils/dropDownUtils.js +17 -4
- package/lib/v1/Switch/__tests__/Switch.spec.js +41 -6
- package/lib/v1/Switch/__tests__/__snapshots__/Switch.spec.js.snap +176 -5
- package/lib/v1/Switch/css/Switch_v1.module.css +7 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,7 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
|
|
4
4
|
|
|
5
|
-
# 1.4.
|
|
5
|
+
# 1.4.18
|
|
6
|
+
|
|
7
|
+
- **Select**
|
|
8
|
+
- `secondaryField` prop supported to render secondary value inside the options
|
|
9
|
+
- `searchFields` prop suppored to additional values based search
|
|
10
|
+
|
|
11
|
+
- **MultiSelect**
|
|
12
|
+
- `secondaryField` prop supported to render secondary value inside the options
|
|
13
|
+
- `SuggestionsProps` supported under **customProps** prop
|
|
14
|
+
|
|
15
|
+
- **SelectWithIcon**
|
|
16
|
+
- `secondaryValueKey` prop supported to render secondary value inside the options
|
|
17
|
+
- `searchFields` prop suppored to additional values based search
|
|
18
|
+
- `ListItemProps` supported under **customProps** prop
|
|
19
|
+
|
|
20
|
+
- **SelectWithAvatar**
|
|
21
|
+
- `secondaryField` prop supported to render secondary value inside the options
|
|
22
|
+
- `searchFields` prop suppored to additional values based search
|
|
23
|
+
- `customProps` props supported with **TextBoxProps**, **DropdownSearchTextBoxProps** and **SuggestionsProps**
|
|
24
|
+
|
|
25
|
+
- **GroupSelect**
|
|
26
|
+
- `secondaryField` option supported under **groupedOptions** prop to render secondary value inside the options
|
|
27
|
+
- `SuggestionsProps` supported under **customProps** prop
|
|
28
|
+
|
|
29
|
+
- **ListItem, ListItemWithAvatar, ListItemWithCheckBox, ListItemWithIcon, ListItemWithRadio**
|
|
30
|
+
- `renderValueRightPlaceholderNode` prop supported to render elements after the value
|
|
31
|
+
|
|
32
|
+
# 1.4.17
|
|
33
|
+
|
|
34
|
+
- **Select, MultiSelect** - Fixed scroll jitter for the highlighted option when the virtualizer is enabled.
|
|
35
|
+
- **Select** - `isAnimate` prop supported
|
|
36
|
+
- `Switch_v1 css` - RTL issue on thumb position fixed.
|
|
37
|
+
|
|
38
|
+
# 1.4.14, 1.4.15 , 1.4.16
|
|
6
39
|
|
|
7
40
|
- `Common Css`
|
|
8
41
|
- added ltr class renamed to ltr-zone.
|
|
@@ -17,7 +50,7 @@ Dot UI is a customizable React component library built to deliver a clean, acces
|
|
|
17
50
|
# 1.4.12
|
|
18
51
|
|
|
19
52
|
- `TextBox`
|
|
20
|
-
- The event is passed as the 4th argument to both
|
|
53
|
+
- The event is passed as the 4th argument to both onBlur and onFocus
|
|
21
54
|
- `Common Css`
|
|
22
55
|
- added ltr class for change direction to ltr in rtl mode.
|
|
23
56
|
|
|
@@ -8,6 +8,54 @@ describe('Card', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(Card, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('rendering the children', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(Card, null, " ", /*#__PURE__*/React.createElement(CardContent, null, "Test")));
|
|
15
|
+
expect(asFragment()).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
test('rendering the isScrollAttribute is true', () => {
|
|
18
|
+
const {
|
|
19
|
+
asFragment
|
|
20
|
+
} = render( /*#__PURE__*/React.createElement(Card, {
|
|
21
|
+
isScrollAttribute: true
|
|
22
|
+
}, " ", /*#__PURE__*/React.createElement(CardContent, null, "Test")));
|
|
23
|
+
expect(asFragment()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
test('rendering the dataId value', () => {
|
|
26
|
+
const {
|
|
27
|
+
asFragment
|
|
28
|
+
} = render( /*#__PURE__*/React.createElement(Card, {
|
|
29
|
+
dataId: "customdataId"
|
|
30
|
+
}, /*#__PURE__*/React.createElement(CardContent, null, "Test")));
|
|
31
|
+
expect(asFragment()).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
test('rendering the customClass', () => {
|
|
34
|
+
const {
|
|
35
|
+
asFragment
|
|
36
|
+
} = render( /*#__PURE__*/React.createElement(Card, {
|
|
37
|
+
customClass: "customClass"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(CardContent, null, "Test")));
|
|
39
|
+
expect(asFragment()).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
test('rendering the htmlId', () => {
|
|
42
|
+
const {
|
|
43
|
+
asFragment
|
|
44
|
+
} = render( /*#__PURE__*/React.createElement(Card, {
|
|
45
|
+
htmlId: "customHtmlId"
|
|
46
|
+
}, /*#__PURE__*/React.createElement(CardContent, null, "Test")));
|
|
47
|
+
expect(asFragment()).toMatchSnapshot();
|
|
48
|
+
});
|
|
49
|
+
test('rendering the a11y', () => {
|
|
50
|
+
const {
|
|
51
|
+
asFragment
|
|
52
|
+
} = render( /*#__PURE__*/React.createElement(Card, {
|
|
53
|
+
a11y: {
|
|
54
|
+
role: 'button'
|
|
55
|
+
}
|
|
56
|
+
}, /*#__PURE__*/React.createElement(CardContent, null, "Test")));
|
|
57
|
+
expect(asFragment()).toMatchSnapshot();
|
|
58
|
+
});
|
|
11
59
|
test('should trigger fetch, when scroll to the bottom of the card while isRecentOnBottom = false', async () => {
|
|
12
60
|
const mockGetNextOptions = jest.fn(() => {
|
|
13
61
|
return new Promise(resolve => {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { CardContent } from "../Card";
|
|
4
|
+
describe('CardContent', () => {
|
|
5
|
+
test('rendering the defult props', () => {
|
|
6
|
+
const {
|
|
7
|
+
asFragment
|
|
8
|
+
} = render( /*#__PURE__*/React.createElement(CardContent, null));
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
test('rendering children', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(CardContent, null, "Test"));
|
|
15
|
+
expect(asFragment()).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
test('rendering isScrollAttribute is true', () => {
|
|
18
|
+
const {
|
|
19
|
+
asFragment
|
|
20
|
+
} = render( /*#__PURE__*/React.createElement(CardContent, {
|
|
21
|
+
isScrollAttribute: true
|
|
22
|
+
}, "Test"));
|
|
23
|
+
expect(asFragment()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
const scroll = ['vertical', 'horizontal', 'both', 'none'];
|
|
26
|
+
test.each(scroll)('Should render with name - %s', scroll => {
|
|
27
|
+
const {
|
|
28
|
+
asFragment
|
|
29
|
+
} = render( /*#__PURE__*/React.createElement(CardContent, {
|
|
30
|
+
isScrollAttribute: true,
|
|
31
|
+
scroll: scroll
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", null, "Test Animation")));
|
|
33
|
+
expect(asFragment()).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
test('rendering shrink is true', () => {
|
|
36
|
+
const {
|
|
37
|
+
asFragment
|
|
38
|
+
} = render( /*#__PURE__*/React.createElement(CardContent, {
|
|
39
|
+
shrink: true
|
|
40
|
+
}, "Test"));
|
|
41
|
+
expect(asFragment()).toMatchSnapshot();
|
|
42
|
+
});
|
|
43
|
+
test('rendering customClass is true', () => {
|
|
44
|
+
const {
|
|
45
|
+
asFragment
|
|
46
|
+
} = render( /*#__PURE__*/React.createElement(CardContent, {
|
|
47
|
+
customClass: "cardCustomClass"
|
|
48
|
+
}, "Test"));
|
|
49
|
+
expect(asFragment()).toMatchSnapshot();
|
|
50
|
+
});
|
|
51
|
+
const preventParentScroll = ['vertical', 'horizontal', 'both'];
|
|
52
|
+
test.each(preventParentScroll)('Should render with name - %s', preventParentScroll => {
|
|
53
|
+
const {
|
|
54
|
+
asFragment
|
|
55
|
+
} = render( /*#__PURE__*/React.createElement(CardContent, {
|
|
56
|
+
isScrollAttribute: true,
|
|
57
|
+
preventParentScroll: preventParentScroll
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", null, "Test")));
|
|
59
|
+
expect(asFragment()).toMatchSnapshot();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { CardHeader } from "../Card";
|
|
4
|
+
describe('CardHeader', () => {
|
|
5
|
+
test('rendering the defult props', () => {
|
|
6
|
+
const {
|
|
7
|
+
asFragment
|
|
8
|
+
} = render( /*#__PURE__*/React.createElement(CardHeader, null));
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
test('rendering the isScroll is true', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(CardHeader, {
|
|
15
|
+
isScroll: true
|
|
16
|
+
}, "Children"));
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
test('rendering the Children is true', () => {
|
|
20
|
+
const {
|
|
21
|
+
asFragment
|
|
22
|
+
} = render( /*#__PURE__*/React.createElement(CardHeader, null, "Children"));
|
|
23
|
+
expect(asFragment()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
test('rendering the customClass ', () => {
|
|
26
|
+
const {
|
|
27
|
+
asFragment
|
|
28
|
+
} = render( /*#__PURE__*/React.createElement(CardHeader, {
|
|
29
|
+
customClass: "cardHeader-class"
|
|
30
|
+
}, "Children"));
|
|
31
|
+
expect(asFragment()).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -1,5 +1,87 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`Card rendering the a11y 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="flex cover coldir"
|
|
7
|
+
data-id="containerComponent"
|
|
8
|
+
data-selector-id="container"
|
|
9
|
+
data-test-id="containerComponent"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="grow basis shrinkOff scrolly"
|
|
13
|
+
data-id="CardContent"
|
|
14
|
+
data-selector-id="cardContent"
|
|
15
|
+
data-test-id="CardContent"
|
|
16
|
+
role="button"
|
|
17
|
+
>
|
|
18
|
+
Test
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</DocumentFragment>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
exports[`Card rendering the children 1`] = `
|
|
25
|
+
<DocumentFragment>
|
|
26
|
+
<div
|
|
27
|
+
class="flex cover coldir"
|
|
28
|
+
data-id="containerComponent"
|
|
29
|
+
data-selector-id="container"
|
|
30
|
+
data-test-id="containerComponent"
|
|
31
|
+
>
|
|
32
|
+
|
|
33
|
+
<div
|
|
34
|
+
class="grow basis shrinkOff scrolly"
|
|
35
|
+
data-id="CardContent"
|
|
36
|
+
data-selector-id="cardContent"
|
|
37
|
+
data-test-id="CardContent"
|
|
38
|
+
>
|
|
39
|
+
Test
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</DocumentFragment>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`Card rendering the customClass 1`] = `
|
|
46
|
+
<DocumentFragment>
|
|
47
|
+
<div
|
|
48
|
+
class="customClass flex cover coldir"
|
|
49
|
+
data-id="containerComponent"
|
|
50
|
+
data-selector-id="container"
|
|
51
|
+
data-test-id="containerComponent"
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
class="grow basis shrinkOff scrolly"
|
|
55
|
+
data-id="CardContent"
|
|
56
|
+
data-selector-id="cardContent"
|
|
57
|
+
data-test-id="CardContent"
|
|
58
|
+
>
|
|
59
|
+
Test
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</DocumentFragment>
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
exports[`Card rendering the dataId value 1`] = `
|
|
66
|
+
<DocumentFragment>
|
|
67
|
+
<div
|
|
68
|
+
class="flex cover coldir"
|
|
69
|
+
data-id="customdataId"
|
|
70
|
+
data-selector-id="container"
|
|
71
|
+
data-test-id="customdataId"
|
|
72
|
+
>
|
|
73
|
+
<div
|
|
74
|
+
class="grow basis shrinkOff scrolly"
|
|
75
|
+
data-id="CardContent"
|
|
76
|
+
data-selector-id="cardContent"
|
|
77
|
+
data-test-id="CardContent"
|
|
78
|
+
>
|
|
79
|
+
Test
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</DocumentFragment>
|
|
83
|
+
`;
|
|
84
|
+
|
|
3
85
|
exports[`Card rendering the defult props 1`] = `
|
|
4
86
|
<DocumentFragment>
|
|
5
87
|
<div
|
|
@@ -11,6 +93,49 @@ exports[`Card rendering the defult props 1`] = `
|
|
|
11
93
|
</DocumentFragment>
|
|
12
94
|
`;
|
|
13
95
|
|
|
96
|
+
exports[`Card rendering the htmlId 1`] = `
|
|
97
|
+
<DocumentFragment>
|
|
98
|
+
<div
|
|
99
|
+
class="flex cover coldir"
|
|
100
|
+
data-id="containerComponent"
|
|
101
|
+
data-selector-id="container"
|
|
102
|
+
data-test-id="containerComponent"
|
|
103
|
+
>
|
|
104
|
+
<div
|
|
105
|
+
class="grow basis shrinkOff scrolly"
|
|
106
|
+
data-id="CardContent"
|
|
107
|
+
data-selector-id="cardContent"
|
|
108
|
+
data-test-id="CardContent"
|
|
109
|
+
id="customHtmlId"
|
|
110
|
+
>
|
|
111
|
+
Test
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</DocumentFragment>
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
exports[`Card rendering the isScrollAttribute is true 1`] = `
|
|
118
|
+
<DocumentFragment>
|
|
119
|
+
<div
|
|
120
|
+
class="flex cover coldir"
|
|
121
|
+
data-id="containerComponent"
|
|
122
|
+
data-scroll="true"
|
|
123
|
+
data-selector-id="container"
|
|
124
|
+
data-test-id="containerComponent"
|
|
125
|
+
>
|
|
126
|
+
|
|
127
|
+
<div
|
|
128
|
+
class="grow basis shrinkOff scrolly"
|
|
129
|
+
data-id="CardContent"
|
|
130
|
+
data-selector-id="cardContent"
|
|
131
|
+
data-test-id="CardContent"
|
|
132
|
+
>
|
|
133
|
+
Test
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</DocumentFragment>
|
|
137
|
+
`;
|
|
138
|
+
|
|
14
139
|
exports[`Card should trigger fetch, when scroll to the bottom of the card while isRecentOnBottom = false 1`] = `
|
|
15
140
|
<DocumentFragment>
|
|
16
141
|
<div
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`CardContent Should render with name - both 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="grow basis shrinkOff scrollboth"
|
|
7
|
+
data-id="CardContent"
|
|
8
|
+
data-scroll="true"
|
|
9
|
+
data-selector-id="cardContent"
|
|
10
|
+
data-test-id="CardContent"
|
|
11
|
+
>
|
|
12
|
+
<div>
|
|
13
|
+
Test Animation
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</DocumentFragment>
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
exports[`CardContent Should render with name - both 2`] = `
|
|
20
|
+
<DocumentFragment>
|
|
21
|
+
<div
|
|
22
|
+
class="grow basis shrinkOff scrolly preventScrollBubbleBoth"
|
|
23
|
+
data-id="CardContent"
|
|
24
|
+
data-scroll="true"
|
|
25
|
+
data-selector-id="cardContent"
|
|
26
|
+
data-test-id="CardContent"
|
|
27
|
+
>
|
|
28
|
+
<div>
|
|
29
|
+
Test
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</DocumentFragment>
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
exports[`CardContent Should render with name - horizontal 1`] = `
|
|
36
|
+
<DocumentFragment>
|
|
37
|
+
<div
|
|
38
|
+
class="grow basis shrinkOff scrollx"
|
|
39
|
+
data-id="CardContent"
|
|
40
|
+
data-scroll="true"
|
|
41
|
+
data-selector-id="cardContent"
|
|
42
|
+
data-test-id="CardContent"
|
|
43
|
+
>
|
|
44
|
+
<div>
|
|
45
|
+
Test Animation
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</DocumentFragment>
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
exports[`CardContent Should render with name - horizontal 2`] = `
|
|
52
|
+
<DocumentFragment>
|
|
53
|
+
<div
|
|
54
|
+
class="grow basis shrinkOff scrolly preventScrollBubbleX"
|
|
55
|
+
data-id="CardContent"
|
|
56
|
+
data-scroll="true"
|
|
57
|
+
data-selector-id="cardContent"
|
|
58
|
+
data-test-id="CardContent"
|
|
59
|
+
>
|
|
60
|
+
<div>
|
|
61
|
+
Test
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</DocumentFragment>
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
exports[`CardContent Should render with name - none 1`] = `
|
|
68
|
+
<DocumentFragment>
|
|
69
|
+
<div
|
|
70
|
+
class="grow basis shrinkOff scrollnone"
|
|
71
|
+
data-id="CardContent"
|
|
72
|
+
data-scroll="true"
|
|
73
|
+
data-selector-id="cardContent"
|
|
74
|
+
data-test-id="CardContent"
|
|
75
|
+
>
|
|
76
|
+
<div>
|
|
77
|
+
Test Animation
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</DocumentFragment>
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
exports[`CardContent Should render with name - vertical 1`] = `
|
|
84
|
+
<DocumentFragment>
|
|
85
|
+
<div
|
|
86
|
+
class="grow basis shrinkOff scrolly"
|
|
87
|
+
data-id="CardContent"
|
|
88
|
+
data-scroll="true"
|
|
89
|
+
data-selector-id="cardContent"
|
|
90
|
+
data-test-id="CardContent"
|
|
91
|
+
>
|
|
92
|
+
<div>
|
|
93
|
+
Test Animation
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</DocumentFragment>
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
exports[`CardContent Should render with name - vertical 2`] = `
|
|
100
|
+
<DocumentFragment>
|
|
101
|
+
<div
|
|
102
|
+
class="grow basis shrinkOff scrolly preventScrollBubbleY"
|
|
103
|
+
data-id="CardContent"
|
|
104
|
+
data-scroll="true"
|
|
105
|
+
data-selector-id="cardContent"
|
|
106
|
+
data-test-id="CardContent"
|
|
107
|
+
>
|
|
108
|
+
<div>
|
|
109
|
+
Test
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</DocumentFragment>
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
exports[`CardContent rendering children 1`] = `
|
|
116
|
+
<DocumentFragment>
|
|
117
|
+
<div
|
|
118
|
+
class="grow basis shrinkOff scrolly"
|
|
119
|
+
data-id="CardContent"
|
|
120
|
+
data-selector-id="cardContent"
|
|
121
|
+
data-test-id="CardContent"
|
|
122
|
+
>
|
|
123
|
+
Test
|
|
124
|
+
</div>
|
|
125
|
+
</DocumentFragment>
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
exports[`CardContent rendering customClass is true 1`] = `
|
|
129
|
+
<DocumentFragment>
|
|
130
|
+
<div
|
|
131
|
+
class="cardCustomClass grow basis shrinkOff scrolly"
|
|
132
|
+
data-id="CardContent"
|
|
133
|
+
data-selector-id="cardContent"
|
|
134
|
+
data-test-id="CardContent"
|
|
135
|
+
>
|
|
136
|
+
Test
|
|
137
|
+
</div>
|
|
138
|
+
</DocumentFragment>
|
|
139
|
+
`;
|
|
140
|
+
|
|
141
|
+
exports[`CardContent rendering isScrollAttribute is true 1`] = `
|
|
142
|
+
<DocumentFragment>
|
|
143
|
+
<div
|
|
144
|
+
class="grow basis shrinkOff scrolly"
|
|
145
|
+
data-id="CardContent"
|
|
146
|
+
data-scroll="true"
|
|
147
|
+
data-selector-id="cardContent"
|
|
148
|
+
data-test-id="CardContent"
|
|
149
|
+
>
|
|
150
|
+
Test
|
|
151
|
+
</div>
|
|
152
|
+
</DocumentFragment>
|
|
153
|
+
`;
|
|
154
|
+
|
|
155
|
+
exports[`CardContent rendering shrink is true 1`] = `
|
|
156
|
+
<DocumentFragment>
|
|
157
|
+
<div
|
|
158
|
+
class="grow basis shrinkOn scrolly"
|
|
159
|
+
data-id="CardContent"
|
|
160
|
+
data-selector-id="cardContent"
|
|
161
|
+
data-test-id="CardContent"
|
|
162
|
+
>
|
|
163
|
+
Test
|
|
164
|
+
</div>
|
|
165
|
+
</DocumentFragment>
|
|
166
|
+
`;
|
|
167
|
+
|
|
168
|
+
exports[`CardContent rendering the defult props 1`] = `
|
|
169
|
+
<DocumentFragment>
|
|
170
|
+
<div
|
|
171
|
+
class="grow basis shrinkOff scrolly"
|
|
172
|
+
data-id="CardContent"
|
|
173
|
+
data-selector-id="cardContent"
|
|
174
|
+
data-test-id="CardContent"
|
|
175
|
+
/>
|
|
176
|
+
</DocumentFragment>
|
|
177
|
+
`;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`CardHeader rendering the Children is true 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="notScroll shrinkOff"
|
|
7
|
+
data-id="CardHeader"
|
|
8
|
+
data-selector-id="cardHeader"
|
|
9
|
+
data-test-id="CardHeader"
|
|
10
|
+
>
|
|
11
|
+
Children
|
|
12
|
+
</div>
|
|
13
|
+
</DocumentFragment>
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
exports[`CardHeader rendering the customClass 1`] = `
|
|
17
|
+
<DocumentFragment>
|
|
18
|
+
<div
|
|
19
|
+
class="notScroll cardHeader-class shrinkOff"
|
|
20
|
+
data-id="CardHeader"
|
|
21
|
+
data-selector-id="cardHeader"
|
|
22
|
+
data-test-id="CardHeader"
|
|
23
|
+
>
|
|
24
|
+
Children
|
|
25
|
+
</div>
|
|
26
|
+
</DocumentFragment>
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
exports[`CardHeader rendering the defult props 1`] = `
|
|
30
|
+
<DocumentFragment>
|
|
31
|
+
<div
|
|
32
|
+
class="notScroll shrinkOff"
|
|
33
|
+
data-id="CardHeader"
|
|
34
|
+
data-selector-id="cardHeader"
|
|
35
|
+
data-test-id="CardHeader"
|
|
36
|
+
/>
|
|
37
|
+
</DocumentFragment>
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
exports[`CardHeader rendering the isScroll is true 1`] = `
|
|
41
|
+
<DocumentFragment>
|
|
42
|
+
<div
|
|
43
|
+
class="scroll shrinkOff"
|
|
44
|
+
data-id="CardHeader"
|
|
45
|
+
data-selector-id="cardHeader"
|
|
46
|
+
data-test-id="CardHeader"
|
|
47
|
+
>
|
|
48
|
+
Children
|
|
49
|
+
</div>
|
|
50
|
+
</DocumentFragment>
|
|
51
|
+
`;
|
package/es/ListItem/ListItem.js
CHANGED
|
@@ -7,6 +7,9 @@ import { ListItem_Props } from "./props/propTypes";
|
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
9
|
import { Icon } from '@zohodesk/icons';
|
|
10
|
+
/*** Utils ****/
|
|
11
|
+
|
|
12
|
+
import { renderNode, isRenderable } from '@zohodesk/utils';
|
|
10
13
|
/**** CSS ****/
|
|
11
14
|
|
|
12
15
|
import style from "./ListItem.module.css";
|
|
@@ -71,7 +74,8 @@ export default class ListItem extends React.Component {
|
|
|
71
74
|
customClass,
|
|
72
75
|
customProps,
|
|
73
76
|
needMultiLineText,
|
|
74
|
-
secondaryValue
|
|
77
|
+
secondaryValue,
|
|
78
|
+
renderValueRightPlaceholderNode
|
|
75
79
|
} = this.props;
|
|
76
80
|
let {
|
|
77
81
|
ListItemProps = {},
|
|
@@ -79,7 +83,8 @@ export default class ListItem extends React.Component {
|
|
|
79
83
|
} = customProps;
|
|
80
84
|
let {
|
|
81
85
|
customListItem = '',
|
|
82
|
-
customTickIcon = ''
|
|
86
|
+
customTickIcon = '',
|
|
87
|
+
customValueRightPlaceholder = ''
|
|
83
88
|
} = customClass;
|
|
84
89
|
const listA11y = {
|
|
85
90
|
ariaHidden: true,
|
|
@@ -123,7 +128,9 @@ export default class ListItem extends React.Component {
|
|
|
123
128
|
shrink: true,
|
|
124
129
|
adjust: true,
|
|
125
130
|
className: needMultiLineText ? style.multiLineValue : style.value
|
|
126
|
-
}, value) : null,
|
|
131
|
+
}, value) : null, isRenderable(renderValueRightPlaceholderNode) ? /*#__PURE__*/React.createElement(Box, {
|
|
132
|
+
className: customValueRightPlaceholder
|
|
133
|
+
}, renderNode(renderValueRightPlaceholderNode)) : null, children ? /*#__PURE__*/React.createElement(Box, {
|
|
127
134
|
shrink: true,
|
|
128
135
|
adjust: true,
|
|
129
136
|
className: style.children
|
|
@@ -9,6 +9,9 @@ import { ListItemWithAvatar_Props } from "./props/propTypes";
|
|
|
9
9
|
import Avatar from "../Avatar/Avatar";
|
|
10
10
|
import AvatarTeam from "../AvatarTeam/AvatarTeam";
|
|
11
11
|
import { Icon } from '@zohodesk/icons';
|
|
12
|
+
/*** Utils ****/
|
|
13
|
+
|
|
14
|
+
import { renderNode, isRenderable } from '@zohodesk/utils';
|
|
12
15
|
/**** CSS ****/
|
|
13
16
|
|
|
14
17
|
import style from "./ListItem.module.css";
|
|
@@ -76,6 +79,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
76
79
|
customProps,
|
|
77
80
|
needMultiLineText,
|
|
78
81
|
secondaryValue,
|
|
82
|
+
renderValueRightPlaceholderNode,
|
|
79
83
|
lhsAlignContent
|
|
80
84
|
} = this.props;
|
|
81
85
|
let {
|
|
@@ -87,7 +91,8 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
87
91
|
let {
|
|
88
92
|
customListItem = '',
|
|
89
93
|
customAvatar = '',
|
|
90
|
-
customAvatarTeam = ''
|
|
94
|
+
customAvatarTeam = '',
|
|
95
|
+
customValueRightPlaceholder = ''
|
|
91
96
|
} = customClass;
|
|
92
97
|
const listA11y = {
|
|
93
98
|
ariaHidden: true,
|
|
@@ -148,16 +153,20 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
148
153
|
...AvatarProps
|
|
149
154
|
}))) : null, /*#__PURE__*/React.createElement(Box, {
|
|
150
155
|
flexible: true,
|
|
151
|
-
|
|
152
|
-
}, /*#__PURE__*/React.createElement(
|
|
153
|
-
|
|
156
|
+
className: style.leftBox
|
|
157
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
158
|
+
className: style.titleBox
|
|
154
159
|
}, value ? /*#__PURE__*/React.createElement(Box, {
|
|
160
|
+
shrink: true,
|
|
161
|
+
adjust: true,
|
|
155
162
|
"data-title": isDisabled ? null : title,
|
|
156
163
|
className: needMultiLineText ? style.multiLineValue : style.value
|
|
157
|
-
}, value) : null,
|
|
164
|
+
}, value) : null, isRenderable(renderValueRightPlaceholderNode) ? /*#__PURE__*/React.createElement(Box, {
|
|
165
|
+
className: customValueRightPlaceholder
|
|
166
|
+
}, renderNode(renderValueRightPlaceholderNode)) : null), secondaryValue ? /*#__PURE__*/React.createElement(Box, {
|
|
158
167
|
"data-title": isDisabled ? null : secondaryValue,
|
|
159
168
|
className: `${style.secondaryField} ${needMultiLineText ? style.multiLine : style.secondaryValue}`
|
|
160
|
-
}, secondaryValue) : null)
|
|
169
|
+
}, secondaryValue) : null), needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
161
170
|
className: style.tickIcon,
|
|
162
171
|
"aria-hidden": ariaHidden,
|
|
163
172
|
dataId: `${dataIdString}_tickIcon`,
|