@ray-js/components 1.4.24 → 1.4.26

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,3 +1,4 @@
1
1
  import React from 'react';
2
- declare const Camera: () => React.JSX.Element;
2
+ import { CameraProps } from '@ray-js/adapter';
3
+ declare const Camera: React.FC<CameraProps>;
3
4
  export default Camera;
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
-
3
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
2
  const Camera = () => {
5
3
  return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
6
4
  };
@@ -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 CheckboxGroupProps extends BaseProps {
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 options
9
- * @description.zh 群组项 (Web 端非必填)
10
- * @default null
18
+ * @description.en name
19
+ * @description.zh 姓名
20
+ * @default undefined
11
21
  */
12
- options?: CheckboxGroupOption[];
22
+ name?: string;
13
23
  /**
14
24
  * @description.en disabled
15
25
  * @description.zh 是否禁用
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- declare const IpcPlayer: () => React.JSX.Element;
2
+ import { IpcPlayerProps } from '@ray-js/adapter';
3
+ declare const IpcPlayer: React.FC<IpcPlayerProps>;
3
4
  export default IpcPlayer;
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
-
3
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
2
  const IpcPlayer = () => {
5
3
  return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
6
4
  };
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- declare const NativeVideo: () => React.JSX.Element;
2
+ import { NativeVideoProps } from '@ray-js/adapter';
3
+ declare const NativeVideo: React.FC<NativeVideoProps>;
3
4
  export default NativeVideo;
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
-
3
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
2
  const NativeVideo = () => {
5
3
  return /*#__PURE__*/React.createElement("div", null, "web\u7AEF\u6682\u672A\u5B9E\u73B0");
6
4
  };
@@ -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 RadioGroupProps extends BaseProps {
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.24",
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": "^1.4.24",
33
- "@ray-js/framework-shared": "^1.4.24",
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": "^1.4.24"
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": "5f3689fa6a6843dbc27b9266777873ef876b5e11"
49
+ "gitHead": "7981d6aea368513b5248cbc0691f817b7a5c225b"
50
50
  }