@aloudata/aloudata-design 0.2.5 → 0.3.0-beta.1
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/es/Avatar/index.d.ts +15 -0
- package/es/Avatar/index.js +33 -0
- package/es/Avatar/style/index.d.ts +2 -0
- package/es/Avatar/style/index.js +2 -0
- package/es/Avatar/style/index.less +34 -0
- package/es/Breadcrumb/index.d.ts +8 -0
- package/es/Breadcrumb/index.js +36 -0
- package/es/Breadcrumb/style/index.d.ts +2 -0
- package/es/Breadcrumb/style/index.js +2 -0
- package/es/Breadcrumb/style/index.less +28 -0
- package/es/Button/index.d.ts +4 -4
- package/es/Button/index.js +28 -23
- package/es/Button/style/index.less +158 -125
- package/es/Button/style/variables.less +60 -0
- package/es/Checkbox/style/index.less +16 -1
- package/es/ConfigProvider/index.d.ts +1 -0
- package/es/ConfigProvider/index.js +1 -0
- package/es/Dropdown/Button.js +1 -1
- package/es/Dropdown/style/index.less +41 -8
- package/es/Empty/image/Authority.d.ts +3 -0
- package/es/Empty/image/Authority.js +360 -0
- package/es/Empty/image/Dataspace.d.ts +3 -0
- package/es/Empty/image/Dataspace.js +271 -0
- package/es/Empty/image/Search.d.ts +3 -0
- package/es/Empty/image/Search.js +156 -0
- package/es/Empty/image/Simple.d.ts +3 -0
- package/es/Empty/image/Simple.js +20 -0
- package/es/Empty/image/Worksheet.d.ts +3 -0
- package/es/Empty/image/Worksheet.js +270 -0
- package/es/Empty/image/empty.d.ts +3 -0
- package/es/Empty/image/empty.js +139 -0
- package/es/Empty/index.d.ts +21 -5
- package/es/Empty/index.js +84 -54
- package/es/Empty/style/index.less +56 -11
- package/es/Icon/index.d.ts +2 -2
- package/es/Icon/index.js +10 -2
- package/es/Input/components/Group/index.d.ts +4 -2
- package/es/Input/components/Group/index.js +23 -1
- package/es/Input/components/Input/index.d.ts +1 -1
- package/es/Input/components/Input/index.js +12 -0
- package/es/Input/components/Password/index.d.ts +7 -1
- package/es/Input/components/Password/index.js +25 -3
- package/es/Input/style/index.less +278 -43
- package/es/InputNumber/index.d.ts +4 -0
- package/es/InputNumber/index.js +32 -0
- package/es/InputNumber/style/index.d.ts +2 -0
- package/es/InputNumber/style/index.js +2 -0
- package/es/InputNumber/style/index.less +152 -0
- package/es/Menu/Divider.d.ts +2 -1
- package/es/Menu/MenuItem.d.ts +2 -1
- package/es/Menu/SubMenu.d.ts +2 -1
- package/es/Menu/SubMenu.js +1 -1
- package/es/Menu/index.d.ts +2 -1
- package/es/Menu/style/index.less +0 -1
- package/es/Modal/index.d.ts +21 -0
- package/es/Modal/index.js +93 -0
- package/es/Modal/style/index.d.ts +2 -0
- package/es/Modal/style/index.js +2 -0
- package/es/Modal/style/index.less +206 -0
- package/es/Navigator/components/Header/index.d.ts +9 -0
- package/es/Navigator/components/Header/index.js +18 -0
- package/es/Navigator/components/Menu/index.d.ts +7 -13
- package/es/Navigator/components/Menu/index.js +26 -162
- package/es/Navigator/components/MenuItem/index.d.ts +21 -0
- package/es/Navigator/components/MenuItem/index.js +39 -0
- package/es/Navigator/index.d.ts +19 -8
- package/es/Navigator/index.js +6 -15
- package/es/Navigator/style/bg.png +0 -0
- package/es/Navigator/style/index.less +66 -176
- package/es/Popover/index.d.ts +5 -0
- package/es/Popover/index.js +22 -0
- package/es/Popover/style/index.d.ts +2 -0
- package/es/Popover/style/index.js +2 -0
- package/es/Popover/style/index.less +37 -0
- package/es/Radio/index.d.ts +2 -3
- package/es/Select/index.d.ts +36 -9
- package/es/Select/index.js +154 -7
- package/es/Select/rc-select/BaseSelect.d.ts +116 -0
- package/es/Select/rc-select/BaseSelect.js +641 -0
- package/es/Select/rc-select/OptGroup.d.ts +12 -0
- package/es/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
- package/es/Select/rc-select/Option.d.ts +14 -0
- package/es/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
- package/es/Select/rc-select/OptionList.d.ts +10 -0
- package/es/Select/rc-select/OptionList.js +401 -0
- package/es/Select/rc-select/Select.d.ts +109 -0
- package/es/Select/rc-select/Select.js +547 -0
- package/es/Select/rc-select/SelectContext.d.ts +20 -0
- package/es/Select/rc-select/SelectContext.js +4 -0
- package/es/Select/rc-select/SelectTrigger.d.ts +30 -0
- package/es/Select/rc-select/SelectTrigger.js +136 -0
- package/es/Select/rc-select/Selector/Input.d.ts +26 -0
- package/es/Select/rc-select/Selector/Input.js +114 -0
- package/es/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
- package/es/Select/rc-select/Selector/MultipleSelector.js +236 -0
- package/es/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
- package/es/Select/rc-select/Selector/SingleSelector.js +112 -0
- package/es/Select/rc-select/Selector/index.d.ts +80 -0
- package/es/Select/rc-select/Selector/index.js +194 -0
- package/es/Select/rc-select/TransBtn.d.ts +12 -0
- package/es/Select/rc-select/TransBtn.js +42 -0
- package/es/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
- package/es/Select/rc-select/hooks/useBaseProps.js +11 -0
- package/es/Select/rc-select/hooks/useCache.d.ts +7 -0
- package/es/Select/rc-select/hooks/useCache.js +49 -0
- package/es/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
- package/es/Select/rc-select/hooks/useDelayReset.js +50 -0
- package/es/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
- package/es/Select/rc-select/hooks/useFilterOptions.js +75 -0
- package/es/Select/rc-select/hooks/useId.d.ts +5 -0
- package/es/Select/rc-select/hooks/useId.js +47 -0
- package/es/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
- package/es/Select/rc-select/hooks/useLayoutEffect.js +17 -0
- package/es/Select/rc-select/hooks/useLock.d.ts +7 -0
- package/es/Select/rc-select/hooks/useLock.js +35 -0
- package/es/Select/rc-select/hooks/useOptions.d.ts +11 -0
- package/es/Select/rc-select/hooks/useOptions.js +53 -0
- package/es/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
- package/es/Select/rc-select/hooks/useRefFunc.js +15 -0
- package/es/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
- package/es/Select/rc-select/hooks/useSelectTriggerControl.js +40 -0
- package/es/Select/rc-select/index.d.ts +10 -0
- package/es/Select/rc-select/index.js +7 -0
- package/es/Select/rc-select/interface.d.ts +10 -0
- package/es/Select/{interface.js → rc-select/interface.js} +0 -0
- package/es/Select/rc-select/utils/commonUtil.d.ts +4 -0
- package/es/Select/rc-select/utils/commonUtil.js +12 -0
- package/es/Select/rc-select/utils/keyUtil.d.ts +2 -0
- package/es/Select/rc-select/utils/keyUtil.js +8 -0
- package/es/Select/rc-select/utils/legacyUtil.d.ts +3 -0
- package/es/Select/rc-select/utils/legacyUtil.js +58 -0
- package/es/Select/rc-select/utils/platformUtil.d.ts +1 -0
- package/es/Select/rc-select/utils/platformUtil.js +4 -0
- package/es/Select/rc-select/utils/valueUtil.d.ts +22 -0
- package/es/Select/rc-select/utils/valueUtil.js +157 -0
- package/es/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
- package/es/Select/rc-select/utils/warningPropsUtil.js +114 -0
- package/es/Select/style/index.d.ts +2 -0
- package/es/Select/style/index.js +4 -1
- package/es/Select/style/index.less +173 -494
- package/es/Select/style/multiple.less +222 -0
- package/es/Select/style/rtl.less +168 -0
- package/es/Select/style/select.less +337 -0
- package/es/Select/style/single.less +179 -0
- package/es/Select/style/status.less +48 -0
- package/es/Select/style/variables.less +56 -0
- package/es/Select/style/variables.less.d.ts +97 -0
- package/es/Select/utils/iconUtil.d.ts +24 -0
- package/es/Select/utils/iconUtil.js +87 -0
- package/es/Space/index.d.ts +1 -1
- package/es/Space/index.js +0 -1
- package/es/Table/Table.d.ts +6 -0
- package/es/Table/Table.js +464 -0
- package/es/Table/components/Empty/empty-img.png +0 -0
- package/es/Table/components/Empty/index.d.ts +4 -0
- package/es/Table/components/Empty/index.js +16 -0
- package/es/Table/components/Empty/index.less +24 -0
- package/es/Table/index.d.ts +2 -4
- package/es/Table/index.js +2 -463
- package/es/Table/interface.d.ts +11 -15
- package/es/Table/style/index.less +44 -21
- package/es/Tabs/style/index.less +39 -7
- package/es/Tooltip/style/index.less +1 -0
- package/es/index.d.ts +14 -2
- package/es/index.js +7 -1
- package/es/style/index.less +2 -1
- package/es/style/mixins/index.less +8 -0
- package/es/style/themes/default/index.less +1 -1
- package/es/style/themes/default/themeColor.module.less +58 -94
- package/es/style/themes/default/themeColor.module.less.d.ts +1 -17
- package/lib/Avatar/index.d.ts +15 -0
- package/lib/Avatar/index.js +57 -0
- package/lib/Avatar/style/index.d.ts +2 -0
- package/lib/Avatar/style/index.js +5 -0
- package/lib/Avatar/style/index.less +34 -0
- package/lib/Breadcrumb/index.d.ts +8 -0
- package/lib/Breadcrumb/index.js +50 -0
- package/lib/Breadcrumb/style/index.d.ts +2 -0
- package/lib/Breadcrumb/style/index.js +5 -0
- package/lib/Breadcrumb/style/index.less +28 -0
- package/lib/Button/index.d.ts +4 -4
- package/lib/Button/index.js +28 -24
- package/lib/Button/style/index.less +158 -125
- package/lib/Button/style/variables.less +60 -0
- package/lib/Checkbox/style/index.less +16 -1
- package/lib/ConfigProvider/index.d.ts +1 -0
- package/lib/ConfigProvider/index.js +26 -0
- package/lib/Dropdown/Button.js +1 -1
- package/lib/Dropdown/style/index.less +41 -8
- package/lib/Empty/image/Authority.d.ts +3 -0
- package/lib/Empty/image/Authority.js +374 -0
- package/lib/Empty/image/Dataspace.d.ts +3 -0
- package/lib/Empty/image/Dataspace.js +285 -0
- package/lib/Empty/image/Search.d.ts +3 -0
- package/lib/Empty/image/Search.js +170 -0
- package/lib/Empty/image/Simple.d.ts +3 -0
- package/lib/Empty/image/Simple.js +34 -0
- package/lib/Empty/image/Worksheet.d.ts +3 -0
- package/lib/Empty/image/Worksheet.js +284 -0
- package/lib/Empty/image/empty.d.ts +3 -0
- package/lib/Empty/image/empty.js +153 -0
- package/lib/Empty/index.d.ts +21 -5
- package/lib/Empty/index.js +94 -53
- package/lib/Empty/style/index.less +56 -11
- package/lib/Icon/index.d.ts +2 -2
- package/lib/Icon/index.js +10 -2
- package/lib/Input/components/Group/index.d.ts +4 -2
- package/lib/Input/components/Group/index.js +24 -1
- package/lib/Input/components/Input/index.d.ts +1 -1
- package/lib/Input/components/Input/index.js +13 -0
- package/lib/Input/components/Password/index.d.ts +7 -1
- package/lib/Input/components/Password/index.js +25 -2
- package/lib/Input/style/index.less +278 -43
- package/lib/InputNumber/index.d.ts +4 -0
- package/lib/InputNumber/index.js +45 -0
- package/lib/InputNumber/style/index.d.ts +2 -0
- package/lib/InputNumber/style/index.js +5 -0
- package/lib/InputNumber/style/index.less +152 -0
- package/lib/Menu/Divider.d.ts +2 -1
- package/lib/Menu/MenuItem.d.ts +2 -1
- package/lib/Menu/SubMenu.d.ts +2 -1
- package/lib/Menu/SubMenu.js +1 -1
- package/lib/Menu/index.d.ts +2 -1
- package/lib/Menu/style/index.less +0 -1
- package/lib/Modal/index.d.ts +21 -0
- package/lib/Modal/index.js +119 -0
- package/lib/Modal/style/index.d.ts +2 -0
- package/lib/Modal/style/index.js +5 -0
- package/lib/Modal/style/index.less +206 -0
- package/lib/Navigator/components/Header/index.d.ts +9 -0
- package/lib/Navigator/components/Header/index.js +28 -0
- package/lib/Navigator/components/Menu/index.d.ts +7 -13
- package/lib/Navigator/components/Menu/index.js +25 -162
- package/lib/Navigator/components/MenuItem/index.d.ts +21 -0
- package/lib/Navigator/components/MenuItem/index.js +56 -0
- package/lib/Navigator/index.d.ts +19 -8
- package/lib/Navigator/index.js +7 -15
- package/lib/Navigator/style/bg.png +0 -0
- package/lib/Navigator/style/index.less +66 -176
- package/lib/Popover/index.d.ts +5 -0
- package/lib/Popover/index.js +35 -0
- package/lib/Popover/style/index.d.ts +2 -0
- package/lib/Popover/style/index.js +5 -0
- package/lib/Popover/style/index.less +37 -0
- package/lib/Radio/index.d.ts +2 -3
- package/lib/Select/index.d.ts +36 -9
- package/lib/Select/index.js +166 -18
- package/lib/Select/rc-select/BaseSelect.d.ts +116 -0
- package/lib/Select/rc-select/BaseSelect.js +672 -0
- package/lib/Select/rc-select/OptGroup.d.ts +12 -0
- package/lib/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
- package/lib/Select/rc-select/Option.d.ts +14 -0
- package/lib/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
- package/lib/Select/rc-select/OptionList.d.ts +10 -0
- package/lib/Select/rc-select/OptionList.js +427 -0
- package/lib/Select/rc-select/Select.d.ts +109 -0
- package/lib/Select/rc-select/Select.js +545 -0
- package/lib/Select/rc-select/SelectContext.d.ts +20 -0
- package/lib/Select/rc-select/SelectContext.js +19 -0
- package/lib/Select/rc-select/SelectTrigger.d.ts +30 -0
- package/lib/Select/rc-select/SelectTrigger.js +153 -0
- package/lib/Select/rc-select/Selector/Input.d.ts +26 -0
- package/lib/Select/rc-select/Selector/Input.js +132 -0
- package/lib/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
- package/lib/Select/rc-select/Selector/MultipleSelector.js +257 -0
- package/lib/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
- package/lib/Select/rc-select/Selector/SingleSelector.js +129 -0
- package/lib/Select/rc-select/Selector/index.d.ts +80 -0
- package/lib/Select/rc-select/Selector/index.js +203 -0
- package/lib/Select/rc-select/TransBtn.d.ts +12 -0
- package/lib/Select/rc-select/TransBtn.js +59 -0
- package/lib/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
- package/lib/Select/rc-select/hooks/useBaseProps.js +28 -0
- package/lib/Select/rc-select/hooks/useCache.d.ts +7 -0
- package/lib/Select/rc-select/hooks/useCache.js +63 -0
- package/lib/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useDelayReset.js +62 -0
- package/lib/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
- package/lib/Select/rc-select/hooks/useFilterOptions.js +91 -0
- package/lib/Select/rc-select/hooks/useId.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useId.js +68 -0
- package/lib/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useLayoutEffect.js +32 -0
- package/lib/Select/rc-select/hooks/useLock.d.ts +7 -0
- package/lib/Select/rc-select/hooks/useLock.js +49 -0
- package/lib/Select/rc-select/hooks/useOptions.d.ts +11 -0
- package/lib/Select/rc-select/hooks/useOptions.js +68 -0
- package/lib/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
- package/lib/Select/rc-select/hooks/useRefFunc.js +29 -0
- package/lib/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
- package/lib/Select/rc-select/hooks/useSelectTriggerControl.js +54 -0
- package/lib/Select/rc-select/index.d.ts +10 -0
- package/lib/Select/rc-select/index.js +45 -0
- package/lib/Select/rc-select/interface.d.ts +10 -0
- package/lib/Select/{interface.js → rc-select/interface.js} +0 -0
- package/lib/Select/rc-select/utils/commonUtil.d.ts +4 -0
- package/lib/Select/rc-select/utils/commonUtil.js +23 -0
- package/lib/Select/rc-select/utils/keyUtil.d.ts +2 -0
- package/lib/Select/rc-select/utils/keyUtil.js +17 -0
- package/lib/Select/rc-select/utils/legacyUtil.d.ts +3 -0
- package/lib/Select/rc-select/utils/legacyUtil.js +73 -0
- package/lib/Select/rc-select/utils/platformUtil.d.ts +1 -0
- package/lib/Select/rc-select/utils/platformUtil.js +11 -0
- package/lib/Select/rc-select/utils/valueUtil.d.ts +22 -0
- package/lib/Select/rc-select/utils/valueUtil.js +172 -0
- package/lib/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
- package/lib/Select/rc-select/utils/warningPropsUtil.js +132 -0
- package/lib/Select/style/index.d.ts +2 -0
- package/lib/Select/style/index.js +4 -0
- package/lib/Select/style/index.less +173 -494
- package/lib/Select/style/multiple.less +222 -0
- package/lib/Select/style/rtl.less +168 -0
- package/lib/Select/style/select.less +337 -0
- package/lib/Select/style/single.less +179 -0
- package/lib/Select/style/status.less +48 -0
- package/lib/Select/style/variables.less +56 -0
- package/lib/Select/style/variables.less.d.ts +97 -0
- package/lib/Select/utils/iconUtil.d.ts +24 -0
- package/lib/Select/utils/iconUtil.js +109 -0
- package/lib/Space/index.d.ts +1 -1
- package/lib/Space/index.js +0 -6
- package/lib/Table/Table.d.ts +6 -0
- package/lib/Table/Table.js +491 -0
- package/lib/Table/components/Empty/empty-img.png +0 -0
- package/lib/Table/components/Empty/index.d.ts +4 -0
- package/lib/Table/components/Empty/index.js +30 -0
- package/lib/Table/components/Empty/index.less +24 -0
- package/lib/Table/index.d.ts +2 -4
- package/lib/Table/index.js +2 -478
- package/lib/Table/interface.d.ts +11 -15
- package/lib/Table/style/index.less +44 -21
- package/lib/Tabs/style/index.less +39 -7
- package/lib/Tooltip/style/index.less +1 -0
- package/lib/index.d.ts +14 -2
- package/lib/index.js +48 -0
- package/lib/style/index.less +2 -1
- package/lib/style/mixins/index.less +8 -0
- package/lib/style/themes/default/index.less +1 -1
- package/lib/style/themes/default/themeColor.module.less +58 -94
- package/lib/style/themes/default/themeColor.module.less.d.ts +1 -17
- package/package.json +3 -2
- package/es/Select/BaseSelect.d.ts +0 -5
- package/es/Select/BaseSelect.js +0 -413
- package/es/Select/OptionsList/OptGroup.d.ts +0 -7
- package/es/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
- package/es/Select/OptionsList/OptionItem/RenderGroup.js +0 -16
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
- package/es/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -45
- package/es/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
- package/es/Select/OptionsList/OptionItem/RenderOption.js +0 -79
- package/es/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
- package/es/Select/OptionsList/OptionItem/RenderTooltip.js +0 -25
- package/es/Select/OptionsList/OptionItem.d.ts +0 -4
- package/es/Select/OptionsList/OptionItem.js +0 -4
- package/es/Select/OptionsList/Options.d.ts +0 -7
- package/es/Select/OptionsList/index.d.ts +0 -4
- package/es/Select/OptionsList/index.js +0 -176
- package/es/Select/Selector/index.d.ts +0 -4
- package/es/Select/Selector/index.js +0 -252
- package/es/Select/VirtualList.d.ts +0 -5
- package/es/Select/VirtualList.js +0 -29
- package/es/Select/hooks/useCacheOption.d.ts +0 -9
- package/es/Select/hooks/useCacheOption.js +0 -107
- package/es/Select/interface.d.ts +0 -235
- package/es/Select/utils.d.ts +0 -21
- package/es/Select/utils.js +0 -193
- package/lib/Select/BaseSelect.d.ts +0 -5
- package/lib/Select/BaseSelect.js +0 -446
- package/lib/Select/OptionsList/OptGroup.d.ts +0 -7
- package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
- package/lib/Select/OptionsList/OptionItem/RenderGroup.js +0 -27
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
- package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -60
- package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
- package/lib/Select/OptionsList/OptionItem/RenderOption.js +0 -94
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
- package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +0 -37
- package/lib/Select/OptionsList/OptionItem.d.ts +0 -4
- package/lib/Select/OptionsList/OptionItem.js +0 -39
- package/lib/Select/OptionsList/Options.d.ts +0 -7
- package/lib/Select/OptionsList/index.d.ts +0 -4
- package/lib/Select/OptionsList/index.js +0 -195
- package/lib/Select/Selector/index.d.ts +0 -4
- package/lib/Select/Selector/index.js +0 -276
- package/lib/Select/VirtualList.d.ts +0 -5
- package/lib/Select/VirtualList.js +0 -42
- package/lib/Select/hooks/useCacheOption.d.ts +0 -9
- package/lib/Select/hooks/useCacheOption.js +0 -113
- package/lib/Select/interface.d.ts +0 -235
- package/lib/Select/utils.d.ts +0 -21
- package/lib/Select/utils.js +0 -233
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import "antd/es/modal/style";
|
|
2
|
+
import _Modal from "antd/es/modal";
|
|
3
|
+
var _excluded = ["className", "children", "forbidBodyScroll", "footer", "okText", "cancelText", "onOk", "onCancel", "width", "closeIcon"];
|
|
4
|
+
|
|
5
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import useModal from 'antd/lib/modal/useModal/index';
|
|
11
|
+
import confirm, { withWarn, withInfo, withSuccess, withError, withConfirm, modalGlobalConfig } from 'antd/lib/modal/confirm';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
import Button from '../Button';
|
|
14
|
+
import Icon from '../Icon';
|
|
15
|
+
export var destroyFns = [];
|
|
16
|
+
|
|
17
|
+
function modalWarn(props) {
|
|
18
|
+
return confirm(withWarn(props));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var DEFAULT_WIDTH = 552;
|
|
22
|
+
|
|
23
|
+
var OriginModal = function OriginModal(props) {
|
|
24
|
+
var className = props.className,
|
|
25
|
+
children = props.children,
|
|
26
|
+
forbidBodyScroll = props.forbidBodyScroll,
|
|
27
|
+
footer = props.footer,
|
|
28
|
+
okText = props.okText,
|
|
29
|
+
cancelText = props.cancelText,
|
|
30
|
+
onOk = props.onOk,
|
|
31
|
+
onCancel = props.onCancel,
|
|
32
|
+
width = props.width,
|
|
33
|
+
closeIcon = props.closeIcon,
|
|
34
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
35
|
+
|
|
36
|
+
var Footer = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
size: "large",
|
|
38
|
+
onClick: onCancel
|
|
39
|
+
}, cancelText || '取消'), /*#__PURE__*/React.createElement(Button, {
|
|
40
|
+
type: "primary",
|
|
41
|
+
size: "large",
|
|
42
|
+
onClick: onOk
|
|
43
|
+
}, okText || '确定'));
|
|
44
|
+
return /*#__PURE__*/React.createElement(_Modal, Object.assign({}, restProps, {
|
|
45
|
+
onCancel: onCancel,
|
|
46
|
+
footer: footer !== undefined ? footer : Footer,
|
|
47
|
+
className: classNames('ald-modal', className),
|
|
48
|
+
width: width || DEFAULT_WIDTH,
|
|
49
|
+
closeIcon: closeIcon || /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
size: "small",
|
|
51
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
52
|
+
type: "close",
|
|
53
|
+
size: 12
|
|
54
|
+
}),
|
|
55
|
+
className: "ald-modal-close"
|
|
56
|
+
})
|
|
57
|
+
}), children);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
OriginModal.useModal = useModal;
|
|
61
|
+
var Modal = OriginModal;
|
|
62
|
+
|
|
63
|
+
Modal.info = function infoFn(props) {
|
|
64
|
+
return confirm(withInfo(props));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
Modal.success = function successFn(props) {
|
|
68
|
+
return confirm(withSuccess(props));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
Modal.error = function errorFn(props) {
|
|
72
|
+
return confirm(withError(props));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
Modal.warning = modalWarn;
|
|
76
|
+
Modal.warn = modalWarn;
|
|
77
|
+
|
|
78
|
+
Modal.confirm = function confirmFn(props) {
|
|
79
|
+
return confirm(withConfirm(props));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
Modal.destroyAll = function destroyAllFn() {
|
|
83
|
+
while (destroyFns.length) {
|
|
84
|
+
var close = destroyFns.pop();
|
|
85
|
+
|
|
86
|
+
if (close) {
|
|
87
|
+
close();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
Modal.config = modalGlobalConfig;
|
|
93
|
+
export default Modal;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
2
|
+
@import '../../Button/style/variables.less';
|
|
3
|
+
|
|
4
|
+
.ald-modal {
|
|
5
|
+
.ant-modal-content {
|
|
6
|
+
border-radius: 12px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ald-modal-close {
|
|
10
|
+
position: relative;
|
|
11
|
+
top: -4px;
|
|
12
|
+
left: -10px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ant-modal-header {
|
|
16
|
+
padding: 24px 36px;
|
|
17
|
+
border-bottom-width: 0;
|
|
18
|
+
border-radius: 12px 12px 0 0;
|
|
19
|
+
|
|
20
|
+
.ant-modal-title {
|
|
21
|
+
width: 95%;
|
|
22
|
+
color: @NL0;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
font-size: 20px;
|
|
25
|
+
font-family: 'PingFang SC', sans-serif;
|
|
26
|
+
font-style: normal;
|
|
27
|
+
line-height: 28px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ant-modal-body {
|
|
32
|
+
padding: 16px 36px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ant-modal-footer {
|
|
36
|
+
padding: 16px 24px;
|
|
37
|
+
background-color: @BG95;
|
|
38
|
+
border-top-width: 0;
|
|
39
|
+
border-radius: 0 0 12px 12px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ant-modal-confirm {
|
|
44
|
+
.ant-modal-content {
|
|
45
|
+
border-radius: 12px;
|
|
46
|
+
|
|
47
|
+
.ant-modal-body {
|
|
48
|
+
padding: 24px 24px 16px 36px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ant-modal-confirm-body {
|
|
53
|
+
& > .anticon {
|
|
54
|
+
width: 24px;
|
|
55
|
+
height: 24px;
|
|
56
|
+
margin-right: 12px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ant-modal-confirm-title {
|
|
60
|
+
color: @NL0;
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
font-family: 'PingFang SC', sans-serif;
|
|
64
|
+
font-style: normal;
|
|
65
|
+
line-height: 24px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ant-modal-confirm-content {
|
|
69
|
+
margin-top: 12px;
|
|
70
|
+
color: @NL0;
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
font-family: 'PingFang SC', sans-serif;
|
|
74
|
+
font-style: normal;
|
|
75
|
+
line-height: 20px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.anticon-info-circle {
|
|
79
|
+
background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAwQzUuMzcyNTggMCAwIDUuMzcyNTggMCAxMkMwIDE4LjYyNzQgNS4zNzI1OCAyNCAxMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMFpNMTIgMTlDMTEuNDQ3OCAxOSAxMSAxOC41NTIzIDExIDE4TDExIDEwLjVDMTEgOS45NDc2OSAxMS40NDc4IDkuNDk5O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MDUyMyAxMi41NTIzIDE0LjUgMTIgMTQuNUMxMS40NDc4IDE0LjUgMTEgMTQuMDUyMyAxMSAxMy41VjUuOTk5OTdDMTEgNS40NDc2OSAxMS40NDc4IDQuOTk5OTcgMTIgNC45OTk5N1pNMTEgMTcuNUMxMSAxNy4yMjM4IDExLjIyMzkgMTcgMTEuNSAxN0gxMi41QzEyLjc3NjIgMTcgMTMgMTcuMjIzOCAxMyAxNy41VjE4LjVDMTMgMTguNzc2MSAxMi43NzYyIDE5IDEyLjUgMTlIMTEuNUMxMS4yMjM5IDE5IDExIDE4Ljc3NjEgMTEgMTguNVYxNy41WiIgZmlsbD0iI0ZGQzIyOSIvPgo8L3N2Zz4K');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
svg {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 简装组件的场景下,以下样式先直接替换,后续精装在讨论方案
|
|
101
|
+
:is(.ant-modal-confirm-info, .ant-modal-confirm-success, .ant-modal-confirm-error, .ant-modal-confirm-warning, .ant-modal-confirm-confirm) {
|
|
102
|
+
.ant-modal-confirm-btns {
|
|
103
|
+
.ant-btn {
|
|
104
|
+
padding: @Button-padding;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ant-btn-default {
|
|
108
|
+
padding: @Button-border-padding;
|
|
109
|
+
color: @Button-secondary-color;
|
|
110
|
+
background-color: @Button-secondary-bgColor;
|
|
111
|
+
border: 1px solid;
|
|
112
|
+
border-color: @Button-secondary-borderColor;
|
|
113
|
+
box-shadow: none;
|
|
114
|
+
|
|
115
|
+
&:focus {
|
|
116
|
+
color: @Button-secondary-color;
|
|
117
|
+
background-color: @Button-secondary-bgColor;
|
|
118
|
+
border-color: @Button-secondary-borderColor-active;
|
|
119
|
+
box-shadow: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:hover,
|
|
123
|
+
&:active {
|
|
124
|
+
color: @Button-secondary-color-active;
|
|
125
|
+
background-color: @Button-secondary-bgColor-active;
|
|
126
|
+
border-color: @Button-secondary-borderColor-active;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&[disabled],
|
|
130
|
+
&.ant-btn-loading {
|
|
131
|
+
color: @Button-secondary-color-disable;
|
|
132
|
+
background-color: @Button-secondary-bgColor-disable;
|
|
133
|
+
border-color: @Button-secondary-borderColor;
|
|
134
|
+
cursor: default;
|
|
135
|
+
|
|
136
|
+
&:hover,
|
|
137
|
+
&:focus,
|
|
138
|
+
&:active {
|
|
139
|
+
color: @Button-secondary-color-disable;
|
|
140
|
+
background-color: @Button-secondary-bgColor-disable;
|
|
141
|
+
border-color: @Button-secondary-borderColor;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ant-btn-primary {
|
|
147
|
+
min-width: auto;
|
|
148
|
+
height: @Button-height-middle;
|
|
149
|
+
color: @Button-primary-color;
|
|
150
|
+
font-size: @Button-text-size-middle;
|
|
151
|
+
line-height: @Button-text-size-middle;
|
|
152
|
+
background-color: @Button-primary-bgColor;
|
|
153
|
+
border-color: @Button-primary-bgColor;
|
|
154
|
+
border-radius: @Button-borderRadius-middle;
|
|
155
|
+
box-shadow: none;
|
|
156
|
+
|
|
157
|
+
&:focus {
|
|
158
|
+
//text-shadow: @text-shadow;
|
|
159
|
+
color: @Button-primary-color;
|
|
160
|
+
background-color: @Button-primary-bgColor;
|
|
161
|
+
border-color: @Button-primary-bgColor;
|
|
162
|
+
box-shadow: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:hover,
|
|
166
|
+
&:active {
|
|
167
|
+
color: @Button-primary-color-active;
|
|
168
|
+
background-color: @Button-primary-bgColor-active;
|
|
169
|
+
border-color: @Button-primary-bgColor-active;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&.ant-btn-loading,
|
|
173
|
+
&[disabled] {
|
|
174
|
+
color: @Button-primary-color-disable;
|
|
175
|
+
background-color: @Button-primary-bgColor-disable;
|
|
176
|
+
border-color: @Button-primary-bgColor-disable;
|
|
177
|
+
cursor: default;
|
|
178
|
+
|
|
179
|
+
&:hover,
|
|
180
|
+
&:focus,
|
|
181
|
+
&:active {
|
|
182
|
+
color: @Button-primary-color-disable;
|
|
183
|
+
background-color: @Button-primary-bgColor-disable;
|
|
184
|
+
border-color: @Button-primary-bgColor-disable;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.ant-btn-lg {
|
|
190
|
+
min-width: auto;
|
|
191
|
+
height: @Button-height-large;
|
|
192
|
+
font-size: @Button-text-size-large;
|
|
193
|
+
line-height: @Button-text-size-large;
|
|
194
|
+
border-radius: @Button-borderRadius-large;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ant-btn-sm {
|
|
198
|
+
height: @Button-height-small;
|
|
199
|
+
font-size: @Button-text-size-small;
|
|
200
|
+
line-height: 22px;
|
|
201
|
+
border-radius: @Button-borderRadius-small;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// 简装组件的场景下,以上样式先直接替换,后续精装在讨论方案
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
function Header(props) {
|
|
4
|
+
var logoSrc = props.logoSrc;
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
className: "ald-nav-header"
|
|
7
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "ald-nav-header-content"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
10
|
+
src: logoSrc,
|
|
11
|
+
alt: "",
|
|
12
|
+
className: "ald-nav-logo-img"
|
|
13
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "ald-nav-header-select"
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default Header;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IMenuItem } from '../MenuItem';
|
|
3
|
+
export type { IMenuItem } from '../MenuItem';
|
|
4
|
+
interface IMenuProps {
|
|
5
|
+
menuList: IMenuItem[];
|
|
6
|
+
selectedKey: string;
|
|
3
7
|
onMenuSelect?: (menuInfo: {
|
|
4
8
|
key: string;
|
|
5
9
|
path: string;
|
|
6
10
|
}) => void;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
interface IMenuProps {
|
|
9
|
-
menuList: IMenuItem[];
|
|
10
|
-
selectedKey: string;
|
|
11
|
-
}
|
|
12
|
-
export interface IMenuItem {
|
|
13
|
-
title: string;
|
|
14
|
-
key: string;
|
|
15
|
-
path: string;
|
|
16
|
-
icon?: React.ReactNode;
|
|
17
|
-
children?: Omit<IMenuItem, 'children'>[];
|
|
18
11
|
}
|
|
12
|
+
declare function Menu(props: IMenuProps): JSX.Element;
|
|
19
13
|
export default Menu;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
2
|
|
|
9
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -16,172 +10,42 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
16
10
|
|
|
17
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
12
|
|
|
19
|
-
import React, {
|
|
20
|
-
import
|
|
21
|
-
import Icon from '../../../Icon';
|
|
13
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
14
|
+
import MenuItem from '../MenuItem';
|
|
22
15
|
|
|
23
16
|
function Menu(props) {
|
|
24
17
|
var menuList = props.menuList,
|
|
25
18
|
selectedKey = props.selectedKey,
|
|
26
|
-
onMenuSelect = props.onMenuSelect
|
|
19
|
+
_props$onMenuSelect = props.onMenuSelect,
|
|
20
|
+
onMenuSelectCallback = _props$onMenuSelect === void 0 ? function () {} : _props$onMenuSelect;
|
|
27
21
|
|
|
28
|
-
var
|
|
29
|
-
return getFlattenMenuByKey(menuList);
|
|
30
|
-
}, [menuList]),
|
|
31
|
-
flattenMenuByMenuKey = _useMemo.flattenMenuByMenuKey;
|
|
32
|
-
|
|
33
|
-
var _useState = useState(''),
|
|
22
|
+
var _useState = useState(selectedKey),
|
|
34
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _useState3 = useState(''),
|
|
40
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
-
currentSelectedKey = _useState4[0],
|
|
42
|
-
setCurrentSelectedKey = _useState4[1]; // 当前选中的菜单项
|
|
24
|
+
currentSelectKey = _useState2[0],
|
|
25
|
+
setCurrentSelectKey = _useState2[1];
|
|
43
26
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (isOpen) {
|
|
49
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
50
|
-
type: "arrow_drop_up",
|
|
51
|
-
size: 20,
|
|
52
|
-
className: "ald-nav-menu-icon-right"
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
57
|
-
type: "arrow_drop_down",
|
|
58
|
-
size: 20,
|
|
59
|
-
className: "ald-nav-menu-icon-right"
|
|
60
|
-
});
|
|
61
|
-
}, []);
|
|
27
|
+
var onMenuSelect = useCallback(function (menuInfo) {
|
|
28
|
+
setCurrentSelectKey(menuInfo.key);
|
|
29
|
+
onMenuSelectCallback(menuInfo);
|
|
30
|
+
}, [onMenuSelectCallback]);
|
|
62
31
|
useEffect(function () {
|
|
63
|
-
|
|
32
|
+
setCurrentSelectKey(selectedKey);
|
|
64
33
|
}, [selectedKey]);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
key: key,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}, [flattenMenuByMenuKey, onMenuSelect]);
|
|
79
|
-
/**
|
|
80
|
-
* 根据当前选中的菜单项,设置展开的菜单项
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
useEffect(function () {
|
|
84
|
-
var _flattenMenuByMenuKey;
|
|
85
|
-
|
|
86
|
-
setOpenKey(((_flattenMenuByMenuKey = flattenMenuByMenuKey[currentSelectedKey]) === null || _flattenMenuByMenuKey === void 0 ? void 0 : _flattenMenuByMenuKey.openKey) || '');
|
|
87
|
-
}, [currentSelectedKey, flattenMenuByMenuKey, onMenuSelect]);
|
|
88
|
-
/**
|
|
89
|
-
* 父级菜单点击
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
var onSupMenuClick = useCallback(function (key) {
|
|
93
|
-
if (key === openKey) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
var FIRST_INDEX = 0;
|
|
98
|
-
var firstChildrenKey = flattenMenuByMenuKey[key].children[FIRST_INDEX].key;
|
|
99
|
-
setCurrentSelectedKey(firstChildrenKey);
|
|
100
|
-
onMenuChange(firstChildrenKey);
|
|
101
|
-
}, [flattenMenuByMenuKey, openKey, onMenuChange]);
|
|
102
|
-
/**
|
|
103
|
-
* 子级菜单项或者一级菜单点击
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
var onMenuItemClick = useCallback(function (key) {
|
|
107
|
-
if (key === currentSelectedKey) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
setCurrentSelectedKey(key);
|
|
112
|
-
onMenuChange(key);
|
|
113
|
-
}, [currentSelectedKey, onMenuChange]);
|
|
114
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className: "ald-nav-menu-wrap"
|
|
116
|
-
}, /*#__PURE__*/React.createElement(AntdMenu, {
|
|
117
|
-
selectedKeys: [currentSelectedKey],
|
|
118
|
-
expandIcon: renderExpandIcon,
|
|
119
|
-
openKeys: [openKey],
|
|
120
|
-
mode: "inline",
|
|
121
|
-
style: {
|
|
122
|
-
padding: '0 12px'
|
|
123
|
-
}
|
|
124
|
-
}, Array.isArray(menuList) && menuList.map(function (item) {
|
|
125
|
-
if (item.children) {
|
|
126
|
-
return /*#__PURE__*/React.createElement(AntdMenu.SubMenu, {
|
|
127
|
-
key: item.key,
|
|
128
|
-
icon: item.icon,
|
|
129
|
-
title: item.title,
|
|
130
|
-
onTitleClick: function onTitleClick() {
|
|
131
|
-
return onSupMenuClick(item.key);
|
|
132
|
-
}
|
|
133
|
-
}, item.children.map(function (subItem) {
|
|
134
|
-
return /*#__PURE__*/React.createElement(AntdMenu.Item, {
|
|
135
|
-
onClick: function onClick() {
|
|
136
|
-
return onMenuItemClick(subItem.key);
|
|
137
|
-
},
|
|
138
|
-
key: subItem.key
|
|
139
|
-
}, subItem.title);
|
|
34
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, Array.isArray(menuList) && menuList.map(function (item, index) {
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "ald-nav-group",
|
|
37
|
+
key: "".concat(String(index), "_key")
|
|
38
|
+
}, item.groupTitle && /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: "ald-nav-group-title"
|
|
40
|
+
}, item.groupTitle), item.children.map(function (data) {
|
|
41
|
+
return /*#__PURE__*/React.createElement(MenuItem, Object.assign({}, data, {
|
|
42
|
+
key: data.key,
|
|
43
|
+
menuItemKey: data.key,
|
|
44
|
+
selectedKey: currentSelectKey,
|
|
45
|
+
onMenuSelect: onMenuSelect
|
|
140
46
|
}));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return /*#__PURE__*/React.createElement(AntdMenu.Item, {
|
|
144
|
-
key: item.key,
|
|
145
|
-
icon: item.icon,
|
|
146
|
-
onClick: function onClick() {
|
|
147
|
-
return onMenuItemClick(item.key);
|
|
148
|
-
}
|
|
149
|
-
}, item.title);
|
|
150
|
-
})));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function getFlattenMenuByKey(menuList) {
|
|
154
|
-
var flattenMenuByMenuKey = {};
|
|
155
|
-
var menuKeys = []; // 存储所有的key 用来判断是否有重复的key
|
|
156
|
-
|
|
157
|
-
var menuInvalidFlag = true; // 传入的menuList是否有效
|
|
158
|
-
|
|
159
|
-
menuList.forEach(function (item) {
|
|
160
|
-
if (!item.key) {
|
|
161
|
-
menuInvalidFlag = false;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (item.children) {
|
|
165
|
-
flattenMenuByMenuKey[item.key] = _objectSpread(_objectSpread({}, item), {}, {
|
|
166
|
-
openKey: ''
|
|
167
|
-
});
|
|
168
|
-
item.children.forEach(function (childItem) {
|
|
169
|
-
flattenMenuByMenuKey[childItem.key] = _objectSpread(_objectSpread({}, childItem), {}, {
|
|
170
|
-
openKey: item.key
|
|
171
|
-
});
|
|
172
|
-
menuKeys.push(childItem.key);
|
|
173
|
-
});
|
|
174
|
-
} else {
|
|
175
|
-
flattenMenuByMenuKey[item.key] = _objectSpread(_objectSpread({}, item), {}, {
|
|
176
|
-
openKey: ''
|
|
177
|
-
});
|
|
178
|
-
menuKeys.push(item.key);
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
return {
|
|
182
|
-
menuInvalidFlag: menuInvalidFlag,
|
|
183
|
-
flattenMenuByMenuKey: flattenMenuByMenuKey
|
|
184
|
-
};
|
|
47
|
+
}));
|
|
48
|
+
}));
|
|
185
49
|
}
|
|
186
50
|
|
|
187
51
|
export default Menu;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ISelectedMenuInfo {
|
|
3
|
+
key: string;
|
|
4
|
+
path: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IMenuItem {
|
|
7
|
+
groupTitle: string | null;
|
|
8
|
+
children: IMenuItemContentProps[];
|
|
9
|
+
}
|
|
10
|
+
interface IMenuItemContentProps {
|
|
11
|
+
menuIcon: React.ReactNode;
|
|
12
|
+
content: string | React.ReactNode;
|
|
13
|
+
key: string;
|
|
14
|
+
path: string;
|
|
15
|
+
}
|
|
16
|
+
declare function MenuItem(data: IMenuItemContentProps & {
|
|
17
|
+
selectedKey: string;
|
|
18
|
+
menuItemKey: string;
|
|
19
|
+
onMenuSelect?: (menuInfo: ISelectedMenuInfo) => void;
|
|
20
|
+
}): JSX.Element;
|
|
21
|
+
export default MenuItem;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
function MenuItem(data) {
|
|
5
|
+
var menuIcon = data.menuIcon,
|
|
6
|
+
content = data.content,
|
|
7
|
+
menuItemKey = data.menuItemKey,
|
|
8
|
+
path = data.path,
|
|
9
|
+
selectedKey = data.selectedKey,
|
|
10
|
+
_data$onMenuSelect = data.onMenuSelect,
|
|
11
|
+
onMenuSelect = _data$onMenuSelect === void 0 ? function () {} : _data$onMenuSelect;
|
|
12
|
+
var onMenuItemClick = useCallback(function (menuInfo) {
|
|
13
|
+
if (menuInfo.key === selectedKey) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
onMenuSelect(menuInfo);
|
|
18
|
+
}, [onMenuSelect, selectedKey]);
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: classNames('ald-nav-menu-item', {
|
|
21
|
+
'ald-nav-menu-item-selected': menuItemKey === selectedKey
|
|
22
|
+
}),
|
|
23
|
+
key: menuItemKey,
|
|
24
|
+
onClick: function onClick() {
|
|
25
|
+
return onMenuItemClick({
|
|
26
|
+
path: path,
|
|
27
|
+
key: menuItemKey
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "ald-nav-menu-item-icon"
|
|
32
|
+
}, menuIcon), /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "ald-nav-menu-item-content"
|
|
34
|
+
}, typeof content === 'string' ? /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "ald-nav-menu-item-content-text"
|
|
36
|
+
}, content) : content));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default MenuItem;
|
package/es/Navigator/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IMenuItem } from './components/Menu';
|
|
3
|
-
|
|
3
|
+
declare function Navigator(props: INavigatorProps): JSX.Element;
|
|
4
4
|
export interface INavigatorProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 应用logo
|
|
7
|
+
* @type {string}
|
|
8
|
+
* @default []
|
|
9
|
+
*/
|
|
10
|
+
logoSrc: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description 当前选中的应用
|
|
13
|
+
* @type {string}
|
|
14
|
+
* @default --
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @description 应用切换时调用
|
|
18
|
+
* @type {(appId: string) => void}
|
|
19
|
+
* @default --
|
|
20
|
+
*/
|
|
5
21
|
/**
|
|
6
22
|
* @description 菜单数据
|
|
7
23
|
* @default []
|
|
@@ -12,16 +28,10 @@ export interface INavigatorProps {
|
|
|
12
28
|
* @default --
|
|
13
29
|
*/
|
|
14
30
|
selectedKey: string;
|
|
15
|
-
/**
|
|
16
|
-
* @description logo的地址 默认高度为24px
|
|
17
|
-
* @default --
|
|
18
|
-
*/
|
|
19
|
-
logoSrc: string;
|
|
20
31
|
/**
|
|
21
32
|
* @description logo的点击(可选)
|
|
22
33
|
* @default --
|
|
23
34
|
*/
|
|
24
|
-
onLogoClick?: () => void;
|
|
25
35
|
/**
|
|
26
36
|
* @description 导航底部信息 可自定义
|
|
27
37
|
* @default null
|
|
@@ -36,5 +46,6 @@ export interface INavigatorProps {
|
|
|
36
46
|
path: string;
|
|
37
47
|
}) => void;
|
|
38
48
|
}
|
|
39
|
-
|
|
49
|
+
export type { IMenuItem } from './components/Menu';
|
|
50
|
+
export type { ISelectedMenuInfo } from './components/MenuItem';
|
|
40
51
|
export default Navigator;
|