@ray-js/components 1.3.1-beta.7 → 1.3.2
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.
@@ -1,37 +1,50 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
+
var _excluded = ["options", "name", "disabled", "onChange", "children", "style"];
|
1
4
|
import "core-js/modules/es.array.map.js";
|
2
5
|
import * as React from 'react';
|
3
6
|
import { RadioGroup as RemaxRadioGroup } from '@ray-js/adapter';
|
4
7
|
import Radio from '../Radio';
|
5
8
|
import Label from '../Label';
|
9
|
+
import { inlineStyle } from '@ray-js/framework-shared';
|
6
10
|
|
7
11
|
var RadioGroup = function (props) {
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
8
13
|
var options = props.options,
|
9
14
|
name = props.name,
|
10
15
|
disabled = props.disabled,
|
11
16
|
_props$onChange = props.onChange,
|
12
17
|
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
13
|
-
children = props.children
|
14
|
-
|
15
|
-
|
16
|
-
onChange: function handleOnChange(e) {
|
17
|
-
!disabled && onChange(e);
|
18
|
-
}
|
19
|
-
}, function renderChildren() {
|
20
|
-
return children;
|
21
|
-
}() || function renderOptions() {
|
22
|
-
return options.map(function (item, index) {
|
23
|
-
var _item$checked;
|
18
|
+
children = props.children,
|
19
|
+
style = props.style,
|
20
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
return (
|
23
|
+
/*#__PURE__*/
|
24
|
+
// @ts-ignore
|
25
|
+
React.createElement(RemaxRadioGroup, _extends({
|
26
|
+
style: inlineStyle(style),
|
27
|
+
name: name,
|
28
|
+
onChange: function handleOnChange(e) {
|
29
|
+
!disabled && onChange(e);
|
30
|
+
}
|
31
|
+
}, restProps), function renderChildren() {
|
32
|
+
return children;
|
33
|
+
}() || function renderOptions() {
|
34
|
+
return options.map(function (item, index) {
|
35
|
+
var _item$checked;
|
36
|
+
|
37
|
+
return /*#__PURE__*/React.createElement(Label, {
|
38
|
+
key: index + '_' + item.value
|
39
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
40
|
+
value: item.value,
|
41
|
+
checked: (_item$checked = item.checked) !== null && _item$checked !== void 0 ? _item$checked : false,
|
42
|
+
disabled: disabled || item.disabled || false,
|
43
|
+
color: item.color
|
44
|
+
}), item.label);
|
45
|
+
});
|
46
|
+
}())
|
47
|
+
);
|
35
48
|
};
|
36
49
|
|
37
50
|
export default RadioGroup;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/components",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.2",
|
4
4
|
"description": "Ray basic components",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -24,10 +24,10 @@
|
|
24
24
|
"watch": "ray start --type=component"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@ray-core/macro": "^0.3.0
|
28
|
-
"@ray-core/wechat": "^0.3.0
|
29
|
-
"@ray-js/adapter": "^1.3.
|
30
|
-
"@ray-js/framework-shared": "^1.3.
|
27
|
+
"@ray-core/macro": "^0.3.0",
|
28
|
+
"@ray-core/wechat": "^0.3.0",
|
29
|
+
"@ray-js/adapter": "^1.3.2",
|
30
|
+
"@ray-js/framework-shared": "^1.3.2",
|
31
31
|
"ahooks": "^3.7.1",
|
32
32
|
"clsx": "^1.1.1",
|
33
33
|
"core-js": "^3.19.1",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
"style-to-object": "^0.3.0"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@ray-js/cli": "^1.3.
|
40
|
+
"@ray-js/cli": "^1.3.2"
|
41
41
|
},
|
42
42
|
"maintainers": [
|
43
43
|
{
|
@@ -45,6 +45,6 @@
|
|
45
45
|
"email": "tuyafe@tuya.com"
|
46
46
|
}
|
47
47
|
],
|
48
|
-
"gitHead": "
|
48
|
+
"gitHead": "a6af0026d8770839d9c1209a9e933b23ed77bf4a",
|
49
49
|
"repository": {}
|
50
50
|
}
|