doui-react 1.0.2 → 2.0.1-dev
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/api/component/common.d.ts +2 -2
- package/es/api/component/common.js +3 -0
- package/es/api/component/global-style.d.ts +0 -1
- package/es/api/component/global-style.js +2 -3
- package/es/api/component/react-dom.js +20 -28
- package/es/button/component/index.js +8 -9
- package/es/button/type/index.d.ts +3 -7
- package/es/checkbox/type/index.d.ts +1 -1
- package/es/date-picker/component/index.js +13 -17
- package/es/date-picker/type/index.d.ts +5 -14
- package/es/form/component/constant.js +2 -2
- package/es/form/component/form-item-map.d.ts +2 -1
- package/es/form/component/form-item-map.js +2 -1
- package/es/form/component/form-item.js +1 -3
- package/es/form/component/form-list.d.ts +2 -2
- package/es/form/component/utils.d.ts +37 -27
- package/es/form/component/utils.js +2 -2
- package/es/form/style/form-item.d.ts +1 -1
- package/es/form/style/form-item.js +4 -11
- package/es/form/style/index.js +2 -2
- package/es/form/type/form-item.d.ts +5 -6
- package/es/form/type/form-list.d.ts +2 -2
- package/es/form/type/index.d.ts +3 -3
- package/es/grid/component/pagination.d.ts +72 -15
- package/es/hooks/hook/use-fetch.js +5 -12
- package/es/icon/hook/index.d.ts +108 -103
- package/es/input/component/number.d.ts +1 -1
- package/es/input/component/number.js +8 -30
- package/es/input/component/utils.d.ts +0 -1
- package/es/input/component/utils.js +0 -3
- package/es/input/type/index.d.ts +3 -3
- package/es/modal-prompt/component/utils.js +2 -1
- package/es/modal-prompt/type/index.d.ts +2 -2
- package/es/open-modal/component/footer.d.ts +1 -1
- package/es/open-modal/component/footer.js +2 -4
- package/es/open-modal/component/index.js +16 -1
- package/es/open-modal/component/modal.js +16 -6
- package/es/open-modal/component/utils.js +2 -6
- package/es/open-modal/hook/use-modal.js +1 -1
- package/es/open-modal/style/index.js +2 -2
- package/es/open-modal/style/wrap.js +1 -1
- package/es/open-modal/type/index.d.ts +6 -1
- package/es/radio/component/abstract-box.d.ts +68 -96
- package/es/radio/component/abstract-box.js +1 -5
- package/es/radio/component/use-radio.d.ts +7 -5
- package/es/radio/component/utils.js +1 -1
- package/es/radio/type/index.d.ts +2 -2
- package/es/select/component/use-select-options.d.ts +1 -1
- package/es/select/component/use-select-options.js +5 -2
- package/es/select/component/use-select.js +4 -7
- package/es/select/component/utils.d.ts +1 -2
- package/es/select/type/index.d.ts +3 -2
- package/es/stack/style/index.d.ts +2 -1
- package/es/switch/type/index.d.ts +2 -2
- package/es/table/component/action-button.js +0 -1
- package/es/table/component/filter.d.ts +1 -1
- package/es/table/component/filter.js +1 -1
- package/es/table/component/sort.d.ts +1 -1
- package/es/table/component/time.js +2 -2
- package/es/table/component/utils.d.ts +3 -77
- package/es/table/component/utils.js +5 -8
- package/es/table/hook/search.d.ts +1 -1
- package/es/table/hook/search.js +8 -6
- package/es/table/type/action.d.ts +2 -7
- package/es/table/type/column.d.ts +3 -3
- package/es/tabs/component/utils.d.ts +8 -8
- package/es/tabs/type/index.d.ts +1 -1
- package/es/text/component/index.js +15 -16
- package/es/text/component/use-text.d.ts +3 -2
- package/es/text/component/use-text.js +12 -19
- package/es/text/component/utils.d.ts +1 -1
- package/es/text/style/index.js +1 -1
- package/es/text/type/index.d.ts +2 -2
- package/es/tooltip/component/index.d.ts +34 -24
- package/es/tooltip/component/index.js +6 -2
- package/es/tooltip/type/index.d.ts +1 -1
- package/es/tree/component/index.d.ts +1 -1
- package/es/tree/style/index.js +1 -1
- package/es/tree-select/component/use-tree-select.js +4 -4
- package/es/tree-select/style/index.js +1 -1
- package/es/virtual-list/component/index.d.ts +1 -1
- package/es/virtual-list/component/index.js +4 -2
- package/es/virtual-list/type/index.d.ts +2 -1
- package/lib/api/component/common.d.ts +2 -2
- package/lib/api/component/common.js +3 -0
- package/lib/api/component/global-style.d.ts +0 -1
- package/lib/api/component/global-style.js +3 -4
- package/lib/api/component/react-dom.js +22 -30
- package/lib/button/component/index.js +8 -9
- package/lib/button/type/index.d.ts +3 -7
- package/lib/checkbox/type/index.d.ts +1 -1
- package/lib/date-picker/component/index.js +13 -17
- package/lib/date-picker/type/index.d.ts +5 -14
- package/lib/form/component/constant.js +2 -2
- package/lib/form/component/form-item-map.d.ts +2 -1
- package/lib/form/component/form-item-map.js +2 -1
- package/lib/form/component/form-item.js +1 -3
- package/lib/form/component/form-list.d.ts +2 -2
- package/lib/form/component/utils.d.ts +37 -27
- package/lib/form/component/utils.js +2 -2
- package/lib/form/style/form-item.d.ts +1 -1
- package/lib/form/style/form-item.js +4 -11
- package/lib/form/style/index.js +1 -1
- package/lib/form/type/form-item.d.ts +5 -6
- package/lib/form/type/form-list.d.ts +2 -2
- package/lib/form/type/index.d.ts +3 -3
- package/lib/grid/component/pagination.d.ts +72 -15
- package/lib/hooks/hook/use-fetch.js +5 -12
- package/lib/icon/hook/index.d.ts +108 -103
- package/lib/input/component/number.d.ts +1 -1
- package/lib/input/component/number.js +7 -28
- package/lib/input/component/utils.d.ts +0 -1
- package/lib/input/component/utils.js +0 -4
- package/lib/input/type/index.d.ts +3 -3
- package/lib/modal-prompt/component/utils.js +2 -1
- package/lib/modal-prompt/type/index.d.ts +2 -2
- package/lib/open-modal/component/footer.d.ts +1 -1
- package/lib/open-modal/component/footer.js +2 -4
- package/lib/open-modal/component/index.js +17 -1
- package/lib/open-modal/component/modal.js +14 -4
- package/lib/open-modal/component/utils.js +2 -6
- package/lib/open-modal/hook/use-modal.js +1 -1
- package/lib/open-modal/style/index.js +1 -1
- package/lib/open-modal/style/wrap.js +1 -1
- package/lib/open-modal/type/index.d.ts +6 -1
- package/lib/radio/component/abstract-box.d.ts +68 -96
- package/lib/radio/component/abstract-box.js +1 -5
- package/lib/radio/component/use-radio.d.ts +7 -5
- package/lib/radio/component/utils.js +1 -1
- package/lib/radio/type/index.d.ts +2 -2
- package/lib/select/component/use-select-options.d.ts +1 -1
- package/lib/select/component/use-select-options.js +5 -2
- package/lib/select/component/use-select.js +4 -7
- package/lib/select/component/utils.d.ts +1 -2
- package/lib/select/type/index.d.ts +3 -2
- package/lib/stack/style/index.d.ts +2 -1
- package/lib/switch/type/index.d.ts +2 -2
- package/lib/table/component/action-button.js +0 -1
- package/lib/table/component/filter.d.ts +1 -1
- package/lib/table/component/filter.js +1 -1
- package/lib/table/component/sort.d.ts +1 -1
- package/lib/table/component/time.js +2 -2
- package/lib/table/component/utils.d.ts +3 -77
- package/lib/table/component/utils.js +5 -8
- package/lib/table/hook/search.d.ts +1 -1
- package/lib/table/hook/search.js +8 -6
- package/lib/table/type/action.d.ts +2 -7
- package/lib/table/type/column.d.ts +3 -3
- package/lib/tabs/component/utils.d.ts +8 -8
- package/lib/tabs/type/index.d.ts +1 -1
- package/lib/text/component/index.js +15 -16
- package/lib/text/component/use-text.d.ts +3 -2
- package/lib/text/component/use-text.js +11 -18
- package/lib/text/component/utils.d.ts +1 -1
- package/lib/text/style/index.js +1 -1
- package/lib/text/type/index.d.ts +2 -2
- package/lib/tooltip/component/index.d.ts +34 -24
- package/lib/tooltip/component/index.js +6 -2
- package/lib/tooltip/type/index.d.ts +1 -1
- package/lib/tree/component/index.d.ts +1 -1
- package/lib/tree/style/index.js +1 -1
- package/lib/tree-select/component/use-tree-select.js +4 -4
- package/lib/tree-select/style/index.js +1 -1
- package/lib/virtual-list/component/index.d.ts +1 -1
- package/lib/virtual-list/component/index.js +4 -2
- package/lib/virtual-list/type/index.d.ts +2 -1
- package/package.json +10 -13
|
@@ -5,12 +5,11 @@ import { useFormContext } from "../../form";
|
|
|
5
5
|
import { Portal } from "../../portal";
|
|
6
6
|
import { HStack } from "../../stack";
|
|
7
7
|
import { cx } from '@emotion/css';
|
|
8
|
-
import _ from 'lodash';
|
|
9
8
|
import { useMount } from 'react-use';
|
|
10
9
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
11
10
|
export function Footer(_ref) {
|
|
12
11
|
var className = _ref.className,
|
|
13
|
-
|
|
12
|
+
children = _ref.children,
|
|
14
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
14
|
var _useFormContext = useFormContext(),
|
|
16
15
|
setModalProps = _useFormContext.setModalProps;
|
|
@@ -19,7 +18,6 @@ export function Footer(_ref) {
|
|
|
19
18
|
footer: null
|
|
20
19
|
});
|
|
21
20
|
});
|
|
22
|
-
var component = _.isFunction(Children) ? _jsx(Children, {}) : Children;
|
|
23
21
|
return _jsx(Portal, {
|
|
24
22
|
container: function container(current) {
|
|
25
23
|
return current.closest('.ant-modal-content');
|
|
@@ -28,7 +26,7 @@ export function Footer(_ref) {
|
|
|
28
26
|
className: cx('ant-modal-footer', className),
|
|
29
27
|
justify: "right"
|
|
30
28
|
}, props), {}, {
|
|
31
|
-
children:
|
|
29
|
+
children: children
|
|
32
30
|
}))
|
|
33
31
|
});
|
|
34
32
|
}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["configProviderProps"];
|
|
1
4
|
import { mountComponent, unmountComponent } from "../../api";
|
|
5
|
+
import { ConfigProvider } from 'antd';
|
|
6
|
+
import zhCN from 'antd/es/locale/zh_CN';
|
|
2
7
|
import { Modal } from "./modal";
|
|
8
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
3
9
|
export * from "./modal";
|
|
10
|
+
function ModalWrapper(_ref) {
|
|
11
|
+
var configProviderProps = _ref.configProviderProps,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
return _jsx(ConfigProvider, _objectSpread(_objectSpread({
|
|
14
|
+
locale: zhCN
|
|
15
|
+
}, configProviderProps), {}, {
|
|
16
|
+
children: _jsx(Modal, _objectSpread({}, props))
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
4
19
|
export function openModal(props) {
|
|
5
|
-
return mountComponent(
|
|
20
|
+
return mountComponent(ModalWrapper, props);
|
|
6
21
|
}
|
|
7
22
|
export function closeModal() {
|
|
8
23
|
unmountComponent();
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { getClassName } from "../../api";
|
|
2
3
|
import { Form } from "../../form";
|
|
3
4
|
import { Text } from "../../text";
|
|
4
|
-
import { Modal as AntdModal } from 'antd';
|
|
5
|
+
import { Modal as AntdModal, Divider } from 'antd';
|
|
5
6
|
import { ModalProvider } from "../hook";
|
|
6
7
|
import { Footer } from "./footer";
|
|
7
8
|
import { Title } from "./title";
|
|
8
9
|
import { useModal } from "./use-modal";
|
|
9
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
10
11
|
export var Modal = function Modal(props) {
|
|
11
12
|
var _useModal = useModal(props),
|
|
12
13
|
context = _useModal.context,
|
|
@@ -17,9 +18,9 @@ export var Modal = function Modal(props) {
|
|
|
17
18
|
ok = context.ok,
|
|
18
19
|
close = context.close;
|
|
19
20
|
return _jsx(ModalProvider, _objectSpread(_objectSpread({}, context), {}, {
|
|
20
|
-
children:
|
|
21
|
+
children: _jsxs(AntdModal, _objectSpread(_objectSpread({
|
|
21
22
|
open: open,
|
|
22
|
-
|
|
23
|
+
destroyOnHidden: true
|
|
23
24
|
}, modalProps), {}, {
|
|
24
25
|
title: _jsx(Text, {
|
|
25
26
|
children: modalProps.title
|
|
@@ -27,9 +28,18 @@ export var Modal = function Modal(props) {
|
|
|
27
28
|
confirmLoading: confirmLoading,
|
|
28
29
|
onCancel: close,
|
|
29
30
|
onOk: ok,
|
|
30
|
-
children: _jsx(
|
|
31
|
+
children: [_jsx(Divider, {
|
|
32
|
+
style: {
|
|
33
|
+
margin: '15px 0 24px'
|
|
34
|
+
}
|
|
35
|
+
}), _jsx(Form, _objectSpread(_objectSpread({}, formProps), {}, {
|
|
31
36
|
context: context
|
|
32
|
-
}))
|
|
37
|
+
})), _jsx(Divider, {
|
|
38
|
+
className: getClassName('footer-divider'),
|
|
39
|
+
style: {
|
|
40
|
+
margin: '15px 0 20px'
|
|
41
|
+
}
|
|
42
|
+
})]
|
|
33
43
|
}))
|
|
34
44
|
}));
|
|
35
45
|
};
|
|
@@ -73,7 +73,7 @@ export function getModalAndFormProps(props) {
|
|
|
73
73
|
footer: _.isNull(formProps.footer) ? null : undefined,
|
|
74
74
|
// 为 null 时,不显示 footer
|
|
75
75
|
css: style.wrapper({
|
|
76
|
-
bodyBottomMargin: getBodyBottomMargin(bodyBottomMargin
|
|
76
|
+
bodyBottomMargin: getBodyBottomMargin(bodyBottomMargin),
|
|
77
77
|
titleCenter: titleCenter
|
|
78
78
|
}),
|
|
79
79
|
style: modalProps.centered ? {} : {
|
|
@@ -86,14 +86,10 @@ export function getModalAndFormProps(props) {
|
|
|
86
86
|
modalProps: mergedModalProps
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function getBodyBottomMargin(bodyBottomMargin
|
|
90
|
-
var _formProps$items;
|
|
89
|
+
function getBodyBottomMargin(bodyBottomMargin) {
|
|
91
90
|
if (!_.isNil(bodyBottomMargin)) {
|
|
92
91
|
return transformValueWithStyleUnit(bodyBottomMargin);
|
|
93
92
|
}
|
|
94
|
-
if ((_formProps$items = formProps.items) !== null && _formProps$items !== void 0 && _formProps$items.length) {
|
|
95
|
-
return '10px';
|
|
96
|
-
}
|
|
97
93
|
}
|
|
98
94
|
export function shouldEnableButton(_ref2) {
|
|
99
95
|
var _onValidate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import usePatchElement from 'antd/
|
|
3
|
+
import usePatchElement from 'antd/es/_util/hooks/usePatchElement';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { Modal } from "../component";
|
|
6
6
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../../api";
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
5
|
function titleStyle(titleCenter) {
|
|
6
6
|
if (titleCenter) {
|
|
@@ -12,7 +12,7 @@ var style = {
|
|
|
12
12
|
wrapper: function wrapper(_ref) {
|
|
13
13
|
var bodyBottomMargin = _ref.bodyBottomMargin,
|
|
14
14
|
titleCenter = _ref.titleCenter;
|
|
15
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
15
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-modal-title {\n font-size: 16px;\n ", "\n }\n\n .ant-modal-body {\n padding-bottom: ", ";\n }\n\n &:not(:has(.ant-modal-footer)) {\n .", " {\n display: none;\n }\n }\n "])), titleStyle(titleCenter), bodyBottomMargin, getClassName('footer-divider'));
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
export default style;
|
|
@@ -2,5 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/css';
|
|
4
4
|
export function getWrapStyle(wrapStyle) {
|
|
5
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
5
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n "])), wrapStyle);
|
|
6
6
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FunctionReturn } from "../../api";
|
|
2
2
|
import { FormInstance, FormItemProps, FormProps, FormValues } from "../../form";
|
|
3
3
|
import { CSSObject } from '@emotion/react';
|
|
4
|
-
import {
|
|
4
|
+
import { ConfigProviderProps } from 'antd/es/config-provider';
|
|
5
|
+
import type { ModalProps as AntdModalProps } from 'antd/es/modal';
|
|
5
6
|
import { ReactNode } from 'react';
|
|
6
7
|
type AntdComponentProps = Omit<AntdModalProps, 'onOk' | 'children'> & Omit<FormProps, 'children' | 'content' | 'title'>;
|
|
7
8
|
/**
|
|
@@ -46,6 +47,10 @@ export interface OpenModalProps extends AntdComponentProps {
|
|
|
46
47
|
* @description 对话框外层容器的样式
|
|
47
48
|
*/
|
|
48
49
|
wrapStyle?: CSSObject;
|
|
50
|
+
/**
|
|
51
|
+
* @description Antd Provider Props
|
|
52
|
+
*/
|
|
53
|
+
configProviderProps?: Omit<ConfigProviderProps, 'children'>;
|
|
49
54
|
/**
|
|
50
55
|
* @description 点击取消按钮的回调
|
|
51
56
|
*/
|
|
@@ -1,92 +1,60 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseBoxProps } from "..";
|
|
3
3
|
import type { SerializedStyles } from '@emotion/utils';
|
|
4
|
-
import { CheckboxChangeEvent } from 'antd/
|
|
4
|
+
import { CheckboxChangeEvent } from 'antd/es/checkbox/Checkbox';
|
|
5
5
|
export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGroup, ...props }: BaseBoxProps): {
|
|
6
6
|
highlightTextProps: Partial<BaseBoxProps>;
|
|
7
7
|
tooltipProps: {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
color?: string | undefined;
|
|
9
|
+
title?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
|
|
10
|
+
overlay?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
|
|
11
|
+
styles?: Partial<Record<"body" | "root", import("react").CSSProperties>> | undefined;
|
|
12
|
+
classNames?: Partial<Record<"body" | "root", string>> | undefined;
|
|
10
13
|
style?: import("react").CSSProperties | undefined;
|
|
11
14
|
className?: string | undefined;
|
|
12
|
-
|
|
13
|
-
placement?: import("antd/
|
|
14
|
-
builtinPlacements?: import("rc-trigger").BuildInPlacements | undefined;
|
|
15
|
+
rootClassName?: string | undefined;
|
|
16
|
+
placement?: import("antd/es/tooltip").TooltipPlacement | undefined;
|
|
17
|
+
builtinPlacements?: import("@rc-component/trigger").BuildInPlacements | undefined;
|
|
15
18
|
openClassName?: string | undefined;
|
|
16
19
|
arrowPointAtCenter?: boolean | undefined;
|
|
17
|
-
|
|
20
|
+
arrow?: boolean | {
|
|
21
|
+
arrowPointAtCenter?: boolean | undefined;
|
|
22
|
+
pointAtCenter?: boolean | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
autoAdjustOverflow?: boolean | import("antd/es/tooltip").AdjustOverflow | undefined;
|
|
18
25
|
getPopupContainer?: ((triggerNode: HTMLElement) => HTMLElement) | undefined;
|
|
19
26
|
children?: import("react").ReactNode;
|
|
20
|
-
|
|
27
|
+
destroyTooltipOnHide?: boolean | {
|
|
28
|
+
keepParent?: boolean | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
destroyOnHidden?: boolean | undefined;
|
|
21
31
|
open?: boolean | undefined;
|
|
22
|
-
defaultVisible?: boolean | undefined;
|
|
23
32
|
defaultOpen?: boolean | undefined;
|
|
24
|
-
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
25
33
|
onOpenChange?: ((visible: boolean) => void) | undefined;
|
|
26
|
-
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
27
34
|
afterOpenChange?: ((visible: boolean) => void) | undefined;
|
|
28
|
-
zIndex?: number | undefined;
|
|
29
|
-
animation?: string | undefined;
|
|
30
|
-
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
31
|
-
id?: string | undefined;
|
|
32
|
-
prefixCls?: string | undefined;
|
|
33
|
-
onPopupAlign?: ((element: HTMLElement, align: import("rc-trigger/lib/interface").AlignType) => void) | undefined;
|
|
34
|
-
trigger?: string | string[] | undefined;
|
|
35
|
-
transitionName?: string | undefined;
|
|
36
|
-
overlayStyle?: import("react").CSSProperties | undefined;
|
|
37
|
-
overlayClassName?: string | undefined;
|
|
38
|
-
mouseEnterDelay?: number | undefined;
|
|
39
|
-
mouseLeaveDelay?: number | undefined;
|
|
40
|
-
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
41
|
-
destroyTooltipOnHide?: boolean | {
|
|
42
|
-
keepParent?: boolean | undefined;
|
|
43
|
-
} | undefined;
|
|
44
|
-
align: import("rc-trigger/lib/interface").AlignType;
|
|
45
|
-
showArrow?: boolean | undefined;
|
|
46
|
-
arrowContent?: import("react").ReactNode;
|
|
47
|
-
popupVisible?: boolean | undefined;
|
|
48
|
-
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
49
|
-
} | {
|
|
50
|
-
title?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
|
|
51
|
-
overlay?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
|
|
52
|
-
style?: import("react").CSSProperties | undefined;
|
|
53
|
-
className?: string | undefined;
|
|
54
|
-
color?: string | undefined;
|
|
55
|
-
placement?: import("antd/lib/tooltip").TooltipPlacement | undefined;
|
|
56
|
-
builtinPlacements?: import("rc-trigger").BuildInPlacements | undefined;
|
|
57
|
-
openClassName?: string | undefined;
|
|
58
|
-
arrowPointAtCenter?: boolean | undefined;
|
|
59
|
-
autoAdjustOverflow?: boolean | import("antd/lib/tooltip").AdjustOverflow | undefined;
|
|
60
|
-
getPopupContainer?: ((triggerNode: HTMLElement) => HTMLElement) | undefined;
|
|
61
|
-
children?: import("react").ReactNode;
|
|
62
35
|
visible?: boolean | undefined;
|
|
63
|
-
open?: boolean | undefined;
|
|
64
36
|
defaultVisible?: boolean | undefined;
|
|
65
|
-
defaultOpen?: boolean | undefined;
|
|
66
37
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
67
|
-
onOpenChange?: ((visible: boolean) => void) | undefined;
|
|
68
38
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
69
|
-
afterOpenChange?: ((visible: boolean) => void) | undefined;
|
|
70
|
-
zIndex?: number | undefined;
|
|
71
39
|
animation?: string | undefined;
|
|
72
|
-
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
73
|
-
id?: string | undefined;
|
|
74
|
-
prefixCls?: string | undefined;
|
|
75
|
-
onPopupAlign?: ((element: HTMLElement, align: import("rc-trigger/lib/interface").AlignType) => void) | undefined;
|
|
76
|
-
trigger?: string | string[] | undefined;
|
|
77
40
|
transitionName?: string | undefined;
|
|
78
|
-
|
|
79
|
-
|
|
41
|
+
prefixCls?: string | undefined;
|
|
42
|
+
zIndex?: number | undefined;
|
|
43
|
+
forceRender?: boolean | undefined;
|
|
44
|
+
id?: string | undefined;
|
|
45
|
+
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
46
|
+
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
80
47
|
mouseEnterDelay?: number | undefined;
|
|
81
48
|
mouseLeaveDelay?: number | undefined;
|
|
49
|
+
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
50
|
+
overlayClassName?: string | undefined;
|
|
51
|
+
overlayStyle?: import("react").CSSProperties | undefined;
|
|
52
|
+
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
53
|
+
popupVisible?: boolean | undefined;
|
|
54
|
+
fresh?: boolean | undefined;
|
|
82
55
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
83
|
-
|
|
84
|
-
keepParent?: boolean | undefined;
|
|
85
|
-
} | undefined;
|
|
86
|
-
align: import("rc-trigger/lib/interface").AlignType;
|
|
87
|
-
showArrow?: boolean | undefined;
|
|
56
|
+
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
88
57
|
arrowContent?: import("react").ReactNode;
|
|
89
|
-
popupVisible?: boolean | undefined;
|
|
90
58
|
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
91
59
|
};
|
|
92
60
|
boxProps: {
|
|
@@ -97,48 +65,45 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
97
65
|
value?: any;
|
|
98
66
|
boxTooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
99
67
|
inGroup?: boolean | undefined;
|
|
100
|
-
style?: import("react").CSSProperties | undefined;
|
|
101
|
-
type?: string | undefined;
|
|
102
68
|
className?: string | undefined;
|
|
103
|
-
|
|
69
|
+
style?: import("react").CSSProperties | undefined;
|
|
70
|
+
title?: string | undefined;
|
|
71
|
+
prefixCls?: string | undefined;
|
|
72
|
+
rootClassName?: string | undefined;
|
|
73
|
+
name?: string | undefined;
|
|
74
|
+
disabled?: boolean | undefined;
|
|
104
75
|
defaultChecked?: boolean | undefined;
|
|
105
76
|
autoFocus?: boolean | undefined;
|
|
106
77
|
id?: string | undefined;
|
|
107
78
|
tabIndex?: number | undefined;
|
|
108
79
|
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
109
80
|
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
81
|
+
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
110
82
|
onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
111
83
|
onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
112
|
-
|
|
113
|
-
name?: string | undefined;
|
|
114
|
-
prefixCls?: string | undefined;
|
|
84
|
+
type?: string | undefined;
|
|
115
85
|
checked?: boolean | undefined;
|
|
116
86
|
indeterminate?: boolean | undefined;
|
|
117
87
|
skipGroup?: boolean | undefined;
|
|
118
|
-
|
|
119
|
-
tooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
120
|
-
autoShowTooltip?: boolean | undefined;
|
|
88
|
+
required?: boolean | undefined;
|
|
121
89
|
slot?: string | undefined;
|
|
122
|
-
|
|
123
|
-
accessKey?: string | undefined;
|
|
124
|
-
color?: string | undefined;
|
|
90
|
+
dir?: string | undefined;
|
|
125
91
|
content?: string | undefined;
|
|
126
|
-
|
|
127
|
-
translate?: "yes" | "no" | undefined;
|
|
92
|
+
onSubmit?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
128
93
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
129
94
|
suppressContentEditableWarning?: boolean | undefined;
|
|
130
95
|
suppressHydrationWarning?: boolean | undefined;
|
|
131
|
-
|
|
132
|
-
|
|
96
|
+
accessKey?: string | undefined;
|
|
97
|
+
autoCapitalize?: (string & {}) | "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
98
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
133
99
|
contextMenu?: string | undefined;
|
|
134
|
-
dir?: string | undefined;
|
|
135
100
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
136
|
-
enterKeyHint?: "search" | "
|
|
101
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
137
102
|
hidden?: boolean | undefined;
|
|
138
103
|
lang?: string | undefined;
|
|
139
104
|
nonce?: string | undefined;
|
|
140
|
-
placeholder?: string | undefined;
|
|
141
105
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
106
|
+
translate?: "yes" | "no" | undefined;
|
|
142
107
|
radioGroup?: string | undefined;
|
|
143
108
|
role?: import("react").AriaRole | undefined;
|
|
144
109
|
about?: string | undefined;
|
|
@@ -153,6 +118,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
153
118
|
vocab?: string | undefined;
|
|
154
119
|
autoCorrect?: string | undefined;
|
|
155
120
|
autoSave?: string | undefined;
|
|
121
|
+
color?: string | undefined;
|
|
156
122
|
itemProp?: string | undefined;
|
|
157
123
|
itemScope?: boolean | undefined;
|
|
158
124
|
itemType?: string | undefined;
|
|
@@ -161,48 +127,55 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
161
127
|
results?: number | undefined;
|
|
162
128
|
security?: string | undefined;
|
|
163
129
|
unselectable?: "off" | "on" | undefined;
|
|
164
|
-
inputMode?: "search" | "
|
|
130
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
165
131
|
is?: string | undefined;
|
|
132
|
+
exportparts?: string | undefined;
|
|
133
|
+
part?: string | undefined;
|
|
166
134
|
"aria-activedescendant"?: string | undefined;
|
|
167
135
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
168
|
-
"aria-autocomplete"?: "
|
|
136
|
+
"aria-autocomplete"?: "inline" | "none" | "list" | "both" | undefined;
|
|
137
|
+
"aria-braillelabel"?: string | undefined;
|
|
138
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
169
139
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
170
140
|
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
171
141
|
"aria-colcount"?: number | undefined;
|
|
172
142
|
"aria-colindex"?: number | undefined;
|
|
143
|
+
"aria-colindextext"?: string | undefined;
|
|
173
144
|
"aria-colspan"?: number | undefined;
|
|
174
145
|
"aria-controls"?: string | undefined;
|
|
175
|
-
"aria-current"?: boolean | "time" | "
|
|
146
|
+
"aria-current"?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
176
147
|
"aria-describedby"?: string | undefined;
|
|
148
|
+
"aria-description"?: string | undefined;
|
|
177
149
|
"aria-details"?: string | undefined;
|
|
178
150
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
179
|
-
"aria-dropeffect"?: "
|
|
151
|
+
"aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
180
152
|
"aria-errormessage"?: string | undefined;
|
|
181
153
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
182
154
|
"aria-flowto"?: string | undefined;
|
|
183
155
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
184
|
-
"aria-haspopup"?: boolean | "dialog" | "menu" | "
|
|
156
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "tree" | "true" | "false" | "grid" | "listbox" | undefined;
|
|
185
157
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
186
158
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
187
159
|
"aria-keyshortcuts"?: string | undefined;
|
|
188
|
-
|
|
160
|
+
'aria-label'?: string | undefined;
|
|
189
161
|
"aria-labelledby"?: string | undefined;
|
|
190
162
|
"aria-level"?: number | undefined;
|
|
191
163
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
192
164
|
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
193
165
|
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
194
166
|
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
195
|
-
"aria-orientation"?: "
|
|
167
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
196
168
|
"aria-owns"?: string | undefined;
|
|
197
169
|
"aria-placeholder"?: string | undefined;
|
|
198
170
|
"aria-posinset"?: number | undefined;
|
|
199
171
|
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
200
172
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
201
|
-
"aria-relevant"?: "text" | "
|
|
173
|
+
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
202
174
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
203
175
|
"aria-roledescription"?: string | undefined;
|
|
204
176
|
"aria-rowcount"?: number | undefined;
|
|
205
177
|
"aria-rowindex"?: number | undefined;
|
|
178
|
+
"aria-rowindextext"?: string | undefined;
|
|
206
179
|
"aria-rowspan"?: number | undefined;
|
|
207
180
|
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
208
181
|
"aria-setsize"?: number | undefined;
|
|
@@ -226,18 +199,15 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
226
199
|
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLElement> | undefined;
|
|
227
200
|
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLElement> | undefined;
|
|
228
201
|
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLElement> | undefined;
|
|
229
|
-
onFocus?: import("react").FocusEventHandler<HTMLElement> | undefined;
|
|
230
202
|
onFocusCapture?: import("react").FocusEventHandler<HTMLElement> | undefined;
|
|
231
|
-
onBlur?: import("react").FocusEventHandler<HTMLElement> | undefined;
|
|
232
203
|
onBlurCapture?: import("react").FocusEventHandler<HTMLElement> | undefined;
|
|
233
204
|
onChangeCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
234
|
-
onBeforeInput?: import("react").
|
|
205
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLElement> | undefined;
|
|
235
206
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
236
207
|
onInput?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
237
208
|
onInputCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
238
209
|
onReset?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
239
210
|
onResetCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
240
|
-
onSubmit?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
241
211
|
onSubmitCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
242
212
|
onInvalid?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
243
213
|
onInvalidCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
@@ -345,9 +315,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
345
315
|
onPointerCancel?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
346
316
|
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
347
317
|
onPointerEnter?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
348
|
-
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
349
318
|
onPointerLeave?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
350
|
-
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
351
319
|
onPointerOver?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
352
320
|
onPointerOverCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
353
321
|
onPointerOut?: import("react").PointerEventHandler<HTMLElement> | undefined;
|
|
@@ -368,6 +336,10 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
368
336
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
|
|
369
337
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
370
338
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
339
|
+
direction?: import("antd/es/config-provider").DirectionType;
|
|
340
|
+
rows?: number | false | undefined;
|
|
341
|
+
tooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
342
|
+
autoShowTooltip?: boolean | undefined;
|
|
371
343
|
refs?: import("../../api").Refs | undefined;
|
|
372
344
|
ref: import("../../api").Refs | undefined;
|
|
373
345
|
};
|
|
@@ -45,11 +45,7 @@ export function useAbstractBox(_ref2) {
|
|
|
45
45
|
var _parseHighlightTextAn = parseHighlightTextAndRestProps(props),
|
|
46
46
|
highlightTextProps = _parseHighlightTextAn.highlightTextProps,
|
|
47
47
|
restProps = _parseHighlightTextAn.restProps;
|
|
48
|
-
var tooltipProps = _objectSpread({
|
|
49
|
-
align: {
|
|
50
|
-
offset: [0, 1]
|
|
51
|
-
}
|
|
52
|
-
}, generateTooltip(boxTooltip));
|
|
48
|
+
var tooltipProps = _objectSpread({}, generateTooltip(boxTooltip));
|
|
53
49
|
var boxProps = _objectSpread(_objectSpread({
|
|
54
50
|
ref: refs
|
|
55
51
|
}, restProps), {}, _defineProperty(_defineProperty({}, inGroup ? 'value' : 'checked', value), "onChange", function onChange(e) {
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RadioProps } from "..";
|
|
3
|
-
import { RadioChangeEvent } from 'antd/
|
|
3
|
+
import { RadioChangeEvent } from 'antd/es/radio/interface';
|
|
4
4
|
export declare function useRadio({ onChange, ...props }: RadioProps): {
|
|
5
5
|
options: any[];
|
|
6
6
|
onChange: (e: RadioChangeEvent) => void;
|
|
7
7
|
defaultValue?: any;
|
|
8
8
|
value: any;
|
|
9
|
-
size?: import("antd/
|
|
10
|
-
disabled?:
|
|
9
|
+
size?: import("antd/es/button").ButtonSize;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
11
|
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
12
12
|
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
13
13
|
name?: string | undefined;
|
|
14
14
|
children?: import("react").ReactNode;
|
|
15
15
|
id?: string | undefined;
|
|
16
|
-
optionType?: import("antd/
|
|
17
|
-
buttonStyle?: import("antd/
|
|
16
|
+
optionType?: import("antd/es/radio/interface").RadioGroupOptionType | undefined;
|
|
17
|
+
buttonStyle?: import("antd/es/radio/interface").RadioGroupButtonStyle | undefined;
|
|
18
18
|
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
19
19
|
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
20
|
+
block?: boolean | undefined;
|
|
20
21
|
prefixCls?: string | undefined;
|
|
21
22
|
className?: string | undefined;
|
|
23
|
+
rootClassName?: string | undefined;
|
|
22
24
|
style?: import("react").CSSProperties | undefined;
|
|
23
25
|
};
|
|
@@ -5,7 +5,7 @@ import { highlightTextPropKeys } from "../../select/component/constant";
|
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
export function parseHighlightTextAndRestProps(props) {
|
|
7
7
|
var highlightTextProps = _.pick(props, highlightTextPropKeys);
|
|
8
|
-
var restProps = _.omit(props, [].concat(_toConsumableArray(highlightTextPropKeys), ['__callback__', 'showAll', 'isNoMatchSearchText', 'shouldRerenderOptions', '__filterNotExistValue__']));
|
|
8
|
+
var restProps = _.omit(props, [].concat(_toConsumableArray(highlightTextPropKeys), ['__callback__', '__callbackDeps__', 'showAll', 'isNoMatchSearchText', 'shouldRerenderOptions', '__filterNotExistValue__']));
|
|
9
9
|
return {
|
|
10
10
|
highlightTextProps: highlightTextProps,
|
|
11
11
|
restProps: restProps
|
package/es/radio/type/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { BaseComponentProps, BaseFlexProps } from "../../api";
|
|
|
2
2
|
import { BaseSelectProps } from "../../select";
|
|
3
3
|
import { TextProps } from "../../text";
|
|
4
4
|
import { RadioGroupProps } from 'antd';
|
|
5
|
-
import { CheckboxProps as AntdCheckboxProps } from 'antd/
|
|
5
|
+
import { CheckboxProps as AntdCheckboxProps } from 'antd/es/checkbox/Checkbox';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
|
-
export interface BaseBoxProps extends Omit<AntdCheckboxProps, 'onChange'>, TextProps, BaseComponentProps {
|
|
7
|
+
export interface BaseBoxProps extends Omit<AntdCheckboxProps, 'onChange' | 'onBlur' | 'onFocus'>, Omit<TextProps, 'onBlur' | 'onFocus'>, BaseComponentProps {
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
text?: ReactNode;
|
|
10
10
|
/**
|
|
@@ -3,7 +3,7 @@ interface DisplayValueProps extends Pick<BaseSelectProps, 'value' | 'options'> {
|
|
|
3
3
|
filterNotExistValue?: boolean;
|
|
4
4
|
}
|
|
5
5
|
export declare function getDisplayValue({ value, options, filterNotExistValue }: DisplayValueProps): any;
|
|
6
|
-
export declare function useSelectOptions<T = any>({ value, loading, options, __callback__, shouldRerenderOptions, __filterNotExistValue__: filterNotExistValue, ...props }: BaseSelectProps): T & {
|
|
6
|
+
export declare function useSelectOptions<T = any>({ value, loading, options, __callback__, __callbackDeps__, shouldRerenderOptions, __filterNotExistValue__: filterNotExistValue, ...props }: BaseSelectProps): T & {
|
|
7
7
|
value: any;
|
|
8
8
|
options: import("..").SelectOptions | undefined;
|
|
9
9
|
displayOptions: any[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["value", "loading", "options", "__callback__", "shouldRerenderOptions", "__filterNotExistValue__"];
|
|
4
|
+
var _excluded = ["value", "loading", "options", "__callback__", "__callbackDeps__", "shouldRerenderOptions", "__filterNotExistValue__"];
|
|
4
5
|
import { useFormContext } from "../../form";
|
|
5
6
|
import { isValueNotExistInOptions } from "../../form/component/utils";
|
|
6
7
|
import { useDeepMemo } from "../../hooks";
|
|
@@ -36,6 +37,8 @@ export function useSelectOptions(_ref2) {
|
|
|
36
37
|
loading = _ref2.loading,
|
|
37
38
|
options = _ref2.options,
|
|
38
39
|
__callback__ = _ref2.__callback__,
|
|
40
|
+
_ref2$__callbackDeps_ = _ref2.__callbackDeps__,
|
|
41
|
+
__callbackDeps__ = _ref2$__callbackDeps_ === void 0 ? [] : _ref2$__callbackDeps_,
|
|
39
42
|
shouldRerenderOptions = _ref2.shouldRerenderOptions,
|
|
40
43
|
filterNotExistValue = _ref2.__filterNotExistValue__,
|
|
41
44
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
@@ -61,7 +64,7 @@ export function useSelectOptions(_ref2) {
|
|
|
61
64
|
};
|
|
62
65
|
__callback__ === null || __callback__ === void 0 || __callback__(params);
|
|
63
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
-
}, [memoValue, memoOptions, finalLoading]);
|
|
67
|
+
}, [memoValue, memoOptions, finalLoading].concat(_toConsumableArray(__callbackDeps__)));
|
|
65
68
|
var displayOptions = useMemo(function () {
|
|
66
69
|
return generateOptions(_objectSpread({
|
|
67
70
|
options: memoOptions
|
|
@@ -57,10 +57,7 @@ function renderMaxTag(omittedValues) {
|
|
|
57
57
|
return _jsxs(Text, {
|
|
58
58
|
autoShowTooltip: false,
|
|
59
59
|
tooltip: {
|
|
60
|
-
title: tooltip
|
|
61
|
-
align: {
|
|
62
|
-
offset: [0, 0]
|
|
63
|
-
}
|
|
60
|
+
title: tooltip
|
|
64
61
|
},
|
|
65
62
|
children: ["+", omittedValues.length, "..."]
|
|
66
63
|
});
|
|
@@ -103,7 +100,7 @@ export function useSelect(_ref3) {
|
|
|
103
100
|
})),
|
|
104
101
|
displayOptions = _useSelectOptions.displayOptions,
|
|
105
102
|
restSelectProps = _objectWithoutProperties(_useSelectOptions, _excluded2);
|
|
106
|
-
function
|
|
103
|
+
function onOpenChange(open) {
|
|
107
104
|
setOpen(open);
|
|
108
105
|
setSearch('');
|
|
109
106
|
}
|
|
@@ -123,7 +120,7 @@ export function useSelect(_ref3) {
|
|
|
123
120
|
optionFilterProp: 'originLabel',
|
|
124
121
|
optionLabelProp: 'originLabel',
|
|
125
122
|
getPopupContainer: getPopupContainer,
|
|
126
|
-
|
|
123
|
+
popupRender: customRenderDropdown,
|
|
127
124
|
maxTagPlaceholder: renderMaxTag
|
|
128
125
|
}, getComponentProps(restSelectProps)), {}, {
|
|
129
126
|
placeholder: placeholder,
|
|
@@ -131,6 +128,6 @@ export function useSelect(_ref3) {
|
|
|
131
128
|
loading: loading,
|
|
132
129
|
options: displayOptions,
|
|
133
130
|
onSearch: showSearch ? setSearch : undefined,
|
|
134
|
-
|
|
131
|
+
onOpenChange: onOpenChange
|
|
135
132
|
});
|
|
136
133
|
}
|