@zohodesk/components 1.6.27 → 1.6.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/es/DividerLine/DividerLine.js +40 -0
- package/es/DividerLine/__tests__/DividerLine.spec.js +81 -0
- package/es/DividerLine/__tests__/__snapshots__/DividerLine.spec.js.snap +131 -0
- package/es/DividerLine/constants/index.js +29 -0
- package/es/DividerLine/css/DividerLine.module.css +52 -0
- package/es/DividerLine/css/cssJSLogic.js +1 -0
- package/es/DividerLine/css/dividerLine.cva.js +42 -0
- package/es/DividerLine/props/defaultProps.js +11 -0
- package/es/DividerLine/props/propTypes.js +19 -0
- package/es/DropDown/DropDownSeparator.js +9 -4
- package/es/DropDown/DropDownSeparator.module.css +0 -4
- package/es/DropDown/__tests__/DropDownSeparator.spec.js +8 -0
- package/es/DropDown/__tests__/__snapshots__/DropDownSeparator.spec.js.snap +12 -2
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +1 -0
- package/es/MultiSelect/AdvancedMultiSelect.js +1 -0
- package/es/MultiSelect/SelectedOptions.js +3 -3
- package/es/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +42 -0
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +10 -0
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +10 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +121 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +97 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +157 -0
- package/es/Select/SelectWithAvatar.js +14 -3
- package/es/Select/SelectWithIcon.js +23 -1
- package/es/Select/__tests__/SelectWithAvatar.spec.js +17 -0
- package/es/Select/__tests__/SelectWithIcon.spec.js +18 -0
- package/es/Select/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +47 -0
- package/es/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +19 -0
- package/es/Select/props/propTypes.js +1 -0
- package/es/Tooltip/Tooltip.js +4 -1
- package/lib/DividerLine/DividerLine.js +50 -0
- package/lib/DividerLine/__tests__/DividerLine.spec.js +88 -0
- package/lib/DividerLine/__tests__/__snapshots__/DividerLine.spec.js.snap +131 -0
- package/lib/DividerLine/constants/index.js +39 -0
- package/lib/DividerLine/css/DividerLine.module.css +52 -0
- package/lib/DividerLine/css/cssJSLogic.js +13 -0
- package/lib/DividerLine/css/dividerLine.cva.js +57 -0
- package/lib/DividerLine/props/defaultProps.js +21 -0
- package/lib/DividerLine/props/propTypes.js +31 -0
- package/lib/DropDown/DropDownSeparator.js +9 -4
- package/lib/DropDown/DropDownSeparator.module.css +0 -4
- package/lib/DropDown/__tests__/DropDownSeparator.spec.js +8 -0
- package/lib/DropDown/__tests__/__snapshots__/DropDownSeparator.spec.js.snap +12 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +1 -0
- package/lib/MultiSelect/AdvancedMultiSelect.js +1 -0
- package/lib/MultiSelect/SelectedOptions.js +3 -3
- package/lib/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +42 -0
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +10 -0
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +10 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +121 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +97 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +157 -0
- package/lib/Select/SelectWithAvatar.js +15 -3
- package/lib/Select/SelectWithIcon.js +26 -1
- package/lib/Select/__tests__/SelectWithAvatar.spec.js +20 -0
- package/lib/Select/__tests__/SelectWithIcon.spec.js +21 -0
- package/lib/Select/__tests__/__snapshots__/SelectWithAvatar.spec.js.snap +47 -0
- package/lib/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +19 -0
- package/lib/Select/props/propTypes.js +1 -0
- package/lib/Tooltip/Tooltip.js +6 -1
- package/package.json +10 -10
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _DividerLine = _interopRequireDefault(require("../DividerLine"));
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
|
|
11
|
+
describe('DividerLine - Snapshot', function () {
|
|
12
|
+
afterEach(function () {
|
|
13
|
+
(0, _react2.cleanup)();
|
|
14
|
+
});
|
|
15
|
+
test('Render with default props', function () {
|
|
16
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], null)),
|
|
17
|
+
asFragment = _render.asFragment;
|
|
18
|
+
|
|
19
|
+
expect(asFragment()).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
test.each(['horizontal', 'vertical'])('Render with orientation as %s', function (orientation) {
|
|
22
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
23
|
+
orientation: orientation
|
|
24
|
+
})),
|
|
25
|
+
asFragment = _render2.asFragment;
|
|
26
|
+
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
test.each(['solid', 'dashed', 'dotted'])('Render with lineStyle as %s', function (lineStyle) {
|
|
30
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
31
|
+
lineStyle: lineStyle
|
|
32
|
+
})),
|
|
33
|
+
asFragment = _render3.asFragment;
|
|
34
|
+
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test.each(['default', 'secondary', 'tertiary', 'brand'])('Render with color as %s', function (color) {
|
|
38
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
39
|
+
color: color
|
|
40
|
+
})),
|
|
41
|
+
asFragment = _render4.asFragment;
|
|
42
|
+
|
|
43
|
+
expect(asFragment()).toMatchSnapshot();
|
|
44
|
+
});
|
|
45
|
+
test('Render with customId and testId', function () {
|
|
46
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
47
|
+
customId: "divider-line-customId",
|
|
48
|
+
testId: "divider-line-testId"
|
|
49
|
+
})),
|
|
50
|
+
asFragment = _render5.asFragment;
|
|
51
|
+
|
|
52
|
+
expect(asFragment()).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
test('Render with customAttributes', function () {
|
|
55
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
56
|
+
customAttributes: {
|
|
57
|
+
wrapper: {
|
|
58
|
+
'data-custom-attr': 'true'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})),
|
|
62
|
+
asFragment = _render6.asFragment;
|
|
63
|
+
|
|
64
|
+
expect(asFragment()).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
test('Render with a11yAttributes', function () {
|
|
67
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
68
|
+
a11yAttributes: {
|
|
69
|
+
wrapper: {
|
|
70
|
+
'aria-label': 'Section divider'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
})),
|
|
74
|
+
asFragment = _render7.asFragment;
|
|
75
|
+
|
|
76
|
+
expect(asFragment()).toMatchSnapshot();
|
|
77
|
+
});
|
|
78
|
+
test('Render with customClass', function () {
|
|
79
|
+
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
80
|
+
customClass: {
|
|
81
|
+
wrapper: 'my-divider-line'
|
|
82
|
+
}
|
|
83
|
+
})),
|
|
84
|
+
asFragment = _render8.asFragment;
|
|
85
|
+
|
|
86
|
+
expect(asFragment()).toMatchSnapshot();
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
+
|
|
3
|
+
exports[`DividerLine - Snapshot Render with a11yAttributes 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<hr
|
|
6
|
+
aria-label="Section divider"
|
|
7
|
+
aria-orientation="horizontal"
|
|
8
|
+
class="wrapper horizontal solid colorDefault"
|
|
9
|
+
/>
|
|
10
|
+
</DocumentFragment>
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
exports[`DividerLine - Snapshot Render with color as brand 1`] = `
|
|
14
|
+
<DocumentFragment>
|
|
15
|
+
<hr
|
|
16
|
+
aria-orientation="horizontal"
|
|
17
|
+
class="wrapper horizontal solid colorBrand"
|
|
18
|
+
/>
|
|
19
|
+
</DocumentFragment>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`DividerLine - Snapshot Render with color as default 1`] = `
|
|
23
|
+
<DocumentFragment>
|
|
24
|
+
<hr
|
|
25
|
+
aria-orientation="horizontal"
|
|
26
|
+
class="wrapper horizontal solid colorDefault"
|
|
27
|
+
/>
|
|
28
|
+
</DocumentFragment>
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports[`DividerLine - Snapshot Render with color as secondary 1`] = `
|
|
32
|
+
<DocumentFragment>
|
|
33
|
+
<hr
|
|
34
|
+
aria-orientation="horizontal"
|
|
35
|
+
class="wrapper horizontal solid colorSecondary"
|
|
36
|
+
/>
|
|
37
|
+
</DocumentFragment>
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
exports[`DividerLine - Snapshot Render with color as tertiary 1`] = `
|
|
41
|
+
<DocumentFragment>
|
|
42
|
+
<hr
|
|
43
|
+
aria-orientation="horizontal"
|
|
44
|
+
class="wrapper horizontal solid colorTertiary"
|
|
45
|
+
/>
|
|
46
|
+
</DocumentFragment>
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
exports[`DividerLine - Snapshot Render with customAttributes 1`] = `
|
|
50
|
+
<DocumentFragment>
|
|
51
|
+
<hr
|
|
52
|
+
aria-orientation="horizontal"
|
|
53
|
+
class="wrapper horizontal solid colorDefault"
|
|
54
|
+
data-custom-attr="true"
|
|
55
|
+
/>
|
|
56
|
+
</DocumentFragment>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`DividerLine - Snapshot Render with customClass 1`] = `
|
|
60
|
+
<DocumentFragment>
|
|
61
|
+
<hr
|
|
62
|
+
aria-orientation="horizontal"
|
|
63
|
+
class="wrapper horizontal solid colorDefault my-divider-line"
|
|
64
|
+
/>
|
|
65
|
+
</DocumentFragment>
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
exports[`DividerLine - Snapshot Render with customId and testId 1`] = `
|
|
69
|
+
<DocumentFragment>
|
|
70
|
+
<hr
|
|
71
|
+
aria-orientation="horizontal"
|
|
72
|
+
class="wrapper horizontal solid colorDefault"
|
|
73
|
+
data-id="divider-line-customId"
|
|
74
|
+
data-test-id="divider-line-testId"
|
|
75
|
+
/>
|
|
76
|
+
</DocumentFragment>
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
exports[`DividerLine - Snapshot Render with default props 1`] = `
|
|
80
|
+
<DocumentFragment>
|
|
81
|
+
<hr
|
|
82
|
+
aria-orientation="horizontal"
|
|
83
|
+
class="wrapper horizontal solid colorDefault"
|
|
84
|
+
/>
|
|
85
|
+
</DocumentFragment>
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
exports[`DividerLine - Snapshot Render with lineStyle as dashed 1`] = `
|
|
89
|
+
<DocumentFragment>
|
|
90
|
+
<hr
|
|
91
|
+
aria-orientation="horizontal"
|
|
92
|
+
class="wrapper horizontal dashed colorDefault"
|
|
93
|
+
/>
|
|
94
|
+
</DocumentFragment>
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
exports[`DividerLine - Snapshot Render with lineStyle as dotted 1`] = `
|
|
98
|
+
<DocumentFragment>
|
|
99
|
+
<hr
|
|
100
|
+
aria-orientation="horizontal"
|
|
101
|
+
class="wrapper horizontal dotted colorDefault"
|
|
102
|
+
/>
|
|
103
|
+
</DocumentFragment>
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
exports[`DividerLine - Snapshot Render with lineStyle as solid 1`] = `
|
|
107
|
+
<DocumentFragment>
|
|
108
|
+
<hr
|
|
109
|
+
aria-orientation="horizontal"
|
|
110
|
+
class="wrapper horizontal solid colorDefault"
|
|
111
|
+
/>
|
|
112
|
+
</DocumentFragment>
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
exports[`DividerLine - Snapshot Render with orientation as horizontal 1`] = `
|
|
116
|
+
<DocumentFragment>
|
|
117
|
+
<hr
|
|
118
|
+
aria-orientation="horizontal"
|
|
119
|
+
class="wrapper horizontal solid colorDefault"
|
|
120
|
+
/>
|
|
121
|
+
</DocumentFragment>
|
|
122
|
+
`;
|
|
123
|
+
|
|
124
|
+
exports[`DividerLine - Snapshot Render with orientation as vertical 1`] = `
|
|
125
|
+
<DocumentFragment>
|
|
126
|
+
<hr
|
|
127
|
+
aria-orientation="vertical"
|
|
128
|
+
class="wrapper vertical solid colorDefault"
|
|
129
|
+
/>
|
|
130
|
+
</DocumentFragment>
|
|
131
|
+
`;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ORIENTATION = exports.LINE_STYLE_CLASS_MAP = exports.LINE_STYLE = exports.DEFAULT_ORIENTATION = exports.DEFAULT_LINE_STYLE = exports.DEFAULT_COLOR = exports.COLOR_CLASS_MAP = exports.COLOR = void 0;
|
|
7
|
+
|
|
8
|
+
var _LINE_STYLE_CLASS_MAP, _COLOR_CLASS_MAP;
|
|
9
|
+
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
|
|
12
|
+
var ORIENTATION = {
|
|
13
|
+
HORIZONTAL: 'horizontal',
|
|
14
|
+
VERTICAL: 'vertical'
|
|
15
|
+
};
|
|
16
|
+
exports.ORIENTATION = ORIENTATION;
|
|
17
|
+
var LINE_STYLE = {
|
|
18
|
+
SOLID: 'solid',
|
|
19
|
+
DASHED: 'dashed',
|
|
20
|
+
DOTTED: 'dotted'
|
|
21
|
+
};
|
|
22
|
+
exports.LINE_STYLE = LINE_STYLE;
|
|
23
|
+
var LINE_STYLE_CLASS_MAP = (_LINE_STYLE_CLASS_MAP = {}, _defineProperty(_LINE_STYLE_CLASS_MAP, LINE_STYLE.SOLID, 'solid'), _defineProperty(_LINE_STYLE_CLASS_MAP, LINE_STYLE.DASHED, 'dashed'), _defineProperty(_LINE_STYLE_CLASS_MAP, LINE_STYLE.DOTTED, 'dotted'), _LINE_STYLE_CLASS_MAP);
|
|
24
|
+
exports.LINE_STYLE_CLASS_MAP = LINE_STYLE_CLASS_MAP;
|
|
25
|
+
var COLOR = {
|
|
26
|
+
DEFAULT: 'default',
|
|
27
|
+
SECONDARY: 'secondary',
|
|
28
|
+
TERTIARY: 'tertiary',
|
|
29
|
+
BRAND: 'brand'
|
|
30
|
+
};
|
|
31
|
+
exports.COLOR = COLOR;
|
|
32
|
+
var COLOR_CLASS_MAP = (_COLOR_CLASS_MAP = {}, _defineProperty(_COLOR_CLASS_MAP, COLOR.DEFAULT, 'colorDefault'), _defineProperty(_COLOR_CLASS_MAP, COLOR.SECONDARY, 'colorSecondary'), _defineProperty(_COLOR_CLASS_MAP, COLOR.TERTIARY, 'colorTertiary'), _defineProperty(_COLOR_CLASS_MAP, COLOR.BRAND, 'colorBrand'), _COLOR_CLASS_MAP);
|
|
33
|
+
exports.COLOR_CLASS_MAP = COLOR_CLASS_MAP;
|
|
34
|
+
var DEFAULT_ORIENTATION = ORIENTATION.HORIZONTAL;
|
|
35
|
+
exports.DEFAULT_ORIENTATION = DEFAULT_ORIENTATION;
|
|
36
|
+
var DEFAULT_LINE_STYLE = LINE_STYLE.SOLID;
|
|
37
|
+
exports.DEFAULT_LINE_STYLE = DEFAULT_LINE_STYLE;
|
|
38
|
+
var DEFAULT_COLOR = COLOR.DEFAULT;
|
|
39
|
+
exports.DEFAULT_COLOR = DEFAULT_COLOR;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
border: none;
|
|
4
|
+
margin: 0 ;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.horizontal {
|
|
8
|
+
inline-size: 100% ;
|
|
9
|
+
block-size: 0 ;
|
|
10
|
+
border-block-start-width: 1px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.vertical {
|
|
14
|
+
inline-size: 0 ;
|
|
15
|
+
block-size: 100% ;
|
|
16
|
+
border-inline-start-width: 1px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.solid {
|
|
20
|
+
border-block-start-style: solid;
|
|
21
|
+
border-inline-start-style: solid;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dashed {
|
|
25
|
+
border-block-start-style: dashed;
|
|
26
|
+
border-inline-start-style: dashed;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dotted {
|
|
30
|
+
border-block-start-style: dotted;
|
|
31
|
+
border-inline-start-style: dotted;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.colorDefault {
|
|
35
|
+
border-block-start-color: var(--zd-border-primary);
|
|
36
|
+
border-inline-start-color: var(--zd-border-primary);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.colorSecondary {
|
|
40
|
+
border-block-start-color: var(--zd-border-secondary);
|
|
41
|
+
border-inline-start-color: var(--zd-border-secondary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.colorTertiary {
|
|
45
|
+
border-block-start-color: var(--zd-border-tertiary);
|
|
46
|
+
border-inline-start-color: var(--zd-border-tertiary);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.colorBrand {
|
|
50
|
+
border-block-start-color: var(--zd-border-brand);
|
|
51
|
+
border-inline-start-color: var(--zd-border-brand);
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _dividerLine.dividerLine_cva;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _dividerLine = require("./dividerLine.cva");
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dividerLine_cva = dividerLine_cva;
|
|
7
|
+
|
|
8
|
+
var _cssUtility = require("@dot-system/css-utility");
|
|
9
|
+
|
|
10
|
+
var _constant = require("@zohodesk/utils/es/constantProps/constant");
|
|
11
|
+
|
|
12
|
+
var _DividerLineModule = _interopRequireDefault(require("./DividerLine.module.css"));
|
|
13
|
+
|
|
14
|
+
var _constants = require("../constants");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
var resolveClassVariants = function resolveClassVariants(classMap) {
|
|
19
|
+
return Object.keys(classMap).reduce(function (acc, key) {
|
|
20
|
+
acc[key] = _DividerLineModule["default"][classMap[key]];
|
|
21
|
+
return acc;
|
|
22
|
+
}, {});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var wrapperVariants = (0, _cssUtility.cva)(_DividerLineModule["default"].wrapper, {
|
|
26
|
+
variants: {
|
|
27
|
+
orientation: {
|
|
28
|
+
horizontal: _DividerLineModule["default"].horizontal,
|
|
29
|
+
vertical: _DividerLineModule["default"].vertical
|
|
30
|
+
},
|
|
31
|
+
lineStyle: resolveClassVariants(_constants.LINE_STYLE_CLASS_MAP),
|
|
32
|
+
color: resolveClassVariants(_constants.COLOR_CLASS_MAP)
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
function dividerLine_cva(_ref) {
|
|
37
|
+
var props = _ref.props;
|
|
38
|
+
var _props$orientation = props.orientation,
|
|
39
|
+
orientation = _props$orientation === void 0 ? _constants.DEFAULT_ORIENTATION : _props$orientation,
|
|
40
|
+
_props$lineStyle = props.lineStyle,
|
|
41
|
+
lineStyle = _props$lineStyle === void 0 ? _constants.DEFAULT_LINE_STYLE : _props$lineStyle,
|
|
42
|
+
_props$color = props.color,
|
|
43
|
+
color = _props$color === void 0 ? _constants.DEFAULT_COLOR : _props$color,
|
|
44
|
+
_props$customClass = props.customClass,
|
|
45
|
+
customClass = _props$customClass === void 0 ? _constant.DUMMY_OBJECT : _props$customClass;
|
|
46
|
+
var _customClass$wrapper = customClass.wrapper,
|
|
47
|
+
wrapperCustomClass = _customClass$wrapper === void 0 ? '' : _customClass$wrapper;
|
|
48
|
+
var wrapperClass = wrapperVariants({
|
|
49
|
+
orientation: orientation,
|
|
50
|
+
lineStyle: lineStyle,
|
|
51
|
+
color: color,
|
|
52
|
+
className: wrapperCustomClass
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
wrapperClass: wrapperClass
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _constants = require("../constants");
|
|
9
|
+
|
|
10
|
+
var _constant = require("@zohodesk/utils/es/constantProps/constant");
|
|
11
|
+
|
|
12
|
+
var defaultProps = {
|
|
13
|
+
orientation: _constants.DEFAULT_ORIENTATION,
|
|
14
|
+
lineStyle: _constants.DEFAULT_LINE_STYLE,
|
|
15
|
+
color: _constants.DEFAULT_COLOR,
|
|
16
|
+
customClass: _constant.DUMMY_OBJECT,
|
|
17
|
+
customAttributes: _constant.DUMMY_OBJECT,
|
|
18
|
+
a11yAttributes: _constant.DUMMY_OBJECT
|
|
19
|
+
};
|
|
20
|
+
var _default = defaultProps;
|
|
21
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
var propTypes = {
|
|
15
|
+
customId: _propTypes["default"].string,
|
|
16
|
+
testId: _propTypes["default"].string,
|
|
17
|
+
orientation: _propTypes["default"].oneOf(Object.values(_constants.ORIENTATION)),
|
|
18
|
+
lineStyle: _propTypes["default"].oneOf(Object.values(_constants.LINE_STYLE)),
|
|
19
|
+
color: _propTypes["default"].oneOf(Object.values(_constants.COLOR)),
|
|
20
|
+
customClass: _propTypes["default"].shape({
|
|
21
|
+
wrapper: _propTypes["default"].string
|
|
22
|
+
}),
|
|
23
|
+
customAttributes: _propTypes["default"].shape({
|
|
24
|
+
wrapper: _propTypes["default"].object
|
|
25
|
+
}),
|
|
26
|
+
a11yAttributes: _propTypes["default"].shape({
|
|
27
|
+
wrapper: _propTypes["default"].object
|
|
28
|
+
})
|
|
29
|
+
};
|
|
30
|
+
var _default = propTypes;
|
|
31
|
+
exports["default"] = _default;
|
|
@@ -9,9 +9,9 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _DividerLine = _interopRequireDefault(require("../DividerLine/DividerLine"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _propTypes = require("./props/propTypes");
|
|
15
15
|
|
|
16
16
|
var _DropDownSeparatorModule = _interopRequireDefault(require("./DropDownSeparator.module.css"));
|
|
17
17
|
|
|
@@ -53,8 +53,13 @@ var DropDownSeparator = /*#__PURE__*/function (_React$Component) {
|
|
|
53
53
|
value: function render() {
|
|
54
54
|
var _this$props$customCla = this.props.customClass,
|
|
55
55
|
customClass = _this$props$customCla === void 0 ? '' : _this$props$customCla;
|
|
56
|
-
return /*#__PURE__*/_react["default"].createElement("
|
|
57
|
-
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement(_DividerLine["default"], {
|
|
57
|
+
orientation: "horizontal",
|
|
58
|
+
lineStyle: "solid",
|
|
59
|
+
color: "secondary",
|
|
60
|
+
customClass: {
|
|
61
|
+
wrapper: "".concat(_DropDownSeparatorModule["default"].separator, " ").concat(customClass)
|
|
62
|
+
}
|
|
58
63
|
});
|
|
59
64
|
}
|
|
60
65
|
}]);
|
|
@@ -15,4 +15,12 @@ describe('DropDownSeparator', function () {
|
|
|
15
15
|
|
|
16
16
|
expect(asFragment()).toMatchSnapshot();
|
|
17
17
|
});
|
|
18
|
+
test('rendering the custom class', function () {
|
|
19
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_DropDownSeparator["default"], {
|
|
20
|
+
customClass: "my-custom-class"
|
|
21
|
+
})),
|
|
22
|
+
asFragment = _render2.asFragment;
|
|
23
|
+
|
|
24
|
+
expect(asFragment()).toMatchSnapshot();
|
|
25
|
+
});
|
|
18
26
|
});
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
+
exports[`DropDownSeparator rendering the custom class 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<hr
|
|
6
|
+
aria-orientation="horizontal"
|
|
7
|
+
class="wrapper horizontal solid colorSecondary separator my-custom-class"
|
|
8
|
+
/>
|
|
9
|
+
</DocumentFragment>
|
|
10
|
+
`;
|
|
11
|
+
|
|
3
12
|
exports[`DropDownSeparator rendering the defult props 1`] = `
|
|
4
13
|
<DocumentFragment>
|
|
5
|
-
<
|
|
6
|
-
|
|
14
|
+
<hr
|
|
15
|
+
aria-orientation="horizontal"
|
|
16
|
+
class="wrapper horizontal solid colorSecondary separator"
|
|
7
17
|
/>
|
|
8
18
|
</DocumentFragment>
|
|
9
19
|
`;
|
|
@@ -1043,6 +1043,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
1043
1043
|
selectedOptions: formatSelectedOptions,
|
|
1044
1044
|
highLightedSelectOptions: highLightedSelectOptions,
|
|
1045
1045
|
isReadOnly: isReadOnly,
|
|
1046
|
+
isDisabled: isDisabled,
|
|
1046
1047
|
getRef: this.selectedOptionRef,
|
|
1047
1048
|
onRemove: this.handleRemoveOption,
|
|
1048
1049
|
onSelect: this.handleClickSelectedOption,
|
|
@@ -523,6 +523,7 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
523
523
|
selectedOptions: selectedOptions,
|
|
524
524
|
highLightedSelectOptions: highLightedSelectOptions,
|
|
525
525
|
isReadOnly: isReadOnly,
|
|
526
|
+
isDisabled: isDisabled,
|
|
526
527
|
getRef: this.selectedOptionRef,
|
|
527
528
|
onRemove: this.handleRemoveOption,
|
|
528
529
|
onSelect: this.handleClickSelectedOption,
|
|
@@ -84,8 +84,8 @@ var SelectedOptions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
84
84
|
iconSize = option.iconSize,
|
|
85
85
|
isDisabled = option.isDisabled;
|
|
86
86
|
var commonProps = {
|
|
87
|
-
disabled: isDisabled,
|
|
88
|
-
onRemove: isDisabled || isReadOnly ? null : onRemove,
|
|
87
|
+
disabled: isDisabled || isInputDisabled,
|
|
88
|
+
onRemove: isDisabled || isInputDisabled || isReadOnly ? null : onRemove,
|
|
89
89
|
text: value,
|
|
90
90
|
palette: isDarkPalette,
|
|
91
91
|
onSelectTag: isReadOnly ? null : onSelect,
|
|
@@ -121,7 +121,7 @@ var SelectedOptions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
121
121
|
key: "".concat(id, "customTag"),
|
|
122
122
|
dataId: dataId
|
|
123
123
|
}, typeof renderCustomSelectedValue == 'function' ? renderCustomSelectedValue({
|
|
124
|
-
onRemove: isDisabled || isReadOnly ? null : onRemove,
|
|
124
|
+
onRemove: isDisabled || isInputDisabled || isReadOnly ? null : onRemove,
|
|
125
125
|
palette: isDarkPalette,
|
|
126
126
|
onSelectTag: isReadOnly ? null : onSelect,
|
|
127
127
|
getRef: getRef,
|
|
@@ -9,6 +9,38 @@ var _AdvancedGroupMultiSelect = _interopRequireDefault(require("../AdvancedGroup
|
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
10
|
|
|
11
11
|
describe('AdvancedGroupMultiSelect', function () {
|
|
12
|
+
var options = [{
|
|
13
|
+
id: 'Group1',
|
|
14
|
+
name: 'Group 1',
|
|
15
|
+
options: [{
|
|
16
|
+
id: 'group11',
|
|
17
|
+
value: 'Option 1'
|
|
18
|
+
}, {
|
|
19
|
+
id: 'group12',
|
|
20
|
+
value: 'Option 2'
|
|
21
|
+
}],
|
|
22
|
+
textField: 'value',
|
|
23
|
+
valueField: 'id'
|
|
24
|
+
}, {
|
|
25
|
+
id: 'Group2',
|
|
26
|
+
name: 'Group 2',
|
|
27
|
+
options: [{
|
|
28
|
+
id: 'group21',
|
|
29
|
+
value: 'Group2 Option 1'
|
|
30
|
+
}, {
|
|
31
|
+
id: 'group22',
|
|
32
|
+
value: 'Group2 Option 2'
|
|
33
|
+
}],
|
|
34
|
+
textField: 'value',
|
|
35
|
+
valueField: 'id'
|
|
36
|
+
}];
|
|
37
|
+
var selectedGroupOptions = [{
|
|
38
|
+
groupId: 'Group1',
|
|
39
|
+
id: 'group11'
|
|
40
|
+
}, {
|
|
41
|
+
groupId: 'Group2',
|
|
42
|
+
id: 'group22'
|
|
43
|
+
}];
|
|
12
44
|
test('rendering the defult props', function () {
|
|
13
45
|
var mockOnChange = jest.fn();
|
|
14
46
|
|
|
@@ -17,4 +49,14 @@ describe('AdvancedGroupMultiSelect', function () {
|
|
|
17
49
|
|
|
18
50
|
expect(asFragment()).toMatchSnapshot();
|
|
19
51
|
});
|
|
52
|
+
test('Should render as disabled', function () {
|
|
53
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AdvancedGroupMultiSelect["default"], {
|
|
54
|
+
options: options,
|
|
55
|
+
selectedGroupOptions: selectedGroupOptions,
|
|
56
|
+
isDisabled: true
|
|
57
|
+
})),
|
|
58
|
+
asFragment = _render2.asFragment;
|
|
59
|
+
|
|
60
|
+
expect(asFragment()).toMatchSnapshot();
|
|
61
|
+
});
|
|
20
62
|
});
|
|
@@ -53,4 +53,14 @@ describe('AdvancedMultiSelect', function () {
|
|
|
53
53
|
|
|
54
54
|
expect(asFragment()).toMatchSnapshot();
|
|
55
55
|
});
|
|
56
|
+
test('Should render as disabled', function () {
|
|
57
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AdvancedMultiSelect["default"], {
|
|
58
|
+
options: options,
|
|
59
|
+
selectedOptions: ['Apple'],
|
|
60
|
+
isDisabled: true
|
|
61
|
+
})),
|
|
62
|
+
asFragment = _render4.asFragment;
|
|
63
|
+
|
|
64
|
+
expect(asFragment()).toMatchSnapshot();
|
|
65
|
+
});
|
|
56
66
|
});
|
|
@@ -80,4 +80,14 @@ describe('MultiSelect', function () {
|
|
|
80
80
|
|
|
81
81
|
expect(asFragment()).toMatchSnapshot();
|
|
82
82
|
});
|
|
83
|
+
test('Should render as disabled', function () {
|
|
84
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_MultiSelect["default"], {
|
|
85
|
+
options: options,
|
|
86
|
+
selectedOptions: testSelectedData,
|
|
87
|
+
isDisabled: true
|
|
88
|
+
})),
|
|
89
|
+
asFragment = _render4.asFragment;
|
|
90
|
+
|
|
91
|
+
expect(asFragment()).toMatchSnapshot();
|
|
92
|
+
});
|
|
83
93
|
});
|