@aloudata/aloudata-design 0.4.0-beta.10 → 0.4.0-beta.12
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/component/Avatar/index.d.ts +1 -1
- package/es/Avatar/component/Avatar/index.js +12 -16
- package/es/Breadcrumb/index.js +14 -18
- package/es/Button/index.d.ts +2 -2
- package/es/Button/index.js +16 -39
- package/es/Button/style/index.less +1 -1
- package/es/Checkbox/component/CheckboxGroup/index.d.ts +0 -1
- package/es/Checkbox/component/CheckboxGroup/index.js +11 -11
- package/es/Checkbox/index.js +8 -8
- package/es/Checkbox/type.d.ts +1 -1
- package/es/Checkbox/type.js +0 -1
- package/es/ConfigProvider/defaultRenderEmpty.d.ts +2 -2
- package/es/ConfigProvider/defaultRenderEmpty.js +0 -6
- package/es/ConfigProvider/sizeContext.d.ts +2 -2
- package/es/ConfigProvider/sizeContext.js +1 -1
- package/es/Divider/index.js +7 -3
- package/es/Dropdown/Button.d.ts +1 -1
- package/es/Dropdown/Button.js +16 -14
- package/es/Dropdown/index.d.ts +3 -3
- package/es/Dropdown/index.js +10 -10
- package/es/Empty/image/Authority.d.ts +0 -1
- package/es/Empty/image/Authority.js +0 -2
- package/es/Empty/image/Dataspace.d.ts +0 -1
- package/es/Empty/image/Dataspace.js +0 -2
- package/es/Empty/image/Search.d.ts +0 -1
- package/es/Empty/image/Search.js +0 -2
- package/es/Empty/image/Simple.d.ts +0 -1
- package/es/Empty/image/Simple.js +0 -2
- package/es/Empty/image/Worksheet.d.ts +0 -1
- package/es/Empty/image/Worksheet.js +0 -2
- package/es/Empty/image/empty.d.ts +0 -1
- package/es/Empty/image/empty.js +0 -2
- package/es/Empty/index.d.ts +1 -1
- package/es/Empty/index.js +16 -24
- package/es/Icon/components/Icon.js +14 -12
- package/es/Icon/components/createFromScripts.js +2 -8
- package/es/Icon/icons/AddLine.js +17 -23
- package/es/Icon/icons/AlertFill.js +17 -23
- package/es/Icon/icons/ArrowsDownLine.js +17 -23
- package/es/Icon/icons/CancelFill.js +17 -23
- package/es/Icon/icons/CheckFill.js +17 -23
- package/es/Icon/icons/CheckLine.js +17 -23
- package/es/Icon/icons/CloseLine.js +17 -23
- package/es/Icon/icons/DatabaseLine.js +17 -23
- package/es/Icon/icons/Deleteline.js +17 -23
- package/es/Icon/icons/DownloadLine.js +17 -23
- package/es/Icon/icons/ErrorFill.js +17 -23
- package/es/Icon/icons/EyeOffLine.js +17 -23
- package/es/Icon/icons/EyeOnLine.js +17 -23
- package/es/Icon/icons/FileLine.js +17 -23
- package/es/Icon/icons/HomeFill.js +17 -23
- package/es/Icon/icons/LightningLine.js +17 -23
- package/es/Icon/icons/Loading.js +17 -23
- package/es/Icon/icons/More.js +17 -23
- package/es/Icon/icons/NewWindowsLine.js +17 -23
- package/es/Icon/icons/SearchLine.js +17 -23
- package/es/Icon/icons/SortAscendingLine.js +17 -23
- package/es/Icon/icons/SortDescendingLine.js +17 -23
- package/es/Icon/icons/TextLine.js +17 -23
- package/es/Icon/icons/UserLine.js +17 -23
- package/es/Icon/icons.js +1658 -1588
- package/es/Input/components/Group/index.js +11 -9
- package/es/Input/components/Input/index.d.ts +2 -2
- package/es/Input/components/Input/index.js +10 -9
- package/es/Input/components/Password/index.js +14 -12
- package/es/Input/components/TextArea/index.js +13 -11
- package/es/InputNumber/index.js +10 -12
- package/es/Menu/Divider.js +7 -1
- package/es/Menu/MenuItem.js +7 -1
- package/es/Menu/SubMenu.js +8 -6
- package/es/Menu/index.d.ts +1 -1
- package/es/Menu/index.js +8 -6
- package/es/Modal/index.d.ts +1 -1
- package/es/Modal/index.js +18 -28
- package/es/Modal/locale.js +4 -6
- package/es/Modal/style/index.less +6 -1
- package/es/Navigator/components/Header/index.js +0 -2
- package/es/Navigator/components/Menu/index.js +14 -18
- package/es/Navigator/components/MenuItem/index.js +6 -9
- package/es/Navigator/index.js +5 -7
- package/es/Popconfirm/index.d.ts +89 -2
- package/es/Popconfirm/index.js +105 -1
- package/es/Popconfirm/style/index.less +58 -0
- package/es/Popover/index.js +9 -9
- package/es/Radio/components/Group/index.d.ts +1 -1
- package/es/Radio/components/Group/index.js +23 -32
- package/es/Radio/components/Radio/index.js +10 -19
- package/es/Radio/interface/radioGroup.d.ts +3 -3
- package/es/Select/index.d.ts +4 -4
- package/es/Select/index.js +53 -70
- package/es/Select/rc-select/BaseSelect.d.ts +7 -7
- package/es/Select/rc-select/BaseSelect.js +155 -245
- package/es/Select/rc-select/OptGroup.js +0 -1
- package/es/Select/rc-select/Option.js +0 -1
- package/es/Select/rc-select/OptionList.d.ts +2 -2
- package/es/Select/rc-select/OptionList.js +76 -128
- package/es/Select/rc-select/Select.d.ts +8 -8
- package/es/Select/rc-select/Select.js +137 -205
- package/es/Select/rc-select/SelectTrigger.js +30 -42
- package/es/Select/rc-select/Selector/Input.d.ts +1 -1
- package/es/Select/rc-select/Selector/Input.js +29 -37
- package/es/Select/rc-select/Selector/MultipleSelector.js +72 -97
- package/es/Select/rc-select/Selector/SingleSelector.js +28 -43
- package/es/Select/rc-select/Selector/index.js +33 -58
- package/es/Select/rc-select/TransBtn.js +5 -10
- package/es/Select/rc-select/hooks/useBaseProps.js +0 -1
- package/es/Select/rc-select/hooks/useCache.d.ts +1 -1
- package/es/Select/rc-select/hooks/useCache.js +9 -12
- package/es/Select/rc-select/hooks/useDelayReset.js +4 -18
- package/es/Select/rc-select/hooks/useFilterOptions.d.ts +1 -1
- package/es/Select/rc-select/hooks/useFilterOptions.js +8 -17
- package/es/Select/rc-select/hooks/useId.js +6 -17
- package/es/Select/rc-select/hooks/useLayoutEffect.js +0 -1
- package/es/Select/rc-select/hooks/useLock.js +2 -6
- package/es/Select/rc-select/hooks/useOptions.d.ts +2 -2
- package/es/Select/rc-select/hooks/useOptions.js +2 -10
- package/es/Select/rc-select/hooks/useRefFunc.js +0 -1
- package/es/Select/rc-select/hooks/useSelectTriggerControl.js +0 -5
- package/es/Select/rc-select/utils/commonUtil.js +0 -2
- package/es/Select/rc-select/utils/keyUtil.js +4 -3
- package/es/Select/rc-select/utils/legacyUtil.js +13 -22
- package/es/Select/rc-select/utils/valueUtil.js +18 -50
- package/es/Select/rc-select/utils/warningPropsUtil.js +30 -47
- package/es/Select/style/index.js +2 -1
- package/es/Select/style/status.less +3 -1
- package/es/Select/utils/iconUtil.d.ts +3 -3
- package/es/Select/utils/iconUtil.js +16 -26
- package/es/Space/index.js +1 -1
- package/es/Spin/index.d.ts +2 -2
- package/es/Steps/components/Step/index.d.ts +1 -1
- package/es/Steps/components/Step/index.js +9 -8
- package/es/Steps/index.d.ts +8 -2
- package/es/Steps/index.js +64 -10
- package/es/Steps/style/index.less +11 -12
- package/es/Switch/index.js +17 -30
- package/es/Table/Table.js +115 -191
- package/es/Table/components/Empty/index.js +0 -2
- package/es/Table/components/Loading/index.js +0 -2
- package/es/Table/components/TableBodyRowList/index.js +20 -39
- package/es/Table/components/TableHead/index.js +57 -94
- package/es/Table/interface.d.ts +1 -1
- package/es/Table/style/index.less +8 -4
- package/es/Table/utils.js +8 -29
- package/es/Tabs/index.d.ts +22 -7
- package/es/Tabs/index.js +12 -19
- package/es/Tooltip/index.d.ts +1 -1
- package/es/Tooltip/index.js +12 -12
- package/es/_utils/hooks/useControlledState.d.ts +1 -1
- package/es/_utils/hooks/useControlledState.js +8 -21
- package/es/_utils/hooks/useId.js +2 -6
- package/es/_utils/hooks/usePrefixCls.d.ts +1 -1
- package/es/_utils/hooks/usePrefixCls.js +2 -5
- package/es/index.d.ts +1 -1
- package/es/locale-provider/context.d.ts +1 -1
- package/es/locale-provider/index.js +10 -32
- package/lib/Alert/index.js +0 -4
- package/lib/Alert/style/index.js +0 -1
- package/lib/Avatar/component/Avatar/index.d.ts +1 -1
- package/lib/Avatar/component/Avatar/index.js +11 -24
- package/lib/Avatar/index.js +0 -4
- package/lib/Avatar/style/index.js +0 -1
- package/lib/Breadcrumb/index.js +14 -23
- package/lib/Breadcrumb/style/index.js +0 -1
- package/lib/Button/index.d.ts +2 -2
- package/lib/Button/index.js +16 -47
- package/lib/Button/style/index.js +0 -1
- package/lib/Button/style/index.less +1 -1
- package/lib/Card/index.js +0 -4
- package/lib/Card/style/index.js +0 -1
- package/lib/Checkbox/component/CheckboxGroup/index.d.ts +0 -1
- package/lib/Checkbox/component/CheckboxGroup/index.js +9 -16
- package/lib/Checkbox/index.js +8 -14
- package/lib/Checkbox/style/index.js +0 -1
- package/lib/Checkbox/type.d.ts +1 -1
- package/lib/Checkbox/type.js +0 -1
- package/lib/Col/index.js +0 -4
- package/lib/Col/style/index.js +0 -1
- package/lib/ConfigProvider/defaultRenderEmpty.d.ts +2 -2
- package/lib/ConfigProvider/defaultRenderEmpty.js +0 -13
- package/lib/ConfigProvider/index.js +0 -5
- package/lib/ConfigProvider/sizeContext.d.ts +2 -2
- package/lib/ConfigProvider/sizeContext.js +1 -8
- package/lib/ConfigProvider/style/index.js +0 -1
- package/lib/DatePicker/index.js +0 -4
- package/lib/DatePicker/style/index.js +0 -1
- package/lib/Divider/index.js +7 -8
- package/lib/Divider/style/index.js +0 -1
- package/lib/Drawer/index.js +0 -4
- package/lib/Drawer/style/index.js +0 -1
- package/lib/Dropdown/Button.d.ts +1 -1
- package/lib/Dropdown/Button.js +14 -20
- package/lib/Dropdown/index.d.ts +3 -3
- package/lib/Dropdown/index.js +10 -17
- package/lib/Dropdown/style/index.js +0 -2
- package/lib/Empty/image/Authority.d.ts +0 -1
- package/lib/Empty/image/Authority.js +0 -6
- package/lib/Empty/image/Dataspace.d.ts +0 -1
- package/lib/Empty/image/Dataspace.js +0 -6
- package/lib/Empty/image/Search.d.ts +0 -1
- package/lib/Empty/image/Search.js +0 -6
- package/lib/Empty/image/Simple.d.ts +0 -1
- package/lib/Empty/image/Simple.js +0 -6
- package/lib/Empty/image/Worksheet.d.ts +0 -1
- package/lib/Empty/image/Worksheet.js +0 -6
- package/lib/Empty/image/empty.d.ts +0 -1
- package/lib/Empty/image/empty.js +0 -6
- package/lib/Empty/index.d.ts +1 -1
- package/lib/Empty/index.js +15 -37
- package/lib/Form/index.js +0 -4
- package/lib/Form/style/index.js +0 -1
- package/lib/Icon/antdIconfont.js +0 -1
- package/lib/Icon/components/Icon.js +14 -16
- package/lib/Icon/components/createFromScripts.js +2 -8
- package/lib/Icon/icons/AddLine.js +16 -30
- package/lib/Icon/icons/AlertFill.js +16 -30
- package/lib/Icon/icons/ArrowsDownLine.js +16 -30
- package/lib/Icon/icons/CancelFill.js +16 -30
- package/lib/Icon/icons/CheckFill.js +16 -30
- package/lib/Icon/icons/CheckLine.js +16 -30
- package/lib/Icon/icons/CloseLine.js +16 -30
- package/lib/Icon/icons/DatabaseLine.js +16 -30
- package/lib/Icon/icons/Deleteline.js +16 -30
- package/lib/Icon/icons/DownloadLine.js +16 -30
- package/lib/Icon/icons/ErrorFill.js +16 -30
- package/lib/Icon/icons/EyeOffLine.js +16 -30
- package/lib/Icon/icons/EyeOnLine.js +16 -30
- package/lib/Icon/icons/FileLine.js +16 -30
- package/lib/Icon/icons/HomeFill.js +16 -30
- package/lib/Icon/icons/LightningLine.js +16 -30
- package/lib/Icon/icons/Loading.js +16 -30
- package/lib/Icon/icons/More.js +16 -30
- package/lib/Icon/icons/NewWindowsLine.js +16 -30
- package/lib/Icon/icons/SearchLine.js +16 -30
- package/lib/Icon/icons/SortAscendingLine.js +16 -30
- package/lib/Icon/icons/SortDescendingLine.js +16 -30
- package/lib/Icon/icons/TextLine.js +16 -30
- package/lib/Icon/icons/UserLine.js +16 -30
- package/lib/Icon/icons.js +1658 -1588
- package/lib/Icon/index.js +0 -3
- package/lib/Input/components/Group/index.js +11 -16
- package/lib/Input/components/Input/index.d.ts +2 -2
- package/lib/Input/components/Input/index.js +10 -16
- package/lib/Input/components/Password/index.js +12 -21
- package/lib/Input/components/TextArea/index.js +13 -18
- package/lib/Input/index.js +0 -6
- package/lib/Input/style/index.js +0 -2
- package/lib/InputNumber/index.js +10 -18
- package/lib/InputNumber/style/index.js +0 -1
- package/lib/Layout/index.js +0 -4
- package/lib/Layout/style/index.js +0 -1
- package/lib/Menu/Divider.js +7 -7
- package/lib/Menu/MenuItem.js +7 -7
- package/lib/Menu/SubMenu.js +8 -13
- package/lib/Menu/index.d.ts +1 -1
- package/lib/Menu/index.js +8 -16
- package/lib/Menu/style/index.js +0 -2
- package/lib/Modal/index.d.ts +1 -1
- package/lib/Modal/index.js +17 -45
- package/lib/Modal/locale.js +4 -9
- package/lib/Modal/style/index.js +0 -1
- package/lib/Modal/style/index.less +6 -1
- package/lib/Navigator/components/Header/index.js +0 -4
- package/lib/Navigator/components/Menu/index.js +13 -24
- package/lib/Navigator/components/MenuItem/index.js +6 -15
- package/lib/Navigator/index.js +5 -15
- package/lib/Navigator/style/index.js +0 -1
- package/lib/PageHeader/index.js +0 -4
- package/lib/PageHeader/style/index.js +0 -1
- package/lib/Popconfirm/index.d.ts +89 -2
- package/lib/Popconfirm/index.js +106 -5
- package/lib/Popconfirm/style/index.js +0 -1
- package/lib/Popconfirm/style/index.less +58 -0
- package/lib/Popover/index.js +9 -14
- package/lib/Popover/style/index.js +0 -1
- package/lib/Progress/index.js +0 -3
- package/lib/Progress/style/index.js +0 -1
- package/lib/Radio/components/Group/index.d.ts +1 -1
- package/lib/Radio/components/Group/index.js +22 -41
- package/lib/Radio/components/Radio/index.js +10 -30
- package/lib/Radio/index.js +0 -4
- package/lib/Radio/interface/radioGroup.d.ts +3 -3
- package/lib/Radio/style/index.js +0 -1
- package/lib/Row/index.js +0 -4
- package/lib/Row/style/index.js +0 -1
- package/lib/Select/index.d.ts +4 -4
- package/lib/Select/index.js +52 -87
- package/lib/Select/rc-select/BaseSelect.d.ts +7 -7
- package/lib/Select/rc-select/BaseSelect.js +155 -266
- package/lib/Select/rc-select/OptGroup.js +0 -2
- package/lib/Select/rc-select/Option.js +0 -2
- package/lib/Select/rc-select/OptionList.d.ts +2 -2
- package/lib/Select/rc-select/OptionList.js +75 -146
- package/lib/Select/rc-select/Select.d.ts +8 -8
- package/lib/Select/rc-select/Select.js +137 -224
- package/lib/Select/rc-select/SelectContext.js +1 -5
- package/lib/Select/rc-select/SelectTrigger.js +29 -49
- package/lib/Select/rc-select/Selector/Input.d.ts +1 -1
- package/lib/Select/rc-select/Selector/Input.js +29 -46
- package/lib/Select/rc-select/Selector/MultipleSelector.js +71 -109
- package/lib/Select/rc-select/Selector/SingleSelector.js +28 -50
- package/lib/Select/rc-select/Selector/index.js +32 -67
- package/lib/Select/rc-select/TransBtn.js +5 -16
- package/lib/Select/rc-select/hooks/useBaseProps.js +1 -7
- package/lib/Select/rc-select/hooks/useCache.d.ts +1 -1
- package/lib/Select/rc-select/hooks/useCache.js +9 -18
- package/lib/Select/rc-select/hooks/useDelayReset.js +4 -22
- package/lib/Select/rc-select/hooks/useFilterOptions.d.ts +1 -1
- package/lib/Select/rc-select/hooks/useFilterOptions.js +8 -25
- package/lib/Select/rc-select/hooks/useId.js +6 -26
- package/lib/Select/rc-select/hooks/useLayoutEffect.js +0 -6
- package/lib/Select/rc-select/hooks/useLock.js +2 -10
- package/lib/Select/rc-select/hooks/useOptions.d.ts +2 -2
- package/lib/Select/rc-select/hooks/useOptions.js +2 -15
- package/lib/Select/rc-select/hooks/useRefFunc.js +0 -5
- package/lib/Select/rc-select/hooks/useSelectTriggerControl.js +1 -10
- package/lib/Select/rc-select/index.js +0 -7
- package/lib/Select/rc-select/utils/commonUtil.js +0 -4
- package/lib/Select/rc-select/utils/keyUtil.js +4 -5
- package/lib/Select/rc-select/utils/legacyUtil.js +12 -28
- package/lib/Select/rc-select/utils/platformUtil.js +0 -1
- package/lib/Select/rc-select/utils/valueUtil.js +18 -55
- package/lib/Select/rc-select/utils/warningPropsUtil.js +30 -56
- package/lib/Select/style/index.js +0 -2
- package/lib/Select/style/status.less +3 -1
- package/lib/Select/utils/iconUtil.d.ts +3 -3
- package/lib/Select/utils/iconUtil.js +16 -39
- package/lib/Skeleton/index.js +0 -3
- package/lib/Skeleton/style/index.js +0 -1
- package/lib/Space/index.js +2 -9
- package/lib/Space/style/index.js +0 -1
- package/lib/Spin/index.d.ts +2 -2
- package/lib/Spin/index.js +0 -3
- package/lib/Spin/style/index.js +0 -1
- package/lib/Steps/components/ProcessIcon/index.js +0 -4
- package/lib/Steps/components/Step/index.d.ts +1 -1
- package/lib/Steps/components/Step/index.js +9 -18
- package/lib/Steps/index.d.ts +8 -2
- package/lib/Steps/index.js +63 -17
- package/lib/Steps/style/index.js +0 -1
- package/lib/Steps/style/index.less +11 -12
- package/lib/Switch/index.js +17 -37
- package/lib/Switch/style/index.js +0 -1
- package/lib/Table/Table.js +117 -216
- package/lib/Table/components/Empty/index.js +0 -6
- package/lib/Table/components/Loading/index.js +0 -7
- package/lib/Table/components/TableBodyRowList/index.js +19 -47
- package/lib/Table/components/TableHead/index.js +56 -108
- package/lib/Table/index.js +0 -3
- package/lib/Table/interface.d.ts +1 -1
- package/lib/Table/style/index.js +0 -1
- package/lib/Table/style/index.less +8 -4
- package/lib/Table/utils.js +8 -33
- package/lib/Tabs/index.d.ts +22 -7
- package/lib/Tabs/index.js +10 -28
- package/lib/Tabs/style/index.js +0 -2
- package/lib/Tooltip/index.d.ts +1 -1
- package/lib/Tooltip/index.js +12 -17
- package/lib/Tooltip/style/index.js +0 -1
- package/lib/Tree/index.js +0 -3
- package/lib/Tree/style/index.js +0 -1
- package/lib/Typography/index.js +0 -4
- package/lib/Typography/style/index.js +0 -1
- package/lib/Upload/index.js +0 -4
- package/lib/Upload/style/index.js +0 -1
- package/lib/_utils/hooks/useControlledState.d.ts +1 -1
- package/lib/_utils/hooks/useControlledState.js +8 -23
- package/lib/_utils/hooks/useId.js +3 -10
- package/lib/_utils/hooks/usePrefixCls.d.ts +1 -1
- package/lib/_utils/hooks/usePrefixCls.js +2 -10
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -42
- package/lib/locale/default.js +0 -3
- package/lib/locale/en_US.js +1 -6
- package/lib/locale/zh_CN.js +1 -6
- package/lib/locale-provider/LocaleReceiver.js +0 -5
- package/lib/locale-provider/context.d.ts +1 -1
- package/lib/locale-provider/context.js +0 -2
- package/lib/locale-provider/default.js +0 -3
- package/lib/locale-provider/en_US.js +0 -3
- package/lib/locale-provider/index.js +8 -37
- package/lib/locale-provider/zh_CN.js +0 -3
- package/lib/message/index.js +0 -4
- package/lib/message/style/index.js +0 -1
- package/lib/notification/index.js +0 -4
- package/lib/notification/style/index.js +0 -1
- package/package.json +4 -3
- package/es/Table/hooks/useFrame.d.ts +0 -7
- package/es/Table/hooks/useFrame.js +0 -90
- package/es/Tabs/TabPane.d.ts +0 -21
- package/es/Tabs/TabPane.js +0 -6
- package/lib/Table/hooks/useFrame.d.ts +0 -7
- package/lib/Table/hooks/useFrame.js +0 -98
- package/lib/Tabs/TabPane.d.ts +0 -21
- package/lib/Tabs/TabPane.js +0 -18
package/es/Navigator/index.js
CHANGED
|
@@ -2,14 +2,13 @@ import React, { useCallback } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import Menu from './components/Menu';
|
|
4
4
|
import Header from './components/Header';
|
|
5
|
-
|
|
6
5
|
function Navigator(props) {
|
|
7
6
|
var logoSrc = props.logoSrc,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
menuList = props.menuList,
|
|
8
|
+
selectedKey = props.selectedKey,
|
|
9
|
+
_props$footer = props.footer,
|
|
10
|
+
footer = _props$footer === void 0 ? null : _props$footer,
|
|
11
|
+
onMenuSelect = props.onMenuSelect;
|
|
13
12
|
var renderMenu = useCallback(function () {
|
|
14
13
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
15
14
|
menuList: menuList,
|
|
@@ -31,5 +30,4 @@ function Navigator(props) {
|
|
|
31
30
|
className: "ald-nav-footer-wrap"
|
|
32
31
|
}, footer)));
|
|
33
32
|
}
|
|
34
|
-
|
|
35
33
|
export default Navigator;
|
package/es/Popconfirm/index.d.ts
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import type { AbstractTooltipProps, RenderFunction } from 'antd/lib/tooltip';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ButtonType, IButtonProps } from '../Button';
|
|
4
|
+
import './style/index.less';
|
|
5
|
+
export interface IPopconfirmProps extends AbstractTooltipProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description 确认框的描述
|
|
8
|
+
* @type string | RenderFunction
|
|
9
|
+
* @default -
|
|
10
|
+
*/
|
|
11
|
+
title: string | RenderFunction;
|
|
12
|
+
/**
|
|
13
|
+
* @description 点击确认的回调
|
|
14
|
+
* @type (e?: React.MouseEvent<HTMLElement>) => void
|
|
15
|
+
* @default -
|
|
16
|
+
*/
|
|
17
|
+
onConfirm?: (e?: React.MouseEvent<HTMLElement>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* @description 点击取消的回调
|
|
20
|
+
* @type (e?: React.MouseEvent<HTMLElement>) => void
|
|
21
|
+
* @default -
|
|
22
|
+
*/
|
|
23
|
+
onCancel?: (e?: React.MouseEvent<HTMLElement>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* @description 确认按钮文字
|
|
26
|
+
* @type ReactNode
|
|
27
|
+
* @default 确认
|
|
28
|
+
*/
|
|
29
|
+
okText?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* @description 确认按钮类型
|
|
32
|
+
* @type string
|
|
33
|
+
* @default primary
|
|
34
|
+
*/
|
|
35
|
+
okType?: ButtonType;
|
|
36
|
+
/**
|
|
37
|
+
* @description 取消按钮文字
|
|
38
|
+
* @type ReactNode
|
|
39
|
+
* @default 取消
|
|
40
|
+
*/
|
|
41
|
+
cancelText?: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* @description 取消按钮类型
|
|
44
|
+
* @type string
|
|
45
|
+
* @default text
|
|
46
|
+
*/
|
|
47
|
+
cancelType?: ButtonType;
|
|
48
|
+
/**
|
|
49
|
+
* @description ok按钮props
|
|
50
|
+
* @type IButtonProps
|
|
51
|
+
* @default -
|
|
52
|
+
*/
|
|
53
|
+
okButtonProps?: IButtonProps;
|
|
54
|
+
/**
|
|
55
|
+
* @description cancel按钮props
|
|
56
|
+
* @type IButtonProps
|
|
57
|
+
* @default -
|
|
58
|
+
*/
|
|
59
|
+
cancelButtonProps?: IButtonProps;
|
|
60
|
+
/**
|
|
61
|
+
* @description 是否显示取消按钮
|
|
62
|
+
* @type boolean
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
showCancel?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* @description 自定义弹出气泡的icon图标
|
|
68
|
+
* @type ReactNode
|
|
69
|
+
* @default -
|
|
70
|
+
*/
|
|
71
|
+
icon?: React.ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* @description 当确认框状态改变时
|
|
74
|
+
* @type (
|
|
75
|
+
open: boolean,
|
|
76
|
+
e?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLDivElement>,
|
|
77
|
+
) => void;
|
|
78
|
+
* @default -
|
|
79
|
+
*/
|
|
80
|
+
onOpenChange?: (open: boolean, e?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLDivElement>) => void;
|
|
81
|
+
/**
|
|
82
|
+
* @description 自定义底部按钮
|
|
83
|
+
* @type ReactNode
|
|
84
|
+
* @default -
|
|
85
|
+
*/
|
|
86
|
+
footer?: React.ReactNode;
|
|
87
|
+
children?: React.ReactNode;
|
|
88
|
+
}
|
|
89
|
+
declare const Popconfirm: ({ title, icon, okText, okType, cancelText, cancelType, okButtonProps, cancelButtonProps, showCancel, children, footer, ...props }: IPopconfirmProps) => JSX.Element;
|
|
3
90
|
export default Popconfirm;
|
package/es/Popconfirm/index.js
CHANGED
|
@@ -1,2 +1,106 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
import "antd/es/popover/style";
|
|
3
|
+
import _Popover from "antd/es/popover";
|
|
4
|
+
import "@aloudata/icons-react/styles/index.less";
|
|
5
|
+
import _AlertTriangleLine from "@aloudata/icons-react/es/icons/AlertTriangleLine";
|
|
6
|
+
var _excluded = ["title", "icon", "okText", "okType", "cancelText", "cancelType", "okButtonProps", "cancelButtonProps", "showCancel", "children", "footer"];
|
|
7
|
+
var _this = this;
|
|
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
|
+
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; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
+
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."); }
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import Button from '../Button';
|
|
24
|
+
import './style/index.less';
|
|
25
|
+
var Popconfirm = function Popconfirm(_ref) {
|
|
26
|
+
var title = _ref.title,
|
|
27
|
+
_ref$icon = _ref.icon,
|
|
28
|
+
icon = _ref$icon === void 0 ? /*#__PURE__*/React.createElement(_AlertTriangleLine, {
|
|
29
|
+
fill: "#DC6803",
|
|
30
|
+
size: 20
|
|
31
|
+
}) : _ref$icon,
|
|
32
|
+
_ref$okText = _ref.okText,
|
|
33
|
+
okText = _ref$okText === void 0 ? '确认' : _ref$okText,
|
|
34
|
+
_ref$okType = _ref.okType,
|
|
35
|
+
okType = _ref$okType === void 0 ? 'primary' : _ref$okType,
|
|
36
|
+
_ref$cancelText = _ref.cancelText,
|
|
37
|
+
cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
|
|
38
|
+
_ref$cancelType = _ref.cancelType,
|
|
39
|
+
cancelType = _ref$cancelType === void 0 ? 'text' : _ref$cancelType,
|
|
40
|
+
okButtonProps = _ref.okButtonProps,
|
|
41
|
+
cancelButtonProps = _ref.cancelButtonProps,
|
|
42
|
+
_ref$showCancel = _ref.showCancel,
|
|
43
|
+
showCancel = _ref$showCancel === void 0 ? true : _ref$showCancel,
|
|
44
|
+
children = _ref.children,
|
|
45
|
+
footer = _ref.footer,
|
|
46
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
+
var _useMergedState = useMergedState(false, {
|
|
48
|
+
value: props.open,
|
|
49
|
+
defaultValue: props.defaultOpen
|
|
50
|
+
}),
|
|
51
|
+
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
52
|
+
open = _useMergedState2[0],
|
|
53
|
+
setOpen = _useMergedState2[1];
|
|
54
|
+
var settingOpen = function settingOpen(value, e) {
|
|
55
|
+
var _props$onOpenChange;
|
|
56
|
+
setOpen(value, true);
|
|
57
|
+
(_props$onOpenChange = props.onOpenChange) === null || _props$onOpenChange === void 0 ? void 0 : _props$onOpenChange.call(props, value, e);
|
|
58
|
+
};
|
|
59
|
+
var onConfirm = function onConfirm(e) {
|
|
60
|
+
var _props$onConfirm;
|
|
61
|
+
settingOpen(false, e);
|
|
62
|
+
(_props$onConfirm = props.onConfirm) === null || _props$onConfirm === void 0 ? void 0 : _props$onConfirm.call(_this, e);
|
|
63
|
+
};
|
|
64
|
+
var onCancel = function onCancel(e) {
|
|
65
|
+
var _props$onCancel;
|
|
66
|
+
settingOpen(false, e);
|
|
67
|
+
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 ? void 0 : _props$onCancel.call(_this, e);
|
|
68
|
+
};
|
|
69
|
+
var onOpenChange = function onOpenChange(value) {
|
|
70
|
+
settingOpen(value);
|
|
71
|
+
};
|
|
72
|
+
var content = /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: "contentWrapper"
|
|
74
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: "content"
|
|
76
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "contentTitle"
|
|
78
|
+
}, icon && /*#__PURE__*/React.createElement("span", {
|
|
79
|
+
className: "icon"
|
|
80
|
+
}, icon), /*#__PURE__*/React.createElement("p", {
|
|
81
|
+
className: "desc"
|
|
82
|
+
}, typeof title === 'function' ? title() : title)), /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: "contentFooter"
|
|
84
|
+
}, footer || /*#__PURE__*/React.createElement(React.Fragment, null, showCancel && /*#__PURE__*/React.createElement(Button, _objectSpread(_objectSpread({
|
|
85
|
+
type: cancelType,
|
|
86
|
+
size: "small"
|
|
87
|
+
}, cancelButtonProps), {}, {
|
|
88
|
+
onClick: onCancel
|
|
89
|
+
}), cancelText), /*#__PURE__*/React.createElement(Button, _objectSpread(_objectSpread({
|
|
90
|
+
type: okType,
|
|
91
|
+
size: "small"
|
|
92
|
+
}, okButtonProps), {}, {
|
|
93
|
+
onClick: onConfirm
|
|
94
|
+
}), okText)))));
|
|
95
|
+
return /*#__PURE__*/React.createElement(_Popover, _objectSpread({
|
|
96
|
+
content: content,
|
|
97
|
+
open: open,
|
|
98
|
+
onVisibleChange: onOpenChange,
|
|
99
|
+
trigger: ['click']
|
|
100
|
+
}, props), /*#__PURE__*/React.createElement("span", {
|
|
101
|
+
onClick: function onClick() {
|
|
102
|
+
setOpen(!open);
|
|
103
|
+
}
|
|
104
|
+
}, children));
|
|
105
|
+
};
|
|
2
106
|
export default Popconfirm;
|
|
@@ -1 +1,59 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
|
+
|
|
3
|
+
.contentWrapper {
|
|
4
|
+
padding: 8px 4px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.content {
|
|
8
|
+
width: 288px;
|
|
9
|
+
max-height: 120px;
|
|
10
|
+
overflow: auto;
|
|
11
|
+
border-radius: @border-radius-base;
|
|
12
|
+
|
|
13
|
+
.contentTitle {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: none;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
gap: 4px;
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
align-self: stretch;
|
|
20
|
+
padding: 0 0 16px;
|
|
21
|
+
line-height: 20px;
|
|
22
|
+
|
|
23
|
+
.icon {
|
|
24
|
+
flex: 0 0 20px;
|
|
25
|
+
height: 20px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.desc {
|
|
29
|
+
flex: 1;
|
|
30
|
+
align-items: center;
|
|
31
|
+
margin: 0;
|
|
32
|
+
overflow: auto;
|
|
33
|
+
color: @NL40;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 20px;
|
|
37
|
+
word-wrap: break-word;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.contentFooter {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex: none;
|
|
44
|
+
flex-grow: 0;
|
|
45
|
+
gap: 12px;
|
|
46
|
+
align-items: center;
|
|
47
|
+
align-self: stretch;
|
|
48
|
+
justify-content: flex-end;
|
|
49
|
+
order: 1;
|
|
50
|
+
height: 44px;
|
|
51
|
+
padding: 16px 0 0;
|
|
52
|
+
background: @BG100;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ant-popover-inner {
|
|
57
|
+
border-radius: @border-radius-base;
|
|
58
|
+
box-shadow: @shadow-lg;
|
|
59
|
+
}
|
package/es/Popover/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
import "antd/es/popover/style";
|
|
2
3
|
import _Popover from "antd/es/popover";
|
|
3
4
|
var _excluded = ["overlayClassName", "children"];
|
|
4
|
-
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
10
|
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
11
|
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
12
|
import React from 'react';
|
|
10
13
|
import classnames from 'classnames';
|
|
11
|
-
|
|
12
14
|
function Popover(props) {
|
|
13
15
|
var overlayClassName = props.overlayClassName,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return /*#__PURE__*/React.createElement(_Popover, Object.assign({
|
|
16
|
+
children = props.children,
|
|
17
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
18
|
+
return /*#__PURE__*/React.createElement(_Popover, _objectSpread({
|
|
18
19
|
overlayClassName: classnames('ald-popover', overlayClassName)
|
|
19
20
|
}, restProps), children);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
22
|
export default Popover;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IRadioGroupProps } from '../../interface/radioGroup';
|
|
3
|
-
export declare const RadioGroupContext: React.Context<
|
|
3
|
+
export declare const RadioGroupContext: React.Context<Omit<IRadioGroupProps, "className" | "children"> & {
|
|
4
4
|
sliderRef?: React.RefObject<HTMLDivElement> | undefined;
|
|
5
5
|
}>;
|
|
6
6
|
export default function RadioGroup(props: IRadioGroupProps): JSX.Element;
|
|
@@ -1,61 +1,52 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
6
|
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."); }
|
|
6
|
-
|
|
7
7
|
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); }
|
|
8
|
-
|
|
9
8
|
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; }
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
11
|
import React, { createContext, useRef } from 'react';
|
|
16
12
|
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
17
13
|
import classNames from 'classnames';
|
|
18
14
|
export var RadioGroupContext = /*#__PURE__*/createContext({});
|
|
19
15
|
export default function RadioGroup(props) {
|
|
20
16
|
var children = props.children,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var sliderRef = useRef(null);
|
|
30
|
-
|
|
17
|
+
_props$radioGroupStyl = props.radioGroupStyle,
|
|
18
|
+
radioGroupStyle = _props$radioGroupStyl === void 0 ? 'border' : _props$radioGroupStyl,
|
|
19
|
+
_props$size = props.size,
|
|
20
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
21
|
+
_props$type = props.type,
|
|
22
|
+
type = _props$type === void 0 ? 'radio' : _props$type,
|
|
23
|
+
className = props.className;
|
|
24
|
+
// 滑块的ref
|
|
25
|
+
var sliderRef = useRef(null);
|
|
26
|
+
// 该hooks与useState相同,但是当props中有value值时,优先使用value的值
|
|
31
27
|
var _useMergedState = useMergedState(props.defaultValue, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
value: props === null || props === void 0 ? void 0 : props.value
|
|
29
|
+
}),
|
|
30
|
+
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
31
|
+
value = _useMergedState2[0],
|
|
32
|
+
setValue = _useMergedState2[1];
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
34
|
var onRadioChange = function onRadioChange(selectedValue) {
|
|
40
|
-
var lastValue = value;
|
|
35
|
+
var lastValue = value;
|
|
36
|
+
// const val = ev.target.value;
|
|
41
37
|
// console.log(selectValue);
|
|
42
|
-
|
|
43
38
|
setValue(selectedValue);
|
|
44
39
|
var onChange = props.onChange;
|
|
45
|
-
|
|
46
40
|
if (onChange && selectedValue !== lastValue) {
|
|
47
41
|
onChange(selectedValue);
|
|
48
42
|
}
|
|
49
43
|
};
|
|
50
|
-
|
|
51
44
|
var getWrapperClass = function getWrapperClass() {
|
|
52
45
|
var _classNames;
|
|
53
|
-
|
|
54
46
|
var isButton = ['button', 'iconButton'].includes(type);
|
|
55
47
|
var tempType = type === 'iconButton' ? 'icon-button' : type;
|
|
56
48
|
return classNames('ald-radio-group', className, "ald-radio-group-".concat(tempType), (_classNames = {}, _defineProperty(_classNames, "ald-radio-group-".concat(radioGroupStyle), isButton), _defineProperty(_classNames, "ald-radio-group-".concat(size), isButton), _classNames));
|
|
57
49
|
};
|
|
58
|
-
|
|
59
50
|
return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {
|
|
60
51
|
value: {
|
|
61
52
|
onChange: onRadioChange,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
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
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
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
9
9
|
import _ from 'lodash';
|
|
@@ -13,25 +13,21 @@ export default function Radio(props) {
|
|
|
13
13
|
var groupContext = useContext(RadioGroupContext);
|
|
14
14
|
var labelRef = useRef(null);
|
|
15
15
|
var id = getUUID().toString();
|
|
16
|
-
|
|
17
16
|
var radioProps = _objectSpread({}, props);
|
|
18
|
-
|
|
19
17
|
if (!_.isEmpty(groupContext)) {
|
|
20
18
|
radioProps.disabled = props.disabled;
|
|
21
19
|
radioProps.checked = !props.disabled && groupContext.value === props.value;
|
|
22
20
|
} else {
|
|
23
21
|
radioProps.checked = !('checked' in props) ? props.defaultChecked : radioProps.checked;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
}
|
|
23
|
+
// 设置input外层盒子的class
|
|
27
24
|
var aldRadioClass = classNames('ald-radio', {
|
|
28
25
|
'ald-radio-checked': radioProps.checked,
|
|
29
26
|
'ald-radio-disabled': radioProps.disabled
|
|
30
|
-
});
|
|
31
|
-
|
|
27
|
+
});
|
|
28
|
+
// 根据属性设置最外层的class
|
|
32
29
|
var getWrapperClass = function getWrapperClass() {
|
|
33
30
|
var otherClass = '';
|
|
34
|
-
|
|
35
31
|
if (groupContext.type === 'button') {
|
|
36
32
|
if (groupContext.radioGroupStyle === 'filled') {
|
|
37
33
|
otherClass = 'ald-radio-button-wrapper-filled';
|
|
@@ -48,23 +44,19 @@ export default function Radio(props) {
|
|
|
48
44
|
// 当type未设置或者是radio时
|
|
49
45
|
otherClass = 'ald-radio-wrapper';
|
|
50
46
|
}
|
|
51
|
-
|
|
52
47
|
return classNames('ald-radio-label', otherClass, {
|
|
53
48
|
'ald-radio-wrapper-checked': radioProps.checked,
|
|
54
49
|
'ald-radio-wrapper-disabled': radioProps.disabled
|
|
55
50
|
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
};
|
|
52
|
+
// filled button模式下,更改滑块的位置
|
|
59
53
|
useEffect(function () {
|
|
60
54
|
var _groupContext$sliderR;
|
|
61
|
-
|
|
62
55
|
if (radioProps.checked && (groupContext === null || groupContext === void 0 ? void 0 : (_groupContext$sliderR = groupContext.sliderRef) === null || _groupContext$sliderR === void 0 ? void 0 : _groupContext$sliderR.current) && (labelRef === null || labelRef === void 0 ? void 0 : labelRef.current)) {
|
|
63
56
|
groupContext.sliderRef.current.style.left = "".concat(labelRef.current.offsetLeft, "px");
|
|
64
57
|
groupContext.sliderRef.current.style.width = "".concat(labelRef.current.offsetWidth, "px");
|
|
65
58
|
}
|
|
66
59
|
}, [groupContext.sliderRef, radioProps.checked]);
|
|
67
|
-
|
|
68
60
|
var onChange = function onChange() {
|
|
69
61
|
if (groupContext === null || groupContext === void 0 ? void 0 : groupContext.onChange) {
|
|
70
62
|
// console.log(e);
|
|
@@ -72,7 +64,6 @@ export default function Radio(props) {
|
|
|
72
64
|
groupContext.onChange(props.value);
|
|
73
65
|
}
|
|
74
66
|
};
|
|
75
|
-
|
|
76
67
|
return /*#__PURE__*/React.createElement("label", {
|
|
77
68
|
className: getWrapperClass(),
|
|
78
69
|
htmlFor: id,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type TRadioGroupStyle = 'border' | 'filled';
|
|
3
|
+
export type TRadioSize = 'large' | 'middle' | 'small' | 'default';
|
|
4
|
+
export type TRadioType = 'radio' | 'button' | 'iconButton';
|
|
5
5
|
export interface IRadioGroupProps {
|
|
6
6
|
/**
|
|
7
7
|
* @description 按钮组的样式 'border' | 'filled'
|
package/es/Select/index.d.ts
CHANGED
|
@@ -6,15 +6,15 @@ import * as React from 'react';
|
|
|
6
6
|
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
7
7
|
import { SelectCommonPlacement } from 'antd/lib/_util/motion';
|
|
8
8
|
import type { InputStatus } from 'antd/lib/_util/statusUtils';
|
|
9
|
-
|
|
9
|
+
type RawValue = string | number;
|
|
10
10
|
export type { OptionProps, BaseSelectRef as RefSelectProps, BaseOptionType, DefaultOptionType };
|
|
11
11
|
export interface LabeledValue {
|
|
12
12
|
key?: string;
|
|
13
13
|
value: RawValue;
|
|
14
14
|
label: React.ReactNode;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
|
|
17
|
+
export type SelectType = SizeType | 'mini';
|
|
18
18
|
export interface InternalSelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<RcSelectProps<ValueType, OptionType>, 'mode'> {
|
|
19
19
|
suffixIcon?: React.ReactNode;
|
|
20
20
|
size?: SelectType;
|
|
@@ -30,7 +30,7 @@ export interface SelectProps<ValueType = any, OptionType extends BaseOptionType
|
|
|
30
30
|
declare const Select: (<ValueType = any, OptionType extends DefaultOptionType | BaseOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
|
|
31
31
|
children?: React.ReactNode;
|
|
32
32
|
} & {
|
|
33
|
-
ref?:
|
|
33
|
+
ref?: React.Ref<BaseSelectRef> | undefined;
|
|
34
34
|
}) => React.ReactElement) & {
|
|
35
35
|
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
|
|
36
36
|
Option: typeof Option;
|