doui-react 1.0.0 → 2.0.0

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.
Files changed (157) hide show
  1. package/es/api/component/common.d.ts +2 -2
  2. package/es/api/component/common.js +3 -0
  3. package/es/api/component/global-style.d.ts +0 -1
  4. package/es/api/component/global-style.js +2 -3
  5. package/es/api/component/react-dom.js +9 -21
  6. package/es/api/component/validate-input.js +3 -5
  7. package/es/button/component/index.js +9 -10
  8. package/es/button/type/index.d.ts +3 -7
  9. package/es/checkbox/type/index.d.ts +1 -1
  10. package/es/date-picker/component/index.js +13 -17
  11. package/es/date-picker/type/index.d.ts +5 -14
  12. package/es/form/component/constant.js +2 -2
  13. package/es/form/component/form-item-map.d.ts +1 -1
  14. package/es/form/component/form-item.js +1 -3
  15. package/es/form/component/form-list.d.ts +2 -2
  16. package/es/form/component/utils.d.ts +33 -23
  17. package/es/form/component/utils.js +4 -4
  18. package/es/form/style/form-item.d.ts +1 -1
  19. package/es/form/style/form-item.js +4 -11
  20. package/es/form/style/index.js +2 -2
  21. package/es/form/type/form-item.d.ts +6 -6
  22. package/es/form/type/form-list.d.ts +2 -2
  23. package/es/form/type/index.d.ts +3 -3
  24. package/es/grid/component/pagination.d.ts +72 -15
  25. package/es/icon/hook/index.d.ts +195 -190
  26. package/es/input/component/index.js +1 -1
  27. package/es/input/component/number.d.ts +1 -1
  28. package/es/input/component/number.js +8 -30
  29. package/es/input/component/utils.d.ts +3 -2
  30. package/es/input/component/utils.js +40 -5
  31. package/es/input/type/index.d.ts +8 -3
  32. package/es/modal-prompt/component/index.js +3 -1
  33. package/es/modal-prompt/component/utils.js +2 -1
  34. package/es/modal-prompt/type/index.d.ts +2 -2
  35. package/es/open-modal/component/footer.d.ts +1 -1
  36. package/es/open-modal/component/footer.js +2 -4
  37. package/es/open-modal/component/modal.js +14 -6
  38. package/es/open-modal/component/utils.js +2 -6
  39. package/es/open-modal/hook/use-modal.js +1 -1
  40. package/es/open-modal/style/index.js +1 -2
  41. package/es/open-modal/style/wrap.js +1 -1
  42. package/es/open-modal/type/index.d.ts +2 -2
  43. package/es/radio/component/abstract-box.d.ts +84 -112
  44. package/es/radio/component/abstract-box.js +1 -5
  45. package/es/radio/component/use-radio.d.ts +7 -5
  46. package/es/radio/type/index.d.ts +2 -2
  47. package/es/select/component/use-select.js +5 -8
  48. package/es/select/component/utils.d.ts +1 -2
  49. package/es/select/type/index.d.ts +1 -1
  50. package/es/stack/style/index.d.ts +2 -1
  51. package/es/switch/type/index.d.ts +2 -2
  52. package/es/table/component/action-button.js +0 -1
  53. package/es/table/component/filter.d.ts +1 -1
  54. package/es/table/component/filter.js +1 -1
  55. package/es/table/component/sort.d.ts +1 -1
  56. package/es/table/component/time.js +2 -2
  57. package/es/table/component/utils.d.ts +3 -77
  58. package/es/table/component/utils.js +1 -3
  59. package/es/table/hook/search.d.ts +1 -1
  60. package/es/table/hook/search.js +8 -6
  61. package/es/table/type/action.d.ts +2 -7
  62. package/es/table/type/column.d.ts +3 -3
  63. package/es/tabs/component/utils.d.ts +7 -7
  64. package/es/tabs/type/index.d.ts +1 -1
  65. package/es/text/component/index.js +15 -16
  66. package/es/text/component/use-text.d.ts +3 -2
  67. package/es/text/component/use-text.js +12 -19
  68. package/es/text/component/utils.d.ts +1 -1
  69. package/es/text/style/index.js +1 -1
  70. package/es/text/type/index.d.ts +2 -2
  71. package/es/tooltip/component/index.d.ts +31 -21
  72. package/es/tooltip/component/index.js +6 -2
  73. package/es/tooltip/type/index.d.ts +1 -1
  74. package/es/tree/component/index.d.ts +1 -1
  75. package/es/tree/style/index.js +1 -1
  76. package/es/tree-select/component/use-tree-select.js +4 -4
  77. package/es/tree-select/style/index.js +1 -1
  78. package/es/virtual-list/type/index.d.ts +1 -1
  79. package/lib/api/component/common.d.ts +2 -2
  80. package/lib/api/component/common.js +3 -0
  81. package/lib/api/component/global-style.d.ts +0 -1
  82. package/lib/api/component/global-style.js +3 -4
  83. package/lib/api/component/react-dom.js +9 -21
  84. package/lib/api/component/validate-input.js +3 -5
  85. package/lib/button/component/index.js +9 -10
  86. package/lib/button/type/index.d.ts +3 -7
  87. package/lib/checkbox/type/index.d.ts +1 -1
  88. package/lib/date-picker/component/index.js +13 -17
  89. package/lib/date-picker/type/index.d.ts +5 -14
  90. package/lib/form/component/constant.js +2 -2
  91. package/lib/form/component/form-item-map.d.ts +1 -1
  92. package/lib/form/component/form-item.js +1 -3
  93. package/lib/form/component/form-list.d.ts +2 -2
  94. package/lib/form/component/utils.d.ts +32 -22
  95. package/lib/form/component/utils.js +4 -4
  96. package/lib/form/style/form-item.d.ts +1 -1
  97. package/lib/form/style/form-item.js +4 -11
  98. package/lib/form/style/index.js +1 -1
  99. package/lib/form/type/form-item.d.ts +6 -6
  100. package/lib/form/type/form-list.d.ts +2 -2
  101. package/lib/form/type/index.d.ts +3 -3
  102. package/lib/grid/component/pagination.d.ts +72 -15
  103. package/lib/icon/hook/index.d.ts +195 -190
  104. package/lib/input/component/index.js +1 -1
  105. package/lib/input/component/number.d.ts +1 -1
  106. package/lib/input/component/number.js +7 -28
  107. package/lib/input/component/utils.d.ts +3 -2
  108. package/lib/input/component/utils.js +41 -6
  109. package/lib/input/type/index.d.ts +8 -3
  110. package/lib/modal-prompt/component/index.js +3 -1
  111. package/lib/modal-prompt/component/utils.js +2 -1
  112. package/lib/modal-prompt/type/index.d.ts +2 -2
  113. package/lib/open-modal/component/footer.d.ts +1 -1
  114. package/lib/open-modal/component/footer.js +2 -4
  115. package/lib/open-modal/component/modal.js +12 -4
  116. package/lib/open-modal/component/utils.js +2 -6
  117. package/lib/open-modal/hook/use-modal.js +1 -1
  118. package/lib/open-modal/style/index.js +1 -2
  119. package/lib/open-modal/style/wrap.js +1 -1
  120. package/lib/open-modal/type/index.d.ts +2 -2
  121. package/lib/radio/component/abstract-box.d.ts +86 -114
  122. package/lib/radio/component/abstract-box.js +1 -5
  123. package/lib/radio/component/use-radio.d.ts +7 -5
  124. package/lib/radio/type/index.d.ts +2 -2
  125. package/lib/select/component/use-select.js +5 -8
  126. package/lib/select/component/utils.d.ts +1 -2
  127. package/lib/select/type/index.d.ts +1 -1
  128. package/lib/stack/style/index.d.ts +2 -1
  129. package/lib/switch/type/index.d.ts +2 -2
  130. package/lib/table/component/action-button.js +0 -1
  131. package/lib/table/component/filter.d.ts +1 -1
  132. package/lib/table/component/filter.js +1 -1
  133. package/lib/table/component/sort.d.ts +1 -1
  134. package/lib/table/component/time.js +2 -2
  135. package/lib/table/component/utils.d.ts +3 -77
  136. package/lib/table/component/utils.js +1 -3
  137. package/lib/table/hook/search.d.ts +1 -1
  138. package/lib/table/hook/search.js +8 -6
  139. package/lib/table/type/action.d.ts +2 -7
  140. package/lib/table/type/column.d.ts +3 -3
  141. package/lib/tabs/component/utils.d.ts +7 -7
  142. package/lib/tabs/type/index.d.ts +1 -1
  143. package/lib/text/component/index.js +15 -16
  144. package/lib/text/component/use-text.d.ts +3 -2
  145. package/lib/text/component/use-text.js +11 -18
  146. package/lib/text/component/utils.d.ts +1 -1
  147. package/lib/text/style/index.js +1 -1
  148. package/lib/text/type/index.d.ts +2 -2
  149. package/lib/tooltip/component/index.d.ts +30 -20
  150. package/lib/tooltip/component/index.js +6 -2
  151. package/lib/tooltip/type/index.d.ts +1 -1
  152. package/lib/tree/component/index.d.ts +1 -1
  153. package/lib/tree/style/index.js +1 -1
  154. package/lib/tree-select/component/use-tree-select.js +4 -4
  155. package/lib/tree-select/style/index.js +1 -1
  156. package/lib/virtual-list/type/index.d.ts +1 -1
  157. package/package.json +10 -13
@@ -2,7 +2,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["value", "onChange", "onBlur", "validate", "refs", "allowEnter", "allowResetOnEmpty"];
5
+ var _excluded = ["value", "onChange", "onBlur", "validate", "refs", "allowEnter", "allowResetOnEmpty", "allowTrim"];
6
6
  import { mergeFunction, validateScript, validateString } from "../../api";
7
7
  import { useFormContext } from "../../form";
8
8
  import { transformPathToName } from "../../form/component/utils";
@@ -35,6 +35,7 @@ export function useInputValidate(_ref) {
35
35
  _ref$allowEnter = _ref.allowEnter,
36
36
  allowEnter = _ref$allowEnter === void 0 ? true : _ref$allowEnter,
37
37
  allowResetOnEmpty = _ref.allowResetOnEmpty,
38
+ allowTrim = _ref.allowTrim,
38
39
  props = _objectWithoutProperties(_ref, _excluded);
39
40
  var resetOnEmpty = useResetOnEmpty(_objectSpread(_objectSpread({}, props), {}, {
40
41
  allowResetOnEmpty: allowResetOnEmpty,
@@ -42,6 +43,11 @@ export function useInputValidate(_ref) {
42
43
  return !value;
43
44
  }
44
45
  }));
46
+ var trim = useTrim({
47
+ value: value,
48
+ onChange: onChange,
49
+ allowTrim: allowTrim
50
+ });
45
51
  var handleChange = function handleChange(e) {
46
52
  var value = e.target.value;
47
53
  if (validateInput(value, validate) && validateEnter(value, allowEnter)) {
@@ -55,12 +61,9 @@ export function useInputValidate(_ref) {
55
61
  autoComplete: 'off',
56
62
  value: _.isNil(value) ? '' : value,
57
63
  onChange: handleChange,
58
- onBlur: mergeFunction(onBlur, resetOnEmpty)
64
+ onBlur: mergeFunction(trim, resetOnEmpty, onBlur)
59
65
  });
60
66
  }
61
- export function formatNumber(value, precision) {
62
- return +value.toFixed(precision);
63
- }
64
67
  export function useResetOnEmpty(_ref2) {
65
68
  var name = _ref2.name,
66
69
  allowResetOnEmpty = _ref2.allowResetOnEmpty,
@@ -99,4 +102,36 @@ export function useResetOnEmpty(_ref2) {
99
102
  return _onBlur.apply(this, arguments);
100
103
  }
101
104
  return onBlur;
105
+ }
106
+ export function useTrim(_ref3) {
107
+ var value = _ref3.value,
108
+ onChange = _ref3.onChange,
109
+ allowTrim = _ref3.allowTrim;
110
+ function onBlur(_x) {
111
+ return _onBlur2.apply(this, arguments);
112
+ }
113
+ function _onBlur2() {
114
+ _onBlur2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
115
+ var trimValue;
116
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
117
+ while (1) switch (_context2.prev = _context2.next) {
118
+ case 0:
119
+ if (!(!allowTrim || !value)) {
120
+ _context2.next = 2;
121
+ break;
122
+ }
123
+ return _context2.abrupt("return");
124
+ case 2:
125
+ trimValue = _.trim("".concat(value));
126
+ onChange === null || onChange === void 0 || onChange(trimValue);
127
+ _.set(event, 'target.value', trimValue);
128
+ case 5:
129
+ case "end":
130
+ return _context2.stop();
131
+ }
132
+ }, _callee2);
133
+ }));
134
+ return _onBlur2.apply(this, arguments);
135
+ }
136
+ return onBlur;
102
137
  }
@@ -2,9 +2,9 @@ import { BaseComponentProps } from "../../api";
2
2
  import { inputMap } from "../component";
3
3
  import { validateTypeMap } from "../component/utils";
4
4
  import { InputProps as AntdInputProps } from 'antd';
5
- import { InputNumberProps } from 'antd/lib/input-number';
6
- import { PasswordProps } from 'antd/lib/input/Password';
7
- import { TextAreaProps } from 'antd/lib/input/TextArea';
5
+ import { InputNumberProps } from 'antd/es/input-number';
6
+ import { PasswordProps } from 'antd/es/input/Password';
7
+ import { TextAreaProps } from 'antd/es/input/TextArea';
8
8
  type UnionType = BaseComponentProps & AntdInputProps & TextAreaProps & InputNumberProps & PasswordProps;
9
9
  export interface InputProps extends Omit<UnionType, 'form' | 'onChange'> {
10
10
  /**
@@ -32,6 +32,11 @@ export interface InputProps extends Omit<UnionType, 'form' | 'onChange'> {
32
32
  * @default false
33
33
  */
34
34
  allowResetOnEmpty?: boolean;
35
+ /**
36
+ * @description 是否 trim 输入框前后空格
37
+ * @default false
38
+ */
39
+ allowTrim?: boolean;
35
40
  /**
36
41
  * @description 输入框值改变的回调
37
42
  */
@@ -25,7 +25,9 @@ export function openConfirm(_ref) {
25
25
  style: {
26
26
  display: showCancel ? 'unset' : 'none'
27
27
  }
28
- }
28
+ },
29
+ okText: '确定',
30
+ cancelText: '取消'
29
31
  }, props);
30
32
  return new Promise(function (resolve) {
31
33
  Modal.confirm(_objectSpread(_objectSpread({}, mergedProps), {}, {
@@ -31,7 +31,8 @@ export function openModalFunction(props) {
31
31
  duration = _mergeProps.duration,
32
32
  restProps = _objectWithoutProperties(_mergeProps, _excluded2);
33
33
  return new Promise(function (resolve) {
34
- var modal = Modal[type](_objectSpread(_objectSpread({}, restProps), {}, {
34
+ var modalMethod = Modal[type];
35
+ var modal = modalMethod(_objectSpread(_objectSpread({}, restProps), {}, {
35
36
  onOk: function onOk() {
36
37
  return resolve();
37
38
  }
@@ -1,5 +1,5 @@
1
- import { ModalFuncProps as AntdModalFuncProps } from 'antd/lib/modal/Modal';
2
- import { SpinProps } from 'antd/lib/spin';
1
+ import type { ModalFuncProps as AntdModalFuncProps } from 'antd/es/modal';
2
+ import { SpinProps } from 'antd/es/spin';
3
3
  import { CSSProperties, ReactNode } from 'react';
4
4
  export interface ConfirmModalProps extends AntdModalFuncProps {
5
5
  /**
@@ -1,2 +1,2 @@
1
1
  import { HStackProps } from "../../stack";
2
- export declare function Footer({ className, children: Children, ...props }: HStackProps): import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare function Footer({ className, children, ...props }: HStackProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -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
- Children = _ref.children,
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: component
29
+ children: children
32
30
  }))
33
31
  });
34
32
  }
@@ -1,12 +1,12 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { Form } from "../../form";
3
3
  import { Text } from "../../text";
4
- import { Modal as AntdModal } from 'antd';
4
+ import { Modal as AntdModal, Divider } from 'antd';
5
5
  import { ModalProvider } from "../hook";
6
6
  import { Footer } from "./footer";
7
7
  import { Title } from "./title";
8
8
  import { useModal } from "./use-modal";
9
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
10
10
  export var Modal = function Modal(props) {
11
11
  var _useModal = useModal(props),
12
12
  context = _useModal.context,
@@ -17,9 +17,9 @@ export var Modal = function Modal(props) {
17
17
  ok = context.ok,
18
18
  close = context.close;
19
19
  return _jsx(ModalProvider, _objectSpread(_objectSpread({}, context), {}, {
20
- children: _jsx(AntdModal, _objectSpread(_objectSpread({
20
+ children: _jsxs(AntdModal, _objectSpread(_objectSpread({
21
21
  open: open,
22
- destroyOnClose: true
22
+ destroyOnHidden: true
23
23
  }, modalProps), {}, {
24
24
  title: _jsx(Text, {
25
25
  children: modalProps.title
@@ -27,9 +27,17 @@ export var Modal = function Modal(props) {
27
27
  confirmLoading: confirmLoading,
28
28
  onCancel: close,
29
29
  onOk: ok,
30
- children: _jsx(Form, _objectSpread(_objectSpread({}, formProps), {}, {
30
+ children: [_jsx(Divider, {
31
+ style: {
32
+ margin: '15px 0 24px'
33
+ }
34
+ }), _jsx(Form, _objectSpread(_objectSpread({}, formProps), {}, {
31
35
  context: context
32
- }))
36
+ })), _jsx(Divider, {
37
+ style: {
38
+ margin: '15px 0 20px'
39
+ }
40
+ })]
33
41
  }))
34
42
  }));
35
43
  };
@@ -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, formProps),
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, formProps) {
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/lib/_util/hooks/usePatchElement';
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,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
2
  var _templateObject, _templateObject2, _templateObject3;
3
- import { commonFontFamily } from "../../api";
4
3
  import { css } from '@emotion/react';
5
4
  function titleStyle(titleCenter) {
6
5
  if (titleCenter) {
@@ -12,7 +11,7 @@ var style = {
12
11
  wrapper: function wrapper(_ref) {
13
12
  var bodyBottomMargin = _ref.bodyBottomMargin,
14
13
  titleCenter = _ref.titleCenter;
15
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n\n .ant-modal-title {\n font-weight: 600;\n ", "\n }\n\n .ant-modal-body {\n padding-bottom: ", ";\n }\n "])), commonFontFamily, titleStyle(titleCenter), bodyBottomMargin);
14
+ 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 "])), titleStyle(titleCenter), bodyBottomMargin);
16
15
  }
17
16
  };
18
17
  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 &.ant-modal-centered .ant-select-dropdown {\n text-align: left;\n }\n\n ", "\n "])), wrapStyle);
5
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n "])), wrapStyle);
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { FunctionReturn } from "../../api";
2
2
  import { FormInstance, FormItemProps, FormProps, FormValues } from "../../form";
3
3
  import { CSSObject } from '@emotion/react';
4
- import { ModalProps as AntdModalProps } from 'antd/lib/modal/Modal';
4
+ import type { ModalProps as AntdModalProps } from 'antd/es/modal';
5
5
  import { ReactNode } from 'react';
6
6
  type AntdComponentProps = Omit<AntdModalProps, 'onOk' | 'children'> & Omit<FormProps, 'children' | 'content' | 'title'>;
7
7
  /**
@@ -56,7 +56,7 @@ export interface OpenModalProps extends AntdComponentProps {
56
56
  */
57
57
  onOk?(values: FormValues, form: FormInstance): FunctionReturn<boolean | void>;
58
58
  /**
59
- * @description 关闭弹框时的回调
59
+ * @description 关闭弹窗时的回调
60
60
  */
61
61
  unmount?: () => void;
62
62
  }
@@ -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/lib/checkbox/Checkbox';
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
- title?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
9
- overlay?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
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
- color?: string | undefined;
13
- placement?: import("antd/lib/tooltip").TooltipPlacement | undefined;
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
- autoAdjustOverflow?: boolean | import("antd/lib/tooltip").AdjustOverflow | undefined;
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
- visible?: boolean | undefined;
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
- onPopupAlign?: ((element: HTMLElement, align: import("rc-trigger/lib/interface").AlignType) => void) | undefined;
33
- trigger?: string | string[] | undefined;
34
- transitionName?: string | undefined;
35
- overlayStyle?: import("react").CSSProperties | undefined;
36
- overlayClassName?: string | undefined;
37
- prefixCls?: 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
39
  zIndex?: number | undefined;
71
40
  animation?: string | undefined;
72
41
  motion?: import("rc-motion").CSSMotionProps | undefined;
73
42
  id?: string | undefined;
74
- onPopupAlign?: ((element: HTMLElement, align: import("rc-trigger/lib/interface").AlignType) => void) | undefined;
75
- trigger?: string | string[] | undefined;
76
- transitionName?: string | undefined;
77
- overlayStyle?: import("react").CSSProperties | undefined;
78
- overlayClassName?: string | undefined;
79
43
  prefixCls?: string | undefined;
44
+ transitionName?: string | undefined;
80
45
  mouseEnterDelay?: number | undefined;
81
46
  mouseLeaveDelay?: number | undefined;
47
+ onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
48
+ overlayClassName?: string | undefined;
49
+ align?: import("@rc-component/trigger").AlignType | undefined;
50
+ overlayStyle?: import("react").CSSProperties | undefined;
51
+ trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
52
+ popupVisible?: boolean | undefined;
53
+ forceRender?: boolean | undefined;
54
+ fresh?: boolean | undefined;
82
55
  getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
83
- destroyTooltipOnHide?: boolean | {
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: {
@@ -98,82 +66,51 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
98
66
  boxTooltip?: import("react").ReactNode | import("antd").TooltipProps;
99
67
  inGroup?: boolean | undefined;
100
68
  style?: import("react").CSSProperties | undefined;
101
- type?: string | undefined;
69
+ title?: string | undefined;
102
70
  className?: string | undefined;
103
- defaultChecked?: boolean | undefined;
104
- autoFocus?: boolean | undefined;
105
71
  id?: string | undefined;
72
+ name?: string | undefined;
73
+ type?: string | undefined;
106
74
  tabIndex?: number | undefined;
107
75
  onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
108
76
  onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
109
77
  onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
110
78
  onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
111
79
  onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
112
- name?: string | undefined;
113
- prefixCls?: string | undefined;
114
- checked?: boolean | undefined;
115
80
  disabled?: boolean | undefined;
81
+ checked?: boolean | undefined;
82
+ required?: boolean | undefined;
83
+ defaultChecked?: boolean | undefined;
84
+ autoFocus?: boolean | undefined;
85
+ prefixCls?: string | undefined;
86
+ rootClassName?: string | undefined;
116
87
  indeterminate?: boolean | undefined;
117
88
  skipGroup?: boolean | undefined;
118
- rows?: number | false | undefined;
119
- tooltip?: import("react").ReactNode | import("antd").TooltipProps;
120
- autoShowTooltip?: boolean | undefined;
121
89
  slot?: string | undefined;
122
- title?: string | undefined;
123
90
  accessKey?: string | undefined;
124
91
  dir?: string | undefined;
125
92
  color?: string | undefined;
126
93
  content?: string | undefined;
127
- direction?: import("antd/lib/config-provider").DirectionType;
94
+ direction?: import("antd/es/config-provider").DirectionType;
128
95
  translate?: "no" | "yes" | undefined;
129
- defaultValue?: string | number | readonly string[] | undefined;
130
- suppressContentEditableWarning?: boolean | undefined;
131
96
  suppressHydrationWarning?: boolean | undefined;
132
- autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
133
- contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
134
- contextMenu?: string | undefined;
135
- draggable?: (boolean | "true" | "false") | undefined;
136
- enterKeyHint?: "search" | "done" | "enter" | "go" | "next" | "previous" | "send" | undefined;
137
- hidden?: boolean | undefined;
138
97
  lang?: string | undefined;
139
- nonce?: string | undefined;
140
- placeholder?: string | undefined;
141
- spellCheck?: (boolean | "true" | "false") | undefined;
142
- radioGroup?: string | undefined;
143
98
  role?: import("react").AriaRole | undefined;
144
- about?: string | undefined;
145
- datatype?: string | undefined;
146
- inlist?: any;
147
- prefix?: string | undefined;
148
- property?: string | undefined;
149
- rel?: string | undefined;
150
- resource?: string | undefined;
151
- rev?: string | undefined;
152
- typeof?: string | undefined;
153
- vocab?: string | undefined;
154
- autoCorrect?: string | undefined;
155
- autoSave?: string | undefined;
156
- itemProp?: string | undefined;
157
- itemScope?: boolean | undefined;
158
- itemType?: string | undefined;
159
- itemID?: string | undefined;
160
- itemRef?: string | undefined;
161
- results?: number | undefined;
162
- security?: string | undefined;
163
- unselectable?: "off" | "on" | undefined;
164
- inputMode?: "search" | "text" | "none" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined;
165
- is?: string | undefined;
166
99
  "aria-activedescendant"?: string | undefined;
167
100
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
168
101
  "aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
102
+ "aria-braillelabel"?: string | undefined;
103
+ "aria-brailleroledescription"?: string | undefined;
169
104
  "aria-busy"?: (boolean | "true" | "false") | undefined;
170
105
  "aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
171
106
  "aria-colcount"?: number | undefined;
172
107
  "aria-colindex"?: number | undefined;
108
+ "aria-colindextext"?: string | undefined;
173
109
  "aria-colspan"?: number | undefined;
174
110
  "aria-controls"?: string | undefined;
175
- "aria-current"?: boolean | "time" | "page" | "date" | "true" | "false" | "step" | "location" | undefined;
111
+ "aria-current"?: boolean | "time" | "page" | "true" | "false" | "step" | "location" | "date" | undefined;
176
112
  "aria-describedby"?: string | undefined;
113
+ "aria-description"?: string | undefined;
177
114
  "aria-details"?: string | undefined;
178
115
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
179
116
  "aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
@@ -185,7 +122,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
185
122
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
186
123
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
187
124
  "aria-keyshortcuts"?: string | undefined;
188
- "aria-label"?: string | undefined;
125
+ 'aria-label'?: string | undefined;
189
126
  "aria-labelledby"?: string | undefined;
190
127
  "aria-level"?: number | undefined;
191
128
  "aria-live"?: "off" | "assertive" | "polite" | undefined;
@@ -203,6 +140,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
203
140
  "aria-roledescription"?: string | undefined;
204
141
  "aria-rowcount"?: number | undefined;
205
142
  "aria-rowindex"?: number | undefined;
143
+ "aria-rowindextext"?: string | undefined;
206
144
  "aria-rowspan"?: number | undefined;
207
145
  "aria-selected"?: (boolean | "true" | "false") | undefined;
208
146
  "aria-setsize"?: number | undefined;
@@ -226,12 +164,10 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
226
164
  onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLElement> | undefined;
227
165
  onCompositionUpdate?: import("react").CompositionEventHandler<HTMLElement> | undefined;
228
166
  onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLElement> | undefined;
229
- onFocus?: import("react").FocusEventHandler<HTMLElement> | undefined;
230
167
  onFocusCapture?: import("react").FocusEventHandler<HTMLElement> | undefined;
231
- onBlur?: import("react").FocusEventHandler<HTMLElement> | undefined;
232
168
  onBlurCapture?: import("react").FocusEventHandler<HTMLElement> | undefined;
233
169
  onChangeCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
234
- onBeforeInput?: import("react").FormEventHandler<HTMLElement> | undefined;
170
+ onBeforeInput?: import("react").InputEventHandler<HTMLElement> | undefined;
235
171
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
236
172
  onInput?: import("react").FormEventHandler<HTMLElement> | undefined;
237
173
  onInputCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
@@ -345,9 +281,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
345
281
  onPointerCancel?: import("react").PointerEventHandler<HTMLElement> | undefined;
346
282
  onPointerCancelCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
347
283
  onPointerEnter?: import("react").PointerEventHandler<HTMLElement> | undefined;
348
- onPointerEnterCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
349
284
  onPointerLeave?: import("react").PointerEventHandler<HTMLElement> | undefined;
350
- onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
351
285
  onPointerOver?: import("react").PointerEventHandler<HTMLElement> | undefined;
352
286
  onPointerOverCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
353
287
  onPointerOut?: import("react").PointerEventHandler<HTMLElement> | undefined;
@@ -368,6 +302,44 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
368
302
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
369
303
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
370
304
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
305
+ tooltip?: import("react").ReactNode | import("antd").TooltipProps;
306
+ hidden?: boolean | undefined;
307
+ contextMenu?: string | undefined;
308
+ defaultValue?: string | number | readonly string[] | undefined;
309
+ prefix?: string | undefined;
310
+ suppressContentEditableWarning?: boolean | undefined;
311
+ autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
312
+ contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
313
+ draggable?: (boolean | "true" | "false") | undefined;
314
+ enterKeyHint?: "search" | "done" | "enter" | "next" | "go" | "previous" | "send" | undefined;
315
+ nonce?: string | undefined;
316
+ spellCheck?: (boolean | "true" | "false") | undefined;
317
+ radioGroup?: string | undefined;
318
+ about?: string | undefined;
319
+ datatype?: string | undefined;
320
+ inlist?: any;
321
+ property?: string | undefined;
322
+ rel?: string | undefined;
323
+ resource?: string | undefined;
324
+ rev?: string | undefined;
325
+ typeof?: string | undefined;
326
+ vocab?: string | undefined;
327
+ autoCorrect?: string | undefined;
328
+ autoSave?: string | undefined;
329
+ itemProp?: string | undefined;
330
+ itemScope?: boolean | undefined;
331
+ itemType?: string | undefined;
332
+ itemID?: string | undefined;
333
+ itemRef?: string | undefined;
334
+ results?: number | undefined;
335
+ security?: string | undefined;
336
+ unselectable?: "off" | "on" | undefined;
337
+ inputMode?: "search" | "text" | "none" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined;
338
+ is?: string | undefined;
339
+ exportparts?: string | undefined;
340
+ part?: string | undefined;
341
+ rows?: number | false | undefined;
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/lib/radio/interface';
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/lib/button").ButtonSize;
10
- disabled?: import("antd/lib/config-provider/DisabledContext").DisabledType;
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/lib/radio/interface").RadioGroupOptionType | undefined;
17
- buttonStyle?: import("antd/lib/radio/interface").RadioGroupButtonStyle | undefined;
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
  };