@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.
@@ -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 是否禁用
@@ -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 姓名
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Video: () => React.JSX.Element;
3
+ export default Video;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
4
+ const Video = () => {
5
+ return /*#__PURE__*/React.createElement("div", null, "Web\u7AEF\u6682\u672A\u5B9E\u73B0");
6
+ };
7
+ export default Video;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { VideoProps } from '@ray-js/adapter';
3
+ declare const Video: React.FC<VideoProps>;
4
+ export default Video;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { Video as RemaxVideo } from '@ray-js/adapter';
3
+ const Video = props => {
4
+ return /*#__PURE__*/React.createElement(RemaxVideo, props);
5
+ };
6
+ export default Video;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare function Video(): React.JSX.Element;
3
+ export default Video;
@@ -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;
@@ -0,0 +1,3 @@
1
+ import Video from './Video';
2
+ export type { VideoProps } from '@ray-js/adapter';
3
+ export default Video;
@@ -0,0 +1,2 @@
1
+ import Video from './Video';
2
+ export default Video;
package/lib/index.d.ts CHANGED
@@ -32,3 +32,4 @@ export { default as Camera } from './Camera';
32
32
  export { default as Progress } from './Progress';
33
33
  export { default as Iframe } from './Iframe';
34
34
  export { default as Modal } from './Modal';
35
+ export { default as Video } from './Video';
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.23",
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.23",
33
- "@ray-js/framework-shared": "^1.4.23",
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.23"
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": "5951cf6623ba2b0ed46df78f25f25ff839a2f2b4"
49
+ "gitHead": "1f7733e15d0e83677ca7a14c60bb03b4b7ddb783"
50
50
  }