@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.6
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 +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +17 -16
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +90 -118
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +9 -10
- package/Checkbox/index.js +28 -35
- package/CheckboxGroup/index.js +43 -58
- package/Collapse/index.js +52 -49
- package/CollapseBox/index.js +65 -70
- package/CollapseLayout/index.js +106 -101
- package/ColorPicker/index.js +3 -3
- package/ComboSelect/index.js +260 -337
- package/ComboSelect/lang/en_US.d.ts +1 -0
- package/ComboSelect/lang/index.d.ts +2 -0
- package/ComboSelect/lang/zh_CN.d.ts +1 -0
- package/ComboSelect/utils.d.ts +6 -0
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +24 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +80 -95
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +222 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +70 -74
- package/FormItem/index.js +18 -15
- package/FunctionModal/index.js +7 -14
- package/GlobalContext/index.js +17 -20
- package/Help/index.js +9 -12
- package/HelperText/index.js +11 -11
- package/InputLang/index.js +104 -124
- package/InputNumber/index.js +62 -81
- package/Label/index.js +19 -21
- package/Loading/index.js +11 -10
- package/Menu/index.js +302 -371
- package/Message/index.js +104 -113
- package/Modal/index.js +122 -148
- package/MultiBox/index.d.ts +5 -0
- package/MultiBox/index.js +111 -115
- package/Notification/index.js +105 -103
- package/OperateBtn/index.d.ts +3 -0
- package/OperateBtn/index.js +77 -107
- package/PageHeader/index.js +327 -406
- package/Pagination/index.js +107 -137
- package/ParauiProvider/index.js +20 -22
- package/PasswordRules/index.js +36 -40
- package/PopConfirm/index.js +60 -77
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +22 -23
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +34 -43
- package/Select/index.js +281 -345
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +582 -796
- package/SelectorPicker/index.js +113 -134
- package/SingleBox/index.d.ts +5 -0
- package/SingleBox/index.js +92 -88
- package/Slider/index.js +46 -57
- package/Status/index.js +14 -13
- package/Stepper/index.js +24 -25
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +360 -494
- package/Tabs/index.js +100 -100
- package/Tag/index.js +64 -82
- package/TextEditor/index.js +78 -100
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +29 -28
- package/Timeline/index.js +50 -47
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +29 -29
- package/Tooltip/index.js +52 -56
- package/Transfer/index.js +117 -154
- package/Tree/index.js +9 -10
- package/Upload/index.js +125 -143
- package/Upload/interface.d.ts +2 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-5a7e2438.js → index-3cdaba96.js} +967 -934
- package/_verture/{index-b1f80962.js → index-4fafd0a0.js} +6 -8
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/{index-232d890b.js → index-d63bd287.js} +1 -1
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-9331b116.js → index-e0f9064d.js} +125 -134
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-8534f23d.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-75fa4188.js} +15 -2
- package/_verture/{toConsumableArray-8f4c9589.js → toConsumableArray-c7a8028f.js} +1 -1
- package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
- package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
- package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
- package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
- package/_verture/utils-c17b5265.js +97 -0
- package/index.js +24 -23
- package/locale/en-US.d.ts +1 -0
- package/locale/index.d.ts +2 -0
- package/locale/index.js +10 -8
- package/locale/zh-CN.d.ts +1 -0
- package/package.json +11 -10
- package/umd/AutoBox.js +9 -8
- package/umd/AutoTips.js +9 -8
- package/umd/Badge.js +1 -1
- package/umd/Breadcrumbs.js +9 -8
- package/umd/Button.js +9 -8
- package/umd/ButtonGroup.js +9 -8
- package/umd/Carousel.js +5 -5
- package/umd/Cascader.js +9 -8
- package/umd/Checkbox.js +9 -8
- package/umd/CheckboxGroup.js +9 -8
- package/umd/Collapse.js +8 -7
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +9 -8
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +9 -8
- package/umd/DatePicker.js +9 -8
- package/umd/Descriptions.js +9 -8
- package/umd/Desktop.js +9 -8
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +9 -8
- package/umd/Dropdown.js +6 -5
- package/umd/DynamicMultiBox.js +11 -10
- package/umd/Empty.js +1 -1
- package/umd/Form.js +9 -8
- package/umd/FormItem.js +9 -8
- package/umd/FunctionModal.js +9 -8
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +9 -8
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +9 -8
- package/umd/InputNumber.js +9 -8
- package/umd/Label.js +9 -8
- package/umd/Loading.js +4 -4
- package/umd/Menu.js +4 -4
- package/umd/Message.js +4 -4
- package/umd/Modal.js +9 -8
- package/umd/MultiBox.js +9 -8
- package/umd/Notification.js +8 -7
- package/umd/OperateBtn.js +9 -8
- package/umd/PageHeader.js +9 -8
- package/umd/Pagination.js +9 -8
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +9 -8
- package/umd/Popover.js +9 -8
- package/umd/Progress.js +5 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +9 -8
- package/umd/RadioGroup.js +9 -8
- package/umd/Search.js +9 -8
- package/umd/Select.js +9 -8
- package/umd/SelectInput.js +9 -8
- package/umd/Selector.js +9 -8
- package/umd/SelectorPicker.js +9 -8
- package/umd/SingleBox.js +9 -8
- package/umd/Slider.js +6 -5
- package/umd/Status.js +4 -4
- package/umd/Stepper.js +9 -8
- package/umd/Switch.js +9 -8
- package/umd/Table.js +9 -8
- package/umd/Tabs.js +9 -8
- package/umd/Tag.js +9 -8
- package/umd/TextEditor.js +22 -21
- package/umd/TextField.js +9 -8
- package/umd/TimePicker.js +9 -8
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +9 -8
- package/umd/ToggleButton.js +9 -8
- package/umd/Tooltip.js +9 -8
- package/umd/Transfer.js +10 -9
- package/umd/Tree.js +9 -8
- package/umd/Upload.js +10 -9
- package/umd/locale.js +1 -1
- package/_verture/index-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
- package/_verture/utils-418da0a4.js +0 -73
- /package/_verture/{typeof-c310ee4a.js → typeof-b240b062.js} +0 -0
package/Descriptions/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-1d116156.js';
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
3
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
2
|
import { useState, useEffect, Fragment as Fragment$1 } from 'react';
|
|
5
3
|
import { Title } from '../Title/index.js';
|
|
@@ -7,11 +5,9 @@ import AutoTips from '../AutoTips/index.js';
|
|
|
7
5
|
import CollapseBox from '../CollapseBox/index.js';
|
|
8
6
|
import { Button } from '../Button/index.js';
|
|
9
7
|
import clsx from 'clsx';
|
|
10
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
11
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
8
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
9
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
12
10
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
13
|
-
import '../_verture/typeof-adeedc13.js';
|
|
14
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
15
11
|
import '../Help/index.js';
|
|
16
12
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
17
13
|
import '../Tooltip/index.js';
|
|
@@ -24,12 +20,12 @@ import 'rc-collapse';
|
|
|
24
20
|
import '@para-ui/icons/Right';
|
|
25
21
|
import '@paraview/lib';
|
|
26
22
|
import 'react-transition-group';
|
|
27
|
-
import '../_verture/util-
|
|
23
|
+
import '../_verture/util-82646c4f.js';
|
|
28
24
|
import '@para-ui/icons/LoadingF';
|
|
29
25
|
import '@para-ui/icons/Down';
|
|
30
|
-
import '../_verture/index-
|
|
26
|
+
import '../_verture/index-da9097d3.js';
|
|
31
27
|
import 'rc-dropdown';
|
|
32
|
-
import '../_verture/usePopupContainer-
|
|
28
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
33
29
|
import 'dayjs';
|
|
34
30
|
import '@para-ui/core/GlobalContext';
|
|
35
31
|
|
|
@@ -44,52 +40,45 @@ var zh = {
|
|
|
44
40
|
};
|
|
45
41
|
|
|
46
42
|
var localeJson = {
|
|
47
|
-
zh
|
|
48
|
-
en
|
|
43
|
+
zh,
|
|
44
|
+
en
|
|
49
45
|
};
|
|
50
46
|
|
|
51
47
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/11/9 14:21\n* @description 样式\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-descriptions .paraui-v4-title {\n margin-bottom: 20px;\n}\n.paraui-v4-descriptions .table-box {\n display: inline-flex;\n}\n.paraui-v4-descriptions .table-box > table {\n table-layout: fixed;\n width: 100%;\n}\n.paraui-v4-descriptions .table-box > table > tbody > tr {\n text-align: left;\n}\n.paraui-v4-descriptions .table-box > table > tbody > tr th, .paraui-v4-descriptions .table-box > table > tbody > tr .title {\n color: rgb(92, 101, 115);\n font-size: 14px;\n font-weight: 400;\n}\n.paraui-v4-descriptions .table-box > table > tbody > tr td, .paraui-v4-descriptions .table-box > table > tbody > tr .content {\n color: rgb(29, 33, 38);\n font-size: 14px;\n font-weight: 400;\n}\n.paraui-v4-descriptions .collapse-btn {\n margin: 0;\n height: 20px;\n line-height: 20px;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-border .table-box {\n border: 1px solid rgb(212, 218, 227);\n overflow: hidden;\n border-radius: 4px;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table {\n border-collapse: collapse;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table > tbody > tr {\n border-bottom: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table > tbody > tr:last-child {\n border-bottom: none;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table > tbody > tr > th {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table > tbody > tr > th, .paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table > tbody > tr > td {\n height: 40px;\n border-right: 1px solid rgb(212, 218, 227);\n padding: 0 10px;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table > tbody > tr > th:last-child, .paraui-v4-descriptions.paraui-v4-descriptions-border .table-box > table > tbody > tr > td:last-child {\n border-right: none;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-horizontal .table-box > table > tbody > tr > td > .item-container {\n display: flex;\n padding-bottom: 10px;\n padding-right: 40px;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-horizontal .table-box > table > tbody > tr > td > .item-container > .title {\n display: flex;\n overflow: hidden;\n max-width: 50%;\n margin-right: 10px;\n}\n.paraui-v4-descriptions.paraui-v4-descriptions-horizontal .table-box > table > tbody > tr > td > .item-container > .content {\n flex: 1;\n overflow: hidden;\n}";
|
|
52
48
|
styleInject(css_248z);
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
layout =
|
|
59
|
-
border
|
|
60
|
-
title
|
|
61
|
-
list
|
|
62
|
-
column
|
|
63
|
-
collapse
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
openCom = _useState2[0],
|
|
74
|
-
setOpenCom = _useState2[1];
|
|
75
|
-
var _useState3 = useState([]),
|
|
76
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
77
|
-
rowConfig = _useState4[0],
|
|
78
|
-
setRowConfig = _useState4[1]; // 二维数组,每一行配置信息
|
|
79
|
-
useEffect(function () {
|
|
50
|
+
const Descriptions = props => {
|
|
51
|
+
const {
|
|
52
|
+
className,
|
|
53
|
+
style,
|
|
54
|
+
layout = 'horizontal',
|
|
55
|
+
border,
|
|
56
|
+
title,
|
|
57
|
+
list,
|
|
58
|
+
column,
|
|
59
|
+
collapse,
|
|
60
|
+
defaultOpen = false,
|
|
61
|
+
open,
|
|
62
|
+
collapsedHeight = 60,
|
|
63
|
+
onCollapse
|
|
64
|
+
} = props;
|
|
65
|
+
const intl = useFormatMessage('Descriptions', localeJson);
|
|
66
|
+
const [openCom, setOpenCom] = useState(false);
|
|
67
|
+
const [rowConfig, setRowConfig] = useState([]); // 二维数组,每一行配置信息
|
|
68
|
+
useEffect(() => {
|
|
80
69
|
if (defaultOpen !== undefined) setOpenCom(defaultOpen);
|
|
81
70
|
}, [defaultOpen]);
|
|
82
|
-
useEffect(
|
|
71
|
+
useEffect(() => {
|
|
83
72
|
if (open !== undefined) setOpenCom(open);
|
|
84
73
|
}, [open]);
|
|
85
|
-
useEffect(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
for (
|
|
92
|
-
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const listCom = list ? list : [];
|
|
76
|
+
const rowCount = handleRowCount();
|
|
77
|
+
let accumulate = 0;
|
|
78
|
+
const arr = [];
|
|
79
|
+
let arrChild = [];
|
|
80
|
+
for (let i = 0, l = listCom.length; i < l; i++) {
|
|
81
|
+
const item = listCom[i];
|
|
93
82
|
accumulate += item.column || 1;
|
|
94
83
|
arrChild.push(item);
|
|
95
84
|
if (accumulate >= rowCount) {
|
|
@@ -103,7 +92,7 @@ var Descriptions = function Descriptions(props) {
|
|
|
103
92
|
setRowConfig(arr);
|
|
104
93
|
}, [list, layout, column]);
|
|
105
94
|
/** 处理行个数 */
|
|
106
|
-
|
|
95
|
+
const handleRowCount = () => {
|
|
107
96
|
if (column) return column;
|
|
108
97
|
if (layout === 'horizontal' && !border) {
|
|
109
98
|
return 4;
|
|
@@ -111,9 +100,9 @@ var Descriptions = function Descriptions(props) {
|
|
|
111
100
|
return layout === 'horizontal' ? 3 : 4;
|
|
112
101
|
};
|
|
113
102
|
/** 处理横向展示 */
|
|
114
|
-
|
|
103
|
+
const handleContentHorizontal = (item, index) => {
|
|
115
104
|
return jsx("tr", {
|
|
116
|
-
children: item.map(
|
|
105
|
+
children: item.map((itemChild, indexChild) => {
|
|
117
106
|
return jsx(Fragment$1, {
|
|
118
107
|
children: border ? jsxs(Fragment, {
|
|
119
108
|
children: [jsx("th", Object.assign({
|
|
@@ -151,10 +140,10 @@ var Descriptions = function Descriptions(props) {
|
|
|
151
140
|
}, index);
|
|
152
141
|
};
|
|
153
142
|
/** 处理纵向展示 */
|
|
154
|
-
|
|
143
|
+
const handleContentVertical = (item, index) => {
|
|
155
144
|
return jsxs(Fragment$1, {
|
|
156
145
|
children: [jsx("tr", {
|
|
157
|
-
children: item.map(
|
|
146
|
+
children: item.map((itemChild, indexChild) => {
|
|
158
147
|
return jsx("th", Object.assign({
|
|
159
148
|
colSpan: itemChild.column || 1
|
|
160
149
|
}, {
|
|
@@ -162,7 +151,7 @@ var Descriptions = function Descriptions(props) {
|
|
|
162
151
|
}), indexChild);
|
|
163
152
|
})
|
|
164
153
|
}), jsx("tr", {
|
|
165
|
-
children: item.map(
|
|
154
|
+
children: item.map((itemChild, indexChild) => {
|
|
166
155
|
return jsx("td", Object.assign({
|
|
167
156
|
colSpan: itemChild.column || 1
|
|
168
157
|
}, {
|
|
@@ -173,13 +162,13 @@ var Descriptions = function Descriptions(props) {
|
|
|
173
162
|
}, index);
|
|
174
163
|
};
|
|
175
164
|
/** 处理内容 */
|
|
176
|
-
|
|
165
|
+
const handleContent = () => {
|
|
177
166
|
return jsx("div", Object.assign({
|
|
178
167
|
className: 'table-box'
|
|
179
168
|
}, {
|
|
180
169
|
children: jsx("table", {
|
|
181
170
|
children: jsx("tbody", {
|
|
182
|
-
children: rowConfig.map(
|
|
171
|
+
children: rowConfig.map((item, index) => {
|
|
183
172
|
if (layout === 'horizontal') return handleContentHorizontal(item, index);
|
|
184
173
|
return handleContentVertical(item, index);
|
|
185
174
|
})
|
|
@@ -188,21 +177,21 @@ var Descriptions = function Descriptions(props) {
|
|
|
188
177
|
}));
|
|
189
178
|
};
|
|
190
179
|
/** 处理标题 */
|
|
191
|
-
|
|
180
|
+
const handleLabel = () => {
|
|
192
181
|
if (title) {
|
|
193
|
-
|
|
182
|
+
let titleProps = {
|
|
194
183
|
title: ''
|
|
195
184
|
};
|
|
196
185
|
if (typeof title === 'string') titleProps.title = title;else titleProps = title;
|
|
197
186
|
return jsx(Title, Object.assign({}, titleProps));
|
|
198
187
|
}
|
|
199
188
|
};
|
|
200
|
-
|
|
189
|
+
const onClickCollapse = () => {
|
|
201
190
|
onCollapse && onCollapse(!openCom);
|
|
202
191
|
if (open === undefined) setOpenCom(!openCom);
|
|
203
192
|
};
|
|
204
193
|
/** 处理是否折叠 */
|
|
205
|
-
|
|
194
|
+
const handleContentCollapse = () => {
|
|
206
195
|
if (collapse && !border) {
|
|
207
196
|
return jsxs(Fragment, {
|
|
208
197
|
children: [jsx(CollapseBox, Object.assign({
|
|
@@ -223,7 +212,9 @@ var Descriptions = function Descriptions(props) {
|
|
|
223
212
|
};
|
|
224
213
|
return jsxs("div", Object.assign({
|
|
225
214
|
style: style,
|
|
226
|
-
className: clsx("".concat($prefixCls, "-descriptions"), className, "".concat($prefixCls, "-descriptions-").concat(layout),
|
|
215
|
+
className: clsx("".concat($prefixCls, "-descriptions"), className, "".concat($prefixCls, "-descriptions-").concat(layout), {
|
|
216
|
+
["".concat($prefixCls, "-descriptions-border")]: border
|
|
217
|
+
})
|
|
227
218
|
}, {
|
|
228
219
|
children: [handleLabel(), handleContentCollapse()]
|
|
229
220
|
}));
|