@zohodesk/components 1.2.26 → 1.2.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/.cli/UnValidatedFiles.html +101 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +12 -4
- package/es/CheckBox/CheckBox.js +10 -0
- package/es/CheckBox/props/propTypes.js +1 -0
- package/es/DateTime/DateWidget.js +13 -4
- package/es/Radio/Radio.js +26 -7
- package/es/Radio/Radio.module.css +3 -0
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
- package/es/Radio/props/defaultProps.js +1 -0
- package/es/Radio/props/propTypes.js +7 -0
- package/es/v1/CheckBox/CheckBox.js +6 -0
- package/es/v1/CheckBox/props/propTypes.js +1 -0
- package/es/v1/DateTime/DateWidget.js +13 -4
- package/es/v1/Radio/Radio.js +22 -7
- package/es/v1/Radio/props/defaultProps.js +1 -0
- package/es/v1/Radio/props/propTypes.js +7 -0
- package/lib/CheckBox/CheckBox.js +34 -24
- package/lib/CheckBox/props/propTypes.js +1 -0
- package/lib/DateTime/DateWidget.js +21 -11
- package/lib/Radio/Radio.js +45 -26
- package/lib/Radio/Radio.module.css +3 -0
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
- package/lib/Radio/props/defaultProps.js +1 -0
- package/lib/Radio/props/propTypes.js +7 -0
- package/lib/v1/CheckBox/CheckBox.js +6 -0
- package/lib/v1/CheckBox/props/propTypes.js +1 -0
- package/lib/v1/DateTime/DateWidget.js +21 -11
- package/lib/v1/Radio/Radio.js +22 -7
- package/lib/v1/Radio/props/defaultProps.js +1 -0
- package/lib/v1/Radio/props/propTypes.js +7 -0
- package/package.json +6 -6
- package/propValidationArg.json +8 -4
- package/result.json +1 -1
package/lib/Radio/Radio.js
CHANGED
|
@@ -21,6 +21,8 @@ var _RadioModule = _interopRequireDefault(require("./Radio.module.css"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
23
|
|
|
24
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
24
26
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
27
|
|
|
26
28
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -53,6 +55,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
53
55
|
|
|
54
56
|
_this = _super.call(this, props);
|
|
55
57
|
_this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
|
|
58
|
+
_this.handleGetRef = _this.handleGetRef.bind(_assertThisInitialized(_this));
|
|
56
59
|
return _this;
|
|
57
60
|
}
|
|
58
61
|
|
|
@@ -64,28 +67,38 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
64
67
|
value = _this$props.value;
|
|
65
68
|
onChange && onChange(value, e);
|
|
66
69
|
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "handleGetRef",
|
|
72
|
+
value: function handleGetRef(ele) {
|
|
73
|
+
var _this$props2 = this.props,
|
|
74
|
+
getRef = _this$props2.getRef,
|
|
75
|
+
value = _this$props2.value;
|
|
76
|
+
getRef && getRef(ele, value);
|
|
77
|
+
}
|
|
67
78
|
}, {
|
|
68
79
|
key: "render",
|
|
69
80
|
value: function render() {
|
|
70
|
-
var _this$
|
|
71
|
-
id = _this$
|
|
72
|
-
name = _this$
|
|
73
|
-
value = _this$
|
|
74
|
-
checked = _this$
|
|
75
|
-
disabled = _this$
|
|
76
|
-
isReadOnly = _this$
|
|
77
|
-
palette = _this$
|
|
78
|
-
disabledTitle = _this$
|
|
79
|
-
title = _this$
|
|
80
|
-
text = _this$
|
|
81
|
-
labelPalette = _this$
|
|
82
|
-
size = _this$
|
|
83
|
-
labelSize = _this$
|
|
84
|
-
variant = _this$
|
|
85
|
-
active = _this$
|
|
86
|
-
isFilled = _this$
|
|
87
|
-
customClass = _this$
|
|
88
|
-
|
|
81
|
+
var _this$props3 = this.props,
|
|
82
|
+
id = _this$props3.id,
|
|
83
|
+
name = _this$props3.name,
|
|
84
|
+
value = _this$props3.value,
|
|
85
|
+
checked = _this$props3.checked,
|
|
86
|
+
disabled = _this$props3.disabled,
|
|
87
|
+
isReadOnly = _this$props3.isReadOnly,
|
|
88
|
+
palette = _this$props3.palette,
|
|
89
|
+
disabledTitle = _this$props3.disabledTitle,
|
|
90
|
+
title = _this$props3.title,
|
|
91
|
+
text = _this$props3.text,
|
|
92
|
+
labelPalette = _this$props3.labelPalette,
|
|
93
|
+
size = _this$props3.size,
|
|
94
|
+
labelSize = _this$props3.labelSize,
|
|
95
|
+
variant = _this$props3.variant,
|
|
96
|
+
active = _this$props3.active,
|
|
97
|
+
isFilled = _this$props3.isFilled,
|
|
98
|
+
customClass = _this$props3.customClass,
|
|
99
|
+
customProps = _this$props3.customProps,
|
|
100
|
+
children = _this$props3.children,
|
|
101
|
+
a11y = _this$props3.a11y;
|
|
89
102
|
var _customClass$customRa = customClass.customRadioWrap,
|
|
90
103
|
customRadioWrap = _customClass$customRa === void 0 ? '' : _customClass$customRa,
|
|
91
104
|
_customClass$customRa2 = customClass.customRadio,
|
|
@@ -97,13 +110,18 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
97
110
|
var ariaHidden = a11y.ariaHidden,
|
|
98
111
|
_a11y$role = a11y.role,
|
|
99
112
|
role = _a11y$role === void 0 ? 'radio' : _a11y$role,
|
|
113
|
+
tabIndex = a11y.tabIndex,
|
|
100
114
|
_a11y$ariaChecked = a11y.ariaChecked,
|
|
101
115
|
ariaChecked = _a11y$ariaChecked === void 0 ? checked : _a11y$ariaChecked,
|
|
102
116
|
ariaLabel = a11y.ariaLabel,
|
|
103
117
|
ariaLabelledby = a11y.ariaLabelledby,
|
|
104
118
|
_a11y$ariaReadonly = a11y.ariaReadonly,
|
|
105
119
|
ariaReadonly = _a11y$ariaReadonly === void 0 ? isReadOnly || disabled ? true : false : _a11y$ariaReadonly;
|
|
106
|
-
|
|
120
|
+
var _customProps$Containe = customProps.ContainerProps,
|
|
121
|
+
ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe,
|
|
122
|
+
_customProps$LabelPro = customProps.LabelProps,
|
|
123
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro;
|
|
124
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
107
125
|
dataId: value ? value.toLowerCase() : 'RadioComp',
|
|
108
126
|
isCover: false,
|
|
109
127
|
isInline: text ? false : true,
|
|
@@ -113,13 +131,14 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
113
131
|
"data-title": toolTip,
|
|
114
132
|
onClick: !isReadOnly && !disabled ? this.onChange : '',
|
|
115
133
|
"aria-checked": ariaChecked,
|
|
116
|
-
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
134
|
+
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : tabIndex || '0',
|
|
135
|
+
eleRef: this.handleGetRef,
|
|
117
136
|
role: role,
|
|
118
137
|
"aria-Hidden": ariaHidden,
|
|
119
138
|
"aria-label": ariaLabel,
|
|
120
139
|
"aria-labelledby": ariaLabelledby,
|
|
121
140
|
"aria-readonly": ariaReadonly
|
|
122
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
141
|
+
}, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
123
142
|
className: "".concat(_RadioModule["default"].radio, " ").concat(checked ? "".concat(_RadioModule["default"]["rdBox".concat(palette)]) : '', " \n ").concat(isReadOnly || disabled ? '' : "".concat(_RadioModule["default"]["hover".concat(palette)]), " ").concat(_RadioModule["default"][size], " ").concat(isFilled ? _RadioModule["default"].filled : '', " ").concat(_RadioModule["default"]["centerPath".concat(palette)], " ").concat(customRadio)
|
|
124
143
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
125
144
|
type: "hidden",
|
|
@@ -144,17 +163,17 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
144
163
|
}) : null))), text && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
145
164
|
flexible: true,
|
|
146
165
|
className: _RadioModule["default"].text
|
|
147
|
-
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
|
166
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
148
167
|
text: text,
|
|
149
|
-
palette:
|
|
168
|
+
palette: labelPalette,
|
|
150
169
|
size: labelSize,
|
|
151
170
|
type: "title",
|
|
152
171
|
clipped: true,
|
|
153
172
|
dataId: "".concat(text, "_label"),
|
|
154
173
|
variant: variant,
|
|
155
174
|
title: toolTip ? toolTip : text,
|
|
156
|
-
customClass: "".concat(checked && active
|
|
157
|
-
})));
|
|
175
|
+
customClass: "".concat(checked && active ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', " \n ").concat(_RadioModule["default"]["".concat(palette, "Label")], " ").concat(accessMode, " ").concat(customLabel)
|
|
176
|
+
}, LabelProps))), children);
|
|
158
177
|
}
|
|
159
178
|
}]);
|
|
160
179
|
|
|
@@ -1145,7 +1145,7 @@ exports[`Radio rendering the accessMode when disabled 1`] = `
|
|
|
1145
1145
|
data-test-id="boxComponent"
|
|
1146
1146
|
>
|
|
1147
1147
|
<label
|
|
1148
|
-
class="label title medium
|
|
1148
|
+
class="label title medium default font_default
|
|
1149
1149
|
dotted cursor
|
|
1150
1150
|
primaryLabel disabled "
|
|
1151
1151
|
data-id="RadioText_label"
|
|
@@ -1505,7 +1505,7 @@ exports[`Radio rendering the disabled is true 1`] = `
|
|
|
1505
1505
|
data-test-id="boxComponent"
|
|
1506
1506
|
>
|
|
1507
1507
|
<label
|
|
1508
|
-
class="label title medium
|
|
1508
|
+
class="label title medium default font_default
|
|
1509
1509
|
dotted cursor
|
|
1510
1510
|
undefined disabled "
|
|
1511
1511
|
data-id="RadioText_label"
|
|
@@ -1567,7 +1567,7 @@ exports[`Radio rendering the disabledTitle 1`] = `
|
|
|
1567
1567
|
data-test-id="boxComponent"
|
|
1568
1568
|
>
|
|
1569
1569
|
<label
|
|
1570
|
-
class="label title medium
|
|
1570
|
+
class="label title medium default font_default
|
|
1571
1571
|
dotted cursor
|
|
1572
1572
|
primaryLabel disabled "
|
|
1573
1573
|
data-id="RadioText_label"
|
|
@@ -14,6 +14,7 @@ var propTypes = {
|
|
|
14
14
|
checked: _propTypes["default"].bool,
|
|
15
15
|
disabled: _propTypes["default"].bool,
|
|
16
16
|
disabledTitle: _propTypes["default"].string,
|
|
17
|
+
getRef: _propTypes["default"].func,
|
|
17
18
|
id: _propTypes["default"].string,
|
|
18
19
|
isFilled: _propTypes["default"].bool,
|
|
19
20
|
isReadOnly: _propTypes["default"].bool,
|
|
@@ -30,14 +31,20 @@ var propTypes = {
|
|
|
30
31
|
customRadio: _propTypes["default"].string,
|
|
31
32
|
customLabel: _propTypes["default"].string
|
|
32
33
|
}),
|
|
34
|
+
customProps: _propTypes["default"].exact({
|
|
35
|
+
ContainerProps: _propTypes["default"].object,
|
|
36
|
+
LabelProps: _propTypes["default"].object
|
|
37
|
+
}),
|
|
33
38
|
a11y: _propTypes["default"].shape({
|
|
34
39
|
ariaChecked: _propTypes["default"].bool,
|
|
35
40
|
ariaHidden: _propTypes["default"].bool,
|
|
36
41
|
role: _propTypes["default"].string,
|
|
42
|
+
tabIndex: _propTypes["default"].oneOfType(_propTypes["default"].string, _propTypes["default"].number),
|
|
37
43
|
ariaLabelledby: _propTypes["default"].string,
|
|
38
44
|
ariaLabel: _propTypes["default"].string,
|
|
39
45
|
ariaReadonly: _propTypes["default"].bool
|
|
40
46
|
}),
|
|
47
|
+
children: _propTypes["default"].node,
|
|
41
48
|
onChange: _propTypes["default"].func,
|
|
42
49
|
text: _propTypes["default"].string
|
|
43
50
|
};
|
|
@@ -38,6 +38,7 @@ var CheckBox = function CheckBox(props) {
|
|
|
38
38
|
isFilled = props.isFilled,
|
|
39
39
|
isClipped = props.isClipped,
|
|
40
40
|
getRef = props.getRef,
|
|
41
|
+
getContainerRef = props.getContainerRef,
|
|
41
42
|
variant = props.variant,
|
|
42
43
|
active = props.active,
|
|
43
44
|
dataId = props.dataId,
|
|
@@ -53,6 +54,10 @@ var CheckBox = function CheckBox(props) {
|
|
|
53
54
|
onChange && onChange(!checked, e);
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
function handleGetContainerRef(ele) {
|
|
58
|
+
getContainerRef && getContainerRef(ele, id);
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
var _customProps$CheckBox = customProps.CheckBoxProps,
|
|
57
62
|
CheckBoxProps = _customProps$CheckBox === void 0 ? {} : _customProps$CheckBox,
|
|
58
63
|
_customProps$LabelPro = customProps.LabelProps,
|
|
@@ -85,6 +90,7 @@ var CheckBox = function CheckBox(props) {
|
|
|
85
90
|
onClick: isReadOnly || disabled ? null : onChange,
|
|
86
91
|
tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
87
92
|
"aria-checked": ariaChecked,
|
|
93
|
+
eleRef: handleGetContainerRef,
|
|
88
94
|
role: role,
|
|
89
95
|
"aria-label": ariaLabel,
|
|
90
96
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -18,6 +18,7 @@ var propTypes = {
|
|
|
18
18
|
disabled: _propTypes["default"].bool,
|
|
19
19
|
disabledTitle: _propTypes["default"].string,
|
|
20
20
|
getRef: _propTypes["default"].func,
|
|
21
|
+
getContainerRef: _propTypes["default"].func,
|
|
21
22
|
id: _propTypes["default"].string,
|
|
22
23
|
isFilled: _propTypes["default"].bool,
|
|
23
24
|
isClipped: _propTypes["default"].bool,
|
|
@@ -934,8 +934,10 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
934
934
|
|
|
935
935
|
if (isAllowedDateType) {
|
|
936
936
|
// if (focusOrder !== oldFocusOrder) {
|
|
937
|
-
var _this$
|
|
938
|
-
|
|
937
|
+
var _this$state5 = this.state,
|
|
938
|
+
_this$state5$dateForm = _this$state5.dateFormatSelection,
|
|
939
|
+
dateFormatSelection = _this$state5$dateForm === void 0 ? {} : _this$state5$dateForm,
|
|
940
|
+
isFocused = _this$state5.isFocused;
|
|
939
941
|
var _dateFormatSelection$2 = dateFormatSelection.order,
|
|
940
942
|
order = _dateFormatSelection$2 === void 0 ? [] : _dateFormatSelection$2;
|
|
941
943
|
var isPopupOpen = this.props.isPopupOpen; // const { type: oldFocusedType = '' } = order[oldFocusOrder] || {};
|
|
@@ -953,9 +955,17 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
953
955
|
|
|
954
956
|
if (isPopupOpen) {
|
|
955
957
|
if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
958
|
+
if (!isFocused && isYearView) {
|
|
959
|
+
this.DateTimeYearViewToggle(true, oldIsMonthOpen);
|
|
960
|
+
} else {
|
|
961
|
+
this.DateTimeYearViewToggle(true, isMonthOpen);
|
|
962
|
+
}
|
|
963
|
+
} else if (yearViewTypes.indexOf(focusedType) === -1) {
|
|
964
|
+
if (!isFocused && isYearView) {
|
|
965
|
+
this.DateTimeYearViewToggle(isYearView, oldIsMonthOpen);
|
|
966
|
+
} else {
|
|
967
|
+
this.DateTimeYearViewToggle(false, false);
|
|
968
|
+
}
|
|
959
969
|
}
|
|
960
970
|
} // }
|
|
961
971
|
|
|
@@ -1006,12 +1016,12 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1006
1016
|
onError = _this$props11.onError,
|
|
1007
1017
|
startDate = _this$props11.startDate,
|
|
1008
1018
|
endDate = _this$props11.endDate;
|
|
1009
|
-
var _this$
|
|
1010
|
-
_this$
|
|
1011
|
-
value = _this$
|
|
1012
|
-
isError = _this$
|
|
1013
|
-
isDateEdited = _this$
|
|
1014
|
-
isFocused = _this$
|
|
1019
|
+
var _this$state6 = this.state,
|
|
1020
|
+
_this$state6$selected = _this$state6.selected,
|
|
1021
|
+
value = _this$state6$selected === void 0 ? '' : _this$state6$selected,
|
|
1022
|
+
isError = _this$state6.isError,
|
|
1023
|
+
isDateEdited = _this$state6.isDateEdited,
|
|
1024
|
+
isFocused = _this$state6.isFocused;
|
|
1015
1025
|
var showValue = this.handleGetShowValue();
|
|
1016
1026
|
var isAllowedDateType = this.handleGetAllowedType();
|
|
1017
1027
|
var showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
|
package/lib/v1/Radio/Radio.js
CHANGED
|
@@ -19,6 +19,8 @@ var _RadioModule = _interopRequireDefault(require("../../Radio/Radio.module.css"
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
21
|
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
22
24
|
var Radio = function Radio(props) {
|
|
23
25
|
var id = props.id,
|
|
24
26
|
name = props.name,
|
|
@@ -37,6 +39,9 @@ var Radio = function Radio(props) {
|
|
|
37
39
|
active = props.active,
|
|
38
40
|
isFilled = props.isFilled,
|
|
39
41
|
customClass = props.customClass,
|
|
42
|
+
customProps = props.customProps,
|
|
43
|
+
getRef = props.getRef,
|
|
44
|
+
children = props.children,
|
|
40
45
|
a11y = props.a11y;
|
|
41
46
|
var _customClass$customRa = customClass.customRadioWrap,
|
|
42
47
|
customRadioWrap = _customClass$customRa === void 0 ? '' : _customClass$customRa,
|
|
@@ -49,19 +54,28 @@ var Radio = function Radio(props) {
|
|
|
49
54
|
var ariaHidden = a11y.ariaHidden,
|
|
50
55
|
_a11y$role = a11y.role,
|
|
51
56
|
role = _a11y$role === void 0 ? 'radio' : _a11y$role,
|
|
57
|
+
tabIndex = a11y.tabIndex,
|
|
52
58
|
_a11y$ariaChecked = a11y.ariaChecked,
|
|
53
59
|
ariaChecked = _a11y$ariaChecked === void 0 ? checked : _a11y$ariaChecked,
|
|
54
60
|
ariaLabel = a11y.ariaLabel,
|
|
55
61
|
ariaLabelledby = a11y.ariaLabelledby,
|
|
56
62
|
_a11y$ariaReadonly = a11y.ariaReadonly,
|
|
57
63
|
ariaReadonly = _a11y$ariaReadonly === void 0 ? isReadOnly || disabled ? true : false : _a11y$ariaReadonly;
|
|
64
|
+
var _customProps$Containe = customProps.ContainerProps,
|
|
65
|
+
ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe,
|
|
66
|
+
_customProps$LabelPro = customProps.LabelProps,
|
|
67
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro;
|
|
58
68
|
|
|
59
69
|
function onChange(e) {
|
|
60
70
|
var onChange = props.onChange;
|
|
61
71
|
onChange && onChange(value, e);
|
|
62
72
|
}
|
|
63
73
|
|
|
64
|
-
|
|
74
|
+
function handleGetRef(ele) {
|
|
75
|
+
getRef && getRef(ele, value);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
65
79
|
dataId: value ? value.toLowerCase() : 'RadioComp',
|
|
66
80
|
isCover: false,
|
|
67
81
|
isInline: text ? false : true,
|
|
@@ -71,13 +85,14 @@ var Radio = function Radio(props) {
|
|
|
71
85
|
"data-title": toolTip,
|
|
72
86
|
onClick: !isReadOnly && !disabled ? onChange : '',
|
|
73
87
|
"aria-checked": ariaChecked,
|
|
74
|
-
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
88
|
+
tabindex: isReadOnly || disabled || ariaHidden ? '-1' : tabIndex || '0',
|
|
89
|
+
eleRef: handleGetRef,
|
|
75
90
|
role: role,
|
|
76
91
|
"aria-Hidden": ariaHidden,
|
|
77
92
|
"aria-label": ariaLabel,
|
|
78
93
|
"aria-labelledby": ariaLabelledby,
|
|
79
94
|
"aria-readonly": ariaReadonly
|
|
80
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
95
|
+
}, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
81
96
|
className: "".concat(_RadioModule["default"].radio, " ").concat(checked ? "".concat(_RadioModule["default"]["rdBox".concat(palette)]) : '', "\n ").concat(isReadOnly || disabled ? '' : "".concat(_RadioModule["default"]["hover".concat(palette)]), " ").concat(_RadioModule["default"][size], " ").concat(isFilled ? _RadioModule["default"].filled : '', " ").concat(_RadioModule["default"]["centerPath".concat(palette)], " ").concat(customRadio)
|
|
82
97
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
83
98
|
type: "hidden",
|
|
@@ -102,17 +117,17 @@ var Radio = function Radio(props) {
|
|
|
102
117
|
}) : null))), text && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
103
118
|
flexible: true,
|
|
104
119
|
className: _RadioModule["default"].text
|
|
105
|
-
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
106
121
|
text: text,
|
|
107
|
-
palette:
|
|
122
|
+
palette: labelPalette,
|
|
108
123
|
size: labelSize,
|
|
109
124
|
type: "title",
|
|
110
125
|
clipped: true,
|
|
111
126
|
dataId: "".concat(text, "_label"),
|
|
112
127
|
variant: variant,
|
|
113
128
|
title: toolTip ? toolTip : text,
|
|
114
|
-
customClass: "".concat(checked && active
|
|
115
|
-
})));
|
|
129
|
+
customClass: "".concat(checked && active ? "".concat(_RadioModule["default"]["".concat(palette, "checkedActive")]) : '', "\n ").concat(_RadioModule["default"]["".concat(palette, "Label")], " ").concat(accessMode, " ").concat(customLabel)
|
|
130
|
+
}, LabelProps))), children);
|
|
116
131
|
};
|
|
117
132
|
|
|
118
133
|
var _default = Radio;
|
|
@@ -14,6 +14,7 @@ var propTypes = {
|
|
|
14
14
|
checked: _propTypes["default"].bool,
|
|
15
15
|
disabled: _propTypes["default"].bool,
|
|
16
16
|
disabledTitle: _propTypes["default"].string,
|
|
17
|
+
getRef: _propTypes["default"].func,
|
|
17
18
|
id: _propTypes["default"].string,
|
|
18
19
|
isFilled: _propTypes["default"].bool,
|
|
19
20
|
isReadOnly: _propTypes["default"].bool,
|
|
@@ -30,14 +31,20 @@ var propTypes = {
|
|
|
30
31
|
customRadio: _propTypes["default"].string,
|
|
31
32
|
customLabel: _propTypes["default"].string
|
|
32
33
|
}),
|
|
34
|
+
customProps: _propTypes["default"].exact({
|
|
35
|
+
ContainerProps: _propTypes["default"].object,
|
|
36
|
+
LabelProps: _propTypes["default"].object
|
|
37
|
+
}),
|
|
33
38
|
a11y: _propTypes["default"].shape({
|
|
34
39
|
ariaChecked: _propTypes["default"].bool,
|
|
35
40
|
ariaHidden: _propTypes["default"].bool,
|
|
36
41
|
role: _propTypes["default"].string,
|
|
42
|
+
tabIndex: _propTypes["default"].oneOfType(_propTypes["default"].string, _propTypes["default"].number),
|
|
37
43
|
ariaLabelledby: _propTypes["default"].string,
|
|
38
44
|
ariaLabel: _propTypes["default"].string,
|
|
39
45
|
ariaReadonly: _propTypes["default"].bool
|
|
40
46
|
}),
|
|
47
|
+
children: _propTypes["default"].node,
|
|
41
48
|
onChange: _propTypes["default"].func,
|
|
42
49
|
text: _propTypes["default"].string
|
|
43
50
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.28",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"@zohodesk-private/color-variable-preprocessor": "1.2.0",
|
|
67
67
|
"@zohodesk-private/css-variable-migrator": "^1.0.7",
|
|
68
68
|
"@zohodesk-private/node-plugins": "1.1.6",
|
|
69
|
-
"@zohodesk-private/react-prop-validator": "1.2.
|
|
69
|
+
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
70
70
|
"@zohodesk/a11y": "2.2.0",
|
|
71
71
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
72
72
|
"@zohodesk/hooks": "2.0.3",
|
|
73
|
-
"@zohodesk/icons": "1.0.
|
|
74
|
-
"@zohodesk/svg": "1.1.
|
|
73
|
+
"@zohodesk/icons": "1.0.35",
|
|
74
|
+
"@zohodesk/svg": "1.1.11",
|
|
75
75
|
"@zohodesk/utils": "1.3.13",
|
|
76
76
|
"@zohodesk/variables": "1.0.0",
|
|
77
77
|
"@zohodesk/virtualizer": "1.0.3",
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"selectn": "1.1.2"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@zohodesk/icons": "1.0.
|
|
88
|
+
"@zohodesk/icons": "1.0.35",
|
|
89
89
|
"@zohodesk/variables": "1.0.0",
|
|
90
|
-
"@zohodesk/svg": "1.1.
|
|
90
|
+
"@zohodesk/svg": "1.1.11",
|
|
91
91
|
"@zohodesk/virtualizer": "1.0.3",
|
|
92
92
|
"velocity-react": "1.4.3",
|
|
93
93
|
"react-sortable-hoc": "^0.8.3",
|
package/propValidationArg.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputDir": "./src",
|
|
3
3
|
"outputDir": "./.cli",
|
|
4
|
-
"excludeDir":"./.cli",
|
|
5
|
-
"propUnifiExcludeDir":"./.cli",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
4
|
+
"excludeDir": "./.cli",
|
|
5
|
+
"propUnifiExcludeDir": "./.cli",
|
|
6
|
+
"enable": true,
|
|
7
|
+
"need_report": true,
|
|
8
|
+
"prop_validation_strict_mode": true,
|
|
9
|
+
"prop_validation_log": false,
|
|
10
|
+
"prop_unification_strict_mode": true,
|
|
11
|
+
"prop_unification_log": false
|
|
8
12
|
}
|