@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
package/Modal/index.js
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
|
|
2
|
+
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import Dialog from 'rc-dialog';
|
|
6
|
+
import { Button } from '../Button/index.js';
|
|
7
|
+
import CloseIcon from '@para-ui/icons/Close';
|
|
8
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
9
|
+
import { d as defaultModalLocale } from '../_verture/index-e2881a53.js';
|
|
10
|
+
import ReactDOM from 'react-dom';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
13
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
14
|
+
import CompleteIcon from '@para-ui/icons/CheckCircleF';
|
|
15
|
+
import CloseCircleFilled from '@para-ui/icons/CloseCircleF';
|
|
16
|
+
import InfoOutlined from '@para-ui/icons/WarningCircle';
|
|
17
|
+
import WarningCircleF from '@para-ui/icons/WarningCircleF';
|
|
18
|
+
import { UUID } from '@paraview/lib';
|
|
19
|
+
import { getConfirmLocale } from '@para-ui/core/GlobalContext';
|
|
20
|
+
import '../_verture/typeof-498dd2b1.js';
|
|
21
|
+
import '../_verture/slicedToArray-76060636.js';
|
|
22
|
+
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
23
|
+
import '@para-ui/icons/LoadingF';
|
|
24
|
+
import '@para-ui/icons/Forbid';
|
|
25
|
+
import '../Tooltip/index.js';
|
|
26
|
+
import 'rc-tooltip';
|
|
27
|
+
import 'rc-tooltip/lib/placements';
|
|
28
|
+
import '@para-ui/icons/Down';
|
|
29
|
+
import '../_verture/index-77f9e0fb.js';
|
|
30
|
+
import 'rc-dropdown';
|
|
31
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
32
|
+
import 'dayjs';
|
|
33
|
+
|
|
34
|
+
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/2 下午7:00\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-confirm.paraui-v3-modal .paraui-v3-modal-body {\n padding: 0;\n}\n.paraui-v3-confirm .confirm-wrapper {\n width: 416px;\n outline: none;\n}\n.paraui-v3-confirm .confirm-content {\n position: relative;\n padding: 32px 32px 24px;\n}\n.paraui-v3-confirm .confirm-content-close {\n position: absolute;\n right: 16px;\n top: 16px;\n border: none;\n}\n.paraui-v3-confirm .confirm-content-close svg {\n font-size: 18px;\n}\n.paraui-v3-confirm .confirm-content-icon {\n float: left;\n margin-top: 2px;\n color: rgb(255, 161, 80);\n}\n.paraui-v3-confirm .confirm-content-icon svg {\n color: inherit;\n font-size: 16px;\n}\n.paraui-v3-confirm .confirm-content-icon--warn, .paraui-v3-confirm .confirm-content-icon-warning {\n color: rgb(255, 161, 80);\n}\n.paraui-v3-confirm .confirm-content-icon--error {\n color: rgb(235, 96, 84);\n}\n.paraui-v3-confirm .confirm-content-icon--success {\n color: rgb(83, 195, 27);\n}\n.paraui-v3-confirm .confirm-content-icon--info {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-confirm .confirm-content-body {\n margin: 0 16px 0 30px;\n color: rgb(46, 55, 67);\n font-size: 14px;\n}\n.paraui-v3-confirm .confirm-content-body .confirm-body-title {\n display: block;\n margin-bottom: 8px;\n font-weight: 700;\n font-size: 16px;\n}\n.paraui-v3-confirm .confirm-content-actions {\n margin-top: 24px;\n text-align: right;\n}\n.paraui-v3-confirm .confirm-content-actions > button + button {\n margin-left: 16px;\n}";
|
|
35
|
+
styleInject(css_248z$1);
|
|
36
|
+
|
|
37
|
+
//图标
|
|
38
|
+
var iconMap = {
|
|
39
|
+
"success": jsx(CompleteIcon, {}),
|
|
40
|
+
"warn": jsx(WarningCircleF, {}),
|
|
41
|
+
"warning": jsx(WarningCircleF, {}),
|
|
42
|
+
"error": jsx(CloseCircleFilled, {}),
|
|
43
|
+
"info": jsx(InfoOutlined, {})
|
|
44
|
+
};
|
|
45
|
+
//confirm modal
|
|
46
|
+
var ConfirmDialog = function ConfirmDialog(props) {
|
|
47
|
+
var _props$type = props.type,
|
|
48
|
+
type = _props$type === void 0 ? 'warning' : _props$type,
|
|
49
|
+
title = props.title,
|
|
50
|
+
content = props.content,
|
|
51
|
+
icon = props.icon,
|
|
52
|
+
okText = props.okText,
|
|
53
|
+
cancelText = props.cancelText,
|
|
54
|
+
onOk = props.onOk,
|
|
55
|
+
onCancel = props.onCancel,
|
|
56
|
+
className = props.className,
|
|
57
|
+
_props$showCancel = props.showCancel,
|
|
58
|
+
showCancel = _props$showCancel === void 0 ? true : _props$showCancel,
|
|
59
|
+
_props$closable = props.closable,
|
|
60
|
+
closable = _props$closable === void 0 ? false : _props$closable,
|
|
61
|
+
okButtonProps = props.okButtonProps,
|
|
62
|
+
cancelButtonProps = props.cancelButtonProps,
|
|
63
|
+
resolveFn = props.resolveFn,
|
|
64
|
+
callback = props.callback,
|
|
65
|
+
destroy = props.destroy,
|
|
66
|
+
actions = props.actions,
|
|
67
|
+
_props$showActions = props.showActions,
|
|
68
|
+
showActions = _props$showActions === void 0 ? true : _props$showActions,
|
|
69
|
+
restProps = __rest(props, ["type", "title", "content", "icon", "okText", "cancelText", "onOk", "onCancel", "className", "showCancel", "closable", "okButtonProps", "cancelButtonProps", "resolveFn", "callback", "destroy", "actions", "showActions"]);
|
|
70
|
+
var prefixCls = "".concat($prefixCls, "-confirm");
|
|
71
|
+
//取消
|
|
72
|
+
var handleCancel = function handleCancel() {
|
|
73
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
74
|
+
resolveFn === null || resolveFn === void 0 ? void 0 : resolveFn(false);
|
|
75
|
+
destroy === null || destroy === void 0 ? void 0 : destroy();
|
|
76
|
+
};
|
|
77
|
+
//确认
|
|
78
|
+
var handleOk = function handleOk() {
|
|
79
|
+
onOk === null || onOk === void 0 ? void 0 : onOk();
|
|
80
|
+
resolveFn === null || resolveFn === void 0 ? void 0 : resolveFn(true);
|
|
81
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
82
|
+
destroy === null || destroy === void 0 ? void 0 : destroy();
|
|
83
|
+
};
|
|
84
|
+
//render actions
|
|
85
|
+
var renderActions = function renderActions() {
|
|
86
|
+
if (!showActions) return null;
|
|
87
|
+
if (actions) {
|
|
88
|
+
return jsx("div", Object.assign({
|
|
89
|
+
className: 'confirm-content-actions'
|
|
90
|
+
}, {
|
|
91
|
+
children: actions
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return jsxs("div", Object.assign({
|
|
95
|
+
className: 'confirm-content-actions'
|
|
96
|
+
}, {
|
|
97
|
+
children: [showCancel && jsx(Button, Object.assign({
|
|
98
|
+
variant: 'outlined',
|
|
99
|
+
size: 'small',
|
|
100
|
+
onClick: handleCancel
|
|
101
|
+
}, cancelButtonProps, {
|
|
102
|
+
children: cancelText
|
|
103
|
+
})), jsx(Button, Object.assign({
|
|
104
|
+
variant: 'contained',
|
|
105
|
+
size: 'small',
|
|
106
|
+
onClick: handleOk
|
|
107
|
+
}, okButtonProps, {
|
|
108
|
+
children: okText
|
|
109
|
+
}))]
|
|
110
|
+
}));
|
|
111
|
+
};
|
|
112
|
+
return jsx(Modal, Object.assign({}, restProps, {
|
|
113
|
+
onOk: handleOk,
|
|
114
|
+
onCancel: handleCancel,
|
|
115
|
+
title: "",
|
|
116
|
+
footer: "",
|
|
117
|
+
size: 'auto',
|
|
118
|
+
hideHeader: true,
|
|
119
|
+
showActions: false,
|
|
120
|
+
className: clsx(prefixCls, className)
|
|
121
|
+
}, {
|
|
122
|
+
children: jsx("div", Object.assign({
|
|
123
|
+
className: 'confirm-wrapper'
|
|
124
|
+
}, {
|
|
125
|
+
children: jsxs("div", Object.assign({
|
|
126
|
+
className: 'confirm-content'
|
|
127
|
+
}, {
|
|
128
|
+
children: [closable && jsx(Button.IconButton, Object.assign({
|
|
129
|
+
variant: 'outlined',
|
|
130
|
+
size: 'small',
|
|
131
|
+
className: 'confirm-content-close',
|
|
132
|
+
onClick: handleCancel
|
|
133
|
+
}, {
|
|
134
|
+
children: jsx(CloseIcon, {})
|
|
135
|
+
})), jsx("span", Object.assign({
|
|
136
|
+
className: clsx('confirm-content-icon', "confirm-content-icon--".concat(type))
|
|
137
|
+
}, {
|
|
138
|
+
children: icon || iconMap[type]
|
|
139
|
+
})), jsxs("div", Object.assign({
|
|
140
|
+
className: 'confirm-content-body'
|
|
141
|
+
}, {
|
|
142
|
+
children: [title && jsx("span", Object.assign({
|
|
143
|
+
className: 'confirm-body-title'
|
|
144
|
+
}, {
|
|
145
|
+
children: title
|
|
146
|
+
})), jsx("div", Object.assign({
|
|
147
|
+
className: 'confirm-body-desc'
|
|
148
|
+
}, {
|
|
149
|
+
children: content
|
|
150
|
+
}))]
|
|
151
|
+
})), renderActions()]
|
|
152
|
+
}))
|
|
153
|
+
}))
|
|
154
|
+
}));
|
|
155
|
+
};
|
|
156
|
+
//销毁方法map
|
|
157
|
+
var $destroyFnsMap = new Map();
|
|
158
|
+
//confirm
|
|
159
|
+
var confirm = function confirm(props, resolveFn, callback) {
|
|
160
|
+
var box = document.createElement('div');
|
|
161
|
+
var uuid = props.uuid || UUID();
|
|
162
|
+
if (props.uuid) box.setAttribute('data-confirm-cid', props.uuid);
|
|
163
|
+
document.body.appendChild(box);
|
|
164
|
+
//销毁组件
|
|
165
|
+
var destroy = function destroy() {
|
|
166
|
+
var unmountResult = ReactDOM.unmountComponentAtNode(box);
|
|
167
|
+
if (unmountResult && box.parentNode) {
|
|
168
|
+
box.parentNode.removeChild(box);
|
|
169
|
+
}
|
|
170
|
+
$destroyFnsMap.delete(uuid);
|
|
171
|
+
};
|
|
172
|
+
$destroyFnsMap.set(uuid, destroy);
|
|
173
|
+
//渲染组件
|
|
174
|
+
setTimeout(function () {
|
|
175
|
+
var _a, _b;
|
|
176
|
+
var runtimeLocale = getConfirmLocale();
|
|
177
|
+
ReactDOM.render(jsx(ConfirmDialog, Object.assign({}, props, {
|
|
178
|
+
okText: (_a = props.okText) !== null && _a !== void 0 ? _a : runtimeLocale.ok,
|
|
179
|
+
cancelText: (_b = props.cancelText) !== null && _b !== void 0 ? _b : runtimeLocale.cancel,
|
|
180
|
+
open: true,
|
|
181
|
+
resolveFn: resolveFn,
|
|
182
|
+
callback: callback,
|
|
183
|
+
destroy: destroy
|
|
184
|
+
})), box);
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
//promise factory
|
|
188
|
+
var promiseFactory = function promiseFactory(config, type, callback) {
|
|
189
|
+
var opts = {
|
|
190
|
+
type: type
|
|
191
|
+
};
|
|
192
|
+
if (typeof config === 'string') opts.content = config;else opts = Object.assign(Object.assign({}, config), {
|
|
193
|
+
type: type
|
|
194
|
+
});
|
|
195
|
+
return new Promise(function (resolve) {
|
|
196
|
+
confirm(opts, resolve, callback);
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
//销毁弹框
|
|
200
|
+
var destroyAllConfirm = function destroyAllConfirm(uuid) {
|
|
201
|
+
if (uuid) {
|
|
202
|
+
var close = $destroyFnsMap.get(uuid);
|
|
203
|
+
if (close) close();
|
|
204
|
+
$destroyFnsMap.delete(uuid);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
$destroyFnsMap.forEach(function (close) {
|
|
208
|
+
if (close) close();
|
|
209
|
+
});
|
|
210
|
+
$destroyFnsMap.clear();
|
|
211
|
+
};
|
|
212
|
+
//confirm 方法对象
|
|
213
|
+
var Confirm = {
|
|
214
|
+
info: function info(config, callback) {
|
|
215
|
+
return promiseFactory(config, 'info', callback);
|
|
216
|
+
},
|
|
217
|
+
warn: function warn(config, callback) {
|
|
218
|
+
return promiseFactory(config, 'warn', callback);
|
|
219
|
+
},
|
|
220
|
+
error: function error(config, callback) {
|
|
221
|
+
return promiseFactory(config, 'error', callback);
|
|
222
|
+
},
|
|
223
|
+
success: function success(config, callback) {
|
|
224
|
+
return promiseFactory(config, 'success', callback);
|
|
225
|
+
},
|
|
226
|
+
destroyAll: destroyAllConfirm
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/6/13 下午6:54\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-modal {\n color: rgb(46, 55, 67);\n font-size: 14px;\n line-height: 1.5715;\n pointer-events: none;\n position: relative;\n top: 100px;\n width: auto;\n max-width: calc(100vw - 32px);\n margin: 0 auto;\n padding-bottom: 24px;\n}\n.paraui-v3-modal.paraui-v3-modal-sm .paraui-v3-modal-content {\n width: 430px;\n max-height: 250px;\n}\n.paraui-v3-modal.paraui-v3-modal-md .paraui-v3-modal-content {\n width: 486px;\n max-height: 610px;\n}\n.paraui-v3-modal.paraui-v3-modal-lg .paraui-v3-modal-content {\n width: 948px;\n max-height: 610px;\n}\n.paraui-v3-modal.paraui-v3-modal-fullscreen {\n max-width: 100%;\n width: 100%;\n height: 100%;\n}\n.paraui-v3-modal.paraui-v3-modal-zoom-enter, .paraui-v3-modal.paraui-v3-modal-zoom-appear {\n transform: none;\n opacity: 0;\n animation-duration: 0.3s;\n user-select: none;\n}\n.paraui-v3-modal-mask {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1500;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.45);\n}\n.paraui-v3-modal-mask-hidden {\n display: none;\n}\n.paraui-v3-modal-wrap {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: auto;\n outline: 0;\n z-index: 1500;\n -webkit-overflow-scrolling: touch;\n}\n.paraui-v3-modal .paraui-v3-modal-content {\n display: flex;\n height: 100%;\n flex-direction: column;\n position: relative;\n border-radius: 4px;\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 2px 8px 0px rgba(171, 176, 185, 0.4);\n pointer-events: auto;\n overflow-y: auto;\n}\n.paraui-v3-modal .paraui-v3-modal-title {\n position: relative;\n height: 44px;\n padding: 12px 24px;\n font-size: 14px;\n color: rgb(46, 55, 67);\n font-weight: 700;\n line-height: 20px;\n border-bottom: 1px solid rgba(171, 176, 185, 0.2);\n overflow-wrap: break-word;\n}\n.paraui-v3-modal .paraui-v3-modal-title .paraui-v3-modal-close {\n position: absolute;\n top: 8px;\n right: 14px;\n z-index: 10;\n border: 0;\n}\n.paraui-v3-modal .paraui-v3-modal-title .paraui-v3-modal-close .paraui-v3-modal-close-icon {\n font-size: 20px;\n}\n.paraui-v3-modal .paraui-v3-modal-body {\n flex: auto;\n padding: 16px 24px;\n overflow-y: auto;\n overflow-wrap: break-word;\n}\n.paraui-v3-modal .paraui-v3-modal-footer {\n padding: 8px 24px 24px;\n text-align: right;\n}\n.paraui-v3-modal .paraui-v3-modal-footer > button + button {\n margin-left: 16px;\n}\n.paraui-v3-modal-open {\n overflow: hidden;\n}\n.paraui-v3-modal-centered {\n text-align: center;\n}\n.paraui-v3-modal-centered::before {\n display: inline-block;\n width: 0;\n height: 100%;\n vertical-align: middle;\n content: \"\";\n}\n.paraui-v3-modal-centered .paraui-v3-modal {\n top: 0;\n display: inline-block;\n padding-bottom: 0;\n text-align: left;\n vertical-align: middle;\n}\n@media (max-width: 767px) {\n .paraui-v3-modal .paraui-v3-modal {\n max-width: calc(100vw - 16px);\n margin: 8px auto;\n }\n .paraui-v3-modal .paraui-v3-modal-centered .paraui-v3-modal {\n flex: 1;\n }\n}\n\n.paraui-v3-modal-zoom-enter,\n.paraui-v3-modal-zoom-appear {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n transform: scale(0);\n opacity: 0;\n animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);\n}\n\n.paraui-v3-modal-zoom-leave {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-v3-modal-zoom-enter.paraui-v3-modal-zoom-enter-active,\n.paraui-v3-modal-zoom-appear.paraui-v3-modal-zoom-appear-active {\n animation-name: paraui-v3ModalZoomIn;\n animation-play-state: running;\n}\n\n.paraui-v3-modal-zoom-leave.paraui-v3-modal-zoom-leave-active {\n animation-name: paraui-v3ModalZoomOut;\n animation-play-state: running;\n pointer-events: none;\n}\n\n.paraui-v3-modal-zoom-enter-prepare,\n.paraui-v3-modal-zoom-appear-prepare {\n transform: none;\n}\n\n.paraui-v3-modal-zoom-leave {\n animation-timing-function: cubic-bezier(0.78, 0.14, 0.15, 0.86);\n}\n\n.paraui-v3-modal-fade-enter,\n.paraui-v3-modal-fade-appear {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-v3-modal-fade-leave {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-v3-modal-fade-enter.paraui-v3-modal-fade-enter-active,\n.paraui-v3-modal-fade-appear.paraui-v3-modal-fade-appear-active {\n animation-name: paraui-v3ModalFadeIn;\n animation-play-state: running;\n}\n\n.paraui-v3-modal-fade-leave.paraui-v3-modal-fade-leave-active {\n animation-name: paraui-v3ModalFadeOut;\n animation-play-state: running;\n pointer-events: none;\n}\n\n.paraui-v3-modal-fade-enter,\n.paraui-v3-modal-fade-appear {\n opacity: 0;\n animation-timing-function: linear;\n}\n\n.paraui-v3-modal-fade-leave {\n animation-timing-function: linear;\n}\n\n@keyframes paraui-v3ModalZoomIn {\n 0% {\n transform: scale(0.2);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n@keyframes paraui-v3ModalZoomOut {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0.2);\n opacity: 0;\n }\n}\n@keyframes paraui-v3ModalFadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes paraui-v3ModalFadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}";
|
|
230
|
+
styleInject(css_248z);
|
|
231
|
+
|
|
232
|
+
//鼠标位置内部使用
|
|
233
|
+
var mousePosition;
|
|
234
|
+
var getClickPosition = function getClickPosition(e) {
|
|
235
|
+
mousePosition = {
|
|
236
|
+
x: e.pageX,
|
|
237
|
+
y: e.pageY
|
|
238
|
+
};
|
|
239
|
+
setTimeout(function () {
|
|
240
|
+
mousePosition = null;
|
|
241
|
+
}, 100);
|
|
242
|
+
};
|
|
243
|
+
// 只有点击事件支持从鼠标位置动画展开
|
|
244
|
+
if (window.document.documentElement) {
|
|
245
|
+
document.documentElement.addEventListener('click', getClickPosition, true);
|
|
246
|
+
}
|
|
247
|
+
//Modal
|
|
248
|
+
var Modal = function Modal(props) {
|
|
249
|
+
var open = props.open,
|
|
250
|
+
_props$visible = props.visible,
|
|
251
|
+
visible = _props$visible === void 0 ? false : _props$visible,
|
|
252
|
+
closeIcon = props.closeIcon,
|
|
253
|
+
_props$centered = props.centered,
|
|
254
|
+
centered = _props$centered === void 0 ? true : _props$centered,
|
|
255
|
+
_props$focusTriggerAf = props.focusTriggerAfterClose,
|
|
256
|
+
focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,
|
|
257
|
+
title = props.title,
|
|
258
|
+
footer = props.footer,
|
|
259
|
+
_props$showActions = props.showActions,
|
|
260
|
+
showActions = _props$showActions === void 0 ? true : _props$showActions,
|
|
261
|
+
actions = props.actions,
|
|
262
|
+
header = props.header,
|
|
263
|
+
_props$hideHeader = props.hideHeader,
|
|
264
|
+
hideHeader = _props$hideHeader === void 0 ? false : _props$hideHeader,
|
|
265
|
+
_props$showCancel = props.showCancel,
|
|
266
|
+
showCancel = _props$showCancel === void 0 ? true : _props$showCancel,
|
|
267
|
+
_props$maskClosable = props.maskClosable,
|
|
268
|
+
maskClosable = _props$maskClosable === void 0 ? false : _props$maskClosable,
|
|
269
|
+
_props$disableBackdro = props.disableBackdropClick,
|
|
270
|
+
disableBackdropClick = _props$disableBackdro === void 0 ? true : _props$disableBackdro,
|
|
271
|
+
_props$keyboard = props.keyboard,
|
|
272
|
+
keyboard = _props$keyboard === void 0 ? false : _props$keyboard,
|
|
273
|
+
_props$disableEscapeK = props.disableEscapeKeyDown,
|
|
274
|
+
disableEscapeKeyDown = _props$disableEscapeK === void 0 ? true : _props$disableEscapeK,
|
|
275
|
+
fullScreen = props.fullScreen,
|
|
276
|
+
customizeSize = props.customizeSize,
|
|
277
|
+
style = props.style,
|
|
278
|
+
bodyStyle = props.bodyStyle,
|
|
279
|
+
contentWidth = props.contentWidth,
|
|
280
|
+
contentHeight = props.contentHeight,
|
|
281
|
+
contentStyle = props.contentStyle,
|
|
282
|
+
_props$size = props.size,
|
|
283
|
+
size = _props$size === void 0 ? 'md' : _props$size,
|
|
284
|
+
children = props.children,
|
|
285
|
+
_props$closable = props.closable,
|
|
286
|
+
closable = _props$closable === void 0 ? true : _props$closable,
|
|
287
|
+
restProps = __rest(props, ["open", "visible", "closeIcon", "centered", "focusTriggerAfterClose", "title", "footer", "showActions", "actions", "header", "hideHeader", "showCancel", "maskClosable", "disableBackdropClick", "keyboard", "disableEscapeKeyDown", "fullScreen", "customizeSize", "style", "bodyStyle", "contentWidth", "contentHeight", "contentStyle", "size", "children", "closable"]);
|
|
288
|
+
var isFullScreen = fullScreen || size === 'fullScreen'; //是否全屏
|
|
289
|
+
var intl = useFormatMessage('Modal', defaultModalLocale);
|
|
290
|
+
var prefixCls = "".concat($prefixCls, "-modal");
|
|
291
|
+
//关闭回调
|
|
292
|
+
var handleCancel = function handleCancel(e) {
|
|
293
|
+
var _a;
|
|
294
|
+
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
295
|
+
};
|
|
296
|
+
//确定回调
|
|
297
|
+
var handleOk = function handleOk(e) {
|
|
298
|
+
var _a;
|
|
299
|
+
(_a = props.onOk) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
300
|
+
};
|
|
301
|
+
//modal size class
|
|
302
|
+
var makeSizeCls = function makeSizeCls() {
|
|
303
|
+
var sizeMap = {
|
|
304
|
+
sm: "".concat(prefixCls, "-sm"),
|
|
305
|
+
md: "".concat(prefixCls, "-md"),
|
|
306
|
+
lg: "".concat(prefixCls, "-lg"),
|
|
307
|
+
auto: "".concat(prefixCls, "-auto"),
|
|
308
|
+
fullScreen: "".concat(prefixCls, "-fullscreen")
|
|
309
|
+
};
|
|
310
|
+
if (contentWidth || contentHeight || contentStyle) return;
|
|
311
|
+
if (isFullScreen) return sizeMap['fullScreen'];
|
|
312
|
+
return sizeMap[size];
|
|
313
|
+
};
|
|
314
|
+
//自定义样式
|
|
315
|
+
var getCStyle = function getCStyle() {
|
|
316
|
+
return Object.assign(Object.assign({}, customizeSize), style);
|
|
317
|
+
};
|
|
318
|
+
//自定义内容样式
|
|
319
|
+
var getContentStyle = function getContentStyle() {
|
|
320
|
+
return Object.assign(Object.assign(Object.assign({}, bodyStyle), {
|
|
321
|
+
width: contentWidth,
|
|
322
|
+
height: contentHeight
|
|
323
|
+
}), contentStyle);
|
|
324
|
+
};
|
|
325
|
+
//header
|
|
326
|
+
var renderHeader = function renderHeader() {
|
|
327
|
+
if (hideHeader) return null;
|
|
328
|
+
if (header) return header;
|
|
329
|
+
//
|
|
330
|
+
var closeNode = closable && jsx(Button.IconButton, Object.assign({
|
|
331
|
+
onClick: handleCancel,
|
|
332
|
+
className: "".concat(prefixCls, "-close"),
|
|
333
|
+
variant: 'outlined',
|
|
334
|
+
size: 'small'
|
|
335
|
+
}, {
|
|
336
|
+
children: closeIcon || jsx(CloseIcon, {
|
|
337
|
+
className: "".concat(prefixCls, "-close-icon")
|
|
338
|
+
})
|
|
339
|
+
}));
|
|
340
|
+
return jsxs(Fragment, {
|
|
341
|
+
children: [title, closeNode]
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
//footer
|
|
345
|
+
var renderFooter = function renderFooter() {
|
|
346
|
+
if (!showActions) return null;
|
|
347
|
+
var okText = props.okText,
|
|
348
|
+
cancelText = props.cancelText,
|
|
349
|
+
okButtonProps = props.okButtonProps,
|
|
350
|
+
cancelButtonProps = props.cancelButtonProps,
|
|
351
|
+
_props$confirmLoading = props.confirmLoading,
|
|
352
|
+
confirmLoading = _props$confirmLoading === void 0 ? false : _props$confirmLoading;
|
|
353
|
+
var okBtn = jsx(Button, Object.assign({
|
|
354
|
+
variant: "contained",
|
|
355
|
+
size: "medium",
|
|
356
|
+
loading: confirmLoading,
|
|
357
|
+
onClick: handleOk
|
|
358
|
+
}, okButtonProps, {
|
|
359
|
+
children: okText !== null && okText !== void 0 ? okText : intl({
|
|
360
|
+
id: 'ok'
|
|
361
|
+
})
|
|
362
|
+
}));
|
|
363
|
+
var cancelBtn = showCancel && jsx(Button, Object.assign({
|
|
364
|
+
variant: "outlined",
|
|
365
|
+
size: "medium",
|
|
366
|
+
onClick: handleCancel
|
|
367
|
+
}, cancelButtonProps, {
|
|
368
|
+
children: cancelText !== null && cancelText !== void 0 ? cancelText : intl({
|
|
369
|
+
id: 'cancel'
|
|
370
|
+
})
|
|
371
|
+
}));
|
|
372
|
+
var buttons = [cancelBtn, okBtn];
|
|
373
|
+
var tActions = actions !== null && actions !== void 0 ? actions : footer;
|
|
374
|
+
if (typeof tActions === 'function') {
|
|
375
|
+
var btns = tActions(buttons);
|
|
376
|
+
return jsx(Fragment, {
|
|
377
|
+
children: Array.isArray(btns) ? btns.map(function (btn, idx) {
|
|
378
|
+
return jsx(React__default.Fragment, {
|
|
379
|
+
children: btn
|
|
380
|
+
}, idx);
|
|
381
|
+
}) : btns
|
|
382
|
+
});
|
|
383
|
+
} else if (tActions) {
|
|
384
|
+
return tActions;
|
|
385
|
+
}
|
|
386
|
+
return jsx(Fragment, {
|
|
387
|
+
children: buttons.map(function (btn, idx) {
|
|
388
|
+
return jsx(React__default.Fragment, {
|
|
389
|
+
children: btn
|
|
390
|
+
}, idx);
|
|
391
|
+
})
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
//wrap cls
|
|
395
|
+
var makeWrapClassName = clsx(props.wrapClassName, _defineProperty({}, "".concat(prefixCls, "-centered"), centered));
|
|
396
|
+
//modal cls
|
|
397
|
+
var makeModalClassName = clsx(props.className, "".concat($prefixCls, "-scrollbar-small"), makeSizeCls());
|
|
398
|
+
return jsx(Dialog, Object.assign({}, restProps, {
|
|
399
|
+
visible: open !== null && open !== void 0 ? open : visible,
|
|
400
|
+
title: renderHeader(),
|
|
401
|
+
footer: renderFooter(),
|
|
402
|
+
style: getCStyle(),
|
|
403
|
+
bodyStyle: getContentStyle(),
|
|
404
|
+
prefixCls: prefixCls,
|
|
405
|
+
className: makeModalClassName,
|
|
406
|
+
wrapClassName: makeWrapClassName,
|
|
407
|
+
mousePosition: mousePosition,
|
|
408
|
+
onClose: handleCancel,
|
|
409
|
+
closable: false,
|
|
410
|
+
closeIcon: null,
|
|
411
|
+
maskClosable: !disableBackdropClick || maskClosable,
|
|
412
|
+
keyboard: !disableEscapeKeyDown || keyboard,
|
|
413
|
+
focusTriggerAfterClose: focusTriggerAfterClose,
|
|
414
|
+
transitionName: "".concat(prefixCls, "-zoom"),
|
|
415
|
+
maskTransitionName: "".concat(prefixCls, "-fade")
|
|
416
|
+
}, {
|
|
417
|
+
children: children
|
|
418
|
+
}));
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
export { Confirm, Modal, Modal as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author linhd
|
|
3
|
+
* @date 2021/8/23 14:20
|
|
4
|
+
* @description 多值框
|
|
5
|
+
*/
|
|
6
|
+
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
+
import { LabelTooltipProps } from "../Label";
|
|
8
|
+
import { HelperTextDetailProps } from "../HelperText";
|
|
9
|
+
import './index.scss';
|
|
10
|
+
interface ReplaceFieldsProps {
|
|
11
|
+
/** key索引 */
|
|
12
|
+
key?: string;
|
|
13
|
+
/** value索引 */
|
|
14
|
+
value?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface MultiBoxProps extends HelperTextDetailProps {
|
|
17
|
+
/** 样式class */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** style */
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/** 大小 */
|
|
22
|
+
size?: 'small' | 'medium' | 'large';
|
|
23
|
+
/** 中间符号 */
|
|
24
|
+
separator?: ReactNode;
|
|
25
|
+
/** 标题 */
|
|
26
|
+
label?: ReactNode;
|
|
27
|
+
/** 帮组提示信息 */
|
|
28
|
+
labelTooltip?: LabelTooltipProps;
|
|
29
|
+
/** 标题提示 */
|
|
30
|
+
labelSign?: ReactNode;
|
|
31
|
+
/** 提示语key */
|
|
32
|
+
placeholderKey?: ReactNode;
|
|
33
|
+
/** 提示语value */
|
|
34
|
+
placeholderValue?: ReactNode;
|
|
35
|
+
/** 是否禁用 */
|
|
36
|
+
disabled?: boolean | {
|
|
37
|
+
[name: string]: boolean;
|
|
38
|
+
}[];
|
|
39
|
+
/** 是否必填 */
|
|
40
|
+
required?: boolean;
|
|
41
|
+
/** 默认值 不受控 */
|
|
42
|
+
defaultValue?: any[];
|
|
43
|
+
/** 选中值 多选时为数组 单选单值 */
|
|
44
|
+
value?: any[];
|
|
45
|
+
/** 替换字段 */
|
|
46
|
+
replaceFields?: ReplaceFieldsProps;
|
|
47
|
+
/** 没有错误的时候,不渲染 */
|
|
48
|
+
hideErrorDom?: boolean;
|
|
49
|
+
/** 错误提示 */
|
|
50
|
+
helperText?: ReactNode | Record<string, ReactNode>[];
|
|
51
|
+
/** 改变值 */
|
|
52
|
+
onChange?: (val: any[]) => void;
|
|
53
|
+
/** 键值索引匹配 */
|
|
54
|
+
fetchSuggestionsKey?: (val: string, cb: (data: any[]) => void) => void;
|
|
55
|
+
/** 值索引匹配 */
|
|
56
|
+
fetchSuggestionsValue?: (val: string, cb: (data: any[]) => void) => void;
|
|
57
|
+
[name: string]: any;
|
|
58
|
+
}
|
|
59
|
+
export declare const MultiBox: FunctionComponent<MultiBoxProps>;
|
|
60
|
+
export default MultiBox;
|