@para-ui/core 3.0.28 → 3.0.30
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.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/Cascader/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
3
|
-
import { r as regenerator } from '../_verture/index-
|
|
1
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-87c7d895.js';
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
3
|
+
import { r as regenerator } from '../_verture/index-06fea29b.js';
|
|
4
4
|
import { a as __awaiter } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { useState, useCallback } from 'react';
|
|
7
7
|
import RcCascader from 'rc-cascader';
|
|
8
8
|
import Right from '@para-ui/icons/Right';
|
|
9
9
|
import LoadingIcon from '@para-ui/icons/Loading';
|
|
10
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
11
|
-
import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-
|
|
10
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
11
|
+
import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-66aa48a1.js';
|
|
12
12
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
13
13
|
import '@para-ui/core/GlobalContext';
|
|
14
14
|
|
|
@@ -25,66 +25,62 @@ var localeJson = {
|
|
|
25
25
|
en: en
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-cascader input {\n color: #333;\n width: 560px;\n padding: 6px 12px;\n overflow: hidden;\n box-sizing: border-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-radius: 4px;\n border: 1px solid #d9d9d9;\n}\n.paraui-v3-cascader button {\n background: transparent;\n border: none;\n}\n
|
|
28
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-cascader input {\n color: #333;\n width: 560px;\n padding: 6px 12px;\n overflow: hidden;\n box-sizing: border-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-radius: 4px;\n border: 1px solid #d9d9d9;\n}\n.paraui-v3-cascader button {\n background: transparent;\n border: none;\n}\n.paraui-v3-cascader.component-cascader-dropdown-hidden {\n display: none;\n}\n.paraui-v3-cascader .component-cascader-menus {\n font-size: 12px;\n overflow: hidden;\n background: #fff;\n border: 1px solid #d9d9d9;\n border-radius: 4px;\n box-shadow: 0 0 4px rgba(0, 0, 0, 0.17);\n white-space: nowrap;\n}\n.paraui-v3-cascader .component-cascader-menus.slide-up-enter, .paraui-v3-cascader .component-cascader-menus.slide-up-appear {\n animation-duration: 0.3s;\n animation-fill-mode: both;\n transform-origin: 0 0;\n opacity: 0;\n animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);\n animation-play-state: paused;\n}\n.paraui-v3-cascader .component-cascader-menus.slide-up-leave {\n animation-duration: 0.3s;\n animation-fill-mode: both;\n transform-origin: 0 0;\n opacity: 1;\n animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);\n animation-play-state: paused;\n}\n.paraui-v3-cascader .component-cascader-menus.slide-up-enter.slide-up-enter-active, .paraui-v3-cascader .component-cascader-menus-placement-bottomLeft, .paraui-v3-cascader .component-cascader-menus.slide-up-appear.slide-up-appear-active, .paraui-v3-cascader .component-cascader-menus-placement-bottomLeft {\n animation-name: SlideUpIn;\n animation-play-state: running;\n}\n.paraui-v3-cascader .component-cascader-menus.slide-up-enter.slide-up-enter-active, .paraui-v3-cascader .component-cascader-menus-placement-topLeft, .paraui-v3-cascader .component-cascader-menus.slide-up-appear.slide-up-appear-active, .paraui-v3-cascader .component-cascader-menus-placement-topLeft {\n animation-name: SlideDownIn;\n animation-play-state: running;\n}\n.paraui-v3-cascader .component-cascader-menus.slide-up-leave.slide-up-leave-active, .paraui-v3-cascader .component-cascader-menus-placement-bottomLeft {\n animation-name: SlideUpOut;\n animation-play-state: running;\n}\n.paraui-v3-cascader .component-cascader-menus.slide-up-leave.slide-up-leave-active, .paraui-v3-cascader .component-cascader-menus-placement-topLeft {\n animation-name: SlideDownOut;\n animation-play-state: running;\n}\n.paraui-v3-cascader .component-cascader-menu {\n display: inline-block;\n min-width: 100px;\n height: 192px;\n list-style: none;\n margin: 0;\n padding: 0;\n border-right: 1px solid #e9e9e9;\n overflow: auto;\n}\n.paraui-v3-cascader .component-cascader-menu:last-child {\n border-right: 0;\n}\n.paraui-v3-cascader .component-cascader-menu-item {\n height: 32px;\n line-height: 32px;\n padding: 0 16px;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s ease;\n position: relative;\n}\n.paraui-v3-cascader .component-cascader-menu-item:hover {\n background: rgba(171, 176, 185, 0.231372549);\n}\n.paraui-v3-cascader .component-cascader-menu-item-disabled {\n cursor: not-allowed;\n color: #ccc;\n}\n.paraui-v3-cascader .component-cascader-menu-item-disabled:hover {\n background: transparent;\n}\n.paraui-v3-cascader .component-cascader-menu-item-active {\n color: #3666d6;\n}\n.paraui-v3-cascader .component-cascader-menu-item-loading-icon {\n display: flex;\n align-items: center;\n margin-left: 10px;\n}\n.paraui-v3-cascader .component-cascader-menu-item-expand {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.paraui-v3-cascader .component-cascader-menu-item-expand-icon {\n font-size: 12px;\n margin-left: 10px;\n}\n.paraui-v3-cascader .component-cascader-menu-item-expand-icon SVG {\n display: flex;\n align-items: center;\n}\n.paraui-v3-cascader .component-cascader-menu-item-expand-icon SVG path {\n fill: #999;\n}\n\n.component-cascader-dropdown {\n position: absolute;\n}\n\n@keyframes SlideUpIn {\n 0% {\n opacity: 0;\n transform-origin: 0% 0%;\n transform: scaleY(0.8);\n }\n 100% {\n opacity: 1;\n transform-origin: 0% 0%;\n transform: scaleY(1);\n }\n}\n@keyframes SlideUpOut {\n 0% {\n opacity: 1;\n transform-origin: 0% 0%;\n transform: scaleY(1);\n }\n 100% {\n opacity: 0;\n transform-origin: 0% 0%;\n transform: scaleY(0.8);\n }\n}\n@keyframes SlideDownIn {\n 0% {\n opacity: 0;\n transform-origin: 0% 100%;\n transform: scaleY(0.8);\n }\n 100% {\n opacity: 1;\n transform-origin: 0% 100%;\n transform: scaleY(1);\n }\n}\n@keyframes SlideDownOut {\n 0% {\n opacity: 1;\n transform-origin: 0% 100%;\n transform: scaleY(1);\n }\n 100% {\n opacity: 0;\n transform-origin: 0% 100%;\n transform: scaleY(0.8);\n }\n}";
|
|
29
29
|
styleInject(css_248z);
|
|
30
30
|
|
|
31
31
|
var Cascader = function Cascader(_ref) {
|
|
32
32
|
var data = _ref.data,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
33
|
+
_ref$expandTrigger = _ref.expandTrigger,
|
|
34
|
+
expandTrigger = _ref$expandTrigger === void 0 ? 'click' : _ref$expandTrigger,
|
|
35
|
+
_ref$value = _ref.value,
|
|
36
|
+
value = _ref$value === void 0 ? [] : _ref$value,
|
|
37
|
+
onChange = _ref.onChange,
|
|
38
|
+
onDropdownVisibleChange = _ref.onDropdownVisibleChange,
|
|
39
|
+
_ref$changeOnSelect = _ref.changeOnSelect,
|
|
40
|
+
changeOnSelect = _ref$changeOnSelect === void 0 ? false : _ref$changeOnSelect,
|
|
41
|
+
_ref$expandIcon = _ref.expandIcon,
|
|
42
|
+
expandIcon = _ref$expandIcon === void 0 ? jsx(Right, {}) : _ref$expandIcon,
|
|
43
|
+
_ref$expandJoin = _ref.expandJoin,
|
|
44
|
+
expandJoin = _ref$expandJoin === void 0 ? ' , ' : _ref$expandJoin,
|
|
45
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
46
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
47
|
+
label: 'label',
|
|
48
|
+
value: 'value',
|
|
49
|
+
children: 'children'
|
|
50
|
+
} : _ref$fieldNames,
|
|
51
|
+
_ref$disabled = _ref.disabled,
|
|
52
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
53
|
+
placeholder = _ref.placeholder,
|
|
54
|
+
_ref$loadData = _ref.loadData,
|
|
55
|
+
loadData = _ref$loadData === void 0 ? function () {
|
|
56
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
57
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
58
|
+
while (1) {
|
|
59
|
+
switch (_context.prev = _context.next) {
|
|
60
|
+
case 0:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context.stop();
|
|
63
|
+
}
|
|
63
64
|
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
children = _ref.children;
|
|
65
|
+
}, _callee);
|
|
66
|
+
}));
|
|
67
|
+
} : _ref$loadData,
|
|
68
|
+
_ref$loadingIcon = _ref.loadingIcon,
|
|
69
|
+
loadingIcon = _ref$loadingIcon === void 0 ? jsx(LoadingIcon, {}) : _ref$loadingIcon,
|
|
70
|
+
children = _ref.children;
|
|
71
71
|
var intl = useFormatMessage('Cascader', localeJson);
|
|
72
|
-
|
|
73
72
|
var _useState = useState(data),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
+
option = _useState2[0],
|
|
75
|
+
setOption = _useState2[1];
|
|
78
76
|
var _useState3 = useState(value),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
78
|
+
inputValue = _useState4[0],
|
|
79
|
+
setValue = _useState4[1];
|
|
83
80
|
var _useState5 = useState(valueToLabel(data, value, expandJoin)),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
82
|
+
inputLabel = _useState6[0],
|
|
83
|
+
setLabel = _useState6[1];
|
|
88
84
|
var onStateChange = useCallback(function (value, selectedOptions) {
|
|
89
85
|
setValue(value);
|
|
90
86
|
setLabel(selectedOptions.map(function (o) {
|
|
@@ -92,7 +88,6 @@ var Cascader = function Cascader(_ref) {
|
|
|
92
88
|
}).join(expandJoin));
|
|
93
89
|
onChange && onChange(value, selectedOptions);
|
|
94
90
|
}, []);
|
|
95
|
-
|
|
96
91
|
var loadingData = function loadingData(opt) {
|
|
97
92
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
98
93
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
@@ -101,10 +96,8 @@ var Cascader = function Cascader(_ref) {
|
|
|
101
96
|
case 0:
|
|
102
97
|
_context2.next = 2;
|
|
103
98
|
return loadData(opt);
|
|
104
|
-
|
|
105
99
|
case 2:
|
|
106
100
|
setOption(_toConsumableArray(data));
|
|
107
|
-
|
|
108
101
|
case 3:
|
|
109
102
|
case "end":
|
|
110
103
|
return _context2.stop();
|
|
@@ -113,7 +106,6 @@ var Cascader = function Cascader(_ref) {
|
|
|
113
106
|
}, _callee2);
|
|
114
107
|
}));
|
|
115
108
|
};
|
|
116
|
-
|
|
117
109
|
return jsx("div", Object.assign({
|
|
118
110
|
className: $prefixCls + '-cascader'
|
|
119
111
|
}, {
|
|
@@ -146,11 +138,9 @@ var Cascader = function Cascader(_ref) {
|
|
|
146
138
|
}))
|
|
147
139
|
}));
|
|
148
140
|
};
|
|
149
|
-
|
|
150
141
|
function valueToLabel(opt, value, expandJoin) {
|
|
151
142
|
var label = [];
|
|
152
143
|
var count = 0;
|
|
153
|
-
|
|
154
144
|
function find(data) {
|
|
155
145
|
for (var i = 0; i < data.length; i++) {
|
|
156
146
|
if (data[i].value === value[count]) {
|
|
@@ -163,10 +153,8 @@ function valueToLabel(opt, value, expandJoin) {
|
|
|
163
153
|
}
|
|
164
154
|
}
|
|
165
155
|
}
|
|
166
|
-
|
|
167
156
|
return label;
|
|
168
157
|
}
|
|
169
|
-
|
|
170
158
|
find(opt);
|
|
171
159
|
return label.join(expandJoin);
|
|
172
160
|
}
|
package/Checkbox/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import Label from '../Label/index.js';
|
|
5
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
5
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
6
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
7
7
|
import '../Help/index.js';
|
|
8
8
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -17,87 +17,71 @@ styleInject(css_248z);
|
|
|
17
17
|
|
|
18
18
|
var Checkbox = function Checkbox(props) {
|
|
19
19
|
var _props$className = props.className,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
21
|
+
_props$label = props.label,
|
|
22
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
23
|
+
labelTooltip = props.labelTooltip,
|
|
24
|
+
_props$size = props.size,
|
|
25
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
26
|
+
_props$disabled = props.disabled,
|
|
27
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
28
|
+
_props$indeterminate = props.indeterminate,
|
|
29
|
+
indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate,
|
|
30
|
+
onChange = props.onChange,
|
|
31
|
+
style = props.style;
|
|
33
32
|
var _useState = useState(false),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
checkedCom = _useState2[0],
|
|
35
|
+
setCheckedCom = _useState2[1]; // 复选框状态
|
|
39
36
|
useEffect(function () {
|
|
40
37
|
if (props.defaultChecked !== undefined) setCheckedCom(props.defaultChecked);
|
|
41
38
|
}, []);
|
|
42
39
|
useEffect(function () {
|
|
43
40
|
if (props.checked !== undefined) setCheckedCom(props.checked);
|
|
44
|
-
}, [props.checked]);
|
|
45
|
-
|
|
41
|
+
}, [props.checked]);
|
|
42
|
+
// 点击选择
|
|
46
43
|
var clickCheck = function clickCheck(e) {
|
|
47
44
|
e.preventDefault();
|
|
48
45
|
if (disabled) return;
|
|
49
|
-
|
|
50
46
|
if (indeterminate) {
|
|
51
47
|
// 不可受控组件
|
|
52
48
|
if (props.checked === undefined) setCheckedCom(true);
|
|
53
49
|
onChange && onChange(e, true);
|
|
54
50
|
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
}
|
|
52
|
+
// 不可受控组件
|
|
58
53
|
if (props.checked === undefined) setCheckedCom(!checkedCom);
|
|
59
54
|
e.target.checked = !checkedCom;
|
|
60
55
|
e.target.value = !checkedCom;
|
|
61
56
|
onChange && onChange(e, !checkedCom);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
};
|
|
58
|
+
// 处理class
|
|
65
59
|
var handClass = function handClass() {
|
|
66
60
|
var str = $prefixCls + '-checkbox';
|
|
67
61
|
if (className) str += ' ' + className;
|
|
68
62
|
if (size) str += " ".concat($prefixCls, "-checkbox-").concat(size);
|
|
69
63
|
if (disabled) str += " ".concat($prefixCls, "-checkbox-disabled");
|
|
70
64
|
if (indeterminate) str += " ".concat($prefixCls, "-checkbox-indeterminate");else if (checkedCom) str += " ".concat($prefixCls, "-checkbox-checked");
|
|
71
|
-
|
|
72
65
|
if (labelTooltip && labelTooltip.tooltipType) {
|
|
73
66
|
str += " ".concat($prefixCls, "-checkbox-").concat(labelTooltip.tooltipType);
|
|
74
67
|
}
|
|
75
|
-
|
|
76
68
|
return str;
|
|
77
69
|
};
|
|
78
|
-
|
|
79
70
|
var handLabelClass = function handLabelClass() {
|
|
80
71
|
var str = 'checkbox-label';
|
|
81
|
-
|
|
82
72
|
if (labelTooltip && labelTooltip.className) {
|
|
83
73
|
str += ' ' + labelTooltip.className;
|
|
84
74
|
}
|
|
85
|
-
|
|
86
75
|
return str;
|
|
87
76
|
};
|
|
88
77
|
/** 处理帮组classNaem */
|
|
89
|
-
|
|
90
|
-
|
|
91
78
|
var handHelpClassName = function handHelpClassName() {
|
|
92
79
|
var str = ' checkbox-help';
|
|
93
|
-
|
|
94
80
|
if (labelTooltip && labelTooltip.helpClassName) {
|
|
95
81
|
str += ' ' + labelTooltip.helpClassName;
|
|
96
82
|
}
|
|
97
|
-
|
|
98
83
|
return str;
|
|
99
84
|
};
|
|
100
|
-
|
|
101
85
|
return jsxs("label", Object.assign({
|
|
102
86
|
className: handClass(),
|
|
103
87
|
onClick: clickCheck,
|
package/CheckboxGroup/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { useState, useEffect, createElement } from 'react';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { Checkbox } from '../Checkbox/index.js';
|
|
5
5
|
import Label from '../Label/index.js';
|
|
6
6
|
import HelperText from '../HelperText/index.js';
|
|
7
7
|
import { DeepClone } from '@paraview/lib';
|
|
8
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
8
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
10
|
import '../Help/index.js';
|
|
11
11
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -20,36 +20,34 @@ styleInject(css_248z);
|
|
|
20
20
|
|
|
21
21
|
var CheckboxGroup = function CheckboxGroup(props) {
|
|
22
22
|
var _props$label = props.label,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
23
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
24
|
+
labelTooltip = props.labelTooltip,
|
|
25
|
+
_props$spacing = props.spacing,
|
|
26
|
+
spacing = _props$spacing === void 0 ? '28px' : _props$spacing,
|
|
27
|
+
_props$size = props.size,
|
|
28
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
29
|
+
_props$row = props.row,
|
|
30
|
+
row = _props$row === void 0 ? true : _props$row,
|
|
31
|
+
_props$disabled = props.disabled,
|
|
32
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
33
|
+
_props$required = props.required,
|
|
34
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
35
|
+
_props$error = props.error,
|
|
36
|
+
error = _props$error === void 0 ? false : _props$error,
|
|
37
|
+
hideErrorDom = props.hideErrorDom,
|
|
38
|
+
_props$helperText = props.helperText,
|
|
39
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
40
|
+
_props$id = props.id,
|
|
41
|
+
id = _props$id === void 0 ? 'name' : _props$id,
|
|
42
|
+
list = props.list,
|
|
43
|
+
_props$className = props.className,
|
|
44
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
45
|
+
onChange = props.onChange,
|
|
46
|
+
style = props.style;
|
|
48
47
|
var _useState = useState([]),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
valueCom = _useState2[0],
|
|
50
|
+
setValueCom = _useState2[1];
|
|
53
51
|
useEffect(function () {
|
|
54
52
|
if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
|
|
55
53
|
}, []);
|
|
@@ -62,37 +60,29 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
62
60
|
* @event 点击元素
|
|
63
61
|
* @checked 当前值
|
|
64
62
|
*/
|
|
65
|
-
|
|
66
63
|
var onchangeCom = function onchangeCom(item) {
|
|
67
64
|
return function (event, checked) {
|
|
68
65
|
var name = item[id]; // 值
|
|
69
|
-
|
|
70
66
|
var arr = DeepClone(valueCom);
|
|
71
|
-
|
|
72
67
|
if (checked) {
|
|
73
68
|
arr.push(name);
|
|
74
69
|
} else {
|
|
75
70
|
var index = arr.indexOf(name);
|
|
76
71
|
arr.splice(index, 1);
|
|
77
72
|
}
|
|
78
|
-
|
|
79
73
|
if (props.value === undefined) setValueCom(arr);
|
|
80
74
|
onChange && onChange(arr);
|
|
81
75
|
};
|
|
82
76
|
};
|
|
83
|
-
|
|
84
77
|
var handLabel = function handLabel() {
|
|
85
78
|
if (label || required) {
|
|
86
79
|
var handLabelClass = function handLabelClass() {
|
|
87
80
|
var str = 'checkbox-group-label';
|
|
88
|
-
|
|
89
81
|
if (labelTooltip && labelTooltip.className) {
|
|
90
82
|
str += ' ' + labelTooltip.className;
|
|
91
83
|
}
|
|
92
|
-
|
|
93
84
|
return str;
|
|
94
85
|
};
|
|
95
|
-
|
|
96
86
|
return jsx(Label, Object.assign({
|
|
97
87
|
label: label,
|
|
98
88
|
required: required
|
|
@@ -100,25 +90,19 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
100
90
|
className: handLabelClass()
|
|
101
91
|
}));
|
|
102
92
|
}
|
|
103
|
-
|
|
104
93
|
return null;
|
|
105
94
|
};
|
|
106
95
|
/**
|
|
107
96
|
* @description 处理单选框每一项样式
|
|
108
97
|
* */
|
|
109
|
-
|
|
110
|
-
|
|
111
98
|
var handStyleItem = function handStyleItem(item, index) {
|
|
112
99
|
var obj = Object.assign({}, item.style);
|
|
113
|
-
|
|
114
100
|
if (spacing && row && list.length !== index + 1) {
|
|
115
101
|
obj.marginRight = spacing;
|
|
116
102
|
}
|
|
117
|
-
|
|
118
103
|
return obj;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
};
|
|
105
|
+
// 处理class
|
|
122
106
|
var handClass = function handClass() {
|
|
123
107
|
var str = $prefixCls + '-checkbox-group';
|
|
124
108
|
if (className) str += ' ' + className;
|
|
@@ -128,7 +112,6 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
128
112
|
if (row) str += " ".concat($prefixCls, "-checkbox-group-row");else str += " ".concat($prefixCls, "-checkbox-group-column");
|
|
129
113
|
return str;
|
|
130
114
|
};
|
|
131
|
-
|
|
132
115
|
return jsxs("div", Object.assign({
|
|
133
116
|
className: handClass(),
|
|
134
117
|
style: style
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @description 折叠面板
|
|
5
5
|
*/
|
|
6
6
|
import React, { FunctionComponent } from 'react';
|
|
7
|
-
export
|
|
7
|
+
export type CollapsibleType = 'header' | 'disabled';
|
|
8
8
|
export interface CollapsePanelProps {
|
|
9
9
|
/** className */
|
|
10
10
|
className?: string;
|
package/Collapse/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import CollapsePanel, { CollapsibleType } from './collapsePanel';
|
|
8
8
|
import './index.scss';
|
|
9
|
-
export
|
|
9
|
+
export type ExpandIconPosition = 'left' | 'right' | undefined;
|
|
10
10
|
export interface CollapseProps {
|
|
11
11
|
/** className */
|
|
12
12
|
className?: string;
|
package/Collapse/index.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import RcCollapse from 'rc-collapse';
|
|
3
|
-
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-
|
|
3
|
+
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import Right from '@para-ui/icons/Right';
|
|
6
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
7
7
|
|
|
8
8
|
var CollapsePanelProps = function CollapsePanelProps(props) {
|
|
9
9
|
var _props$className = props.className,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
11
|
+
_props$showArrow = props.showArrow,
|
|
12
|
+
showArrow = _props$showArrow === void 0 ? true : _props$showArrow;
|
|
13
13
|
/** 处理className */
|
|
14
|
-
|
|
15
14
|
var handClass = function handClass() {
|
|
16
15
|
var str = '';
|
|
17
16
|
if (className) str += className;
|
|
18
17
|
if (!showArrow) str += ' collapse-panel-no-arrow';
|
|
19
18
|
return str;
|
|
20
19
|
};
|
|
21
|
-
|
|
22
20
|
return jsx(RcCollapse.Panel, Object.assign({}, props, {
|
|
23
21
|
className: handClass(),
|
|
24
22
|
prefixCls: $rcPrefixCls + '-collapse'
|
|
@@ -34,25 +32,20 @@ function cloneElement(element, props) {
|
|
|
34
32
|
return replaceElement(element, element, props);
|
|
35
33
|
}
|
|
36
34
|
/** toArray */
|
|
37
|
-
|
|
38
35
|
function toArray(list) {
|
|
39
36
|
if (!list) {
|
|
40
37
|
return [];
|
|
41
38
|
}
|
|
42
|
-
|
|
43
39
|
return Array.isArray(list) ? list : [list];
|
|
44
40
|
}
|
|
45
41
|
/** omit */
|
|
46
|
-
|
|
47
42
|
function omit(obj, fields) {
|
|
48
43
|
var clone = Object.assign({}, obj);
|
|
49
|
-
|
|
50
44
|
if (Array.isArray(fields)) {
|
|
51
45
|
fields.forEach(function (key) {
|
|
52
46
|
delete clone[key];
|
|
53
47
|
});
|
|
54
48
|
}
|
|
55
|
-
|
|
56
49
|
return clone;
|
|
57
50
|
}
|
|
58
51
|
|
|
@@ -63,7 +56,6 @@ var getCollapsedHeight = function getCollapsedHeight() {
|
|
|
63
56
|
opacity: 0
|
|
64
57
|
};
|
|
65
58
|
};
|
|
66
|
-
|
|
67
59
|
var getRealHeight = function getRealHeight(node) {
|
|
68
60
|
var scrollHeight = node.scrollHeight;
|
|
69
61
|
return {
|
|
@@ -71,17 +63,14 @@ var getRealHeight = function getRealHeight(node) {
|
|
|
71
63
|
opacity: 1
|
|
72
64
|
};
|
|
73
65
|
};
|
|
74
|
-
|
|
75
66
|
var getCurrentHeight = function getCurrentHeight(node) {
|
|
76
67
|
return {
|
|
77
68
|
height: node ? node.offsetHeight : 0
|
|
78
69
|
};
|
|
79
70
|
};
|
|
80
|
-
|
|
81
71
|
var skipOpacityTransition = function skipOpacityTransition(_, event) {
|
|
82
72
|
return (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
83
73
|
};
|
|
84
|
-
|
|
85
74
|
var collapseMotion = {
|
|
86
75
|
motionName: 'collapse-motion-collapse',
|
|
87
76
|
onAppearStart: getCollapsedHeight,
|
|
@@ -101,34 +90,29 @@ styleInject(css_248z);
|
|
|
101
90
|
|
|
102
91
|
var Collapse = function Collapse(props) {
|
|
103
92
|
var _props$className = props.className,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
94
|
+
_props$expandIconPosi = props.expandIconPosition,
|
|
95
|
+
expandIconPosition = _props$expandIconPosi === void 0 ? 'left' : _props$expandIconPosi;
|
|
107
96
|
/** 处理字内容 */
|
|
108
|
-
|
|
109
97
|
var getItems = function getItems() {
|
|
110
98
|
var children = props.children;
|
|
111
99
|
return toArray(children).map(function (child, index) {
|
|
112
100
|
var _a;
|
|
113
|
-
|
|
114
101
|
if ((_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
115
102
|
var key = child.key || String(index);
|
|
116
103
|
var _child$props = child.props,
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
disabled = _child$props.disabled,
|
|
105
|
+
collapsible = _child$props.collapsible;
|
|
119
106
|
var childProps = Object.assign(Object.assign({}, omit(child.props, ['disabled'])), {
|
|
120
107
|
key: key,
|
|
121
108
|
collapsible: collapsible !== null && collapsible !== void 0 ? collapsible : disabled ? 'disabled' : undefined
|
|
122
109
|
});
|
|
123
110
|
return cloneElement(child, childProps);
|
|
124
111
|
}
|
|
125
|
-
|
|
126
112
|
return child;
|
|
127
113
|
});
|
|
128
114
|
};
|
|
129
115
|
/** 处理展开图标 */
|
|
130
|
-
|
|
131
|
-
|
|
132
116
|
var renderExpandIcon = function renderExpandIcon() {
|
|
133
117
|
var panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
134
118
|
var expandIcon = props.expandIcon;
|
|
@@ -142,8 +126,6 @@ var Collapse = function Collapse(props) {
|
|
|
142
126
|
}));
|
|
143
127
|
};
|
|
144
128
|
/** 处理className */
|
|
145
|
-
|
|
146
|
-
|
|
147
129
|
var handClass = function handClass() {
|
|
148
130
|
var str = $prefixCls + '-collapse';
|
|
149
131
|
if (className) str += ' ' + className;
|
|
@@ -151,8 +133,6 @@ var Collapse = function Collapse(props) {
|
|
|
151
133
|
return str;
|
|
152
134
|
};
|
|
153
135
|
/** 处理过度动画 */
|
|
154
|
-
|
|
155
|
-
|
|
156
136
|
var openMotion = Object.assign(Object.assign({}, collapseMotion), {
|
|
157
137
|
motionAppear: false,
|
|
158
138
|
leavedClassName: "collapse-content-hidden"
|
package/Collapse/util.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const isValidElement: typeof React.isValidElement;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type AnyObject = Record<any, any>;
|
|
4
|
+
type RenderProps = undefined | AnyObject | ((originProps: AnyObject) => AnyObject | undefined);
|
|
5
5
|
export declare function replaceElement(element: React.ReactNode, replacement: React.ReactNode, props: RenderProps): React.ReactNode;
|
|
6
6
|
export declare function cloneElement(element: React.ReactNode, props?: RenderProps): React.ReactElement;
|
|
7
7
|
/** toArray */
|