@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,142 @@
|
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
|
|
2
|
+
import { useState, useEffect, createElement } from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Checkbox } from '../Checkbox/index.js';
|
|
5
|
+
import Label from '../Label/index.js';
|
|
6
|
+
import HelperText from '../HelperText/index.js';
|
|
7
|
+
import { DeepClone } from '@paraview/lib';
|
|
8
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
9
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
|
+
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
11
|
+
import '../Help/index.js';
|
|
12
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
13
|
+
import '../Tooltip/index.js';
|
|
14
|
+
import 'rc-tooltip';
|
|
15
|
+
import 'rc-tooltip/lib/placements';
|
|
16
|
+
import 'clsx';
|
|
17
|
+
import '@para-ui/icons/Help';
|
|
18
|
+
|
|
19
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-checkbox-group {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 100%;\n}\n.paraui-v3-checkbox-group > .checkbox-group-label {\n margin-bottom: 4px;\n}\n.paraui-v3-checkbox-group > .checkbox-group-content {\n line-height: 0;\n}\n.paraui-v3-checkbox-group > .checkbox-group-content > .paraui-v3-checkbox {\n margin-top: 8px;\n margin-bottom: 4px;\n}\n.paraui-v3-checkbox-group.paraui-v3-checkbox-group-column > .checkbox-group-content {\n display: flex;\n flex-direction: column;\n}";
|
|
20
|
+
styleInject(css_248z);
|
|
21
|
+
|
|
22
|
+
var CheckboxGroup = function CheckboxGroup(props) {
|
|
23
|
+
var _props$label = props.label,
|
|
24
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
25
|
+
labelTooltip = props.labelTooltip,
|
|
26
|
+
_props$spacing = props.spacing,
|
|
27
|
+
spacing = _props$spacing === void 0 ? '28px' : _props$spacing,
|
|
28
|
+
_props$size = props.size,
|
|
29
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
30
|
+
_props$row = props.row,
|
|
31
|
+
row = _props$row === void 0 ? true : _props$row,
|
|
32
|
+
_props$disabled = props.disabled,
|
|
33
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
34
|
+
_props$required = props.required,
|
|
35
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
36
|
+
_props$error = props.error,
|
|
37
|
+
error = _props$error === void 0 ? false : _props$error,
|
|
38
|
+
hideErrorDom = props.hideErrorDom,
|
|
39
|
+
_props$helperText = props.helperText,
|
|
40
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
41
|
+
_props$id = props.id,
|
|
42
|
+
id = _props$id === void 0 ? 'name' : _props$id,
|
|
43
|
+
list = props.list,
|
|
44
|
+
_props$className = props.className,
|
|
45
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
46
|
+
onChange = props.onChange,
|
|
47
|
+
style = props.style;
|
|
48
|
+
var _useState = useState([]),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
valueCom = _useState2[0],
|
|
51
|
+
setValueCom = _useState2[1];
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
|
|
54
|
+
}, []);
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
if (props.value !== undefined) setValueCom(props.value);
|
|
57
|
+
}, [props.value]);
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param item 点击当前项数据
|
|
61
|
+
* @event 点击元素
|
|
62
|
+
* @checked 当前值
|
|
63
|
+
*/
|
|
64
|
+
var onchangeCom = function onchangeCom(item) {
|
|
65
|
+
return function (event, checked) {
|
|
66
|
+
var name = item[id]; // 值
|
|
67
|
+
var arr = DeepClone(valueCom);
|
|
68
|
+
if (checked) {
|
|
69
|
+
arr.push(name);
|
|
70
|
+
} else {
|
|
71
|
+
var index = arr.indexOf(name);
|
|
72
|
+
arr.splice(index, 1);
|
|
73
|
+
}
|
|
74
|
+
if (props.value === undefined) setValueCom(arr);
|
|
75
|
+
onChange && onChange(arr);
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
var handLabel = function handLabel() {
|
|
79
|
+
if (label || required) {
|
|
80
|
+
var handLabelClass = function handLabelClass() {
|
|
81
|
+
var str = 'checkbox-group-label';
|
|
82
|
+
if (labelTooltip && labelTooltip.className) {
|
|
83
|
+
str += ' ' + labelTooltip.className;
|
|
84
|
+
}
|
|
85
|
+
return str;
|
|
86
|
+
};
|
|
87
|
+
return jsx(Label, Object.assign({
|
|
88
|
+
label: label,
|
|
89
|
+
required: required
|
|
90
|
+
}, labelTooltip, {
|
|
91
|
+
className: handLabelClass()
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* @description 处理单选框每一项样式
|
|
98
|
+
* */
|
|
99
|
+
var handStyleItem = function handStyleItem(item, index) {
|
|
100
|
+
var obj = Object.assign({}, item.style);
|
|
101
|
+
if (spacing && row && list.length !== index + 1) {
|
|
102
|
+
obj.marginRight = spacing;
|
|
103
|
+
}
|
|
104
|
+
return obj;
|
|
105
|
+
};
|
|
106
|
+
// 处理class
|
|
107
|
+
var handClass = function handClass() {
|
|
108
|
+
var str = $prefixCls + '-checkbox-group';
|
|
109
|
+
if (className) str += ' ' + className;
|
|
110
|
+
if (size) str += " ".concat($prefixCls, "-checkbox-group-").concat(size);
|
|
111
|
+
if (error) str += " ".concat($prefixCls, "-checkbox-group-error");
|
|
112
|
+
if (disabled) str += " ".concat($prefixCls, "-checkbox-group-disabled");
|
|
113
|
+
if (row) str += " ".concat($prefixCls, "-checkbox-group-row");else str += " ".concat($prefixCls, "-checkbox-group-column");
|
|
114
|
+
return str;
|
|
115
|
+
};
|
|
116
|
+
return jsxs("div", Object.assign({
|
|
117
|
+
className: handClass(),
|
|
118
|
+
style: style
|
|
119
|
+
}, {
|
|
120
|
+
children: [handLabel(), jsx("div", Object.assign({
|
|
121
|
+
className: "checkbox-group-content"
|
|
122
|
+
}, {
|
|
123
|
+
children: list.map(function (item, index) {
|
|
124
|
+
return /*#__PURE__*/createElement(Checkbox, Object.assign({}, item, {
|
|
125
|
+
style: handStyleItem(item, index),
|
|
126
|
+
checked: valueCom.indexOf(item[id]) !== -1,
|
|
127
|
+
size: size,
|
|
128
|
+
disabled: Boolean(disabled || item.disabled),
|
|
129
|
+
key: index,
|
|
130
|
+
onChange: onchangeCom(item)
|
|
131
|
+
}));
|
|
132
|
+
})
|
|
133
|
+
})), jsx(HelperText, {
|
|
134
|
+
className: "checkbox-group-error-text",
|
|
135
|
+
error: error,
|
|
136
|
+
helperText: helperText,
|
|
137
|
+
hideErrorDom: hideErrorDom
|
|
138
|
+
})]
|
|
139
|
+
}));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export { CheckboxGroup, CheckboxGroup as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author linhd
|
|
3
|
+
* @date 2022/3/7 4:12 PM
|
|
4
|
+
* @description 折叠面板
|
|
5
|
+
*/
|
|
6
|
+
import React, { FunctionComponent } from 'react';
|
|
7
|
+
export type CollapsibleType = 'header' | 'disabled';
|
|
8
|
+
export interface CollapsePanelProps {
|
|
9
|
+
/** className */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** 样式 */
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
/** 对应 activeKey */
|
|
14
|
+
key: string | number;
|
|
15
|
+
/** 面板头内容 */
|
|
16
|
+
header: React.ReactNode;
|
|
17
|
+
/** @deprecated Use `collapsible="disabled"` instead */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 是否展示当前面板上的箭头 */
|
|
20
|
+
showArrow?: boolean;
|
|
21
|
+
/** 被隐藏时是否渲染 DOM 结构 */
|
|
22
|
+
forceRender?: boolean;
|
|
23
|
+
id?: string;
|
|
24
|
+
/** 自定义渲染每个面板右上角的内容 */
|
|
25
|
+
extra?: React.ReactNode;
|
|
26
|
+
/** 是否可折叠或指定可折叠触发区域 */
|
|
27
|
+
collapsible?: CollapsibleType;
|
|
28
|
+
}
|
|
29
|
+
export declare const CollapsePanelProps: FunctionComponent<CollapsePanelProps>;
|
|
30
|
+
export default CollapsePanelProps;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author linhd
|
|
3
|
+
* @date 2022/3/7 4:03 PM
|
|
4
|
+
* @description 折叠面板
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import CollapsePanel, { CollapsibleType } from './collapsePanel';
|
|
8
|
+
import './index.scss';
|
|
9
|
+
export type ExpandIconPosition = 'left' | 'right' | undefined;
|
|
10
|
+
export interface CollapseProps {
|
|
11
|
+
/** className */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** 样式 */
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
/** 初始化选中面板的 key */
|
|
16
|
+
defaultActiveKey?: Array<string | number> | string | number;
|
|
17
|
+
/** 当前激活 tab 面板的 key */
|
|
18
|
+
activeKey?: Array<string | number> | string | number;
|
|
19
|
+
/** 手风琴模式 */
|
|
20
|
+
accordion?: boolean;
|
|
21
|
+
/** 所有子面板是否可折叠或指定可折叠触发区域 */
|
|
22
|
+
collapsible?: CollapsibleType;
|
|
23
|
+
/** 销毁折叠隐藏的面板 */
|
|
24
|
+
destroyInactivePanel?: boolean;
|
|
25
|
+
/** 自定义切换图标 */
|
|
26
|
+
expandIcon?: (panelProps: PanelProps) => React.ReactNode;
|
|
27
|
+
/** 设置图标位置 */
|
|
28
|
+
expandIconPosition?: ExpandIconPosition;
|
|
29
|
+
/** onChange */
|
|
30
|
+
onChange?: (key: string | string[]) => void;
|
|
31
|
+
children?: any;
|
|
32
|
+
}
|
|
33
|
+
interface PanelProps {
|
|
34
|
+
/** 是否展开 */
|
|
35
|
+
isActive?: boolean;
|
|
36
|
+
/** 面板头内容 */
|
|
37
|
+
header?: React.ReactNode;
|
|
38
|
+
/** className */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** style */
|
|
41
|
+
style?: React.CSSProperties;
|
|
42
|
+
/** 是否展示当前面板上的箭头 */
|
|
43
|
+
showArrow?: boolean;
|
|
44
|
+
/** 被隐藏时是否渲染 DOM 结构 */
|
|
45
|
+
forceRender?: boolean;
|
|
46
|
+
/** @deprecated Use `collapsible="disabled"` instead */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** 自定义渲染每个面板右上角的内容 */
|
|
49
|
+
extra?: React.ReactNode;
|
|
50
|
+
/** 是否可折叠或指定可折叠触发区域 */
|
|
51
|
+
collapsible?: CollapsibleType;
|
|
52
|
+
}
|
|
53
|
+
interface CollapseInterface extends React.FC<CollapseProps> {
|
|
54
|
+
Panel: typeof CollapsePanel;
|
|
55
|
+
}
|
|
56
|
+
export declare const Collapse: CollapseInterface;
|
|
57
|
+
export default Collapse;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import RcCollapse from 'rc-collapse';
|
|
3
|
+
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import Right from '@para-ui/icons/Right';
|
|
6
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
7
|
+
|
|
8
|
+
var CollapsePanelProps = function CollapsePanelProps(props) {
|
|
9
|
+
var _props$className = props.className,
|
|
10
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
11
|
+
_props$showArrow = props.showArrow,
|
|
12
|
+
showArrow = _props$showArrow === void 0 ? true : _props$showArrow;
|
|
13
|
+
/** 处理className */
|
|
14
|
+
var handClass = function handClass() {
|
|
15
|
+
var str = '';
|
|
16
|
+
if (className) str += className;
|
|
17
|
+
if (!showArrow) str += ' collapse-panel-no-arrow';
|
|
18
|
+
return str;
|
|
19
|
+
};
|
|
20
|
+
return jsx(RcCollapse.Panel, Object.assign({}, props, {
|
|
21
|
+
className: handClass(),
|
|
22
|
+
prefixCls: $rcPrefixCls + '-collapse'
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var isValidElement = React.isValidElement;
|
|
27
|
+
function replaceElement(element, replacement, props) {
|
|
28
|
+
if (!isValidElement(element)) return replacement;
|
|
29
|
+
return /*#__PURE__*/React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
|
|
30
|
+
}
|
|
31
|
+
function cloneElement(element, props) {
|
|
32
|
+
return replaceElement(element, element, props);
|
|
33
|
+
}
|
|
34
|
+
/** toArray */
|
|
35
|
+
function toArray(list) {
|
|
36
|
+
if (!list) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
return Array.isArray(list) ? list : [list];
|
|
40
|
+
}
|
|
41
|
+
/** omit */
|
|
42
|
+
function omit(obj, fields) {
|
|
43
|
+
var clone = Object.assign({}, obj);
|
|
44
|
+
if (Array.isArray(fields)) {
|
|
45
|
+
fields.forEach(function (key) {
|
|
46
|
+
delete clone[key];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return clone;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ================== Collapse Motion ==================
|
|
53
|
+
var getCollapsedHeight = function getCollapsedHeight() {
|
|
54
|
+
return {
|
|
55
|
+
height: 0,
|
|
56
|
+
opacity: 0
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
var getRealHeight = function getRealHeight(node) {
|
|
60
|
+
var scrollHeight = node.scrollHeight;
|
|
61
|
+
return {
|
|
62
|
+
height: scrollHeight,
|
|
63
|
+
opacity: 1
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
var getCurrentHeight = function getCurrentHeight(node) {
|
|
67
|
+
return {
|
|
68
|
+
height: node ? node.offsetHeight : 0
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
var skipOpacityTransition = function skipOpacityTransition(_, event) {
|
|
72
|
+
return (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
73
|
+
};
|
|
74
|
+
var collapseMotion = {
|
|
75
|
+
motionName: 'collapse-motion-collapse',
|
|
76
|
+
onAppearStart: getCollapsedHeight,
|
|
77
|
+
onEnterStart: getCollapsedHeight,
|
|
78
|
+
onAppearActive: getRealHeight,
|
|
79
|
+
onEnterActive: getRealHeight,
|
|
80
|
+
onLeaveStart: getCurrentHeight,
|
|
81
|
+
onLeaveActive: getCollapsedHeight,
|
|
82
|
+
onAppearEnd: skipOpacityTransition,
|
|
83
|
+
onEnterEnd: skipOpacityTransition,
|
|
84
|
+
onLeaveEnd: skipOpacityTransition,
|
|
85
|
+
motionDeadline: 500
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-collapse {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n background-color: white;\n border-bottom: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-collapse .collapse-motion-collapse {\n overflow: hidden;\n transition: height 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) !important;\n}\n.paraui-v3-collapse > .component-collapse-item {\n border-top: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-header {\n display: flex;\n align-items: center;\n padding: 16px;\n color: rgb(46, 55, 67);\n cursor: pointer;\n font-weight: 700;\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-header > .collapse-svg-box {\n line-height: 0;\n margin-right: 16px;\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-header > .collapse-svg-box svg {\n color: rgb(46, 55, 67);\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-header > .collapse-svg-box .collapse-expand-svg {\n transition: all 0.3s, visibility 0s;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-header > .component-collapse-extra {\n line-height: 0;\n margin-left: auto;\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-header > .component-collapse-extra svg {\n color: rgb(46, 55, 67);\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-content.collapse-content-hidden {\n display: none;\n}\n.paraui-v3-collapse > .component-collapse-item > .component-collapse-content > .component-collapse-content-box {\n padding: 0 16px 16px;\n color: rgb(46, 55, 67);\n font-size: 14px;\n}\n.paraui-v3-collapse > .component-collapse-item.component-collapse-item-active > .component-collapse-header > .collapse-svg-box .collapse-expand-svg {\n transform: rotate(90deg);\n}\n.paraui-v3-collapse.paraui-v3-collapse-svg-right > .component-collapse-item > .component-collapse-header {\n padding-right: 40px;\n position: relative;\n}\n.paraui-v3-collapse.paraui-v3-collapse-svg-right > .component-collapse-item > .component-collapse-header > .collapse-svg-box {\n position: absolute;\n right: 12px;\n top: 17px;\n margin-right: 0;\n}\n.paraui-v3-collapse > .component-collapse-item-disabled > .component-collapse-header {\n color: rgb(46, 55, 67);\n cursor: not-allowed;\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-collapse > .component-collapse-item-disabled > .component-collapse-header > .collapse-svg-box svg {\n color: rgb(46, 55, 67);\n}\n.paraui-v3-collapse > .component-collapse-item-disabled > .component-collapse-header > .collapse-svg-box .collapse-expand-svg {\n color: rgb(46, 55, 67);\n}\n.paraui-v3-collapse > .component-collapse-item-disabled > .component-collapse-header > .component-collapse-extra svg {\n color: rgb(46, 55, 67);\n}";
|
|
89
|
+
styleInject(css_248z);
|
|
90
|
+
|
|
91
|
+
var Collapse = function Collapse(props) {
|
|
92
|
+
var _props$className = props.className,
|
|
93
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
94
|
+
_props$expandIconPosi = props.expandIconPosition,
|
|
95
|
+
expandIconPosition = _props$expandIconPosi === void 0 ? 'left' : _props$expandIconPosi;
|
|
96
|
+
/** 处理字内容 */
|
|
97
|
+
var getItems = function getItems() {
|
|
98
|
+
var children = props.children;
|
|
99
|
+
return toArray(children).map(function (child, index) {
|
|
100
|
+
var _a;
|
|
101
|
+
if ((_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
102
|
+
var key = child.key || String(index);
|
|
103
|
+
var _child$props = child.props,
|
|
104
|
+
disabled = _child$props.disabled,
|
|
105
|
+
collapsible = _child$props.collapsible;
|
|
106
|
+
var childProps = Object.assign(Object.assign({}, omit(child.props, ['disabled'])), {
|
|
107
|
+
key: key,
|
|
108
|
+
collapsible: collapsible !== null && collapsible !== void 0 ? collapsible : disabled ? 'disabled' : undefined
|
|
109
|
+
});
|
|
110
|
+
return cloneElement(child, childProps);
|
|
111
|
+
}
|
|
112
|
+
return child;
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
/** 处理展开图标 */
|
|
116
|
+
var renderExpandIcon = function renderExpandIcon() {
|
|
117
|
+
var panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
118
|
+
var expandIcon = props.expandIcon;
|
|
119
|
+
var icon = expandIcon ? expandIcon(panelProps) : jsx(Right, {
|
|
120
|
+
className: "collapse-expand-svg"
|
|
121
|
+
});
|
|
122
|
+
return jsx("div", Object.assign({
|
|
123
|
+
className: "collapse-svg-box"
|
|
124
|
+
}, {
|
|
125
|
+
children: icon
|
|
126
|
+
}));
|
|
127
|
+
};
|
|
128
|
+
/** 处理className */
|
|
129
|
+
var handClass = function handClass() {
|
|
130
|
+
var str = $prefixCls + '-collapse';
|
|
131
|
+
if (className) str += ' ' + className;
|
|
132
|
+
if (expandIconPosition) str += " ".concat($prefixCls, "-collapse-svg-").concat(expandIconPosition);
|
|
133
|
+
return str;
|
|
134
|
+
};
|
|
135
|
+
/** 处理过度动画 */
|
|
136
|
+
var openMotion = Object.assign(Object.assign({}, collapseMotion), {
|
|
137
|
+
motionAppear: false,
|
|
138
|
+
leavedClassName: "collapse-content-hidden"
|
|
139
|
+
});
|
|
140
|
+
return jsx(RcCollapse, Object.assign({
|
|
141
|
+
openMotion: openMotion
|
|
142
|
+
}, props, {
|
|
143
|
+
expandIcon: renderExpandIcon,
|
|
144
|
+
prefixCls: $rcPrefixCls + '-collapse',
|
|
145
|
+
className: handClass()
|
|
146
|
+
}, {
|
|
147
|
+
children: getItems()
|
|
148
|
+
}));
|
|
149
|
+
};
|
|
150
|
+
Collapse.Panel = CollapsePanelProps;
|
|
151
|
+
|
|
152
|
+
export { Collapse, Collapse as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const isValidElement: typeof React.isValidElement;
|
|
3
|
+
type AnyObject = Record<any, any>;
|
|
4
|
+
type RenderProps = undefined | AnyObject | ((originProps: AnyObject) => AnyObject | undefined);
|
|
5
|
+
export declare function replaceElement(element: React.ReactNode, replacement: React.ReactNode, props: RenderProps): React.ReactNode;
|
|
6
|
+
export declare function cloneElement(element: React.ReactNode, props?: RenderProps): React.ReactElement;
|
|
7
|
+
/** toArray */
|
|
8
|
+
export declare function toArray<T>(list: T | T[]): T[];
|
|
9
|
+
/** omit */
|
|
10
|
+
export declare function omit<T extends object, K extends keyof T>(obj: T, fields: K[]): Omit<T, K>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author linhd
|
|
3
|
+
* @date 2022/5/23 2:19 PM
|
|
4
|
+
* @description 折叠容器
|
|
5
|
+
*/
|
|
6
|
+
import React, { FunctionComponent } from 'react';
|
|
7
|
+
import './index.scss';
|
|
8
|
+
export interface CollapseBoxProps {
|
|
9
|
+
/** className */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** css样式 */
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
/** 收起状态最小高度 */
|
|
14
|
+
collapsedHeight?: string | number;
|
|
15
|
+
/** 收起时是否不渲染子节点 */
|
|
16
|
+
unmountOnExit?: boolean;
|
|
17
|
+
/** 动画时间 */
|
|
18
|
+
timeout?: 'auto' | number | {
|
|
19
|
+
appear?: number | undefined;
|
|
20
|
+
enter?: number | undefined;
|
|
21
|
+
exit?: number | undefined;
|
|
22
|
+
};
|
|
23
|
+
children?: any;
|
|
24
|
+
[name: string]: any;
|
|
25
|
+
}
|
|
26
|
+
declare const CollapseBox: FunctionComponent<CollapseBoxProps>;
|
|
27
|
+
export default CollapseBox;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useEffect } from 'react';
|
|
4
|
+
import { Transition } from 'react-transition-group';
|
|
5
|
+
import { g as getTransitionProps, a as getAutoHeightDuration } from '../_verture/util-7e1fb1e2.js';
|
|
6
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
7
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
|
+
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
9
|
+
|
|
10
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-collapse-box {\n transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n width: 100%;\n overflow: hidden;\n height: 0;\n}\n.paraui-v3-collapse-box > .collapse-box-wrapper {\n display: flex;\n width: 100%;\n}\n.paraui-v3-collapse-box > .collapse-box-wrapper > .collapse-box-wrapper-inner {\n width: 100%;\n}\n.paraui-v3-collapse-box.paraui-v3-collapse-box-entered {\n overflow: visible;\n}\n.paraui-v3-collapse-box.paraui-v3-collapse-box-hidden {\n visibility: hidden;\n}";
|
|
11
|
+
styleInject(css_248z);
|
|
12
|
+
|
|
13
|
+
var CollapseBox = function CollapseBox(props) {
|
|
14
|
+
var className = props.className,
|
|
15
|
+
style = props.style,
|
|
16
|
+
open = props.in,
|
|
17
|
+
_props$collapsedHeigh = props.collapsedHeight,
|
|
18
|
+
collapsedHeightProp = _props$collapsedHeigh === void 0 ? '0px' : _props$collapsedHeigh,
|
|
19
|
+
_props$timeout = props.timeout,
|
|
20
|
+
timeout = _props$timeout === void 0 ? 'auto' : _props$timeout,
|
|
21
|
+
unmountOnExit = props.unmountOnExit,
|
|
22
|
+
_children = props.children;
|
|
23
|
+
// timer
|
|
24
|
+
var timer = useRef(null);
|
|
25
|
+
// 动画节点
|
|
26
|
+
var nodeRef = useRef(null);
|
|
27
|
+
// 内置容器
|
|
28
|
+
var wrapperRef = useRef(null);
|
|
29
|
+
// 存储动画时间变量
|
|
30
|
+
var autoTransitionDuration = useRef(null);
|
|
31
|
+
// 下拉收起的高度
|
|
32
|
+
var collapsedHeight = typeof collapsedHeightProp === 'number' ? "".concat(collapsedHeightProp, "px") : collapsedHeightProp;
|
|
33
|
+
var _useState = useState(false),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
inProp = _useState2[0],
|
|
36
|
+
setInProp = _useState2[1];
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
return function () {
|
|
39
|
+
clearTimeout(timer.current);
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
setInProp(open);
|
|
44
|
+
}, [open]);
|
|
45
|
+
// 处理节点
|
|
46
|
+
var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {
|
|
47
|
+
return function (nodeOrAppearing) {
|
|
48
|
+
if (callback) {
|
|
49
|
+
callback(nodeOrAppearing);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
// 下拉
|
|
54
|
+
var handleEnter = normalizedTransitionCallback(function (node) {
|
|
55
|
+
node.style.height = collapsedHeight;
|
|
56
|
+
});
|
|
57
|
+
var handleEntering = normalizedTransitionCallback(function (node) {
|
|
58
|
+
var wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
|
|
59
|
+
var _getTransitionProps = getTransitionProps({
|
|
60
|
+
style: style,
|
|
61
|
+
timeout: timeout
|
|
62
|
+
}, {
|
|
63
|
+
mode: 'enter'
|
|
64
|
+
}),
|
|
65
|
+
transitionDuration = _getTransitionProps.duration;
|
|
66
|
+
if (timeout === 'auto') {
|
|
67
|
+
var duration2 = getAutoHeightDuration(wrapperHeight);
|
|
68
|
+
node.style.transitionDuration = "".concat(duration2, "ms");
|
|
69
|
+
autoTransitionDuration.current = duration2;
|
|
70
|
+
} else {
|
|
71
|
+
node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : "".concat(transitionDuration, "ms");
|
|
72
|
+
}
|
|
73
|
+
node.style.height = "".concat(wrapperHeight, "px");
|
|
74
|
+
});
|
|
75
|
+
var handleEntered = normalizedTransitionCallback(function (node) {
|
|
76
|
+
node.style.height = 'auto';
|
|
77
|
+
});
|
|
78
|
+
// 收起
|
|
79
|
+
var handleExit = normalizedTransitionCallback(function (node) {
|
|
80
|
+
var wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
|
|
81
|
+
node.style.height = "".concat(wrapperHeight, "px");
|
|
82
|
+
});
|
|
83
|
+
var handleExiting = normalizedTransitionCallback(function (node) {
|
|
84
|
+
var wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
|
|
85
|
+
var _getTransitionProps2 = getTransitionProps({
|
|
86
|
+
style: style,
|
|
87
|
+
timeout: timeout
|
|
88
|
+
}, {
|
|
89
|
+
mode: 'exit'
|
|
90
|
+
}),
|
|
91
|
+
transitionDuration = _getTransitionProps2.duration;
|
|
92
|
+
if (timeout === 'auto') {
|
|
93
|
+
var duration2 = getAutoHeightDuration(wrapperHeight);
|
|
94
|
+
node.style.transitionDuration = "".concat(duration2, "ms");
|
|
95
|
+
autoTransitionDuration.current = duration2;
|
|
96
|
+
} else {
|
|
97
|
+
node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : "".concat(transitionDuration, "ms");
|
|
98
|
+
}
|
|
99
|
+
node.style.height = collapsedHeight;
|
|
100
|
+
});
|
|
101
|
+
// 完成下拉/收起回调
|
|
102
|
+
var addEndListener = function addEndListener(nodeOrNext, maybeNext) {
|
|
103
|
+
timer.current = setTimeout(maybeNext, autoTransitionDuration.current || 0);
|
|
104
|
+
};
|
|
105
|
+
// 处理className
|
|
106
|
+
var handClass = function handClass(state) {
|
|
107
|
+
var str = $prefixCls + '-collapse-box';
|
|
108
|
+
if (className) str += ' ' + className;
|
|
109
|
+
if (state === 'entered') str += " ".concat($prefixCls, "-collapse-box-entered");
|
|
110
|
+
if (state === 'exited' && !inProp && collapsedHeight === '0px') str += " ".concat($prefixCls, "-collapse-box-hidden");
|
|
111
|
+
return str;
|
|
112
|
+
};
|
|
113
|
+
return jsx(Transition, Object.assign({
|
|
114
|
+
in: inProp,
|
|
115
|
+
unmountOnExit: unmountOnExit,
|
|
116
|
+
onEnter: handleEnter,
|
|
117
|
+
onEntered: handleEntered,
|
|
118
|
+
onEntering: handleEntering,
|
|
119
|
+
onExit: handleExit,
|
|
120
|
+
onExiting: handleExiting,
|
|
121
|
+
//nodeRef={nodeRef}
|
|
122
|
+
timeout: timeout === 'auto' ? undefined : timeout,
|
|
123
|
+
addEndListener: addEndListener
|
|
124
|
+
}, {
|
|
125
|
+
children: function children(state, childProps) {
|
|
126
|
+
return jsx("div", Object.assign({
|
|
127
|
+
className: handClass(state),
|
|
128
|
+
style: Object.assign({
|
|
129
|
+
minHeight: collapsedHeight
|
|
130
|
+
}, style),
|
|
131
|
+
ref: nodeRef
|
|
132
|
+
}, childProps, {
|
|
133
|
+
children: jsx("div", Object.assign({
|
|
134
|
+
className: 'collapse-box-wrapper',
|
|
135
|
+
ref: wrapperRef
|
|
136
|
+
}, {
|
|
137
|
+
children: jsx("div", Object.assign({
|
|
138
|
+
className: 'collapse-box-wrapper-inner'
|
|
139
|
+
}, {
|
|
140
|
+
children: _children
|
|
141
|
+
}))
|
|
142
|
+
}))
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
}));
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export { CollapseBox as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface CollapseLayoutProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
/**
|
|
7
|
+
* 收起出现的位置
|
|
8
|
+
* 默认 left
|
|
9
|
+
*/
|
|
10
|
+
type?: 'left' | 'right' | 'top' | 'bottom';
|
|
11
|
+
/**
|
|
12
|
+
* 普通展示数据
|
|
13
|
+
*/
|
|
14
|
+
defaultContent?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 显示隐藏的数据
|
|
17
|
+
*/
|
|
18
|
+
displayContent?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* 展开还是收起
|
|
21
|
+
*/
|
|
22
|
+
open?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 允许缩放的长度
|
|
25
|
+
* */
|
|
26
|
+
zoomLength?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 单位
|
|
29
|
+
* 默认px
|
|
30
|
+
*/
|
|
31
|
+
unit?: string;
|
|
32
|
+
/**
|
|
33
|
+
* 展开按钮显示文字
|
|
34
|
+
*/
|
|
35
|
+
showLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 收起按钮展示文字
|
|
38
|
+
*/
|
|
39
|
+
hideLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 间距
|
|
42
|
+
* 默认20
|
|
43
|
+
*/
|
|
44
|
+
spacing?: number;
|
|
45
|
+
/** 点击回调 bol 显示/展开 */
|
|
46
|
+
onClickBtn?: (bol?: boolean) => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @author zhanzl
|
|
50
|
+
* @date 2022/08/09
|
|
51
|
+
*/
|
|
52
|
+
declare const CollapseLayout: FC<CollapseLayoutProps>;
|
|
53
|
+
export default CollapseLayout;
|