Skip to content

Commit bfcdb7c

Browse files
committed
v1.1.1
1 parent a4c8b63 commit bfcdb7c

9 files changed

+16
-9
lines changed

docs/asset-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"index.css": "static/css/index.3f27b5d0.chunk.css",
3-
"index.js": "static/js/index.3f27b5d0.chunk.js",
2+
"index.css": "static/css/index.0d5bbde3.chunk.css",
3+
"index.js": "static/js/index.0d5bbde3.chunk.js",
44
"runtime-index.js": "static/js/runtime-index.92eae014.js",
55
"static/js/2.979b8646.chunk.js": "static/js/2.979b8646.chunk.js",
66
"index.html": "index.html"

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html style="width:100%;height:100%;overflow:auto"><head><meta charset="utf-8"/><title>Checkbox</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"/><style>.demo{width:1100px;height:500px;margin:50px auto;background:#fff;font-size:12px;overflow:auto}.rw-layout-content{height:200px}.rw-layout.rw-layout-has-sider{text-align:center;background:#3ba0e9}.rw-layout-sider{width:200px;text-align:center;background:#3ba0e9;color:#fff}.rw-layout-footer,.rw-layout-header{background:#7dbcea;color:#fff;height:64px;line-height:64px;text-align:center}.rw-layout-content{background:#108ee9;color:#fff;text-align:center}</style><link href="static/css/index.3f27b5d0.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime-index.92eae014.js"></script><script src="static/js/2.979b8646.chunk.js"></script><script src="static/js/index.3f27b5d0.chunk.js"></script></body></html>
1+
<!doctype html><html style="width:100%;height:100%;overflow:auto"><head><meta charset="utf-8"/><title>Checkbox</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"/><style>.demo{width:1100px;height:500px;margin:50px auto;background:#fff;font-size:12px;overflow:auto}.rw-layout-content{height:200px}.rw-layout.rw-layout-has-sider{text-align:center;background:#3ba0e9}.rw-layout-sider{width:200px;text-align:center;background:#3ba0e9;color:#fff}.rw-layout-footer,.rw-layout-header{background:#7dbcea;color:#fff;height:64px;line-height:64px;text-align:center}.rw-layout-content{background:#108ee9;color:#fff;text-align:center}</style><link href="static/css/index.0d5bbde3.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime-index.92eae014.js"></script><script src="static/js/2.979b8646.chunk.js"></script><script src="static/js/index.0d5bbde3.chunk.js"></script></body></html>

docs/static/js/index.0d5bbde3.chunk.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/index.3f27b5d0.chunk.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-widget-checkbox",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "rw-widget-checkbox",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

src/Checkbox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { RWCheckbox, RWCheckboxProps } from "./RWCheckbox";
55
import { CheckboxGroup } from "./CheckboxGroup";
66

77
export interface CheckboxProps
8-
extends Omit<RWCheckboxProps, "onChange" | "onMouseEnter" | "onMouseLeave"> {
8+
extends Omit<RWCheckboxProps, "onChange" | "onMouseEnter" | "onMouseLeave" | "type"> {
99
name?: string;
1010
value?: any;
1111
onChange?: (checked: boolean, e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -65,6 +65,7 @@ export const Checkbox: React.FC<CheckboxProps> & { Group: typeof CheckboxGroup }
6565
>
6666
<RWCheckbox
6767
{...restProps}
68+
type="checkbox"
6869
name={name}
6970
checked={checked}
7071
onChange={handleChange}

src/RWCheckbox.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import classNames from "classnames";
33

44
export interface RWCheckboxProps extends React.HTMLAttributes<HTMLInputElement> {
5+
type: "checkbox" | "radio";
56
prefixCls: string;
67
className?: string;
78
name?: string;
@@ -10,16 +11,18 @@ export interface RWCheckboxProps extends React.HTMLAttributes<HTMLInputElement>
1011
disabled?: boolean;
1112
readOnly?: boolean;
1213
indeterminate?: boolean;
14+
inputRef?: React.RefObject<HTMLInputElement>;
1315
}
1416

1517
export interface RWCheckboxState {
1618
checked: boolean;
1719
}
1820

1921
export class RWCheckbox extends React.Component<RWCheckboxProps, RWCheckboxState> {
20-
static defaultProps = {
22+
static defaultProps: RWCheckboxProps = {
2123
prefixCls: "rw-checkbox",
2224
defaultChecked: false,
25+
type: "checkbox",
2326
};
2427

2528
static getDerivedStateFromProps(props: RWCheckboxProps, state: RWCheckboxState) {
@@ -57,6 +60,8 @@ export class RWCheckbox extends React.Component<RWCheckboxProps, RWCheckboxState
5760
disabled,
5861
readOnly,
5962
indeterminate,
63+
type,
64+
inputRef,
6065
...restProps
6166
} = this.props;
6267
let { checked } = this.state;
@@ -75,9 +80,10 @@ export class RWCheckbox extends React.Component<RWCheckboxProps, RWCheckboxState
7580
<span className={classString} style={style}>
7681
<input
7782
{...restProps}
83+
ref={inputRef}
7884
className={inputClassString}
7985
name={name}
80-
type="checkbox"
86+
type={type}
8187
readOnly={readOnly}
8288
disabled={disabled}
8389
checked={!!checked}

0 commit comments

Comments
 (0)