New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@uiw/react-radio

Package Overview
Dependencies
Maintainers
2
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-radio - npm Package Compare versions

Comparing version 4.21.23 to 5.0.0-bate.2.0

cjs/style/index.d.ts

2

cjs/index.d.ts

@@ -5,4 +5,6 @@ export * from './Radio';

export * from './RadioButton';
export * from './style';
export { default as Radio } from './Radio';
export { default as RadioGroup } from './RadioGroup';
export { default as RadioButton } from './RadioButton';
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,14 @@ "use strict";

});
var _style = require("./style");
Object.keys(_style).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _style[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _style[key];
}
});
});
//# sourceMappingURL=index.js.map

2

cjs/Radio.d.ts
import React from 'react';
import { RadioAbstractProps } from './RadioAbstract';
import './style/index.less';
export interface RadioProps extends RadioAbstractProps {

@@ -8,1 +7,2 @@ }

export default Radio;
//# sourceMappingURL=Radio.d.ts.map

@@ -14,1 +14,2 @@ import React from 'react';

export declare const RadioAbstract: React.ForwardRefExoticComponent<RadioAbstractProps & React.RefAttributes<HTMLInputElement>>;
//# sourceMappingURL=RadioAbstract.d.ts.map

@@ -13,2 +13,3 @@ "use strict";

var _react = _interopRequireWildcard(require("react"));
var _style = require("./style");
var _jsxRuntime = require("react/jsx-runtime");

@@ -61,15 +62,18 @@ var _excluded = ["prefixCls", "type", "disabled", "value", "className", "style", "children", "size", "checked", "onChange"];

var label = children || value;
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_style.RadioBase, {
className: cls,
style: style,
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
disabled: disabled,
size: size,
checked: checked,
label: label,
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_style.RadioInputStyleBase, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
type: type,
disabled: disabled,
value: value
value: value,
checked: checked
})), {}, {
checked: checked,
onChange: handleChange,
ref: ref
})), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
className: "".concat(prefixCls, "-text"),
})), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.RadioText, {
children: label

@@ -76,0 +80,0 @@ })]

@@ -13,3 +13,4 @@ import React from 'react';

}
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "color" | "content" | "translate" | "value" | "hidden" | "cite" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "prefixCls"> & React.RefAttributes<any>>;
export declare const RadioButton: React.ForwardRefExoticComponent<Omit<RadioButtonProps, "ref"> & React.RefAttributes<any>>;
export default RadioButton;
//# sourceMappingURL=RadioButton.d.ts.map

@@ -56,3 +56,2 @@ "use strict";

}, [props.checked]);
console.log('props.checked', props.checked);
function handleChange(e) {

@@ -59,0 +58,0 @@ e.persist();

import React from 'react';
import { IProps, HTMLDivProps } from '@uiw/utils';
import { RadioProps } from './Radio';
import './style/group.less';
export interface RadioGroupProps extends IProps, HTMLDivProps {

@@ -12,1 +11,2 @@ name?: RadioProps['name'];

export default RadioGroup;
//# sourceMappingURL=RadioGroup.d.ts.map

@@ -12,2 +12,3 @@ "use strict";

var _reactButtonGroup = _interopRequireDefault(require("@uiw/react-button-group"));
var _style = require("./style");
var _jsxRuntime = require("react/jsx-runtime");

@@ -24,3 +25,3 @@ var _excluded = ["prefixCls", "className", "name", "value", "onChange", "children"];

other = (0, _objectWithoutProperties2["default"])(props, _excluded);
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.RadioGroupBase, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
ref: ref,

@@ -27,0 +28,0 @@ className: [prefixCls, className].filter(Boolean).join(' ').trim(),

@@ -5,4 +5,6 @@ export * from './Radio';

export * from './RadioButton';
export * from './style';
export { default as Radio } from './Radio';
export { default as RadioGroup } from './RadioGroup';
export { default as RadioButton } from './RadioButton';
//# sourceMappingURL=index.d.ts.map

@@ -5,2 +5,3 @@ export * from './Radio';

export * from './RadioButton';
export * from './style';
export { default as Radio } from './Radio';

@@ -7,0 +8,0 @@ export { default as RadioGroup } from './RadioGroup';

import React from 'react';
import { RadioAbstractProps } from './RadioAbstract';
import './style/index.less';
export interface RadioProps extends RadioAbstractProps {

@@ -8,1 +7,2 @@ }

export default Radio;
//# sourceMappingURL=Radio.d.ts.map
import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { RadioAbstract } from './RadioAbstract';
import "./style/index.css";
import { jsx as _jsx } from "react/jsx-runtime";

@@ -6,0 +5,0 @@ export var Radio = /*#__PURE__*/React.forwardRef((props, ref) => {

@@ -14,1 +14,2 @@ import React from 'react';

export declare const RadioAbstract: React.ForwardRefExoticComponent<RadioAbstractProps & React.RefAttributes<HTMLInputElement>>;
//# sourceMappingURL=RadioAbstract.d.ts.map

@@ -5,2 +5,8 @@ import _extends from "@babel/runtime/helpers/extends";

import React, { useState, useMemo } from 'react';
import { RadioText, RadioBase, RadioInputStyleBase } from './style';
/**
* Constructs a type by picking all properties from `HTMLInputProps` and then removing `size`.
* Omit: https://www.typescriptlang.org/docs/handbook/utility-types.html#omittk
*/
import { jsx as _jsx } from "react/jsx-runtime";

@@ -44,15 +50,18 @@ import { jsxs as _jsxs } from "react/jsx-runtime";

var label = children || value;
return /*#__PURE__*/_jsxs("label", {
return /*#__PURE__*/_jsxs(RadioBase, {
className: cls,
style,
children: [/*#__PURE__*/_jsx("input", _extends({}, _extends({}, other, {
disabled,
size,
checked,
label,
children: [/*#__PURE__*/_jsx(RadioInputStyleBase, _extends({}, _extends({}, other, {
type,
disabled,
value
value,
checked
}), {
checked: checked,
onChange: handleChange,
ref: ref
})), label && /*#__PURE__*/_jsx("div", {
className: prefixCls + "-text",
})), label && /*#__PURE__*/_jsx(RadioText, {
children: label

@@ -59,0 +68,0 @@ })]

@@ -13,3 +13,4 @@ import React from 'react';

}
export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "color" | "content" | "translate" | "value" | "hidden" | "cite" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "dir" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "prefixCls"> & React.RefAttributes<any>>;
export declare const RadioButton: React.ForwardRefExoticComponent<Omit<RadioButtonProps, "ref"> & React.RefAttributes<any>>;
export default RadioButton;
//# sourceMappingURL=RadioButton.d.ts.map

@@ -42,3 +42,2 @@ import _extends from "@babel/runtime/helpers/extends";

}, [props.checked]);
console.log('props.checked', props.checked);
function handleChange(e) {

@@ -45,0 +44,0 @@ e.persist();

import React from 'react';
import { IProps, HTMLDivProps } from '@uiw/utils';
import { RadioProps } from './Radio';
import './style/group.less';
export interface RadioGroupProps extends IProps, HTMLDivProps {

@@ -12,1 +11,2 @@ name?: RadioProps['name'];

export default RadioGroup;
//# sourceMappingURL=RadioGroup.d.ts.map

@@ -6,3 +6,3 @@ import _extends from "@babel/runtime/helpers/extends";

import ButtonGroup from '@uiw/react-button-group';
import "./style/group.css";
import { RadioGroupBase } from './style';
import { jsx as _jsx } from "react/jsx-runtime";

@@ -19,3 +19,3 @@ export var RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {

other = _objectWithoutPropertiesLoose(props, _excluded);
return /*#__PURE__*/_jsx("div", _extends({}, other, {
return /*#__PURE__*/_jsx(RadioGroupBase, _extends({}, other, {
ref: ref,

@@ -22,0 +22,0 @@ className: [prefixCls, className].filter(Boolean).join(' ').trim(),

{
"name": "@uiw/react-radio",
"version": "4.21.23",
"version": "5.0.0-bate.2.0",
"description": "Radio component",

@@ -44,9 +44,10 @@ "author": "Kenny Wong <wowohoo@qq.com>",

"react": ">=16.9.0",
"react-dom": ">=16.9.0"
"react-dom": ">=16.9.0",
"styled-components": ">=5.3.5"
},
"dependencies": {
"@uiw/react-button": "^4.21.23",
"@uiw/react-button-group": "^4.21.23",
"@uiw/utils": "^4.21.23"
"@uiw/react-button": "^5.0.0-bate.2.0",
"@uiw/react-button-group": "^5.0.0-bate.2.0",
"@uiw/utils": "^5.0.0-bate.2.0"
}
}

@@ -20,19 +20,18 @@ Radio 单选框

```jsx mdx:preview&bg=#fff
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true
import React from 'react';
import { Radio, RadioButton } from 'uiw';
export default function Demo() {
return (
<div>
<Radio value="1">Radio</Radio>
<Radio value="2" checked>选中</Radio>
<Radio value="3" disabled>禁用</Radio>
<Radio value="4" checked disabled>选中并禁用</Radio>
<Radio value="4" checked disabled>选中并禁用</Radio>
<RadioButton value="5" >RadioButton</RadioButton>
<RadioButton value="5" checked >RadioButton 选中</RadioButton>
</div>
);
}
const Demo = () => (
<div>
<Radio value="1">Radio</Radio>
<Radio value="2" checked>选中</Radio>
<Radio value="3" disabled>禁用</Radio>
<Radio value="4" checked disabled>选中并禁用</Radio>
<Radio value="4" checked disabled>选中并禁用</Radio>
<RadioButton value="5" >RadioButton</RadioButton>
<RadioButton value="5" checked >RadioButton 选中</RadioButton>
</div>
);
export default Demo
```

@@ -42,92 +41,92 @@

```jsx mdx:preview&bg=#fff
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true
import React from 'react';
import { Form, Radio, RadioGroup, RadioButton, Row, Col, Button, Notify } from 'uiw';
export default function Demo() {
return (
<Form
onChange={({ initial, current }) => {}}
resetOnSubmit={false}
onSubmitError={(error) => error && error.filed ? { ...error.filed } : null}
onSubmit={({initial, current}) => {
const ErrObj = {};
if (current.radioGroup === 'unknown') {
ErrObj.radioGroup = '请选择性别!';
}
const Demo = () => (
<Form
onChange={({ initial, current }) => {}}
resetOnSubmit={false}
onSubmitError={(error) => error && error.filed ? { ...error.filed } : null}
onSubmit={({initial, current}) => {
const ErrObj = {};
if (current.radioGroup === 'unknown') {
ErrObj.radioGroup = '请选择性别!';
}
if(Object.keys(ErrObj).length > 0) {
const err = new Error();
err.filed = ErrObj;
throw err;
}
if(Object.keys(ErrObj).length > 0) {
const err = new Error();
err.filed = ErrObj;
throw err;
}
Notify.success({
title: '提交成功!', description: `填写:【填写成功】!`
});
}}
fields={{
radioGroup: {
value: 'girl',
label: '请输入内容',
help: '必须选择性别!',
children: (
<RadioGroup>
<Radio value="man">男</Radio>
<Radio value="girl">女</Radio>
<Radio value="shemale">中性</Radio>
<Radio value="unknown">未知</Radio>
</RadioGroup>
),
},
radioButtonGroup: {
value: 'girl',
label: '请输入内容',
help: '必须选择性别!',
children: (
<RadioGroup>
<RadioButton value="man">男</RadioButton>
<RadioButton value="girl">女</RadioButton>
<RadioButton value="shemale">中性</RadioButton>
<RadioButton value="unknown">未知</RadioButton>
</RadioGroup>
),
},
radio: {
help: '请选择!该选项为必选!',
validator: (value) => !value ? '必填选项!' : null,
children: <Radio value="man">已阅读</Radio>,
},
}}
>
{({ fields, state, canSubmit }) => {
return (
<div>
<Row>
<Col>{fields.radioGroup}</Col>
</Row>
<Row>
<Col>{fields.radioButtonGroup}</Col>
</Row>
<Row>
<Col>{fields.radio}</Col>
</Row>
<Row>
<Col>
<Button disabled={!canSubmit()} type="primary" htmlType="submit">提交</Button>
</Col>
</Row>
<Row>
<Col>
<pre style={{ padding: 10, marginTop: 10 }}>
{JSON.stringify(state.current, null, 2)}
</pre>
</Col>
</Row>
</div>
);
}}
</Form>
);
}
Notify.success({
title: '提交成功!', description: `填写:【填写成功】!`
});
}}
fields={{
radioGroup: {
value: 'girl',
label: '请输入内容',
help: '必须选择性别!',
children: (
<RadioGroup>
<Radio value="man">男</Radio>
<Radio value="girl">女</Radio>
<Radio value="shemale">中性</Radio>
<Radio value="unknown">未知</Radio>
</RadioGroup>
),
},
radioButtonGroup: {
value: 'girl',
label: '请输入内容',
help: '必须选择性别!',
children: (
<RadioGroup>
<RadioButton value="man">男</RadioButton>
<RadioButton value="girl">女</RadioButton>
<RadioButton value="shemale">中性</RadioButton>
<RadioButton value="unknown">未知</RadioButton>
</RadioGroup>
),
},
radio: {
help: '请选择!该选项为必选!',
validator: (value) => !value ? '必填选项!' : null,
children: <Radio value="man">已阅读</Radio>,
},
}}
>
{({ fields, state, canSubmit }) => {
return (
<div>
<Row>
<Col>{fields.radioGroup}</Col>
</Row>
<Row>
<Col>{fields.radioButtonGroup}</Col>
</Row>
<Row>
<Col>{fields.radio}</Col>
</Row>
<Row>
<Col>
<Button disabled={!canSubmit()} type="primary" htmlType="submit">提交</Button>
</Col>
</Row>
<Row>
<Col>
<pre style={{ padding: 10, marginTop: 10 }}>
{JSON.stringify(state.current, null, 2)}
</pre>
</Col>
</Row>
</div>
);
}}
</Form>
);
export default Demo
```

@@ -139,3 +138,3 @@

```jsx mdx:preview&bg=#fff
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true
import React from 'react';

@@ -171,3 +170,3 @@ import { Radio, RadioGroup, RadioButton } from 'uiw';

}
export default Demo;
export default Demo
```

@@ -179,5 +178,5 @@

```jsx mdx:preview&bg=#fff
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true
import React from 'react';
import { Radio, RadioGroup, RadioButton, Divider, Button } from 'uiw';
import { Radio, RadioGroup, Divider, Button,RadioButton } from 'uiw';

@@ -227,3 +226,3 @@ class Demo extends React.Component {

}
export default Demo;
export default Demo
```

@@ -230,0 +229,0 @@

@@ -5,4 +5,5 @@ export * from './Radio';

export * from './RadioButton';
export * from './style';
export { default as Radio } from './Radio';
export { default as RadioGroup } from './RadioGroup';
export { default as RadioButton } from './RadioButton';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc