@para-ui/core 4.0.42 → 4.0.43
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/Cascader/index.js +5 -6
- package/ComboSelect/index.js +6 -7
- package/CycleSelector/index.js +3 -6
- package/DatePicker/index.js +1 -4
- package/DynamicMultiBox/index.js +6 -7
- package/Form/index.js +7 -8
- package/FormItem/index.js +7 -8
- package/Image/index.js +2 -3
- package/Pagination/index.d.ts +4 -0
- package/Pagination/index.js +5 -4
- package/QuickReply/index.js +1 -1
- package/README.md +6 -0
- package/Select/index.js +2 -2
- package/Selector/index.js +223 -281
- package/SelectorPicker/index.js +4 -4
- package/SingleBox/index.js +2 -2
- package/SortBox/index.js +1 -1
- package/Stepper/index.js +1 -1
- package/Switch/index.js +2 -2
- package/Table/index.js +465 -493
- package/Table/lang/en_US.d.ts +2 -0
- package/Table/lang/index.d.ts +4 -0
- package/Table/lang/zh_CN.d.ts +2 -0
- package/Tabs/index.js +2 -2
- package/Tag/index.js +53 -82
- package/TimePicker/index.js +1 -4
- package/Timeline/index.js +1 -2
- package/ToggleButton/index.js +1 -2
- package/Tree/index.js +5 -6
- package/Upload/index.js +4 -5
- package/_verture/{Portal-edd94cac.js → Portal-42560ff0.js} +1 -2
- package/_verture/{defineProperty-6f62bb2a.js → defineProperty-f0e15205.js} +10 -2
- package/_verture/{index-2824e7a7.js → index-3fcb421f.js} +3 -4
- package/_verture/{index-67fe714a.js → index-4b1025fa.js} +54 -56
- package/_verture/{index-77fff5bd.js → index-5f0bfdcf.js} +2 -3
- package/_verture/{index-94e24006.js → index-8ac46bd9.js} +1 -1
- package/index.js +8 -9
- package/locale/en-US.d.ts +2 -0
- package/locale/index.d.ts +4 -0
- package/locale/index.js +6 -2
- package/locale/zh-CN.d.ts +2 -0
- package/package.json +3 -2
- package/umd/ComboSelect.js +1 -1
- package/umd/DynamicMultiBox.js +1 -1
- package/umd/Form.js +1 -1
- package/umd/FormItem.js +1 -1
- package/umd/Pagination.js +1 -1
- package/umd/Table.js +2 -2
- package/umd/locale.js +1 -1
- package/_verture/typeof-adeedc13.js +0 -11
- /package/_verture/{index-c8cb6751.js → index-0f5ee6f7.js} +0 -0
- /package/_verture/{typeof-4646b22c.js → typeof-6ec38efd.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { _ as _slicedToArray } from './slicedToArray-75fa4188.js';
|
|
4
3
|
import { TextField } from '../TextField/index.js';
|
|
4
|
+
import { _ as _slicedToArray } from './slicedToArray-75fa4188.js';
|
|
5
5
|
import { RadioGroup } from '../RadioGroup/index.js';
|
|
6
6
|
import Select from '../Select/index.js';
|
|
7
7
|
import { CheckboxGroup } from '../CheckboxGroup/index.js';
|
|
@@ -407,53 +407,52 @@ var DefaultCompoments = function DefaultCompoments(props) {
|
|
|
407
407
|
/**
|
|
408
408
|
* form 表单操作项 类型
|
|
409
409
|
*/
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
410
|
+
const ItemType = props => {
|
|
411
|
+
const {
|
|
412
|
+
itemType,
|
|
413
|
+
error,
|
|
414
|
+
placeholder,
|
|
415
|
+
label,
|
|
416
|
+
inputProps,
|
|
417
|
+
name,
|
|
418
|
+
rules,
|
|
419
|
+
setValue,
|
|
420
|
+
setError,
|
|
421
|
+
backData,
|
|
422
|
+
disabled,
|
|
423
|
+
change,
|
|
424
|
+
isComponent
|
|
425
|
+
} = props;
|
|
426
|
+
const intl = useFormatMessage('FormItem', localeJson);
|
|
427
|
+
const tipsStr = placeholder || "".concat(label);
|
|
426
428
|
/**
|
|
427
429
|
* 报错信息
|
|
428
430
|
* @type {boolean}
|
|
429
431
|
*/
|
|
430
|
-
|
|
431
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
432
|
-
errorStatus = _React$useState2[0],
|
|
433
|
-
setErrorStatus = _React$useState2[1];
|
|
432
|
+
const [errorStatus, setErrorStatus] = React__default.useState(!!error);
|
|
434
433
|
/**
|
|
435
434
|
* 校验方法
|
|
436
435
|
*/
|
|
437
|
-
|
|
436
|
+
const validateFunction = val => {
|
|
438
437
|
setValue && setValue(name, 'value', val);
|
|
439
438
|
change && change(val);
|
|
440
439
|
// 没有校验规则直接退出
|
|
441
440
|
if (!rules) return;
|
|
442
|
-
|
|
443
|
-
setErrorMsg
|
|
444
|
-
setAndValidateValue
|
|
441
|
+
const item = Object.assign(Object.assign({}, props), {
|
|
442
|
+
setErrorMsg,
|
|
443
|
+
setAndValidateValue
|
|
445
444
|
});
|
|
446
|
-
|
|
445
|
+
const errorMessage = validate(item, val, intl) || '';
|
|
447
446
|
setErrorMsg(errorMessage);
|
|
448
447
|
};
|
|
449
448
|
/**
|
|
450
449
|
* 存储和校验数据
|
|
451
450
|
*/
|
|
452
|
-
|
|
451
|
+
const setAndValidateValue = validateFunction;
|
|
453
452
|
/**
|
|
454
453
|
* 合并设置Error状态方法
|
|
455
454
|
*/
|
|
456
|
-
|
|
455
|
+
const setErrorMsg = React__default.useCallback(msg => {
|
|
457
456
|
setError && setError(msg);
|
|
458
457
|
setErrorStatus(!!msg);
|
|
459
458
|
setValue && setValue(name, 'message', msg);
|
|
@@ -461,21 +460,21 @@ var ItemType = function ItemType(props) {
|
|
|
461
460
|
/**
|
|
462
461
|
* 传出最后的 item 对象
|
|
463
462
|
*/
|
|
464
|
-
React__default.useEffect(
|
|
465
|
-
|
|
466
|
-
setErrorMsg
|
|
467
|
-
setAndValidateValue
|
|
463
|
+
React__default.useEffect(() => {
|
|
464
|
+
const item = Object.assign(Object.assign({}, props), {
|
|
465
|
+
setErrorMsg,
|
|
466
|
+
setAndValidateValue
|
|
468
467
|
});
|
|
469
468
|
setValue && setValue(name, 'item', item);
|
|
470
469
|
}, [name, props, setErrorMsg, setValue]);
|
|
471
470
|
/**
|
|
472
471
|
* 判断显示那个
|
|
473
472
|
*/
|
|
474
|
-
|
|
473
|
+
const selectType = () => {
|
|
475
474
|
if (!isComponent && itemType && typeof itemType !== 'string' && (!itemType.name || itemType.name === 'InputType')) {
|
|
476
|
-
|
|
477
|
-
setErrorMsg
|
|
478
|
-
setAndValidateValue
|
|
475
|
+
const item = Object.assign(Object.assign({}, props), {
|
|
476
|
+
setErrorMsg,
|
|
477
|
+
setAndValidateValue
|
|
479
478
|
});
|
|
480
479
|
return itemType(item);
|
|
481
480
|
}
|
|
@@ -484,7 +483,7 @@ var ItemType = function ItemType(props) {
|
|
|
484
483
|
return jsx(FormFile, Object.assign({}, props, {
|
|
485
484
|
defaultValue: backData[name],
|
|
486
485
|
disabled: disabled,
|
|
487
|
-
onChange:
|
|
486
|
+
onChange: value => {
|
|
488
487
|
validateFunction(value);
|
|
489
488
|
}
|
|
490
489
|
}));
|
|
@@ -492,7 +491,7 @@ var ItemType = function ItemType(props) {
|
|
|
492
491
|
if (backData[name] === undefined) setValue && setValue(name, 'initValue', !!backData[name]);
|
|
493
492
|
return jsx(Switch, Object.assign({
|
|
494
493
|
defaultChecked: !!backData[name],
|
|
495
|
-
onChange:
|
|
494
|
+
onChange: checked => {
|
|
496
495
|
validateFunction(checked);
|
|
497
496
|
}
|
|
498
497
|
}, Object.assign(Object.assign({}, inputProps), {
|
|
@@ -502,7 +501,7 @@ var ItemType = function ItemType(props) {
|
|
|
502
501
|
return jsx(FormCheckboxGroup, Object.assign({
|
|
503
502
|
error: errorStatus,
|
|
504
503
|
defaultValue: backData[name],
|
|
505
|
-
change:
|
|
504
|
+
change: value => {
|
|
506
505
|
validateFunction(value);
|
|
507
506
|
},
|
|
508
507
|
list: props.list
|
|
@@ -514,7 +513,7 @@ var ItemType = function ItemType(props) {
|
|
|
514
513
|
placeholder: tipsStr,
|
|
515
514
|
defaultValue: backData[name],
|
|
516
515
|
error: errorStatus,
|
|
517
|
-
change:
|
|
516
|
+
change: value => {
|
|
518
517
|
validateFunction(value);
|
|
519
518
|
},
|
|
520
519
|
list: props.list
|
|
@@ -525,7 +524,7 @@ var ItemType = function ItemType(props) {
|
|
|
525
524
|
return jsx(FormRadioGroup, Object.assign({
|
|
526
525
|
error: errorStatus,
|
|
527
526
|
defaultValue: backData[name],
|
|
528
|
-
change:
|
|
527
|
+
change: value => {
|
|
529
528
|
validateFunction(value);
|
|
530
529
|
},
|
|
531
530
|
list: props.list
|
|
@@ -542,7 +541,7 @@ var ItemType = function ItemType(props) {
|
|
|
542
541
|
rows: 3,
|
|
543
542
|
name: name,
|
|
544
543
|
hideErrorDom: null,
|
|
545
|
-
onChange:
|
|
544
|
+
onChange: e => {
|
|
546
545
|
validateFunction(e.target.value);
|
|
547
546
|
}
|
|
548
547
|
}, inputProps));
|
|
@@ -554,7 +553,7 @@ var ItemType = function ItemType(props) {
|
|
|
554
553
|
disabled: disabled,
|
|
555
554
|
name: name,
|
|
556
555
|
hideErrorDom: null,
|
|
557
|
-
onChange:
|
|
556
|
+
onChange: val => {
|
|
558
557
|
validateFunction(val);
|
|
559
558
|
}
|
|
560
559
|
}, inputProps));
|
|
@@ -564,7 +563,7 @@ var ItemType = function ItemType(props) {
|
|
|
564
563
|
placeholder: tipsStr,
|
|
565
564
|
defaultValue: backData[name],
|
|
566
565
|
disabled: disabled,
|
|
567
|
-
onChange:
|
|
566
|
+
onChange: options => {
|
|
568
567
|
validateFunction(options);
|
|
569
568
|
}
|
|
570
569
|
}, inputProps));
|
|
@@ -576,7 +575,7 @@ var ItemType = function ItemType(props) {
|
|
|
576
575
|
placeholder: tipsStr,
|
|
577
576
|
defaultValue: backData[name],
|
|
578
577
|
disabled: disabled,
|
|
579
|
-
onChange:
|
|
578
|
+
onChange: val => {
|
|
580
579
|
validateFunction(val);
|
|
581
580
|
},
|
|
582
581
|
inputProps: inputProps
|
|
@@ -587,7 +586,7 @@ var ItemType = function ItemType(props) {
|
|
|
587
586
|
autocomplete: "off",
|
|
588
587
|
error: errorStatus,
|
|
589
588
|
placeholder: tipsStr,
|
|
590
|
-
onChange:
|
|
589
|
+
onChange: e => {
|
|
591
590
|
validateFunction(e.target.value);
|
|
592
591
|
},
|
|
593
592
|
name: name,
|
|
@@ -603,25 +602,24 @@ var ItemType = function ItemType(props) {
|
|
|
603
602
|
* 报错信息组件
|
|
604
603
|
* @description 为了解决,在主组件设置state,导致输入框中内容刷新,且失去焦点
|
|
605
604
|
*/
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
605
|
+
const ErrorTips = props => {
|
|
606
|
+
const {
|
|
607
|
+
getSetError,
|
|
608
|
+
errorMessage,
|
|
609
|
+
helperTextProps
|
|
610
|
+
} = props;
|
|
610
611
|
/**
|
|
611
612
|
* 报错信息
|
|
612
613
|
* @type {string}
|
|
613
614
|
*/
|
|
614
|
-
|
|
615
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
616
|
-
errorTips = _React$useState2[0],
|
|
617
|
-
setErrorTips = _React$useState2[1];
|
|
615
|
+
const [errorTips, setErrorTips] = React__default.useState(errorMessage || '');
|
|
618
616
|
/**
|
|
619
617
|
* 初始化传出, 设置错误信息方法
|
|
620
618
|
*/
|
|
621
|
-
React__default.useEffect(
|
|
619
|
+
React__default.useEffect(() => {
|
|
622
620
|
setErrorTips(errorMessage || '');
|
|
623
621
|
}, [errorMessage]);
|
|
624
|
-
React__default.useEffect(
|
|
622
|
+
React__default.useEffect(() => {
|
|
625
623
|
getSetError && getSetError(setErrorTips);
|
|
626
624
|
}, [getSetError]);
|
|
627
625
|
return jsx(HelperText, Object.assign({
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { _ as _toConsumableArray } from './toConsumableArray-c7a8028f.js';
|
|
2
|
-
import { _ as _defineProperty } from './defineProperty-
|
|
2
|
+
import { _ as _typeof, a as _defineProperty } from './defineProperty-f0e15205.js';
|
|
3
3
|
import { _ as _slicedToArray } from './slicedToArray-75fa4188.js';
|
|
4
|
-
import { r as regenerator } from './index-
|
|
4
|
+
import { r as regenerator } from './index-8ac46bd9.js';
|
|
5
5
|
import { a as __rest, _ as __awaiter } from './tslib.es6-f43aa41d.js';
|
|
6
6
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
import React__default, { isValidElement, cloneElement, useRef, useState, useImperativeHandle, useEffect, useMemo } from 'react';
|
|
8
8
|
import RcTree from 'rc-tree';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import { _ as _typeof } from './typeof-adeedc13.js';
|
|
11
10
|
import LoadingOutlined from '@para-ui/icons/LoadingF';
|
|
12
11
|
import FileOutlined from '@para-ui/icons/Document';
|
|
13
12
|
import SolidArrowDown from '@para-ui/icons/DownTriangleF';
|
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { Button } from './Button/index.js';
|
|
|
9
9
|
export { ButtonGroup } from './ButtonGroup/index.js';
|
|
10
10
|
export { Card } from './Card/index.js';
|
|
11
11
|
export { Carousel } from './Carousel/index.js';
|
|
12
|
-
export { C as Cascader } from './_verture/index-
|
|
12
|
+
export { C as Cascader } from './_verture/index-3fcb421f.js';
|
|
13
13
|
export { Checkbox } from './Checkbox/index.js';
|
|
14
14
|
export { CheckboxGroup } from './CheckboxGroup/index.js';
|
|
15
15
|
export { Collapse } from './Collapse/index.js';
|
|
@@ -30,7 +30,7 @@ export { D as Dropdown } from './_verture/index-bde7aabe.js';
|
|
|
30
30
|
export { default as DynamicMultiBox } from './DynamicMultiBox/index.js';
|
|
31
31
|
export { default as Empty } from './Empty/index.js';
|
|
32
32
|
export { default as Form } from './Form/index.js';
|
|
33
|
-
export { F as FormItem } from './_verture/index-
|
|
33
|
+
export { F as FormItem } from './_verture/index-4b1025fa.js';
|
|
34
34
|
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-369509dd.js';
|
|
35
35
|
export { G as GlobalContext, c as changeConfirmLocale, g as getConfirmLocale } from './_verture/index-ca413216.js';
|
|
36
36
|
export { default as Help } from './Help/index.js';
|
|
@@ -84,7 +84,7 @@ export { Title } from './Title/index.js';
|
|
|
84
84
|
export { ToggleButton, ToggleButtonGroup } from './ToggleButton/index.js';
|
|
85
85
|
export { Tooltip } from './Tooltip/index.js';
|
|
86
86
|
export { SSortablejs, Transfer } from './Transfer/index.js';
|
|
87
|
-
export { T as Tree } from './_verture/index-
|
|
87
|
+
export { T as Tree } from './_verture/index-5f0bfdcf.js';
|
|
88
88
|
export { default as Upload } from './Upload/index.js';
|
|
89
89
|
export { default as Utils, getDateYYYYMMddHHMM, isObject, pixelReplacement } from './Utils/index.js';
|
|
90
90
|
export { default as locale } from './locale/index.js';
|
|
@@ -111,13 +111,12 @@ import '@para-ui/icons/LoadingF';
|
|
|
111
111
|
import 'react-slick';
|
|
112
112
|
import '@para-ui/icons/RightCircleF';
|
|
113
113
|
import '@para-ui/icons/LeftCircleF';
|
|
114
|
-
import './_verture/Portal-
|
|
114
|
+
import './_verture/Portal-42560ff0.js';
|
|
115
115
|
import './_verture/slicedToArray-75fa4188.js';
|
|
116
|
-
import './_verture/
|
|
116
|
+
import './_verture/defineProperty-f0e15205.js';
|
|
117
117
|
import './_verture/toConsumableArray-c7a8028f.js';
|
|
118
|
-
import './_verture/defineProperty-6f62bb2a.js';
|
|
119
118
|
import 'rc-motion';
|
|
120
|
-
import './_verture/typeof-
|
|
119
|
+
import './_verture/typeof-6ec38efd.js';
|
|
121
120
|
import 'rc-tree/lib/utils/conductUtil';
|
|
122
121
|
import '@para-ui/icons/Right';
|
|
123
122
|
import '@para-ui/icons/CloseCircleF';
|
|
@@ -153,7 +152,7 @@ import 'rc-dropdown';
|
|
|
153
152
|
import './_verture/usePopupContainer-635f66f4.js';
|
|
154
153
|
import '@para-ui/icons/Panel';
|
|
155
154
|
import '@para-ui/icons/Drag';
|
|
156
|
-
import './_verture/index-
|
|
155
|
+
import './_verture/index-0f5ee6f7.js';
|
|
157
156
|
import './_verture/sortable.esm-76fe46a4.js';
|
|
158
157
|
import '@para-ui/icons/LinkGroup';
|
|
159
158
|
import '@para-ui/icons/UploadFile';
|
|
@@ -181,7 +180,7 @@ import '@para-ui/icons/EditOutline';
|
|
|
181
180
|
import '@para-ui/icons/Message';
|
|
182
181
|
import '@para-ui/icons/Set';
|
|
183
182
|
import '@para-ui/icons/Loading';
|
|
184
|
-
import './_verture/index-
|
|
183
|
+
import './_verture/index-8ac46bd9.js';
|
|
185
184
|
import 'rc-slider';
|
|
186
185
|
import './_verture/tinycolor-ece3542d.js';
|
|
187
186
|
import 'rc-steps';
|
package/locale/en-US.d.ts
CHANGED
package/locale/index.d.ts
CHANGED
|
@@ -270,6 +270,8 @@ declare const _default: {
|
|
|
270
270
|
selectNum: string;
|
|
271
271
|
selectAll: string;
|
|
272
272
|
dragSort: string;
|
|
273
|
+
noHomePageEmpty: string;
|
|
274
|
+
returnPrevPage: string;
|
|
273
275
|
};
|
|
274
276
|
Tabs: {
|
|
275
277
|
confirmDelete: string;
|
|
@@ -576,6 +578,8 @@ declare const _default: {
|
|
|
576
578
|
selectNum: string;
|
|
577
579
|
selectAll: string;
|
|
578
580
|
dragSort: string;
|
|
581
|
+
noHomePageEmpty: string;
|
|
582
|
+
returnPrevPage: string;
|
|
579
583
|
};
|
|
580
584
|
Tabs: {
|
|
581
585
|
confirmDelete: string;
|
package/locale/index.js
CHANGED
|
@@ -268,7 +268,9 @@ var enUS = {
|
|
|
268
268
|
"refresh": "Refresh",
|
|
269
269
|
"selectNum": "Selected {num} items",
|
|
270
270
|
"selectAll": "Select All",
|
|
271
|
-
"dragSort": "Drag Sort"
|
|
271
|
+
"dragSort": "Drag Sort",
|
|
272
|
+
"noHomePageEmpty": "There is no data on this page",
|
|
273
|
+
"returnPrevPage": "Return to previous page"
|
|
272
274
|
},
|
|
273
275
|
"Tabs": {
|
|
274
276
|
"confirmDelete": "Are you sure delete?"
|
|
@@ -575,7 +577,9 @@ var zhCN = {
|
|
|
575
577
|
"refresh": "刷新",
|
|
576
578
|
"selectNum": "已选{num}项",
|
|
577
579
|
"selectAll": "全选",
|
|
578
|
-
"dragSort": "拖动排序"
|
|
580
|
+
"dragSort": "拖动排序",
|
|
581
|
+
"noHomePageEmpty": "当前页面无数据",
|
|
582
|
+
"returnPrevPage": "返回上一页"
|
|
579
583
|
},
|
|
580
584
|
"Tabs": {
|
|
581
585
|
"confirmDelete": "确定删除吗?"
|
package/locale/zh-CN.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@para-ui/core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.43",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
7
7
|
"description": "Powered by Para FED",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"lint": "npm run lint:script && npm run lint:style",
|
|
24
24
|
"lint:script-all": "eslint --ext .js,.jsx,.ts,.tsx --fix src",
|
|
25
25
|
"lint:style-all": "stylelint 'src/**/*.{css,scss}' --fix",
|
|
26
|
-
"lint:all": "npm run lint:script-all && npm run lint:style-all"
|
|
26
|
+
"lint:all": "npm run lint:script-all && npm run lint:style-all",
|
|
27
|
+
"prepare": "if [ \"$CI\" != \"true\" ]; then npx husky install; fi"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"@monaco-editor/react": "^4.6.0",
|