@para-ui/core 3.0.3 → 3.0.4
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/Breadcrumbs/index.d.ts +14 -0
- package/Breadcrumbs/index.js +210 -156
- package/Breadcrumbs/lang/en_US.d.ts +4 -0
- package/Breadcrumbs/lang/index.d.ts +9 -0
- package/Breadcrumbs/lang/zh_CN.d.ts +4 -0
- package/Button/index.js +9 -3
- package/ButtonGroup/index.js +1 -1
- package/Cascader/index.js +1 -1
- package/ComboSelect/index.js +16 -10
- package/DatePicker/generatePicker/index.d.ts +11 -2
- package/DatePicker/index.js +46 -34
- package/Desktop/index.js +1 -1
- package/Drawer/index.js +1 -1
- package/Empty/index.js +1 -1
- package/Form/index.js +3 -3
- package/FormItem/index.js +3 -3
- package/FunctionModal/index.js +3 -3
- package/Modal/index.js +1 -1
- package/OperateBtn/index.js +1 -1
- package/PageHeader/index.js +1 -1
- package/Pagination/index.js +1 -1
- package/PopConfirm/index.js +1 -1
- package/Popover/index.js +2 -16
- package/Querying/index.js +1 -1
- package/README.md +8 -0
- package/Search/index.js +1 -1
- package/Select/index.js +1 -1
- package/SelectInput/index.js +1 -1
- package/Selector/index.js +2 -1
- package/Selector/lang/index.d.ts +2 -0
- package/SelectorPicker/index.js +2 -1
- package/Table/index.js +1 -1
- package/Tabs/index.js +1 -1
- package/TimePicker/index.js +1 -1
- package/ToggleButton/index.js +1 -1
- package/Tooltip/index.js +2 -3
- package/Transfer/index.d.ts +19 -4
- package/Transfer/index.js +118 -70
- package/Transfer/lang/index.d.ts +4 -0
- package/Tree/index.js +3 -3
- package/Upload/index.js +1 -1
- package/_verture/{index-3136f653.js → index-4b4ee8b5.js} +0 -0
- package/_verture/{index-77832168.js → index-e0508c99.js} +1 -1
- package/_verture/{modalContext-f1a611ab.js → modalContext-4bce2dae.js} +0 -0
- package/_verture/{useFormatMessage-ac9d6acf.js → useFormatMessage-f4452258.js} +6 -4
- package/index.js +6 -5
- package/package.json +1 -1
package/Selector/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import Empty from '../Empty/index.js';
|
|
|
17
17
|
import SearchIcon from '@para-ui/icons/Search';
|
|
18
18
|
import Refresh from '@para-ui/icons/Refresh';
|
|
19
19
|
import { ArrayToObject, Get, Post, Cancel } from '@paraview/lib';
|
|
20
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
20
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
21
21
|
import { u as useGlobalProps } from '../_verture/useGlobalProps-af9a2af6.js';
|
|
22
22
|
import '../Label/index.js';
|
|
23
23
|
import '../Help/index.js';
|
|
@@ -41,6 +41,7 @@ import '@para-ui/icons/Forbid';
|
|
|
41
41
|
import '@para-ui/icons/Down';
|
|
42
42
|
import '@para-ui/core/GlobalContext';
|
|
43
43
|
import '@para-ui/icons/More';
|
|
44
|
+
import '@para-ui/icons/Return';
|
|
44
45
|
|
|
45
46
|
var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-selector-node {\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v3-selector-node:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-selector-node > .selector-node-left {\n display: flex;\n align-items: center;\n flex: 1;\n overflow: hidden;\n padding-right: 16px;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-radio {\n margin-right: 8px;\n display: flex;\n align-items: center;\n padding: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-radio .radio-box {\n top: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-check {\n margin-right: 8px;\n display: flex;\n align-items: center;\n padding: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-check .checkbox-box {\n top: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .node-img {\n display: inline-block;\n width: 30px;\n height: 30px;\n margin-right: 8px;\n}\n.paraui-v3-selector-node > .selector-node-left > .node-img img {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch {\n height: 36px;\n padding: 0 16px;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch > .selector-node-left > .main-title {\n font-size: 14px;\n color: rgb(46, 55, 67);\n white-space: nowrap;\n height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch > .selector-node-left > .sub-title {\n margin-left: 8px;\n font-size: 14px;\n color: rgba(46, 55, 67, 0.4);\n white-space: nowrap;\n height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch > .selector-node-left > .tag {\n margin-left: 8px;\n background-color: rgba(54, 102, 214, 0.05);\n color: rgb(54, 102, 214);\n border-radius: 2px;\n font-size: 12px;\n padding: 0px 6px;\n white-space: nowrap;\n height: 17px;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf {\n padding: 6px 16px;\n height: 48px;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box {\n display: flex;\n white-space: nowrap;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n font-size: 14px;\n color: rgb(46, 55, 67);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .tag {\n margin-left: 8px;\n background-color: rgba(54, 102, 214, 0.05);\n color: rgb(54, 102, 214);\n border-radius: 2px;\n font-size: 12px;\n padding: 1px 6px;\n white-space: nowrap;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .sub-title {\n font-size: 12px;\n color: rgba(46, 55, 67, 0.4);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node > .selector-node-right {\n display: flex;\n align-items: center;\n height: 100%;\n}\n.paraui-v3-selector-node > .selector-node-right > .detail {\n font-size: 14px;\n color: rgb(54, 102, 214);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v3-selector-node > .selector-node-right > .detail:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-selector-node > .selector-node-right > .line {\n border-left: 1px solid rgba(171, 176, 185, 0.2);\n margin: 0 8px;\n content: \"\";\n display: inline-block;\n height: 12px;\n}\n.paraui-v3-selector-node > .selector-node-right > .lower-child {\n font-size: 14px;\n color: rgb(54, 102, 214);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v3-selector-node > .selector-node-right > .lower-child:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-selector-node > .selector-node-right > .close {\n display: flex;\n align-items: center;\n color: rgb(54, 102, 214);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v3-selector-node > .selector-node-right > .close:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-selector-node > .selector-node-right > .close:hover > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-selector-node > .selector-node-right > .close > svg {\n font-size: 16px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .detail, .paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .lower-child {\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .detail:hover, .paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .lower-child:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled {\n cursor: not-allowed;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled.paraui-v3-selector-node-branch > .selector-node-left > .main-title {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled > .selector-node-right > .lower-child {\n cursor: not-allowed;\n color: rgba(46, 55, 67, 0.4);\n}\n\n.paraui-v3-selector-detail .selector-detail-popover-content.selector-detail-popover-content-loading {\n min-width: 100px;\n min-height: 50px;\n}";
|
|
46
47
|
styleInject(css_248z$3);
|
package/Selector/lang/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
seeMore: string;
|
|
6
6
|
selected: string;
|
|
7
7
|
pleaseEnter: string;
|
|
8
|
+
searchResult: string;
|
|
8
9
|
};
|
|
9
10
|
en: {
|
|
10
11
|
root: string;
|
|
@@ -12,6 +13,7 @@ declare const _default: {
|
|
|
12
13
|
seeMore: string;
|
|
13
14
|
selected: string;
|
|
14
15
|
pleaseEnter: string;
|
|
16
|
+
searchResult: string;
|
|
15
17
|
};
|
|
16
18
|
};
|
|
17
19
|
export default _default;
|
package/SelectorPicker/index.js
CHANGED
|
@@ -37,10 +37,11 @@ import '../_verture/useGlobalProps-af9a2af6.js';
|
|
|
37
37
|
import '@para-ui/core/GlobalContext';
|
|
38
38
|
import '../Button/index.js';
|
|
39
39
|
import '@para-ui/icons/Forbid';
|
|
40
|
-
import '../_verture/useFormatMessage-
|
|
40
|
+
import '../_verture/useFormatMessage-f4452258.js';
|
|
41
41
|
import '@para-ui/icons/Search';
|
|
42
42
|
import '../Breadcrumbs/index.js';
|
|
43
43
|
import '@para-ui/icons/More';
|
|
44
|
+
import '@para-ui/icons/Return';
|
|
44
45
|
import '../Empty/index.js';
|
|
45
46
|
import '@para-ui/icons/Refresh';
|
|
46
47
|
|
package/Table/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import Screen from '@para-ui/icons/ScreenF';
|
|
|
15
15
|
import SolidArrowUp from '@para-ui/icons/UpTriangleF';
|
|
16
16
|
import SolidArrowDown from '@para-ui/icons/DownTriangleF';
|
|
17
17
|
import Panel from '@para-ui/icons/Panel';
|
|
18
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
18
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
19
19
|
import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
20
20
|
import { _ as _defineProperty } from '../_verture/defineProperty-0590dc61.js';
|
|
21
21
|
import { Radio } from '../Radio/index.js';
|
package/Tabs/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import CloseIcon from '@para-ui/icons/Close';
|
|
|
9
9
|
import { PopConfirm } from '../PopConfirm/index.js';
|
|
10
10
|
import Help from '../Help/index.js';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
12
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
13
13
|
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
14
14
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
15
15
|
import '../_verture/slicedToArray-d7722f4b.js';
|
package/TimePicker/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import '../_verture/style-inject.es-300983ab.js';
|
|
|
17
17
|
import '@para-ui/icons/Down';
|
|
18
18
|
import '../Dropdown/index.js';
|
|
19
19
|
import 'rc-dropdown';
|
|
20
|
-
import '../_verture/useFormatMessage-
|
|
20
|
+
import '../_verture/useFormatMessage-f4452258.js';
|
|
21
21
|
import '@para-ui/core/GlobalContext';
|
|
22
22
|
import '../Tag/index.js';
|
|
23
23
|
import '../_verture/defineProperty-0590dc61.js';
|
package/ToggleButton/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import '@para-ui/icons/Forbid';
|
|
|
15
15
|
import '@para-ui/icons/Down';
|
|
16
16
|
import '../Dropdown/index.js';
|
|
17
17
|
import 'rc-dropdown';
|
|
18
|
-
import '../_verture/useFormatMessage-
|
|
18
|
+
import '../_verture/useFormatMessage-f4452258.js';
|
|
19
19
|
import '@para-ui/core/GlobalContext';
|
|
20
20
|
import 'rc-tooltip';
|
|
21
21
|
import 'rc-tooltip/lib/placements';
|
package/Tooltip/index.js
CHANGED
|
@@ -324,7 +324,6 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
324
324
|
|
|
325
325
|
var _props$prefixCls = props.prefixCls,
|
|
326
326
|
prefixCls = _props$prefixCls === void 0 ? "".concat($rcPrefixCls, "-tooltip") : _props$prefixCls,
|
|
327
|
-
getTooltipContainer = props.getTooltipContainer,
|
|
328
327
|
getPopupContainer = props.getPopupContainer,
|
|
329
328
|
overlayClassName = props.overlayClassName,
|
|
330
329
|
overlayInnerStyle = props.overlayInnerStyle,
|
|
@@ -333,7 +332,7 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
333
332
|
placement = props.placement,
|
|
334
333
|
isPopover = props.isPopover,
|
|
335
334
|
followCursor = props.followCursor,
|
|
336
|
-
restProps = __rest(props, ["prefixCls", "
|
|
335
|
+
restProps = __rest(props, ["prefixCls", "getPopupContainer", "overlayClassName", "overlayInnerStyle", "children", "title", "placement", "isPopover", "followCursor"]);
|
|
337
336
|
|
|
338
337
|
var tempVisible = visible;
|
|
339
338
|
|
|
@@ -348,7 +347,7 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
348
347
|
prefixCls: prefixCls,
|
|
349
348
|
placement: followCursor ? 'top' : mapLegacyPlacement(placement),
|
|
350
349
|
overlayClassName: overlayCls,
|
|
351
|
-
getTooltipContainer: getPopupContainer
|
|
350
|
+
getTooltipContainer: getPopupContainer,
|
|
352
351
|
ref: tRef,
|
|
353
352
|
builtinPlacements: getTooltipPlacements(),
|
|
354
353
|
overlay: title,
|
package/Transfer/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './style/index.scss';
|
|
3
|
+
interface ItemDataProps {
|
|
4
|
+
/** 唯一值,用来过滤 */
|
|
5
|
+
key?: string;
|
|
6
|
+
/** 显示名 */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** 描述 */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** 是否选中 */
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
/** 是否禁用 */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** 是否隐藏 */
|
|
15
|
+
hide?: boolean;
|
|
16
|
+
[name: string]: any;
|
|
17
|
+
}
|
|
3
18
|
/**
|
|
4
19
|
* @description: 穿梭框
|
|
5
20
|
* @param className{string} 类名
|
|
@@ -13,10 +28,10 @@ import './style/index.scss';
|
|
|
13
28
|
interface TransferProps {
|
|
14
29
|
className?: string;
|
|
15
30
|
style?: React.CSSProperties;
|
|
16
|
-
data?: Array<
|
|
17
|
-
value?: Array<
|
|
18
|
-
onChange?: (data: Array<
|
|
31
|
+
data?: Array<ItemDataProps>;
|
|
32
|
+
value?: Array<ItemDataProps>;
|
|
33
|
+
onChange?: (data: Array<ItemDataProps>) => void;
|
|
19
34
|
titles?: Array<string>;
|
|
20
35
|
}
|
|
21
|
-
export declare const Transfer: (
|
|
36
|
+
export declare const Transfer: (props: TransferProps) => JSX.Element;
|
|
22
37
|
export default Transfer;
|
package/Transfer/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-f8047a75.js';
|
|
2
2
|
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { useState,
|
|
4
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { Checkbox } from '../Checkbox/index.js';
|
|
7
7
|
import { Search } from '../Search/index.js';
|
|
@@ -10,8 +10,9 @@ import { Button } from '../Button/index.js';
|
|
|
10
10
|
import SearchIcon from '@para-ui/icons/Search';
|
|
11
11
|
import NavigateBefore from '@para-ui/icons/Left';
|
|
12
12
|
import Right from '@para-ui/icons/Right';
|
|
13
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
13
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
14
14
|
import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
15
|
+
import { ArrayToObject } from '@paraview/lib';
|
|
15
16
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
16
17
|
import '../Label/index.js';
|
|
17
18
|
import '../Help/index.js';
|
|
@@ -22,7 +23,6 @@ import 'rc-tooltip/lib/placements';
|
|
|
22
23
|
import '@para-ui/icons/Help';
|
|
23
24
|
import '../TextField/index.js';
|
|
24
25
|
import '../_verture/typeof-498dd2b1.js';
|
|
25
|
-
import '@paraview/lib';
|
|
26
26
|
import '@para-ui/icons/PreviewClose';
|
|
27
27
|
import '@para-ui/icons/PreviewOpen';
|
|
28
28
|
import '@para-ui/icons/CloseCircle';
|
|
@@ -60,15 +60,14 @@ var localeJson = {
|
|
|
60
60
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-transfer {\n display: flex;\n font-size: 14px;\n}\n.paraui-v3-transfer .box {\n width: 289px;\n border-radius: 4px;\n border: 1px solid rgba(171, 176, 185, 0.368627451);\n overflow: hidden;\n}\n.paraui-v3-transfer .box .box-header {\n background: rgba(171, 176, 185, 0.2745098039);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-left: 10px;\n height: 44px;\n}\n.paraui-v3-transfer .box .box-header .count {\n margin: 0 10px 0 0;\n color: #999;\n letter-spacing: 1px;\n}\n.paraui-v3-transfer .box .context {\n height: 400px;\n overflow: auto;\n scrollbar-base-color: red;\n}\n.paraui-v3-transfer .box .text-field-content {\n border: none;\n border-radius: 0;\n border-bottom: 1px solid #ddd;\n}\n.paraui-v3-transfer ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: #3666D6;\n}\n.paraui-v3-transfer .moveBtn {\n display: flex;\n height: 414px;\n flex-direction: column;\n justify-content: center;\n margin: 0 24px;\n}\n.paraui-v3-transfer .moveBtn .btn-left {\n margin-top: 20px;\n}\n.paraui-v3-transfer .context .item {\n padding: 0px 12px;\n height: 36px;\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v3-transfer .context .item > .item-label {\n margin-left: 8px;\n flex: 1;\n overflow: hidden;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-transfer .context .item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-transfer .context .item:hover > .item-label {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-transfer .context .item.item-disabled:hover {\n background: inherit;\n}\n.paraui-v3-transfer .context .item.item-disabled > .item-label {\n color: rgba(46, 55, 67, 0.4);\n}";
|
|
61
61
|
styleInject(css_248z);
|
|
62
62
|
|
|
63
|
-
var Transfer = function Transfer(
|
|
64
|
-
var
|
|
65
|
-
data =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
style = _ref.style;
|
|
63
|
+
var Transfer = function Transfer(props) {
|
|
64
|
+
var _props$data = props.data,
|
|
65
|
+
data = _props$data === void 0 ? [] : _props$data,
|
|
66
|
+
value = props.value,
|
|
67
|
+
onChange = props.onChange,
|
|
68
|
+
titles = props.titles,
|
|
69
|
+
className = props.className,
|
|
70
|
+
style = props.style;
|
|
72
71
|
var intl = useFormatMessage('Transfer', localeJson);
|
|
73
72
|
|
|
74
73
|
var _useState = useState(data),
|
|
@@ -76,7 +75,7 @@ var Transfer = function Transfer(_ref) {
|
|
|
76
75
|
leftData = _useState2[0],
|
|
77
76
|
setLeftData = _useState2[1];
|
|
78
77
|
|
|
79
|
-
var _useState3 = useState(
|
|
78
|
+
var _useState3 = useState([]),
|
|
80
79
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
80
|
rightData = _useState4[0],
|
|
82
81
|
setRightData = _useState4[1];
|
|
@@ -111,6 +110,33 @@ var Transfer = function Transfer(_ref) {
|
|
|
111
110
|
actionRightStyle = _useState16[0],
|
|
112
111
|
setActionRightStyle = _useState16[1];
|
|
113
112
|
|
|
113
|
+
useEffect(function () {
|
|
114
|
+
if (value) {
|
|
115
|
+
setRightData(_toConsumableArray(value));
|
|
116
|
+
filterLeftData(_toConsumableArray(value));
|
|
117
|
+
}
|
|
118
|
+
}, [value]);
|
|
119
|
+
/**
|
|
120
|
+
* @description 过滤左边数据
|
|
121
|
+
* @param arr {ItemDataProps} 右边数据源
|
|
122
|
+
* */
|
|
123
|
+
|
|
124
|
+
var filterLeftData = function filterLeftData(arr) {
|
|
125
|
+
var keyJson = ArrayToObject('key', arr);
|
|
126
|
+
var nameJson = ArrayToObject('name', arr);
|
|
127
|
+
var handArr = [];
|
|
128
|
+
var leftArr = props.data || [];
|
|
129
|
+
|
|
130
|
+
for (var i = 0, l = leftArr.length; i < l; i++) {
|
|
131
|
+
var item = leftArr[i];
|
|
132
|
+
var key = item.key || item.name || '';
|
|
133
|
+
if (key && (keyJson[key] || nameJson[key])) continue;
|
|
134
|
+
handArr.push(item);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
setLeftData(handArr);
|
|
138
|
+
};
|
|
139
|
+
|
|
114
140
|
var onchange = useCallback(function (e, bol, index, direction) {
|
|
115
141
|
if (direction === 'left') {
|
|
116
142
|
leftData[index].checked = bol;
|
|
@@ -123,12 +149,12 @@ var Transfer = function Transfer(_ref) {
|
|
|
123
149
|
var queryAll = useCallback(function (e, direction) {
|
|
124
150
|
if (direction === 'left') {
|
|
125
151
|
leftData.forEach(function (item) {
|
|
126
|
-
item.checked = e.target.checked;
|
|
152
|
+
if (!item.disabled && !item.hide) item.checked = e.target.checked;
|
|
127
153
|
});
|
|
128
154
|
setLeftData(_toConsumableArray(leftData));
|
|
129
155
|
} else {
|
|
130
156
|
rightData.forEach(function (item) {
|
|
131
|
-
item.checked = e.target.checked;
|
|
157
|
+
if (!item.disabled && !item.hide) item.checked = e.target.checked;
|
|
132
158
|
});
|
|
133
159
|
setRightData(_toConsumableArray(rightData));
|
|
134
160
|
} //console.log(e.target.checked)
|
|
@@ -136,13 +162,14 @@ var Transfer = function Transfer(_ref) {
|
|
|
136
162
|
|
|
137
163
|
setleftChecked(e.target.checked);
|
|
138
164
|
}, [leftData, rightData]);
|
|
139
|
-
|
|
165
|
+
|
|
166
|
+
var onMove = function onMove(direction) {
|
|
140
167
|
var newData = [];
|
|
141
168
|
|
|
142
169
|
if (direction === 'left') {
|
|
143
170
|
newData = _toConsumableArray(rightData);
|
|
144
171
|
newData.forEach(function (item) {
|
|
145
|
-
if (item.checked) {
|
|
172
|
+
if (item.checked && !item.hide) {
|
|
146
173
|
item.checked = false;
|
|
147
174
|
leftData.push(item);
|
|
148
175
|
rightData.splice(rightData.indexOf(item), 1);
|
|
@@ -151,7 +178,7 @@ var Transfer = function Transfer(_ref) {
|
|
|
151
178
|
} else {
|
|
152
179
|
newData = _toConsumableArray(leftData);
|
|
153
180
|
newData.forEach(function (item) {
|
|
154
|
-
if (item.checked) {
|
|
181
|
+
if (item.checked && !item.hide) {
|
|
155
182
|
item.checked = false;
|
|
156
183
|
rightData.push(item);
|
|
157
184
|
leftData.splice(leftData.indexOf(item), 1);
|
|
@@ -162,56 +189,81 @@ var Transfer = function Transfer(_ref) {
|
|
|
162
189
|
setLeftData(_toConsumableArray(leftData));
|
|
163
190
|
setRightData(_toConsumableArray(rightData));
|
|
164
191
|
onChange && onChange(rightData);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var
|
|
169
|
-
var result = [];
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
var onSearch = function onSearch(e, direction) {
|
|
195
|
+
var str = e.toUpperCase();
|
|
170
196
|
|
|
171
197
|
if (direction === 'left') {
|
|
172
|
-
|
|
173
|
-
|
|
198
|
+
leftData.forEach(function (item) {
|
|
199
|
+
item.hide = false;
|
|
200
|
+
var name = (item.name || '').toUpperCase();
|
|
201
|
+
var description = (item.description || '').toUpperCase();
|
|
202
|
+
|
|
203
|
+
if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
|
|
204
|
+
item.hide = true;
|
|
205
|
+
}
|
|
174
206
|
});
|
|
175
|
-
setLeftData(
|
|
207
|
+
setLeftData(_toConsumableArray(leftData));
|
|
176
208
|
} else {
|
|
177
|
-
|
|
178
|
-
|
|
209
|
+
rightData.filter(function (item) {
|
|
210
|
+
item.hide = false;
|
|
211
|
+
var name = (item.name || '').toUpperCase();
|
|
212
|
+
var description = (item.description || '').toUpperCase();
|
|
213
|
+
|
|
214
|
+
if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
|
|
215
|
+
item.hide = true;
|
|
216
|
+
}
|
|
179
217
|
});
|
|
180
|
-
setRightData(
|
|
218
|
+
setRightData(_toConsumableArray(rightData));
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* 计算全选,半选
|
|
223
|
+
* @return {'' | 'checked' | 'indeterminate'} 全不选 / 全选 / 半选
|
|
224
|
+
* */
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
var calculationStatus = function calculationStatus(arr) {
|
|
228
|
+
if (arr.length === 0) return ''; // 全不选
|
|
229
|
+
|
|
230
|
+
var checked = false;
|
|
231
|
+
var noChecked = false;
|
|
232
|
+
|
|
233
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
234
|
+
if (checked && noChecked) break;
|
|
235
|
+
var item = arr[i];
|
|
236
|
+
if (item.disabled || item.hide) continue;
|
|
237
|
+
|
|
238
|
+
if (item.checked) {
|
|
239
|
+
checked = true;
|
|
240
|
+
} else {
|
|
241
|
+
noChecked = true;
|
|
242
|
+
}
|
|
181
243
|
}
|
|
182
|
-
|
|
244
|
+
|
|
245
|
+
if (checked && !noChecked) return 'checked'; // 全选
|
|
246
|
+
|
|
247
|
+
if (checked && noChecked) return 'indeterminate'; // 半选
|
|
248
|
+
|
|
249
|
+
return '';
|
|
250
|
+
};
|
|
251
|
+
|
|
183
252
|
useEffect(function () {
|
|
184
253
|
var arr = leftData.filter(function (item) {
|
|
185
|
-
return item.checked;
|
|
254
|
+
return item.checked && !item.hide;
|
|
186
255
|
});
|
|
187
256
|
setLeftCount(arr.length);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
setActionRightStyle('on');
|
|
192
|
-
} else if (arr.length && arr.length === leftData.length) {
|
|
193
|
-
setleftChecked('checked');
|
|
194
|
-
setActionRightStyle('on');
|
|
195
|
-
} else {
|
|
196
|
-
setleftChecked('');
|
|
197
|
-
setActionRightStyle('');
|
|
198
|
-
}
|
|
199
|
-
|
|
257
|
+
var leftType = calculationStatus(leftData);
|
|
258
|
+
setleftChecked(leftType);
|
|
259
|
+
setActionRightStyle(leftType === 'indeterminate' || leftType === 'checked' ? 'on' : '');
|
|
200
260
|
var rArr = rightData.filter(function (item) {
|
|
201
|
-
return item.checked;
|
|
261
|
+
return item.checked && !item.hide;
|
|
202
262
|
});
|
|
203
263
|
setRightCount(rArr.length);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
setActionLeftStyle('on');
|
|
208
|
-
} else if (rArr.length && rArr.length === rightData.length) {
|
|
209
|
-
setrightChecked('checked');
|
|
210
|
-
setActionLeftStyle('on');
|
|
211
|
-
} else {
|
|
212
|
-
setrightChecked('');
|
|
213
|
-
setActionLeftStyle('');
|
|
214
|
-
}
|
|
264
|
+
var rightType = calculationStatus(rightData);
|
|
265
|
+
setrightChecked(rightType);
|
|
266
|
+
setActionLeftStyle(rightType === 'indeterminate' || rightType === 'checked' ? 'on' : '');
|
|
215
267
|
}, [leftData, rightData]);
|
|
216
268
|
return jsxs("div", Object.assign({
|
|
217
269
|
className: clsx("".concat($prefixCls, "-transfer"), className),
|
|
@@ -233,7 +285,7 @@ var Transfer = function Transfer(_ref) {
|
|
|
233
285
|
onChange: function onChange(e) {
|
|
234
286
|
queryAll(e, 'left');
|
|
235
287
|
}
|
|
236
|
-
}
|
|
288
|
+
}), jsxs("div", Object.assign({
|
|
237
289
|
className: "count"
|
|
238
290
|
}, {
|
|
239
291
|
children: [leftCount, "/", leftData.length]
|
|
@@ -245,17 +297,15 @@ var Transfer = function Transfer(_ref) {
|
|
|
245
297
|
}),
|
|
246
298
|
showBtn: false,
|
|
247
299
|
rightIcon: jsx(SearchIcon, {}),
|
|
248
|
-
onChange: function onChange(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
var arr = (_a = e === null || e === void 0 ? void 0 : e.split('')) !== null && _a !== void 0 ? _a : [];
|
|
252
|
-
onSearch(arr, 'left');
|
|
300
|
+
onChange: function onChange(val) {
|
|
301
|
+
onSearch(val, 'left');
|
|
253
302
|
},
|
|
254
303
|
allowClear: false
|
|
255
304
|
}), jsx("div", Object.assign({
|
|
256
305
|
className: "context"
|
|
257
306
|
}, {
|
|
258
307
|
children: leftData.map(function (item, index) {
|
|
308
|
+
if (item.hide) return null;
|
|
259
309
|
return jsxs("div", Object.assign({
|
|
260
310
|
className: clsx('item', item.disabled && 'item-disabled'),
|
|
261
311
|
onClick: function onClick(e) {
|
|
@@ -271,10 +321,10 @@ var Transfer = function Transfer(_ref) {
|
|
|
271
321
|
className: "item-label"
|
|
272
322
|
}, {
|
|
273
323
|
children: jsx(AutoTips, {
|
|
274
|
-
children: item.name
|
|
324
|
+
children: item.name || item.key
|
|
275
325
|
})
|
|
276
326
|
}))]
|
|
277
|
-
}), item.name);
|
|
327
|
+
}), item.key || item.name);
|
|
278
328
|
})
|
|
279
329
|
}))]
|
|
280
330
|
})), jsxs("div", Object.assign({
|
|
@@ -341,17 +391,15 @@ var Transfer = function Transfer(_ref) {
|
|
|
341
391
|
}),
|
|
342
392
|
showBtn: false,
|
|
343
393
|
rightIcon: jsx(SearchIcon, {}),
|
|
344
|
-
onChange: function onChange(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var arr = (_a = e === null || e === void 0 ? void 0 : e.split('')) !== null && _a !== void 0 ? _a : [];
|
|
348
|
-
onSearch(arr, 'right');
|
|
394
|
+
onChange: function onChange(val) {
|
|
395
|
+
onSearch(val, 'right');
|
|
349
396
|
},
|
|
350
397
|
allowClear: false
|
|
351
398
|
}), jsx("div", Object.assign({
|
|
352
399
|
className: "context"
|
|
353
400
|
}, {
|
|
354
401
|
children: rightData.map(function (item, index) {
|
|
402
|
+
if (item.hide) return null;
|
|
355
403
|
return jsxs("div", Object.assign({
|
|
356
404
|
className: clsx('item', item.disabled && 'item-disabled'),
|
|
357
405
|
onClick: function onClick(e) {
|
|
@@ -367,10 +415,10 @@ var Transfer = function Transfer(_ref) {
|
|
|
367
415
|
className: "item-label"
|
|
368
416
|
}, {
|
|
369
417
|
children: jsx(AutoTips, {
|
|
370
|
-
children: item.name
|
|
418
|
+
children: item.name || item.key
|
|
371
419
|
})
|
|
372
420
|
}))]
|
|
373
|
-
}), item.name);
|
|
421
|
+
}), item.key || item.name);
|
|
374
422
|
})
|
|
375
423
|
}))]
|
|
376
424
|
}))]
|
package/Transfer/lang/index.d.ts
CHANGED
|
@@ -3,11 +3,15 @@ declare const _default: {
|
|
|
3
3
|
left: string;
|
|
4
4
|
right: string;
|
|
5
5
|
searchPlaceholder: string;
|
|
6
|
+
leftBtnTips: string;
|
|
7
|
+
rightBtnTips: string;
|
|
6
8
|
};
|
|
7
9
|
en: {
|
|
8
10
|
left: string;
|
|
9
11
|
right: string;
|
|
10
12
|
searchPlaceholder: string;
|
|
13
|
+
leftBtnTips: string;
|
|
14
|
+
rightBtnTips: string;
|
|
11
15
|
};
|
|
12
16
|
};
|
|
13
17
|
export default _default;
|
package/Tree/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Tree } from '../_verture/index-
|
|
2
|
-
export { T as default } from '../_verture/index-
|
|
1
|
+
import { T as Tree } from '../_verture/index-e0508c99.js';
|
|
2
|
+
export { T as default } from '../_verture/index-e0508c99.js';
|
|
3
3
|
import '../_verture/toConsumableArray-f8047a75.js';
|
|
4
4
|
import '../_verture/slicedToArray-d7722f4b.js';
|
|
5
5
|
import '../_verture/defineProperty-0590dc61.js';
|
|
@@ -28,7 +28,7 @@ import '@para-ui/icons/PlusCircle';
|
|
|
28
28
|
import '@para-ui/icons/Delete';
|
|
29
29
|
import '@para-ui/icons/Forbid';
|
|
30
30
|
import '@paraview/lib';
|
|
31
|
-
import '../_verture/useFormatMessage-
|
|
31
|
+
import '../_verture/useFormatMessage-f4452258.js';
|
|
32
32
|
import '@para-ui/core/GlobalContext';
|
|
33
33
|
import '@para-ui/icons/MoreCircle';
|
|
34
34
|
import '../Empty/index.js';
|
package/Upload/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import clsx from 'clsx';
|
|
|
16
16
|
import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
17
17
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
18
18
|
import Forbid from '@para-ui/icons/Forbid';
|
|
19
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
19
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
20
20
|
import EditOutline from '@para-ui/icons/EditOutline';
|
|
21
21
|
import { Button } from '../Button/index.js';
|
|
22
22
|
import { Slider } from '../Slider/index.js';
|
|
File without changes
|
|
@@ -20,7 +20,7 @@ import Delete from '@para-ui/icons/Delete';
|
|
|
20
20
|
import Forbid from '@para-ui/icons/Forbid';
|
|
21
21
|
import { Tooltip } from '../Tooltip/index.js';
|
|
22
22
|
import { UUID, Request } from '@paraview/lib';
|
|
23
|
-
import { u as useFormatMessage } from './useFormatMessage-
|
|
23
|
+
import { u as useFormatMessage } from './useFormatMessage-f4452258.js';
|
|
24
24
|
import { s as styleInject } from './style-inject.es-300983ab.js';
|
|
25
25
|
import MoreOutlinedIcon from '@para-ui/icons/MoreCircle';
|
|
26
26
|
import Empty from '../Empty/index.js';
|
|
File without changes
|
|
@@ -2,17 +2,19 @@ import React__default from 'react';
|
|
|
2
2
|
import GlobalContext from '@para-ui/core/GlobalContext';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @author linhd
|
|
6
|
-
* @date 2022/3/15 4:03 PM
|
|
7
|
-
* @description 国际化钩子
|
|
8
|
-
*/
|
|
5
|
+
* @author linhd
|
|
6
|
+
* @date 2022/3/15 4:03 PM
|
|
7
|
+
* @description 国际化钩子
|
|
8
|
+
*/
|
|
9
9
|
|
|
10
10
|
var useFormatMessage = function useFormatMessage(comName, defI18nData) {
|
|
11
11
|
var _React$useContext = React__default.useContext(GlobalContext),
|
|
12
12
|
intlFormat = _React$useContext.intlFormat;
|
|
13
13
|
|
|
14
14
|
defI18nData.zh_CN = defI18nData.zh;
|
|
15
|
+
defI18nData['zh-CN'] = defI18nData.zh;
|
|
15
16
|
defI18nData.en_US = defI18nData.en;
|
|
17
|
+
defI18nData['en-US'] = defI18nData.en;
|
|
16
18
|
var intl = intlFormat && intlFormat(comName, defI18nData);
|
|
17
19
|
return intl;
|
|
18
20
|
};
|
package/index.js
CHANGED
|
@@ -19,8 +19,8 @@ export { Drawer } from './Drawer/index.js';
|
|
|
19
19
|
export { Dropdown } from './Dropdown/index.js';
|
|
20
20
|
export { default as Empty } from './Empty/index.js';
|
|
21
21
|
export { default as Form } from './Form/index.js';
|
|
22
|
-
export { F as FormItem } from './_verture/index-
|
|
23
|
-
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-
|
|
22
|
+
export { F as FormItem } from './_verture/index-4b4ee8b5.js';
|
|
23
|
+
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-4bce2dae.js';
|
|
24
24
|
export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
|
|
25
25
|
export { default as Help } from './Help/index.js';
|
|
26
26
|
export { default as HelperText } from './HelperText/index.js';
|
|
@@ -64,7 +64,7 @@ export { Title } from './Title/index.js';
|
|
|
64
64
|
export { ToggleButton, ToggleButtonGroup } from './ToggleButton/index.js';
|
|
65
65
|
export { Tooltip } from './Tooltip/index.js';
|
|
66
66
|
export { Transfer } from './Transfer/index.js';
|
|
67
|
-
export { T as Tree } from './_verture/index-
|
|
67
|
+
export { T as Tree } from './_verture/index-e0508c99.js';
|
|
68
68
|
export { default as Upload } from './Upload/index.js';
|
|
69
69
|
import './_verture/slicedToArray-d7722f4b.js';
|
|
70
70
|
import 'react/jsx-runtime';
|
|
@@ -75,14 +75,15 @@ import './_verture/constant-bf34e6fa.js';
|
|
|
75
75
|
import '@para-ui/icons/More';
|
|
76
76
|
import './_verture/style-inject.es-300983ab.js';
|
|
77
77
|
import './_verture/toConsumableArray-f8047a75.js';
|
|
78
|
+
import '@para-ui/icons/Return';
|
|
79
|
+
import './_verture/useFormatMessage-f4452258.js';
|
|
80
|
+
import '@para-ui/core/GlobalContext';
|
|
78
81
|
import './_verture/typeof-498dd2b1.js';
|
|
79
82
|
import './_verture/tslib.es6-55ed4bd2.js';
|
|
80
83
|
import 'clsx';
|
|
81
84
|
import '@para-ui/icons/LoadingF';
|
|
82
85
|
import '@para-ui/icons/Forbid';
|
|
83
86
|
import '@para-ui/icons/Down';
|
|
84
|
-
import './_verture/useFormatMessage-ac9d6acf.js';
|
|
85
|
-
import '@para-ui/core/GlobalContext';
|
|
86
87
|
import './_verture/defineProperty-0590dc61.js';
|
|
87
88
|
import 'react-slick';
|
|
88
89
|
import './_verture/index-342379c6.js';
|