@aloudata/aloudata-design 0.2.7 → 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 +163 -130
- 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 +1 -2
- 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 -119
- 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 +58 -166
- 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 +2 -1
- 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 +10 -10
- 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 +163 -130
- 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 +1 -2
- 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 -118
- 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 +58 -166
- 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 +2 -1
- 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 +10 -10
- 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,464 @@
|
|
|
1
|
+
var _excluded = ["style"],
|
|
2
|
+
_excluded2 = ["style"];
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
|
|
16
|
+
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."); }
|
|
17
|
+
|
|
18
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
+
|
|
20
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
21
|
+
|
|
22
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
23
|
+
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
|
|
26
|
+
/* eslint-disable no-unneeded-ternary */
|
|
27
|
+
/// <reference types ='./react-table-config' />
|
|
28
|
+
import _ from 'lodash';
|
|
29
|
+
import classnames from 'classnames';
|
|
30
|
+
import Icon from '../Icon';
|
|
31
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
32
|
+
import usePrefixCls from '../_utils/hooks/usePrefixCls';
|
|
33
|
+
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
34
|
+
import TableEmpty from './components/Empty';
|
|
35
|
+
import ResizeObserver from 'rc-resize-observer';
|
|
36
|
+
import { useTable, useBlockLayout, useRowSelect, useSortBy, useResizeColumns } from 'react-table';
|
|
37
|
+
import './style/index';
|
|
38
|
+
var ARRAY_FIRST_INDEX = 0;
|
|
39
|
+
var DEFAULT_ROW_WIDTH = 0;
|
|
40
|
+
var DEFAULT_BODY_HEIGHT = 0;
|
|
41
|
+
var EMPTY_LENGTH = 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
|
|
43
|
+
function Table(props, ref) {
|
|
44
|
+
var _classnames3;
|
|
45
|
+
|
|
46
|
+
var columns = props.columns,
|
|
47
|
+
data = props.data,
|
|
48
|
+
onRowSelected = props.onRowSelected,
|
|
49
|
+
loadMore = props.loadMore,
|
|
50
|
+
loading = props.loading,
|
|
51
|
+
hasNextPage = props.hasNextPage,
|
|
52
|
+
_props$sortable = props.sortable,
|
|
53
|
+
sortable = _props$sortable === void 0 ? false : _props$sortable,
|
|
54
|
+
defaultSort = props.defaultSort,
|
|
55
|
+
_props$resizeColumn = props.resizeColumn,
|
|
56
|
+
resizeColumn = _props$resizeColumn === void 0 ? false : _props$resizeColumn,
|
|
57
|
+
allSortDirections = props.sortDirections,
|
|
58
|
+
_props$onChange = props.onChange,
|
|
59
|
+
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
60
|
+
_props$innerScroll = props.innerScroll,
|
|
61
|
+
innerScroll = _props$innerScroll === void 0 ? false : _props$innerScroll,
|
|
62
|
+
_props$scrollThreshol = props.scrollThreshold,
|
|
63
|
+
scrollThreshold = _props$scrollThreshol === void 0 ? '150px' : _props$scrollThreshol,
|
|
64
|
+
_props$rowClassName = props.rowClassName,
|
|
65
|
+
rowClassName = _props$rowClassName === void 0 ? '' : _props$rowClassName,
|
|
66
|
+
_props$ellipsis = props.ellipsis,
|
|
67
|
+
ellipsis = _props$ellipsis === void 0 ? true : _props$ellipsis,
|
|
68
|
+
rowKey = props.rowKey;
|
|
69
|
+
|
|
70
|
+
var _React$useState = React.useState(null),
|
|
71
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
72
|
+
selectedRowId = _React$useState2[0],
|
|
73
|
+
setSelectedRowId = _React$useState2[1];
|
|
74
|
+
|
|
75
|
+
var tableBodyListRef = useRef(null);
|
|
76
|
+
var tableRef = useRef(null);
|
|
77
|
+
|
|
78
|
+
var _useState = useState(DEFAULT_BODY_HEIGHT),
|
|
79
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
80
|
+
tableClientWidth = _useState2[0],
|
|
81
|
+
setTableClientWidth = _useState2[1];
|
|
82
|
+
|
|
83
|
+
var RANDOM_ID = "INNER_SCROLL_ID_".concat(Math.random());
|
|
84
|
+
|
|
85
|
+
var _useState3 = useState(DEFAULT_ROW_WIDTH),
|
|
86
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
+
width = _useState4[0],
|
|
88
|
+
setWidth = _useState4[1]; // 如果页面整体宽度变化则重新计算
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
useEffect(function () {
|
|
92
|
+
if (tableRef.current) {
|
|
93
|
+
setTableClientWidth(tableRef.current.clientWidth);
|
|
94
|
+
}
|
|
95
|
+
}, [width]);
|
|
96
|
+
var initialColumnsWidthMap = useMemo(function () {
|
|
97
|
+
var map = new Map();
|
|
98
|
+
|
|
99
|
+
if (tableClientWidth !== DEFAULT_BODY_HEIGHT) {
|
|
100
|
+
var noGivenColumns = 0;
|
|
101
|
+
var givenColumnsTotalWidth = 0;
|
|
102
|
+
columns.forEach(function (column) {
|
|
103
|
+
if (column.width) {
|
|
104
|
+
map.set(column.dataIndex, column.width);
|
|
105
|
+
givenColumnsTotalWidth += column.width;
|
|
106
|
+
} else {
|
|
107
|
+
noGivenColumns += 1;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
var averageWidth = (tableClientWidth - givenColumnsTotalWidth) / noGivenColumns;
|
|
111
|
+
return {
|
|
112
|
+
columnMap: map,
|
|
113
|
+
averageWidth: averageWidth
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
columns.forEach(function (column) {
|
|
118
|
+
if (column.width) {
|
|
119
|
+
map.set(column.dataIndex, column.width);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
columnMap: map,
|
|
124
|
+
averageWidth: DEFAULT_ROW_WIDTH
|
|
125
|
+
};
|
|
126
|
+
}, [columns, tableClientWidth]);
|
|
127
|
+
var newColumns = useMemo(function () {
|
|
128
|
+
return columns.map(function (column) {
|
|
129
|
+
return _objectSpread(_objectSpread({}, column), {}, {
|
|
130
|
+
width: initialColumnsWidthMap.columnMap.get(column.dataIndex) || initialColumnsWidthMap.averageWidth,
|
|
131
|
+
Header: column.title ? column.title : function () {
|
|
132
|
+
return null;
|
|
133
|
+
},
|
|
134
|
+
disableSortBy: !sortable || typeof column.sorter === 'boolean',
|
|
135
|
+
accessor: column.dataIndex,
|
|
136
|
+
Cell: function Cell(_ref) {
|
|
137
|
+
var row = _ref.row,
|
|
138
|
+
value = _ref.value;
|
|
139
|
+
return typeof column.render === 'function' ? column.render(value, row.original, row.index) : value;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
}, [columns, sortable, initialColumnsWidthMap]); // 默认排序的对象
|
|
144
|
+
|
|
145
|
+
var defaultSortObject = {
|
|
146
|
+
id: newColumns[ARRAY_FIRST_INDEX].accessor,
|
|
147
|
+
desc: newColumns[ARRAY_FIRST_INDEX].sortOrder && newColumns[ARRAY_FIRST_INDEX].sortOrder === 'descend' ? true : false
|
|
148
|
+
}; // 如果支持排序 但是没有默认排序 则默认按第一列倒叙排序
|
|
149
|
+
|
|
150
|
+
var getInitialSortDirection = function getInitialSortDirection() {
|
|
151
|
+
if (defaultSort && defaultSort.id) {
|
|
152
|
+
return defaultSort;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (sortable) {
|
|
156
|
+
return defaultSortObject;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
id: '',
|
|
161
|
+
desc: false
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
var _React$useState3 = React.useState(getInitialSortDirection()),
|
|
166
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
167
|
+
sortDirection = _React$useState4[0],
|
|
168
|
+
setSortDirection = _React$useState4[1];
|
|
169
|
+
|
|
170
|
+
var getInitSortBy = function getInitSortBy() {
|
|
171
|
+
if (!(sortDirection === null || sortDirection === void 0 ? void 0 : sortDirection.id)) {
|
|
172
|
+
return [];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var sortColumn = newColumns.find(function (column) {
|
|
176
|
+
return column.accessor === sortDirection.id;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
if (sortColumn === null || sortColumn === void 0 ? void 0 : sortColumn.sorter) {
|
|
180
|
+
return [];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return [sortDirection];
|
|
184
|
+
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
var getRowIdFn = function getRowIdFn(row, relativeIndex, parent) {
|
|
188
|
+
if (rowKey && parent) {
|
|
189
|
+
if (typeof rowKey === 'string') {
|
|
190
|
+
return [rowKey, relativeIndex].join('.');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (typeof rowKey === 'function') {
|
|
194
|
+
return [rowKey(row), relativeIndex].join('.');
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return relativeIndex.toString();
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
var _useTable = useTable({
|
|
202
|
+
columns: newColumns,
|
|
203
|
+
data: data,
|
|
204
|
+
disableMultiSort: true,
|
|
205
|
+
disableSortBy: !sortable,
|
|
206
|
+
getRowId: getRowIdFn,
|
|
207
|
+
initialState: {
|
|
208
|
+
sortBy: getInitSortBy()
|
|
209
|
+
}
|
|
210
|
+
}, useBlockLayout, useSortBy, useRowSelect, useResizeColumns),
|
|
211
|
+
getTableProps = _useTable.getTableProps,
|
|
212
|
+
getTableBodyProps = _useTable.getTableBodyProps,
|
|
213
|
+
headerGroups = _useTable.headerGroups,
|
|
214
|
+
rows = _useTable.rows,
|
|
215
|
+
prepareRow = _useTable.prepareRow,
|
|
216
|
+
setSortBy = _useTable.setSortBy,
|
|
217
|
+
totalColumnsWidth = _useTable.totalColumnsWidth;
|
|
218
|
+
|
|
219
|
+
var theadRowWidthRef = React.useRef(DEFAULT_ROW_WIDTH);
|
|
220
|
+
var prefixCls = usePrefixCls('', 'ald-table');
|
|
221
|
+
var onRowClick = useCallback(function (row) {
|
|
222
|
+
if (!onRowSelected) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
setSelectedRowId(row.id);
|
|
227
|
+
onRowSelected(row.original);
|
|
228
|
+
}, [onRowSelected]); // 排序的方向 倒叙{ id: 'xx', desc: true }、正序{ id: 'xx', desc: false }、无序 { id: '', desc: undefined }
|
|
229
|
+
// 获取排序方向以及排序的id
|
|
230
|
+
|
|
231
|
+
var getSortBy = function getSortBy(id) {
|
|
232
|
+
var sortDirections = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['ascend', 'descend'];
|
|
233
|
+
var // 如果传了sortDirections,则使用传入的,否则使用默认的
|
|
234
|
+
sortOrder = arguments.length > 2 ? arguments[2] : undefined;
|
|
235
|
+
var res = {
|
|
236
|
+
id: id,
|
|
237
|
+
desc: undefined
|
|
238
|
+
};
|
|
239
|
+
var isSameCol = sortDirection.id === id;
|
|
240
|
+
var descMap = new Map([['ascend', false], ['descend', true]]);
|
|
241
|
+
var directions = allSortDirections || sortDirections; // 如果不是同一列 则返回默认排序 或者排序顺序的第一个
|
|
242
|
+
|
|
243
|
+
if (!isSameCol) {
|
|
244
|
+
if (sortOrder === 'ascend' || sortOrder === 'descend') {
|
|
245
|
+
res.desc = descMap.get(sortOrder);
|
|
246
|
+
} else {
|
|
247
|
+
res.desc = sortOrder ? sortOrder : descMap.get(directions[ARRAY_FIRST_INDEX]);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return res;
|
|
251
|
+
} // 如果是同一列
|
|
252
|
+
// 如果列给了默认的sortOrder则不在变化
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
if (sortOrder === 'ascend' || sortOrder === 'descend') {
|
|
256
|
+
res.desc = descMap.get(sortOrder);
|
|
257
|
+
return res;
|
|
258
|
+
} // 在所有方向上 往后取一个
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
var lastSortDirection = sortDirection.desc ? 'descend' : 'ascend';
|
|
262
|
+
|
|
263
|
+
var index = _.findIndex(directions, function (item) {
|
|
264
|
+
return item === lastSortDirection;
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
var nextIndex = index + 1;
|
|
268
|
+
res.desc = descMap.get(directions[nextIndex]); // 如果没有排序方向,则返回默认排序对象
|
|
269
|
+
|
|
270
|
+
if (res.desc === undefined) {
|
|
271
|
+
res.id = '';
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return res;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
var getHeaderProps = function getHeaderProps(column) {
|
|
278
|
+
// @ts-ignore
|
|
279
|
+
var id = column.id,
|
|
280
|
+
canSort = column.canSort,
|
|
281
|
+
sorter = column.sorter,
|
|
282
|
+
sortOrder = column.sortOrder,
|
|
283
|
+
sortDirections = column.sortDirections;
|
|
284
|
+
var toggleProps = column.getSortByToggleProps(); // 仅在Table设置sortable时,所有列的canSort为true,此时为前端排序
|
|
285
|
+
|
|
286
|
+
if (canSort) {
|
|
287
|
+
// client sort
|
|
288
|
+
return _objectSpread(_objectSpread({}, column.getHeaderProps(_objectSpread({}, toggleProps))), {}, {
|
|
289
|
+
onClick: function onClick(e) {
|
|
290
|
+
e.stopPropagation();
|
|
291
|
+
|
|
292
|
+
if (typeof toggleProps.onClick === 'function') {
|
|
293
|
+
var sortBy = getSortBy(id, sortDirections, sortOrder);
|
|
294
|
+
setSortBy(sortBy.desc === undefined ? [defaultSortObject] : [sortBy]); // 客户端排序时 需要重新设置排序
|
|
295
|
+
|
|
296
|
+
setSortDirection(sortBy);
|
|
297
|
+
onChange(sortBy);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
} // 当列设置sorter属性时,则为服务端排序
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
if (sorter) {
|
|
305
|
+
// server sort
|
|
306
|
+
return _objectSpread(_objectSpread({}, column.getHeaderProps({
|
|
307
|
+
style: {
|
|
308
|
+
cursor: 'pointer'
|
|
309
|
+
}
|
|
310
|
+
})), {}, {
|
|
311
|
+
onClick: function onClick(e) {
|
|
312
|
+
e.stopPropagation();
|
|
313
|
+
var sortBy = getSortBy(id, sortDirections, sortOrder);
|
|
314
|
+
setSortDirection(sortBy);
|
|
315
|
+
onChange(sortBy);
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return column.getHeaderProps();
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
var SortIcons = function SortIcons(_ref2) {
|
|
324
|
+
var id = _ref2.id;
|
|
325
|
+
var currentSortId = sortDirection.id,
|
|
326
|
+
desc = sortDirection.desc;
|
|
327
|
+
|
|
328
|
+
if (id !== currentSortId || !sortable) {
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
return desc ? /*#__PURE__*/React.createElement(Icon, {
|
|
333
|
+
className: "".concat(prefixCls, "-sortIcon"),
|
|
334
|
+
type: "sort_descending",
|
|
335
|
+
size: 12
|
|
336
|
+
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
337
|
+
className: "".concat(prefixCls, "-sortIcon"),
|
|
338
|
+
type: "sort_ascending",
|
|
339
|
+
size: 12
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
var scrollToTop = function scrollToTop() {
|
|
344
|
+
var INITIAL_OFFSET_TOP = 0;
|
|
345
|
+
|
|
346
|
+
if (tableBodyListRef && tableBodyListRef.current) {
|
|
347
|
+
tableBodyListRef.current.scrollTop = INITIAL_OFFSET_TOP;
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
React.useImperativeHandle(ref, function () {
|
|
352
|
+
return {
|
|
353
|
+
backToTop: function backToTop() {
|
|
354
|
+
scrollToTop();
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
});
|
|
358
|
+
var LoadingNode = /*#__PURE__*/React.createElement("div", {
|
|
359
|
+
className: classnames("".concat(prefixCls, "-loading"))
|
|
360
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
361
|
+
type: "waiting",
|
|
362
|
+
size: 16,
|
|
363
|
+
className: classnames("".concat(prefixCls, "-loading-icon"))
|
|
364
|
+
}), "Loading");
|
|
365
|
+
|
|
366
|
+
var renderTableBody = function renderTableBody() {
|
|
367
|
+
if (loading && !rows.length) {
|
|
368
|
+
return LoadingNode;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (!loading && !rows.length) {
|
|
372
|
+
return /*#__PURE__*/React.createElement(TableEmpty, null);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
var renderRowList = function renderRowList() {
|
|
376
|
+
return data.map(function (item, index) {
|
|
377
|
+
var _classnames;
|
|
378
|
+
|
|
379
|
+
var row = rows[index];
|
|
380
|
+
prepareRow(row);
|
|
381
|
+
|
|
382
|
+
var _row$getRowProps = row.getRowProps(),
|
|
383
|
+
rowStyle = _row$getRowProps.style,
|
|
384
|
+
rowProps = _objectWithoutProperties(_row$getRowProps, _excluded);
|
|
385
|
+
|
|
386
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, rowProps, {
|
|
387
|
+
style: _objectSpread({}, rowStyle),
|
|
388
|
+
className: classnames("".concat(prefixCls, "-row"), (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-row-selected"), row.id === selectedRowId), _defineProperty(_classnames, rowClassName, rowClassName), _defineProperty(_classnames, "".concat(prefixCls, "-row-ellipsis"), ellipsis), _classnames)),
|
|
389
|
+
onClick: function onClick() {
|
|
390
|
+
return onRowClick(row);
|
|
391
|
+
},
|
|
392
|
+
key: row.id
|
|
393
|
+
}), row.cells.map(function (cell) {
|
|
394
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, cell.getCellProps(), {
|
|
395
|
+
className: classnames("".concat(prefixCls, "-cell"))
|
|
396
|
+
}), cell.render('Cell'));
|
|
397
|
+
}));
|
|
398
|
+
});
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
402
|
+
className: classnames("".concat(prefixCls, "-list"), _defineProperty({}, "".concat(prefixCls, "-innerScroll"), innerScroll)),
|
|
403
|
+
id: RANDOM_ID,
|
|
404
|
+
ref: tableBodyListRef
|
|
405
|
+
}, innerScroll ? /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
406
|
+
dataLength: rows.length,
|
|
407
|
+
next: loadMore,
|
|
408
|
+
hasMore: !!hasNextPage,
|
|
409
|
+
loader: LoadingNode,
|
|
410
|
+
scrollableTarget: RANDOM_ID,
|
|
411
|
+
scrollThreshold: scrollThreshold
|
|
412
|
+
}, renderRowList()) : renderRowList());
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
return /*#__PURE__*/React.createElement(ResizeObserver, {
|
|
416
|
+
onResize: function onResize(_ref3) {
|
|
417
|
+
var domWidth = _ref3.width;
|
|
418
|
+
setWidth(domWidth);
|
|
419
|
+
}
|
|
420
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
421
|
+
className: prefixCls,
|
|
422
|
+
ref: tableRef
|
|
423
|
+
}, /*#__PURE__*/React.createElement("div", Object.assign({}, getTableProps(), {
|
|
424
|
+
className: classnames("".concat(prefixCls, "-table-wrap"), (_classnames3 = {}, _defineProperty(_classnames3, "".concat(prefixCls, "-column-resizable"), resizeColumn), _defineProperty(_classnames3, "".concat(prefixCls, "-init-loading"), data.length === EMPTY_LENGTH && loading), _defineProperty(_classnames3, "".concat(prefixCls, "-empty"), data.length === EMPTY_LENGTH && loading), _classnames3))
|
|
425
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
426
|
+
className: "".concat(prefixCls, "-thead")
|
|
427
|
+
}, headerGroups.map(function (headerGroup) {
|
|
428
|
+
var _headerGroup$getHeade = headerGroup.getHeaderGroupProps(),
|
|
429
|
+
style = _headerGroup$getHeade.style,
|
|
430
|
+
headerGroupProps = _objectWithoutProperties(_headerGroup$getHeade, _excluded2);
|
|
431
|
+
|
|
432
|
+
theadRowWidthRef.current = (style === null || style === void 0 ? void 0 : style.width) || DEFAULT_ROW_WIDTH;
|
|
433
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, headerGroupProps, {
|
|
434
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
435
|
+
width: resizeColumn ? style === null || style === void 0 ? void 0 : style.width : '100%'
|
|
436
|
+
}),
|
|
437
|
+
className: "".concat(prefixCls, "-row")
|
|
438
|
+
}), headerGroup.headers.map(function (column) {
|
|
439
|
+
var barPorps = resizeColumn ? column.getResizerProps() : {};
|
|
440
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
441
|
+
className: classnames(_defineProperty({}, "".concat(prefixCls, "-cell-sorting"), column.id === sortDirection.id), "".concat(prefixCls, "-cell")),
|
|
442
|
+
style: getHeaderProps(column).style,
|
|
443
|
+
key: column.id
|
|
444
|
+
}, /*#__PURE__*/React.createElement("div", Object.assign({
|
|
445
|
+
className: "".concat(prefixCls, "-cell-content")
|
|
446
|
+
}, getHeaderProps(column), {
|
|
447
|
+
style: {
|
|
448
|
+
width: '100%'
|
|
449
|
+
}
|
|
450
|
+
}), column.render('Header'), /*#__PURE__*/React.createElement(SortIcons, {
|
|
451
|
+
id: column.id
|
|
452
|
+
})), /*#__PURE__*/React.createElement("div", Object.assign({}, barPorps, {
|
|
453
|
+
className: classnames(_defineProperty({}, "".concat(prefixCls, "-dragBar"), resizeColumn), "".concat(prefixCls, "-bar"))
|
|
454
|
+
})));
|
|
455
|
+
}));
|
|
456
|
+
})), /*#__PURE__*/React.createElement("div", Object.assign({}, getTableBodyProps(), {
|
|
457
|
+
className: classnames("".concat(prefixCls, "-tbody"), _defineProperty({}, "".concat(prefixCls, "-innerScroll"), innerScroll)),
|
|
458
|
+
style: {
|
|
459
|
+
width: totalColumnsWidth
|
|
460
|
+
}
|
|
461
|
+
}), renderTableBody()))));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export default /*#__PURE__*/React.forwardRef(Table);
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "antd/es/empty/style";
|
|
2
|
+
import _Empty from "antd/es/empty";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import './index.less';
|
|
5
|
+
|
|
6
|
+
function TableEmpty() {
|
|
7
|
+
var emptyNode = /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "ald-table-empty-node"
|
|
9
|
+
});
|
|
10
|
+
return /*#__PURE__*/React.createElement(_Empty, {
|
|
11
|
+
image: emptyNode,
|
|
12
|
+
description: "No Data"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default TableEmpty;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
2
|
+
|
|
3
|
+
.ald-table-tbody {
|
|
4
|
+
.ant-empty {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding-top: 52px;
|
|
9
|
+
color: @NL50;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ant-empty-image {
|
|
13
|
+
width: 48px;
|
|
14
|
+
height: 48px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ald-table-empty-node {
|
|
18
|
+
width: 48px;
|
|
19
|
+
height: 48px;
|
|
20
|
+
background-image: url('./empty-img.png');
|
|
21
|
+
background-repeat: no-repeat;
|
|
22
|
+
background-size: cover;
|
|
23
|
+
}
|
|
24
|
+
}
|
package/es/Table/index.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<ITableProps<Record<string, unknown>>, "onChange" | "loading" | "data" | "ellipsis" | "columns" | "total" | "renderHeaderLeft" | "renderHeaderRight" | "onRowSelected" | "loadMore" | "hasNextPage" | "sortable" | "defaultSort" | "resizeColumn" | "sortDirections" | "showHeader" | "innerScroll" | "scrollThreshold" | "rowClassName" | "renderEmpty" | "rowKey"> & React.RefAttributes<unknown>>;
|
|
4
|
-
export default _default;
|
|
1
|
+
import Table from './Table';
|
|
2
|
+
export default Table;
|