doui-react 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/form/component/form-item-map.d.ts +1 -0
- package/es/form/component/form-item-map.js +2 -1
- package/es/form/component/utils.d.ts +6 -6
- package/es/form/component/utils.js +1 -1
- package/es/hooks/hook/use-fetch.js +5 -12
- package/es/open-modal/component/index.js +16 -1
- package/es/open-modal/type/index.d.ts +5 -0
- package/es/radio/component/abstract-box.d.ts +67 -67
- package/es/radio/component/utils.js +1 -1
- package/es/select/component/use-select-options.d.ts +1 -1
- package/es/select/component/use-select-options.js +5 -2
- package/es/select/type/index.d.ts +2 -1
- package/es/tabs/component/utils.d.ts +5 -5
- package/lib/form/component/form-item-map.d.ts +1 -0
- package/lib/form/component/form-item-map.js +2 -1
- package/lib/form/component/utils.d.ts +6 -6
- package/lib/form/component/utils.js +1 -1
- package/lib/hooks/hook/use-fetch.js +5 -12
- package/lib/open-modal/component/index.js +17 -1
- package/lib/open-modal/type/index.d.ts +5 -0
- package/lib/radio/component/abstract-box.d.ts +74 -74
- package/lib/radio/component/utils.js +1 -1
- package/lib/select/component/use-select-options.d.ts +1 -1
- package/lib/select/component/use-select-options.js +5 -2
- package/lib/select/type/index.d.ts +2 -1
- package/lib/tabs/component/utils.d.ts +5 -5
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export interface FormItemSelectProps extends Pick<FormItemProps, 'requiredInOpti
|
|
|
14
14
|
export declare function useCollectFormItemState({ name, collectState, filterNotExistValue, requiredInOptions, form: outerForm, ...props }: FormItemSelectProps): {
|
|
15
15
|
__filterNotExistValue__: boolean;
|
|
16
16
|
__callback__: import("use-debounce").DebouncedState<({ loading, options, value }: SelectCallbackProps) => Promise<void>>;
|
|
17
|
+
__callbackDeps__: (string | number | boolean | undefined)[];
|
|
17
18
|
labelInValue?: boolean | undefined;
|
|
18
19
|
};
|
|
19
20
|
declare function FormItemSelect(props: FormItemSelectProps & SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -84,7 +84,8 @@ export function useCollectFormItemState(_ref) {
|
|
|
84
84
|
}
|
|
85
85
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
86
86
|
__filterNotExistValue__: !!requiredInOptionsAndFilterNotExistValue,
|
|
87
|
-
__callback__: useDebounce(onCallback)
|
|
87
|
+
__callback__: useDebounce(onCallback),
|
|
88
|
+
__callbackDeps__: [filterNotExistValue, requiredInOptions]
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
function FormItemSelect(props) {
|
|
@@ -24,7 +24,7 @@ export declare function getFormItemProps(props: any): {
|
|
|
24
24
|
pointAtCenter?: boolean | undefined;
|
|
25
25
|
};
|
|
26
26
|
autoAdjustOverflow?: boolean | import("antd/es/tooltip").AdjustOverflow | undefined;
|
|
27
|
-
getPopupContainer:
|
|
27
|
+
getPopupContainer: (triggerNode: HTMLElement) => HTMLElement;
|
|
28
28
|
children?: import("react").ReactNode;
|
|
29
29
|
destroyTooltipOnHide?: boolean | {
|
|
30
30
|
keepParent?: boolean | undefined;
|
|
@@ -38,12 +38,13 @@ export declare function getFormItemProps(props: any): {
|
|
|
38
38
|
defaultVisible?: boolean | undefined;
|
|
39
39
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
40
40
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
41
|
-
zIndex?: number | undefined;
|
|
42
|
-
animation?: string | undefined;
|
|
43
|
-
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
44
|
-
id?: string | undefined;
|
|
45
41
|
prefixCls?: string | undefined;
|
|
42
|
+
id?: string | undefined;
|
|
43
|
+
animation?: string | undefined;
|
|
46
44
|
transitionName?: string | undefined;
|
|
45
|
+
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
46
|
+
zIndex?: number | undefined;
|
|
47
|
+
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
47
48
|
mouseEnterDelay?: number | undefined;
|
|
48
49
|
mouseLeaveDelay?: number | undefined;
|
|
49
50
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
@@ -55,7 +56,6 @@ export declare function getFormItemProps(props: any): {
|
|
|
55
56
|
forceRender?: boolean | undefined;
|
|
56
57
|
fresh?: boolean | undefined;
|
|
57
58
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
58
|
-
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
59
59
|
arrowContent?: import("react").ReactNode;
|
|
60
60
|
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
61
61
|
icon: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -149,7 +149,7 @@ function generateRules(_ref2) {
|
|
|
149
149
|
var _form$getItems;
|
|
150
150
|
var value = _ref3.value;
|
|
151
151
|
var options = (_form$getItems = form.getItems(item.name)) === null || _form$getItems === void 0 ? void 0 : _form$getItems.options;
|
|
152
|
-
if (!isEmpty(value) && isValueNotExistInOptions(value, options)) {
|
|
152
|
+
if (!isEmpty(value) && options && isValueNotExistInOptions(value, options)) {
|
|
153
153
|
return _message;
|
|
154
154
|
}
|
|
155
155
|
};
|
|
@@ -6,7 +6,6 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
6
6
|
var _excluded = ["wait"];
|
|
7
7
|
import { useDebounce, useDeepEffect } from "./..";
|
|
8
8
|
import _ from 'lodash';
|
|
9
|
-
import isEqual from 'react-fast-compare';
|
|
10
9
|
import { useLatest, useSetState } from 'react-use';
|
|
11
10
|
var defaultOptions = {
|
|
12
11
|
automatic: true,
|
|
@@ -45,7 +44,8 @@ export function useFetch(_fn, dependencyList, options) {
|
|
|
45
44
|
args[_key] = _args[_key];
|
|
46
45
|
}
|
|
47
46
|
setState({
|
|
48
|
-
loading: true
|
|
47
|
+
loading: true,
|
|
48
|
+
error: undefined
|
|
49
49
|
});
|
|
50
50
|
_context.prev = 2;
|
|
51
51
|
_context.next = 5;
|
|
@@ -65,16 +65,9 @@ export function useFetch(_fn, dependencyList, options) {
|
|
|
65
65
|
}
|
|
66
66
|
return _context.abrupt("return");
|
|
67
67
|
case 10:
|
|
68
|
-
setState(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
loading: false
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
loading: false,
|
|
76
|
-
data: data
|
|
77
|
-
};
|
|
68
|
+
setState({
|
|
69
|
+
loading: false,
|
|
70
|
+
data: data
|
|
78
71
|
});
|
|
79
72
|
_context.next = 16;
|
|
80
73
|
break;
|
|
@@ -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,6 +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 { ConfigProviderProps } from 'antd/es/config-provider';
|
|
4
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'>;
|
|
@@ -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
|
*/
|
|
@@ -36,12 +36,13 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
36
36
|
defaultVisible?: boolean | undefined;
|
|
37
37
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
38
38
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
39
|
-
zIndex?: number | undefined;
|
|
40
|
-
animation?: string | undefined;
|
|
41
|
-
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
42
|
-
id?: string | undefined;
|
|
43
39
|
prefixCls?: string | undefined;
|
|
40
|
+
id?: string | undefined;
|
|
41
|
+
animation?: string | undefined;
|
|
44
42
|
transitionName?: string | undefined;
|
|
43
|
+
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
44
|
+
zIndex?: number | undefined;
|
|
45
|
+
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
45
46
|
mouseEnterDelay?: number | undefined;
|
|
46
47
|
mouseLeaveDelay?: number | undefined;
|
|
47
48
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
@@ -53,7 +54,6 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
53
54
|
forceRender?: boolean | undefined;
|
|
54
55
|
fresh?: boolean | undefined;
|
|
55
56
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
56
|
-
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
57
57
|
arrowContent?: import("react").ReactNode;
|
|
58
58
|
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
59
59
|
};
|
|
@@ -65,37 +65,73 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
65
65
|
value?: any;
|
|
66
66
|
boxTooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
67
67
|
inGroup?: boolean | undefined;
|
|
68
|
+
indeterminate?: boolean | undefined;
|
|
69
|
+
prefixCls?: string | undefined;
|
|
70
|
+
className?: string | undefined;
|
|
71
|
+
rootClassName?: string | undefined;
|
|
72
|
+
defaultChecked?: boolean | undefined;
|
|
73
|
+
checked?: boolean | undefined;
|
|
68
74
|
style?: import("react").CSSProperties | undefined;
|
|
75
|
+
disabled?: boolean | undefined;
|
|
69
76
|
title?: string | undefined;
|
|
70
|
-
className?: string | undefined;
|
|
71
|
-
id?: string | undefined;
|
|
72
|
-
name?: string | undefined;
|
|
73
|
-
type?: string | undefined;
|
|
74
|
-
tabIndex?: number | undefined;
|
|
75
|
-
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
76
|
-
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
77
77
|
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
78
78
|
onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
79
79
|
onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
81
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
82
|
+
tabIndex?: number | undefined;
|
|
83
|
+
name?: string | undefined;
|
|
84
|
+
id?: string | undefined;
|
|
84
85
|
autoFocus?: boolean | undefined;
|
|
85
|
-
|
|
86
|
-
rootClassName?: string | undefined;
|
|
87
|
-
indeterminate?: boolean | undefined;
|
|
86
|
+
type?: string | undefined;
|
|
88
87
|
skipGroup?: boolean | undefined;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
dir?: string | undefined;
|
|
92
|
-
color?: string | undefined;
|
|
93
|
-
content?: string | undefined;
|
|
88
|
+
required?: boolean | undefined;
|
|
89
|
+
'aria-label'?: string | undefined;
|
|
94
90
|
direction?: import("antd/es/config-provider").DirectionType;
|
|
95
|
-
|
|
91
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
92
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
96
93
|
suppressHydrationWarning?: boolean | undefined;
|
|
94
|
+
accessKey?: string | undefined;
|
|
95
|
+
autoCapitalize?: "none" | "off" | "on" | "sentences" | "words" | "characters" | (string & {}) | undefined;
|
|
96
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
97
|
+
contextMenu?: string | undefined;
|
|
98
|
+
dir?: string | undefined;
|
|
99
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
100
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
101
|
+
hidden?: boolean | undefined;
|
|
97
102
|
lang?: string | undefined;
|
|
103
|
+
nonce?: string | undefined;
|
|
104
|
+
slot?: string | undefined;
|
|
105
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
106
|
+
translate?: "yes" | "no" | undefined;
|
|
107
|
+
radioGroup?: string | undefined;
|
|
98
108
|
role?: import("react").AriaRole | undefined;
|
|
109
|
+
about?: string | undefined;
|
|
110
|
+
content?: string | undefined;
|
|
111
|
+
datatype?: string | undefined;
|
|
112
|
+
inlist?: any;
|
|
113
|
+
prefix?: string | undefined;
|
|
114
|
+
property?: string | undefined;
|
|
115
|
+
rel?: string | undefined;
|
|
116
|
+
resource?: string | undefined;
|
|
117
|
+
rev?: string | undefined;
|
|
118
|
+
typeof?: string | undefined;
|
|
119
|
+
vocab?: string | undefined;
|
|
120
|
+
autoCorrect?: string | undefined;
|
|
121
|
+
autoSave?: string | undefined;
|
|
122
|
+
color?: string | undefined;
|
|
123
|
+
itemProp?: string | undefined;
|
|
124
|
+
itemScope?: boolean | undefined;
|
|
125
|
+
itemType?: string | undefined;
|
|
126
|
+
itemID?: string | undefined;
|
|
127
|
+
itemRef?: string | undefined;
|
|
128
|
+
results?: number | undefined;
|
|
129
|
+
security?: string | undefined;
|
|
130
|
+
unselectable?: "off" | "on" | undefined;
|
|
131
|
+
inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
132
|
+
is?: string | undefined;
|
|
133
|
+
exportparts?: string | undefined;
|
|
134
|
+
part?: string | undefined;
|
|
99
135
|
"aria-activedescendant"?: string | undefined;
|
|
100
136
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
101
137
|
"aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
|
|
@@ -108,34 +144,33 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
108
144
|
"aria-colindextext"?: string | undefined;
|
|
109
145
|
"aria-colspan"?: number | undefined;
|
|
110
146
|
"aria-controls"?: string | undefined;
|
|
111
|
-
"aria-current"?: boolean | "
|
|
147
|
+
"aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
112
148
|
"aria-describedby"?: string | undefined;
|
|
113
149
|
"aria-description"?: string | undefined;
|
|
114
150
|
"aria-details"?: string | undefined;
|
|
115
151
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
116
|
-
"aria-dropeffect"?: "
|
|
152
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
117
153
|
"aria-errormessage"?: string | undefined;
|
|
118
154
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
119
155
|
"aria-flowto"?: string | undefined;
|
|
120
156
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
121
|
-
"aria-haspopup"?: boolean | "
|
|
157
|
+
"aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
|
|
122
158
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
123
159
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
124
160
|
"aria-keyshortcuts"?: string | undefined;
|
|
125
|
-
'aria-label'?: string | undefined;
|
|
126
161
|
"aria-labelledby"?: string | undefined;
|
|
127
162
|
"aria-level"?: number | undefined;
|
|
128
163
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
129
164
|
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
130
165
|
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
131
166
|
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
132
|
-
"aria-orientation"?: "
|
|
167
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
133
168
|
"aria-owns"?: string | undefined;
|
|
134
169
|
"aria-placeholder"?: string | undefined;
|
|
135
170
|
"aria-posinset"?: number | undefined;
|
|
136
171
|
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
137
172
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
138
|
-
"aria-relevant"?: "text" | "
|
|
173
|
+
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
139
174
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
140
175
|
"aria-roledescription"?: string | undefined;
|
|
141
176
|
"aria-rowcount"?: number | undefined;
|
|
@@ -302,43 +337,8 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
302
337
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
|
|
303
338
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
304
339
|
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
340
|
rows?: number | false | undefined;
|
|
341
|
+
tooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
342
342
|
autoShowTooltip?: boolean | undefined;
|
|
343
343
|
refs?: import("../../api").Refs | undefined;
|
|
344
344
|
ref: import("../../api").Refs | undefined;
|
|
@@ -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
|
|
@@ -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
|
|
@@ -3,7 +3,7 @@ import { UseFetchOptions } from "../../hooks";
|
|
|
3
3
|
import { TextProps } from "../../text";
|
|
4
4
|
import { SelectProps as AntdSelectProps } from 'antd/es/select';
|
|
5
5
|
import { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select';
|
|
6
|
-
import { ReactNode } from 'react';
|
|
6
|
+
import { DependencyList, ReactNode } from 'react';
|
|
7
7
|
/**
|
|
8
8
|
* @noExtends
|
|
9
9
|
*/
|
|
@@ -54,6 +54,7 @@ export interface BaseSelectProps {
|
|
|
54
54
|
*/
|
|
55
55
|
__filterNotExistValue__?: boolean;
|
|
56
56
|
__callback__?(props: SelectCallbackProps): void;
|
|
57
|
+
__callbackDeps__?: DependencyList;
|
|
57
58
|
}
|
|
58
59
|
type UnionType = Omit<AntdSelectProps, 'options'> & Omit<BaseSelectProps, 'options'> & BaseComponentProps;
|
|
59
60
|
export interface SelectProps extends UnionType {
|
|
@@ -6,16 +6,16 @@ export declare function getRenderTabBar({ type, items, size, tabBarGutter, tabBa
|
|
|
6
6
|
export declare function generateTabItems({ items }: TabsProps): {
|
|
7
7
|
label: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
8
|
key: string;
|
|
9
|
-
|
|
9
|
+
prefixCls?: string | undefined;
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
|
|
11
|
+
style?: import("react").CSSProperties | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
12
13
|
children?: import("react").ReactNode;
|
|
13
|
-
|
|
14
|
+
id?: string | undefined;
|
|
14
15
|
closable?: boolean | undefined;
|
|
15
16
|
closeIcon?: import("react").ReactNode;
|
|
16
17
|
active?: boolean | undefined;
|
|
17
|
-
|
|
18
|
-
prefixCls?: string | undefined;
|
|
18
|
+
icon?: import("react").ReactNode;
|
|
19
19
|
forceRender?: boolean | undefined;
|
|
20
20
|
destroyInactiveTabPane?: boolean | undefined;
|
|
21
21
|
animated?: boolean | undefined;
|
|
@@ -14,6 +14,7 @@ export interface FormItemSelectProps extends Pick<FormItemProps, 'requiredInOpti
|
|
|
14
14
|
export declare function useCollectFormItemState({ name, collectState, filterNotExistValue, requiredInOptions, form: outerForm, ...props }: FormItemSelectProps): {
|
|
15
15
|
__filterNotExistValue__: boolean;
|
|
16
16
|
__callback__: import("use-debounce").DebouncedState<({ loading, options, value }: SelectCallbackProps) => Promise<void>>;
|
|
17
|
+
__callbackDeps__: (string | number | boolean | undefined)[];
|
|
17
18
|
labelInValue?: boolean | undefined;
|
|
18
19
|
};
|
|
19
20
|
declare function FormItemSelect(props: FormItemSelectProps & SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -92,7 +92,8 @@ function useCollectFormItemState(_ref) {
|
|
|
92
92
|
}
|
|
93
93
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
94
94
|
__filterNotExistValue__: !!requiredInOptionsAndFilterNotExistValue,
|
|
95
|
-
__callback__: (0, _hooks.useDebounce)(onCallback)
|
|
95
|
+
__callback__: (0, _hooks.useDebounce)(onCallback),
|
|
96
|
+
__callbackDeps__: [filterNotExistValue, requiredInOptions]
|
|
96
97
|
});
|
|
97
98
|
}
|
|
98
99
|
function FormItemSelect(props) {
|
|
@@ -24,7 +24,7 @@ export declare function getFormItemProps(props: any): {
|
|
|
24
24
|
pointAtCenter?: boolean | undefined;
|
|
25
25
|
};
|
|
26
26
|
autoAdjustOverflow?: boolean | import("antd/es/tooltip").AdjustOverflow | undefined;
|
|
27
|
-
getPopupContainer:
|
|
27
|
+
getPopupContainer: (triggerNode: HTMLElement) => HTMLElement;
|
|
28
28
|
children?: import("react").ReactNode;
|
|
29
29
|
destroyTooltipOnHide?: boolean | {
|
|
30
30
|
keepParent?: boolean | undefined;
|
|
@@ -38,12 +38,13 @@ export declare function getFormItemProps(props: any): {
|
|
|
38
38
|
defaultVisible?: boolean | undefined;
|
|
39
39
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
40
40
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
41
|
-
zIndex?: number | undefined;
|
|
42
|
-
animation?: string | undefined;
|
|
43
|
-
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
44
|
-
id?: string | undefined;
|
|
45
41
|
prefixCls?: string | undefined;
|
|
42
|
+
id?: string | undefined;
|
|
43
|
+
animation?: string | undefined;
|
|
46
44
|
transitionName?: string | undefined;
|
|
45
|
+
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
46
|
+
zIndex?: number | undefined;
|
|
47
|
+
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
47
48
|
mouseEnterDelay?: number | undefined;
|
|
48
49
|
mouseLeaveDelay?: number | undefined;
|
|
49
50
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
@@ -55,7 +56,6 @@ export declare function getFormItemProps(props: any): {
|
|
|
55
56
|
forceRender?: boolean | undefined;
|
|
56
57
|
fresh?: boolean | undefined;
|
|
57
58
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
58
|
-
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
59
59
|
arrowContent?: import("react").ReactNode;
|
|
60
60
|
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
61
61
|
icon: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -181,7 +181,7 @@ function generateRules(_ref2) {
|
|
|
181
181
|
var _form$getItems;
|
|
182
182
|
var value = _ref3.value;
|
|
183
183
|
var options = (_form$getItems = form.getItems(item.name)) === null || _form$getItems === void 0 ? void 0 : _form$getItems.options;
|
|
184
|
-
if (!isEmpty(value) && isValueNotExistInOptions(value, options)) {
|
|
184
|
+
if (!isEmpty(value) && options && isValueNotExistInOptions(value, options)) {
|
|
185
185
|
return _message;
|
|
186
186
|
}
|
|
187
187
|
};
|
|
@@ -12,7 +12,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
13
|
var _2 = require("./..");
|
|
14
14
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
15
|
-
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
16
15
|
var _reactUse = require("react-use");
|
|
17
16
|
var _excluded = ["wait"];
|
|
18
17
|
var defaultOptions = {
|
|
@@ -52,7 +51,8 @@ function useFetch(_fn, dependencyList, options) {
|
|
|
52
51
|
args[_key] = _args[_key];
|
|
53
52
|
}
|
|
54
53
|
setState({
|
|
55
|
-
loading: true
|
|
54
|
+
loading: true,
|
|
55
|
+
error: undefined
|
|
56
56
|
});
|
|
57
57
|
_context.prev = 2;
|
|
58
58
|
_context.next = 5;
|
|
@@ -72,16 +72,9 @@ function useFetch(_fn, dependencyList, options) {
|
|
|
72
72
|
}
|
|
73
73
|
return _context.abrupt("return");
|
|
74
74
|
case 10:
|
|
75
|
-
setState(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
loading: false
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
loading: false,
|
|
83
|
-
data: data
|
|
84
|
-
};
|
|
75
|
+
setState({
|
|
76
|
+
loading: false,
|
|
77
|
+
data: data
|
|
85
78
|
});
|
|
86
79
|
_context.next = 16;
|
|
87
80
|
break;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -9,7 +10,11 @@ var _exportNames = {
|
|
|
9
10
|
};
|
|
10
11
|
exports.closeModal = closeModal;
|
|
11
12
|
exports.openModal = openModal;
|
|
13
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
15
|
var _api = require("../../api");
|
|
16
|
+
var _antd = require("antd");
|
|
17
|
+
var _zh_CN = _interopRequireDefault(require("antd/es/locale/zh_CN"));
|
|
13
18
|
var _modal = require("./modal");
|
|
14
19
|
Object.keys(_modal).forEach(function (key) {
|
|
15
20
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -22,8 +27,19 @@ Object.keys(_modal).forEach(function (key) {
|
|
|
22
27
|
}
|
|
23
28
|
});
|
|
24
29
|
});
|
|
30
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
31
|
+
var _excluded = ["configProviderProps"];
|
|
32
|
+
function ModalWrapper(_ref) {
|
|
33
|
+
var configProviderProps = _ref.configProviderProps,
|
|
34
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
35
|
+
return (0, _jsxRuntime.jsx)(_antd.ConfigProvider, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
36
|
+
locale: _zh_CN.default
|
|
37
|
+
}, configProviderProps), {}, {
|
|
38
|
+
children: (0, _jsxRuntime.jsx)(_modal.Modal, (0, _objectSpread2.default)({}, props))
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
25
41
|
function openModal(props) {
|
|
26
|
-
return (0, _api.mountComponent)(
|
|
42
|
+
return (0, _api.mountComponent)(ModalWrapper, props);
|
|
27
43
|
}
|
|
28
44
|
function closeModal() {
|
|
29
45
|
(0, _api.unmountComponent)();
|
|
@@ -1,6 +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 { ConfigProviderProps } from 'antd/es/config-provider';
|
|
4
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'>;
|
|
@@ -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
|
*/
|
|
@@ -36,24 +36,24 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
36
36
|
defaultVisible?: boolean | undefined;
|
|
37
37
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
38
38
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
39
|
-
zIndex?: number | undefined;
|
|
40
|
-
animation?: string | undefined;
|
|
41
|
-
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
42
|
-
id?: string | undefined;
|
|
43
39
|
prefixCls?: string | undefined;
|
|
40
|
+
id?: string | undefined;
|
|
41
|
+
animation?: string | undefined;
|
|
44
42
|
transitionName?: string | undefined;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
overlayClassName?: string | undefined;
|
|
49
|
-
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
50
|
-
overlayStyle?: import("react").CSSProperties | undefined;
|
|
43
|
+
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
44
|
+
zIndex?: number | undefined;
|
|
45
|
+
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
51
46
|
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
48
|
+
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
54
49
|
fresh?: boolean | undefined;
|
|
50
|
+
mouseLeaveDelay?: number | undefined;
|
|
51
|
+
mouseEnterDelay?: number | undefined;
|
|
52
|
+
forceRender?: boolean | undefined;
|
|
53
|
+
popupVisible?: boolean | undefined;
|
|
54
|
+
overlayStyle?: import("react").CSSProperties | undefined;
|
|
55
|
+
overlayClassName?: string | undefined;
|
|
55
56
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
56
|
-
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
57
57
|
arrowContent?: import("react").ReactNode;
|
|
58
58
|
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
59
59
|
};
|
|
@@ -65,37 +65,73 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
65
65
|
value?: any;
|
|
66
66
|
boxTooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
67
67
|
inGroup?: boolean | undefined;
|
|
68
|
+
name?: string | undefined;
|
|
69
|
+
prefixCls?: string | undefined;
|
|
70
|
+
className?: string | undefined;
|
|
71
|
+
rootClassName?: string | undefined;
|
|
72
|
+
disabled?: boolean | undefined;
|
|
68
73
|
style?: import("react").CSSProperties | undefined;
|
|
74
|
+
indeterminate?: boolean | undefined;
|
|
75
|
+
defaultChecked?: boolean | undefined;
|
|
76
|
+
checked?: boolean | undefined;
|
|
69
77
|
title?: string | undefined;
|
|
70
|
-
className?: string | undefined;
|
|
71
|
-
id?: string | undefined;
|
|
72
|
-
name?: string | undefined;
|
|
73
|
-
type?: string | undefined;
|
|
74
|
-
tabIndex?: number | undefined;
|
|
75
|
-
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
76
|
-
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
77
78
|
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
78
79
|
onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
79
80
|
onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
82
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
83
|
+
tabIndex?: number | undefined;
|
|
84
|
+
id?: string | undefined;
|
|
84
85
|
autoFocus?: boolean | undefined;
|
|
85
|
-
|
|
86
|
-
rootClassName?: string | undefined;
|
|
87
|
-
indeterminate?: boolean | undefined;
|
|
86
|
+
type?: string | undefined;
|
|
88
87
|
skipGroup?: boolean | undefined;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
color?: string | undefined;
|
|
93
|
-
content?: string | undefined;
|
|
88
|
+
required?: boolean | undefined;
|
|
89
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
90
|
+
'aria-label'?: string | undefined;
|
|
94
91
|
direction?: import("antd/es/config-provider").DirectionType;
|
|
95
|
-
|
|
92
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
96
93
|
suppressHydrationWarning?: boolean | undefined;
|
|
94
|
+
accessKey?: string | undefined;
|
|
95
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | (string & {}) | undefined;
|
|
96
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
97
|
+
contextMenu?: string | undefined;
|
|
98
|
+
dir?: string | undefined;
|
|
99
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
100
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
101
|
+
hidden?: boolean | undefined;
|
|
97
102
|
lang?: string | undefined;
|
|
103
|
+
nonce?: string | undefined;
|
|
104
|
+
slot?: string | undefined;
|
|
105
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
106
|
+
translate?: "yes" | "no" | undefined;
|
|
107
|
+
radioGroup?: string | undefined;
|
|
98
108
|
role?: import("react").AriaRole | undefined;
|
|
109
|
+
about?: string | undefined;
|
|
110
|
+
content?: string | undefined;
|
|
111
|
+
datatype?: string | undefined;
|
|
112
|
+
inlist?: any;
|
|
113
|
+
prefix?: string | undefined;
|
|
114
|
+
property?: string | undefined;
|
|
115
|
+
rel?: string | undefined;
|
|
116
|
+
resource?: string | undefined;
|
|
117
|
+
rev?: string | undefined;
|
|
118
|
+
typeof?: string | undefined;
|
|
119
|
+
vocab?: string | undefined;
|
|
120
|
+
autoCorrect?: string | undefined;
|
|
121
|
+
autoSave?: string | undefined;
|
|
122
|
+
color?: string | undefined;
|
|
123
|
+
itemProp?: string | undefined;
|
|
124
|
+
itemScope?: boolean | undefined;
|
|
125
|
+
itemType?: string | undefined;
|
|
126
|
+
itemID?: string | undefined;
|
|
127
|
+
itemRef?: string | undefined;
|
|
128
|
+
results?: number | undefined;
|
|
129
|
+
security?: string | undefined;
|
|
130
|
+
unselectable?: "off" | "on" | undefined;
|
|
131
|
+
inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
132
|
+
is?: string | undefined;
|
|
133
|
+
exportparts?: string | undefined;
|
|
134
|
+
part?: string | undefined;
|
|
99
135
|
"aria-activedescendant"?: string | undefined;
|
|
100
136
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
101
137
|
"aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
|
|
@@ -108,21 +144,20 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
108
144
|
"aria-colindextext"?: string | undefined;
|
|
109
145
|
"aria-colspan"?: number | undefined;
|
|
110
146
|
"aria-controls"?: string | undefined;
|
|
111
|
-
"aria-current"?: boolean | "
|
|
147
|
+
"aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
112
148
|
"aria-describedby"?: string | undefined;
|
|
113
149
|
"aria-description"?: string | undefined;
|
|
114
150
|
"aria-details"?: string | undefined;
|
|
115
151
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
116
|
-
"aria-dropeffect"?: "
|
|
152
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
117
153
|
"aria-errormessage"?: string | undefined;
|
|
118
154
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
119
155
|
"aria-flowto"?: string | undefined;
|
|
120
156
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
121
|
-
"aria-haspopup"?: boolean | "
|
|
157
|
+
"aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
|
|
122
158
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
123
159
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
124
160
|
"aria-keyshortcuts"?: string | undefined;
|
|
125
|
-
'aria-label'?: string | undefined;
|
|
126
161
|
"aria-labelledby"?: string | undefined;
|
|
127
162
|
"aria-level"?: number | undefined;
|
|
128
163
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
@@ -135,7 +170,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
135
170
|
"aria-posinset"?: number | undefined;
|
|
136
171
|
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
137
172
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
138
|
-
"aria-relevant"?: "text" | "
|
|
173
|
+
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
139
174
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
140
175
|
"aria-roledescription"?: string | undefined;
|
|
141
176
|
"aria-rowcount"?: number | undefined;
|
|
@@ -302,43 +337,8 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
302
337
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
|
|
303
338
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
304
339
|
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
340
|
rows?: number | false | undefined;
|
|
341
|
+
tooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
342
342
|
autoShowTooltip?: boolean | undefined;
|
|
343
343
|
refs?: import("../../api").Refs | undefined;
|
|
344
344
|
ref: import("../../api").Refs | undefined;
|
|
@@ -13,7 +13,7 @@ var _constant = require("../../select/component/constant");
|
|
|
13
13
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
14
14
|
function parseHighlightTextAndRestProps(props) {
|
|
15
15
|
var highlightTextProps = _lodash.default.pick(props, _constant.highlightTextPropKeys);
|
|
16
|
-
var restProps = _lodash.default.omit(props, [].concat((0, _toConsumableArray2.default)(_constant.highlightTextPropKeys), ['__callback__', 'showAll', 'isNoMatchSearchText', 'shouldRerenderOptions', '__filterNotExistValue__']));
|
|
16
|
+
var restProps = _lodash.default.omit(props, [].concat((0, _toConsumableArray2.default)(_constant.highlightTextPropKeys), ['__callback__', '__callbackDeps__', 'showAll', 'isNoMatchSearchText', 'shouldRerenderOptions', '__filterNotExistValue__']));
|
|
17
17
|
return {
|
|
18
18
|
highlightTextProps: highlightTextProps,
|
|
19
19
|
restProps: restProps
|
|
@@ -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[];
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getDisplayValue = getDisplayValue;
|
|
8
8
|
exports.useSelectOptions = useSelectOptions;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var _form = require("../../form");
|
|
12
13
|
var _utils = require("../../form/component/utils");
|
|
@@ -14,7 +15,7 @@ var _hooks = require("../../hooks");
|
|
|
14
15
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
15
16
|
var _react = require("react");
|
|
16
17
|
var _utils2 = require("./utils");
|
|
17
|
-
var _excluded = ["value", "loading", "options", "__callback__", "shouldRerenderOptions", "__filterNotExistValue__"];
|
|
18
|
+
var _excluded = ["value", "loading", "options", "__callback__", "__callbackDeps__", "shouldRerenderOptions", "__filterNotExistValue__"];
|
|
18
19
|
var selectOptionsPropKeys = ['options', 'search', 'sort', 'renderLabel', 'presetProcessOption', 'finalProcessOption'];
|
|
19
20
|
function parseSelectOptionsAndRestProps(props) {
|
|
20
21
|
var selectOptionsProps = _lodash.default.pick(props, selectOptionsPropKeys);
|
|
@@ -44,6 +45,8 @@ function useSelectOptions(_ref2) {
|
|
|
44
45
|
loading = _ref2.loading,
|
|
45
46
|
options = _ref2.options,
|
|
46
47
|
__callback__ = _ref2.__callback__,
|
|
48
|
+
_ref2$__callbackDeps_ = _ref2.__callbackDeps__,
|
|
49
|
+
__callbackDeps__ = _ref2$__callbackDeps_ === void 0 ? [] : _ref2$__callbackDeps_,
|
|
47
50
|
shouldRerenderOptions = _ref2.shouldRerenderOptions,
|
|
48
51
|
filterNotExistValue = _ref2.__filterNotExistValue__,
|
|
49
52
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
@@ -69,7 +72,7 @@ function useSelectOptions(_ref2) {
|
|
|
69
72
|
};
|
|
70
73
|
__callback__ === null || __callback__ === void 0 || __callback__(params);
|
|
71
74
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
-
}, [memoValue, memoOptions, finalLoading]);
|
|
75
|
+
}, [memoValue, memoOptions, finalLoading].concat((0, _toConsumableArray2.default)(__callbackDeps__)));
|
|
73
76
|
var displayOptions = (0, _react.useMemo)(function () {
|
|
74
77
|
return (0, _utils2.generateOptions)((0, _objectSpread2.default)({
|
|
75
78
|
options: memoOptions
|
|
@@ -3,7 +3,7 @@ import { UseFetchOptions } from "../../hooks";
|
|
|
3
3
|
import { TextProps } from "../../text";
|
|
4
4
|
import { SelectProps as AntdSelectProps } from 'antd/es/select';
|
|
5
5
|
import { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select';
|
|
6
|
-
import { ReactNode } from 'react';
|
|
6
|
+
import { DependencyList, ReactNode } from 'react';
|
|
7
7
|
/**
|
|
8
8
|
* @noExtends
|
|
9
9
|
*/
|
|
@@ -54,6 +54,7 @@ export interface BaseSelectProps {
|
|
|
54
54
|
*/
|
|
55
55
|
__filterNotExistValue__?: boolean;
|
|
56
56
|
__callback__?(props: SelectCallbackProps): void;
|
|
57
|
+
__callbackDeps__?: DependencyList;
|
|
57
58
|
}
|
|
58
59
|
type UnionType = Omit<AntdSelectProps, 'options'> & Omit<BaseSelectProps, 'options'> & BaseComponentProps;
|
|
59
60
|
export interface SelectProps extends UnionType {
|
|
@@ -6,16 +6,16 @@ export declare function getRenderTabBar({ type, items, size, tabBarGutter, tabBa
|
|
|
6
6
|
export declare function generateTabItems({ items }: TabsProps): {
|
|
7
7
|
label: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
8
|
key: string;
|
|
9
|
-
|
|
9
|
+
prefixCls?: string | undefined;
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
|
|
11
|
+
style?: import("react").CSSProperties | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
12
13
|
children?: import("react").ReactNode;
|
|
13
|
-
|
|
14
|
+
id?: string | undefined;
|
|
14
15
|
closable?: boolean | undefined;
|
|
15
16
|
closeIcon?: import("react").ReactNode;
|
|
16
17
|
active?: boolean | undefined;
|
|
17
|
-
|
|
18
|
-
prefixCls?: string | undefined;
|
|
18
|
+
icon?: import("react").ReactNode;
|
|
19
19
|
forceRender?: boolean | undefined;
|
|
20
20
|
destroyInactiveTabPane?: boolean | undefined;
|
|
21
21
|
animated?: boolean | undefined;
|