@ray-js/components 1.4.23 → 1.4.25
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/lib/CheckboxGroup/CheckboxGroup.thing.js +4 -2
- package/lib/CheckboxGroup/props.d.ts +15 -5
- package/lib/RadioGroup/RadioGroup.thing.js +3 -3
- package/lib/RadioGroup/props.d.ts +10 -6
- package/lib/Video/Video.d.ts +3 -0
- package/lib/Video/Video.js +7 -0
- package/lib/Video/Video.thing.d.ts +4 -0
- package/lib/Video/Video.thing.js +6 -0
- package/lib/Video/Video.wechat.d.ts +3 -0
- package/lib/Video/Video.wechat.js +8 -0
- package/lib/Video/index.d.ts +3 -0
- package/lib/Video/index.js +2 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/package.json +5 -5
@@ -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 姓名
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { View } from '@ray-js/components';
|
3
|
+
|
4
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
5
|
+
function Video() {
|
6
|
+
return /*#__PURE__*/React.createElement(View, null, "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u7AEF\u6682\u672A\u5B9E\u73B0");
|
7
|
+
}
|
8
|
+
export default Video;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -31,4 +31,5 @@ export { default as Map } from './Map';
|
|
31
31
|
export { default as Camera } from './Camera';
|
32
32
|
export { default as Progress } from './Progress';
|
33
33
|
export { default as Iframe } from './Iframe';
|
34
|
-
export { default as Modal } from './Modal';
|
34
|
+
export { default as Modal } from './Modal';
|
35
|
+
export { default as Video } from './Video';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/components",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.25",
|
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": "^1.4.
|
33
|
-
"@ray-js/framework-shared": "^1.4.
|
32
|
+
"@ray-js/adapter": "^1.4.25",
|
33
|
+
"@ray-js/framework-shared": "^1.4.25",
|
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": "^1.4.
|
43
|
+
"@ray-js/cli": "^1.4.25"
|
44
44
|
},
|
45
45
|
"publishConfig": {
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "1f7733e15d0e83677ca7a14c60bb03b4b7ddb783"
|
50
50
|
}
|