@para-ui/core 2.2.6 → 2.2.7-beta
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/AutoBox/index.d.ts +34 -34
- package/AutoBox/index.js +203 -15
- package/AutoTips/index.d.ts +27 -27
- package/AutoTips/index.js +84 -15
- package/Breadcrumbs/index.d.ts +39 -39
- package/Breadcrumbs/index.js +227 -15
- package/Button/SplitButton.d.ts +62 -61
- package/Button/index.d.ts +71 -56
- package/Button/index.js +348 -14
- package/Button/lang/en_US.d.ts +4 -4
- package/Button/lang/index.d.ts +9 -9
- package/Button/lang/zh_CN.d.ts +4 -4
- package/ButtonGroup/index.d.ts +33 -33
- package/ButtonGroup/index.js +128 -14
- package/Carousel/index.d.ts +30 -30
- package/Carousel/index.js +74 -15
- package/Cascader/index.d.ts +52 -52
- package/Cascader/index.js +166 -15
- package/Cascader/lang/en_US.d.ts +4 -4
- package/Cascader/lang/index.d.ts +9 -9
- package/Cascader/lang/zh_CN.d.ts +4 -4
- package/Checkbox/index.d.ts +40 -40
- package/Checkbox/index.js +105 -14
- package/CheckboxGroup/index.d.ts +46 -46
- package/CheckboxGroup/index.js +138 -14
- package/Collapse/collapsePanel.d.ts +30 -30
- package/Collapse/index.d.ts +57 -57
- package/Collapse/index.js +171 -15
- package/Collapse/motion.d.ts +5 -5
- package/Collapse/util.d.ts +11 -11
- package/CollapseBox/index.d.ts +27 -27
- package/CollapseBox/index.js +164 -15
- package/CollapseBox/util.d.ts +5 -5
- package/ColorPicker/index.d.ts +4 -4
- package/ColorPicker/index.js +4 -1
- package/ComboSelect/WithTabsCombo/index.d.ts +11 -11
- package/ComboSelect/WithTabsCombo/interface.d.ts +141 -141
- package/ComboSelect/index.d.ts +11 -11
- package/ComboSelect/index.js +1803 -14
- package/ComboSelect/interface.d.ts +140 -143
- package/ComboSelect/lang/en_US.d.ts +8 -8
- package/ComboSelect/lang/index.d.ts +17 -17
- package/ComboSelect/lang/zh_CN.d.ts +8 -8
- package/ComboSelect/utils.d.ts +12 -12
- package/Container/index.d.ts +77 -77
- package/Container/index.js +239 -15
- package/DatePicker/PickerButton.d.ts +3 -3
- package/DatePicker/PickerTag.d.ts +3 -3
- package/DatePicker/generatePicker/generateRangePicker.d.ts +4 -4
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +11 -11
- package/DatePicker/generatePicker/index.d.ts +77 -77
- package/DatePicker/index.d.ts +18 -18
- package/DatePicker/index.js +733 -14
- package/DatePicker/lang/en_US.d.ts +3 -3
- package/DatePicker/lang/index.d.ts +7 -7
- package/DatePicker/lang/zh_CN.d.ts +3 -3
- package/DatePicker/util.d.ts +20 -20
- package/Desktop/index.d.ts +57 -55
- package/Desktop/index.js +853 -14
- package/Drawer/index.d.ts +11 -11
- package/Drawer/index.js +186 -14
- package/Drawer/interface.d.ts +83 -83
- package/Drawer/lang/en_US.d.ts +5 -5
- package/Drawer/lang/index.d.ts +11 -11
- package/Drawer/lang/zh_CN.d.ts +5 -5
- package/Dropdown/index.d.ts +25 -0
- package/Dropdown/index.js +67 -0
- package/Empty/images/index.d.ts +3 -2
- package/Empty/index.d.ts +30 -30
- package/Empty/index.js +644 -14
- package/Empty/lang/en_US.d.ts +6 -6
- package/Empty/lang/index.d.ts +13 -13
- package/Empty/lang/zh_CN.d.ts +6 -6
- package/Form/index.d.ts +181 -181
- package/Form/index.js +384 -14
- package/FormItem/compoments/defaultCompoments/index.d.ts +19 -19
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +8 -8
- package/FormItem/compoments/formFile/index.d.ts +38 -38
- package/FormItem/compoments/formRadioGroup/index.d.ts +8 -8
- package/FormItem/compoments/formSelect/index.d.ts +18 -18
- package/FormItem/errorTips.d.ts +12 -12
- package/FormItem/index.d.ts +152 -152
- package/FormItem/index.js +81 -14
- package/FormItem/itemType.d.ts +42 -42
- package/FormItem/validateFunction.d.ts +15 -15
- package/FunctionModal/dialog.d.ts +58 -58
- package/FunctionModal/index.d.ts +8 -8
- package/FunctionModal/index.js +39 -14
- package/FunctionModal/modalContext.d.ts +15 -14
- package/GlobalContext/componentsProps.d.ts +19 -19
- package/GlobalContext/confirmLocale.d.ts +7 -7
- package/GlobalContext/index.d.ts +28 -28
- package/GlobalContext/index.js +41 -16
- package/GlobalContext/intl.d.ts +34 -34
- package/GlobalContext/useFormatMessage.d.ts +3 -3
- package/Help/index.d.ts +18 -20
- package/Help/index.js +39 -15
- package/HelperText/index.d.ts +19 -19
- package/HelperText/index.js +29 -15
- package/Hooks/useGlobalProps.d.ts +1 -1
- package/InputLang/index.d.ts +49 -49
- package/InputLang/index.js +270 -14
- package/InputNumber/index.d.ts +74 -74
- package/InputNumber/index.js +308 -14
- package/Label/index.d.ts +35 -35
- package/Label/index.js +81 -14
- package/Loading/index.d.ts +17 -17
- package/Loading/index.js +47 -15
- package/Menu/footerExpansion.d.ts +9 -9
- package/Menu/index.d.ts +10 -10
- package/Menu/index.js +1232 -14
- package/Menu/interface.d.ts +139 -139
- package/Menu/logo.d.ts +9 -9
- package/Menu/verticalMenuList.d.ts +14 -14
- package/Message/index.d.ts +73 -73
- package/Message/index.js +222 -15
- package/Modal/Confirm/index.d.ts +65 -66
- package/Modal/index.d.ts +90 -61
- package/Modal/index.js +443 -14
- package/Modal/lang/en_US.d.ts +5 -5
- package/Modal/lang/index.d.ts +11 -11
- package/Modal/lang/zh_CN.d.ts +5 -5
- package/MultiBox/index.d.ts +54 -54
- package/MultiBox/index.js +231 -14
- package/Notification/index.d.ts +52 -52
- package/Notification/index.js +266 -15
- package/OperateBtn/index.d.ts +59 -59
- package/OperateBtn/index.js +260 -14
- package/OperateBtn/lang/en_US.d.ts +4 -4
- package/OperateBtn/lang/index.d.ts +9 -9
- package/OperateBtn/lang/zh_CN.d.ts +4 -4
- package/PageHeader/horizontalMeun.d.ts +9 -9
- package/PageHeader/horizontalMeunRight.d.ts +9 -9
- package/PageHeader/index.d.ts +10 -10
- package/PageHeader/index.js +1171 -14
- package/PageHeader/interface.d.ts +167 -167
- package/Pagination/index.d.ts +33 -33
- package/Pagination/index.js +469 -14
- package/Pagination/lang/en_US.d.ts +8 -8
- package/Pagination/lang/index.d.ts +17 -17
- package/Pagination/lang/zh_CN.d.ts +8 -8
- package/ParauiProvider/index.d.ts +8 -12
- package/ParauiProvider/index.js +53 -15
- package/PopConfirm/index.d.ts +58 -56
- package/PopConfirm/index.js +189 -14
- package/PopConfirm/lang/en_US.d.ts +5 -5
- package/PopConfirm/lang/index.d.ts +11 -11
- package/PopConfirm/lang/zh_CN.d.ts +5 -5
- package/Popover/index.d.ts +14 -14
- package/Popover/index.js +66 -15
- package/Progress/Line.d.ts +47 -47
- package/Progress/Steps.d.ts +17 -17
- package/Progress/index.d.ts +81 -81
- package/Progress/index.js +358 -20
- package/Progress/utils.d.ts +6 -6
- package/Querying/images/index.d.ts +3 -2
- package/Querying/index.d.ts +26 -26
- package/Querying/index.js +762 -14
- package/Querying/lang/en_US.d.ts +4 -4
- package/Querying/lang/index.d.ts +9 -9
- package/Querying/lang/zh_CN.d.ts +4 -4
- package/Radio/index.d.ts +38 -38
- package/Radio/index.js +94 -14
- package/RadioGroup/index.d.ts +47 -47
- package/RadioGroup/index.js +128 -14
- package/Search/index.d.ts +56 -56
- package/Search/index.js +220 -14
- package/Select/index.d.ts +86 -86
- package/Select/index.js +1288 -14
- package/Select/lang/en_US.d.ts +5 -5
- package/Select/lang/index.d.ts +11 -11
- package/Select/lang/zh_CN.d.ts +5 -5
- package/SelectInput/index.d.ts +11 -11
- package/SelectInput/index.js +51 -14
- package/SingleBox/index.d.ts +42 -42
- package/SingleBox/index.js +194 -14
- package/Slider/index.d.ts +14 -14
- package/Slider/index.js +125 -15
- package/Slider/interface.d.ts +102 -102
- package/Split/index.d.ts +7 -7
- package/Split/index.js +134 -15
- package/Stepper/icons.d.ts +5 -5
- package/Stepper/index.d.ts +49 -39
- package/Stepper/index.js +99 -15
- package/Switch/index.d.ts +78 -78
- package/Switch/index.js +73 -14
- package/Table/index.d.ts +10 -10
- package/Table/index.js +2725 -14
- package/Table/interface.d.ts +202 -202
- package/Table/lang/en_US.d.ts +6 -6
- package/Table/lang/index.d.ts +13 -13
- package/Table/lang/zh_CN.d.ts +6 -6
- package/Table/tableBody.d.ts +9 -9
- package/Table/tableBodyElement/index.d.ts +15 -15
- package/Table/tableBodyInterface.d.ts +67 -67
- package/Table/tableContainer/index.d.ts +16 -16
- package/Table/tableElement/index.d.ts +17 -17
- package/Table/tableHead.d.ts +9 -9
- package/Table/tableHeadElement/index.d.ts +15 -15
- package/Table/tableHeadInterface.d.ts +26 -30
- package/Table/tablePagination.d.ts +9 -9
- package/Table/tablePaginationInterFace.d.ts +24 -24
- package/Table/tdElement/index.d.ts +15 -15
- package/Table/thElement/index.d.ts +15 -15
- package/Table/trElement/index.d.ts +15 -15
- package/Table/util.d.ts +16 -16
- package/Tabs/index.d.ts +69 -48
- package/Tabs/index.js +218 -14
- package/Tabs/lang/en_US.d.ts +4 -0
- package/Tabs/lang/index.d.ts +9 -0
- package/Tabs/lang/zh_CN.d.ts +4 -0
- package/Tag/TagGroup.d.ts +66 -66
- package/Tag/index.d.ts +34 -34
- package/Tag/index.js +286 -14
- package/Test/index.d.ts +3 -2
- package/Test/index.js +9 -16
- package/TextField/index.d.ts +93 -93
- package/TextField/index.js +686 -14
- package/TimePicker/index.d.ts +22 -22
- package/TimePicker/index.js +77 -14
- package/TimePicker/locale/en_US.d.ts +3 -3
- package/TimePicker/locale/zh_CN.d.ts +3 -3
- package/TimePicker/style/index.d.ts +1 -1
- package/Timeline/TimelineItem.d.ts +23 -0
- package/Timeline/index.d.ts +31 -22
- package/Timeline/index.js +150 -15
- package/ToggleButton/ToggleButtonGroup.d.ts +49 -49
- package/ToggleButton/index.d.ts +49 -49
- package/ToggleButton/index.js +200 -14
- package/Tooltip/index.d.ts +11 -14
- package/Tooltip/index.js +335 -15
- package/Tooltip/interface.d.ts +21 -0
- package/Tooltip/utils.d.ts +22 -0
- package/Transfer/index.d.ts +18 -17
- package/Transfer/index.js +343 -14
- package/Transfer/lang/en_US.d.ts +6 -6
- package/Transfer/lang/index.d.ts +13 -13
- package/Transfer/lang/zh_CN.d.ts +6 -6
- package/Tree/OperateBar/index.d.ts +13 -13
- package/Tree/Tree.d.ts +4 -4
- package/Tree/index.d.ts +5 -5
- package/Tree/index.js +35 -14
- package/Tree/interface.d.ts +209 -207
- package/Tree/lang/en_US.d.ts +8 -8
- package/Tree/lang/index.d.ts +17 -17
- package/Tree/lang/zh_CN.d.ts +8 -8
- package/Tree/utils/tools.d.ts +26 -26
- package/Tree/utils/treeUtil.d.ts +15 -15
- package/Upload/Dragger/index.d.ts +10 -10
- package/Upload/ErroTip/index.d.ts +13 -13
- package/Upload/ImageUpload/index.d.ts +14 -14
- package/Upload/ImgCrop/EasyCrop.d.ts +17 -17
- package/Upload/ImgCrop/constants.d.ts +7 -7
- package/Upload/ImgCrop/index.d.ts +6 -6
- package/Upload/ImgCrop/interface.d.ts +24 -24
- package/Upload/UploadList/index.d.ts +5 -5
- package/Upload/index.d.ts +15 -15
- package/Upload/index.js +1542 -14
- package/Upload/interface.d.ts +134 -134
- package/Upload/lang/en_US.d.ts +12 -12
- package/Upload/lang/index.d.ts +25 -25
- package/Upload/lang/zh_CN.d.ts +12 -12
- package/_verture/defineProperty-0590dc61.js +16 -0
- package/_verture/index-2c0ecd8d.js +778 -0
- package/_verture/index-342379c6.js +391 -0
- package/_verture/index-a369ca3f.js +4 -0
- package/_verture/index-e2881a53.js +16 -0
- package/_verture/index-ee85b1cd.js +1555 -0
- package/_verture/intl-336570e4.js +65 -0
- package/_verture/modalContext-e7cc8067.js +228 -0
- package/_verture/slicedToArray-d7722f4b.js +62 -0
- package/_verture/style-inject.es-300983ab.js +28 -0
- package/_verture/toConsumableArray-f8047a75.js +19 -0
- package/_verture/tslib.es6-55ed4bd2.js +38 -0
- package/_verture/typeof-498dd2b1.js +11 -0
- package/_verture/useFormatMessage-ac9d6acf.js +20 -0
- package/_verture/useGlobalProps-af9a2af6.js +12 -0
- package/index.d.ts +128 -128
- package/index.js +160 -19
- package/package.json +54 -21
- package/Popper/index.d.ts +0 -13
- package/Popper/index.js +0 -16
- package/README.md +0 -501
- package/cdn/AutoBox/index.js +0 -29
- package/cdn/AutoTips/index.js +0 -40
- package/cdn/Breadcrumbs/index.js +0 -53
- package/cdn/Button/index.js +0 -79
- package/cdn/ButtonGroup/index.js +0 -79
- package/cdn/Carousel/index.js +0 -6
- package/cdn/Cascader/index.js +0 -42
- package/cdn/Checkbox/index.js +0 -53
- package/cdn/CheckboxGroup/index.js +0 -53
- package/cdn/Collapse/index.js +0 -27
- package/cdn/CollapseBox/index.js +0 -1
- package/cdn/ColorPicker/index.js +0 -1
- package/cdn/ComboSelect/index.js +0 -438
- package/cdn/Container/index.js +0 -1
- package/cdn/DatePicker/index.js +0 -185
- package/cdn/Desktop/index.js +0 -24
- package/cdn/Drawer/index.js +0 -84
- package/cdn/Empty/index.js +0 -1
- package/cdn/Form/index.js +0 -477
- package/cdn/FormItem/index.js +0 -477
- package/cdn/FunctionModal/index.js +0 -144
- package/cdn/GlobalContext/index.js +0 -1
- package/cdn/Help/index.js +0 -53
- package/cdn/HelperText/index.js +0 -1
- package/cdn/InputLang/index.js +0 -144
- package/cdn/InputNumber/index.js +0 -118
- package/cdn/Label/index.js +0 -53
- package/cdn/Loading/index.js +0 -14
- package/cdn/Menu/index.js +0 -40
- package/cdn/Message/index.js +0 -53
- package/cdn/Modal/index.js +0 -144
- package/cdn/MultiBox/index.js +0 -131
- package/cdn/Notification/index.js +0 -66
- package/cdn/OperateBtn/index.js +0 -92
- package/cdn/PageHeader/index.js +0 -92
- package/cdn/Pagination/index.js +0 -214
- package/cdn/ParauiProvider/index.js +0 -9
- package/cdn/PopConfirm/index.js +0 -131
- package/cdn/Popover/index.js +0 -16
- package/cdn/Popper/index.js +0 -26
- package/cdn/Progress/index.js +0 -58
- package/cdn/Querying/index.js +0 -1
- package/cdn/Radio/index.js +0 -53
- package/cdn/RadioGroup/index.js +0 -53
- package/cdn/Search/index.js +0 -144
- package/cdn/Select/index.js +0 -131
- package/cdn/SelectInput/index.js +0 -131
- package/cdn/SingleBox/index.js +0 -131
- package/cdn/Slider/index.js +0 -16
- package/cdn/Split/index.js +0 -1
- package/cdn/Stepper/index.js +0 -154
- package/cdn/Switch/index.js +0 -71
- package/cdn/Table/index.js +0 -292
- package/cdn/Tabs/index.js +0 -165
- package/cdn/Tag/index.js +0 -27
- package/cdn/Test/index.js +0 -1
- package/cdn/TextField/index.js +0 -105
- package/cdn/TimePicker/index.js +0 -185
- package/cdn/Timeline/index.js +0 -16
- package/cdn/ToggleButton/index.js +0 -79
- package/cdn/Tooltip/index.js +0 -40
- package/cdn/Transfer/index.js +0 -170
- package/cdn/Tree/index.js +0 -170
- package/cdn/Upload/index.js +0 -252
- package/style.css +0 -72
package/Querying/lang/en_US.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
querying: string;
|
|
3
|
-
};
|
|
4
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
querying: string;
|
|
3
|
+
};
|
|
4
|
+
export default _default;
|
package/Querying/lang/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
zh: {
|
|
3
|
-
querying: string;
|
|
4
|
-
};
|
|
5
|
-
en: {
|
|
6
|
-
querying: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
zh: {
|
|
3
|
+
querying: string;
|
|
4
|
+
};
|
|
5
|
+
en: {
|
|
6
|
+
querying: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
package/Querying/lang/zh_CN.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
querying: string;
|
|
3
|
-
};
|
|
4
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
querying: string;
|
|
3
|
+
};
|
|
4
|
+
export default _default;
|
package/Radio/index.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author linhd
|
|
3
|
-
* @date 2021/8/4 10:20
|
|
4
|
-
* @description 单选框
|
|
5
|
-
*/
|
|
6
|
-
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
-
import { LabelTooltipProps } from '../Label';
|
|
8
|
-
import './index.scss';
|
|
9
|
-
export interface RadioProps {
|
|
10
|
-
/** 样式class */
|
|
11
|
-
className?: string;
|
|
12
|
-
/** style */
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
/** 标题 */
|
|
15
|
-
label?: ReactNode;
|
|
16
|
-
/** 帮组提示信息 */
|
|
17
|
-
labelTooltip?: LabelTooltipProps;
|
|
18
|
-
/** 大小 */
|
|
19
|
-
size?: 'small' | 'medium' | 'large';
|
|
20
|
-
/** 默认值 有值不受控组件 初始化第一次 */
|
|
21
|
-
defaultChecked?: boolean;
|
|
22
|
-
/** 默认值 有值受控组件*/
|
|
23
|
-
checked?: boolean;
|
|
24
|
-
/** 禁用 */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
/** inputProps */
|
|
27
|
-
inputProps?: {
|
|
28
|
-
type?: string;
|
|
29
|
-
value?: any;
|
|
30
|
-
checked?: any;
|
|
31
|
-
[name: string]: any;
|
|
32
|
-
};
|
|
33
|
-
/** 改变事件 */
|
|
34
|
-
onChange?: (e: any, checked: boolean) => void;
|
|
35
|
-
[name: string]: any;
|
|
36
|
-
}
|
|
37
|
-
export declare const Radio: FunctionComponent<RadioProps>;
|
|
38
|
-
export default Radio;
|
|
1
|
+
/**
|
|
2
|
+
* @author linhd
|
|
3
|
+
* @date 2021/8/4 10:20
|
|
4
|
+
* @description 单选框
|
|
5
|
+
*/
|
|
6
|
+
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
+
import { LabelTooltipProps } from '../Label';
|
|
8
|
+
import './index.scss';
|
|
9
|
+
export interface RadioProps {
|
|
10
|
+
/** 样式class */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** style */
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
/** 标题 */
|
|
15
|
+
label?: ReactNode;
|
|
16
|
+
/** 帮组提示信息 */
|
|
17
|
+
labelTooltip?: LabelTooltipProps;
|
|
18
|
+
/** 大小 */
|
|
19
|
+
size?: 'small' | 'medium' | 'large';
|
|
20
|
+
/** 默认值 有值不受控组件 初始化第一次 */
|
|
21
|
+
defaultChecked?: boolean;
|
|
22
|
+
/** 默认值 有值受控组件*/
|
|
23
|
+
checked?: boolean;
|
|
24
|
+
/** 禁用 */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** inputProps */
|
|
27
|
+
inputProps?: {
|
|
28
|
+
type?: string;
|
|
29
|
+
value?: any;
|
|
30
|
+
checked?: any;
|
|
31
|
+
[name: string]: any;
|
|
32
|
+
};
|
|
33
|
+
/** 改变事件 */
|
|
34
|
+
onChange?: (e: any, checked: boolean) => void;
|
|
35
|
+
[name: string]: any;
|
|
36
|
+
}
|
|
37
|
+
export declare const Radio: FunctionComponent<RadioProps>;
|
|
38
|
+
export default Radio;
|
package/Radio/index.js
CHANGED
|
@@ -1,14 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import Label from '../Label/index.js';
|
|
5
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
6
|
+
import '../Help/index.js';
|
|
7
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
8
|
+
import '../Tooltip/index.js';
|
|
9
|
+
import 'rc-tooltip';
|
|
10
|
+
import 'rc-tooltip/lib/placements';
|
|
11
|
+
import 'clsx';
|
|
12
|
+
import '@para-ui/icons/Help';
|
|
13
|
+
|
|
14
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-radio {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n cursor: pointer;\n display: inline-flex;\n align-items: flex-start;\n line-height: 16px;\n}\n.paraui-radio:hover > .paraui-radio-label {\n color: rgba(54, 102, 214, 0.8);\n cursor: pointer;\n}\n.paraui-radio:hover > .paraui-radio-label svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-radio:hover > .paraui-help > .paraui-radio-label {\n color: rgba(54, 102, 214, 0.8);\n cursor: pointer;\n}\n.paraui-radio:hover > .paraui-help > .paraui-radio-label svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-radio:hover > .paraui-radio-box > .paraui-radio-box-inner {\n border-color: rgba(54, 102, 214, 0.8);\n}\n.paraui-radio > .paraui-radio-box {\n position: relative;\n}\n.paraui-radio > .paraui-radio-box > input {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n}\n.paraui-radio > .paraui-radio-box > .paraui-radio-box-inner {\n position: relative;\n top: 0;\n left: 0;\n display: block;\n background-color: white;\n border: 1px solid rgba(171, 176, 185, 0.4);\n border-radius: 50%;\n}\n.paraui-radio > .paraui-radio-box > .paraui-radio-box-inner:after {\n position: absolute;\n display: table;\n content: \" \";\n transform: scale(1) translate(-50%, -50%);\n background-color: white;\n border-radius: 50%;\n left: 50%;\n top: 50%;\n}\n.paraui-radio > .paraui-radio-label {\n color: rgb(46, 55, 67);\n padding: 0 8px;\n margin: 0;\n display: inline-flex;\n align-items: flex-start;\n}\n.paraui-radio > .paraui-radio-label > .paraui-help > svg {\n top: 0;\n}\n.paraui-radio .paraui-label {\n line-height: 16px;\n}\n.paraui-radio > .paraui-help {\n padding: 0 8px;\n}\n.paraui-radio > .paraui-help > .paraui-radio-label {\n color: rgb(46, 55, 67);\n margin: 0;\n display: inline-flex;\n align-items: center;\n}\n.paraui-radio.radio-checked > .paraui-radio-box > .paraui-radio-box-inner {\n border-color: transparent;\n background-color: rgb(54, 102, 214);\n}\n.paraui-radio.radio-checked:hover > .paraui-radio-box > .paraui-radio-box-inner {\n border-color: transparent;\n background-color: rgba(54, 102, 214, 0.8);\n}\n.paraui-radio.radio-disabled {\n cursor: not-allowed;\n}\n.paraui-radio.radio-disabled:hover > .paraui-radio-box > .paraui-radio-box-inner {\n background-color: rgb(245, 246, 247);\n border-color: rgba(171, 176, 185, 0.4);\n}\n.paraui-radio.radio-disabled > .paraui-radio-label {\n color: rgba(46, 55, 67, 0.4);\n cursor: not-allowed;\n}\n.paraui-radio.radio-disabled > .paraui-radio-label svg {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-radio.radio-disabled > .paraui-radio-box > input {\n cursor: not-allowed;\n}\n.paraui-radio.radio-disabled > .paraui-radio-box > .paraui-radio-box-inner {\n background-color: rgb(245, 246, 247);\n border-color: rgba(171, 176, 185, 0.4);\n}\n.paraui-radio.radio-disabled > .paraui-radio-box > .paraui-radio-box-inner:after {\n background-color: rgb(245, 246, 247);\n}\n.paraui-radio.radio-disabled.radio-checked > .paraui-radio-box > .paraui-radio-box-inner:after {\n background-color: rgba(171, 176, 185, 0.4);\n}\n.paraui-radio.radio-disabled > .paraui-help {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-radio.radio-disabled > .paraui-help > .paraui-radio-label {\n color: rgba(46, 55, 67, 0.4);\n cursor: not-allowed;\n}\n.paraui-radio.radio-small > .paraui-radio-box {\n top: 1px;\n}\n.paraui-radio.radio-small > .paraui-radio-box > .paraui-radio-box-inner {\n width: 14px;\n height: 14px;\n}\n.paraui-radio.radio-small > .paraui-radio-box > .paraui-radio-box-inner:after {\n width: 4px;\n height: 4px;\n}\n.paraui-radio.radio-medium > .paraui-radio-box > .paraui-radio-box-inner {\n width: 16px;\n height: 16px;\n}\n.paraui-radio.radio-medium > .paraui-radio-box > .paraui-radio-box-inner:after {\n width: 6px;\n height: 6px;\n}\n.paraui-radio.radio-large > .paraui-radio-box > .paraui-radio-box-inner {\n width: 16px;\n height: 16px;\n}\n.paraui-radio.radio-large > .paraui-radio-box > .paraui-radio-box-inner:after {\n width: 6px;\n height: 6px;\n}";
|
|
15
|
+
styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
var Radio = function Radio(props) {
|
|
18
|
+
var _props$className = props.className,
|
|
19
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
20
|
+
labelTooltip = props.labelTooltip,
|
|
21
|
+
_props$label = props.label,
|
|
22
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
23
|
+
_props$size = props.size,
|
|
24
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
25
|
+
_props$disabled = props.disabled,
|
|
26
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
27
|
+
onChange = props.onChange,
|
|
28
|
+
style = props.style;
|
|
29
|
+
|
|
30
|
+
var _useState = useState(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
checkedCom = _useState2[0],
|
|
33
|
+
setCheckedCom = _useState2[1]; // 复选框状态
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
if (props.defaultChecked !== undefined) setCheckedCom(props.defaultChecked);
|
|
38
|
+
}, []);
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
if (props.checked !== undefined) setCheckedCom(props.checked);
|
|
41
|
+
}, [props.checked]); // 点击选择
|
|
42
|
+
|
|
43
|
+
var clickCheck = function clickCheck(e) {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
if (disabled) return; // 不可受控组件
|
|
46
|
+
|
|
47
|
+
if (props.checked === undefined) setCheckedCom(!checkedCom);
|
|
48
|
+
e.target.checked = !checkedCom;
|
|
49
|
+
onChange && onChange(e, !checkedCom);
|
|
50
|
+
}; // 处理className
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
var handClass = function handClass() {
|
|
54
|
+
var str = 'paraui-radio';
|
|
55
|
+
if (className) str += ' ' + className;
|
|
56
|
+
if (size) str += ' radio-' + size;
|
|
57
|
+
if (disabled) str += ' radio-disabled';
|
|
58
|
+
if (checkedCom) str += ' radio-checked';
|
|
59
|
+
return str;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var handLabelClass = function handLabelClass() {
|
|
63
|
+
var str = 'paraui-radio-label';
|
|
64
|
+
|
|
65
|
+
if (labelTooltip && labelTooltip.className) {
|
|
66
|
+
str += ' ' + labelTooltip.className;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return str;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return jsxs("label", Object.assign({
|
|
73
|
+
className: handClass(),
|
|
74
|
+
onClick: clickCheck,
|
|
75
|
+
style: style
|
|
76
|
+
}, {
|
|
77
|
+
children: [jsxs("span", Object.assign({
|
|
78
|
+
className: "paraui-radio-box"
|
|
79
|
+
}, {
|
|
80
|
+
children: [jsx("input", Object.assign({
|
|
81
|
+
type: "radio",
|
|
82
|
+
value: checkedCom
|
|
83
|
+
}, props.inputProps)), jsx("span", {
|
|
84
|
+
className: "paraui-radio-box-inner"
|
|
85
|
+
})]
|
|
86
|
+
})), label !== undefined && label !== '' && label !== null ? jsx(Label, Object.assign({
|
|
87
|
+
label: label
|
|
88
|
+
}, labelTooltip, {
|
|
89
|
+
className: handLabelClass()
|
|
90
|
+
})) : null]
|
|
91
|
+
}));
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export { Radio, Radio as default };
|
package/RadioGroup/index.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author linhd
|
|
3
|
-
* @date 2021/8/4 14:18
|
|
4
|
-
* @description 单选框组
|
|
5
|
-
*/
|
|
6
|
-
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
-
import { RadioProps } from '../Radio';
|
|
8
|
-
import { LabelTooltipProps } from "../Label";
|
|
9
|
-
import './index.scss';
|
|
10
|
-
export interface RadioListProps extends RadioProps {
|
|
11
|
-
[name: string]: any;
|
|
12
|
-
}
|
|
13
|
-
export interface RadioGroupProps {
|
|
14
|
-
/** 样式class */
|
|
15
|
-
className?: string;
|
|
16
|
-
/** style */
|
|
17
|
-
style?: React.CSSProperties;
|
|
18
|
-
/** 标题 */
|
|
19
|
-
label?: ReactNode;
|
|
20
|
-
/** 帮组提示信息 */
|
|
21
|
-
labelTooltip?: LabelTooltipProps;
|
|
22
|
-
/** 尺寸 */
|
|
23
|
-
size?: 'small' | 'medium' | 'large';
|
|
24
|
-
/** 是否必填 */
|
|
25
|
-
required?: boolean;
|
|
26
|
-
/** 布局方式 横向/竖向 */
|
|
27
|
-
row?: boolean;
|
|
28
|
-
/** 是否禁用 */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
/** 是否显示错误 */
|
|
31
|
-
error?: boolean;
|
|
32
|
-
/** 错误提示 */
|
|
33
|
-
helperText?: ReactNode;
|
|
34
|
-
/** 默认值 不受控 */
|
|
35
|
-
defaultValue?: any;
|
|
36
|
-
/** 默认值 */
|
|
37
|
-
value?: any;
|
|
38
|
-
/** 选中选值 */
|
|
39
|
-
id?: string;
|
|
40
|
-
/** 选项数据 */
|
|
41
|
-
list: RadioListProps[];
|
|
42
|
-
/** 改变值 */
|
|
43
|
-
onChange?: (val: any, item?: RadioListProps) => void;
|
|
44
|
-
[name: string]: any;
|
|
45
|
-
}
|
|
46
|
-
export declare const RadioGroup: FunctionComponent<RadioGroupProps>;
|
|
47
|
-
export default RadioGroup;
|
|
1
|
+
/**
|
|
2
|
+
* @author linhd
|
|
3
|
+
* @date 2021/8/4 14:18
|
|
4
|
+
* @description 单选框组
|
|
5
|
+
*/
|
|
6
|
+
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
+
import { RadioProps } from '../Radio';
|
|
8
|
+
import { LabelTooltipProps } from "../Label";
|
|
9
|
+
import './index.scss';
|
|
10
|
+
export interface RadioListProps extends RadioProps {
|
|
11
|
+
[name: string]: any;
|
|
12
|
+
}
|
|
13
|
+
export interface RadioGroupProps {
|
|
14
|
+
/** 样式class */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** style */
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
/** 标题 */
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
/** 帮组提示信息 */
|
|
21
|
+
labelTooltip?: LabelTooltipProps;
|
|
22
|
+
/** 尺寸 */
|
|
23
|
+
size?: 'small' | 'medium' | 'large';
|
|
24
|
+
/** 是否必填 */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** 布局方式 横向/竖向 */
|
|
27
|
+
row?: boolean;
|
|
28
|
+
/** 是否禁用 */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** 是否显示错误 */
|
|
31
|
+
error?: boolean;
|
|
32
|
+
/** 错误提示 */
|
|
33
|
+
helperText?: ReactNode;
|
|
34
|
+
/** 默认值 不受控 */
|
|
35
|
+
defaultValue?: any;
|
|
36
|
+
/** 默认值 */
|
|
37
|
+
value?: any;
|
|
38
|
+
/** 选中选值 */
|
|
39
|
+
id?: string;
|
|
40
|
+
/** 选项数据 */
|
|
41
|
+
list: RadioListProps[];
|
|
42
|
+
/** 改变值 */
|
|
43
|
+
onChange?: (val: any, item?: RadioListProps) => void;
|
|
44
|
+
[name: string]: any;
|
|
45
|
+
}
|
|
46
|
+
export declare const RadioGroup: FunctionComponent<RadioGroupProps>;
|
|
47
|
+
export default RadioGroup;
|
package/RadioGroup/index.js
CHANGED
|
@@ -1,14 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/a(7418);var o=a(8156),i=60103;if(e.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var t=Symbol.for;i=t("react.element"),e.Fragment=t("react.fragment")}var n=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function p(r,e,a){var o,t={},p=null,c=null;for(o in void 0!==a&&(p=""+a),void 0!==e.key&&(p=""+e.key),void 0!==e.ref&&(c=e.ref),e)l.call(e,o)&&!u.hasOwnProperty(o)&&(t[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps)void 0===t[o]&&(t[o]=e[o]);return{$$typeof:i,type:r,key:p,ref:c,props:t,_owner:n.current}}e.jsx=p,e.jsxs=p},5893:function(r,e,a){"use strict";r.exports=a(5251)},2113:function(r,e,a){var o=a(3379),i=a(7381);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[r.id,i,""]]);var t={insert:("body","body"),singleton:!1};o(i,t);r.exports=i.locals||{}},3936:function(r,e,a){var o=a(3379),i=a(9916);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[r.id,i,""]]);var t={insert:("body","body"),singleton:!1};o(i,t);r.exports=i.locals||{}},9663:function(r,e,a){var o=a(3379),i=a(4928);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[r.id,i,""]]);var t={insert:("body","body"),singleton:!1};o(i,t);r.exports=i.locals||{}},7510:function(r,e,a){var o=a(3379),i=a(8979);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[r.id,i,""]]);var t={insert:("body","body"),singleton:!1};o(i,t);r.exports=i.locals||{}},5271:function(r,e,a){var o=a(3379),i=a(2816);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[r.id,i,""]]);var t={insert:("body","body"),singleton:!1};o(i,t);r.exports=i.locals||{}},2310:function(r,e,a){var o=a(3379),i=a(9929);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[r.id,i,""]]);var t={insert:("body","body"),singleton:!1};o(i,t);r.exports=i.locals||{}},3379:function(r,e,a){"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},t=function(){var r={};return function(e){if(void 0===r[e]){var a=document.querySelector(e);if(window.HTMLIFrameElement&&a instanceof window.HTMLIFrameElement)try{a=a.contentDocument.head}catch(r){a=null}r[e]=a}return r[e]}}(),n=[];function l(r){for(var e=-1,a=0;a<n.length;a++)if(n[a].identifier===r){e=a;break}return e}function u(r,e){for(var a={},o=[],i=0;i<r.length;i++){var t=r[i],u=e.base?t[0]+e.base:t[0],p=a[u]||0,c="".concat(u," ").concat(p);a[u]=p+1;var s=l(c),d={css:t[1],media:t[2],sourceMap:t[3]};-1!==s?(n[s].references++,n[s].updater(d)):n.push({identifier:c,updater:h(d,e),references:1}),o.push(c)}return o}function p(r){var e=document.createElement("style"),o=r.attributes||{};if(void 0===o.nonce){var i=a.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(r){e.setAttribute(r,o[r])})),"function"==typeof r.insert)r.insert(e);else{var n=t(r.insert||"head");if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(e)}return e}var c,s=(c=[],function(r,e){return c[r]=e,c.filter(Boolean).join("\n")});function d(r,e,a,o){var i=a?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(r.styleSheet)r.styleSheet.cssText=s(e,i);else{var t=document.createTextNode(i),n=r.childNodes;n[e]&&r.removeChild(n[e]),n.length?r.insertBefore(t,n[e]):r.appendChild(t)}}function f(r,e,a){var o=a.css,i=a.media,t=a.sourceMap;if(i?r.setAttribute("media",i):r.removeAttribute("media"),t&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(t))))," */")),r.styleSheet)r.styleSheet.cssText=o;else{for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(document.createTextNode(o))}}var b=null,g=0;function h(r,e){var a,o,i;if(e.singleton){var t=g++;a=b||(b=p(e)),o=d.bind(null,a,t,!1),i=d.bind(null,a,t,!0)}else a=p(e),o=f.bind(null,a,e),i=function(){!function(r){if(null===r.parentNode)return!1;r.parentNode.removeChild(r)}(a)};return o(r),function(e){if(e){if(e.css===r.css&&e.media===r.media&&e.sourceMap===r.sourceMap)return;o(r=e)}else i()}}r.exports=function(r,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var a=u(r=r||[],e);return function(r){if(r=r||[],"[object Array]"===Object.prototype.toString.call(r)){for(var o=0;o<a.length;o++){var i=l(a[o]);n[i].references--}for(var t=u(r,e),p=0;p<a.length;p++){var c=l(a[p]);0===n[c].references&&(n[c].updater(),n.splice(c,1))}a=t}}}},3566:function(r,e,a){"use strict";var o=a(5893),i=a(7371),t=a(8076),n=a.n(t),l=a(5744),u=a.n(l),p=(a(2113),function(){return p=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},p.apply(this,arguments)}),c=function(r,e){var a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(r);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(r,o[i])&&(a[o[i]]=r[o[i]])}return a};e.default=function(r){var e=r.title,a=void 0===e?"":e,t=r.children,l=r.arrow,s=void 0===l||l,d=r.interactive,f=void 0===d||d,b=r.className,g=r.placement,h=void 0===g?"top-start":g,v=c(r,["title","children","arrow","interactive","className","placement"]);return(0,o.jsx)(i.default,p({title:a,arrow:s,interactive:f,placement:h},v,{children:(0,o.jsx)("span",p({className:u()("paraui-help",b)},{children:t||(0,o.jsx)(n(),{})}))}))}},4254:function(r,e,a){"use strict";var o=a(5893),i=(a(3936),function(){return i=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},i.apply(this,arguments)});e.default=function(r){var e,a=r.className,t=r.style,n=r.error,l=void 0!==n&&n,u=r.helperText;return(0,o.jsx)("p",i({className:(e="paraui-helper-text",a&&(e+=" "+a),l&&(e+=" paraui-helper-text-error"),e),style:t},{children:u}))}},8767:function(r,e,a){"use strict";var o=a(5893),i=a(3566),t=(a(9663),function(){return t=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},t.apply(this,arguments)});e.default=function(r){var e=r.className,a=r.style,n=r.label,l=r.labelSign,u=r.required,p=void 0!==u&&u,c=r.tooltip,s=r.tooltipType,d=void 0===s?"icon":s,f=r.placement,b=r.arrow,g=r.tooltipIcon,h=function(){var r="paraui-label";return d&&(r+=" paraui-label-"+d),c&&(r+=" paraui-label-tooltip"),e&&(r+=" "+e),r};return(0,o.jsxs)(o.Fragment,{children:["icon"===d&&(0,o.jsxs)("label",t({className:h(),style:a},{children:[(0,o.jsx)(o.Fragment,{children:n}),p&&(0,o.jsx)("span",t({className:"paraui-label-required"},{children:"*"})),l&&(0,o.jsx)("span",{children:l}),c&&(0,o.jsx)(i.default,t({title:c,placement:f,arrow:b},{children:g}))]})),"line"===d&&(0,o.jsx)(i.default,t({title:c||"",placement:f,arrow:b},{children:(0,o.jsxs)("label",t({className:h(),style:a},{children:[(0,o.jsx)(o.Fragment,{children:n}),p&&(0,o.jsx)("span",t({className:"paraui-label-required"},{children:"*"})),l&&(0,o.jsx)("span",{children:l})]}))}))]})}},3877:function(r,e,a){"use strict";var o=a(5893),i=a(8156),t=a(8767),n=(a(7510),function(){return n=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},n.apply(this,arguments)});e.default=function(r){var e=r.className,a=void 0===e?"":e,l=r.labelTooltip,u=r.label,p=void 0===u?"":u,c=r.size,s=void 0===c?"large":c,d=r.disabled,f=void 0!==d&&d,b=r.onChange,g=r.style,h=(0,i.useState)(!1),v=h[0],x=h[1];(0,i.useEffect)((function(){void 0!==r.defaultChecked&&x(r.defaultChecked)}),[]),(0,i.useEffect)((function(){void 0!==r.checked&&x(r.checked)}),[r.checked]);var m;return(0,o.jsxs)("label",n({className:(m="paraui-radio",a&&(m+=" "+a),s&&(m+=" radio-"+s),f&&(m+=" radio-disabled"),v&&(m+=" radio-checked"),m),onClick:function(e){e.preventDefault(),f||(void 0===r.checked&&x(!v),e.target.checked=!v,b&&b(e,!v))},style:g},{children:[(0,o.jsxs)("span",n({className:"paraui-radio-box"},{children:[(0,o.jsx)("input",n({type:"radio",value:v},r.inputProps)),(0,o.jsx)("span",{className:"paraui-radio-box-inner"})]})),void 0!==p&&""!==p&&null!==p?(0,o.jsx)(t.default,n({label:p},l,{className:function(){var r="paraui-radio-label";return l&&l.className&&(r+=" "+l.className),r}()})):null]}))}},7371:function(r,e,a){"use strict";var o=a(5893),i=a(670),t=a(5744),n=a.n(t),l=(a(2310),function(){return l=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},l.apply(this,arguments)}),u=function(r,e){var a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(r);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(r,o[i])&&(a[o[i]]=r[o[i]])}return a};e.default=function(r){var e,a=r.placement,t=void 0===a?"top-start":a,p=r.className,c=r.arrow,s=void 0===c||c,d=r.PopperProps,f=r.boundariesElement,b=void 0===f?"scrollParent":f,g=u(r,["placement","className","arrow","PopperProps","boundariesElement"]),h=l(l({},r.classes),{popper:n()("paraui-tooltip",p,null===(e=r.classes)||void 0===e?void 0:e.popper,{"paraui-tooltip-left-right":(null==t?void 0:t.includes("left"))||(null==t?void 0:t.includes("right")),"paraui-tooltip-top-bottom":(null==t?void 0:t.includes("top"))||(null==t?void 0:t.includes("bottom"))})});return(0,o.jsx)(i.Tooltip,l({},g,{enterTouchDelay:0,arrow:s,placement:t,classes:h,PopperProps:l(l({},d),{modifiers:{preventOverflow:{boundariesElement:b}}})}))}},670:function(r){"use strict";r.exports=e},8076:function(r){"use strict";r.exports=o},5744:function(r){"use strict";r.exports=a},8156:function(e){"use strict";e.exports=r}},t={};function n(r){var e=t[r];if(void 0!==e)return e.exports;var a=t[r]={id:r,exports:{}};return i[r](a,a.exports,n),a.exports}n.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(e,{a:e}),e},n.d=function(r,e){for(var a in e)n.o(e,a)&&!n.o(r,a)&&Object.defineProperty(r,a,{enumerable:!0,get:e[a]})},n.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},n.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.nc=void 0;var l={};return function(){"use strict";n.r(l),n.d(l,{RadioGroup:function(){return u}});var r=n(8156),e=n(5893),a=n(3877),o=n(8767),i=n(4254),t=(n(5271),function(){return t=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},t.apply(this,arguments)}),u=function(n){var l=n.className,u=void 0===l?"":l,p=n.style,c=n.label,s=void 0===c?"":c,d=n.labelTooltip,f=n.size,b=void 0===f?"large":f,g=n.row,h=void 0===g||g,v=n.disabled,x=void 0!==v&&v,m=n.required,y=void 0!==m&&m,j=n.error,O=void 0!==j&&j,w=n.helperText,S=void 0===w?"":w,N=n.id,k=void 0===N?"name":N,P=n.value,C=n.list,_=n.onChange,M=(0,r.useState)(),E=M[0],H=M[1];(0,r.useEffect)((function(){void 0!==n.defaultValue&&H(n.defaultValue)}),[]),(0,r.useEffect)((function(){void 0!==P&&H(P)}),[P]);var T,q=function(r){return function(){var e=r[k];P!==e&&(void 0===n.value&&H(e),_&&_(e,r))}};return(0,e.jsxs)("div",t({className:(T="paraui-radio-group",u&&(T+=" "+u),b&&(T+=" radio-group-"+b),O&&(T+=" radio-group-error"),x&&(T+=" radio-group-disabled"),T+=h?" radio-group-row":" radio-group-column"),style:p},{children:[function(){if(s||y){return(0,e.jsx)(o.default,t({label:s,required:y},d,{className:(r="radio-group-label",d&&d.className&&(r+=" "+d.className),r)}))}var r;return null}(),(0,e.jsx)("div",t({className:"radio-group-content"},{children:C.map((function(e,o){return(0,r.createElement)(a.default,t({},e,{checked:E===e[k],size:b,disabled:Boolean(x||e.disabled),key:o,onChange:q(e)}))}))})),(0,e.jsx)(i.default,{className:"radio-group-error-text",error:O,helperText:S})]}))};l.default=u}(),l}()}));
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
2
|
+
import { useState, useEffect, createElement } from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Radio } from '../Radio/index.js';
|
|
5
|
+
import Label from '../Label/index.js';
|
|
6
|
+
import HelperText from '../HelperText/index.js';
|
|
7
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
|
+
import '../Help/index.js';
|
|
9
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
10
|
+
import '../Tooltip/index.js';
|
|
11
|
+
import 'rc-tooltip';
|
|
12
|
+
import 'rc-tooltip/lib/placements';
|
|
13
|
+
import 'clsx';
|
|
14
|
+
import '@para-ui/icons/Help';
|
|
15
|
+
|
|
16
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-radio-group {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 100%;\n}\n.paraui-radio-group > .radio-group-content {\n line-height: 0;\n}\n.paraui-radio-group.radio-group-column > .radio-group-content {\n display: flex;\n flex-direction: column;\n}\n.paraui-radio-group.radio-group-column > .radio-group-content > .paraui-radio {\n margin-bottom: 8px;\n}\n.paraui-radio-group.radio-group-column > .radio-group-content > .paraui-radio:last-child {\n margin-bottom: 0;\n}";
|
|
17
|
+
styleInject(css_248z);
|
|
18
|
+
|
|
19
|
+
var RadioGroup = function RadioGroup(props) {
|
|
20
|
+
var _props$className = props.className,
|
|
21
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
22
|
+
style = props.style,
|
|
23
|
+
_props$label = props.label,
|
|
24
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
25
|
+
labelTooltip = props.labelTooltip,
|
|
26
|
+
_props$size = props.size,
|
|
27
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
28
|
+
_props$row = props.row,
|
|
29
|
+
row = _props$row === void 0 ? true : _props$row,
|
|
30
|
+
_props$disabled = props.disabled,
|
|
31
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
32
|
+
_props$required = props.required,
|
|
33
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
34
|
+
_props$error = props.error,
|
|
35
|
+
error = _props$error === void 0 ? false : _props$error,
|
|
36
|
+
_props$helperText = props.helperText,
|
|
37
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
38
|
+
_props$id = props.id,
|
|
39
|
+
id = _props$id === void 0 ? 'name' : _props$id,
|
|
40
|
+
value = props.value,
|
|
41
|
+
list = props.list,
|
|
42
|
+
onChange = props.onChange;
|
|
43
|
+
|
|
44
|
+
var _useState = useState(),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
valueCom = _useState2[0],
|
|
47
|
+
setValueCom = _useState2[1];
|
|
48
|
+
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
|
|
51
|
+
}, []);
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
if (value !== undefined) setValueCom(value);
|
|
54
|
+
}, [value]);
|
|
55
|
+
/**
|
|
56
|
+
* 改变值
|
|
57
|
+
* @param item 点击当前项数据
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
var onchangeCom = function onchangeCom(item) {
|
|
61
|
+
return function () {
|
|
62
|
+
var name = item[id]; // 值
|
|
63
|
+
|
|
64
|
+
if (value === name) return;
|
|
65
|
+
if (props.value === undefined) setValueCom(name);
|
|
66
|
+
onChange && onChange(name, item);
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var handLabel = function handLabel() {
|
|
71
|
+
if (label || required) {
|
|
72
|
+
var handLabelClass = function handLabelClass() {
|
|
73
|
+
var str = 'radio-group-label';
|
|
74
|
+
|
|
75
|
+
if (labelTooltip && labelTooltip.className) {
|
|
76
|
+
str += ' ' + labelTooltip.className;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return str;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return jsx(Label, Object.assign({
|
|
83
|
+
label: label,
|
|
84
|
+
required: required
|
|
85
|
+
}, labelTooltip, {
|
|
86
|
+
className: handLabelClass()
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return null;
|
|
91
|
+
}; // 处理class
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
var handClass = function handClass() {
|
|
95
|
+
var str = 'paraui-radio-group';
|
|
96
|
+
if (className) str += ' ' + className;
|
|
97
|
+
if (size) str += ' radio-group-' + size;
|
|
98
|
+
if (error) str += ' radio-group-error';
|
|
99
|
+
if (disabled) str += ' radio-group-disabled';
|
|
100
|
+
if (row) str += ' radio-group-row';else str += ' radio-group-column';
|
|
101
|
+
return str;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
return jsxs("div", Object.assign({
|
|
105
|
+
className: handClass(),
|
|
106
|
+
style: style
|
|
107
|
+
}, {
|
|
108
|
+
children: [handLabel(), jsx("div", Object.assign({
|
|
109
|
+
className: "radio-group-content"
|
|
110
|
+
}, {
|
|
111
|
+
children: list.map(function (item, index) {
|
|
112
|
+
return /*#__PURE__*/createElement(Radio, Object.assign({}, item, {
|
|
113
|
+
checked: valueCom === item[id],
|
|
114
|
+
size: size,
|
|
115
|
+
disabled: Boolean(disabled || item.disabled),
|
|
116
|
+
key: index,
|
|
117
|
+
onChange: onchangeCom(item)
|
|
118
|
+
}));
|
|
119
|
+
})
|
|
120
|
+
})), jsx(HelperText, {
|
|
121
|
+
className: "radio-group-error-text",
|
|
122
|
+
error: error,
|
|
123
|
+
helperText: helperText
|
|
124
|
+
})]
|
|
125
|
+
}));
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export { RadioGroup, RadioGroup as default };
|