@para-ui/core 2.2.5 → 2.2.7-beta
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 -34
- package/AutoBox/index.js +203 -15
- package/AutoTips/index.d.ts +27 -27
- package/AutoTips/index.js +84 -15
- package/Breadcrumbs/index.d.ts +39 -39
- package/Breadcrumbs/index.js +227 -15
- package/Button/SplitButton.d.ts +62 -61
- package/Button/index.d.ts +71 -56
- package/Button/index.js +348 -14
- package/Button/lang/en_US.d.ts +4 -4
- package/Button/lang/index.d.ts +9 -9
- package/Button/lang/zh_CN.d.ts +4 -4
- package/ButtonGroup/index.d.ts +33 -33
- package/ButtonGroup/index.js +128 -14
- package/Carousel/index.d.ts +30 -30
- package/Carousel/index.js +74 -15
- package/Cascader/index.d.ts +52 -52
- package/Cascader/index.js +166 -15
- package/Cascader/lang/en_US.d.ts +4 -4
- package/Cascader/lang/index.d.ts +9 -9
- package/Cascader/lang/zh_CN.d.ts +4 -4
- package/Checkbox/index.d.ts +40 -40
- package/Checkbox/index.js +105 -14
- package/CheckboxGroup/index.d.ts +46 -46
- package/CheckboxGroup/index.js +138 -14
- package/Collapse/collapsePanel.d.ts +30 -30
- package/Collapse/index.d.ts +57 -57
- package/Collapse/index.js +171 -15
- package/Collapse/motion.d.ts +5 -5
- package/Collapse/util.d.ts +11 -11
- package/CollapseBox/index.d.ts +27 -27
- package/CollapseBox/index.js +164 -15
- package/CollapseBox/util.d.ts +5 -5
- package/ColorPicker/index.d.ts +4 -4
- package/ColorPicker/index.js +4 -1
- package/ComboSelect/WithTabsCombo/index.d.ts +11 -11
- package/ComboSelect/WithTabsCombo/interface.d.ts +141 -141
- package/ComboSelect/index.d.ts +11 -11
- package/ComboSelect/index.js +1803 -14
- package/ComboSelect/interface.d.ts +140 -143
- package/ComboSelect/lang/en_US.d.ts +8 -8
- package/ComboSelect/lang/index.d.ts +17 -17
- package/ComboSelect/lang/zh_CN.d.ts +8 -8
- package/ComboSelect/utils.d.ts +12 -12
- package/Container/index.d.ts +77 -77
- package/Container/index.js +239 -15
- package/DatePicker/PickerButton.d.ts +3 -3
- package/DatePicker/PickerTag.d.ts +3 -3
- package/DatePicker/generatePicker/generateRangePicker.d.ts +4 -4
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +11 -11
- package/DatePicker/generatePicker/index.d.ts +77 -77
- package/DatePicker/index.d.ts +18 -18
- package/DatePicker/index.js +733 -14
- package/DatePicker/lang/en_US.d.ts +3 -3
- package/DatePicker/lang/index.d.ts +7 -7
- package/DatePicker/lang/zh_CN.d.ts +3 -3
- package/DatePicker/util.d.ts +20 -20
- package/Desktop/index.d.ts +57 -55
- package/Desktop/index.js +853 -14
- package/Drawer/index.d.ts +11 -11
- package/Drawer/index.js +186 -14
- package/Drawer/interface.d.ts +83 -83
- package/Drawer/lang/en_US.d.ts +5 -5
- package/Drawer/lang/index.d.ts +11 -11
- package/Drawer/lang/zh_CN.d.ts +5 -5
- package/Dropdown/index.d.ts +25 -0
- package/Dropdown/index.js +67 -0
- package/Empty/images/index.d.ts +3 -2
- package/Empty/index.d.ts +30 -30
- package/Empty/index.js +644 -14
- package/Empty/lang/en_US.d.ts +6 -6
- package/Empty/lang/index.d.ts +13 -13
- package/Empty/lang/zh_CN.d.ts +6 -6
- package/Form/index.d.ts +181 -181
- package/Form/index.js +384 -14
- package/FormItem/compoments/defaultCompoments/index.d.ts +19 -19
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +8 -8
- package/FormItem/compoments/formFile/index.d.ts +38 -38
- package/FormItem/compoments/formRadioGroup/index.d.ts +8 -8
- package/FormItem/compoments/formSelect/index.d.ts +18 -18
- package/FormItem/errorTips.d.ts +12 -12
- package/FormItem/index.d.ts +152 -152
- package/FormItem/index.js +81 -14
- package/FormItem/itemType.d.ts +42 -42
- package/FormItem/validateFunction.d.ts +15 -15
- package/FunctionModal/dialog.d.ts +58 -58
- package/FunctionModal/index.d.ts +8 -8
- package/FunctionModal/index.js +39 -14
- package/FunctionModal/modalContext.d.ts +15 -14
- package/GlobalContext/componentsProps.d.ts +19 -19
- package/GlobalContext/confirmLocale.d.ts +7 -7
- package/GlobalContext/index.d.ts +28 -28
- package/GlobalContext/index.js +41 -16
- package/GlobalContext/intl.d.ts +34 -34
- package/GlobalContext/useFormatMessage.d.ts +3 -3
- package/Help/index.d.ts +18 -20
- package/Help/index.js +39 -15
- package/HelperText/index.d.ts +19 -19
- package/HelperText/index.js +29 -15
- package/Hooks/useGlobalProps.d.ts +1 -1
- package/InputLang/index.d.ts +49 -49
- package/InputLang/index.js +270 -14
- package/InputNumber/index.d.ts +74 -74
- package/InputNumber/index.js +308 -14
- package/Label/index.d.ts +35 -35
- package/Label/index.js +81 -14
- package/Loading/index.d.ts +17 -17
- package/Loading/index.js +47 -15
- package/Menu/footerExpansion.d.ts +9 -9
- package/Menu/index.d.ts +10 -10
- package/Menu/index.js +1232 -14
- package/Menu/interface.d.ts +139 -139
- package/Menu/logo.d.ts +9 -9
- package/Menu/verticalMenuList.d.ts +14 -14
- package/Message/index.d.ts +73 -59
- package/Message/index.js +222 -15
- package/Modal/Confirm/index.d.ts +65 -66
- package/Modal/index.d.ts +90 -61
- package/Modal/index.js +443 -14
- package/Modal/lang/en_US.d.ts +5 -5
- package/Modal/lang/index.d.ts +11 -11
- package/Modal/lang/zh_CN.d.ts +5 -5
- package/MultiBox/index.d.ts +54 -54
- package/MultiBox/index.js +231 -14
- package/Notification/index.d.ts +52 -52
- package/Notification/index.js +266 -15
- package/OperateBtn/index.d.ts +59 -59
- package/OperateBtn/index.js +260 -14
- package/OperateBtn/lang/en_US.d.ts +4 -4
- package/OperateBtn/lang/index.d.ts +9 -9
- package/OperateBtn/lang/zh_CN.d.ts +4 -4
- package/PageHeader/horizontalMeun.d.ts +9 -9
- package/PageHeader/horizontalMeunRight.d.ts +9 -9
- package/PageHeader/index.d.ts +10 -10
- package/PageHeader/index.js +1171 -14
- package/PageHeader/interface.d.ts +167 -167
- package/Pagination/index.d.ts +33 -33
- package/Pagination/index.js +469 -14
- package/Pagination/lang/en_US.d.ts +8 -8
- package/Pagination/lang/index.d.ts +17 -17
- package/Pagination/lang/zh_CN.d.ts +8 -8
- package/ParauiProvider/index.d.ts +8 -12
- package/ParauiProvider/index.js +53 -15
- package/PopConfirm/index.d.ts +58 -56
- package/PopConfirm/index.js +189 -14
- package/PopConfirm/lang/en_US.d.ts +5 -5
- package/PopConfirm/lang/index.d.ts +11 -11
- package/PopConfirm/lang/zh_CN.d.ts +5 -5
- package/Popover/index.d.ts +14 -14
- package/Popover/index.js +66 -15
- package/Progress/Line.d.ts +47 -47
- package/Progress/Steps.d.ts +17 -17
- package/Progress/index.d.ts +81 -81
- package/Progress/index.js +358 -20
- package/Progress/utils.d.ts +6 -6
- package/Querying/images/index.d.ts +3 -2
- package/Querying/index.d.ts +26 -26
- package/Querying/index.js +762 -14
- package/Querying/lang/en_US.d.ts +4 -4
- package/Querying/lang/index.d.ts +9 -9
- package/Querying/lang/zh_CN.d.ts +4 -4
- package/Radio/index.d.ts +38 -38
- package/Radio/index.js +94 -14
- package/RadioGroup/index.d.ts +47 -47
- package/RadioGroup/index.js +128 -14
- package/Search/index.d.ts +56 -56
- package/Search/index.js +220 -14
- package/Select/index.d.ts +86 -86
- package/Select/index.js +1288 -14
- package/Select/lang/en_US.d.ts +5 -5
- package/Select/lang/index.d.ts +11 -11
- package/Select/lang/zh_CN.d.ts +5 -5
- package/SelectInput/index.d.ts +11 -11
- package/SelectInput/index.js +51 -14
- package/SingleBox/index.d.ts +42 -42
- package/SingleBox/index.js +194 -14
- package/Slider/index.d.ts +14 -14
- package/Slider/index.js +125 -15
- package/Slider/interface.d.ts +102 -102
- package/Split/index.d.ts +7 -7
- package/Split/index.js +134 -15
- package/Stepper/icons.d.ts +5 -5
- package/Stepper/index.d.ts +49 -39
- package/Stepper/index.js +99 -15
- package/Switch/index.d.ts +78 -78
- package/Switch/index.js +73 -14
- package/Table/index.d.ts +10 -10
- package/Table/index.js +2725 -14
- package/Table/interface.d.ts +202 -202
- package/Table/lang/en_US.d.ts +6 -6
- package/Table/lang/index.d.ts +13 -13
- package/Table/lang/zh_CN.d.ts +6 -6
- package/Table/tableBody.d.ts +9 -9
- package/Table/tableBodyElement/index.d.ts +15 -15
- package/Table/tableBodyInterface.d.ts +67 -67
- package/Table/tableContainer/index.d.ts +16 -16
- package/Table/tableElement/index.d.ts +17 -17
- package/Table/tableHead.d.ts +9 -9
- package/Table/tableHeadElement/index.d.ts +15 -15
- package/Table/tableHeadInterface.d.ts +26 -30
- package/Table/tablePagination.d.ts +9 -9
- package/Table/tablePaginationInterFace.d.ts +24 -24
- package/Table/tdElement/index.d.ts +15 -15
- package/Table/thElement/index.d.ts +15 -15
- package/Table/trElement/index.d.ts +15 -15
- package/Table/util.d.ts +16 -16
- package/Tabs/index.d.ts +69 -48
- package/Tabs/index.js +218 -14
- 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 -66
- package/Tag/index.d.ts +34 -34
- package/Tag/index.js +286 -14
- package/Test/index.d.ts +3 -2
- package/Test/index.js +9 -16
- package/TextField/index.d.ts +93 -93
- package/TextField/index.js +686 -14
- package/TimePicker/index.d.ts +22 -22
- package/TimePicker/index.js +77 -14
- package/TimePicker/locale/en_US.d.ts +3 -3
- package/TimePicker/locale/zh_CN.d.ts +3 -3
- package/TimePicker/style/index.d.ts +1 -1
- package/Timeline/TimelineItem.d.ts +23 -0
- package/Timeline/index.d.ts +31 -22
- package/Timeline/index.js +150 -15
- package/ToggleButton/ToggleButtonGroup.d.ts +49 -49
- package/ToggleButton/index.d.ts +49 -49
- package/ToggleButton/index.js +200 -14
- package/Tooltip/index.d.ts +11 -14
- package/Tooltip/index.js +335 -15
- package/Tooltip/interface.d.ts +21 -0
- package/Tooltip/utils.d.ts +22 -0
- package/Transfer/index.d.ts +18 -17
- package/Transfer/index.js +343 -14
- package/Transfer/lang/en_US.d.ts +6 -6
- package/Transfer/lang/index.d.ts +13 -13
- package/Transfer/lang/zh_CN.d.ts +6 -6
- package/Tree/OperateBar/index.d.ts +13 -13
- package/Tree/Tree.d.ts +4 -4
- package/Tree/index.d.ts +5 -5
- package/Tree/index.js +35 -14
- package/Tree/interface.d.ts +209 -207
- package/Tree/lang/en_US.d.ts +8 -8
- package/Tree/lang/index.d.ts +17 -17
- package/Tree/lang/zh_CN.d.ts +8 -8
- package/Tree/utils/tools.d.ts +26 -26
- package/Tree/utils/treeUtil.d.ts +15 -15
- package/Upload/Dragger/index.d.ts +10 -10
- package/Upload/ErroTip/index.d.ts +13 -13
- package/Upload/ImageUpload/index.d.ts +14 -14
- package/Upload/ImgCrop/EasyCrop.d.ts +17 -17
- package/Upload/ImgCrop/constants.d.ts +7 -7
- package/Upload/ImgCrop/index.d.ts +6 -6
- package/Upload/ImgCrop/interface.d.ts +24 -24
- package/Upload/UploadList/index.d.ts +5 -5
- package/Upload/index.d.ts +15 -15
- package/Upload/index.js +1542 -14
- package/Upload/interface.d.ts +134 -134
- package/Upload/lang/en_US.d.ts +12 -12
- package/Upload/lang/index.d.ts +25 -25
- package/Upload/lang/zh_CN.d.ts +12 -12
- package/_verture/defineProperty-0590dc61.js +16 -0
- package/_verture/index-2c0ecd8d.js +778 -0
- package/_verture/index-342379c6.js +391 -0
- package/_verture/index-a369ca3f.js +4 -0
- package/_verture/index-e2881a53.js +16 -0
- package/_verture/index-ee85b1cd.js +1555 -0
- package/_verture/intl-336570e4.js +65 -0
- package/_verture/modalContext-e7cc8067.js +228 -0
- package/_verture/slicedToArray-d7722f4b.js +62 -0
- package/_verture/style-inject.es-300983ab.js +28 -0
- package/_verture/toConsumableArray-f8047a75.js +19 -0
- package/_verture/tslib.es6-55ed4bd2.js +38 -0
- package/_verture/typeof-498dd2b1.js +11 -0
- package/_verture/useFormatMessage-ac9d6acf.js +20 -0
- package/_verture/useGlobalProps-af9a2af6.js +12 -0
- package/index.d.ts +128 -128
- package/index.js +160 -19
- package/package.json +54 -21
- package/Popper/index.d.ts +0 -13
- package/Popper/index.js +0 -16
- package/README.md +0 -495
- package/cdn/AutoBox/index.js +0 -29
- package/cdn/AutoTips/index.js +0 -40
- package/cdn/Breadcrumbs/index.js +0 -53
- package/cdn/Button/index.js +0 -79
- package/cdn/ButtonGroup/index.js +0 -79
- package/cdn/Carousel/index.js +0 -6
- package/cdn/Cascader/index.js +0 -42
- package/cdn/Checkbox/index.js +0 -53
- package/cdn/CheckboxGroup/index.js +0 -53
- package/cdn/Collapse/index.js +0 -27
- package/cdn/CollapseBox/index.js +0 -1
- package/cdn/ColorPicker/index.js +0 -1
- package/cdn/ComboSelect/index.js +0 -438
- package/cdn/Container/index.js +0 -1
- package/cdn/DatePicker/index.js +0 -185
- package/cdn/Desktop/index.js +0 -24
- package/cdn/Drawer/index.js +0 -84
- package/cdn/Empty/index.js +0 -1
- package/cdn/Form/index.js +0 -477
- package/cdn/FormItem/index.js +0 -477
- package/cdn/FunctionModal/index.js +0 -144
- package/cdn/GlobalContext/index.js +0 -1
- package/cdn/Help/index.js +0 -53
- package/cdn/HelperText/index.js +0 -1
- package/cdn/InputLang/index.js +0 -144
- package/cdn/InputNumber/index.js +0 -118
- package/cdn/Label/index.js +0 -53
- package/cdn/Loading/index.js +0 -14
- package/cdn/Menu/index.js +0 -40
- package/cdn/Message/index.js +0 -53
- package/cdn/Modal/index.js +0 -144
- package/cdn/MultiBox/index.js +0 -131
- package/cdn/Notification/index.js +0 -66
- package/cdn/OperateBtn/index.js +0 -92
- package/cdn/PageHeader/index.js +0 -92
- package/cdn/Pagination/index.js +0 -214
- package/cdn/ParauiProvider/index.js +0 -9
- package/cdn/PopConfirm/index.js +0 -131
- package/cdn/Popover/index.js +0 -16
- package/cdn/Popper/index.js +0 -26
- package/cdn/Progress/index.js +0 -58
- package/cdn/Querying/index.js +0 -1
- package/cdn/Radio/index.js +0 -53
- package/cdn/RadioGroup/index.js +0 -53
- package/cdn/Search/index.js +0 -144
- package/cdn/Select/index.js +0 -131
- package/cdn/SelectInput/index.js +0 -131
- package/cdn/SingleBox/index.js +0 -131
- package/cdn/Slider/index.js +0 -16
- package/cdn/Split/index.js +0 -1
- package/cdn/Stepper/index.js +0 -154
- package/cdn/Switch/index.js +0 -71
- package/cdn/Table/index.js +0 -292
- package/cdn/Tabs/index.js +0 -165
- package/cdn/Tag/index.js +0 -27
- package/cdn/Test/index.js +0 -1
- package/cdn/TextField/index.js +0 -105
- package/cdn/TimePicker/index.js +0 -185
- package/cdn/Timeline/index.js +0 -16
- package/cdn/ToggleButton/index.js +0 -79
- package/cdn/Tooltip/index.js +0 -40
- package/cdn/Transfer/index.js +0 -170
- package/cdn/Tree/index.js +0 -170
- package/cdn/Upload/index.js +0 -252
- package/style.css +0 -72
package/Breadcrumbs/index.js
CHANGED
|
@@ -1,15 +1,227 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
t(7418);var n=t(8156),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,r,t){var n,i={},u=null,l=null;for(n in void 0!==t&&(u=""+t),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(l=r.ref),r)s.call(r,n)&&!c.hasOwnProperty(n)&&(i[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===i[n]&&(i[n]=r[n]);return{$$typeof:o,type:e,key:u,ref:l,props:i,_owner:a.current}}r.jsx=u,r.jsxs=u},5893:function(e,r,t){"use strict";e.exports=t(5251)},9271:function(e,r,t){var n=t(3379),o=t(2565);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},4047:function(e,r,t){var n=t(3379),o=t(4044);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},8939:function(e,r,t){var n=t(3379),o=t(5845);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},2310:function(e,r,t){var n=t(3379),o=t(9929);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},3379:function(e,r,t){"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(r){if(void 0===e[r]){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[r]=t}return e[r]}}(),a=[];function s(e){for(var r=-1,t=0;t<a.length;t++)if(a[t].identifier===e){r=t;break}return r}function c(e,r){for(var t={},n=[],o=0;o<e.length;o++){var i=e[o],c=r.base?i[0]+r.base:i[0],u=t[c]||0,l="".concat(c," ").concat(u);t[c]=u+1;var p=s(l),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:l,updater:v(d,r),references:1}),n.push(l)}return n}function u(e){var r=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=t.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){r.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(r);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(r)}return r}var l,p=(l=[],function(e,r){return l[e]=r,l.filter(Boolean).join("\n")});function d(e,r,t,n){var o=t?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=p(r,o);else{var i=document.createTextNode(o),a=e.childNodes;a[r]&&e.removeChild(a[r]),a.length?e.insertBefore(i,a[r]):e.appendChild(i)}}function f(e,r,t){var n=t.css,o=t.media,i=t.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var b=null,m=0;function v(e,r){var t,n,o;if(r.singleton){var i=m++;t=b||(b=u(r)),n=d.bind(null,t,i,!1),o=d.bind(null,t,i,!0)}else t=u(r),n=f.bind(null,t,r),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return n(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;n(e=r)}else o()}}e.exports=function(e,r){(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=o());var t=c(e=e||[],r);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<t.length;n++){var o=s(t[n]);a[o].references--}for(var i=c(e,r),u=0;u<t.length;u++){var l=s(t[u]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}t=i}}}},7839:function(e,r,t){"use strict";var n=t(5893),o=t(8156),i=t(7371),a=(t(9271),function(){return a=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},a.apply(this,arguments)});r.default=function(e){var r=e.children,t=e.arrow,s=void 0!==t&&t,c=e.placement,u=void 0===c?"bottom-start":c,l=e.tips,p=void 0===l?"":l,d=e.className,f=void 0===d?"":d,b=e.beyondText,m=void 0===b||b,v=e.interactive,h=void 0===v||v,y=e.style,g=(0,o.useRef)(),x=(0,o.useState)(""),j=x[0],w=x[1];(0,o.useEffect)((function(){w(p)}),[p]);var O;return(0,n.jsx)("div",a({ref:g,className:(O="paraui-auto-tips",f&&(O+=" "+f),O),onMouseOver:function(){var e="";g.current&&g.current.scrollWidth>g.current.offsetWidth&&(e=p||(m?g.current.innerText:r)),w(e)},style:y},{children:(0,n.jsx)(i.default,a({arrow:s,title:j,placement:u,interactive:h,boundariesElement:"viewport",className:"paraui-auto-tips-tooltip"},{children:(0,n.jsx)("div",a({className:"auto-tips-content"},{children:r}))}))}))}},7083:function(e,r,t){"use strict";var n=t(5893),o=t(670),i=(t(8939),function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)}),a=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};r.default=function(e){var r,t=e.className,s=e.children,c=e.classes,u=e.style,l=a(e,["className","children","classes","style"]);return(0,n.jsx)(o.Popover,i({style:i({zIndex:1300},u),className:(r="paraui-popover",t&&(r+=" "+t),r),classes:{paper:c?"paraui-popover-paper ".concat(c):"paraui-popover-paper"}},l,{children:s}))}},7371:function(e,r,t){"use strict";var n=t(5893),o=t(670),i=t(5744),a=t.n(i),s=(t(2310),function(){return s=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},s.apply(this,arguments)}),c=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};r.default=function(e){var r,t=e.placement,i=void 0===t?"top-start":t,u=e.className,l=e.arrow,p=void 0===l||l,d=e.PopperProps,f=e.boundariesElement,b=void 0===f?"scrollParent":f,m=c(e,["placement","className","arrow","PopperProps","boundariesElement"]),v=s(s({},e.classes),{popper:a()("paraui-tooltip",u,null===(r=e.classes)||void 0===r?void 0:r.popper,{"paraui-tooltip-left-right":(null==i?void 0:i.includes("left"))||(null==i?void 0:i.includes("right")),"paraui-tooltip-top-bottom":(null==i?void 0:i.includes("top"))||(null==i?void 0:i.includes("bottom"))})});return(0,n.jsx)(o.Tooltip,s({},m,{enterTouchDelay:0,arrow:p,placement:i,classes:v,PopperProps:s(s({},d),{modifiers:{preventOverflow:{boundariesElement:b}}})}))}},670:function(e){"use strict";e.exports=r},7037:function(e){"use strict";e.exports=n},8543:function(e){"use strict";e.exports=o},5744:function(e){"use strict";e.exports=t},8156:function(r){"use strict";r.exports=e}},a={};function s(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={id:e,exports:{}};return i[e](t,t.exports,s),t.exports}s.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(r,{a:r}),r},s.d=function(e,r){for(var t in r)s.o(r,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},s.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0;var c={};return function(){"use strict";s.r(c),s.d(c,{Breadcrumbs:function(){return p}});var e=s(5893),r=s(8156),t=s(7083),n=s(7839),o=s(7037),i=s.n(o),a=s(8543),u=(s(4047),function(){return u=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},u.apply(this,arguments)}),l=function(e,r,t){if(t||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))},p=function(o){var s=o.maxWidth,c=void 0===s?"":s,p=o.className,d=o.list,f=o.separator,b=void 0===f?"/":f,m=o.popoverClassName,v=o.isShrink,h=void 0===v||v,y=o.onClickItem,g=o.style,x=(0,r.useState)("breadcrumbs-"+(0,a.UUID)())[0],j=(0,r.useState)([]),w=j[0],O=j[1],S=(0,r.useState)(0),N=S[0],P=S[1],_=(0,r.useState)(!1),k=_[0],E=_[1],C=(0,r.useState)({})[0],M=(0,r.useRef)();(0,r.useEffect)((function(){setTimeout((function(){var e=document.querySelector("."+x);e&&P(e.offsetWidth)})),O(l([],d,!0))}),[d]),(0,r.useEffect)((function(){return h?(setTimeout((function(){T()})),window.addEventListener("resize",T)):window.removeEventListener("resize",T),function(){window.removeEventListener("resize",T)}}),[w,N,h]);var T=function(){if(!(d.length<=2||0===N)){var e=document.querySelector("."+x);if(e&&N)if(e.parentNode&&e.parentNode.offsetWidth>=N){if(!C.scroll)return;C.scroll=!1,O(l([],d,!0)),E(!1)}else{if(C.scroll)return;C.scroll=!0;var r=[];r.push(d[0]),r.push({more:"more-breadcrumbs"}),r.push(d[d.length-1]),O(l([],r,!0))}}},q=function(e){return function(){e.disabled||("more-breadcrumbs"===e.more?E(!0):y&&y(e))}},I=function(){E(!1)},R=function(){var e="paraui-breadcrumbs "+x;return h&&(e+=" paraui-breadcrumbs-shrink"),p&&(e+=" "+p),e},L=function(e,r,t){var n=" breadcrumbs-item";return r===t.length-1&&(n+=" current-breadcrumbs"),e.disabled?n+=" breadcrumbs-item-disabled":n+=" breadcrumbs-item-click",n},U=(0,r.useMemo)((function(){return k&&(0,e.jsx)(t.default,u({open:k,anchorEl:M.current,onClose:I,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:(n="paraui-breadcrumbs-popover",m&&(n+=" "+m),n)},{children:(0,e.jsx)("div",u({className:R()},{children:d.map((function(t,n){var o=d.length-1!==n;return(0,e.jsxs)(r.Fragment,{children:[(0,e.jsx)("div",u({onClick:q(t),className:L(t,n,d)},{children:t.label})),o&&(0,e.jsx)("div",u({className:"breadcrumbs-separator"},{children:b}))]},n)}))}))}));var n}),[k,M,b,d,m]),W=function(e){var r={};return c&&(r.maxWidth=c),e.maxWidth&&(r.maxWidth=e.maxWidth),r};return(0,e.jsxs)("div",u({className:R(),style:g,ref:M},{children:[w.map((function(t,o){var a=w.length-1!==o;return"more-breadcrumbs"===t.more?(0,e.jsxs)(r.Fragment,{children:[(0,e.jsx)("div",u({onClick:q(t),className:"more-breadcrumbs"},{children:(0,e.jsx)(i(),{})})),a&&(0,e.jsx)("div",u({className:"breadcrumbs-separator"},{children:b}))]},o):(0,e.jsxs)(r.Fragment,{children:[(0,e.jsx)("div",u({style:W(t),onClick:q(t),className:L(t,o,w)},{children:(0,e.jsx)(n.default,{children:t.label})})),a&&(0,e.jsx)("div",u({className:"breadcrumbs-separator"},{children:b}))]},o)})),U]}))};c.default=p}(),c}()}));
|
|
1
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-f8047a75.js';
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
3
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
|
|
5
|
+
import { Popover } from '../Popover/index.js';
|
|
6
|
+
import AutoTips from '../AutoTips/index.js';
|
|
7
|
+
import More from '@para-ui/icons/More';
|
|
8
|
+
import { UUID } from '@paraview/lib';
|
|
9
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
11
|
+
import '../Tooltip/index.js';
|
|
12
|
+
import 'rc-tooltip';
|
|
13
|
+
import 'rc-tooltip/lib/placements';
|
|
14
|
+
import 'clsx';
|
|
15
|
+
|
|
16
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n * @author linhd\n * @date 2021年10月25日 14:58:12\n * @description 面包屑\n */\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-breadcrumbs {\n display: inline-block;\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 line-height: 0;\n height: 17px;\n}\n.paraui-breadcrumbs.paraui-breadcrumbs-shrink {\n white-space: nowrap;\n}\n.paraui-breadcrumbs > div {\n display: inline-block;\n line-height: 17px;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div svg {\n font-size: 14px;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div span {\n display: inline-block;\n line-height: 0;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div .paraui-auto-tips {\n line-height: 0;\n}\n.paraui-breadcrumbs > div .paraui-auto-tips .auto-tips-content {\n line-height: 17px;\n}\n.paraui-breadcrumbs > div .paraui-auto-tips span {\n line-height: 17px;\n}\n.paraui-breadcrumbs > .breadcrumbs-separator {\n user-select: none;\n margin: 0 8px;\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click {\n cursor: pointer;\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover svg {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover span {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-disabled {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-breadcrumbs > .more-breadcrumbs {\n cursor: pointer;\n}\n.paraui-breadcrumbs > .current-breadcrumbs {\n color: rgba(46, 55, 67, 0.7);\n font-weight: 700;\n}\n\n.paraui-breadcrumbs-popover > .paraui-popover-content > .paraui-popover-inner {\n display: flex;\n align-items: center;\n height: 36px;\n line-height: 0;\n padding: 0 12px;\n}";
|
|
17
|
+
styleInject(css_248z);
|
|
18
|
+
|
|
19
|
+
var Breadcrumbs = function Breadcrumbs(props) {
|
|
20
|
+
var _props$maxWidth = props.maxWidth,
|
|
21
|
+
maxWidth = _props$maxWidth === void 0 ? '' : _props$maxWidth,
|
|
22
|
+
className = props.className,
|
|
23
|
+
list = props.list,
|
|
24
|
+
_props$separator = props.separator,
|
|
25
|
+
separator = _props$separator === void 0 ? '/' : _props$separator,
|
|
26
|
+
popoverClassName = props.popoverClassName,
|
|
27
|
+
_props$isShrink = props.isShrink,
|
|
28
|
+
isShrink = _props$isShrink === void 0 ? true : _props$isShrink,
|
|
29
|
+
onClickItem = props.onClickItem,
|
|
30
|
+
style = props.style;
|
|
31
|
+
|
|
32
|
+
var _useState = useState('breadcrumbs-' + UUID()),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
34
|
+
classStr = _useState2[0];
|
|
35
|
+
|
|
36
|
+
var _useState3 = useState([]),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
listCom = _useState4[0],
|
|
39
|
+
setListCom = _useState4[1];
|
|
40
|
+
|
|
41
|
+
var _useState5 = useState(0),
|
|
42
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
43
|
+
oneNum = _useState6[0],
|
|
44
|
+
setOneNum = _useState6[1];
|
|
45
|
+
|
|
46
|
+
var _useState7 = useState(false),
|
|
47
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
48
|
+
open = _useState8[0],
|
|
49
|
+
setOpen = _useState8[1];
|
|
50
|
+
|
|
51
|
+
var _useState9 = useState({}),
|
|
52
|
+
_useState10 = _slicedToArray(_useState9, 1),
|
|
53
|
+
constData = _useState10[0];
|
|
54
|
+
|
|
55
|
+
var ref = useRef();
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
setTimeout(function () {
|
|
58
|
+
var dom = document.querySelector('.' + classStr);
|
|
59
|
+
if (dom) setOneNum(dom.offsetWidth);
|
|
60
|
+
});
|
|
61
|
+
setListCom(_toConsumableArray(list));
|
|
62
|
+
}, [list]);
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
if (isShrink) {
|
|
65
|
+
setTimeout(function () {
|
|
66
|
+
changeSize();
|
|
67
|
+
});
|
|
68
|
+
window.addEventListener("resize", changeSize);
|
|
69
|
+
} else window.removeEventListener("resize", changeSize);
|
|
70
|
+
|
|
71
|
+
return function () {
|
|
72
|
+
window.removeEventListener("resize", changeSize);
|
|
73
|
+
};
|
|
74
|
+
}, [listCom, oneNum, isShrink]);
|
|
75
|
+
|
|
76
|
+
var changeSize = function changeSize() {
|
|
77
|
+
if (list.length <= 2 || oneNum === 0) return;
|
|
78
|
+
var refDom = document.querySelector('.' + classStr);
|
|
79
|
+
|
|
80
|
+
if (refDom && oneNum) {
|
|
81
|
+
if (refDom.parentNode && refDom.parentNode.offsetWidth >= oneNum) {
|
|
82
|
+
if (!constData.scroll) return;
|
|
83
|
+
constData.scroll = false;
|
|
84
|
+
setListCom(_toConsumableArray(list));
|
|
85
|
+
setOpen(false);
|
|
86
|
+
} else {
|
|
87
|
+
if (constData.scroll) return;
|
|
88
|
+
constData.scroll = true; // 滚动
|
|
89
|
+
|
|
90
|
+
var arr = [];
|
|
91
|
+
arr.push(list[0]);
|
|
92
|
+
arr.push({
|
|
93
|
+
more: 'more-breadcrumbs'
|
|
94
|
+
});
|
|
95
|
+
arr.push(list[list.length - 1]);
|
|
96
|
+
setListCom([].concat(arr));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}; // 点击菜单
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
var handleClick = function handleClick(item) {
|
|
103
|
+
return function () {
|
|
104
|
+
if (item.disabled) return;
|
|
105
|
+
|
|
106
|
+
if (item.more === 'more-breadcrumbs') {
|
|
107
|
+
setOpen(true);
|
|
108
|
+
} else {
|
|
109
|
+
if (onClickItem) onClickItem(item);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}; // 处理弹出框className
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
var popoverHandClass = function popoverHandClass() {
|
|
116
|
+
var str = 'paraui-breadcrumbs-popover';
|
|
117
|
+
if (popoverClassName) str += ' ' + popoverClassName;
|
|
118
|
+
return str;
|
|
119
|
+
}; // 关闭弹出菜单
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
var handleClose = function handleClose(bol) {
|
|
123
|
+
if (!bol) setOpen(false);
|
|
124
|
+
}; // 处理className
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
var handClass = function handClass() {
|
|
128
|
+
var str = 'paraui-breadcrumbs ' + classStr;
|
|
129
|
+
if (isShrink) str += ' paraui-breadcrumbs-shrink';
|
|
130
|
+
if (className) str += ' ' + className;
|
|
131
|
+
return str;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var handClassItem = function handClassItem(item, index, arr) {
|
|
135
|
+
var str = ' breadcrumbs-item';
|
|
136
|
+
if (index === arr.length - 1) str += ' current-breadcrumbs';
|
|
137
|
+
if (!item.disabled) str += ' breadcrumbs-item-click';else str += ' breadcrumbs-item-disabled';
|
|
138
|
+
return str;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
var popoverContent = function popoverContent() {
|
|
142
|
+
return jsx("div", Object.assign({
|
|
143
|
+
className: handClass()
|
|
144
|
+
}, {
|
|
145
|
+
children: list.map(function (item, index) {
|
|
146
|
+
var showSeparator = list.length - 1 !== index;
|
|
147
|
+
return jsxs(Fragment$1, {
|
|
148
|
+
children: [jsx("div", Object.assign({
|
|
149
|
+
onClick: handleClick(item),
|
|
150
|
+
className: handClassItem(item, index, list)
|
|
151
|
+
}, {
|
|
152
|
+
children: item.label
|
|
153
|
+
})), showSeparator && jsx("div", Object.assign({
|
|
154
|
+
className: "breadcrumbs-separator"
|
|
155
|
+
}, {
|
|
156
|
+
children: separator
|
|
157
|
+
}))]
|
|
158
|
+
}, index);
|
|
159
|
+
})
|
|
160
|
+
}));
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var handStyle = function handStyle(item) {
|
|
164
|
+
var obj = {};
|
|
165
|
+
if (maxWidth) obj.maxWidth = maxWidth;
|
|
166
|
+
if (item.maxWidth) obj.maxWidth = item.maxWidth;
|
|
167
|
+
return obj;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var handContent = function handContent() {
|
|
171
|
+
return jsx("div", Object.assign({
|
|
172
|
+
className: handClass(),
|
|
173
|
+
style: style,
|
|
174
|
+
ref: ref
|
|
175
|
+
}, {
|
|
176
|
+
children: listCom.map(function (item, index) {
|
|
177
|
+
var showSeparator = listCom.length - 1 !== index;
|
|
178
|
+
|
|
179
|
+
if (item.more === 'more-breadcrumbs') {
|
|
180
|
+
// 更多
|
|
181
|
+
return jsxs(Fragment$1, {
|
|
182
|
+
children: [jsx("div", Object.assign({
|
|
183
|
+
onClick: handleClick(item),
|
|
184
|
+
className: "more-breadcrumbs"
|
|
185
|
+
}, {
|
|
186
|
+
children: jsx(More, {})
|
|
187
|
+
})), showSeparator && jsx("div", Object.assign({
|
|
188
|
+
className: "breadcrumbs-separator"
|
|
189
|
+
}, {
|
|
190
|
+
children: separator
|
|
191
|
+
}))]
|
|
192
|
+
}, index);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return jsxs(Fragment$1, {
|
|
196
|
+
children: [jsx("div", Object.assign({
|
|
197
|
+
style: handStyle(item),
|
|
198
|
+
onClick: handleClick(item),
|
|
199
|
+
className: handClassItem(item, index, listCom)
|
|
200
|
+
}, {
|
|
201
|
+
children: jsx(AutoTips, {
|
|
202
|
+
children: item.label
|
|
203
|
+
})
|
|
204
|
+
})), showSeparator && jsx("div", Object.assign({
|
|
205
|
+
className: "breadcrumbs-separator"
|
|
206
|
+
}, {
|
|
207
|
+
children: separator
|
|
208
|
+
}))]
|
|
209
|
+
}, index);
|
|
210
|
+
})
|
|
211
|
+
}));
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
return jsx(Fragment, {
|
|
215
|
+
children: isShrink ? jsx(Popover, Object.assign({
|
|
216
|
+
placement: 'bottom-start',
|
|
217
|
+
visible: open,
|
|
218
|
+
content: popoverContent(),
|
|
219
|
+
onVisibleChange: handleClose,
|
|
220
|
+
overlayClassName: popoverHandClass()
|
|
221
|
+
}, {
|
|
222
|
+
children: handContent()
|
|
223
|
+
})) : handContent()
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export { Breadcrumbs, Breadcrumbs as default };
|
package/Button/SplitButton.d.ts
CHANGED
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Hanz
|
|
3
|
-
* @date 2021/8/4 上午10:22
|
|
4
|
-
* @description 分体式按钮组
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
style
|
|
36
|
-
|
|
37
|
-
popperClassName
|
|
38
|
-
|
|
39
|
-
popperStyle
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
* @param
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* @author Hanz
|
|
3
|
+
* @date 2021/8/4 上午10:22
|
|
4
|
+
* @description 分体式按钮组
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { ButtonProps } from '../Button';
|
|
8
|
+
import { Placement } from '../Dropdown';
|
|
9
|
+
import './index.scss';
|
|
10
|
+
interface Option {
|
|
11
|
+
/**
|
|
12
|
+
* 按钮文字
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* 按钮value
|
|
17
|
+
*/
|
|
18
|
+
value?: any;
|
|
19
|
+
/**
|
|
20
|
+
* 禁用按钮
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
[name: string]: any;
|
|
24
|
+
}
|
|
25
|
+
declare type GroupOption = Array<Option>;
|
|
26
|
+
export interface SplitButtonProps {
|
|
27
|
+
/**
|
|
28
|
+
* 分体式按钮文本
|
|
29
|
+
*/
|
|
30
|
+
buttonText?: React.ReactNode;
|
|
31
|
+
/** 按钮选项数组 */
|
|
32
|
+
options?: Option[] | GroupOption[];
|
|
33
|
+
/** cls */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** style */
|
|
36
|
+
style?: React.CSSProperties;
|
|
37
|
+
/** popperClassName */
|
|
38
|
+
popperClassName?: string;
|
|
39
|
+
/** popperStyle */
|
|
40
|
+
popperStyle?: React.CSSProperties;
|
|
41
|
+
/** 禁用按钮组 */
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/** 浮层位置 */
|
|
44
|
+
placement?: Placement;
|
|
45
|
+
/** button props */
|
|
46
|
+
buttonProps?: ButtonProps;
|
|
47
|
+
/**
|
|
48
|
+
* click callback
|
|
49
|
+
* @param option
|
|
50
|
+
* @param evt
|
|
51
|
+
*/
|
|
52
|
+
onClick?: (option: Option, evt?: React.MouseEvent<HTMLElement>) => void;
|
|
53
|
+
/**
|
|
54
|
+
* 自定义选项渲染
|
|
55
|
+
* @param option
|
|
56
|
+
*/
|
|
57
|
+
optionRender?: (option: Option) => React.ReactNode;
|
|
58
|
+
/** 图标按钮 */
|
|
59
|
+
iconButton?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export default function SplitButton(props: SplitButtonProps): JSX.Element;
|
|
62
|
+
export {};
|
package/Button/index.d.ts
CHANGED
|
@@ -1,56 +1,71 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Hanz
|
|
3
|
-
* @date 2021/8/4 上午10:21
|
|
4
|
-
* @description 按钮
|
|
5
|
-
*/
|
|
6
|
-
import React, { FunctionComponent } from 'react';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
size?: 'small' | 'medium' | 'large';
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @author Hanz
|
|
3
|
+
* @date 2021/8/4 上午10:21
|
|
4
|
+
* @description 按钮
|
|
5
|
+
*/
|
|
6
|
+
import React, { FunctionComponent } from 'react';
|
|
7
|
+
import { TooltipProps } from '../Tooltip';
|
|
8
|
+
import SplitButton from "./SplitButton";
|
|
9
|
+
import './index.scss';
|
|
10
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<any> {
|
|
11
|
+
variant?: 'contained' | 'outlined' | 'text';
|
|
12
|
+
/** 设置按钮载入状态 */
|
|
13
|
+
loading?: boolean | {
|
|
14
|
+
delay: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 禁用时提示文字 disabled 为true有效
|
|
18
|
+
*/
|
|
19
|
+
toolTipTitle?: NonNullable<React.ReactNode>;
|
|
20
|
+
/**
|
|
21
|
+
* tooltip props
|
|
22
|
+
*/
|
|
23
|
+
TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
|
|
24
|
+
/**
|
|
25
|
+
* 设置危险按钮
|
|
26
|
+
*/
|
|
27
|
+
danger?: boolean;
|
|
28
|
+
/** content */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/** 禁用 */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** 大小 */
|
|
33
|
+
size?: 'small' | 'medium' | 'large';
|
|
34
|
+
/** 后置图标 */
|
|
35
|
+
endIcon?: React.ReactNode;
|
|
36
|
+
/** 前置图标 */
|
|
37
|
+
startIcon?: React.ReactNode;
|
|
38
|
+
[name: string]: any;
|
|
39
|
+
}
|
|
40
|
+
export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
|
|
41
|
+
/** 按钮形状 */
|
|
42
|
+
variant?: 'contained' | 'outlined' | 'text';
|
|
43
|
+
size?: 'small' | 'medium' | 'large';
|
|
44
|
+
/** tooltip title */
|
|
45
|
+
toolTipTitle?: NonNullable<React.ReactNode>;
|
|
46
|
+
/** 设置按钮载入状态 */
|
|
47
|
+
loading?: boolean | {
|
|
48
|
+
delay: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* tooltip props
|
|
52
|
+
*/
|
|
53
|
+
TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
|
|
54
|
+
/**
|
|
55
|
+
* 设置危险按钮
|
|
56
|
+
*/
|
|
57
|
+
danger?: boolean;
|
|
58
|
+
/** 禁用 */
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** content */
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
[name: string]: any;
|
|
63
|
+
}
|
|
64
|
+
declare const InternalButton: FunctionComponent<ButtonProps>;
|
|
65
|
+
declare const IconButton: FunctionComponent<IconButtonProps>;
|
|
66
|
+
declare type mergedButtonType = typeof InternalButton & {
|
|
67
|
+
IconButton: typeof IconButton;
|
|
68
|
+
SplitButton: typeof SplitButton;
|
|
69
|
+
};
|
|
70
|
+
export declare const Button: mergedButtonType;
|
|
71
|
+
export default Button;
|