@para-ui/core 3.0.27 → 3.0.29
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 +231 -358
- 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 +40 -82
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +13 -13
- 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 +43 -75
- 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 +16 -5
- package/Pagination/index.js +169 -188
- 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 +16 -0
- 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 +298 -686
- package/SelectorPicker/index.d.ts +2 -0
- package/SelectorPicker/index.js +64 -97
- package/SingleBox/index.js +29 -54
- 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/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +590 -1028
- package/Table/interface.d.ts +15 -6
- package/Table/tableBodyInterface.d.ts +4 -0
- package/Table/tablePagination.d.ts +1 -1
- package/Table/{tablePaginationInterFace.d.ts → tablePaginationInterface.d.ts} +4 -1
- 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 +89 -116
- 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-c40bd040.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.js +15 -15
- package/package.json +4 -5
- package/_verture/defineProperty-0590dc61.js +0 -16
|
@@ -43,6 +43,8 @@ export interface SelectorPickerProps extends HelperTextDetailProps {
|
|
|
43
43
|
onChange?: (val: Record<string, any>[] | Record<string, any> | null, node: Record<string, any>, rowData: Record<string, any>) => void;
|
|
44
44
|
/** 选择器属性 */
|
|
45
45
|
selectorProps?: Omit<SelectorProps, 'layout' | 'disabled' | 'value' | 'defaultValue' | 'disabled' | 'onChange' | 'selectMode'>;
|
|
46
|
+
/** 浮层渲染容器 */
|
|
47
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
46
48
|
}
|
|
47
49
|
declare const SelectorPicker: React.FC<SelectorPickerProps>;
|
|
48
50
|
export default SelectorPicker;
|
package/SelectorPicker/index.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-
|
|
2
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-
|
|
3
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
|
|
2
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-87c7d895.js';
|
|
3
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { useState, useRef, Fragment as Fragment$1 } from 'react';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import HelperText from '../HelperText/index.js';
|
|
8
8
|
import Label from '../Label/index.js';
|
|
9
|
-
import { D as Dropdown } from '../_verture/index-
|
|
9
|
+
import { D as Dropdown } from '../_verture/index-be4faaee.js';
|
|
10
10
|
import Selector, { handFieldConfig } from '../Selector/index.js';
|
|
11
11
|
import AutoTips from '../AutoTips/index.js';
|
|
12
12
|
import CloseCircle from '@para-ui/icons/CloseCircle';
|
|
13
13
|
import Down from '@para-ui/icons/Down';
|
|
14
14
|
import CloseIcon from '@para-ui/icons/Close';
|
|
15
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
15
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
16
16
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
17
|
+
import '../_verture/typeof-498dd2b1.js';
|
|
17
18
|
import '../Help/index.js';
|
|
18
19
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
19
20
|
import '../Tooltip/index.js';
|
|
@@ -21,23 +22,22 @@ import 'rc-tooltip';
|
|
|
21
22
|
import 'rc-tooltip/lib/placements';
|
|
22
23
|
import '@para-ui/icons/Help';
|
|
23
24
|
import 'rc-dropdown';
|
|
24
|
-
import '../_verture/usePopupContainer-
|
|
25
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
25
26
|
import 'dayjs';
|
|
26
27
|
import '@paraview/lib';
|
|
27
|
-
import '../_verture/index-
|
|
28
|
+
import '../_verture/index-06fea29b.js';
|
|
28
29
|
import '../Radio/index.js';
|
|
29
30
|
import '../Checkbox/index.js';
|
|
30
31
|
import '../Popover/index.js';
|
|
31
32
|
import '../Loading/index.js';
|
|
32
33
|
import '@para-ui/icons/LoadingF';
|
|
33
|
-
import '../_verture/useFormatMessage-
|
|
34
|
+
import '../_verture/useFormatMessage-703f8b20.js';
|
|
34
35
|
import '@para-ui/core/GlobalContext';
|
|
35
36
|
import '../Search/index.js';
|
|
36
37
|
import '../TextField/index.js';
|
|
37
|
-
import '../_verture/typeof-498dd2b1.js';
|
|
38
38
|
import '@para-ui/icons/PreviewClose';
|
|
39
39
|
import '@para-ui/icons/PreviewOpen';
|
|
40
|
-
import '../_verture/useGlobalProps-
|
|
40
|
+
import '../_verture/useGlobalProps-1b846a65.js';
|
|
41
41
|
import '../Button/index.js';
|
|
42
42
|
import '@para-ui/icons/Forbid';
|
|
43
43
|
import '@para-ui/icons/Search';
|
|
@@ -50,98 +50,82 @@ import '@para-ui/icons/Refresh';
|
|
|
50
50
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/8/2 5:57 PM\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-selector-picker > .selector-picker-wrapper {\n position: relative;\n display: flex;\n min-height: 36px;\n padding: 0 42px 0 12px;\n border: 1px solid rgba(171, 176, 185, 0.4);\n border-radius: 4px;\n background-color: rgb(255, 255, 255);\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper:hover {\n border-color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-placeholder {\n position: absolute;\n top: 50%;\n left: 12px;\n right: 42px;\n transform: translateY(-50%);\n font-size: 14px;\n color: rgba(46, 55, 67, 0.4);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-arrow {\n position: absolute;\n top: 7px;\n right: 12px;\n line-height: 0;\n transition: 0.3s;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-arrow svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 20px;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-clear {\n position: absolute;\n top: 9px;\n right: 12px;\n opacity: 0;\n line-height: 0;\n cursor: pointer;\n transition: 0.3s;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-clear svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 16px;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow {\n position: relative;\n display: flex;\n width: 100%;\n flex: auto;\n flex-wrap: wrap;\n padding-top: 5px;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow.selector-picker-overflow-single {\n padding-top: 0;\n align-items: center;\n overflow: hidden;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow.selector-picker-overflow-single > .selector-picker-single-content {\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow > .selector-picker-overflow-item {\n flex: none;\n max-width: 100%;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow > .selector-picker-overflow-item > .selector-picker-item {\n display: inline-flex;\n align-items: center;\n padding: 0 12px;\n height: 24px;\n margin: 0 8px 5px 0;\n max-width: 100%;\n color: rgb(46, 55, 67);\n line-height: 24px;\n background-color: rgba(171, 176, 185, 0.2);\n border-radius: 4px;\n user-select: none;\n transition: 0.3s;\n cursor: default;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow > .selector-picker-overflow-item > .selector-picker-item > .selector-picker-item-content {\n display: inline-block;\n margin-right: 4px;\n overflow: hidden;\n font-size: 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow > .selector-picker-overflow-item > .selector-picker-item > .selector-picker-item-remove {\n display: inline-flex;\n cursor: pointer;\n}\n.paraui-v3-selector-picker > .selector-picker-wrapper > .selector-picker-overflow > .selector-picker-overflow-item > .selector-picker-item > .selector-picker-item-remove svg {\n font-size: 16px;\n color: inherit;\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-focused > .selector-picker-wrapper {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-focused > .selector-picker-wrapper > .selector-picker-arrow {\n transform: rotate(180deg);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-disabled {\n cursor: not-allowed;\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-disabled > .selector-picker-wrapper {\n background-color: rgba(171, 176, 185, 0.12);\n border-color: rgba(171, 176, 185, 0.4);\n pointer-events: none;\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-error > .selector-picker-wrapper {\n border-color: rgb(235, 96, 84);\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-error > .selector-picker-wrapper:hover {\n border-color: rgb(235, 96, 84);\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-clear > .selector-picker-wrapper:hover > .selector-picker-arrow {\n opacity: 0;\n}\n.paraui-v3-selector-picker.paraui-v3-selector-picker-clear > .selector-picker-wrapper:hover > .selector-picker-clear {\n opacity: 1;\n}\n.paraui-v3-selector-picker-dropdown .paraui-v3-selector {\n border: 0;\n}\n.paraui-v3-selector-picker-dropdown .selector-picker-dropdown-content {\n max-height: 300px;\n overflow: auto;\n}";
|
|
51
51
|
styleInject(css_248z);
|
|
52
52
|
|
|
53
|
+
//下拉选择器
|
|
53
54
|
var SelectorPicker = function SelectorPicker(props) {
|
|
54
55
|
var _a, _b, _c;
|
|
55
|
-
|
|
56
56
|
var className = props.className,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
57
|
+
label = props.label,
|
|
58
|
+
value = props.value,
|
|
59
|
+
defaultValue = props.defaultValue,
|
|
60
|
+
_props$required = props.required,
|
|
61
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
62
|
+
labelTooltip = props.labelTooltip,
|
|
63
|
+
_props$error = props.error,
|
|
64
|
+
error = _props$error === void 0 ? false : _props$error,
|
|
65
|
+
hideErrorDom = props.hideErrorDom,
|
|
66
|
+
helperText = props.helperText,
|
|
67
|
+
_props$size = props.size,
|
|
68
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
69
|
+
_props$disabled = props.disabled,
|
|
70
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
71
|
+
style = props.style,
|
|
72
|
+
_props$placeholder = props.placeholder,
|
|
73
|
+
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
|
74
|
+
_props$multiple = props.multiple,
|
|
75
|
+
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
76
|
+
maxCount = props.maxCount,
|
|
77
|
+
_props$allowClear = props.allowClear,
|
|
78
|
+
allowClear = _props$allowClear === void 0 ? false : _props$allowClear,
|
|
79
|
+
selectorProps = props.selectorProps,
|
|
80
|
+
onChange = props.onChange,
|
|
81
|
+
onClear = props.onClear,
|
|
82
|
+
tagRender = props.tagRender,
|
|
83
|
+
getPopupContainer = props.getPopupContainer;
|
|
83
84
|
var fieldConfigHand = handFieldConfig((_a = props.selectorProps) === null || _a === void 0 ? void 0 : _a.fieldConfig, ((_b = props.selectorProps) === null || _b === void 0 ? void 0 : _b.rowKey) || 'key'); // 字段配置,对应数据字段
|
|
84
|
-
|
|
85
85
|
var selectorFieldConfigHand = Object.assign(Object.assign({}, fieldConfigHand), (_c = props.selectorProps) === null || _c === void 0 ? void 0 : _c.backDataFieldConfig); // 选中值字段配置,对应数据字段
|
|
86
|
-
|
|
87
86
|
var _useState = useState(!defaultValue ? [] : defaultValue),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
88
|
+
valueCom = _useState2[0],
|
|
89
|
+
setValueCom = _useState2[1];
|
|
92
90
|
var _useState3 = useState(false),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
92
|
+
open = _useState4[0],
|
|
93
|
+
setOpen = _useState4[1]; // 显示下拉
|
|
98
94
|
var posDom = useRef(null);
|
|
99
95
|
var prefixCls = $prefixCls + '-selector-picker';
|
|
100
96
|
/** 改变事件 val绑定值, node处理过的数据 rowData原始数据 */
|
|
101
|
-
|
|
102
97
|
var onChangeCom = function onChangeCom(val, node, rowData) {
|
|
103
98
|
onChange && onChange(val, node, rowData);
|
|
104
99
|
if (!multiple) setOpen(false);
|
|
105
|
-
|
|
106
100
|
if (value === undefined) {
|
|
107
101
|
setValueCom(!val ? [] : val);
|
|
108
102
|
}
|
|
109
103
|
};
|
|
110
104
|
/** 处理value,defaultValue */
|
|
111
|
-
|
|
112
|
-
|
|
113
105
|
var handValue = function handValue() {
|
|
114
106
|
if (value !== undefined) return value;
|
|
115
107
|
return valueCom;
|
|
116
108
|
};
|
|
117
109
|
/** 处理组件绑定的值 */
|
|
118
|
-
|
|
119
|
-
|
|
120
110
|
var handComVal = function handComVal() {
|
|
121
111
|
var val = handValue();
|
|
122
112
|
var handVal = !val ? [] : [val];
|
|
123
|
-
|
|
124
113
|
if (val instanceof Array) {
|
|
125
114
|
handVal = _toConsumableArray(val);
|
|
126
115
|
}
|
|
127
|
-
|
|
128
116
|
return handVal;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
|
|
117
|
+
};
|
|
118
|
+
//打开浮层
|
|
132
119
|
var openSelector = function openSelector() {
|
|
133
120
|
setOpen(true);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
|
|
121
|
+
};
|
|
122
|
+
//生成cls
|
|
137
123
|
var makeCls = function makeCls() {
|
|
138
124
|
var _clsx;
|
|
139
|
-
|
|
140
125
|
var list = handComVal();
|
|
141
126
|
return clsx(prefixCls, className, (_clsx = {}, _defineProperty(_clsx, "".concat(prefixCls, "-focused"), open), _defineProperty(_clsx, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_clsx, "".concat(prefixCls, "-error"), error), _defineProperty(_clsx, "".concat(prefixCls, "-clear"), allowClear && list.length), _defineProperty(_clsx, "".concat(prefixCls, "-").concat(size), size !== 'medium'), _clsx));
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
|
|
127
|
+
};
|
|
128
|
+
//渲染label
|
|
145
129
|
var renderLabel = function renderLabel() {
|
|
146
130
|
if (label || required) {
|
|
147
131
|
return jsx(Label, Object.assign({
|
|
@@ -149,19 +133,16 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
149
133
|
required: required
|
|
150
134
|
}, labelTooltip));
|
|
151
135
|
}
|
|
152
|
-
|
|
153
136
|
return null;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
|
|
137
|
+
};
|
|
138
|
+
//删除当前选中项
|
|
157
139
|
var handleTagRemove = function handleTagRemove(opt, index, e) {
|
|
158
140
|
e.stopPropagation();
|
|
159
141
|
var list = handComVal();
|
|
160
142
|
list.splice(index, 1);
|
|
161
143
|
onChangeCom(_toConsumableArray(list), {}, {});
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
|
|
144
|
+
};
|
|
145
|
+
//全部清空
|
|
165
146
|
var handleAllClear = function handleAllClear(e) {
|
|
166
147
|
e.stopPropagation();
|
|
167
148
|
setOpen(false);
|
|
@@ -169,8 +150,6 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
169
150
|
onChangeCom(multiple ? [] : {}, {}, {});
|
|
170
151
|
};
|
|
171
152
|
/** 处理tag标签 */
|
|
172
|
-
|
|
173
|
-
|
|
174
153
|
var handTagDom = function handTagDom(item, index) {
|
|
175
154
|
var labelStr = selectorFieldConfigHand.mainTitle || '';
|
|
176
155
|
var valKey = selectorFieldConfigHand.key || '';
|
|
@@ -198,15 +177,12 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
198
177
|
}))]
|
|
199
178
|
}))
|
|
200
179
|
}));
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
|
|
180
|
+
};
|
|
181
|
+
//tag memo
|
|
204
182
|
var tagMemo = function tagMemo() {
|
|
205
183
|
var _a, _b;
|
|
206
|
-
|
|
207
184
|
var list = handComVal();
|
|
208
185
|
if (!list.length) return;
|
|
209
|
-
|
|
210
186
|
if (!multiple) {
|
|
211
187
|
//单选
|
|
212
188
|
var labelStr = selectorFieldConfigHand.mainTitle || '';
|
|
@@ -219,20 +195,15 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
219
195
|
children: renderVal || val
|
|
220
196
|
}));
|
|
221
197
|
}
|
|
222
|
-
|
|
223
198
|
var realShowList = _toConsumableArray(list); //实际
|
|
224
|
-
|
|
225
|
-
|
|
226
199
|
var overList = []; //超出显示
|
|
227
|
-
|
|
228
200
|
if (maxCount) {
|
|
229
201
|
if (list.length > maxCount) {
|
|
230
202
|
overList = list.slice(maxCount);
|
|
231
203
|
realShowList = list.slice(0, maxCount);
|
|
232
204
|
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
205
|
+
}
|
|
206
|
+
//超出部分
|
|
236
207
|
var renderOverTag = (overList === null || overList === void 0 ? void 0 : overList.length) ? jsx("div", Object.assign({
|
|
237
208
|
className: "selector-picker-overflow-item"
|
|
238
209
|
}, {
|
|
@@ -255,8 +226,6 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
255
226
|
});
|
|
256
227
|
};
|
|
257
228
|
/** dropdown 下拉浮层 */
|
|
258
|
-
|
|
259
|
-
|
|
260
229
|
var renderOverlay = function renderOverlay() {
|
|
261
230
|
var handSelectorProps = function handSelectorProps() {
|
|
262
231
|
var obj = Object.assign({
|
|
@@ -269,7 +238,6 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
269
238
|
}, selectorProps);
|
|
270
239
|
return obj;
|
|
271
240
|
};
|
|
272
|
-
|
|
273
241
|
return jsx("div", Object.assign({
|
|
274
242
|
className: 'selector-picker-dropdown-content',
|
|
275
243
|
style: {
|
|
@@ -278,13 +246,12 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
278
246
|
}, {
|
|
279
247
|
children: jsx(Selector, Object.assign({}, handSelectorProps()))
|
|
280
248
|
}));
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
|
|
249
|
+
};
|
|
250
|
+
//dropdown anchor
|
|
284
251
|
var renderAnchor = function renderAnchor() {
|
|
285
252
|
var list = handComVal();
|
|
286
|
-
var overflowCls = clsx("selector-picker-overflow", !multiple && "selector-picker-overflow-single");
|
|
287
|
-
|
|
253
|
+
var overflowCls = clsx("selector-picker-overflow", !multiple && "selector-picker-overflow-single");
|
|
254
|
+
//清除图标
|
|
288
255
|
var clearBtn = allowClear && list.length ? jsx("span", Object.assign({
|
|
289
256
|
className: "selector-picker-clear",
|
|
290
257
|
onClick: handleAllClear
|
|
@@ -310,7 +277,6 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
310
277
|
}))]
|
|
311
278
|
}));
|
|
312
279
|
};
|
|
313
|
-
|
|
314
280
|
return jsxs("div", Object.assign({
|
|
315
281
|
className: makeCls(),
|
|
316
282
|
style: style,
|
|
@@ -325,7 +291,8 @@ var SelectorPicker = function SelectorPicker(props) {
|
|
|
325
291
|
onVisibleChange: function onVisibleChange(vis) {
|
|
326
292
|
return setOpen(vis);
|
|
327
293
|
},
|
|
328
|
-
overlayClassName: $prefixCls + '-selector-picker-dropdown'
|
|
294
|
+
overlayClassName: $prefixCls + '-selector-picker-dropdown',
|
|
295
|
+
getPopupContainer: getPopupContainer
|
|
329
296
|
}, {
|
|
330
297
|
children: renderAnchor()
|
|
331
298
|
})), jsx(HelperText, {
|
package/SingleBox/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
|
|
2
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-
|
|
3
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
2
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-87c7d895.js';
|
|
3
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { useState, useEffect } from 'react';
|
|
6
6
|
import { TextField } from '../TextField/index.js';
|
|
@@ -8,8 +8,8 @@ import Label from '../Label/index.js';
|
|
|
8
8
|
import HelperText from '../HelperText/index.js';
|
|
9
9
|
import PlusCircleF from '@para-ui/icons/PlusCircleF';
|
|
10
10
|
import Delete from '@para-ui/icons/Delete';
|
|
11
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
12
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
11
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
12
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
13
13
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
14
14
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
15
15
|
import '@paraview/lib';
|
|
@@ -23,11 +23,11 @@ import 'rc-tooltip/lib/placements';
|
|
|
23
23
|
import 'clsx';
|
|
24
24
|
import '../Loading/index.js';
|
|
25
25
|
import '@para-ui/icons/LoadingF';
|
|
26
|
-
import '../_verture/useGlobalProps-
|
|
26
|
+
import '../_verture/useGlobalProps-1b846a65.js';
|
|
27
27
|
import '@para-ui/core/GlobalContext';
|
|
28
|
-
import '../_verture/index-
|
|
28
|
+
import '../_verture/index-be4faaee.js';
|
|
29
29
|
import 'rc-dropdown';
|
|
30
|
-
import '../_verture/usePopupContainer-
|
|
30
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
31
31
|
import 'dayjs';
|
|
32
32
|
import '../Help/index.js';
|
|
33
33
|
import '@para-ui/icons/Help';
|
|
@@ -50,34 +50,32 @@ styleInject(css_248z);
|
|
|
50
50
|
|
|
51
51
|
var SingleBox = function SingleBox(props) {
|
|
52
52
|
var className = props.className,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
53
|
+
style = props.style,
|
|
54
|
+
_props$size = props.size,
|
|
55
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
56
|
+
_props$placeholder = props.placeholder,
|
|
57
|
+
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder,
|
|
58
|
+
_props$label = props.label,
|
|
59
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
60
|
+
labelTooltip = props.labelTooltip,
|
|
61
|
+
labelSign = props.labelSign,
|
|
62
|
+
_props$disabled = props.disabled,
|
|
63
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
64
|
+
_props$required = props.required,
|
|
65
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
66
|
+
hideErrorDom = props.hideErrorDom,
|
|
67
|
+
_props$helperText = props.helperText,
|
|
68
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
69
|
+
value = props.value,
|
|
70
|
+
onChange = props.onChange,
|
|
71
|
+
fetchSuggestions = props.fetchSuggestions;
|
|
72
72
|
var isError = helperText && typeof helperText === 'string' ? true : false;
|
|
73
73
|
var isErrorArr = helperText instanceof Array;
|
|
74
74
|
var intl = useFormatMessage('SingleBox', localeJson);
|
|
75
|
-
|
|
76
75
|
var _useState = useState([]),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
77
|
+
valueCom = _useState2[0],
|
|
78
|
+
setValueCom = _useState2[1];
|
|
81
79
|
useEffect(function () {
|
|
82
80
|
if (props.defaultValue !== undefined) setValueCom(_toConsumableArray(props.defaultValue));
|
|
83
81
|
}, []);
|
|
@@ -85,16 +83,13 @@ var SingleBox = function SingleBox(props) {
|
|
|
85
83
|
if (value !== undefined) setValueCom(_toConsumableArray(value));
|
|
86
84
|
}, [value]);
|
|
87
85
|
/** 处理错误 */
|
|
88
|
-
|
|
89
86
|
var handError = function handError(index) {
|
|
90
87
|
var obj = {
|
|
91
88
|
error: false,
|
|
92
89
|
helperText: ''
|
|
93
90
|
};
|
|
94
|
-
|
|
95
91
|
if (isErrorArr) {
|
|
96
92
|
var errorItem = helperText[index];
|
|
97
|
-
|
|
98
93
|
if (errorItem) {
|
|
99
94
|
obj = {
|
|
100
95
|
error: true,
|
|
@@ -102,12 +97,9 @@ var SingleBox = function SingleBox(props) {
|
|
|
102
97
|
};
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
|
-
|
|
106
100
|
return obj;
|
|
107
101
|
};
|
|
108
102
|
/** 增加 */
|
|
109
|
-
|
|
110
|
-
|
|
111
103
|
var add = function add() {
|
|
112
104
|
if (disabled) return;
|
|
113
105
|
valueCom.push('');
|
|
@@ -115,8 +107,6 @@ var SingleBox = function SingleBox(props) {
|
|
|
115
107
|
onChange && onChange(valueCom);
|
|
116
108
|
};
|
|
117
109
|
/** 删除 */
|
|
118
|
-
|
|
119
|
-
|
|
120
110
|
var del = function del(index) {
|
|
121
111
|
return function () {
|
|
122
112
|
if (disabled) return;
|
|
@@ -129,8 +119,6 @@ var SingleBox = function SingleBox(props) {
|
|
|
129
119
|
* 改变输入框
|
|
130
120
|
* @param index
|
|
131
121
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
122
|
var changeInput = function changeInput(index) {
|
|
135
123
|
return function (event) {
|
|
136
124
|
valueCom[index] = event.target.value;
|
|
@@ -139,16 +127,12 @@ var SingleBox = function SingleBox(props) {
|
|
|
139
127
|
};
|
|
140
128
|
};
|
|
141
129
|
/** 选择值*/
|
|
142
|
-
|
|
143
|
-
|
|
144
130
|
var selectValue = function selectValue(index) {
|
|
145
131
|
return function (item) {
|
|
146
132
|
valueCom[index] = item;
|
|
147
|
-
|
|
148
133
|
if (_typeof(item) === 'object' && item !== null) {
|
|
149
134
|
valueCom[index] = item.value;
|
|
150
135
|
}
|
|
151
|
-
|
|
152
136
|
if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
|
|
153
137
|
onChange && onChange(valueCom);
|
|
154
138
|
};
|
|
@@ -156,21 +140,15 @@ var SingleBox = function SingleBox(props) {
|
|
|
156
140
|
/**
|
|
157
141
|
* 处理label
|
|
158
142
|
* */
|
|
159
|
-
|
|
160
|
-
|
|
161
143
|
var handLabel = function handLabel() {
|
|
162
144
|
if (!label && !labelSign) return null;
|
|
163
|
-
|
|
164
145
|
var handLabelClass = function handLabelClass() {
|
|
165
146
|
var str = 'single-box-label';
|
|
166
|
-
|
|
167
147
|
if (labelTooltip && labelTooltip.className) {
|
|
168
148
|
str += ' ' + labelTooltip.className;
|
|
169
149
|
}
|
|
170
|
-
|
|
171
150
|
return str;
|
|
172
151
|
};
|
|
173
|
-
|
|
174
152
|
return jsx(Label, Object.assign({
|
|
175
153
|
label: label,
|
|
176
154
|
required: required,
|
|
@@ -180,8 +158,6 @@ var SingleBox = function SingleBox(props) {
|
|
|
180
158
|
}));
|
|
181
159
|
};
|
|
182
160
|
/** 处理class */
|
|
183
|
-
|
|
184
|
-
|
|
185
161
|
var handClass = function handClass() {
|
|
186
162
|
var str = $prefixCls + '-single-box';
|
|
187
163
|
if (className) str += ' ' + className;
|
|
@@ -189,7 +165,6 @@ var SingleBox = function SingleBox(props) {
|
|
|
189
165
|
if (disabled) str += " ".concat($prefixCls, "-single-box-disabled");
|
|
190
166
|
return str;
|
|
191
167
|
};
|
|
192
|
-
|
|
193
168
|
return jsxs("div", Object.assign({
|
|
194
169
|
className: handClass(),
|
|
195
170
|
style: style
|
package/Slider/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { FunctionComponent } from 'react';
|
|
7
7
|
import { SliderSingleProps, SliderRangeProps } from './interface';
|
|
8
8
|
import './index.scss';
|
|
9
|
-
export
|
|
9
|
+
export type Visibles = {
|
|
10
10
|
[index: number]: boolean;
|
|
11
11
|
};
|
|
12
12
|
export declare const Slider: FunctionComponent<SliderSingleProps | SliderRangeProps>;
|