@ray-js/components 1.4.24 → 1.4.26
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Camera/Camera.d.ts +2 -1
- package/lib/Camera/Camera.js +0 -2
- package/lib/CheckboxGroup/CheckboxGroup.thing.js +4 -2
- package/lib/CheckboxGroup/props.d.ts +15 -5
- package/lib/IpcPlayer/IpcPlayer.d.ts +2 -1
- package/lib/IpcPlayer/IpcPlayer.js +0 -2
- package/lib/NativeVideo/NativeVideo.d.ts +2 -1
- package/lib/NativeVideo/NativeVideo.js +0 -2
- package/lib/RadioGroup/RadioGroup.thing.js +3 -3
- package/lib/RadioGroup/props.d.ts +10 -6
- package/package.json +5 -5
package/lib/Camera/Camera.d.ts
CHANGED
package/lib/Camera/Camera.js
CHANGED
@@ -3,19 +3,21 @@ import { CheckboxGroup as RemaxCheckboxGroup } from '@ray-js/adapter';
|
|
3
3
|
import Checkbox from '../Checkbox';
|
4
4
|
import Label from '../Label';
|
5
5
|
const CheckboxGroup = props => {
|
6
|
+
// @ts-ignore
|
6
7
|
const {
|
7
8
|
options,
|
8
9
|
name,
|
9
10
|
disabled,
|
10
|
-
onChange
|
11
|
+
onChange,
|
11
12
|
children
|
12
13
|
} = props;
|
13
14
|
return /*#__PURE__*/React.createElement(RemaxCheckboxGroup, {
|
14
15
|
name: name,
|
15
16
|
onChange: e => {
|
16
|
-
!disabled && onChange(e);
|
17
|
+
!disabled && (onChange === null || onChange === void 0 ? void 0 : onChange(e));
|
17
18
|
}
|
18
19
|
}, (() => children)() || (() => {
|
20
|
+
if (!options || !Array.isArray(options)) return null;
|
19
21
|
return options.map((item, index) => {
|
20
22
|
var _item$checked;
|
21
23
|
return /*#__PURE__*/React.createElement(Label, {
|
@@ -1,15 +1,25 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { BaseProps } from '../types';
|
2
3
|
import { CheckboxProps } from '../Checkbox/props';
|
3
4
|
export type CheckboxGroupOption = CheckboxProps & {
|
4
5
|
label: string;
|
5
6
|
};
|
6
|
-
export interface
|
7
|
+
export interface ICheckboxGroupWithOptions {
|
8
|
+
options: CheckboxGroupOption[];
|
9
|
+
children?: undefined;
|
10
|
+
}
|
11
|
+
export interface ICheckboxGroupWithChildren {
|
12
|
+
options?: undefined;
|
13
|
+
children: React.ReactNode | React.ReactNode[] | string;
|
14
|
+
}
|
15
|
+
export type CheckboxGroupProps = (ICheckboxGroupWithOptions & BaseCheckboxGroupProps) | (ICheckboxGroupWithChildren & BaseCheckboxGroupProps);
|
16
|
+
export interface BaseCheckboxGroupProps extends Omit<BaseProps, 'children'> {
|
7
17
|
/**
|
8
|
-
* @description.en
|
9
|
-
* @description.zh
|
10
|
-
* @default
|
18
|
+
* @description.en name
|
19
|
+
* @description.zh 姓名
|
20
|
+
* @default undefined
|
11
21
|
*/
|
12
|
-
|
22
|
+
name?: string;
|
13
23
|
/**
|
14
24
|
* @description.en disabled
|
15
25
|
* @description.zh 是否禁用
|
@@ -7,12 +7,11 @@ import Radio from '../Radio';
|
|
7
7
|
import Label from '../Label';
|
8
8
|
import { inlineStyle } from '@ray-js/framework-shared';
|
9
9
|
const RadioGroup = props => {
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
11
10
|
const {
|
12
11
|
options,
|
13
12
|
name,
|
14
13
|
disabled,
|
15
|
-
onChange
|
14
|
+
onChange,
|
16
15
|
children,
|
17
16
|
style
|
18
17
|
} = props,
|
@@ -24,9 +23,10 @@ const RadioGroup = props => {
|
|
24
23
|
style: inlineStyle(style),
|
25
24
|
name: name,
|
26
25
|
onChange: e => {
|
27
|
-
!disabled && onChange(e);
|
26
|
+
!disabled && (onChange === null || onChange === void 0 ? void 0 : onChange(e));
|
28
27
|
}
|
29
28
|
}, restProps), (() => children)() || (() => {
|
29
|
+
if (!options || !Array.isArray(options)) return null;
|
30
30
|
return options.map((item, index) => {
|
31
31
|
var _item$checked;
|
32
32
|
return /*#__PURE__*/React.createElement(Label, {
|
@@ -1,15 +1,19 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { BaseProps } from '../types';
|
2
3
|
import { RadioProps } from '../Radio/props';
|
3
4
|
export type RadioGroupOption = RadioProps & {
|
4
5
|
label: string;
|
5
6
|
};
|
6
|
-
export interface
|
7
|
-
/**
|
8
|
-
* @description.en options
|
9
|
-
* @description.zh 组项
|
10
|
-
* @default undefined
|
11
|
-
*/
|
7
|
+
export interface IRadioGroupWithOptions {
|
12
8
|
options: RadioGroupOption[];
|
9
|
+
children?: undefined;
|
10
|
+
}
|
11
|
+
export interface IRadioGroupWithChildren {
|
12
|
+
options?: undefined;
|
13
|
+
children: React.ReactNode | React.ReactNode[] | string;
|
14
|
+
}
|
15
|
+
export type RadioGroupProps = (IRadioGroupWithOptions & BaseRadioGroupProps) | (IRadioGroupWithChildren & BaseRadioGroupProps);
|
16
|
+
export interface BaseRadioGroupProps extends Omit<BaseProps, 'children'> {
|
13
17
|
/**
|
14
18
|
* @description.en name
|
15
19
|
* @description.zh 姓名
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/components",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.26",
|
4
4
|
"description": "Ray basic components",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,8 +29,8 @@
|
|
29
29
|
"dependencies": {
|
30
30
|
"@ray-core/macro": "^0.3.6",
|
31
31
|
"@ray-core/wechat": "^0.3.6",
|
32
|
-
"@ray-js/adapter": "
|
33
|
-
"@ray-js/framework-shared": "
|
32
|
+
"@ray-js/adapter": "1.4.26",
|
33
|
+
"@ray-js/framework-shared": "1.4.26",
|
34
34
|
"ahooks": "^3.7.8",
|
35
35
|
"clsx": "^1.2.1",
|
36
36
|
"core-js": "^3.32.1",
|
@@ -40,11 +40,11 @@
|
|
40
40
|
"style-to-object": "^0.3.0"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
43
|
-
"@ray-js/cli": "
|
43
|
+
"@ray-js/cli": "1.4.26"
|
44
44
|
},
|
45
45
|
"publishConfig": {
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "7981d6aea368513b5248cbc0691f817b7a5c225b"
|
50
50
|
}
|