@para-ui/core 3.0.55 → 3.0.56
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.d.ts +34 -0
- package/AutoBox/index.js +277 -0
- package/AutoBox/protal.d.ts +17 -0
- package/AutoTips/autoTipsMultiline/index.d.ts +18 -0
- package/AutoTips/index.d.ts +35 -0
- package/AutoTips/index.js +271 -0
- package/Breadcrumbs/index.d.ts +53 -0
- package/Breadcrumbs/index.js +266 -0
- 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/SplitButton.d.ts +64 -0
- package/Button/index.d.ts +79 -0
- package/Button/index.js +376 -0
- package/Button/lang/en_US.d.ts +4 -0
- package/Button/lang/index.d.ts +9 -0
- package/Button/lang/zh_CN.d.ts +4 -0
- package/ButtonGroup/index.d.ts +33 -0
- package/ButtonGroup/index.js +124 -0
- package/Carousel/index.d.ts +38 -0
- package/Carousel/index.js +78 -0
- package/Cascader/index.d.ts +54 -0
- package/Cascader/index.js +159 -0
- package/Cascader/lang/en_US.d.ts +4 -0
- package/Cascader/lang/index.d.ts +9 -0
- package/Cascader/lang/zh_CN.d.ts +4 -0
- package/Checkbox/index.d.ts +40 -0
- package/Checkbox/index.js +109 -0
- package/CheckboxGroup/index.d.ts +45 -0
- package/CheckboxGroup/index.js +142 -0
- package/Collapse/collapsePanel.d.ts +30 -0
- package/Collapse/index.d.ts +57 -0
- package/Collapse/index.js +152 -0
- package/Collapse/motion.d.ts +5 -0
- package/Collapse/util.d.ts +11 -0
- package/CollapseBox/index.d.ts +27 -0
- package/CollapseBox/index.js +148 -0
- package/CollapseBox/util.d.ts +5 -0
- package/CollapseLayout/index.d.ts +53 -0
- package/CollapseLayout/index.js +176 -0
- package/ColorPicker/index.d.ts +4 -0
- package/ColorPicker/index.js +4 -0
- package/ComboSelect/index.d.ts +6 -0
- package/ComboSelect/index.js +1049 -0
- package/ComboSelect/interface.d.ts +146 -0
- package/ComboSelect/lang/en_US.d.ts +9 -0
- package/ComboSelect/lang/index.d.ts +19 -0
- package/ComboSelect/lang/zh_CN.d.ts +9 -0
- package/ComboSelect/utils.d.ts +9 -0
- package/Container/index.d.ts +77 -0
- package/Container/index.js +232 -0
- package/DatePicker/PickerButton.d.ts +3 -0
- package/DatePicker/PickerTag.d.ts +3 -0
- package/DatePicker/generatePicker/generateRangePicker.d.ts +4 -0
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +11 -0
- package/DatePicker/generatePicker/index.d.ts +95 -0
- package/DatePicker/index.d.ts +18 -0
- package/DatePicker/index.js +633 -0
- package/DatePicker/lang/en_US.d.ts +3 -0
- package/DatePicker/lang/index.d.ts +7 -0
- package/DatePicker/lang/zh_CN.d.ts +3 -0
- package/DatePicker/util.d.ts +22 -0
- package/Desktop/index.d.ts +57 -0
- package/Desktop/index.js +746 -0
- package/DragVerify/index.d.ts +36 -0
- package/DragVerify/index.js +385 -0
- package/DragVerify/lang/en_US.d.ts +5 -0
- package/DragVerify/lang/index.d.ts +11 -0
- package/DragVerify/lang/zh_CN.d.ts +5 -0
- package/Drawer/index.d.ts +11 -0
- package/Drawer/index.js +235 -0
- package/Drawer/interface.d.ts +92 -0
- package/Drawer/lang/en_US.d.ts +5 -0
- package/Drawer/lang/index.d.ts +11 -0
- package/Drawer/lang/zh_CN.d.ts +5 -0
- package/Dropdown/index.d.ts +40 -0
- package/Dropdown/index.js +10 -0
- package/DynamicMultiBox/formItem.d.ts +14 -0
- package/DynamicMultiBox/index.d.ts +5 -0
- package/DynamicMultiBox/index.js +1323 -0
- package/DynamicMultiBox/interface.d.ts +165 -0
- package/DynamicMultiBox/rowForm.d.ts +24 -0
- package/Empty/images/index.d.ts +3 -0
- package/Empty/index.d.ts +30 -0
- package/Empty/index.js +642 -0
- package/Empty/lang/en_US.d.ts +6 -0
- package/Empty/lang/index.d.ts +13 -0
- package/Empty/lang/zh_CN.d.ts +6 -0
- package/Form/index.d.ts +187 -0
- package/Form/index.js +355 -0
- package/FormItem/compoments/defaultCompoments/index.d.ts +19 -0
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +8 -0
- package/FormItem/compoments/formFile/index.d.ts +38 -0
- package/FormItem/compoments/formRadioGroup/index.d.ts +8 -0
- package/FormItem/compoments/formSelect/index.d.ts +18 -0
- package/FormItem/errorTips.d.ts +12 -0
- package/FormItem/index.d.ts +152 -0
- package/FormItem/index.js +78 -0
- package/FormItem/itemType.d.ts +42 -0
- package/FormItem/validateFunction.d.ts +15 -0
- package/FunctionModal/dialog.d.ts +58 -0
- package/FunctionModal/index.d.ts +8 -0
- package/FunctionModal/index.js +43 -0
- package/FunctionModal/modalContext.d.ts +15 -0
- package/GlobalContext/componentsProps.d.ts +21 -0
- package/GlobalContext/confirmLocale.d.ts +7 -0
- package/GlobalContext/constant.d.ts +8 -0
- package/GlobalContext/index.d.ts +28 -0
- package/GlobalContext/index.js +41 -0
- package/GlobalContext/intl.d.ts +34 -0
- package/GlobalContext/useFormatMessage.d.ts +3 -0
- package/GlobalContext/usePopupContainer.d.ts +4 -0
- package/Help/index.d.ts +24 -0
- package/Help/index.js +41 -0
- package/HelperText/index.d.ts +27 -0
- package/HelperText/index.js +34 -0
- package/Hooks/useGlobalProps.d.ts +1 -0
- package/InputLang/index.d.ts +57 -0
- package/InputLang/index.js +355 -0
- package/InputNumber/index.d.ts +71 -0
- package/InputNumber/index.js +277 -0
- package/Label/index.d.ts +37 -0
- package/Label/index.js +85 -0
- package/Loading/index.d.ts +17 -0
- package/Loading/index.js +47 -0
- package/Menu/footerExpansion.d.ts +9 -0
- package/Menu/index.d.ts +10 -0
- package/Menu/index.js +1105 -0
- package/Menu/interface.d.ts +141 -0
- package/Menu/logo.d.ts +9 -0
- package/Menu/verticalMenuList.d.ts +14 -0
- package/Message/index.d.ts +99 -0
- package/Message/index.js +246 -0
- package/Modal/Confirm/index.d.ts +65 -0
- package/Modal/index.d.ts +99 -0
- package/Modal/index.js +421 -0
- package/Modal/lang/en_US.d.ts +5 -0
- package/Modal/lang/index.d.ts +11 -0
- package/Modal/lang/zh_CN.d.ts +5 -0
- package/MultiBox/index.d.ts +60 -0
- package/MultiBox/index.js +277 -0
- package/MultiBox/lang/en_US.d.ts +4 -0
- package/MultiBox/lang/index.d.ts +9 -0
- package/MultiBox/lang/zh_CN.d.ts +4 -0
- package/Notification/index.d.ts +74 -0
- package/Notification/index.js +252 -0
- package/OperateBtn/index.d.ts +59 -0
- package/OperateBtn/index.js +237 -0
- package/OperateBtn/lang/en_US.d.ts +4 -0
- package/OperateBtn/lang/index.d.ts +9 -0
- package/OperateBtn/lang/zh_CN.d.ts +4 -0
- package/PageHeader/horizontalMeun.d.ts +9 -0
- package/PageHeader/horizontalMeunRight.d.ts +9 -0
- package/PageHeader/index.d.ts +10 -0
- package/PageHeader/index.js +1050 -0
- package/PageHeader/interface.d.ts +169 -0
- package/Pagination/index.d.ts +46 -0
- package/Pagination/index.js +461 -0
- package/Pagination/lang/en_US.d.ts +8 -0
- package/Pagination/lang/index.d.ts +17 -0
- package/Pagination/lang/zh_CN.d.ts +8 -0
- package/ParauiProvider/index.d.ts +8 -0
- package/ParauiProvider/index.js +52 -0
- package/PasswordRules/index.d.ts +55 -0
- package/PasswordRules/index.js +144 -0
- package/PopConfirm/index.d.ts +61 -0
- package/PopConfirm/index.js +194 -0
- package/PopConfirm/lang/en_US.d.ts +5 -0
- package/PopConfirm/lang/index.d.ts +11 -0
- package/PopConfirm/lang/zh_CN.d.ts +5 -0
- package/Popover/index.d.ts +16 -0
- package/Popover/index.js +59 -0
- package/Progress/Line.d.ts +47 -0
- package/Progress/Steps.d.ts +17 -0
- package/Progress/index.d.ts +83 -0
- package/Progress/index.js +323 -0
- package/Progress/utils.d.ts +6 -0
- package/Querying/images/index.d.ts +3 -0
- package/Querying/index.d.ts +26 -0
- package/Querying/index.js +760 -0
- package/Querying/lang/en_US.d.ts +4 -0
- package/Querying/lang/index.d.ts +9 -0
- package/Querying/lang/zh_CN.d.ts +4 -0
- package/README.md +6 -0
- package/Radio/index.d.ts +38 -0
- package/Radio/index.js +97 -0
- package/RadioGroup/index.d.ts +46 -0
- package/RadioGroup/index.js +134 -0
- package/Search/index.d.ts +57 -0
- package/Search/index.js +208 -0
- package/Select/index.d.ts +93 -0
- package/Select/index.js +1146 -0
- package/Select/lang/en_US.d.ts +5 -0
- package/Select/lang/index.d.ts +11 -0
- package/Select/lang/zh_CN.d.ts +5 -0
- package/SelectInput/index.d.ts +12 -0
- package/SelectInput/index.js +55 -0
- package/Selector/index.d.ts +11 -0
- package/Selector/index.js +2175 -0
- package/Selector/interface.d.ts +432 -0
- package/Selector/lang/en_US.d.ts +11 -0
- package/Selector/lang/index.d.ts +23 -0
- package/Selector/lang/zh_CN.d.ts +11 -0
- package/Selector/selectorData/index.d.ts +10 -0
- package/Selector/selectorMain/index.d.ts +10 -0
- package/Selector/selectorNode/index.d.ts +10 -0
- package/Selector/util.d.ts +15 -0
- package/SelectorPicker/index.d.ts +53 -0
- package/SelectorPicker/index.js +444 -0
- package/SelectorPicker/lang/en_US.d.ts +5 -0
- package/SelectorPicker/lang/index.d.ts +11 -0
- package/SelectorPicker/lang/zh_CN.d.ts +5 -0
- package/SingleBox/index.d.ts +44 -0
- package/SingleBox/index.js +224 -0
- package/SingleBox/lang/en_US.d.ts +4 -0
- package/SingleBox/lang/index.d.ts +9 -0
- package/SingleBox/lang/zh_CN.d.ts +4 -0
- package/Slider/index.d.ts +14 -0
- package/Slider/index.js +119 -0
- package/Slider/interface.d.ts +102 -0
- package/Split/index.d.ts +7 -0
- package/Split/index.js +123 -0
- package/Status/index.d.ts +21 -0
- package/Status/index.js +37 -0
- package/Stepper/icons.d.ts +5 -0
- package/Stepper/index.d.ts +59 -0
- package/Stepper/index.js +97 -0
- package/Switch/index.d.ts +78 -0
- package/Switch/index.js +71 -0
- package/Table/index.d.ts +10 -0
- package/Table/index.js +3001 -0
- package/Table/interface.d.ts +346 -0
- package/Table/lang/en_US.d.ts +8 -0
- package/Table/lang/index.d.ts +17 -0
- package/Table/lang/zh_CN.d.ts +8 -0
- package/Table/tableBody.d.ts +9 -0
- package/Table/tableBodyElement/index.d.ts +15 -0
- package/Table/tableBodyInterface.d.ts +73 -0
- package/Table/tableContainer/index.d.ts +16 -0
- package/Table/tableElement/index.d.ts +17 -0
- package/Table/tableHead.d.ts +9 -0
- package/Table/tableHeadElement/index.d.ts +15 -0
- package/Table/tableHeadInterface.d.ts +37 -0
- package/Table/tablePagination.d.ts +9 -0
- package/Table/tablePaginationInterface.d.ts +27 -0
- package/Table/tdElement/index.d.ts +15 -0
- package/Table/thElement/index.d.ts +28 -0
- package/Table/trElement/index.d.ts +15 -0
- package/Table/util.d.ts +34 -0
- package/Tabs/index.d.ts +69 -0
- package/Tabs/index.js +205 -0
- package/Tabs/lang/en_US.d.ts +4 -0
- package/Tabs/lang/index.d.ts +9 -0
- package/Tabs/lang/zh_CN.d.ts +4 -0
- package/Tag/TagGroup.d.ts +66 -0
- package/Tag/index.d.ts +34 -0
- package/Tag/index.js +259 -0
- package/TextEditor/common.d.ts +11 -0
- package/TextEditor/index.d.ts +127 -0
- package/TextEditor/index.js +286 -0
- package/TextField/index.d.ts +90 -0
- package/TextField/index.js +611 -0
- package/TimePicker/index.d.ts +22 -0
- package/TimePicker/index.js +80 -0
- package/TimePicker/locale/en_US.d.ts +3 -0
- package/TimePicker/locale/zh_CN.d.ts +3 -0
- package/TimePicker/style/index.d.ts +1 -0
- package/Timeline/TimelineItem.d.ts +30 -0
- package/Timeline/index.d.ts +32 -0
- package/Timeline/index.js +148 -0
- package/Title/index.d.ts +30 -0
- package/Title/index.js +50 -0
- package/ToggleButton/ToggleButtonGroup.d.ts +49 -0
- package/ToggleButton/index.d.ts +49 -0
- package/ToggleButton/index.js +193 -0
- package/Tooltip/index.d.ts +11 -0
- package/Tooltip/index.js +368 -0
- package/Tooltip/interface.d.ts +35 -0
- package/Tooltip/utils.d.ts +18 -0
- package/Transfer/box.d.ts +38 -0
- package/Transfer/index.d.ts +32 -0
- package/Transfer/index.js +611 -0
- package/Transfer/lang/en_US.d.ts +10 -0
- package/Transfer/lang/index.d.ts +21 -0
- package/Transfer/lang/zh_CN.d.ts +10 -0
- package/Transfer/useClick.d.ts +3 -0
- package/Tree/OperateBar/index.d.ts +13 -0
- package/Tree/Tree.d.ts +4 -0
- package/Tree/index.d.ts +5 -0
- package/Tree/index.js +38 -0
- package/Tree/interface.d.ts +210 -0
- package/Tree/lang/en_US.d.ts +8 -0
- package/Tree/lang/index.d.ts +17 -0
- package/Tree/lang/zh_CN.d.ts +8 -0
- package/Tree/utils/closestPolyfill.d.ts +0 -0
- package/Tree/utils/tools.d.ts +25 -0
- package/Tree/utils/treeUtil.d.ts +15 -0
- package/Upload/Dragger/index.d.ts +10 -0
- package/Upload/ErroTip/index.d.ts +13 -0
- package/Upload/ImageUpload/index.d.ts +16 -0
- package/Upload/ImgCrop/EasyCrop.d.ts +17 -0
- package/Upload/ImgCrop/constants.d.ts +7 -0
- package/Upload/ImgCrop/index.d.ts +6 -0
- package/Upload/ImgCrop/interface.d.ts +48 -0
- package/Upload/UploadList/index.d.ts +5 -0
- package/Upload/index.d.ts +15 -0
- package/Upload/index.js +1446 -0
- package/Upload/interface.d.ts +136 -0
- package/Upload/lang/en_US.d.ts +12 -0
- package/Upload/lang/index.d.ts +25 -0
- package/Upload/lang/zh_CN.d.ts +12 -0
- package/_verture/constant-66aa48a1.js +10 -0
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/index-74f820ba.js +1355 -0
- package/_verture/index-77f9e0fb.js +236 -0
- package/_verture/index-a369ca3f.js +4 -0
- package/_verture/index-beef914f.js +340 -0
- package/_verture/index-d03136d4.js +711 -0
- package/_verture/index-e2881a53.js +16 -0
- package/_verture/intl-5cbb940c.js +57 -0
- package/_verture/modalContext-92bb0e16.js +201 -0
- package/_verture/slicedToArray-76060636.js +43 -0
- package/_verture/sortable.esm-49896035.js +3791 -0
- package/_verture/style-inject.es-300983ab.js +28 -0
- package/_verture/toConsumableArray-81040c9e.js +19 -0
- package/_verture/tslib.es6-55ed4bd2.js +38 -0
- package/_verture/typeof-498dd2b1.js +11 -0
- package/_verture/unsupportedIterableToArray-cb478f24.js +16 -0
- package/_verture/useFormatMessage-703f8b20.js +20 -0
- package/_verture/useGlobalProps-1b846a65.js +11 -0
- package/_verture/usePopupContainer-87febeb9.js +68 -0
- package/_verture/util-7e1fb1e2.js +18 -0
- package/index.d.ts +144 -0
- package/index.js +180 -0
- package/package.json +1 -1
- package/umd/AutoBox.js +43 -0
- package/umd/AutoTips.js +15 -0
- package/umd/Breadcrumbs.js +42 -0
- package/umd/Button.js +43 -0
- package/umd/ButtonGroup.js +43 -0
- package/umd/Carousel.js +6 -0
- package/umd/Cascader.js +43 -0
- package/umd/Checkbox.js +42 -0
- package/umd/CheckboxGroup.js +42 -0
- package/umd/Collapse.js +43 -0
- package/umd/CollapseBox.js +1 -0
- package/umd/CollapseLayout.js +29 -0
- package/umd/ColorPicker.js +1 -0
- package/umd/ComboSelect.js +42 -0
- package/umd/Container.js +1 -0
- package/umd/DatePicker.js +42 -0
- package/umd/Desktop.js +42 -0
- package/umd/DragVerify.js +28 -0
- package/umd/Drawer.js +43 -0
- package/umd/Dropdown.js +15 -0
- package/umd/DynamicMultiBox.js +54 -0
- package/umd/Empty.js +15 -0
- package/umd/Form.js +42 -0
- package/umd/FormItem.js +42 -0
- package/umd/FunctionModal.js +42 -0
- package/umd/GlobalContext.js +1 -0
- package/umd/Help.js +42 -0
- package/umd/HelperText.js +1 -0
- package/umd/InputLang.js +42 -0
- package/umd/InputNumber.js +42 -0
- package/umd/Label.js +42 -0
- package/umd/Loading.js +29 -0
- package/umd/Menu.js +29 -0
- package/umd/Message.js +30 -0
- package/umd/Modal.js +42 -0
- package/umd/MultiBox.js +42 -0
- package/umd/Notification.js +43 -0
- package/umd/OperateBtn.js +42 -0
- package/umd/PageHeader.js +42 -0
- package/umd/Pagination.js +42 -0
- package/umd/ParauiProvider.js +15 -0
- package/umd/PasswordRules.js +29 -0
- package/umd/PopConfirm.js +42 -0
- package/umd/Popover.js +15 -0
- package/umd/Progress.js +35 -0
- package/umd/Querying.js +15 -0
- package/umd/Radio.js +42 -0
- package/umd/RadioGroup.js +42 -0
- package/umd/Search.js +42 -0
- package/umd/Select.js +42 -0
- package/umd/SelectInput.js +42 -0
- package/umd/Selector.js +42 -0
- package/umd/SelectorPicker.js +42 -0
- package/umd/SingleBox.js +42 -0
- package/umd/Slider.js +15 -0
- package/umd/Split.js +1 -0
- package/umd/Status.js +1 -0
- package/umd/Stepper.js +42 -0
- package/umd/Switch.js +42 -0
- package/umd/Table.js +42 -0
- package/umd/Tabs.js +42 -0
- package/umd/Tag.js +43 -0
- package/umd/TextEditor.js +205 -0
- package/umd/TextField.js +42 -0
- package/umd/TimePicker.js +42 -0
- package/umd/Timeline.js +1 -0
- package/umd/Title.js +1 -0
- package/umd/ToggleButton.js +43 -0
- package/umd/Tooltip.js +15 -0
- package/umd/Transfer.js +49 -0
- package/umd/Tree.js +42 -0
- package/umd/Upload.js +56 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="sortablejs" />
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { ItemDataProps } from './box';
|
|
4
|
+
import './style/index.scss';
|
|
5
|
+
/**
|
|
6
|
+
* @description: 穿梭框
|
|
7
|
+
* @param className{string} 类名
|
|
8
|
+
* @param style{string} 样式
|
|
9
|
+
* @param data{Array} 数据源
|
|
10
|
+
* @param value{Array} 当前选中的值
|
|
11
|
+
* @param onChange{Function} 值改变时的回调
|
|
12
|
+
* @param title{String} 标题
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
interface TransferProps {
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
data?: Array<ItemDataProps>;
|
|
19
|
+
value?: Array<string>;
|
|
20
|
+
onChange?: (data: Array<string>) => void;
|
|
21
|
+
onSort?: (data: Array<string>) => void;
|
|
22
|
+
titles?: Array<string>;
|
|
23
|
+
trim?: boolean;
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
rightIcon?: (item: ItemDataProps) => ReactNode;
|
|
26
|
+
render?: (data: ItemDataProps) => void;
|
|
27
|
+
customKey?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const Transfer: (props: TransferProps) => JSX.Element;
|
|
30
|
+
export default Transfer;
|
|
31
|
+
export type IItemDataProps = ItemDataProps;
|
|
32
|
+
export declare const SSortablejs: typeof import("sortablejs");
|
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-81040c9e.js';
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { Button } from '../Button/index.js';
|
|
7
|
+
import NavigateBefore from '@para-ui/icons/Left';
|
|
8
|
+
import Right from '@para-ui/icons/Right';
|
|
9
|
+
import ExpandLess from '@para-ui/icons/Up';
|
|
10
|
+
import Down from '@para-ui/icons/Down';
|
|
11
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
12
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
13
|
+
import { Search } from '../Search/index.js';
|
|
14
|
+
import SearchIcon from '@para-ui/icons/Search';
|
|
15
|
+
import AutoTips from '../AutoTips/index.js';
|
|
16
|
+
import Drag from '@para-ui/icons/Drag';
|
|
17
|
+
import { S as Sortable } from '../_verture/sortable.esm-49896035.js';
|
|
18
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
19
|
+
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
20
|
+
import '../_verture/typeof-498dd2b1.js';
|
|
21
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
22
|
+
import '@para-ui/icons/LoadingF';
|
|
23
|
+
import '@para-ui/icons/Forbid';
|
|
24
|
+
import '../Tooltip/index.js';
|
|
25
|
+
import 'rc-tooltip';
|
|
26
|
+
import 'rc-tooltip/lib/placements';
|
|
27
|
+
import '../_verture/index-77f9e0fb.js';
|
|
28
|
+
import 'rc-dropdown';
|
|
29
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
30
|
+
import 'dayjs';
|
|
31
|
+
import '@paraview/lib';
|
|
32
|
+
import '@para-ui/core/GlobalContext';
|
|
33
|
+
import '../TextField/index.js';
|
|
34
|
+
import '../Label/index.js';
|
|
35
|
+
import '../Help/index.js';
|
|
36
|
+
import '@para-ui/icons/Help';
|
|
37
|
+
import '@para-ui/icons/PreviewClose';
|
|
38
|
+
import '@para-ui/icons/PreviewOpen';
|
|
39
|
+
import '@para-ui/icons/CloseCircle';
|
|
40
|
+
import '../Loading/index.js';
|
|
41
|
+
import '../HelperText/index.js';
|
|
42
|
+
import '../_verture/useGlobalProps-1b846a65.js';
|
|
43
|
+
|
|
44
|
+
var en = {
|
|
45
|
+
left: 'Left',
|
|
46
|
+
right: 'Right',
|
|
47
|
+
allCheck: 'Select All',
|
|
48
|
+
inVertCheck: 'Invert selection',
|
|
49
|
+
searchPlaceholder: 'Please enter the search content',
|
|
50
|
+
leftBtnTips: 'Please check the content on the right first',
|
|
51
|
+
rightBtnTips: 'Please check the content on the left first'
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var zh = {
|
|
55
|
+
left: '左侧',
|
|
56
|
+
right: '右侧',
|
|
57
|
+
allCheck: '全选',
|
|
58
|
+
inVertCheck: '反选',
|
|
59
|
+
searchPlaceholder: '请输入搜索内容',
|
|
60
|
+
leftBtnTips: '请先勾选右侧内容',
|
|
61
|
+
rightBtnTips: '请先勾选左侧内容'
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var localeJson = {
|
|
65
|
+
zh: zh,
|
|
66
|
+
en: en
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var useClick = function useClick(callback, doubleCallback) {
|
|
70
|
+
var clickRef = useRef({
|
|
71
|
+
clickCount: 0,
|
|
72
|
+
time: 0,
|
|
73
|
+
timer: null
|
|
74
|
+
});
|
|
75
|
+
return function () {
|
|
76
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
77
|
+
args[_key] = arguments[_key];
|
|
78
|
+
}
|
|
79
|
+
clickRef.current.clickCount += 1;
|
|
80
|
+
clickRef.current.time = Date.now();
|
|
81
|
+
clickRef.current.timer = setTimeout(function () {
|
|
82
|
+
if (Date.now() - clickRef.current.time <= 200 && clickRef.current.clickCount === 2) {
|
|
83
|
+
doubleCallback && doubleCallback.apply(null, args);
|
|
84
|
+
}
|
|
85
|
+
if (clickRef.current.clickCount === 1) {
|
|
86
|
+
callback && callback.apply(null, args);
|
|
87
|
+
}
|
|
88
|
+
clearTimeout(clickRef.current.timer);
|
|
89
|
+
clickRef.current.clickCount = 0;
|
|
90
|
+
}, 200);
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var Box = function Box(props) {
|
|
95
|
+
var title = props.title,
|
|
96
|
+
data = props.data,
|
|
97
|
+
onSearch = props.onSearch,
|
|
98
|
+
onchange = props.onchange,
|
|
99
|
+
onMove = props.onMove,
|
|
100
|
+
queryAll = props.queryAll,
|
|
101
|
+
inverse = props.inverse,
|
|
102
|
+
direction = props.direction,
|
|
103
|
+
fluctuationPosition = props.fluctuationPosition,
|
|
104
|
+
fluctuationOrther = props.fluctuationOrther,
|
|
105
|
+
onEndSort = props.onEndSort,
|
|
106
|
+
multiple = props.multiple,
|
|
107
|
+
rightIcon = props.rightIcon,
|
|
108
|
+
style = props.style,
|
|
109
|
+
customKey = props.customKey;
|
|
110
|
+
var intl = useFormatMessage('Transfer', localeJson);
|
|
111
|
+
var _useState = useState([]),
|
|
112
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
113
|
+
checkCount = _useState2[0],
|
|
114
|
+
setCheckCount = _useState2[1];
|
|
115
|
+
var _useState3 = useState(0),
|
|
116
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
117
|
+
disabledCount = _useState4[0],
|
|
118
|
+
setDisabledCount = _useState4[1];
|
|
119
|
+
var ref = useRef();
|
|
120
|
+
useEffect(function () {
|
|
121
|
+
var arr = [];
|
|
122
|
+
var count = 0;
|
|
123
|
+
data.forEach(function (item, index) {
|
|
124
|
+
if (item.checked && !item.hide) {
|
|
125
|
+
arr.push(index);
|
|
126
|
+
}
|
|
127
|
+
if (item.disabled || item.hide) {
|
|
128
|
+
count++;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
setDisabledCount(count);
|
|
132
|
+
setCheckCount(arr);
|
|
133
|
+
}, [data]);
|
|
134
|
+
useEffect(function () {
|
|
135
|
+
if (direction == 'right') {
|
|
136
|
+
new Sortable(ref.current, {
|
|
137
|
+
animation: 180,
|
|
138
|
+
ghostClass: 'blue-background-class',
|
|
139
|
+
handle: '.handle',
|
|
140
|
+
onEnd: function onEnd(evt) {
|
|
141
|
+
onEndSort === null || onEndSort === void 0 ? void 0 : onEndSort(evt.oldIndex, evt.newIndex);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}, []);
|
|
146
|
+
var handler = useClick(function (e, index, item) {
|
|
147
|
+
if (item.disabled) return;
|
|
148
|
+
onchange(e, !item.checked, index, direction, multiple);
|
|
149
|
+
}, function (e, index, item) {
|
|
150
|
+
if (item === null || item === void 0 ? void 0 : item.disabled) return;
|
|
151
|
+
onchange(e, true, index, direction, false);
|
|
152
|
+
onMove(direction === "right" ? 'left' : 'right');
|
|
153
|
+
});
|
|
154
|
+
return jsxs("div", Object.assign({
|
|
155
|
+
className: "box",
|
|
156
|
+
style: style
|
|
157
|
+
}, {
|
|
158
|
+
children: [jsx("div", Object.assign({
|
|
159
|
+
className: "box-header"
|
|
160
|
+
}, {
|
|
161
|
+
children: title
|
|
162
|
+
})), jsx(Search, {
|
|
163
|
+
btnType: "inside",
|
|
164
|
+
placeholder: intl({
|
|
165
|
+
id: 'searchPlaceholder'
|
|
166
|
+
}),
|
|
167
|
+
showBtn: false,
|
|
168
|
+
rightIcon: jsx(SearchIcon, {}),
|
|
169
|
+
rightIconExist: true,
|
|
170
|
+
onChange: function onChange(val) {
|
|
171
|
+
onSearch(val, direction);
|
|
172
|
+
},
|
|
173
|
+
onClickRightIcon: function onClickRightIcon(val) {
|
|
174
|
+
onSearch(val, direction);
|
|
175
|
+
},
|
|
176
|
+
onEnter: function onEnter(event) {
|
|
177
|
+
var _a;
|
|
178
|
+
var val = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
179
|
+
onSearch(val, direction);
|
|
180
|
+
},
|
|
181
|
+
allowClear: false
|
|
182
|
+
}), jsx("div", Object.assign({
|
|
183
|
+
className: "context",
|
|
184
|
+
ref: ref
|
|
185
|
+
}, {
|
|
186
|
+
children: data.map(function (item, index) {
|
|
187
|
+
if (item === null || item === void 0 ? void 0 : item.hide) return null;
|
|
188
|
+
return jsxs("div", Object.assign({
|
|
189
|
+
className: clsx('item', (item === null || item === void 0 ? void 0 : item.disabled) && 'item-disabled', (item === null || item === void 0 ? void 0 : item.checked) && 'item-checked', fluctuationPosition === index && 'item-fluctuation', fluctuationOrther === index && 'item-fluctuationOrther'),
|
|
190
|
+
style: (item === null || item === void 0 ? void 0 : item.tagColor) ? {
|
|
191
|
+
borderLeft: "4px solid ".concat(item.tagColor)
|
|
192
|
+
} : undefined,
|
|
193
|
+
onClick: function onClick(e) {
|
|
194
|
+
handler(e, index, item);
|
|
195
|
+
}
|
|
196
|
+
}, {
|
|
197
|
+
children: [jsx("div", Object.assign({
|
|
198
|
+
className: 'item-label'
|
|
199
|
+
}, {
|
|
200
|
+
children: jsx(AutoTips, {
|
|
201
|
+
children: (item === null || item === void 0 ? void 0 : item.name) || item[item[customKey]]
|
|
202
|
+
})
|
|
203
|
+
})), rightIcon ? jsx("div", Object.assign({
|
|
204
|
+
className: 'right-icon'
|
|
205
|
+
}, {
|
|
206
|
+
children: rightIcon(item)
|
|
207
|
+
})) : null, direction === 'right' ? jsx("div", Object.assign({
|
|
208
|
+
className: 'handle'
|
|
209
|
+
}, {
|
|
210
|
+
children: jsx(Drag, {})
|
|
211
|
+
})) : null]
|
|
212
|
+
}), item[item[customKey]] || item.name);
|
|
213
|
+
})
|
|
214
|
+
})), jsxs("div", Object.assign({
|
|
215
|
+
className: 'footer'
|
|
216
|
+
}, {
|
|
217
|
+
children: [jsx(Button, Object.assign({
|
|
218
|
+
variant: "text",
|
|
219
|
+
className: "".concat(checkCount.length === data.length - disabledCount && data.length > 0 ? 'btn-on' : ''),
|
|
220
|
+
onClick: function onClick() {
|
|
221
|
+
queryAll(checkCount.length !== data.length - disabledCount, direction);
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
children: intl({
|
|
225
|
+
id: 'allCheck'
|
|
226
|
+
})
|
|
227
|
+
})), jsx(Button, Object.assign({
|
|
228
|
+
variant: "text",
|
|
229
|
+
className: "".concat(checkCount.length === 0 || checkCount.length === data.length - disabledCount ? 'btn-off' : ''),
|
|
230
|
+
disabled: checkCount.length === 0 || checkCount.length === data.length - disabledCount,
|
|
231
|
+
onClick: function onClick() {
|
|
232
|
+
inverse(direction);
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
children: intl({
|
|
236
|
+
id: 'inVertCheck'
|
|
237
|
+
})
|
|
238
|
+
})), jsxs("div", Object.assign({
|
|
239
|
+
className: "count"
|
|
240
|
+
}, {
|
|
241
|
+
children: [checkCount.length, "/", data.length]
|
|
242
|
+
}))]
|
|
243
|
+
}))]
|
|
244
|
+
}));
|
|
245
|
+
};
|
|
246
|
+
var Sortablejs = Sortable;
|
|
247
|
+
|
|
248
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-transfer {\n display: flex;\n font-size: 14px;\n user-select: none;\n}\n.paraui-v3-transfer .blue-background-class {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-transfer .box {\n border-radius: 4px;\n border: 1px solid rgba(171, 176, 185, 0.4);\n overflow: hidden;\n}\n.paraui-v3-transfer .box .box-header {\n background: rgba(171, 176, 185, 0.12);\n color: rgb(46, 55, 67);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-left: 10px;\n height: 36px;\n border-bottom: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-transfer .box .count {\n margin: 0 10px 0 0;\n color: rgb(46, 55, 67);\n letter-spacing: 1px;\n margin: 0 16px 0 auto;\n}\n.paraui-v3-transfer .box .context {\n height: 400px;\n overflow: auto;\n scrollbar-base-color: red;\n}\n.paraui-v3-transfer .box .context .item-fluctuation {\n animation: flucturation 0.4s forwards;\n}\n.paraui-v3-transfer .box .context .item-fluctuationOrther {\n animation: flucturationOrther 0.5s forwards;\n}\n.paraui-v3-transfer .box .context .item {\n padding: 0px 8px;\n height: 36px;\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v3-transfer .box .context .item.item-checked {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-transfer .box .context .item.item-checked:hover {\n background-color: rgba(54, 102, 214, 0.05) !important;\n}\n.paraui-v3-transfer .box .context .item.item-checked > .item-label {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-transfer .box .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 .box .context .item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-transfer .box .context .item.item-disabled:hover {\n background: inherit;\n cursor: no-drop;\n}\n.paraui-v3-transfer .box .context .item.item-disabled > .item-label {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-transfer .box .context .item .handle {\n margin-left: 14px;\n display: flex;\n align-content: center;\n}\n.paraui-v3-transfer .box .context .item .handle svg {\n color: rgb(28, 41, 60);\n}\n.paraui-v3-transfer .box .context .item .handle:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-transfer .box .context .item .handle:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-transfer .box .text-field-content {\n border: none;\n border-radius: 0;\n border-bottom: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-transfer .box .footer {\n display: flex;\n align-items: center;\n border-top: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-transfer .box .footer .btn-on {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-transfer .box .footer .btn-off {\n color: rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-transfer .box .footer button {\n color: rgb(46, 55, 67);\n padding: 0 0 0 16px;\n}\n.paraui-v3-transfer .box .footer button:hover {\n color: #3666D6;\n}\n.paraui-v3-transfer ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: rgb(54, 102, 214);\n}\n.paraui-v3-transfer .moveBtn {\n display: flex;\n height: 500px;\n flex-direction: column;\n justify-content: center;\n margin: 0 24px;\n}\n.paraui-v3-transfer .moveBtn > button:hover {\n color: white;\n background: rgb(54, 102, 214);\n}\n.paraui-v3-transfer .moveBtn .btn-left {\n margin-top: 20px;\n}\n\n@keyframes flucturation {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(36px);\n }\n}\n@keyframes flucturationOrther {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(-36px);\n }\n}";
|
|
249
|
+
styleInject(css_248z);
|
|
250
|
+
|
|
251
|
+
var Transfer = function Transfer(props) {
|
|
252
|
+
var _a, _b, _c, _d;
|
|
253
|
+
var intl = useFormatMessage('Transfer', localeJson);
|
|
254
|
+
var _props$data = props.data,
|
|
255
|
+
data = _props$data === void 0 ? [] : _props$data,
|
|
256
|
+
value = props.value,
|
|
257
|
+
_props$customKey = props.customKey,
|
|
258
|
+
customKey = _props$customKey === void 0 ? 'key' : _props$customKey,
|
|
259
|
+
onChange = props.onChange,
|
|
260
|
+
_props$titles = props.titles,
|
|
261
|
+
titles = _props$titles === void 0 ? [intl({
|
|
262
|
+
id: 'left'
|
|
263
|
+
}), intl({
|
|
264
|
+
id: 'right'
|
|
265
|
+
})] : _props$titles,
|
|
266
|
+
className = props.className,
|
|
267
|
+
_props$style = props.style,
|
|
268
|
+
style = _props$style === void 0 ? {
|
|
269
|
+
width: '298px'
|
|
270
|
+
} : _props$style,
|
|
271
|
+
onSort = props.onSort,
|
|
272
|
+
_props$trim = props.trim,
|
|
273
|
+
trim = _props$trim === void 0 ? false : _props$trim,
|
|
274
|
+
_props$multiple = props.multiple,
|
|
275
|
+
multiple = _props$multiple === void 0 ? true : _props$multiple,
|
|
276
|
+
rightIcon = props.rightIcon,
|
|
277
|
+
_props$render = props.render,
|
|
278
|
+
render = _props$render === void 0 ? function (item) {} : _props$render;
|
|
279
|
+
var _useState = useState({}),
|
|
280
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
281
|
+
transData = _useState2[0],
|
|
282
|
+
setTransData = _useState2[1];
|
|
283
|
+
var _useState3 = useState([]),
|
|
284
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
285
|
+
leftData = _useState4[0],
|
|
286
|
+
setLeftData = _useState4[1];
|
|
287
|
+
var _useState5 = useState([]),
|
|
288
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
289
|
+
rightData = _useState6[0],
|
|
290
|
+
setRightData = _useState6[1];
|
|
291
|
+
var _useState7 = useState([]),
|
|
292
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
293
|
+
leftCount = _useState8[0],
|
|
294
|
+
setLeftCount = _useState8[1];
|
|
295
|
+
var _useState9 = useState([]),
|
|
296
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
297
|
+
rightCount = _useState10[0],
|
|
298
|
+
setRightCount = _useState10[1];
|
|
299
|
+
var _useState11 = useState(),
|
|
300
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
301
|
+
fluctuationPosition = _useState12[0];
|
|
302
|
+
_useState12[1];
|
|
303
|
+
var _useState13 = useState(),
|
|
304
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
305
|
+
fluctuationOrther = _useState14[0];
|
|
306
|
+
_useState14[1];
|
|
307
|
+
var _useState15 = useState(false),
|
|
308
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
309
|
+
animationsLock = _useState16[0],
|
|
310
|
+
setAnimationLock = _useState16[1];
|
|
311
|
+
var onchange = useCallback(function (e, bol, index, direction, multiple) {
|
|
312
|
+
if (direction === 'left') {
|
|
313
|
+
!multiple && leftData.forEach(function (item) {
|
|
314
|
+
return item.checked = false;
|
|
315
|
+
});
|
|
316
|
+
leftData[index].checked = bol;
|
|
317
|
+
setLeftData(_toConsumableArray(leftData));
|
|
318
|
+
} else {
|
|
319
|
+
!multiple && rightData.forEach(function (item) {
|
|
320
|
+
return item.checked = false;
|
|
321
|
+
});
|
|
322
|
+
rightData[index].checked = bol;
|
|
323
|
+
setRightData(_toConsumableArray(rightData));
|
|
324
|
+
}
|
|
325
|
+
}, [leftData, rightData]);
|
|
326
|
+
var queryAll = useCallback(function (checked, direction) {
|
|
327
|
+
if (direction === 'left') {
|
|
328
|
+
leftData.forEach(function (item) {
|
|
329
|
+
if (!item.disabled && !item.hide) item.checked = checked;
|
|
330
|
+
});
|
|
331
|
+
setLeftData(_toConsumableArray(leftData));
|
|
332
|
+
} else {
|
|
333
|
+
rightData.forEach(function (item) {
|
|
334
|
+
if (!item.disabled && !item.hide) item.checked = checked;
|
|
335
|
+
});
|
|
336
|
+
setRightData(_toConsumableArray(rightData));
|
|
337
|
+
}
|
|
338
|
+
}, [leftData, rightData]);
|
|
339
|
+
var inverse = useCallback(function (direction) {
|
|
340
|
+
if (direction === 'left') {
|
|
341
|
+
leftData.forEach(function (item) {
|
|
342
|
+
if (!item.disabled && !item.hide) item.checked = !item.checked;
|
|
343
|
+
});
|
|
344
|
+
setLeftData(_toConsumableArray(leftData));
|
|
345
|
+
} else {
|
|
346
|
+
rightData.forEach(function (item) {
|
|
347
|
+
if (!item.disabled && !item.hide) item.checked = !item.checked;
|
|
348
|
+
});
|
|
349
|
+
setRightData(_toConsumableArray(rightData));
|
|
350
|
+
}
|
|
351
|
+
}, [leftData, rightData]);
|
|
352
|
+
var onMove = function onMove(direction) {
|
|
353
|
+
var newData = [];
|
|
354
|
+
if (direction === 'left') {
|
|
355
|
+
newData = _toConsumableArray(rightData);
|
|
356
|
+
newData.forEach(function (item) {
|
|
357
|
+
if ((item === null || item === void 0 ? void 0 : item.checked) && !(item === null || item === void 0 ? void 0 : item.hide)) {
|
|
358
|
+
item.checked = false;
|
|
359
|
+
leftData.push(item);
|
|
360
|
+
rightData.splice(rightData.indexOf(item), 1);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
} else {
|
|
364
|
+
newData = _toConsumableArray(leftData);
|
|
365
|
+
newData.forEach(function (item) {
|
|
366
|
+
if ((item === null || item === void 0 ? void 0 : item.checked) && !(item === null || item === void 0 ? void 0 : item.hide)) {
|
|
367
|
+
item.checked = false;
|
|
368
|
+
rightData.push(item);
|
|
369
|
+
leftData.splice(leftData.indexOf(item), 1);
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
setLeftData(_toConsumableArray(leftData));
|
|
374
|
+
setRightData(_toConsumableArray(rightData));
|
|
375
|
+
var rArr = [];
|
|
376
|
+
rightData.forEach(function (item) {
|
|
377
|
+
rArr.push(item[customKey]);
|
|
378
|
+
});
|
|
379
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(rArr);
|
|
380
|
+
};
|
|
381
|
+
// 上下移动
|
|
382
|
+
var fluctuation = function fluctuation(direction) {
|
|
383
|
+
setAnimationLock(true);
|
|
384
|
+
console.log(rightCount);
|
|
385
|
+
if (direction == 'up') {
|
|
386
|
+
// setFluctuationPosition(rightCount[0] - 1)
|
|
387
|
+
// setFluctuationOrther(rightCount[0])
|
|
388
|
+
// setTimeout(() => {
|
|
389
|
+
setRightData(function (pre) {
|
|
390
|
+
// setFluctuationPosition(undefined)
|
|
391
|
+
// setFluctuationOrther(undefined)
|
|
392
|
+
rightCount.forEach(function (item) {
|
|
393
|
+
pre.splice.apply(pre, [item - 1, 0].concat(_toConsumableArray(pre.splice(item, 1))));
|
|
394
|
+
});
|
|
395
|
+
setAnimationLock(false);
|
|
396
|
+
var rArr = [];
|
|
397
|
+
pre.forEach(function (item) {
|
|
398
|
+
rArr.push(item[customKey]);
|
|
399
|
+
});
|
|
400
|
+
onSort === null || onSort === void 0 ? void 0 : onSort([].concat(rArr));
|
|
401
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([].concat(rArr));
|
|
402
|
+
return _toConsumableArray(pre);
|
|
403
|
+
});
|
|
404
|
+
// }, 400)
|
|
405
|
+
} else {
|
|
406
|
+
// setFluctuationPosition(rightCount[0])
|
|
407
|
+
// setFluctuationOrther(rightCount[0] + 1)
|
|
408
|
+
// setTimeout(() => {
|
|
409
|
+
setRightData(function (pre) {
|
|
410
|
+
// setFluctuationPosition(undefined)
|
|
411
|
+
// setFluctuationOrther(undefined)
|
|
412
|
+
rightCount.reverse().forEach(function (item) {
|
|
413
|
+
pre.splice.apply(pre, [item + 1, 0].concat(_toConsumableArray(pre.splice(item, 1))));
|
|
414
|
+
});
|
|
415
|
+
setAnimationLock(false);
|
|
416
|
+
var rArr = [];
|
|
417
|
+
pre.forEach(function (item) {
|
|
418
|
+
rArr.push(item[customKey]);
|
|
419
|
+
});
|
|
420
|
+
onSort === null || onSort === void 0 ? void 0 : onSort([].concat(rArr));
|
|
421
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([].concat(rArr));
|
|
422
|
+
return _toConsumableArray(pre);
|
|
423
|
+
});
|
|
424
|
+
// }, 400)
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
var onSearch = function onSearch(e, direction) {
|
|
429
|
+
var str = trim ? e.toUpperCase().trim() : e.toUpperCase();
|
|
430
|
+
if (direction === 'left') {
|
|
431
|
+
leftData.forEach(function (item) {
|
|
432
|
+
item.hide = false;
|
|
433
|
+
var name = (item.name || '').toUpperCase();
|
|
434
|
+
var description = (item.description || '').toUpperCase();
|
|
435
|
+
if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
|
|
436
|
+
item.hide = true;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
setLeftData(_toConsumableArray(leftData));
|
|
440
|
+
} else {
|
|
441
|
+
rightData.filter(function (item) {
|
|
442
|
+
item.hide = false;
|
|
443
|
+
var name = (item.name || '').toUpperCase();
|
|
444
|
+
var description = (item.description || '').toUpperCase();
|
|
445
|
+
if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
|
|
446
|
+
item.hide = true;
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
setRightData(_toConsumableArray(rightData));
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
var onEndSort = useCallback(function (oldIndex, newIndex) {
|
|
453
|
+
setRightData(function (pre) {
|
|
454
|
+
pre.splice.apply(pre, [newIndex, 0].concat(_toConsumableArray(pre.splice(oldIndex, 1))));
|
|
455
|
+
var rArr = [];
|
|
456
|
+
pre.forEach(function (item) {
|
|
457
|
+
rArr.push(item[customKey]);
|
|
458
|
+
});
|
|
459
|
+
onSort === null || onSort === void 0 ? void 0 : onSort([].concat(rArr));
|
|
460
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([].concat(rArr));
|
|
461
|
+
return _toConsumableArray(pre);
|
|
462
|
+
});
|
|
463
|
+
}, []);
|
|
464
|
+
useEffect(function () {
|
|
465
|
+
if (data.length) {
|
|
466
|
+
var _leftData = {};
|
|
467
|
+
data.forEach(function (item) {
|
|
468
|
+
var key = item[customKey];
|
|
469
|
+
render(item);
|
|
470
|
+
_leftData[key] = item;
|
|
471
|
+
});
|
|
472
|
+
setTransData(Object.assign({}, _leftData));
|
|
473
|
+
}
|
|
474
|
+
}, [data]);
|
|
475
|
+
useEffect(function () {
|
|
476
|
+
var rData = [];
|
|
477
|
+
var lData = [];
|
|
478
|
+
value === null || value === void 0 ? void 0 : value.forEach(function (item) {
|
|
479
|
+
if (transData[item]) {
|
|
480
|
+
rData.push(transData[item]);
|
|
481
|
+
delete transData[item];
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
for (var key in transData) {
|
|
485
|
+
lData.push(transData[key]);
|
|
486
|
+
}
|
|
487
|
+
setRightData([].concat(rData));
|
|
488
|
+
setLeftData([].concat(lData));
|
|
489
|
+
}, [value, transData]);
|
|
490
|
+
useEffect(function () {
|
|
491
|
+
var arr = [];
|
|
492
|
+
leftData.forEach(function (item, index) {
|
|
493
|
+
if (item.checked && !item.hide) {
|
|
494
|
+
arr.push(index);
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
setLeftCount(arr);
|
|
498
|
+
var rArr = [];
|
|
499
|
+
rightData.forEach(function (item, index) {
|
|
500
|
+
if (item.checked && !item.hide) {
|
|
501
|
+
rArr.push(index);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
setRightCount(rArr);
|
|
505
|
+
}, [leftData, rightData]);
|
|
506
|
+
return jsxs("div", Object.assign({
|
|
507
|
+
className: clsx("".concat($prefixCls, "-transfer"), className)
|
|
508
|
+
}, {
|
|
509
|
+
children: [jsx(Box, {
|
|
510
|
+
title: titles[0],
|
|
511
|
+
queryAll: queryAll,
|
|
512
|
+
data: leftData,
|
|
513
|
+
style: style,
|
|
514
|
+
direction: "left",
|
|
515
|
+
customKey: customKey,
|
|
516
|
+
rightIcon: rightIcon,
|
|
517
|
+
onchange: onchange,
|
|
518
|
+
multiple: multiple,
|
|
519
|
+
onMove: onMove,
|
|
520
|
+
inverse: inverse,
|
|
521
|
+
onSearch: onSearch
|
|
522
|
+
}), jsxs("div", Object.assign({
|
|
523
|
+
className: "moveBtn"
|
|
524
|
+
}, {
|
|
525
|
+
children: [jsx(Button.IconButton, Object.assign({
|
|
526
|
+
className: 'btn btn-right',
|
|
527
|
+
variant: 'outlined',
|
|
528
|
+
disabled: leftCount.length <= 0,
|
|
529
|
+
toolTipTitle: leftCount.length <= 0 ? intl({
|
|
530
|
+
id: 'rightBtnTips'
|
|
531
|
+
}) : '',
|
|
532
|
+
TooltipProps: {
|
|
533
|
+
arrow: false,
|
|
534
|
+
placement: 'bottomRight'
|
|
535
|
+
},
|
|
536
|
+
onClick: function onClick() {
|
|
537
|
+
onMove("right");
|
|
538
|
+
}
|
|
539
|
+
}, {
|
|
540
|
+
children: jsx(Right, {})
|
|
541
|
+
})), jsx(Button.IconButton, Object.assign({
|
|
542
|
+
className: 'btn btn-left',
|
|
543
|
+
variant: 'outlined',
|
|
544
|
+
disabled: rightCount.length <= 0 || ((_a = rightData[0]) === null || _a === void 0 ? void 0 : _a.checked) || animationsLock,
|
|
545
|
+
toolTipTitle: rightCount.length <= 0 || ((_b = rightData[0]) === null || _b === void 0 ? void 0 : _b.checked) ? intl({
|
|
546
|
+
id: 'leftBtnTips'
|
|
547
|
+
}) : '',
|
|
548
|
+
TooltipProps: {
|
|
549
|
+
arrow: false,
|
|
550
|
+
placement: 'bottomRight'
|
|
551
|
+
},
|
|
552
|
+
onClick: function onClick() {
|
|
553
|
+
fluctuation('up');
|
|
554
|
+
}
|
|
555
|
+
}, {
|
|
556
|
+
children: jsx(ExpandLess, {})
|
|
557
|
+
})), jsx(Button.IconButton, Object.assign({
|
|
558
|
+
className: 'btn btn-left',
|
|
559
|
+
variant: 'outlined',
|
|
560
|
+
disabled: rightCount.length <= 0 || ((_c = rightData[rightData.length - 1]) === null || _c === void 0 ? void 0 : _c.checked) || animationsLock,
|
|
561
|
+
toolTipTitle: rightCount.length <= 0 || ((_d = rightData[rightData.length - 1]) === null || _d === void 0 ? void 0 : _d.checked) ? intl({
|
|
562
|
+
id: 'leftBtnTips'
|
|
563
|
+
}) : '',
|
|
564
|
+
TooltipProps: {
|
|
565
|
+
arrow: false,
|
|
566
|
+
placement: 'bottomRight'
|
|
567
|
+
},
|
|
568
|
+
onClick: function onClick() {
|
|
569
|
+
fluctuation('down');
|
|
570
|
+
}
|
|
571
|
+
}, {
|
|
572
|
+
children: jsx(Down, {})
|
|
573
|
+
})), jsx(Button.IconButton, Object.assign({
|
|
574
|
+
className: 'btn btn-left',
|
|
575
|
+
variant: 'outlined',
|
|
576
|
+
disabled: rightCount.length <= 0,
|
|
577
|
+
toolTipTitle: rightCount.length <= 0 ? intl({
|
|
578
|
+
id: 'leftBtnTips'
|
|
579
|
+
}) : '',
|
|
580
|
+
TooltipProps: {
|
|
581
|
+
arrow: false,
|
|
582
|
+
placement: 'bottomRight'
|
|
583
|
+
},
|
|
584
|
+
onClick: function onClick() {
|
|
585
|
+
onMove('left');
|
|
586
|
+
}
|
|
587
|
+
}, {
|
|
588
|
+
children: jsx(NavigateBefore, {})
|
|
589
|
+
}))]
|
|
590
|
+
})), jsx(Box, {
|
|
591
|
+
title: titles[1],
|
|
592
|
+
queryAll: queryAll,
|
|
593
|
+
data: rightData,
|
|
594
|
+
style: style,
|
|
595
|
+
direction: "right",
|
|
596
|
+
customKey: customKey,
|
|
597
|
+
rightIcon: rightIcon,
|
|
598
|
+
onchange: onchange,
|
|
599
|
+
multiple: multiple,
|
|
600
|
+
onMove: onMove,
|
|
601
|
+
inverse: inverse,
|
|
602
|
+
fluctuationPosition: fluctuationPosition,
|
|
603
|
+
fluctuationOrther: fluctuationOrther,
|
|
604
|
+
onEndSort: onEndSort,
|
|
605
|
+
onSearch: onSearch
|
|
606
|
+
})]
|
|
607
|
+
}));
|
|
608
|
+
};
|
|
609
|
+
var SSortablejs = Sortablejs;
|
|
610
|
+
|
|
611
|
+
export { SSortablejs, Transfer, Transfer as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
zh: {
|
|
3
|
+
left: string;
|
|
4
|
+
right: string;
|
|
5
|
+
allCheck: string;
|
|
6
|
+
inVertCheck: string;
|
|
7
|
+
searchPlaceholder: string;
|
|
8
|
+
leftBtnTips: string;
|
|
9
|
+
rightBtnTips: string;
|
|
10
|
+
};
|
|
11
|
+
en: {
|
|
12
|
+
left: string;
|
|
13
|
+
right: string;
|
|
14
|
+
allCheck: string;
|
|
15
|
+
inVertCheck: string;
|
|
16
|
+
searchPlaceholder: string;
|
|
17
|
+
leftBtnTips: string;
|
|
18
|
+
rightBtnTips: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|