@zohodesk/dot 1.0.0-temp-210.1 → 1.0.0-temp-211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cli/propValidation_report.html +1 -1
- package/README.md +5 -0
- package/es/ActionButton/__tests__/ActionButton.spec.js +353 -2
- package/es/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +2633 -1
- package/es/Drawer/Drawer.js +2 -10
- package/es/Drawer/__tests__/Content.spec.js +24 -0
- package/es/Drawer/__tests__/Drawer.spec.js +130 -4
- package/es/Drawer/__tests__/Footer.spec.js +34 -0
- package/es/Drawer/__tests__/Header.spec.js +173 -0
- package/es/Drawer/__tests__/__snapshots__/Content.spec.js.snap +127 -0
- package/es/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +535 -2
- package/es/Drawer/__tests__/__snapshots__/Footer.spec.js.snap +1233 -0
- package/es/Drawer/__tests__/__snapshots__/Header.spec.js.snap +782 -0
- package/es/Drawer/props/defaultProps.js +1 -5
- package/es/Drawer/props/propTypes.js +1 -5
- package/es/FlipCard/__tests__/FlipCard.spec.js +606 -2
- package/es/FlipCard/__tests__/__snapshots__/FlipCard.spec.js.snap +6626 -1
- package/es/FreezeLayer/FreezeLayer.js +3 -11
- package/es/FreezeLayer/props/defaultProps.js +1 -5
- package/es/FreezeLayer/props/propTypes.js +1 -5
- package/es/Link/__tests__/Link.spec.js +123 -3
- package/es/Link/__tests__/__snapshots__/Link.spec.js.snap +142 -2
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +8 -2
- package/es/list/ListStencils/ListStencils.js +7 -2
- package/es/list/ListStencils/__tests__/ListStencils.spec.js +9 -0
- package/es/list/ListStencils/__tests__/__snapshots__/ListStencils.spec.js.snap +46 -0
- package/es/list/ListStencils/props/propTypes.js +3 -1
- package/lib/ActionButton/__tests__/ActionButton.spec.js +354 -1
- package/lib/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +2633 -1
- package/lib/Drawer/Drawer.js +2 -10
- package/lib/Drawer/__tests__/Content.spec.js +35 -0
- package/lib/Drawer/__tests__/Drawer.spec.js +132 -5
- package/lib/Drawer/__tests__/Footer.spec.js +41 -0
- package/lib/Drawer/__tests__/Header.spec.js +192 -0
- package/lib/Drawer/__tests__/__snapshots__/Content.spec.js.snap +127 -0
- package/lib/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +535 -2
- package/lib/Drawer/__tests__/__snapshots__/Footer.spec.js.snap +1233 -0
- package/lib/Drawer/__tests__/__snapshots__/Header.spec.js.snap +782 -0
- package/lib/Drawer/props/defaultProps.js +1 -5
- package/lib/Drawer/props/propTypes.js +1 -5
- package/lib/FlipCard/__tests__/FlipCard.spec.js +613 -1
- package/lib/FlipCard/__tests__/__snapshots__/FlipCard.spec.js.snap +6626 -1
- package/lib/FreezeLayer/FreezeLayer.js +3 -11
- package/lib/FreezeLayer/props/defaultProps.js +1 -5
- package/lib/FreezeLayer/props/propTypes.js +1 -5
- package/lib/Link/__tests__/Link.spec.js +130 -4
- package/lib/Link/__tests__/__snapshots__/Link.spec.js.snap +142 -2
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +12 -6
- package/lib/list/ListStencils/ListStencils.js +8 -2
- package/lib/list/ListStencils/__tests__/ListStencils.spec.js +9 -0
- package/lib/list/ListStencils/__tests__/__snapshots__/ListStencils.spec.js.snap +46 -0
- package/lib/list/ListStencils/props/propTypes.js +3 -1
- package/package.json +6 -6
- package/result.json +1 -0
- package/unittest/index.html +45 -0
|
@@ -39,11 +39,7 @@ function FreezeLayer(props) {
|
|
|
39
39
|
forwardRef = props.forwardRef,
|
|
40
40
|
isSvgMask = props.isSvgMask,
|
|
41
41
|
needAutoZindex = props.needAutoZindex,
|
|
42
|
-
customStyle = props.customStyle
|
|
43
|
-
onParentAnimateComplete = props.onParentAnimateComplete,
|
|
44
|
-
onChildAnimateComplete = props.onChildAnimateComplete,
|
|
45
|
-
postAnimateParentStyles = props.postAnimateParentStyles,
|
|
46
|
-
postAnimateChildStyles = props.postAnimateChildStyles;
|
|
42
|
+
customStyle = props.customStyle;
|
|
47
43
|
var finalStyle = (0, _utils.mergeStyle)(_FreezeLayerModule["default"], customStyle);
|
|
48
44
|
|
|
49
45
|
var _cssJSLogic = (0, _cssJSLogic2["default"])({
|
|
@@ -65,9 +61,7 @@ function FreezeLayer(props) {
|
|
|
65
61
|
return /*#__PURE__*/_react["default"].createElement(_VelocityAnimationGroup["default"], {
|
|
66
62
|
name: animationName && animationName,
|
|
67
63
|
isActive: isActive,
|
|
68
|
-
runOnMount: runOnMount
|
|
69
|
-
onEnterComplete: onParentAnimateComplete,
|
|
70
|
-
postEnterStyles: postAnimateParentStyles
|
|
64
|
+
runOnMount: runOnMount
|
|
71
65
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
72
66
|
style: isActive && needAutoZindex ? {
|
|
73
67
|
zIndex: "".concat(getNextIndex())
|
|
@@ -83,9 +77,7 @@ function FreezeLayer(props) {
|
|
|
83
77
|
component: _Layout.Container,
|
|
84
78
|
alignBox: "row",
|
|
85
79
|
align: align,
|
|
86
|
-
dataId: "reactFreezeLayer"
|
|
87
|
-
onEnterComplete: onChildAnimateComplete,
|
|
88
|
-
postEnterStyles: postAnimateChildStyles
|
|
80
|
+
dataId: "reactFreezeLayer"
|
|
89
81
|
}, children) : isSvgMask ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children) : /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
90
82
|
alignBox: "row",
|
|
91
83
|
align: align,
|
|
@@ -11,10 +11,6 @@ var defaultProps = {
|
|
|
11
11
|
isSvgMask: false,
|
|
12
12
|
customClass: '',
|
|
13
13
|
customStyle: {},
|
|
14
|
-
needAutoZindex: true
|
|
15
|
-
onParentAnimateComplete: function onParentAnimateComplete() {},
|
|
16
|
-
onChildAnimateComplete: function onChildAnimateComplete() {},
|
|
17
|
-
postAnimateParentStyles: {},
|
|
18
|
-
postAnimateChildStyles: {}
|
|
14
|
+
needAutoZindex: true
|
|
19
15
|
};
|
|
20
16
|
exports.defaultProps = defaultProps;
|
|
@@ -24,11 +24,7 @@ var propTypes = {
|
|
|
24
24
|
palette: _propTypes["default"].oneOf(['dark', 'default', 'darkLight', 'plain', 'snow']),
|
|
25
25
|
runOnMount: _propTypes["default"].bool,
|
|
26
26
|
customStyle: _propTypes["default"].object,
|
|
27
|
-
zIndex: _propTypes["default"].oneOf(['3', '5', '7', '10'])
|
|
28
|
-
onParentAnimateComplete: _propTypes["default"].func,
|
|
29
|
-
onChildAnimateComplete: _propTypes["default"].func,
|
|
30
|
-
postAnimateParentStyles: _propTypes["default"].object,
|
|
31
|
-
postAnimateChildStyles: _propTypes["default"].object
|
|
27
|
+
zIndex: _propTypes["default"].oneOf(['3', '5', '7', '10'])
|
|
32
28
|
};
|
|
33
29
|
exports.propTypes = propTypes;
|
|
34
30
|
var _default = propTypes;
|
|
@@ -6,12 +6,138 @@ var _react2 = require("@testing-library/react");
|
|
|
6
6
|
|
|
7
7
|
var _Link = _interopRequireDefault(require("../Link"));
|
|
8
8
|
|
|
9
|
+
var _LinkContext = _interopRequireDefault(require("../LinkContext"));
|
|
10
|
+
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
12
|
|
|
11
|
-
describe('Link', function () {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
describe('Link Component Snapshot Tests', function () {
|
|
14
|
+
var targetOptions = ['_blank', '_self'];
|
|
15
|
+
var mockContextOptions = {
|
|
16
|
+
options: {
|
|
17
|
+
isLink: true,
|
|
18
|
+
constructURL: jest.fn(function (urlName, urlData) {
|
|
19
|
+
return "https://zoho.com/".concat(urlName, "/").concat(urlData || '');
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var renderWithProvider = function renderWithProvider(component) {
|
|
25
|
+
return (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_LinkContext["default"].Provider, {
|
|
26
|
+
value: mockContextOptions
|
|
27
|
+
}, component));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
test('renders with default props', function () {
|
|
31
|
+
var _renderWithProvider = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], null)),
|
|
32
|
+
asFragment = _renderWithProvider.asFragment;
|
|
33
|
+
|
|
34
|
+
expect(asFragment()).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
test('renders with children content', function () {
|
|
37
|
+
var _renderWithProvider2 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], null, "Click Here")),
|
|
38
|
+
asFragment = _renderWithProvider2.asFragment;
|
|
39
|
+
|
|
40
|
+
expect(asFragment()).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
test('renders with href prop', function () {
|
|
43
|
+
var _renderWithProvider3 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
44
|
+
href: "https://zoho.com"
|
|
45
|
+
})),
|
|
46
|
+
asFragment = _renderWithProvider3.asFragment;
|
|
47
|
+
|
|
48
|
+
expect(asFragment()).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
test.each(targetOptions)('renders with target - %s', function (target) {
|
|
51
|
+
var _renderWithProvider4 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
52
|
+
target: target
|
|
53
|
+
})),
|
|
54
|
+
asFragment = _renderWithProvider4.asFragment;
|
|
55
|
+
|
|
56
|
+
expect(asFragment()).toMatchSnapshot();
|
|
57
|
+
});
|
|
58
|
+
test('renders with urlName and urlData using provider', function () {
|
|
59
|
+
var _renderWithProvider5 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
60
|
+
urlName: "profile",
|
|
61
|
+
urlData: {
|
|
62
|
+
id: 123
|
|
63
|
+
}
|
|
64
|
+
})),
|
|
65
|
+
asFragment = _renderWithProvider5.asFragment;
|
|
66
|
+
|
|
67
|
+
expect(mockContextOptions.options.constructURL).toHaveBeenCalledWith('profile', {
|
|
68
|
+
id: 123
|
|
69
|
+
});
|
|
70
|
+
expect(asFragment()).toMatchSnapshot();
|
|
71
|
+
});
|
|
72
|
+
test('renders with urlName and undefined urlData using provider', function () {
|
|
73
|
+
var _renderWithProvider6 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
74
|
+
urlName: "profile"
|
|
75
|
+
})),
|
|
76
|
+
asFragment = _renderWithProvider6.asFragment;
|
|
77
|
+
|
|
78
|
+
expect(mockContextOptions.options.constructURL).toHaveBeenCalledWith('profile', undefined);
|
|
79
|
+
expect(asFragment()).toMatchSnapshot();
|
|
80
|
+
});
|
|
81
|
+
test('renders with urlName and urlData as undefined using provider', function () {
|
|
82
|
+
var _renderWithProvider7 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
83
|
+
urlName: undefined,
|
|
84
|
+
urlData: undefined
|
|
85
|
+
})),
|
|
86
|
+
asFragment = _renderWithProvider7.asFragment;
|
|
87
|
+
|
|
88
|
+
expect(mockContextOptions.options.constructURL).toHaveBeenCalledWith(undefined, undefined);
|
|
89
|
+
expect(asFragment()).toMatchSnapshot();
|
|
90
|
+
});
|
|
91
|
+
test('renders with custom className', function () {
|
|
92
|
+
var _renderWithProvider8 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
93
|
+
className: "custom-link"
|
|
94
|
+
})),
|
|
95
|
+
asFragment = _renderWithProvider8.asFragment;
|
|
96
|
+
|
|
97
|
+
expect(asFragment()).toMatchSnapshot();
|
|
98
|
+
});
|
|
99
|
+
test('renders with title prop', function () {
|
|
100
|
+
var _renderWithProvider9 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
101
|
+
title: "Example Title"
|
|
102
|
+
})),
|
|
103
|
+
asFragment = _renderWithProvider9.asFragment;
|
|
104
|
+
|
|
105
|
+
expect(asFragment()).toMatchSnapshot();
|
|
106
|
+
});
|
|
107
|
+
test('renders with download attribute', function () {
|
|
108
|
+
var _renderWithProvider10 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
109
|
+
download: true
|
|
110
|
+
})),
|
|
111
|
+
asFragment = _renderWithProvider10.asFragment;
|
|
112
|
+
|
|
113
|
+
expect(asFragment()).toMatchSnapshot();
|
|
114
|
+
});
|
|
115
|
+
test('renders with rel attribute', function () {
|
|
116
|
+
var _renderWithProvider11 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
117
|
+
rel: "noopener noreferrer"
|
|
118
|
+
})),
|
|
119
|
+
asFragment = _renderWithProvider11.asFragment;
|
|
120
|
+
|
|
121
|
+
expect(asFragment()).toMatchSnapshot();
|
|
122
|
+
});
|
|
123
|
+
test('renders with dataId prop', function () {
|
|
124
|
+
var _renderWithProvider12 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
125
|
+
dataId: "test-id"
|
|
126
|
+
})),
|
|
127
|
+
asFragment = _renderWithProvider12.asFragment;
|
|
128
|
+
|
|
129
|
+
expect(asFragment()).toMatchSnapshot();
|
|
130
|
+
});
|
|
131
|
+
test('renders with customProps', function () {
|
|
132
|
+
var customProps = {
|
|
133
|
+
'data-custom': 'customValue',
|
|
134
|
+
'data-id': 'uniqueId'
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
var _renderWithProvider13 = renderWithProvider( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
138
|
+
customProps: customProps
|
|
139
|
+
})),
|
|
140
|
+
asFragment = _renderWithProvider13.asFragment;
|
|
15
141
|
|
|
16
142
|
expect(asFragment()).toMatchSnapshot();
|
|
17
143
|
});
|
|
@@ -1,10 +1,150 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Link
|
|
3
|
+
exports[`Link Component Snapshot Tests renders with children content 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<a
|
|
6
6
|
class="container "
|
|
7
|
-
href="
|
|
7
|
+
href="https://zoho.com/undefined/"
|
|
8
|
+
rel="noopener noreferrer"
|
|
9
|
+
>
|
|
10
|
+
Click Here
|
|
11
|
+
</a>
|
|
12
|
+
</DocumentFragment>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`Link Component Snapshot Tests renders with custom className 1`] = `
|
|
16
|
+
<DocumentFragment>
|
|
17
|
+
<a
|
|
18
|
+
class="container custom-link"
|
|
19
|
+
href="https://zoho.com/undefined/"
|
|
20
|
+
rel="noopener noreferrer"
|
|
21
|
+
/>
|
|
22
|
+
</DocumentFragment>
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
exports[`Link Component Snapshot Tests renders with customProps 1`] = `
|
|
26
|
+
<DocumentFragment>
|
|
27
|
+
<a
|
|
28
|
+
class="container "
|
|
29
|
+
data-custom="customValue"
|
|
30
|
+
data-id="uniqueId"
|
|
31
|
+
href="https://zoho.com/undefined/"
|
|
32
|
+
rel="noopener noreferrer"
|
|
33
|
+
/>
|
|
34
|
+
</DocumentFragment>
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
exports[`Link Component Snapshot Tests renders with dataId prop 1`] = `
|
|
38
|
+
<DocumentFragment>
|
|
39
|
+
<a
|
|
40
|
+
class="container "
|
|
41
|
+
data-id="test-id"
|
|
42
|
+
data-test-id="test-id"
|
|
43
|
+
href="https://zoho.com/undefined/"
|
|
44
|
+
rel="noopener noreferrer"
|
|
45
|
+
/>
|
|
46
|
+
</DocumentFragment>
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
exports[`Link Component Snapshot Tests renders with default props 1`] = `
|
|
50
|
+
<DocumentFragment>
|
|
51
|
+
<a
|
|
52
|
+
class="container "
|
|
53
|
+
href="https://zoho.com/undefined/"
|
|
54
|
+
rel="noopener noreferrer"
|
|
55
|
+
/>
|
|
56
|
+
</DocumentFragment>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`Link Component Snapshot Tests renders with download attribute 1`] = `
|
|
60
|
+
<DocumentFragment>
|
|
61
|
+
<a
|
|
62
|
+
class="container "
|
|
63
|
+
download=""
|
|
64
|
+
href="https://zoho.com/undefined/"
|
|
65
|
+
rel="noopener noreferrer"
|
|
66
|
+
/>
|
|
67
|
+
</DocumentFragment>
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
exports[`Link Component Snapshot Tests renders with href prop 1`] = `
|
|
71
|
+
<DocumentFragment>
|
|
72
|
+
<a
|
|
73
|
+
class="container "
|
|
74
|
+
href="https://zoho.com"
|
|
75
|
+
rel="noopener noreferrer"
|
|
76
|
+
/>
|
|
77
|
+
</DocumentFragment>
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
exports[`Link Component Snapshot Tests renders with rel attribute 1`] = `
|
|
81
|
+
<DocumentFragment>
|
|
82
|
+
<a
|
|
83
|
+
class="container "
|
|
84
|
+
href="https://zoho.com/undefined/"
|
|
85
|
+
rel="noopener noreferrer"
|
|
86
|
+
/>
|
|
87
|
+
</DocumentFragment>
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
exports[`Link Component Snapshot Tests renders with target - _blank 1`] = `
|
|
91
|
+
<DocumentFragment>
|
|
92
|
+
<a
|
|
93
|
+
class="container "
|
|
94
|
+
href="https://zoho.com/undefined/"
|
|
95
|
+
rel="noopener noreferrer"
|
|
96
|
+
target="_blank"
|
|
97
|
+
/>
|
|
98
|
+
</DocumentFragment>
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`Link Component Snapshot Tests renders with target - _self 1`] = `
|
|
102
|
+
<DocumentFragment>
|
|
103
|
+
<a
|
|
104
|
+
class="container "
|
|
105
|
+
href="https://zoho.com/undefined/"
|
|
106
|
+
rel="noopener noreferrer"
|
|
107
|
+
target="_self"
|
|
108
|
+
/>
|
|
109
|
+
</DocumentFragment>
|
|
110
|
+
`;
|
|
111
|
+
|
|
112
|
+
exports[`Link Component Snapshot Tests renders with title prop 1`] = `
|
|
113
|
+
<DocumentFragment>
|
|
114
|
+
<a
|
|
115
|
+
class="container "
|
|
116
|
+
data-title="Example Title"
|
|
117
|
+
href="https://zoho.com/undefined/"
|
|
118
|
+
rel="noopener noreferrer"
|
|
119
|
+
/>
|
|
120
|
+
</DocumentFragment>
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
exports[`Link Component Snapshot Tests renders with urlName and undefined urlData using provider 1`] = `
|
|
124
|
+
<DocumentFragment>
|
|
125
|
+
<a
|
|
126
|
+
class="container "
|
|
127
|
+
href="https://zoho.com/profile/"
|
|
128
|
+
rel="noopener noreferrer"
|
|
129
|
+
/>
|
|
130
|
+
</DocumentFragment>
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
exports[`Link Component Snapshot Tests renders with urlName and urlData as undefined using provider 1`] = `
|
|
134
|
+
<DocumentFragment>
|
|
135
|
+
<a
|
|
136
|
+
class="container "
|
|
137
|
+
href="https://zoho.com/undefined/"
|
|
138
|
+
rel="noopener noreferrer"
|
|
139
|
+
/>
|
|
140
|
+
</DocumentFragment>
|
|
141
|
+
`;
|
|
142
|
+
|
|
143
|
+
exports[`Link Component Snapshot Tests renders with urlName and urlData using provider 1`] = `
|
|
144
|
+
<DocumentFragment>
|
|
145
|
+
<a
|
|
146
|
+
class="container "
|
|
147
|
+
href="https://zoho.com/profile/[object Object]"
|
|
8
148
|
rel="noopener noreferrer"
|
|
9
149
|
/>
|
|
10
150
|
</DocumentFragment>
|
|
@@ -783,7 +783,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
783
783
|
_item$disableTitle = item.disableTitle,
|
|
784
784
|
disableTitle = _item$disableTitle === void 0 ? '' : _item$disableTitle,
|
|
785
785
|
_item$isDisabled = item.isDisabled,
|
|
786
|
-
isDisabled = _item$isDisabled === void 0 ? false : _item$isDisabled
|
|
786
|
+
isDisabled = _item$isDisabled === void 0 ? false : _item$isDisabled,
|
|
787
|
+
secondaryValue = item.secondaryValue;
|
|
787
788
|
listIndex += 1;
|
|
788
789
|
return iconName ? /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], _extends({
|
|
789
790
|
key: listIndex,
|
|
@@ -811,7 +812,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
811
812
|
role: isSearch ? 'option' : 'menuitem',
|
|
812
813
|
ariaSelected: selectedId === item[idName],
|
|
813
814
|
ariaLabel: item[keyName]
|
|
814
|
-
}
|
|
815
|
+
},
|
|
816
|
+
secondaryValue: secondaryValue
|
|
815
817
|
}, ListItemWithIconProps)) : /*#__PURE__*/_react["default"].createElement(_ListItem["default"], _extends({
|
|
816
818
|
key: listIndex,
|
|
817
819
|
dataId: item[keyName],
|
|
@@ -835,7 +837,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
835
837
|
role: isSearch ? 'option' : 'menuitem',
|
|
836
838
|
ariaSelected: selectedId === item[idName],
|
|
837
839
|
ariaLabel: item[keyName]
|
|
838
|
-
}
|
|
840
|
+
},
|
|
841
|
+
secondaryValue: secondaryValue
|
|
839
842
|
}, ListItemProps));
|
|
840
843
|
}));
|
|
841
844
|
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -850,7 +853,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
850
853
|
_item$isDisabled2 = item.isDisabled,
|
|
851
854
|
isDisabled = _item$isDisabled2 === void 0 ? false : _item$isDisabled2,
|
|
852
855
|
_item$disableTitle2 = item.disableTitle,
|
|
853
|
-
disableTitle = _item$disableTitle2 === void 0 ? '' : _item$disableTitle2
|
|
856
|
+
disableTitle = _item$disableTitle2 === void 0 ? '' : _item$disableTitle2,
|
|
857
|
+
secondaryValue = item.secondaryValue;
|
|
854
858
|
|
|
855
859
|
if (!needDivider) {
|
|
856
860
|
listIndex += 1;
|
|
@@ -886,7 +890,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
886
890
|
role: isSearch ? 'option' : 'menuitem',
|
|
887
891
|
ariaSelected: selectedId === item[idName],
|
|
888
892
|
ariaLabel: item[keyName]
|
|
889
|
-
}
|
|
893
|
+
},
|
|
894
|
+
secondaryValue: secondaryValue
|
|
890
895
|
}, ListItemWithIconProps)) : /*#__PURE__*/_react["default"].createElement(_ListItem["default"], _extends({
|
|
891
896
|
key: listIndex,
|
|
892
897
|
dataId: item[keyName],
|
|
@@ -910,7 +915,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
910
915
|
role: isSearch ? 'option' : 'menuitem',
|
|
911
916
|
ariaSelected: selectedId === item[idName],
|
|
912
917
|
ariaLabel: item[keyName]
|
|
913
|
-
}
|
|
918
|
+
},
|
|
919
|
+
secondaryValue: secondaryValue
|
|
914
920
|
}, ListItemProps)));
|
|
915
921
|
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
916
922
|
isCover: false,
|
|
@@ -57,9 +57,15 @@ var ListStencils = /*#__PURE__*/function (_Component) {
|
|
|
57
57
|
_createClass(ListStencils, [{
|
|
58
58
|
key: "render",
|
|
59
59
|
value: function render() {
|
|
60
|
-
var
|
|
60
|
+
var _this$props = this.props,
|
|
61
|
+
listType = _this$props.listType,
|
|
62
|
+
testId = _this$props.testId,
|
|
63
|
+
customId = _this$props.customId;
|
|
61
64
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
|
-
className: "".concat(_ListStencilsModule["default"].container, " ").concat(_ListStencilsModule["default"][listType])
|
|
65
|
+
className: "".concat(_ListStencilsModule["default"].container, " ").concat(_ListStencilsModule["default"][listType]),
|
|
66
|
+
"data-test-id": testId ? testId + '_listStencils' : null,
|
|
67
|
+
"data-id": customId ? customId + '_listStencils' : null,
|
|
68
|
+
"aria-hidden": "true"
|
|
63
69
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
64
70
|
className: _ListStencilsModule["default"].innerContainer
|
|
65
71
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -15,4 +15,13 @@ describe('ListStencils', function () {
|
|
|
15
15
|
|
|
16
16
|
expect(asFragment()).toMatchSnapshot();
|
|
17
17
|
});
|
|
18
|
+
test('customId and testId', function () {
|
|
19
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ListStencils["default"], {
|
|
20
|
+
testId: "ticket",
|
|
21
|
+
customId: "contact"
|
|
22
|
+
})),
|
|
23
|
+
asFragment = _render2.asFragment;
|
|
24
|
+
|
|
25
|
+
expect(asFragment()).toMatchSnapshot();
|
|
26
|
+
});
|
|
18
27
|
});
|
|
@@ -1,8 +1,54 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`ListStencils customId and testId 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
class="container classic"
|
|
8
|
+
data-id="contact_listStencils"
|
|
9
|
+
data-test-id="ticket_listStencils"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="innerContainer"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="avatar"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="container circle clarge primary "
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
class="detailsColumn"
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
class="detailsInnerColumn"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="primaryRow"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
class="container rectangular default primary "
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<div
|
|
35
|
+
class="secondaryRow"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
class="container rectangular medium primary "
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</DocumentFragment>
|
|
46
|
+
`;
|
|
47
|
+
|
|
3
48
|
exports[`ListStencils rendering the defult props 1`] = `
|
|
4
49
|
<DocumentFragment>
|
|
5
50
|
<div
|
|
51
|
+
aria-hidden="true"
|
|
6
52
|
class="container classic"
|
|
7
53
|
>
|
|
8
54
|
<div
|
|
@@ -10,6 +10,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
12
|
var propTypes = {
|
|
13
|
-
listType: _propTypes["default"].oneOf(['classic', 'compact', 'superCompact'])
|
|
13
|
+
listType: _propTypes["default"].oneOf(['classic', 'compact', 'superCompact']),
|
|
14
|
+
customId: _propTypes["default"].string,
|
|
15
|
+
testId: _propTypes["default"].string
|
|
14
16
|
};
|
|
15
17
|
exports.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/dot",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-211",
|
|
4
4
|
"main": "lib/index",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"sstest": "react-cli sstest",
|
|
38
38
|
"common_package_build": "cd ../common && npm run build && cd ../dot",
|
|
39
39
|
"docs": "npm run css:review && review:props && react-cli docs",
|
|
40
|
-
"prepublishOnly": "node prePublish.js && npm run download && npm run css:review
|
|
40
|
+
"prepublishOnly": "node prePublish.js && npm run download && npm run css:review",
|
|
41
41
|
"postpublish": "node postPublish.js",
|
|
42
42
|
"test-clean": "react-cli clean coverage && react-cli clean ./unittest",
|
|
43
43
|
"download": "react-cli clean ./node_modules ./package-lock.json && npm install",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"@zohodesk-private/node-plugins": "1.1.8",
|
|
64
64
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
65
65
|
"@zohodesk/a11y": "2.3.4",
|
|
66
|
-
"@zohodesk/components": "1.
|
|
66
|
+
"@zohodesk/components": "1.3.1",
|
|
67
67
|
"@zohodesk/hooks": "2.0.5",
|
|
68
|
-
"@zohodesk/icons": "1.0.
|
|
68
|
+
"@zohodesk/icons": "1.0.78",
|
|
69
69
|
"@zohodesk/layout": "^3.1.0",
|
|
70
70
|
"@zohodesk/svg": "1.1.22",
|
|
71
71
|
"@zohodesk/utils": "1.3.14",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"velocity-react": "1.4.3",
|
|
79
79
|
"@zohodesk/variables": "1.0.0",
|
|
80
|
-
"@zohodesk/components": "1.
|
|
81
|
-
"@zohodesk/icons": "1.0.
|
|
80
|
+
"@zohodesk/components": "1.3.1",
|
|
81
|
+
"@zohodesk/icons": "1.0.78",
|
|
82
82
|
"@zohodesk/svg": "1.1.22",
|
|
83
83
|
"@zohodesk/virtualizer": "1.0.3",
|
|
84
84
|
"react-sortable-hoc": "^0.8.3",
|