@dhis2-ui/switch 10.0.0-alpha.5 → 10.0.0-alpha.7
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.
|
@@ -56,7 +56,7 @@ class Switch extends _react.Component {
|
|
|
56
56
|
render() {
|
|
57
57
|
const {
|
|
58
58
|
'aria-label': ariaLabel,
|
|
59
|
-
checked,
|
|
59
|
+
checked = false,
|
|
60
60
|
className,
|
|
61
61
|
disabled,
|
|
62
62
|
error,
|
|
@@ -67,8 +67,8 @@ class Switch extends _react.Component {
|
|
|
67
67
|
value,
|
|
68
68
|
warning,
|
|
69
69
|
dense,
|
|
70
|
-
dataTest,
|
|
71
|
-
role
|
|
70
|
+
dataTest = 'dhis2-uicore-switch',
|
|
71
|
+
role = 'switch'
|
|
72
72
|
} = this.props;
|
|
73
73
|
const classes = (0, _classnames.default)({
|
|
74
74
|
checked,
|
|
@@ -112,11 +112,11 @@ class Switch extends _react.Component {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
exports.Switch = Switch;
|
|
115
|
-
Switch
|
|
115
|
+
_defineProperty(Switch, "defaultProps", {
|
|
116
116
|
checked: false,
|
|
117
117
|
dataTest: 'dhis2-uicore-switch',
|
|
118
118
|
role: 'switch'
|
|
119
|
-
};
|
|
119
|
+
});
|
|
120
120
|
Switch.propTypes = {
|
|
121
121
|
/** Sets an aria-label attribute on the input */
|
|
122
122
|
'aria-label': _propTypes.default.string,
|
|
@@ -47,7 +47,7 @@ const SwitchField = _ref2 => {
|
|
|
47
47
|
required,
|
|
48
48
|
helpText,
|
|
49
49
|
validationText,
|
|
50
|
-
dataTest
|
|
50
|
+
dataTest = 'dhis2-uiwidgets-switchfield'
|
|
51
51
|
} = _ref2;
|
|
52
52
|
return /*#__PURE__*/_react.default.createElement(_field.Field, {
|
|
53
53
|
className: className,
|
|
@@ -83,9 +83,6 @@ const SwitchField = _ref2 => {
|
|
|
83
83
|
}));
|
|
84
84
|
};
|
|
85
85
|
exports.SwitchField = SwitchField;
|
|
86
|
-
SwitchField.defaultProps = {
|
|
87
|
-
dataTest: 'dhis2-uiwidgets-switchfield'
|
|
88
|
-
};
|
|
89
86
|
SwitchField.propTypes = {
|
|
90
87
|
checked: _propTypes.default.bool,
|
|
91
88
|
className: _propTypes.default.string,
|
|
@@ -47,7 +47,7 @@ class Switch extends Component {
|
|
|
47
47
|
render() {
|
|
48
48
|
const {
|
|
49
49
|
'aria-label': ariaLabel,
|
|
50
|
-
checked,
|
|
50
|
+
checked = false,
|
|
51
51
|
className,
|
|
52
52
|
disabled,
|
|
53
53
|
error,
|
|
@@ -58,8 +58,8 @@ class Switch extends Component {
|
|
|
58
58
|
value,
|
|
59
59
|
warning,
|
|
60
60
|
dense,
|
|
61
|
-
dataTest,
|
|
62
|
-
role
|
|
61
|
+
dataTest = 'dhis2-uicore-switch',
|
|
62
|
+
role = 'switch'
|
|
63
63
|
} = this.props;
|
|
64
64
|
const classes = cx({
|
|
65
65
|
checked,
|
|
@@ -102,11 +102,11 @@ class Switch extends Component {
|
|
|
102
102
|
}, [`label.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;color:${colors.grey900};font-size:14px;line-height:19px;}`, "label.dense.__jsx-style-dynamic-selector{font-size:14px;line-height:16px;}", `label.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;color:${theme.disabled};}`, "input.__jsx-style-dynamic-selector{opacity:0;position:absolute;height:18px;width:35px;margin-left:3px;}", "label.dense.__jsx-style-dynamic-selector input.__jsx-style-dynamic-selector{height:14px;width:27px;}", ".icon.__jsx-style-dynamic-selector{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:5px;border:2px solid transparent;padding:1px;border-radius:14px;}", "label.dense.__jsx-style-dynamic-selector .icon.__jsx-style-dynamic-selector{margin-right:3px;border-radius:12px;}", `input.__jsx-style-dynamic-selector:focus+.icon.__jsx-style-dynamic-selector{outline:3px solid ${theme.focus};outline-offset:-3px;}`]));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
Switch
|
|
105
|
+
_defineProperty(Switch, "defaultProps", {
|
|
106
106
|
checked: false,
|
|
107
107
|
dataTest: 'dhis2-uicore-switch',
|
|
108
108
|
role: 'switch'
|
|
109
|
-
};
|
|
109
|
+
});
|
|
110
110
|
Switch.propTypes = {
|
|
111
111
|
/** Sets an aria-label attribute on the input */
|
|
112
112
|
'aria-label': PropTypes.string,
|
|
@@ -40,7 +40,7 @@ const SwitchField = _ref2 => {
|
|
|
40
40
|
required,
|
|
41
41
|
helpText,
|
|
42
42
|
validationText,
|
|
43
|
-
dataTest
|
|
43
|
+
dataTest = 'dhis2-uiwidgets-switchfield'
|
|
44
44
|
} = _ref2;
|
|
45
45
|
return /*#__PURE__*/React.createElement(Field, {
|
|
46
46
|
className: className,
|
|
@@ -75,9 +75,6 @@ const SwitchField = _ref2 => {
|
|
|
75
75
|
initialFocus: initialFocus
|
|
76
76
|
}));
|
|
77
77
|
};
|
|
78
|
-
SwitchField.defaultProps = {
|
|
79
|
-
dataTest: 'dhis2-uiwidgets-switchfield'
|
|
80
|
-
};
|
|
81
78
|
SwitchField.propTypes = {
|
|
82
79
|
checked: PropTypes.bool,
|
|
83
80
|
className: PropTypes.string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/switch",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.7",
|
|
4
4
|
"description": "UI Switch",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2-ui/field": "10.0.0-alpha.
|
|
37
|
-
"@dhis2-ui/required": "10.0.0-alpha.
|
|
38
|
-
"@dhis2/ui-constants": "10.0.0-alpha.
|
|
36
|
+
"@dhis2-ui/field": "10.0.0-alpha.7",
|
|
37
|
+
"@dhis2-ui/required": "10.0.0-alpha.7",
|
|
38
|
+
"@dhis2/ui-constants": "10.0.0-alpha.7",
|
|
39
39
|
"classnames": "^2.3.1",
|
|
40
40
|
"prop-types": "^15.7.2"
|
|
41
41
|
},
|