@zohodesk/components 1.0.0-temp-199.18 → 1.0.0-temp-246
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 +15 -1
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +2 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +2 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +2 -0
- package/es/CheckBox/CheckBox.js +21 -10
- package/es/CheckBox/CheckBox.module.css +21 -6
- package/es/CheckBox/__tests__/CheckBox.spec.js +9 -0
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +162 -93
- package/es/CheckBox/props/propTypes.js +4 -1
- package/es/ColorSelect/ColorSingleSelect.js +0 -1
- package/es/ColorSelect/__tests__/ColorMultiSelect.spec.js +15 -3
- package/es/ColorSelect/__tests__/ColorSingleSelect.spec.js +15 -3
- package/es/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +2 -2
- package/es/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +8 -8
- package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +7 -3
- package/es/ColorSelect/_shared/ColorIndicator/__tests__/ColorIndicator.spec.js +17 -4
- package/es/ColorSelect/_shared/ColorIndicator/__tests__/__snapshots__/ColorIndicator.spec.js.snap +3 -3
- package/es/ColorSelect/_shared/ColorIndicator/props/propTypes.js +1 -1
- package/es/ColorSelect/_shared/ColoredTag/props/propTypes.js +1 -0
- package/es/ColorSelect/_shared/helpers/renderHelpers.js +14 -10
- package/es/ColorSelect/props/propTypes.js +1 -0
- package/es/Label/Label.js +19 -1
- package/es/Label/__tests__/Label.spec.js +58 -0
- package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +66 -0
- package/es/Label/props/defaultProps.js +1 -0
- package/es/Label/props/propTypes.js +7 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -6
- package/es/MultiSelect/MultiSelect.js +2 -2
- package/es/MultiSelect/Suggestions.js +2 -7
- package/es/MultiSelect/props/defaultProps.js +0 -2
- package/es/MultiSelect/props/propTypes.js +3 -11
- package/es/Radio/Radio.js +20 -9
- package/es/Radio/Radio.module.css +38 -5
- package/es/Radio/__tests__/Radio.spec.js +10 -0
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +238 -81
- package/es/Radio/props/propTypes.js +4 -1
- package/es/Select/GroupSelect.js +1 -1
- package/es/Select/SelectWithAvatar.js +3 -3
- package/es/Select/SelectWithIcon.js +3 -10
- package/es/Select/props/defaultProps.js +2 -4
- package/es/Select/props/propTypes.js +3 -11
- package/es/Typography/Typography.js +9 -2
- package/es/Typography/__tests__/Typography.spec.js +427 -0
- package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/es/Typography/props/defaultProps.js +2 -1
- package/es/Typography/props/propTypes.js +24 -5
- package/es/Typography/utils/textHighlighter.js +139 -0
- package/es/common/common.module.css +1 -1
- package/es/shared/ArrowIcon/ArrowIcon.js +6 -3
- package/es/shared/ArrowIcon/ArrowIcon.module.css +9 -0
- package/es/shared/ArrowIcon/__tests__/ArrowIcon.spec.js +24 -0
- package/es/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +70 -7
- package/es/shared/ArrowIcon/props/defaultProps.js +2 -0
- package/es/shared/ArrowIcon/props/propTypes.js +3 -1
- package/es/utils/dropDownUtils.js +3 -3
- package/lib/CheckBox/CheckBox.js +23 -9
- package/lib/CheckBox/CheckBox.module.css +21 -6
- package/lib/CheckBox/__tests__/CheckBox.spec.js +21 -12
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +162 -93
- package/lib/CheckBox/props/propTypes.js +5 -1
- package/lib/ColorSelect/ColorSingleSelect.js +1 -2
- package/lib/ColorSelect/__tests__/ColorMultiSelect.spec.js +15 -3
- package/lib/ColorSelect/__tests__/ColorSingleSelect.spec.js +15 -3
- package/lib/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +2 -2
- package/lib/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +8 -8
- package/lib/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +10 -4
- package/lib/ColorSelect/_shared/ColorIndicator/__tests__/ColorIndicator.spec.js +17 -4
- package/lib/ColorSelect/_shared/ColorIndicator/__tests__/__snapshots__/ColorIndicator.spec.js.snap +3 -3
- package/lib/ColorSelect/_shared/ColorIndicator/props/propTypes.js +1 -1
- package/lib/ColorSelect/_shared/ColoredTag/props/propTypes.js +1 -0
- package/lib/ColorSelect/_shared/helpers/renderHelpers.js +19 -13
- package/lib/ColorSelect/props/propTypes.js +1 -0
- package/lib/Label/Label.js +21 -1
- package/lib/Label/__tests__/Label.spec.js +58 -0
- package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +66 -0
- package/lib/Label/props/defaultProps.js +1 -0
- package/lib/Label/props/propTypes.js +8 -1
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
- package/lib/MultiSelect/MultiSelect.js +2 -2
- package/lib/MultiSelect/Suggestions.js +2 -6
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +5 -13
- package/lib/Radio/Radio.js +22 -8
- package/lib/Radio/Radio.module.css +38 -5
- package/lib/Radio/__tests__/Radio.spec.js +10 -0
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +238 -81
- package/lib/Radio/props/propTypes.js +5 -1
- package/lib/Select/GroupSelect.js +1 -2
- package/lib/Select/SelectWithAvatar.js +3 -4
- package/lib/Select/SelectWithIcon.js +3 -10
- package/lib/Select/props/defaultProps.js +3 -5
- package/lib/Select/props/propTypes.js +3 -11
- package/lib/Typography/Typography.js +9 -2
- package/lib/Typography/__tests__/Typography.spec.js +436 -0
- package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/lib/Typography/props/defaultProps.js +2 -1
- package/lib/Typography/props/propTypes.js +31 -6
- package/lib/Typography/utils/textHighlighter.js +160 -0
- package/lib/common/common.module.css +1 -1
- package/lib/shared/ArrowIcon/ArrowIcon.js +6 -3
- package/lib/shared/ArrowIcon/ArrowIcon.module.css +9 -0
- package/lib/shared/ArrowIcon/__tests__/ArrowIcon.spec.js +34 -10
- package/lib/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +70 -7
- package/lib/shared/ArrowIcon/props/defaultProps.js +2 -0
- package/lib/shared/ArrowIcon/props/propTypes.js +3 -1
- package/lib/utils/dropDownUtils.js +3 -3
- package/package.json +2 -2
|
@@ -10,10 +10,12 @@ const ArrowIcon = props => {
|
|
|
10
10
|
const {
|
|
11
11
|
dataId,
|
|
12
12
|
isRotated,
|
|
13
|
+
isActive,
|
|
13
14
|
customClass,
|
|
14
15
|
customProps,
|
|
15
16
|
tagAttributes,
|
|
16
17
|
a11yAttributes,
|
|
18
|
+
iconSize,
|
|
17
19
|
isDisabled,
|
|
18
20
|
isReadOnly,
|
|
19
21
|
renderCustomToggleIndicator
|
|
@@ -23,7 +25,8 @@ const ArrowIcon = props => {
|
|
|
23
25
|
containerClass = ''
|
|
24
26
|
} = customClass;
|
|
25
27
|
return isRenderable(renderCustomToggleIndicator) ? renderNode(renderCustomToggleIndicator, {
|
|
26
|
-
|
|
28
|
+
isRotated,
|
|
29
|
+
isActive,
|
|
27
30
|
isReadOnly,
|
|
28
31
|
isDisabled
|
|
29
32
|
}) : /*#__PURE__*/React.createElement(Container, {
|
|
@@ -35,10 +38,10 @@ const ArrowIcon = props => {
|
|
|
35
38
|
...a11yAttributes,
|
|
36
39
|
...customProps,
|
|
37
40
|
dataId: `${dataId}_downIcon`,
|
|
38
|
-
className: `${style.arrowIcon} ${isRotated ? style.rotated : ''} ${containerClass}`
|
|
41
|
+
className: `${style.arrowIcon} ${isRotated ? style.rotated : ''} ${isActive ? style.active : ''} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readonly : ''} ${containerClass}`
|
|
39
42
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
40
43
|
name: "ZD-down",
|
|
41
|
-
size:
|
|
44
|
+
size: iconSize,
|
|
42
45
|
iconClass: iconClass
|
|
43
46
|
}));
|
|
44
47
|
};
|
|
@@ -28,7 +28,16 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.rotated,
|
|
31
|
+
.active,
|
|
31
32
|
.arrowContainer:hover .arrowIcon,
|
|
32
33
|
.transparentContainer:hover .arrowIcon {
|
|
33
34
|
--local-arrowIcon-color: var(--zdt_arrowicon_hover_icon);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.disabled {
|
|
38
|
+
composes: disabled from '../../common/common.module.css';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.readonly {
|
|
42
|
+
composes: curdefault from '../../common/common.module.css';
|
|
34
43
|
}
|
|
@@ -24,6 +24,30 @@ describe('ArrowIcon', () => {
|
|
|
24
24
|
}));
|
|
25
25
|
expect(asFragment()).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
|
+
test('Should be render isActive is true', () => {
|
|
28
|
+
const {
|
|
29
|
+
asFragment
|
|
30
|
+
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
|
|
31
|
+
isActive: true
|
|
32
|
+
}));
|
|
33
|
+
expect(asFragment()).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
test('Should be render isDisabled is true', () => {
|
|
36
|
+
const {
|
|
37
|
+
asFragment
|
|
38
|
+
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
|
|
39
|
+
isDisabled: true
|
|
40
|
+
}));
|
|
41
|
+
expect(asFragment()).toMatchSnapshot();
|
|
42
|
+
});
|
|
43
|
+
test('Should be render isReadOnly is true', () => {
|
|
44
|
+
const {
|
|
45
|
+
asFragment
|
|
46
|
+
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
|
|
47
|
+
isReadOnly: true
|
|
48
|
+
}));
|
|
49
|
+
expect(asFragment()).toMatchSnapshot();
|
|
50
|
+
});
|
|
27
51
|
test('Should be render with customClass', () => {
|
|
28
52
|
const {
|
|
29
53
|
asFragment
|
|
@@ -1,10 +1,73 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`ArrowIcon Should be render isActive is true 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
class="arrowIcon active inflex coldir both"
|
|
8
|
+
data-id="undefined_downIcon"
|
|
9
|
+
data-selector-id="container"
|
|
10
|
+
data-test-id="undefined_downIcon"
|
|
11
|
+
>
|
|
12
|
+
<i
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
class="zd_font_icons basic icon-down "
|
|
15
|
+
data-id="fontIcon"
|
|
16
|
+
data-selector-id="fontIcon"
|
|
17
|
+
data-test-id="fontIcon"
|
|
18
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</DocumentFragment>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
exports[`ArrowIcon Should be render isDisabled is true 1`] = `
|
|
25
|
+
<DocumentFragment>
|
|
26
|
+
<div
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
class="arrowIcon disabled inflex coldir both"
|
|
29
|
+
data-id="undefined_downIcon"
|
|
30
|
+
data-selector-id="container"
|
|
31
|
+
data-test-id="undefined_downIcon"
|
|
32
|
+
>
|
|
33
|
+
<i
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
class="zd_font_icons basic icon-down "
|
|
36
|
+
data-id="fontIcon"
|
|
37
|
+
data-selector-id="fontIcon"
|
|
38
|
+
data-test-id="fontIcon"
|
|
39
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</DocumentFragment>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`ArrowIcon Should be render isReadOnly is true 1`] = `
|
|
46
|
+
<DocumentFragment>
|
|
47
|
+
<div
|
|
48
|
+
aria-hidden="true"
|
|
49
|
+
class="arrowIcon readonly inflex coldir both"
|
|
50
|
+
data-id="undefined_downIcon"
|
|
51
|
+
data-selector-id="container"
|
|
52
|
+
data-test-id="undefined_downIcon"
|
|
53
|
+
>
|
|
54
|
+
<i
|
|
55
|
+
aria-hidden="true"
|
|
56
|
+
class="zd_font_icons basic icon-down "
|
|
57
|
+
data-id="fontIcon"
|
|
58
|
+
data-selector-id="fontIcon"
|
|
59
|
+
data-test-id="fontIcon"
|
|
60
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</DocumentFragment>
|
|
64
|
+
`;
|
|
65
|
+
|
|
3
66
|
exports[`ArrowIcon Should be render isRotated is true 1`] = `
|
|
4
67
|
<DocumentFragment>
|
|
5
68
|
<div
|
|
6
69
|
aria-hidden="true"
|
|
7
|
-
class="arrowIcon rotated
|
|
70
|
+
class="arrowIcon rotated inflex coldir both"
|
|
8
71
|
data-id="undefined_downIcon"
|
|
9
72
|
data-selector-id="container"
|
|
10
73
|
data-test-id="undefined_downIcon"
|
|
@@ -25,7 +88,7 @@ exports[`ArrowIcon Should be render with a11yAttributes 1`] = `
|
|
|
25
88
|
<DocumentFragment>
|
|
26
89
|
<div
|
|
27
90
|
aria-hidden="true"
|
|
28
|
-
class="arrowIcon
|
|
91
|
+
class="arrowIcon inflex coldir both"
|
|
29
92
|
data-a11y-focus="true"
|
|
30
93
|
data-id="undefined_downIcon"
|
|
31
94
|
data-selector-id="container"
|
|
@@ -47,7 +110,7 @@ exports[`ArrowIcon Should be render with customClass 1`] = `
|
|
|
47
110
|
<DocumentFragment>
|
|
48
111
|
<div
|
|
49
112
|
aria-hidden="true"
|
|
50
|
-
class="arrowIcon
|
|
113
|
+
class="arrowIcon arrowIcon_containerClass inflex coldir both"
|
|
51
114
|
data-id="undefined_downIcon"
|
|
52
115
|
data-selector-id="container"
|
|
53
116
|
data-test-id="undefined_downIcon"
|
|
@@ -68,7 +131,7 @@ exports[`ArrowIcon Should be render with customProps 1`] = `
|
|
|
68
131
|
<DocumentFragment>
|
|
69
132
|
<div
|
|
70
133
|
aria-hidden="true"
|
|
71
|
-
class="arrowIcon
|
|
134
|
+
class="arrowIcon inflex coldir both"
|
|
72
135
|
data-id="undefined_downIcon"
|
|
73
136
|
data-selector-id="container"
|
|
74
137
|
data-test-id="hereIsTestId"
|
|
@@ -89,7 +152,7 @@ exports[`ArrowIcon Should be render with dataId 1`] = `
|
|
|
89
152
|
<DocumentFragment>
|
|
90
153
|
<div
|
|
91
154
|
aria-hidden="true"
|
|
92
|
-
class="arrowIcon
|
|
155
|
+
class="arrowIcon inflex coldir both"
|
|
93
156
|
data-id="ArrowIcon-test-dataId_downIcon"
|
|
94
157
|
data-selector-id="container"
|
|
95
158
|
data-test-id="ArrowIcon-test-dataId_downIcon"
|
|
@@ -118,7 +181,7 @@ exports[`ArrowIcon Should be render with tagAttributes 1`] = `
|
|
|
118
181
|
<DocumentFragment>
|
|
119
182
|
<div
|
|
120
183
|
aria-hidden="true"
|
|
121
|
-
class="arrowIcon
|
|
184
|
+
class="arrowIcon inflex coldir both"
|
|
122
185
|
data-id="undefined_downIcon"
|
|
123
186
|
data-selector-id="container"
|
|
124
187
|
data-test-id="undefined_downIcon"
|
|
@@ -140,7 +203,7 @@ exports[`ArrowIcon rendering the defult props 1`] = `
|
|
|
140
203
|
<DocumentFragment>
|
|
141
204
|
<div
|
|
142
205
|
aria-hidden="true"
|
|
143
|
-
class="arrowIcon
|
|
206
|
+
class="arrowIcon inflex coldir both"
|
|
144
207
|
data-id="undefined_downIcon"
|
|
145
208
|
data-selector-id="container"
|
|
146
209
|
data-test-id="undefined_downIcon"
|
|
@@ -11,5 +11,7 @@ export default {
|
|
|
11
11
|
a11yAttributes: PropTypes.object,
|
|
12
12
|
renderCustomToggleIndicator: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
13
13
|
isDisabled: PropTypes.bool,
|
|
14
|
-
isReadOnly: PropTypes.bool
|
|
14
|
+
isReadOnly: PropTypes.bool,
|
|
15
|
+
isActive: PropTypes.bool,
|
|
16
|
+
iconSize: PropTypes.string
|
|
15
17
|
};
|
|
@@ -159,7 +159,7 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
159
159
|
const value = typeof option === 'object' ? option[impTextField || textField] : allowValueFallback ? option : '';
|
|
160
160
|
const secondaryValue = typeof option === 'object' ? option[impSecondaryField || secondaryField] : '';
|
|
161
161
|
const photoURL = typeof option === 'object' ? option[impImageField || imageField] : '';
|
|
162
|
-
const
|
|
162
|
+
const colorConfig = selectn('colorConfig', option); // grouping options (group select/MultiSelect)
|
|
163
163
|
|
|
164
164
|
id = !getIsEmptyValue(id) ? optionIdGrouping(id, prefixText) : '';
|
|
165
165
|
const additionalSearchFieldData = searchFields.reduce((value, item) => {
|
|
@@ -200,8 +200,8 @@ export const makeFormatOptions = () => createSelector([getOptions, getValueField
|
|
|
200
200
|
optionDetails.listItemProps = listStyle || listItemProps;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
if (
|
|
204
|
-
optionDetails.
|
|
203
|
+
if (colorConfig) {
|
|
204
|
+
optionDetails.colorConfig = colorConfig;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
if (listStyleCustomProps || listItemCustomProps) {
|
package/lib/CheckBox/CheckBox.js
CHANGED
|
@@ -15,6 +15,8 @@ var _defaultProps = require("./props/defaultProps");
|
|
|
15
15
|
|
|
16
16
|
var _Label = _interopRequireDefault(require("../Label/Label"));
|
|
17
17
|
|
|
18
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
19
|
+
|
|
18
20
|
var _Layout = require("../Layout");
|
|
19
21
|
|
|
20
22
|
var _CssProvider = _interopRequireDefault(require("../Provider/CssProvider"));
|
|
@@ -104,11 +106,14 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
104
106
|
customClass = _this$props3.customClass,
|
|
105
107
|
customProps = _this$props3.customProps,
|
|
106
108
|
dataSelectorId = _this$props3.dataSelectorId,
|
|
107
|
-
renderRightPlaceholderNode = _this$props3.renderRightPlaceholderNode
|
|
109
|
+
renderRightPlaceholderNode = _this$props3.renderRightPlaceholderNode,
|
|
110
|
+
secondaryText = _this$props3.secondaryText;
|
|
108
111
|
var _customProps$CheckBox = customProps.CheckBoxProps,
|
|
109
112
|
CheckBoxProps = _customProps$CheckBox === void 0 ? {} : _customProps$CheckBox,
|
|
110
113
|
_customProps$LabelPro = customProps.LabelProps,
|
|
111
|
-
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro
|
|
114
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
115
|
+
_customProps$secondar = customProps.secondaryTextProps,
|
|
116
|
+
secondaryTextProps = _customProps$secondar === void 0 ? {} : _customProps$secondar;
|
|
112
117
|
var _customClass$customCh = customClass.customCheckBox,
|
|
113
118
|
customCheckBox = _customClass$customCh === void 0 ? '' : _customClass$customCh,
|
|
114
119
|
_customClass$customLa = customClass.customLabel,
|
|
@@ -116,7 +121,9 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
116
121
|
_customClass$customCB = customClass.customCBoxSize,
|
|
117
122
|
customCBoxSize = _customClass$customCB === void 0 ? '' : _customClass$customCB,
|
|
118
123
|
_customClass$customTi = customClass.customTickSize,
|
|
119
|
-
customTickSize = _customClass$customTi === void 0 ? '' : _customClass$customTi
|
|
124
|
+
customTickSize = _customClass$customTi === void 0 ? '' : _customClass$customTi,
|
|
125
|
+
_customClass$customSe = customClass.customSecondaryText,
|
|
126
|
+
customSecondaryText = _customClass$customSe === void 0 ? '' : _customClass$customSe;
|
|
120
127
|
var accessMode = isReadOnly ? _CheckBoxModule["default"].readonly : disabled ? (0, _CssProvider["default"])('isDisabled') : _CheckBoxModule["default"].pointer;
|
|
121
128
|
var toolTip = disabled ? disabledTitle : title ? title : null;
|
|
122
129
|
var ariaLabel = a11y.ariaLabel,
|
|
@@ -145,7 +152,8 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
145
152
|
"aria-hidden": ariaHidden,
|
|
146
153
|
dataSelectorId: dataSelectorId || id
|
|
147
154
|
}, CheckBoxProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
148
|
-
className: "".concat(_CheckBoxModule["default"].boxContainer, " ").concat(_CheckBoxModule["default"][size], " ").concat(customCBoxSize, " ").concat(isFilled ? _CheckBoxModule["default"].filled : '', " ").concat(!isEditable ? "".concat(_CheckBoxModule["default"]["disabled"]) : '')
|
|
155
|
+
className: "".concat(_CheckBoxModule["default"].boxContainer, " ").concat(secondaryText ? _CheckBoxModule["default"].withSecondaryText : '', " ").concat(_CheckBoxModule["default"][size], " ").concat(customCBoxSize, " ").concat(isFilled ? _CheckBoxModule["default"].filled : '', " ").concat(!isEditable ? "".concat(_CheckBoxModule["default"]["disabled"]) : ''),
|
|
156
|
+
align: secondaryText ? "start" : undefined
|
|
149
157
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
150
158
|
type: "hidden",
|
|
151
159
|
id: id,
|
|
@@ -193,10 +201,10 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
193
201
|
y1: "20",
|
|
194
202
|
x2: "28.53",
|
|
195
203
|
y2: "20"
|
|
196
|
-
}) : null))), text && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
204
|
+
}) : null))), (text || secondaryText) && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
197
205
|
flexible: true,
|
|
198
|
-
className: _CheckBoxModule["default"].
|
|
199
|
-
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
206
|
+
className: _CheckBoxModule["default"].labelContainer
|
|
207
|
+
}, text && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
200
208
|
text: text,
|
|
201
209
|
palette: disabled ? 'disable' : labelPalette,
|
|
202
210
|
id: id,
|
|
@@ -204,9 +212,15 @@ var CheckBox = /*#__PURE__*/function (_React$Component) {
|
|
|
204
212
|
type: "title",
|
|
205
213
|
clipped: isClipped,
|
|
206
214
|
variant: variant,
|
|
207
|
-
customClass: "".concat(active && !disabled ? "".concat(_CheckBoxModule["default"]["active".concat(palette, "Label")]) : '', "\n
|
|
215
|
+
customClass: "".concat(active && !disabled ? "".concat(_CheckBoxModule["default"]["active".concat(palette, "Label")]) : '', "\n ").concat(checked && active ? "".concat(_CheckBoxModule["default"]["checked".concat(palette, "Label")]) : '', " \n ").concat(accessMode, " ").concat(customLabel),
|
|
208
216
|
title: toolTip ? toolTip : text
|
|
209
|
-
}, LabelProps))
|
|
217
|
+
}, LabelProps)), secondaryText ? /*#__PURE__*/_react["default"].createElement(_Typography["default"], _extends({
|
|
218
|
+
$ui_size: "12",
|
|
219
|
+
$ui_lineHeight: "1.2"
|
|
220
|
+
}, secondaryTextProps, {
|
|
221
|
+
$i18n_dataTitle: toolTip ? null : secondaryText,
|
|
222
|
+
$ui_className: "".concat(_CheckBoxModule["default"].secondaryText, " ").concat(customSecondaryText)
|
|
223
|
+
}), secondaryText) : null), renderRightPlaceholderNode ? renderRightPlaceholderNode : null);
|
|
210
224
|
}
|
|
211
225
|
}]);
|
|
212
226
|
|
|
@@ -90,12 +90,6 @@
|
|
|
90
90
|
[dir=rtl] .linePath {
|
|
91
91
|
animation: lineAnimate var(--zd_transition3) ease forwards;
|
|
92
92
|
}
|
|
93
|
-
[dir=ltr] .text {
|
|
94
|
-
margin-left: var(--zd_size6) ;
|
|
95
|
-
}
|
|
96
|
-
[dir=rtl] .text {
|
|
97
|
-
margin-right: var(--zd_size6) ;
|
|
98
|
-
}
|
|
99
93
|
|
|
100
94
|
.checkedprimary,
|
|
101
95
|
.checkeddanger {
|
|
@@ -141,6 +135,27 @@
|
|
|
141
135
|
.disabled {
|
|
142
136
|
opacity: 0.7
|
|
143
137
|
}
|
|
138
|
+
|
|
139
|
+
.withSecondaryText {
|
|
140
|
+
margin-top: var(--zd_size1) ;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.secondaryText {
|
|
144
|
+
color: var(--zdt_checkbox_secondary_text);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.labelContainer {
|
|
148
|
+
composes: dflex flexcolumn from '../common/common.module.css';
|
|
149
|
+
gap: var(--zd_size4) ;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[dir=ltr] .labelContainer {
|
|
153
|
+
margin-left: var(--zd_size6) ;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[dir=rtl] .labelContainer {
|
|
157
|
+
margin-right: var(--zd_size6) ;
|
|
158
|
+
}
|
|
144
159
|
@keyframes tickAnimate {
|
|
145
160
|
0% {
|
|
146
161
|
stroke-dashoffset: 40;
|
|
@@ -168,24 +168,33 @@ describe('CheckBox component', function () {
|
|
|
168
168
|
|
|
169
169
|
expect(asFragment()).toMatchSnapshot();
|
|
170
170
|
});
|
|
171
|
-
test('Should
|
|
171
|
+
test('Should render secondaryText', function () {
|
|
172
172
|
var _render18 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
173
|
-
|
|
173
|
+
text: "checkboxText",
|
|
174
|
+
secondaryText: "secondaryText"
|
|
174
175
|
})),
|
|
175
176
|
asFragment = _render18.asFragment;
|
|
176
177
|
|
|
177
178
|
expect(asFragment()).toMatchSnapshot();
|
|
178
179
|
});
|
|
179
|
-
test('Should be render
|
|
180
|
+
test('Should be render activeStyle is minus', function () {
|
|
180
181
|
var _render19 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
181
|
-
|
|
182
|
+
activeStyle: "minus"
|
|
182
183
|
})),
|
|
183
184
|
asFragment = _render19.asFragment;
|
|
184
185
|
|
|
185
186
|
expect(asFragment()).toMatchSnapshot();
|
|
186
187
|
});
|
|
187
|
-
test('
|
|
188
|
+
test('Should be render dataSelectorId', function () {
|
|
188
189
|
var _render20 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
190
|
+
dataSelectorId: "dataSelectorIdCheck"
|
|
191
|
+
})),
|
|
192
|
+
asFragment = _render20.asFragment;
|
|
193
|
+
|
|
194
|
+
expect(asFragment()).toMatchSnapshot();
|
|
195
|
+
});
|
|
196
|
+
test('rendering the Custom Props', function () {
|
|
197
|
+
var _render21 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
189
198
|
text: "checkboxText",
|
|
190
199
|
customProps: {
|
|
191
200
|
CheckBoxProps: {
|
|
@@ -196,12 +205,12 @@ describe('CheckBox component', function () {
|
|
|
196
205
|
}
|
|
197
206
|
}
|
|
198
207
|
})),
|
|
199
|
-
asFragment =
|
|
208
|
+
asFragment = _render21.asFragment;
|
|
200
209
|
|
|
201
210
|
expect(asFragment()).toMatchSnapshot();
|
|
202
211
|
});
|
|
203
212
|
test('rendering the Custom class', function () {
|
|
204
|
-
var
|
|
213
|
+
var _render22 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
205
214
|
text: "checkboxText",
|
|
206
215
|
checked: true,
|
|
207
216
|
customClass: {
|
|
@@ -211,12 +220,12 @@ describe('CheckBox component', function () {
|
|
|
211
220
|
customTickSize: 'customTickSizeClass'
|
|
212
221
|
}
|
|
213
222
|
})),
|
|
214
|
-
asFragment =
|
|
223
|
+
asFragment = _render22.asFragment;
|
|
215
224
|
|
|
216
225
|
expect(asFragment()).toMatchSnapshot();
|
|
217
226
|
});
|
|
218
227
|
test('rendering ally ariaLabel , ariaLabelledby, ariaHidden,ariaChecked,role true and entering their values', function () {
|
|
219
|
-
var
|
|
228
|
+
var _render23 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
220
229
|
checked: true,
|
|
221
230
|
a11y: {
|
|
222
231
|
ariaLabel: 'ariaLabelCheckBox',
|
|
@@ -226,12 +235,12 @@ describe('CheckBox component', function () {
|
|
|
226
235
|
role: 'checkBox2'
|
|
227
236
|
}
|
|
228
237
|
})),
|
|
229
|
-
asFragment =
|
|
238
|
+
asFragment = _render23.asFragment;
|
|
230
239
|
|
|
231
240
|
expect(asFragment()).toMatchSnapshot();
|
|
232
241
|
});
|
|
233
242
|
test('rendering ally ariaLabel , ariaLabelledby, ariaHidden,ariaChecked,role false and entering their values', function () {
|
|
234
|
-
var
|
|
243
|
+
var _render24 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
|
|
235
244
|
checked: true,
|
|
236
245
|
a11y: {
|
|
237
246
|
ariaLabel: 'ariaLabelCheckBox',
|
|
@@ -241,7 +250,7 @@ describe('CheckBox component', function () {
|
|
|
241
250
|
role: 'checkBox3'
|
|
242
251
|
}
|
|
243
252
|
})),
|
|
244
|
-
asFragment =
|
|
253
|
+
asFragment = _render24.asFragment;
|
|
245
254
|
|
|
246
255
|
expect(asFragment()).toMatchSnapshot();
|
|
247
256
|
});
|