@para-ui/core 2.2.7-beta → 2.2.9
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 +15 -203
- package/AutoTips/index.d.ts +27 -27
- package/AutoTips/index.js +15 -84
- package/Breadcrumbs/index.d.ts +39 -39
- package/Breadcrumbs/index.js +15 -227
- package/Button/SplitButton.d.ts +61 -62
- package/Button/index.d.ts +56 -71
- package/Button/index.js +14 -348
- 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 +14 -128
- package/Carousel/index.d.ts +30 -30
- package/Carousel/index.js +15 -74
- package/Cascader/index.d.ts +52 -52
- package/Cascader/index.js +15 -166
- 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 +14 -105
- package/CheckboxGroup/index.d.ts +46 -46
- package/CheckboxGroup/index.js +14 -138
- package/Collapse/collapsePanel.d.ts +30 -30
- package/Collapse/index.d.ts +57 -57
- package/Collapse/index.js +15 -171
- 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 +15 -164
- package/CollapseBox/util.d.ts +5 -5
- package/ColorPicker/index.d.ts +4 -4
- package/ColorPicker/index.js +1 -4
- 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 +14 -1803
- package/ComboSelect/interface.d.ts +143 -140
- 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 +15 -239
- 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 +14 -733
- 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 +55 -57
- package/Desktop/index.js +14 -853
- package/Drawer/index.d.ts +11 -11
- package/Drawer/index.js +14 -186
- 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/Empty/images/index.d.ts +2 -3
- package/Empty/index.d.ts +30 -30
- package/Empty/index.js +14 -644
- 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 +14 -384
- 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 +14 -81
- 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 +14 -39
- package/FunctionModal/modalContext.d.ts +14 -15
- 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 +16 -41
- package/GlobalContext/intl.d.ts +34 -34
- package/GlobalContext/useFormatMessage.d.ts +3 -3
- package/Help/index.d.ts +20 -18
- package/Help/index.js +15 -39
- package/HelperText/index.d.ts +19 -19
- package/HelperText/index.js +15 -29
- package/Hooks/useGlobalProps.d.ts +1 -1
- package/InputLang/index.d.ts +49 -49
- package/InputLang/index.js +14 -270
- package/InputNumber/index.d.ts +74 -74
- package/InputNumber/index.js +14 -308
- package/Label/index.d.ts +35 -35
- package/Label/index.js +14 -81
- package/Loading/index.d.ts +17 -17
- package/Loading/index.js +15 -47
- package/Menu/footerExpansion.d.ts +9 -9
- package/Menu/index.d.ts +10 -10
- package/Menu/index.js +14 -1232
- 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 +15 -222
- package/Modal/Confirm/index.d.ts +66 -65
- package/Modal/index.d.ts +61 -90
- package/Modal/index.js +14 -443
- 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 +14 -231
- package/Notification/index.d.ts +52 -52
- package/Notification/index.js +15 -266
- package/OperateBtn/index.d.ts +59 -59
- package/OperateBtn/index.js +14 -260
- 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 +14 -1171
- package/PageHeader/interface.d.ts +167 -167
- package/Pagination/index.d.ts +33 -33
- package/Pagination/index.js +14 -469
- 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 +12 -8
- package/ParauiProvider/index.js +15 -53
- package/PopConfirm/index.d.ts +56 -58
- package/PopConfirm/index.js +14 -189
- 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 +15 -66
- package/Popper/index.d.ts +13 -0
- package/Popper/index.js +16 -0
- 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 +20 -358
- package/Progress/utils.d.ts +6 -6
- package/Querying/images/index.d.ts +2 -3
- package/Querying/index.d.ts +26 -26
- package/Querying/index.js +14 -762
- 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/README.md +518 -0
- package/Radio/index.d.ts +38 -38
- package/Radio/index.js +14 -94
- package/RadioGroup/index.d.ts +47 -47
- package/RadioGroup/index.js +14 -128
- package/Search/index.d.ts +56 -56
- package/Search/index.js +14 -220
- package/Select/index.d.ts +86 -86
- package/Select/index.js +14 -1288
- 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 +14 -51
- package/SingleBox/index.d.ts +42 -42
- package/SingleBox/index.js +14 -194
- package/Slider/index.d.ts +14 -14
- package/Slider/index.js +15 -125
- package/Slider/interface.d.ts +102 -102
- package/Split/index.d.ts +7 -7
- package/Split/index.js +15 -134
- package/Stepper/icons.d.ts +5 -5
- package/Stepper/index.d.ts +39 -49
- package/Stepper/index.js +15 -99
- package/Switch/index.d.ts +78 -78
- package/Switch/index.js +14 -73
- package/Table/index.d.ts +10 -10
- package/Table/index.js +14 -2725
- 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 +30 -26
- 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 +48 -69
- package/Tabs/index.js +14 -218
- package/Tag/TagGroup.d.ts +66 -66
- package/Tag/index.d.ts +34 -34
- package/Tag/index.js +14 -286
- package/Test/index.d.ts +2 -3
- package/Test/index.js +16 -9
- package/TextField/index.d.ts +93 -93
- package/TextField/index.js +14 -686
- package/TimePicker/index.d.ts +22 -22
- package/TimePicker/index.js +14 -77
- 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/index.d.ts +22 -31
- package/Timeline/index.js +15 -150
- package/ToggleButton/ToggleButtonGroup.d.ts +49 -49
- package/ToggleButton/index.d.ts +49 -49
- package/ToggleButton/index.js +14 -200
- package/Tooltip/index.d.ts +14 -11
- package/Tooltip/index.js +15 -335
- package/Transfer/index.d.ts +17 -18
- package/Transfer/index.js +14 -343
- 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 +14 -35
- package/Tree/interface.d.ts +207 -209
- 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 +14 -1542
- 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/cdn/AutoBox/index.js +29 -0
- package/cdn/AutoTips/index.js +40 -0
- package/cdn/Breadcrumbs/index.js +53 -0
- package/cdn/Button/index.js +79 -0
- package/cdn/ButtonGroup/index.js +79 -0
- package/cdn/Carousel/index.js +6 -0
- package/cdn/Cascader/index.js +42 -0
- package/cdn/Checkbox/index.js +53 -0
- package/cdn/CheckboxGroup/index.js +53 -0
- package/cdn/Collapse/index.js +27 -0
- package/cdn/CollapseBox/index.js +1 -0
- package/cdn/ColorPicker/index.js +1 -0
- package/cdn/ComboSelect/index.js +438 -0
- package/cdn/Container/index.js +1 -0
- package/cdn/DatePicker/index.js +185 -0
- package/cdn/Desktop/index.js +24 -0
- package/cdn/Drawer/index.js +84 -0
- package/cdn/Empty/index.js +1 -0
- package/cdn/Form/index.js +477 -0
- package/cdn/FormItem/index.js +477 -0
- package/cdn/FunctionModal/index.js +144 -0
- package/cdn/GlobalContext/index.js +1 -0
- package/cdn/Help/index.js +53 -0
- package/cdn/HelperText/index.js +1 -0
- package/cdn/InputLang/index.js +144 -0
- package/cdn/InputNumber/index.js +118 -0
- package/cdn/Label/index.js +53 -0
- package/cdn/Loading/index.js +14 -0
- package/cdn/Menu/index.js +40 -0
- package/cdn/Message/index.js +53 -0
- package/cdn/Modal/index.js +144 -0
- package/cdn/MultiBox/index.js +131 -0
- package/cdn/Notification/index.js +66 -0
- package/cdn/OperateBtn/index.js +92 -0
- package/cdn/PageHeader/index.js +92 -0
- package/cdn/Pagination/index.js +214 -0
- package/cdn/ParauiProvider/index.js +9 -0
- package/cdn/PopConfirm/index.js +131 -0
- package/cdn/Popover/index.js +16 -0
- package/cdn/Popper/index.js +26 -0
- package/cdn/Progress/index.js +58 -0
- package/cdn/Querying/index.js +1 -0
- package/cdn/Radio/index.js +53 -0
- package/cdn/RadioGroup/index.js +53 -0
- package/cdn/Search/index.js +144 -0
- package/cdn/Select/index.js +131 -0
- package/cdn/SelectInput/index.js +131 -0
- package/cdn/SingleBox/index.js +131 -0
- package/cdn/Slider/index.js +16 -0
- package/cdn/Split/index.js +1 -0
- package/cdn/Stepper/index.js +154 -0
- package/cdn/Switch/index.js +71 -0
- package/cdn/Table/index.js +292 -0
- package/cdn/Tabs/index.js +165 -0
- package/cdn/Tag/index.js +27 -0
- package/cdn/Test/index.js +1 -0
- package/cdn/TextField/index.js +105 -0
- package/cdn/TimePicker/index.js +185 -0
- package/cdn/Timeline/index.js +16 -0
- package/cdn/ToggleButton/index.js +79 -0
- package/cdn/Tooltip/index.js +40 -0
- package/cdn/Transfer/index.js +170 -0
- package/cdn/Tree/index.js +170 -0
- package/cdn/Upload/index.js +252 -0
- package/index.d.ts +128 -128
- package/index.js +19 -160
- package/package.json +21 -54
- package/style.css +72 -0
- package/Dropdown/index.d.ts +0 -25
- package/Dropdown/index.js +0 -67
- package/Tabs/lang/en_US.d.ts +0 -4
- package/Tabs/lang/index.d.ts +0 -9
- package/Tabs/lang/zh_CN.d.ts +0 -4
- package/Timeline/TimelineItem.d.ts +0 -23
- package/Tooltip/interface.d.ts +0 -21
- package/Tooltip/utils.d.ts +0 -22
- package/_verture/defineProperty-0590dc61.js +0 -16
- package/_verture/index-2c0ecd8d.js +0 -778
- package/_verture/index-342379c6.js +0 -391
- package/_verture/index-a369ca3f.js +0 -4
- package/_verture/index-e2881a53.js +0 -16
- package/_verture/index-ee85b1cd.js +0 -1555
- package/_verture/intl-336570e4.js +0 -65
- package/_verture/modalContext-e7cc8067.js +0 -228
- package/_verture/slicedToArray-d7722f4b.js +0 -62
- package/_verture/style-inject.es-300983ab.js +0 -28
- package/_verture/toConsumableArray-f8047a75.js +0 -19
- package/_verture/tslib.es6-55ed4bd2.js +0 -38
- package/_verture/typeof-498dd2b1.js +0 -11
- package/_verture/useFormatMessage-ac9d6acf.js +0 -20
- package/_verture/useGlobalProps-af9a2af6.js +0 -12
package/Tag/index.js
CHANGED
|
@@ -1,286 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var TagGroup = function TagGroup(props) {
|
|
17
|
-
var className = props.className,
|
|
18
|
-
_props$size = props.size,
|
|
19
|
-
size = _props$size === void 0 ? 'small' : _props$size,
|
|
20
|
-
style = props.style,
|
|
21
|
-
_props$bordered = props.bordered,
|
|
22
|
-
bordered = _props$bordered === void 0 ? false : _props$bordered,
|
|
23
|
-
defaultInputValue = props.defaultInputValue,
|
|
24
|
-
_props$increased = props.increased,
|
|
25
|
-
increased = _props$increased === void 0 ? false : _props$increased,
|
|
26
|
-
increasedTag = props.increasedTag,
|
|
27
|
-
onChange = props.onChange;
|
|
28
|
-
|
|
29
|
-
var _useState = useState([]),
|
|
30
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
-
inData = _useState2[0],
|
|
32
|
-
setInData = _useState2[1]; //数据源
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var _useState3 = useState(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : ''),
|
|
36
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
-
inputValue = _useState4[0],
|
|
38
|
-
setInputValue = _useState4[1]; //input value
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var _useState5 = useState(false),
|
|
42
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
43
|
-
inputVisible = _useState6[0],
|
|
44
|
-
setInputVisible = _useState6[1]; //input visible
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var inputRef = useRef(); //input ref
|
|
48
|
-
|
|
49
|
-
useEffect(function () {
|
|
50
|
-
if (props.data) {
|
|
51
|
-
var tArr = props.data; //Item[]
|
|
52
|
-
|
|
53
|
-
var unObjType = tArr.some(function (v) {
|
|
54
|
-
return ['string', 'number'].includes(_typeof(v));
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (unObjType) {
|
|
58
|
-
tArr = tArr.map(function (_) {
|
|
59
|
-
return {
|
|
60
|
-
value: _,
|
|
61
|
-
label: _
|
|
62
|
-
};
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
setInData(_toConsumableArray(tArr));
|
|
67
|
-
}
|
|
68
|
-
}, [props.data]); //tag value
|
|
69
|
-
|
|
70
|
-
var getTagGroupVal = function getTagGroupVal(data) {
|
|
71
|
-
return data.map(function (_) {
|
|
72
|
-
return _.value;
|
|
73
|
-
});
|
|
74
|
-
}; //show input
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var showInput = function showInput() {
|
|
78
|
-
setInputVisible(true);
|
|
79
|
-
setTimeout(function () {
|
|
80
|
-
var _a;
|
|
81
|
-
|
|
82
|
-
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
83
|
-
});
|
|
84
|
-
}; //input change
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var handleInputChange = function handleInputChange(e) {
|
|
88
|
-
setInputValue(e.target.value);
|
|
89
|
-
}; //input confirm
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var handleInputConfirm = function handleInputConfirm() {
|
|
93
|
-
var val = inputValue.trim();
|
|
94
|
-
|
|
95
|
-
if (val !== '') {
|
|
96
|
-
inData.push({
|
|
97
|
-
value: val,
|
|
98
|
-
label: val,
|
|
99
|
-
closable: true
|
|
100
|
-
});
|
|
101
|
-
setInData(_toConsumableArray(inData));
|
|
102
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
setInputValue(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : '');
|
|
106
|
-
setInputVisible(false);
|
|
107
|
-
}; //input enter
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var handleInputEnter = function handleInputEnter(e) {
|
|
111
|
-
if (e.keyCode === 13 || e.which === 13) {
|
|
112
|
-
handleInputConfirm();
|
|
113
|
-
}
|
|
114
|
-
}; //handle close
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var handleClose = function handleClose(item) {
|
|
118
|
-
return function (e) {
|
|
119
|
-
var idx = inData.findIndex(function (_) {
|
|
120
|
-
return _.value === item.value;
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
if (idx > -1) {
|
|
124
|
-
inData.splice(idx, 1);
|
|
125
|
-
setInData(_toConsumableArray(inData));
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (item.onClose) item.onClose(e);
|
|
129
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
|
|
130
|
-
};
|
|
131
|
-
}; //渲染Tag组
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var renderTagGroup = function renderTagGroup() {
|
|
135
|
-
if (!(inData === null || inData === void 0 ? void 0 : inData.length)) return null;
|
|
136
|
-
return inData.map(function (item, idx) {
|
|
137
|
-
return jsx(Tag, Object.assign({}, item, {
|
|
138
|
-
size: size,
|
|
139
|
-
bordered: bordered,
|
|
140
|
-
visible: true,
|
|
141
|
-
onClose: handleClose(item)
|
|
142
|
-
}, {
|
|
143
|
-
children: item.label
|
|
144
|
-
}), idx);
|
|
145
|
-
});
|
|
146
|
-
}; //动态增加tag
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
var renderNewInput = function renderNewInput() {
|
|
150
|
-
var _a;
|
|
151
|
-
|
|
152
|
-
if (inputVisible) {
|
|
153
|
-
var inputCls = clsx('paraui-tag-group-input', {
|
|
154
|
-
'paraui-tag-group-input-large': size === 'large'
|
|
155
|
-
});
|
|
156
|
-
return jsx("input", {
|
|
157
|
-
type: "text",
|
|
158
|
-
ref: inputRef,
|
|
159
|
-
className: inputCls,
|
|
160
|
-
value: inputValue,
|
|
161
|
-
onChange: handleInputChange,
|
|
162
|
-
onBlur: handleInputConfirm,
|
|
163
|
-
onKeyDown: handleInputEnter
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
var icon = jsx(Plus, {});
|
|
168
|
-
|
|
169
|
-
var text = 'New Tag';
|
|
170
|
-
|
|
171
|
-
if (increasedTag) {
|
|
172
|
-
icon = increasedTag.icon || jsx(Plus, {});
|
|
173
|
-
text = (_a = increasedTag.text) !== null && _a !== void 0 ? _a : 'New Tag';
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
var newCls = clsx('paraui-tag-group-new', {
|
|
177
|
-
'paraui-tag-group-new-icon': !text
|
|
178
|
-
});
|
|
179
|
-
return jsx(Tag, Object.assign({
|
|
180
|
-
className: newCls,
|
|
181
|
-
size: size,
|
|
182
|
-
bordered: bordered,
|
|
183
|
-
icon: icon,
|
|
184
|
-
onClick: showInput
|
|
185
|
-
}, {
|
|
186
|
-
children: text
|
|
187
|
-
}));
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
return jsxs("div", Object.assign({
|
|
191
|
-
className: clsx('paraui-tag-group', className),
|
|
192
|
-
style: style
|
|
193
|
-
}, {
|
|
194
|
-
children: [renderTagGroup(), increased && renderNewInput()]
|
|
195
|
-
}));
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
var PresetColors = ['blue', 'green', 'yellow', 'red']; //tag
|
|
199
|
-
|
|
200
|
-
var InternalTag = function InternalTag(props) {
|
|
201
|
-
var className = props.className,
|
|
202
|
-
children = props.children,
|
|
203
|
-
icon = props.icon,
|
|
204
|
-
color = props.color,
|
|
205
|
-
onClose = props.onClose,
|
|
206
|
-
closeIcon = props.closeIcon,
|
|
207
|
-
_props$closable = props.closable,
|
|
208
|
-
closable = _props$closable === void 0 ? false : _props$closable,
|
|
209
|
-
_props$bordered = props.bordered,
|
|
210
|
-
bordered = _props$bordered === void 0 ? false : _props$bordered,
|
|
211
|
-
_props$size = props.size,
|
|
212
|
-
size = _props$size === void 0 ? 'small' : _props$size,
|
|
213
|
-
style = props.style,
|
|
214
|
-
visibleTag = props.visible,
|
|
215
|
-
restProps = __rest(props, ["className", "children", "icon", "color", "onClose", "closeIcon", "closable", "bordered", "size", "style", "visible"]);
|
|
216
|
-
|
|
217
|
-
var _useState = useState(true),
|
|
218
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
219
|
-
visible = _useState2[0],
|
|
220
|
-
setVisible = _useState2[1]; //显示tag
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
useEffect(function () {
|
|
224
|
-
if ('visible' in props) {
|
|
225
|
-
setVisible(!!visibleTag);
|
|
226
|
-
}
|
|
227
|
-
}, [visibleTag]); //是否预设颜色
|
|
228
|
-
|
|
229
|
-
var isPresetColor = function isPresetColor() {
|
|
230
|
-
if (!color) return false;
|
|
231
|
-
return PresetColors.includes(color);
|
|
232
|
-
}; //tag style
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
var tagStyle = Object.assign({
|
|
236
|
-
color: color && !isPresetColor() ? color : undefined
|
|
237
|
-
}, style); //tag cls
|
|
238
|
-
|
|
239
|
-
var tagClassName = clsx('paraui-tag', className, _defineProperty({
|
|
240
|
-
'paraui-tag-has-color': color,
|
|
241
|
-
'paraui-tag-hidden': !visible,
|
|
242
|
-
'paraui-tag-bordered': bordered,
|
|
243
|
-
'paraui-tag-large': size === 'large'
|
|
244
|
-
}, "paraui-tag-".concat(color), isPresetColor())); //tag close click
|
|
245
|
-
|
|
246
|
-
var handleCloseClick = function handleCloseClick(e) {
|
|
247
|
-
e.stopPropagation();
|
|
248
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
249
|
-
|
|
250
|
-
if (e.defaultPrevented) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (!('visible' in props)) {
|
|
255
|
-
setVisible(false);
|
|
256
|
-
}
|
|
257
|
-
}; //渲染close icon
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
var renderCloseIcon = function renderCloseIcon() {
|
|
261
|
-
if (!closable) return null;
|
|
262
|
-
return closeIcon ? jsx("span", Object.assign({
|
|
263
|
-
className: 'paraui-tag-close-icon',
|
|
264
|
-
onClick: handleCloseClick
|
|
265
|
-
}, {
|
|
266
|
-
children: closeIcon
|
|
267
|
-
})) : jsx(CloseIcon, {
|
|
268
|
-
className: 'paraui-tag-close-icon',
|
|
269
|
-
onClick: handleCloseClick
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
return jsxs("span", Object.assign({}, restProps, {
|
|
274
|
-
className: tagClassName,
|
|
275
|
-
style: tagStyle
|
|
276
|
-
}, {
|
|
277
|
-
children: [icon ? jsxs(Fragment, {
|
|
278
|
-
children: [icon, children && jsx("span", {
|
|
279
|
-
children: children
|
|
280
|
-
})]
|
|
281
|
-
}) : children, renderCloseIcon()]
|
|
282
|
-
}));
|
|
283
|
-
};
|
|
284
|
-
var Tag = InternalTag;
|
|
285
|
-
|
|
286
|
-
export { Tag, TagGroup, Tag as default };
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@para-ui/icons/Close"),require("clsx"),require("@para-ui/icons/Plus")):"function"==typeof define&&define.amd?define(["react","@para-ui/icons/Close","clsx","@para-ui/icons/Plus"],r):"object"==typeof exports?exports.ParaUI=r(require("react"),require("@para-ui/icons/Close"),require("clsx"),require("@para-ui/icons/Plus")):e.ParaUI=r(e.react,e["@para-ui/icons/Close"],e.clsx,e["@para-ui/icons/Plus"])}(self,(function(e,r,t,n){return function(){var a={5243:function(e,r,t){(r=t(3645)(!1)).push([e.id,".paraui-tag{display:inline-flex;justify-content:center;align-items:center;height:24px;margin-right:8px;padding:0 12px;font-size:12px;color:#2e3743;white-space:nowrap;background:rgba(171,176,185,.2);border-radius:4px}.paraui-tag-bordered{border:1px solid rgba(171,176,185,.2);line-height:22px}.paraui-tag-small{line-height:24px}.paraui-tag-small.paraui-tag-bordered{line-height:22px}.paraui-tag-large{line-height:28px}.paraui-tag-large.paraui-tag-bordered{line-height:26px}.paraui-tag .paraui-tag-close-icon{margin-left:4px;color:inherit;font-size:16px;cursor:pointer}.paraui-tag-close-icon:hover{color:inherit}.paraui-tag>.paraui-icon{vertical-align:-4px;color:inherit;font-size:16px}.paraui-tag>.paraui-icon+span{margin-left:4px}.paraui-tag-has-color,.paraui-tag-has-color .paraui-icon,.paraui-tag-has-color .paraui-icon:hover{color:inherit}.paraui-tag-blue{color:#3666d6;background-color:rgba(54,102,214,.05)}.paraui-tag-green{color:#53c31b;background-color:rgba(83,195,27,.05)}.paraui-tag-yellow{color:#ffa150;background-color:rgba(255,161,80,.05)}.paraui-tag-red{color:#eb6054;background-color:rgba(235,96,84,.05)}.paraui-tag-checkable{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);cursor:pointer}.paraui-tag-checkable:not(.paraui-tag-checkable-checked):hover{color:#1890ff}.paraui-tag-checkable:active,.paraui-tag .ant-tag-checkable-checked{color:#fff}.paraui-tag-checkable-checked{background-color:#1890ff}.paraui-tag-checkable:active{background-color:#096dd9}.paraui-tag-hidden{display:none}.paraui-tag-group{display:flex;align-items:center;flex-flow:row wrap}.paraui-tag-group-input{width:78px;height:24px;font-size:12px;color:#2e3743;text-indent:8px;border:1px solid rgba(171,176,185,.4);border-radius:4px}.paraui-tag-group-input-large{height:28px}.paraui-tag-group-new-icon{padding:0 5px}",""]),e.exports=r},3645:function(e){"use strict";e.exports=function(e){var r=[];return r.toString=function(){return this.map((function(r){var t=function(e,r){var t=e[1]||"",n=e[3];if(!n)return t;if(r&&"function"==typeof btoa){var a=(i=n,c=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(u," */")),o=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[t].concat(o).concat([a]).join("\n")}var i,c,u;return[t].join("\n")}(r,e);return r[2]?"@media ".concat(r[2]," {").concat(t,"}"):t})).join("")},r.i=function(e,t,n){"string"==typeof e&&(e=[[null,e,""]]);var a={};if(n)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&a[u[0]]||(t&&(u[2]?u[2]="".concat(t," and ").concat(u[2]):u[2]=t),r.push(u))}},r}},7418:function(e){"use strict";
|
|
2
|
+
/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,c,u=a(e),l=1;l<arguments.length;l++){for(var s in i=Object(arguments[l]))t.call(i,s)&&(u[s]=i[s]);if(r){c=r(i);for(var p=0;p<c.length;p++)n.call(i,c[p])&&(u[c[p]]=i[c[p]])}}return u}},5251:function(e,r,t){"use strict";
|
|
7
|
+
/** @license React v17.0.2
|
|
8
|
+
* react-jsx-runtime.production.min.js
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/t(7418);var n=t(8156),a=60103;if(r.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;a=o("react.element"),r.Fragment=o("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function l(e,r,t){var n,o={},l=null,s=null;for(n in void 0!==t&&(l=""+t),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(s=r.ref),r)c.call(r,n)&&!u.hasOwnProperty(n)&&(o[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===o[n]&&(o[n]=r[n]);return{$$typeof:a,type:e,key:l,ref:s,props:o,_owner:i.current}}r.jsx=l,r.jsxs=l},5893:function(e,r,t){"use strict";e.exports=t(5251)},32:function(e,r,t){var n=t(3379),a=t(5243);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.id,a,""]]);var o={insert:("body","body"),singleton:!1};n(a,o);e.exports=a.locals||{}},3379:function(e,r,t){"use strict";var n,a=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},o=function(){var e={};return function(r){if(void 0===e[r]){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[r]=t}return e[r]}}(),i=[];function c(e){for(var r=-1,t=0;t<i.length;t++)if(i[t].identifier===e){r=t;break}return r}function u(e,r){for(var t={},n=[],a=0;a<e.length;a++){var o=e[a],u=r.base?o[0]+r.base:o[0],l=t[u]||0,s="".concat(u," ").concat(l);t[u]=l+1;var p=c(s),f={css:o[1],media:o[2],sourceMap:o[3]};-1!==p?(i[p].references++,i[p].updater(f)):i.push({identifier:s,updater:v(f,r),references:1}),n.push(s)}return n}function l(e){var r=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var a=t.nc;a&&(n.nonce=a)}if(Object.keys(n).forEach((function(e){r.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(r);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}return r}var s,p=(s=[],function(e,r){return s[e]=r,s.filter(Boolean).join("\n")});function f(e,r,t,n){var a=t?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=p(r,a);else{var o=document.createTextNode(a),i=e.childNodes;i[r]&&e.removeChild(i[r]),i.length?e.insertBefore(o,i[r]):e.appendChild(o)}}function d(e,r,t){var n=t.css,a=t.media,o=t.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var g=null,b=0;function v(e,r){var t,n,a;if(r.singleton){var o=b++;t=g||(g=l(r)),n=f.bind(null,t,o,!1),a=f.bind(null,t,o,!0)}else t=l(r),n=d.bind(null,t,r),a=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return n(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;n(e=r)}else a()}}e.exports=function(e,r){(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=a());var t=u(e=e||[],r);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<t.length;n++){var a=c(t[n]);i[a].references--}for(var o=u(e,r),l=0;l<t.length;l++){var s=c(t[l]);0===i[s].references&&(i[s].updater(),i.splice(s,1))}t=o}}}},5927:function(e){"use strict";e.exports=r},1632:function(e){"use strict";e.exports=n},5744:function(e){"use strict";e.exports=t},8156:function(r){"use strict";r.exports=e}},o={};function i(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={id:e,exports:{}};return a[e](t,t.exports,i),t.exports}i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,{a:r}),r},i.d=function(e,r){for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var c={};return function(){"use strict";i.r(c),i.d(c,{Tag:function(){return v},TagGroup:function(){return f},default:function(){return h}});var e=i(5893),r=i(8156),t=i(5927),n=i.n(t),a=i(5744),o=i.n(a),u=i(1632),l=i.n(u),s=(i(32),function(){return s=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},s.apply(this,arguments)}),p=function(e,r,t){if(t||2===arguments.length)for(var n,a=0,o=r.length;a<o;a++)!n&&a in r||(n||(n=Array.prototype.slice.call(r,0,a)),n[a]=r[a]);return e.concat(n||Array.prototype.slice.call(r))},f=function(t){var n=t.className,a=t.size,i=void 0===a?"small":a,c=t.style,u=t.bordered,f=void 0!==u&&u,d=t.defaultInputValue,g=t.increased,b=void 0!==g&&g,v=t.increasedTag,y=t.onChange,m=(0,r.useState)([]),x=m[0],j=m[1],O=(0,r.useState)(null!=d?d:""),w=O[0],k=O[1],C=(0,r.useState)(!1),S=C[0],P=C[1],N=(0,r.useRef)();(0,r.useEffect)((function(){if(t.data){var e=t.data;e.some((function(e){return["string","number"].includes(typeof e)}))&&(e=e.map((function(e){return{value:e,label:e}}))),j(p([],e,!0))}}),[t.data]);var _=function(e){return e.map((function(e){return e.value}))},T=function(){P(!0),setTimeout((function(){var e;null===(e=N.current)||void 0===e||e.focus()}))},E=function(e){k(e.target.value)},I=function(){var e=w.trim();""!==e&&(x.push({value:e,label:e,closable:!0}),j(p([],x,!0)),null==y||y(x,_(x))),k(null!=d?d:""),P(!1)},M=function(e){13!==e.keyCode&&13!==e.which||I()},R=function(e){return function(r){var t=x.findIndex((function(r){return r.value===e.value}));t>-1&&(x.splice(t,1),j(p([],x,!0))),e.onClose&&e.onClose(r),null==y||y(x,_(x))}};return(0,e.jsxs)("div",s({className:o()("paraui-tag-group",n),style:c},{children:[(null==x?void 0:x.length)?x.map((function(r,t){return(0,e.jsx)(h,s({},r,{size:i,bordered:f,visible:!0,onClose:R(r)},{children:r.label}),t)})):null,b&&function(){var r;if(S){var t=o()("paraui-tag-group-input",{"paraui-tag-group-input-large":"large"===i});return(0,e.jsx)("input",{type:"text",ref:N,className:t,value:w,onChange:E,onBlur:I,onKeyDown:M})}var n=(0,e.jsx)(l(),{}),a="New Tag";v&&(n=v.icon||(0,e.jsx)(l(),{}),a=null!==(r=v.text)&&void 0!==r?r:"New Tag");var c=o()("paraui-tag-group-new",{"paraui-tag-group-new-icon":!a});return(0,e.jsx)(h,s({className:c,size:i,bordered:f,icon:n,onClick:T},{children:a}))}()]}))},d=function(){return d=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},d.apply(this,arguments)},g=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t},b=["blue","green","yellow","red"],v=function(t){var a,i=t.className,c=t.children,u=t.icon,l=t.color,s=t.onClose,p=t.closeIcon,f=t.closable,v=void 0!==f&&f,h=t.bordered,y=void 0!==h&&h,m=t.size,x=void 0===m?"small":m,j=t.style,O=t.visible,w=g(t,["className","children","icon","color","onClose","closeIcon","closable","bordered","size","style","visible"]),k=(0,r.useState)(!0),C=k[0],S=k[1];(0,r.useEffect)((function(){"visible"in t&&S(!!O)}),[O]);var P=function(){return!!l&&b.includes(l)},N=d({color:l&&!P()?l:void 0},j),_=o()("paraui-tag",i,((a={"paraui-tag-has-color":l,"paraui-tag-hidden":!C,"paraui-tag-bordered":y,"paraui-tag-large":"large"===x})["paraui-tag-".concat(l)]=P(),a)),T=function(e){e.stopPropagation(),null==s||s(e),e.defaultPrevented||"visible"in t||S(!1)};return(0,e.jsxs)("span",d({},w,{className:_,style:N},{children:[u?(0,e.jsxs)(e.Fragment,{children:[u,c&&(0,e.jsx)("span",{children:c})]}):c,v?p?(0,e.jsx)("span",d({className:"paraui-tag-close-icon",onClick:T},{children:p})):(0,e.jsx)(n(),{className:"paraui-tag-close-icon",onClick:T}):null]}))},h=v}(),c}()}));
|
package/Test/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export default Test;
|
|
1
|
+
export declare const Test: () => JSX.Element;
|
|
2
|
+
export default Test;
|
package/Test/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.ParaUI=r(require("react")):e.ParaUI=r(e.react)}(self,(function(e){return function(){"use strict";var r={7418:function(e){
|
|
2
|
+
/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/
|
|
7
|
+
var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,f){for(var i,c,a=o(e),u=1;u<arguments.length;u++){for(var p in i=Object(arguments[u]))t.call(i,p)&&(a[p]=i[p]);if(r){c=r(i);for(var l=0;l<c.length;l++)n.call(i,c[l])&&(a[c[l]]=i[c[l]])}}return a}},5251:function(e,r,t){
|
|
8
|
+
/** @license React v17.0.2
|
|
9
|
+
* react-jsx-runtime.production.min.js
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the MIT license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
t(7418);var n=t(8156),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var f=Symbol.for;o=f("react.element"),f("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,a={key:!0,ref:!0,__self:!0,__source:!0};function u(e,r,t){var n,f={},u=null,p=null;for(n in void 0!==t&&(u=""+t),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(p=r.ref),r)c.call(r,n)&&!a.hasOwnProperty(n)&&(f[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===f[n]&&(f[n]=r[n]);return{$$typeof:o,type:e,key:u,ref:p,props:f,_owner:i.current}}r.jsx=u},5893:function(e,r,t){e.exports=t(5251)},8156:function(r){r.exports=e}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var f=t[e]={exports:{}};return r[e](f,f.exports,n),f.exports}n.d=function(e,r){for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){n.r(o),n.d(o,{Test:function(){return r}});var e=n(5893),r=function(){return(0,e.jsx)("div",{children:"123"})};o.default=r}(),o}()}));
|
package/TextField/index.d.ts
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author linhd
|
|
3
|
-
* @date 2021/8/5 15:05
|
|
4
|
-
* @description 输入框
|
|
5
|
-
*/
|
|
6
|
-
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
-
import { LabelTooltipProps } from '../Label';
|
|
8
|
-
import './index.scss';
|
|
9
|
-
export interface TextFieldProps {
|
|
10
|
-
/** 样式class */
|
|
11
|
-
className?: string;
|
|
12
|
-
/** style */
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
/** 大小 */
|
|
15
|
-
size?: 'small' | 'medium' | 'large';
|
|
16
|
-
/** 标题在外,还是在内 */
|
|
17
|
-
labelMode?: 'outside' | 'inside';
|
|
18
|
-
/** 标题 */
|
|
19
|
-
label?: ReactNode;
|
|
20
|
-
/** 标题提示 */
|
|
21
|
-
labelSign?: ReactNode;
|
|
22
|
-
/** 是否必填 */
|
|
23
|
-
required?: boolean;
|
|
24
|
-
/** 帮组提示信息 */
|
|
25
|
-
labelTooltip?: LabelTooltipProps;
|
|
26
|
-
/** 提示语 */
|
|
27
|
-
placeholder?: ReactNode;
|
|
28
|
-
/** 是否禁用 */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
/** 多行 */
|
|
31
|
-
multiline?: boolean;
|
|
32
|
-
/** 是否显示错误 */
|
|
33
|
-
error?: boolean;
|
|
34
|
-
/** 错误提示 */
|
|
35
|
-
helperText?: ReactNode;
|
|
36
|
-
/** 前缀 */
|
|
37
|
-
addonBefore?: ReactNode;
|
|
38
|
-
/** 后缀 */
|
|
39
|
-
addonAfter?: ReactNode;
|
|
40
|
-
/** 默认值 不受控 */
|
|
41
|
-
defaultValue?: string | number;
|
|
42
|
-
/** 默认值 受控 */
|
|
43
|
-
value?: string | number;
|
|
44
|
-
/** 是否得到焦点 */
|
|
45
|
-
autoFocus?: boolean;
|
|
46
|
-
/** 文本类型 */
|
|
47
|
-
type?: 'text' | 'number' | 'password';
|
|
48
|
-
/** 多行文本行 */
|
|
49
|
-
rows?: number;
|
|
50
|
-
/** 多行文本是否可拖动 */
|
|
51
|
-
resize?: boolean;
|
|
52
|
-
/** 右侧图标 */
|
|
53
|
-
rightIcon?: ReactNode;
|
|
54
|
-
/** 是否显示右边图标 */
|
|
55
|
-
showRightIcon?: boolean;
|
|
56
|
-
/** 是否显示清空按钮 */
|
|
57
|
-
allowClear?: boolean;
|
|
58
|
-
/** 长度限制 */
|
|
59
|
-
limitLength?: number;
|
|
60
|
-
/** 下拉框class */
|
|
61
|
-
selectPopoverClass?: string;
|
|
62
|
-
/** 下拉框显示字段 */
|
|
63
|
-
showSelectName?: string;
|
|
64
|
-
/** 返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback(data:[]) 来返回它 */
|
|
65
|
-
fetchSuggestions?: (val: string, cb: (data: any[]) => void) => void;
|
|
66
|
-
/** 渲染下拉子节点 */
|
|
67
|
-
renderSelectItem?: (item: any) => ReactNode;
|
|
68
|
-
/** 失去焦点 */
|
|
69
|
-
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
70
|
-
/** 得到焦点 */
|
|
71
|
-
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
72
|
-
/** 改变输入框 */
|
|
73
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
74
|
-
/** 点击图标 */
|
|
75
|
-
onClickIcon?: (event: React.PointerEvent<HTMLSpanElement>) => void;
|
|
76
|
-
/** 键盘按下 */
|
|
77
|
-
onKeydown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
78
|
-
/** 键盘抬起 */
|
|
79
|
-
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
80
|
-
/** 回车事件 */
|
|
81
|
-
onEnter?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
82
|
-
/** 点击前缀 */
|
|
83
|
-
onClickAddonBefore?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
84
|
-
/** 点击后缀 */
|
|
85
|
-
onClickAddonAfter?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
86
|
-
/** 点击清空内容回调 */
|
|
87
|
-
onClear?: () => void;
|
|
88
|
-
/** 选着下拉框 */
|
|
89
|
-
onSelect?: (item: any) => void;
|
|
90
|
-
[name: string]: any;
|
|
91
|
-
}
|
|
92
|
-
export declare const TextField: FunctionComponent<TextFieldProps>;
|
|
93
|
-
export default TextField;
|
|
1
|
+
/**
|
|
2
|
+
* @author linhd
|
|
3
|
+
* @date 2021/8/5 15:05
|
|
4
|
+
* @description 输入框
|
|
5
|
+
*/
|
|
6
|
+
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
+
import { LabelTooltipProps } from '../Label';
|
|
8
|
+
import './index.scss';
|
|
9
|
+
export interface TextFieldProps {
|
|
10
|
+
/** 样式class */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** style */
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
/** 大小 */
|
|
15
|
+
size?: 'small' | 'medium' | 'large';
|
|
16
|
+
/** 标题在外,还是在内 */
|
|
17
|
+
labelMode?: 'outside' | 'inside';
|
|
18
|
+
/** 标题 */
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
/** 标题提示 */
|
|
21
|
+
labelSign?: ReactNode;
|
|
22
|
+
/** 是否必填 */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
/** 帮组提示信息 */
|
|
25
|
+
labelTooltip?: LabelTooltipProps;
|
|
26
|
+
/** 提示语 */
|
|
27
|
+
placeholder?: ReactNode;
|
|
28
|
+
/** 是否禁用 */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** 多行 */
|
|
31
|
+
multiline?: boolean;
|
|
32
|
+
/** 是否显示错误 */
|
|
33
|
+
error?: boolean;
|
|
34
|
+
/** 错误提示 */
|
|
35
|
+
helperText?: ReactNode;
|
|
36
|
+
/** 前缀 */
|
|
37
|
+
addonBefore?: ReactNode;
|
|
38
|
+
/** 后缀 */
|
|
39
|
+
addonAfter?: ReactNode;
|
|
40
|
+
/** 默认值 不受控 */
|
|
41
|
+
defaultValue?: string | number;
|
|
42
|
+
/** 默认值 受控 */
|
|
43
|
+
value?: string | number;
|
|
44
|
+
/** 是否得到焦点 */
|
|
45
|
+
autoFocus?: boolean;
|
|
46
|
+
/** 文本类型 */
|
|
47
|
+
type?: 'text' | 'number' | 'password';
|
|
48
|
+
/** 多行文本行 */
|
|
49
|
+
rows?: number;
|
|
50
|
+
/** 多行文本是否可拖动 */
|
|
51
|
+
resize?: boolean;
|
|
52
|
+
/** 右侧图标 */
|
|
53
|
+
rightIcon?: ReactNode;
|
|
54
|
+
/** 是否显示右边图标 */
|
|
55
|
+
showRightIcon?: boolean;
|
|
56
|
+
/** 是否显示清空按钮 */
|
|
57
|
+
allowClear?: boolean;
|
|
58
|
+
/** 长度限制 */
|
|
59
|
+
limitLength?: number;
|
|
60
|
+
/** 下拉框class */
|
|
61
|
+
selectPopoverClass?: string;
|
|
62
|
+
/** 下拉框显示字段 */
|
|
63
|
+
showSelectName?: string;
|
|
64
|
+
/** 返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback(data:[]) 来返回它 */
|
|
65
|
+
fetchSuggestions?: (val: string, cb: (data: any[]) => void) => void;
|
|
66
|
+
/** 渲染下拉子节点 */
|
|
67
|
+
renderSelectItem?: (item: any) => ReactNode;
|
|
68
|
+
/** 失去焦点 */
|
|
69
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
70
|
+
/** 得到焦点 */
|
|
71
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
72
|
+
/** 改变输入框 */
|
|
73
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
74
|
+
/** 点击图标 */
|
|
75
|
+
onClickIcon?: (event: React.PointerEvent<HTMLSpanElement>) => void;
|
|
76
|
+
/** 键盘按下 */
|
|
77
|
+
onKeydown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
78
|
+
/** 键盘抬起 */
|
|
79
|
+
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
80
|
+
/** 回车事件 */
|
|
81
|
+
onEnter?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
82
|
+
/** 点击前缀 */
|
|
83
|
+
onClickAddonBefore?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
84
|
+
/** 点击后缀 */
|
|
85
|
+
onClickAddonAfter?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
86
|
+
/** 点击清空内容回调 */
|
|
87
|
+
onClear?: () => void;
|
|
88
|
+
/** 选着下拉框 */
|
|
89
|
+
onSelect?: (item: any) => void;
|
|
90
|
+
[name: string]: any;
|
|
91
|
+
}
|
|
92
|
+
export declare const TextField: FunctionComponent<TextFieldProps>;
|
|
93
|
+
export default TextField;
|