doui-react 1.0.2 → 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/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 +9 -21
- 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 +35 -25
- 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 +195 -190
- 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 +14 -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 +1 -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 +72 -100
- 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 +1 -3
- 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 +30 -20
- 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/type/index.d.ts +1 -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 +9 -21
- 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 +35 -25
- 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 +195 -190
- 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 +12 -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 -2
- 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 +72 -100
- 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 +1 -3
- 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 +30 -20
- 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/type/index.d.ts +1 -1
- package/package.json +10 -13
|
@@ -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
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FormValues } from "../../form";
|
|
2
2
|
import { BaseSelectProps, SelectOptions } from "..";
|
|
3
|
-
import { DependencyList } from 'react';
|
|
4
3
|
export declare function generateOptions({ options, sort, ...rest }: BaseSelectProps): any[];
|
|
5
4
|
export declare function getOptionsValue(options?: SelectOptions): (string | number)[];
|
|
6
5
|
interface DependenciesProps {
|
|
7
6
|
values?: FormValues;
|
|
8
|
-
deps?:
|
|
7
|
+
deps?: string[];
|
|
9
8
|
search: string;
|
|
10
9
|
isFunctionOptions: boolean;
|
|
11
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseComponentProps, FunctionReturn } from "../../api";
|
|
2
2
|
import { UseFetchOptions } from "../../hooks";
|
|
3
3
|
import { TextProps } from "../../text";
|
|
4
|
-
import { SelectProps as AntdSelectProps } from 'antd/
|
|
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 {
|
|
@@ -12,7 +12,8 @@ export declare const alignMap: {
|
|
|
12
12
|
between: string;
|
|
13
13
|
};
|
|
14
14
|
export declare function getAlign(align: HStackProps['align']): string;
|
|
15
|
-
|
|
15
|
+
type WidthFlexStyle = Pick<HStackProps, 'width' | 'style' | 'flex'>;
|
|
16
|
+
export declare function getWidthAndFlex({ width, style, flex }: WidthFlexStyle): import("@emotion/react").SerializedStyles;
|
|
16
17
|
declare const style: {
|
|
17
18
|
hStack: (props: Partial<HStackProps>) => import("@emotion/react").SerializedStyles;
|
|
18
19
|
vStack: (props: Partial<VStackProps>) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseComponentProps, FunctionReturn } from "../../api";
|
|
2
|
-
import { SwitchProps as AntdSwitchProps } from 'antd/
|
|
3
|
-
import { EllipsisConfig } from 'antd/
|
|
2
|
+
import { SwitchProps as AntdSwitchProps } from 'antd/es/switch';
|
|
3
|
+
import { EllipsisConfig } from 'antd/es/typography/Base';
|
|
4
4
|
export interface SwitchProps extends AntdSwitchProps, BaseComponentProps {
|
|
5
5
|
/**
|
|
6
6
|
* @description 提示信息
|
|
@@ -17,7 +17,6 @@ function generateAction(action, params) {
|
|
|
17
17
|
disabled: executeFunction(action.disabled, params),
|
|
18
18
|
tooltip: executeFunction(action.tooltip, params),
|
|
19
19
|
confirm: executeFunction(action.confirm, params),
|
|
20
|
-
confirmMessage: executeFunction(action.confirmMessage, params),
|
|
21
20
|
onClick: function onClick() {
|
|
22
21
|
var _action$onClick;
|
|
23
22
|
return (_action$onClick = action.onClick) === null || _action$onClick === void 0 ? void 0 : _action$onClick.call(action, params);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Column } from '../type';
|
|
2
2
|
export declare function getSortColumn({ dataIndex, sort }: Column): {
|
|
3
|
-
sorter: import("antd/
|
|
3
|
+
sorter: import("antd/es/table/interface").CompareFn<any>;
|
|
4
4
|
} | {
|
|
5
5
|
sorter: (a: any, b: any) => any;
|
|
6
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
3
3
|
var defaultFormat = 'YYYY-MM-DD hh:mm:ss A';
|
|
4
4
|
export function Time(_ref) {
|
|
@@ -7,6 +7,6 @@ export function Time(_ref) {
|
|
|
7
7
|
var timeFormat = column.timeFormat;
|
|
8
8
|
var format = timeFormat || defaultFormat;
|
|
9
9
|
return _jsx(_Fragment, {
|
|
10
|
-
children:
|
|
10
|
+
children: dayjs(+children).format(format)
|
|
11
11
|
});
|
|
12
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormInstance, FormProps } from "../../form";
|
|
3
|
-
import {
|
|
2
|
+
import type { ColumnType } from 'antd/es/table';
|
|
3
|
+
import type { TableRowSelection } from 'antd/es/table/interface';
|
|
4
4
|
import { Column, DataSource, GetSearchColumn, TableContext, TableProps } from '../type';
|
|
5
5
|
import { Actions } from './actions';
|
|
6
6
|
import { Editor } from './editor';
|
|
@@ -19,81 +19,7 @@ export declare const componentMap: {
|
|
|
19
19
|
editor: typeof Editor;
|
|
20
20
|
default: (props: any) => any;
|
|
21
21
|
};
|
|
22
|
-
export declare function generateColumns({ columns, getSearchColumn }: GenerateColumnsProps):
|
|
23
|
-
render: (current: any, record: Record<string, any>, index: number) => import("react").ReactNode;
|
|
24
|
-
dataIndex?: string | undefined;
|
|
25
|
-
type?: "link" | "switch" | "time" | "actions" | "selection" | "editor" | undefined;
|
|
26
|
-
width?: string | number | undefined;
|
|
27
|
-
minWidth?: string | number | undefined;
|
|
28
|
-
maxWidth?: string | number | undefined;
|
|
29
|
-
rows?: number | undefined;
|
|
30
|
-
timeFormat?: string | undefined;
|
|
31
|
-
disabled?: boolean | ((props: import("../type").CommonProps) => boolean) | undefined;
|
|
32
|
-
tooltip?: import("react").ReactNode | ((props: import("../type").CommonProps) => import("react").ReactNode);
|
|
33
|
-
onClick?(props: import("../type").CommonProps): any;
|
|
34
|
-
search?: boolean | string[] | ((props: import("../type").CustomFilterProps) => boolean) | undefined;
|
|
35
|
-
placeholder?: string | undefined;
|
|
36
|
-
sort?: boolean | import("antd/lib/table/interface").CompareFn<any> | {
|
|
37
|
-
compare?: import("antd/lib/table/interface").CompareFn<any> | undefined;
|
|
38
|
-
multiple?: number | undefined;
|
|
39
|
-
} | undefined;
|
|
40
|
-
filters?: (boolean | import("react").Key | import("antd/lib/table/interface").ColumnFilterItem)[] | undefined;
|
|
41
|
-
filterBy?: string[] | ((props: import("../type").CustomFilterProps) => boolean) | undefined;
|
|
42
|
-
actions?: import("../type").ActionProps[] | ((props: import("../type").CommonProps) => import("../type").ActionProps[]) | undefined;
|
|
43
|
-
editorProps?: import("../../form").FormItemProps | ((props: import("../type").CommonProps) => import("../../form").FormItemProps) | undefined;
|
|
44
|
-
className?: string | undefined;
|
|
45
|
-
title?: import("antd/lib/table/interface").ColumnTitle<any>;
|
|
46
|
-
responsive?: import("antd/lib/_util/responsiveObserve").Breakpoint[] | undefined;
|
|
47
|
-
align?: import("rc-table/lib/interface").AlignType | undefined;
|
|
48
|
-
fixed?: import("rc-table/lib/interface").FixedType | undefined;
|
|
49
|
-
colSpan?: number | undefined;
|
|
50
|
-
rowSpan?: number | undefined;
|
|
51
|
-
key?: import("react").Key | undefined;
|
|
52
|
-
shouldCellUpdate?: ((record: any, prevRecord: any) => boolean) | undefined;
|
|
53
|
-
onCell?: import("rc-table/lib/interface").GetComponentProps<any> | undefined;
|
|
54
|
-
onCellClick?: ((record: any, e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined;
|
|
55
|
-
onHeaderCell?: import("rc-table/lib/interface").GetComponentProps<import("rc-table/lib/interface").ColumnType<any> | import("rc-table/lib/interface").ColumnGroupType<any>> | undefined;
|
|
56
|
-
sorter?: boolean | import("antd/lib/table/interface").CompareFn<any> | {
|
|
57
|
-
compare?: import("antd/lib/table/interface").CompareFn<any> | undefined;
|
|
58
|
-
multiple?: number | undefined;
|
|
59
|
-
} | undefined;
|
|
60
|
-
sortOrder?: import("antd/lib/table/interface").SortOrder | undefined;
|
|
61
|
-
defaultSortOrder?: import("antd/lib/table/interface").SortOrder | undefined;
|
|
62
|
-
sortDirections?: import("antd/lib/table/interface").SortOrder[] | undefined;
|
|
63
|
-
showSorterTooltip?: boolean | import("antd").TooltipProps | undefined;
|
|
64
|
-
filtered?: boolean | undefined;
|
|
65
|
-
filterDropdown?: import("react").ReactNode | ((props: import("antd/lib/table/interface").FilterDropdownProps) => import("react").ReactNode);
|
|
66
|
-
filterMultiple?: boolean | undefined;
|
|
67
|
-
filteredValue?: import("antd/lib/table/interface").FilterValue | null | undefined;
|
|
68
|
-
defaultFilteredValue?: import("antd/lib/table/interface").FilterValue | null | undefined;
|
|
69
|
-
filterIcon?: import("react").ReactNode | ((filtered: boolean) => import("react").ReactNode);
|
|
70
|
-
filterMode?: "menu" | "tree" | undefined;
|
|
71
|
-
filterSearch?: import("antd/lib/table/interface").FilterSearchType<import("antd/lib/table/interface").ColumnFilterItem> | undefined;
|
|
72
|
-
onFilter?: ((value: boolean | import("react").Key, record: any) => boolean) | undefined;
|
|
73
|
-
filterDropdownVisible?: boolean | undefined;
|
|
74
|
-
filterDropdownOpen?: boolean | undefined;
|
|
75
|
-
onFilterDropdownVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
76
|
-
onFilterDropdownOpenChange?: ((open: boolean) => void) | undefined;
|
|
77
|
-
filterResetToDefaultFilteredValue?: boolean | undefined;
|
|
78
|
-
onChange?: ((selectedRowKeys: import("react").Key[], selectedRows: any[], info: {
|
|
79
|
-
type: import("antd/lib/table/interface").RowSelectMethod;
|
|
80
|
-
}) => void) | undefined;
|
|
81
|
-
onSelect?: import("antd/lib/table/interface").SelectionSelectFn<any> | undefined;
|
|
82
|
-
columnWidth?: string | number | undefined;
|
|
83
|
-
preserveSelectedRowKeys?: boolean | undefined;
|
|
84
|
-
selectedRowKeys?: import("react").Key[] | undefined;
|
|
85
|
-
defaultSelectedRowKeys?: import("react").Key[] | undefined;
|
|
86
|
-
getCheckboxProps?: ((record: any) => Partial<Omit<import("antd").CheckboxProps, "defaultChecked" | "checked">>) | undefined;
|
|
87
|
-
onSelectMultiple?: ((selected: boolean, selectedRows: any[], changeRows: any[]) => void) | undefined;
|
|
88
|
-
onSelectAll?: ((selected: boolean, selectedRows: any[], changeRows: any[]) => void) | undefined;
|
|
89
|
-
onSelectInvert?: ((selectedRowKeys: import("react").Key[]) => void) | undefined;
|
|
90
|
-
onSelectNone?: (() => void) | undefined;
|
|
91
|
-
selections?: boolean | import("antd/lib/table/hooks/useSelection").INTERNAL_SELECTION_ITEM[] | undefined;
|
|
92
|
-
hideSelectAll?: boolean | undefined;
|
|
93
|
-
columnTitle?: import("react").ReactNode;
|
|
94
|
-
checkStrictly?: boolean | undefined;
|
|
95
|
-
renderCell?: ((value: boolean, record: any, index: number, originNode: import("react").ReactNode) => import("react").ReactNode | import("rc-table/lib/interface").RenderedCell<any>) | undefined;
|
|
96
|
-
}[];
|
|
22
|
+
export declare function generateColumns({ columns, getSearchColumn }: GenerateColumnsProps): ColumnType<any>[];
|
|
97
23
|
interface RowSelectionProps {
|
|
98
24
|
rowKey: string;
|
|
99
25
|
columns: Column[];
|
|
@@ -28,9 +28,7 @@ export var componentMap = {
|
|
|
28
28
|
export function generateColumns(_ref) {
|
|
29
29
|
var columns = _ref.columns,
|
|
30
30
|
getSearchColumn = _ref.getSearchColumn;
|
|
31
|
-
return _.
|
|
32
|
-
return column.width !== 0;
|
|
33
|
-
}).map(function (column) {
|
|
31
|
+
return _.map(columns, function (column) {
|
|
34
32
|
var newColumn = _.clone(column);
|
|
35
33
|
var search = newColumn.search,
|
|
36
34
|
sort = newColumn.sort,
|
package/es/table/hook/search.js
CHANGED
|
@@ -94,12 +94,14 @@ function getSearchableColumn(column) {
|
|
|
94
94
|
}
|
|
95
95
|
return filter.apply(void 0, [column].concat(args));
|
|
96
96
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
filterDropdownProps: {
|
|
98
|
+
onOpenChange: function onOpenChange(visible) {
|
|
99
|
+
if (visible) {
|
|
100
|
+
setTimeout(function () {
|
|
101
|
+
var _currentInput;
|
|
102
|
+
return (_currentInput = currentInput) === null || _currentInput === void 0 ? void 0 : _currentInput.focus();
|
|
103
|
+
}, 30);
|
|
104
|
+
}
|
|
103
105
|
}
|
|
104
106
|
},
|
|
105
107
|
render: function render(text) {
|
|
@@ -3,7 +3,7 @@ import { ButtonProps } from "../../button";
|
|
|
3
3
|
import { FormListActionProps, FormListProps } from "../../form";
|
|
4
4
|
import { TableContext } from "..";
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
|
-
type ButtonType = Omit<ButtonProps & Partial<FormListActionProps> & Pick<FormListProps, 'focusFirstOnAdd'>, 'icon' | 'show' | 'disabled' | 'tooltip' | 'confirm' | '
|
|
6
|
+
type ButtonType = Omit<ButtonProps & Partial<FormListActionProps> & Pick<FormListProps, 'focusFirstOnAdd'>, 'icon' | 'show' | 'disabled' | 'tooltip' | 'confirm' | 'onClick'>;
|
|
7
7
|
export interface ActionProps extends ButtonType {
|
|
8
8
|
/**
|
|
9
9
|
* @description 图标
|
|
@@ -33,12 +33,7 @@ export interface ActionProps extends ButtonType {
|
|
|
33
33
|
* @default false
|
|
34
34
|
* @link TableContext: #tablecontext
|
|
35
35
|
*/
|
|
36
|
-
confirm?:
|
|
37
|
-
/**
|
|
38
|
-
* @description 确认信息
|
|
39
|
-
* @link TableContext: #tablecontext
|
|
40
|
-
*/
|
|
41
|
-
confirmMessage?: ReactNode | ((props: TableContext) => ReactNode);
|
|
36
|
+
confirm?: ButtonProps['confirm'] | ((props: TableContext) => ButtonProps['confirm']);
|
|
42
37
|
/**
|
|
43
38
|
* @description 点击回调
|
|
44
39
|
* @link TableContext: #tablecontext
|
|
@@ -2,10 +2,10 @@ import { FunctionReturn } from "../../api";
|
|
|
2
2
|
import { FormItemProps } from "../../form";
|
|
3
3
|
import { ActionProps, CommonProps } from "..";
|
|
4
4
|
import { componentMap } from "../component/utils";
|
|
5
|
-
import { ColumnType } from 'antd/
|
|
6
|
-
import { ColumnFilterItem, TableRowSelection } from 'antd/
|
|
5
|
+
import type { ColumnType } from 'antd/es/table';
|
|
6
|
+
import type { ColumnFilterItem, TableRowSelection } from 'antd/es/table/interface';
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
|
-
type UnionColumnType = Omit<ColumnType<any>, 'ellipsis' | 'filters'> & Omit<TableRowSelection<any>, 'type'>;
|
|
8
|
+
type UnionColumnType = Omit<ColumnType<any>, 'ellipsis' | 'filters' | 'minWidth' | 'maxWidth'> & Omit<TableRowSelection<any>, 'type'>;
|
|
9
9
|
export interface Column extends UnionColumnType {
|
|
10
10
|
/**
|
|
11
11
|
* @description 字段名
|
|
@@ -6,19 +6,19 @@ 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
|
+
prefixCls?: string | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
9
11
|
style?: import("react").CSSProperties | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
10
13
|
children?: import("react").ReactNode;
|
|
11
|
-
className?: string | undefined;
|
|
12
14
|
id?: string | undefined;
|
|
13
|
-
icon?: import("react").ReactNode;
|
|
14
|
-
prefixCls?: string | undefined;
|
|
15
|
-
disabled?: boolean | undefined;
|
|
16
|
-
animated?: boolean | undefined;
|
|
17
|
-
destroyInactiveTabPane?: boolean | undefined;
|
|
18
|
-
forceRender?: boolean | undefined;
|
|
19
15
|
closable?: boolean | undefined;
|
|
20
16
|
closeIcon?: import("react").ReactNode;
|
|
21
|
-
tabKey?: string | undefined;
|
|
22
17
|
active?: boolean | undefined;
|
|
18
|
+
icon?: import("react").ReactNode;
|
|
19
|
+
forceRender?: boolean | undefined;
|
|
20
|
+
destroyInactiveTabPane?: boolean | undefined;
|
|
21
|
+
animated?: boolean | undefined;
|
|
22
|
+
tabKey?: string | undefined;
|
|
23
23
|
}[];
|
|
24
24
|
export {};
|
package/es/tabs/type/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectOption } from "../../select";
|
|
2
2
|
import { TabsProps as AntdTabsProps } from 'antd';
|
|
3
|
-
import { TabsType } from 'antd/
|
|
3
|
+
import { TabsType } from 'antd/es/tabs';
|
|
4
4
|
import { Tab } from 'rc-tabs/lib/interface';
|
|
5
5
|
export interface TabProps extends Tab, Omit<SelectOption, 'label'> {
|
|
6
6
|
}
|
|
@@ -4,6 +4,7 @@ var _excluded = ["children", "tooltip", "rows", "autoShowTooltip"];
|
|
|
4
4
|
import { generateTooltip } from "./..";
|
|
5
5
|
import { getTooltipProps } from "../../tooltip";
|
|
6
6
|
import { Tooltip, Typography } from 'antd';
|
|
7
|
+
import ResizeObserver from 'rc-resize-observer';
|
|
7
8
|
import style from "../style";
|
|
8
9
|
import { useText } from "./use-text";
|
|
9
10
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
@@ -16,12 +17,11 @@ export function Text(_ref) {
|
|
|
16
17
|
_ref$autoShowTooltip = _ref.autoShowTooltip,
|
|
17
18
|
autoShowTooltip = _ref$autoShowTooltip === void 0 ? true : _ref$autoShowTooltip,
|
|
18
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
-
var _useText = useText(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
key = _useText.key;
|
|
20
|
+
var _useText = useText(),
|
|
21
|
+
key = _useText.key,
|
|
22
|
+
onResize = _useText.onResize;
|
|
23
23
|
if (tooltip === false || !rows) {
|
|
24
|
-
return _jsx("
|
|
24
|
+
return _jsx("span", _objectSpread(_objectSpread({
|
|
25
25
|
css: style.wordBreak
|
|
26
26
|
}, props), {}, {
|
|
27
27
|
children: children
|
|
@@ -29,19 +29,18 @@ export function Text(_ref) {
|
|
|
29
29
|
}
|
|
30
30
|
var ellipsis = {
|
|
31
31
|
rows: rows,
|
|
32
|
-
tooltip: getTooltipProps(_objectSpread({
|
|
33
|
-
align: {
|
|
34
|
-
offset: [0, 5]
|
|
35
|
-
}
|
|
36
|
-
}, generateTooltip(tooltip !== null && tooltip !== void 0 ? tooltip : children)))
|
|
32
|
+
tooltip: getTooltipProps(_objectSpread({}, generateTooltip(tooltip !== null && tooltip !== void 0 ? tooltip : children)))
|
|
37
33
|
};
|
|
38
34
|
if (autoShowTooltip) {
|
|
39
|
-
return _jsx(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
return _jsx(ResizeObserver, {
|
|
36
|
+
onResize: onResize,
|
|
37
|
+
children: _jsx(Paragraph, _objectSpread(_objectSpread({
|
|
38
|
+
css: style.wrapper
|
|
39
|
+
}, props), {}, {
|
|
40
|
+
ellipsis: ellipsis,
|
|
41
|
+
children: children
|
|
42
|
+
}), key)
|
|
43
|
+
});
|
|
45
44
|
}
|
|
46
45
|
return _jsx(Tooltip, _objectSpread(_objectSpread({}, ellipsis.tooltip), {}, {
|
|
47
46
|
children: _jsx(Paragraph, _objectSpread(_objectSpread({
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { useDebounce,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
setKey = _useState2[1];
|
|
11
|
-
var reset = useDebounce(setKey, 150);
|
|
12
|
-
useWindowResize(function (_ref2) {
|
|
13
|
-
var width = _ref2.width;
|
|
14
|
-
return reset(width);
|
|
2
|
+
import { useDebounce, useSafeState } from "../../hooks";
|
|
3
|
+
export function useText() {
|
|
4
|
+
var _useSafeState = useSafeState(0),
|
|
5
|
+
_useSafeState2 = _slicedToArray(_useSafeState, 2),
|
|
6
|
+
key = _useSafeState2[0],
|
|
7
|
+
setKey = _useSafeState2[1];
|
|
8
|
+
var reset = useDebounce(setKey, 150, {
|
|
9
|
+
leading: false
|
|
15
10
|
});
|
|
16
|
-
|
|
17
|
-
// 修复某些场景下,tooltip 会自动显示的问题
|
|
18
|
-
useUpdateEffect(function () {
|
|
19
|
-
reset(Date.now());
|
|
20
|
-
}, [children]);
|
|
21
11
|
return {
|
|
22
|
-
key: key
|
|
12
|
+
key: key,
|
|
13
|
+
onResize: function onResize(size) {
|
|
14
|
+
return reset(size.width);
|
|
15
|
+
}
|
|
23
16
|
};
|
|
24
17
|
}
|
package/es/text/style/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
|
|
|
2
2
|
var _templateObject, _templateObject2;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
var style = {
|
|
5
|
-
wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.ant-typography {\n color: inherit;\n margin-bottom: 0;\n max-width: 100%;\n }\n "]))),
|
|
5
|
+
wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.ant-typography {\n font-size: inherit;\n color: inherit;\n margin-bottom: 0;\n max-width: 100%;\n }\n "]))),
|
|
6
6
|
wordBreak: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n white-space: pre-wrap;\n word-wrap: break-word;\n word-break: break-word;\n "])))
|
|
7
7
|
};
|
|
8
8
|
export default style;
|
package/es/text/type/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EllipsisConfig } from 'antd/
|
|
2
|
-
import type { TypographyProps } from 'antd/
|
|
1
|
+
import { EllipsisConfig } from 'antd/es/typography/Base';
|
|
2
|
+
import type { TypographyProps } from 'antd/es/typography/Typography';
|
|
3
3
|
export interface TextProps extends Omit<TypographyProps<any>, 'onChange'> {
|
|
4
4
|
/**
|
|
5
5
|
* @description 最多显示的行数,设置为 `0` 时,不显示省略号
|