vap1 0.0.7 → 0.0.8
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/components/SearchBar/ActionButtons.d.ts +2 -1
- package/components/SearchBar/ByKeyword.js +1 -1
- package/components/Tables/ApiTableModal.d.ts +2 -2
- package/components/Tables/TopTable.js +3 -3
- package/components/Tables/TopTableModal.d.ts +2 -2
- package/components/Tables/VTable.js +3 -1
- package/components/Trees/ActionTree.d.ts +3 -1
- package/components/Trees/ActionTree.js +77 -20
- package/components/Trees/BaseTree.d.ts +8 -3
- package/components/Trees/BaseTree.js +12 -3
- package/components/Trees/FTree.js +0 -1
- package/components/Trees/STree.js +6 -7
- package/components/Trees/index.d.ts +6 -1
- package/components/UForm/UForm.js +40 -8
- package/components/UForm/UFormModal.js +4 -1
- package/components/UForm/UInfoModal.js +3 -0
- package/components/UForm/UModal.js +10 -5
- package/components/UForm/index.d.ts +8 -3
- package/components/Upload/UploadModal.d.ts +2 -2
- package/components/Upload/UploadModal.js +5 -1
- package/components/Upload/useUpload.d.ts +2 -2
- package/components/_adapt/Alert.d.ts +3 -3
- package/components/_adapt/Breadcrumb.d.ts +15 -0
- package/components/_adapt/Breadcrumb.js +18 -0
- package/components/_adapt/Button.d.ts +5 -5
- package/components/_adapt/Button.js +2 -0
- package/components/_adapt/Collapse.d.ts +7 -7
- package/components/_adapt/ConfigProvider.d.ts +6 -0
- package/components/_adapt/ConfigProvider.js +10 -0
- package/components/_adapt/Drawer.d.ts +3 -3
- package/components/_adapt/Dropdown.d.ts +6 -6
- package/components/_adapt/FloatButton.d.ts +3 -3
- package/components/_adapt/FloatButton.js +1 -0
- package/components/_adapt/Form.d.ts +14 -0
- package/components/_adapt/Form.js +48 -0
- package/components/_adapt/Input.d.ts +17 -0
- package/components/_adapt/Input.js +43 -0
- package/components/_adapt/InputNumber.d.ts +8 -0
- package/components/_adapt/InputNumber.js +60 -0
- package/components/_adapt/Menu.d.ts +8 -7
- package/components/_adapt/Menu.js +12 -20
- package/components/_adapt/Modal.d.ts +9 -7
- package/components/_adapt/Modal.js +12 -20
- package/components/_adapt/Popconfirm.d.ts +3 -3
- package/components/_adapt/Popover.d.ts +3 -3
- package/components/_adapt/Progress.d.ts +3 -3
- package/components/_adapt/Radio.d.ts +16 -0
- package/components/_adapt/Radio.js +24 -0
- package/components/_adapt/Select.d.ts +15 -8
- package/components/_adapt/Select.js +134 -13
- package/components/_adapt/Slider.d.ts +31 -0
- package/components/_adapt/Slider.js +5 -0
- package/components/_adapt/Table.d.ts +26 -0
- package/components/_adapt/Table.js +43 -0
- package/components/_adapt/Tabs.d.ts +4 -4
- package/components/_adapt/Tag.d.ts +9 -7
- package/components/_adapt/Tag.js +4 -3
- package/components/_adapt/Tooltip.d.ts +3 -3
- package/components/_adapt/TreeSelect.d.ts +13 -0
- package/components/_adapt/TreeSelect.js +46 -0
- package/components/_adapt/_Antd5.d.ts +11 -0
- package/components/_adapt/_Antd5.js +5 -0
- package/components/_adapt/notification.d.ts +22 -0
- package/components/_adapt/notification.js +5 -0
- package/components/_adapt/todo/Image.d.ts +1 -1
- package/components/_adapt/todo/Segmented.d.ts +1 -1
- package/components/_adapt/utils.d.ts +1 -1
- package/components/_adapt/utils.js +1 -0
- package/components/_common/AutoComplete.js +1 -1
- package/components/_setup/UForm/UFormTree.js +1 -1
- package/deps/SpringCloud.d.ts +1 -1
- package/hooks/useAjaxQuery.d.ts +5 -8
- package/hooks/useAjaxQuery.js +21 -25
- package/index.d.ts +43 -30
- package/index.js +23 -13
- package/package.json +1 -1
- package/utils/Const.d.ts +1 -1
- package/utils/CustomApp.d.ts +3 -3
- package/utils/Global.js +39 -0
- package/utils/PageUtil.d.ts +5 -1
- package/utils/PageUtil.js +15 -1
- package/utils/Renders/StatusRender.d.ts +1 -1
- package/utils/TreeUtil.d.ts +9 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BaseUploadProps } from './index';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ModalProps } from '../../components/_adapt/Modal';
|
|
4
4
|
import type { PlainObject } from '../../basetype';
|
|
5
5
|
/**
|
|
6
6
|
* 导入结果
|
|
@@ -26,7 +26,7 @@ type ImportResult = boolean | {
|
|
|
26
26
|
9. 导入成功后显示结果,成功 OR 失败,失败时重新上传
|
|
27
27
|
0. 成功后可关闭窗体,关闭后可自行刷新数据。
|
|
28
28
|
*/
|
|
29
|
-
export type UploadModalProps =
|
|
29
|
+
export type UploadModalProps = ModalProps & Omit<BaseUploadProps, 'onChange' | 'disabled'> & {
|
|
30
30
|
/**
|
|
31
31
|
* 上传提示,通常包括上传数据说明,数据模板文件下载等内容。
|
|
32
32
|
* 默认 : 请注意:导入的Excel数据字段须与Excel模版保持一致,否则无法导入数据。点击确认时将仅导入正常数据。
|
|
@@ -39,6 +39,7 @@ exports.UploadModal = void 0;
|
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
40
40
|
const lodash_1 = __importDefault(require("lodash"));
|
|
41
41
|
const Modal_1 = require("../../components/_adapt/Modal");
|
|
42
|
+
// import { Icon } from '../../components/_adapt/Icon';
|
|
42
43
|
const utils_1 = require("../../utils");
|
|
43
44
|
const antd_1 = require("antd");
|
|
44
45
|
const Alert_1 = require("../_adapt/Alert");
|
|
@@ -48,6 +49,9 @@ const Const_1 = require("../../components/_setup/Const");
|
|
|
48
49
|
const DEFAULT = { uploading: false, uploaded: false, percent: 0, error: false, };
|
|
49
50
|
const UploadModal = props => {
|
|
50
51
|
const [state, setState] = (0, react_1.useState)(DEFAULT);
|
|
52
|
+
const [open, afterClose] = (0, Modal_1.useDestoryModal)(props);
|
|
53
|
+
if (!open)
|
|
54
|
+
return utils_1.Const.NONE;
|
|
51
55
|
const onChange = (info) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
56
|
if (lodash_1.default.isEmpty(info.file))
|
|
53
57
|
return;
|
|
@@ -132,7 +136,7 @@ const UploadModal = props => {
|
|
|
132
136
|
react_1.default.createElement(Button_1.Button, { loading: state.uploading, disabled: state.uploading, icon: "upload" }, utils_1.i18n.txt(Const_1.V.UPLOAD_FILE))),
|
|
133
137
|
react_1.default.createElement(Button_1.Button, { onClick: () => props.onCancel() }, utils_1.i18n.ant('Modal.cancelText')));
|
|
134
138
|
};
|
|
135
|
-
return react_1.default.createElement(Modal_1.Modal, Object.assign({ width: 640 }, props, { title: utils_1.i18n.getText(props.ik, props.title, Const_1.V.UPLOAD_MODAL_TITLE), className: "c-upload-modal",
|
|
139
|
+
return react_1.default.createElement(Modal_1.Modal, Object.assign({ width: 640 }, props, { afterClose: () => { setState(DEFAULT); afterClose(); }, title: utils_1.i18n.getText(props.ik, props.title, Const_1.V.UPLOAD_MODAL_TITLE), className: "c-upload-modal", footer: uploaded ? react_1.default.createElement(Button_1.Button, { type: 'primary', onClick: () => props.onOk ? props.onOk(null) : props.onCancel() }, utils_1.i18n.ant('Modal.okText')) : footer() }),
|
|
136
140
|
props.tip ? props.tip : react_1.default.createElement(Alert_1.Alert, { message: react_1.default.createElement("p", null, utils_1.i18n.txt(Const_1.V.UPLOAD_MODAL_TIP)), type: "info" }),
|
|
137
141
|
error && react_1.default.createElement(Alert_1.Alert, { type: "error", message: state.errMsg }),
|
|
138
142
|
uploaded && react_1.default.createElement(Alert_1.Alert, { type: "success", message: state.sucMsg }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { UploadProps } from 'antd/es/upload';
|
|
2
|
+
import type { UploadProps as AntdUploadProps } from 'antd/es/upload';
|
|
3
3
|
import type { BaseUploadProps } from './index';
|
|
4
4
|
import type { UploadChangeParam, UploadFile } from 'antd/es/upload/interface';
|
|
5
5
|
export type UploadState = {
|
|
@@ -11,5 +11,5 @@ export type UploadState = {
|
|
|
11
11
|
name?: string;
|
|
12
12
|
info?: any;
|
|
13
13
|
};
|
|
14
|
-
export declare const getBaseOptions: (props: BaseUploadProps) =>
|
|
14
|
+
export declare const getBaseOptions: (props: BaseUploadProps) => AntdUploadProps;
|
|
15
15
|
export declare const useUpload: (props: BaseUploadProps) => [UploadState, (info: UploadChangeParam<UploadFile<any>>) => void];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
|
-
import type { AlertProps } from 'antd/es/alert';
|
|
3
|
+
import type { AlertProps as AntdAlertProps } from 'antd/es/alert';
|
|
4
4
|
/**
|
|
5
5
|
* 说明: 排除 Alert 组件已被 antd 标记为 deprecated 的属性:
|
|
6
6
|
* closeText : 使用 closeIcon替代
|
|
7
7
|
*/
|
|
8
|
-
export type
|
|
8
|
+
export type AlertProps = Omit<AntdAlertProps, 'closeText'> & {
|
|
9
9
|
closeIcon?: boolean | React.ReactNode;
|
|
10
10
|
};
|
|
11
|
-
export declare const Alert: FC<
|
|
11
|
+
export declare const Alert: FC<AlertProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Breadcrumb as AntdBreadcrumb } from 'antd';
|
|
2
|
+
import type { BreadcrumbProps as AntdBreadcrumbProps, BreadcrumbItemProps as AntdBreadcrumbItemProps } from 'antd/es/breadcrumb';
|
|
3
|
+
import type { BaseOption } from '../../basetype';
|
|
4
|
+
import type { ExoticComponent, PropsWithChildren } from 'react';
|
|
5
|
+
type ItemType = Partial<AntdBreadcrumbItemProps> & BaseOption;
|
|
6
|
+
export type BreadcrumbProps = AntdBreadcrumbProps & {
|
|
7
|
+
items?: ItemType[];
|
|
8
|
+
};
|
|
9
|
+
export type BreadcrumbItemProps = AntdBreadcrumbItemProps;
|
|
10
|
+
type BreadcrumbComponent = ExoticComponent<PropsWithChildren<BreadcrumbProps>> & {
|
|
11
|
+
Item: typeof AntdBreadcrumb.Item;
|
|
12
|
+
Separator: typeof AntdBreadcrumb.Separator;
|
|
13
|
+
};
|
|
14
|
+
export declare const Breadcrumb: BreadcrumbComponent;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Breadcrumb = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const antd_1 = require("antd");
|
|
10
|
+
const _BreadcrumbWithItems = (props) => react_1.default.createElement(antd_1.Breadcrumb, Object.assign({}, props), props.items.map(item => react_1.default.createElement(antd_1.Breadcrumb.Item, Object.assign({}, lodash_1.default.omit(props, ['label', 'title', 'children'])), item.label || item.title || item.children)));
|
|
11
|
+
const _Breadcrumb = props => {
|
|
12
|
+
if (lodash_1.default.isArray(props.items) && props.items.length)
|
|
13
|
+
return react_1.default.createElement(_BreadcrumbWithItems, Object.assign({}, props));
|
|
14
|
+
return react_1.default.createElement(antd_1.Breadcrumb, Object.assign({}, props));
|
|
15
|
+
};
|
|
16
|
+
exports.Breadcrumb = _Breadcrumb;
|
|
17
|
+
exports.Breadcrumb.Item = antd_1.Breadcrumb.Item;
|
|
18
|
+
exports.Breadcrumb.Separator = antd_1.Breadcrumb.Separator;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button as AntdButton } from "antd";
|
|
3
|
-
import type { ButtonProps } from 'antd/es/button';
|
|
3
|
+
import type { ButtonProps as AntdButtonProps } from 'antd/es/button';
|
|
4
4
|
import type { ExoticComponent } from 'react';
|
|
5
5
|
import type { BaseItem } from '../../basetype';
|
|
6
|
-
|
|
7
|
-
export type
|
|
8
|
-
export type OButtonProps = Omit<ButtonProps, 'type' | 'icon'> & BaseItem & {
|
|
6
|
+
import type { SizeType, ButtonType } from './_Antd5';
|
|
7
|
+
export type ButtonProps = Omit<AntdButtonProps, 'type' | 'icon' | 'size'> & BaseItem & {
|
|
9
8
|
danger?: boolean;
|
|
10
9
|
type?: ButtonType;
|
|
10
|
+
size?: SizeType;
|
|
11
11
|
icon?: string | React.ReactNode;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* 扩展 Button 支持 roleCode 和 ik
|
|
15
15
|
*/
|
|
16
|
-
type Button = ExoticComponent<
|
|
16
|
+
type Button = ExoticComponent<ButtonProps> & {
|
|
17
17
|
Group: typeof AntdButton.Group;
|
|
18
18
|
};
|
|
19
19
|
export declare const Button: Button;
|
|
@@ -15,6 +15,8 @@ const _Button = props => {
|
|
|
15
15
|
let btnProps = Object.assign({}, props);
|
|
16
16
|
if (props.danger)
|
|
17
17
|
btnProps.type = 'danger';
|
|
18
|
+
if (props.size)
|
|
19
|
+
btnProps.size = props.size == 'middle' ? 'default' : props.size;
|
|
18
20
|
let icon = null;
|
|
19
21
|
if (props.icon) {
|
|
20
22
|
icon = lodash_1.default.isString(props.icon) ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon;
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* 手风琴组件兼容模块 : Collapse
|
|
4
4
|
* -------------------------------
|
|
5
5
|
*/
|
|
6
|
-
import type { CollapseProps } from 'antd/es/collapse';
|
|
7
|
-
import type { CollapsePanelProps } from 'antd/es/collapse/CollapsePanel';
|
|
6
|
+
import type { CollapseProps as AntdCollapseProps } from 'antd/es/collapse';
|
|
7
|
+
import type { CollapsePanelProps as AntdCollapsePanelProps } from 'antd/es/collapse/CollapsePanel';
|
|
8
8
|
import type { FC, PropsWithChildren, ExoticComponent } from 'react';
|
|
9
9
|
/**
|
|
10
10
|
* 说明: 排除 Collapse 组件已被 antd 标记为 deprecated 的属性:
|
|
11
11
|
* expandIconPosition : 不支持 'left'/'right' 使用 'start'/'end' 替代
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
export type
|
|
13
|
+
export type ExpandIconPosition = 'start' | 'end' | undefined;
|
|
14
|
+
export type CollapseProps = Omit<AntdCollapseProps, 'expandIconPosition'> & {
|
|
15
15
|
expandIconPosition?: ExpandIconPosition;
|
|
16
16
|
};
|
|
17
17
|
type CollapsibleType = 'disabled';
|
|
@@ -20,11 +20,11 @@ type CollapsibleType = 'disabled';
|
|
|
20
20
|
* disabled:1. 不再被支持 , 使用 `collapsible="disabled"` 替代
|
|
21
21
|
* 2. 本版本不支持 header,icon ,只能使用 collapsible="disabled"
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type CollapsePanelProps = Omit<AntdCollapsePanelProps, 'disabled'> & {
|
|
24
24
|
collapsible?: CollapsibleType;
|
|
25
25
|
};
|
|
26
|
-
type CollapseComponent = ExoticComponent<PropsWithChildren<
|
|
27
|
-
Panel: FC<PropsWithChildren<
|
|
26
|
+
type CollapseComponent = ExoticComponent<PropsWithChildren<CollapseProps>> & {
|
|
27
|
+
Panel: FC<PropsWithChildren<CollapsePanelProps>>;
|
|
28
28
|
};
|
|
29
29
|
export declare const Collapse: CollapseComponent;
|
|
30
30
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConfigProviderProps as AntdConfigProviderProps } from 'antd/es/config-provider';
|
|
3
|
+
export type ConfigProviderProps = AntdConfigProviderProps & {
|
|
4
|
+
[properties: string]: any;
|
|
5
|
+
};
|
|
6
|
+
export declare const ConfigProvider: React.FC<ConfigProviderProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ConfigProvider = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const antd_1 = require("antd");
|
|
9
|
+
const ConfigProvider = props => react_1.default.createElement(antd_1.ConfigProvider, Object.assign({}, props));
|
|
10
|
+
exports.ConfigProvider = ConfigProvider;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { DrawerProps } from 'antd/es/drawer';
|
|
1
|
+
import type { DrawerProps as AntdDrawerProps } from 'antd/es/drawer';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* 说明: 排除 Drawer 组件已被 antd 标记为 deprecated 的属性:
|
|
5
5
|
* 1. visible : Please use `open` instead
|
|
6
6
|
* 2. afterVisibleChange Please use `afterOpenChange` instead
|
|
7
7
|
*/
|
|
8
|
-
export type
|
|
8
|
+
export type DrawerProps = Omit<AntdDrawerProps, 'visible' | 'afterVisibleChange'> & {
|
|
9
9
|
size?: 'default' | 'large';
|
|
10
10
|
open?: boolean;
|
|
11
11
|
afterOpenChange?: (open: boolean) => void;
|
|
12
12
|
};
|
|
13
|
-
export declare const Drawer: FC<
|
|
13
|
+
export declare const Drawer: FC<DrawerProps>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { DropDownProps } from 'antd/es/dropdown';
|
|
2
|
+
import type { MenuProps } from './Menu';
|
|
3
|
+
import type { DropDownProps as AntdDropDownProps } from 'antd/es/dropdown';
|
|
4
4
|
/**
|
|
5
5
|
* 说明: 排除 Dropdown 组件已被 antd 标记为 deprecated 的属性:
|
|
6
6
|
* 1. visible : Please use `open` instead
|
|
7
7
|
* 2. onVisibleChange Please use `onOpenChange` instead
|
|
8
8
|
* 3. overlay Please use `menu` instead
|
|
9
9
|
*/
|
|
10
|
-
export type
|
|
10
|
+
export type DropdownProps = Omit<AntdDropDownProps, 'visible' | 'onVisibleChange' | 'overlay'> & {
|
|
11
11
|
arrow?: boolean;
|
|
12
|
-
menu?:
|
|
13
|
-
overlay?:
|
|
12
|
+
menu?: MenuProps;
|
|
13
|
+
overlay?: AntdDropDownProps['overlay'];
|
|
14
14
|
};
|
|
15
|
-
export declare const Dropdown: FC<
|
|
15
|
+
export declare const Dropdown: FC<DropdownProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { BadgeProps } from 'antd/es/badge';
|
|
2
|
+
import type { BadgeProps as AntdBadgeProps } from 'antd/es/badge';
|
|
3
3
|
export type FloatButtonType = 'default' | 'primary';
|
|
4
4
|
export type FloatButtonShape = 'circle' | 'square';
|
|
5
5
|
export type FloatButtonGroupTrigger = 'click' | 'hover';
|
|
6
|
-
export type FloatButtonBadgeProps = Omit<
|
|
6
|
+
export type FloatButtonBadgeProps = Omit<AntdBadgeProps, 'status' | 'text' | 'title' | 'children'>;
|
|
7
7
|
export interface FloatButtonProps {
|
|
8
8
|
className?: string;
|
|
9
9
|
style?: React.CSSProperties;
|
|
@@ -15,4 +15,4 @@ export interface FloatButtonProps {
|
|
|
15
15
|
badge?: FloatButtonBadgeProps;
|
|
16
16
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
17
17
|
}
|
|
18
|
-
export declare const FloatButton: (props: FloatButtonProps) => React.
|
|
18
|
+
export declare const FloatButton: (props: FloatButtonProps) => React.ReactElement<any, any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FormProps as AntdFormProps, FormItemProps as AntdFormItemProps, FormComponentProps, FormCreateOption } from 'antd/es/form';
|
|
3
|
+
import type { FormWrappedProps } from 'antd/es/form/interface';
|
|
4
|
+
import type { FC, ExoticComponent, PropsWithChildren } from 'react';
|
|
5
|
+
export type FormProps = AntdFormProps;
|
|
6
|
+
export type FormItemProps = AntdFormItemProps & {
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
type FormComponent = ExoticComponent<PropsWithChildren<AntdFormProps>> & {
|
|
10
|
+
Item: FC<FormItemProps>;
|
|
11
|
+
create: <TOwnProps extends FormComponentProps<any>>(options?: FormCreateOption<TOwnProps>) => FormWrappedProps<TOwnProps>;
|
|
12
|
+
};
|
|
13
|
+
export declare const Form: FormComponent;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Form = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const antd_1 = require("antd");
|
|
29
|
+
const Icon_1 = require("./Icon");
|
|
30
|
+
const Popover_1 = require("./Popover");
|
|
31
|
+
const FormItem = props => {
|
|
32
|
+
const label = (0, react_1.useMemo)(() => {
|
|
33
|
+
if (props.label == null || props.label == undefined) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
if (props.tooltip) {
|
|
37
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
38
|
+
react_1.default.createElement(Popover_1.Popover, null,
|
|
39
|
+
react_1.default.createElement(Icon_1.Icon, { type: 'help' }),
|
|
40
|
+
props.label));
|
|
41
|
+
}
|
|
42
|
+
return props.label;
|
|
43
|
+
}, [props.label, props.tooltip]);
|
|
44
|
+
return react_1.default.createElement(antd_1.Form.Item, Object.assign({}, props, { label: label }));
|
|
45
|
+
};
|
|
46
|
+
const _Form = antd_1.Form;
|
|
47
|
+
exports.Form = _Form;
|
|
48
|
+
exports.Form.Item = FormItem;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Input as AntdInput } from 'antd';
|
|
2
|
+
import type { InputProps } from 'antd/es/input';
|
|
3
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface InputRef {
|
|
5
|
+
input: HTMLInputElement | null;
|
|
6
|
+
focus: () => void;
|
|
7
|
+
blur: () => void;
|
|
8
|
+
select: () => void;
|
|
9
|
+
}
|
|
10
|
+
type InputComponent = ForwardRefExoticComponent<InputProps & RefAttributes<InputRef>> & {
|
|
11
|
+
Group: typeof AntdInput.Group;
|
|
12
|
+
Search: typeof AntdInput.Search;
|
|
13
|
+
TextArea: typeof AntdInput.TextArea;
|
|
14
|
+
Password: typeof AntdInput.Password;
|
|
15
|
+
};
|
|
16
|
+
export declare const Input: InputComponent;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Input = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const antd_1 = require("antd");
|
|
29
|
+
const _Input = (0, react_1.forwardRef)((props, ref) => react_1.default.createElement(antd_1.Input, Object.assign({}, props, { ref: aInput => {
|
|
30
|
+
if (aInput && ref) {
|
|
31
|
+
ref.current = {
|
|
32
|
+
input: aInput.input,
|
|
33
|
+
focus: aInput.focus,
|
|
34
|
+
blur: aInput.blur,
|
|
35
|
+
select: aInput.select,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
} })));
|
|
39
|
+
exports.Input = _Input;
|
|
40
|
+
exports.Input.Group = antd_1.Input.Group;
|
|
41
|
+
exports.Input.Search = antd_1.Input.Search;
|
|
42
|
+
exports.Input.TextArea = antd_1.Input.TextArea;
|
|
43
|
+
exports.Input.Password = antd_1.Input.Password;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputNumberProps as AntdInputNumberProps } from 'antd/es/input-number';
|
|
2
|
+
import type { FC, ReactNode } from 'react';
|
|
3
|
+
export type InputNumberProps = Omit<AntdInputNumberProps, 'size'> & {
|
|
4
|
+
addonBefore?: ReactNode;
|
|
5
|
+
addonAfter?: ReactNode;
|
|
6
|
+
size?: 'small' | 'middle' | 'large';
|
|
7
|
+
};
|
|
8
|
+
export declare const InputNumber: FC<InputNumberProps>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.InputNumber = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const antd_1 = require("antd");
|
|
29
|
+
const InputNumber = (props) => {
|
|
30
|
+
const numberProps = (0, react_1.useMemo)(() => {
|
|
31
|
+
return {};
|
|
32
|
+
}, [props.size, props.addonAfter, props.addonBefore]);
|
|
33
|
+
return react_1.default.createElement(antd_1.InputNumber, Object.assign({}, props, numberProps));
|
|
34
|
+
};
|
|
35
|
+
exports.InputNumber = InputNumber;
|
|
36
|
+
// prefix?: React.ReactNode;
|
|
37
|
+
// suffix?: React.ReactNode;
|
|
38
|
+
// stringMode?: boolean;
|
|
39
|
+
// style?: React.CSSProperties;
|
|
40
|
+
// tabIndex?: number;
|
|
41
|
+
// controls?: boolean;
|
|
42
|
+
// addonBefore?: React.ReactNode;
|
|
43
|
+
// addonAfter?: React.ReactNode;
|
|
44
|
+
// upHandler?: React.ReactNode;
|
|
45
|
+
// downHandler?: React.ReactNode;
|
|
46
|
+
// keyboard?: boolean;
|
|
47
|
+
// onInput?: (text: string) => void;
|
|
48
|
+
// onStep?: (value: T, info: {
|
|
49
|
+
// offset: ValueType;
|
|
50
|
+
// type: 'up' | 'down';
|
|
51
|
+
// }) => void;
|
|
52
|
+
// disabled?: boolean;
|
|
53
|
+
// bordered?: boolean;
|
|
54
|
+
// status?: InputStatus;
|
|
55
|
+
// controls?: boolean | {
|
|
56
|
+
// upIcon?: React.ReactNode;
|
|
57
|
+
// downIcon?: React.ReactNode;
|
|
58
|
+
// };
|
|
59
|
+
// onChange?: (value: number | undefined) => void;
|
|
60
|
+
{ /* <AntdInputNumber value={""} /> */ }
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Menu as AntdMenu } from 'antd';
|
|
3
|
-
import type { MenuProps } from 'antd/es/menu';
|
|
4
|
-
import type { MenuItemProps } from 'antd/es/menu/MenuItem';
|
|
5
|
-
import type { SubMenuProps } from 'antd/es/menu/SubMenu';
|
|
3
|
+
import type { MenuProps as AntdMenuProps } from 'antd/es/menu';
|
|
4
|
+
import type { MenuItemProps as AntdMenuItemProps } from 'antd/es/menu/MenuItem';
|
|
5
|
+
import type { SubMenuProps as AntdSubMenuProps } from 'antd/es/menu/SubMenu';
|
|
6
6
|
import type { PropsWithChildren, ExoticComponent } from 'react';
|
|
7
7
|
import type { Key } from '../../basetype';
|
|
8
|
-
export interface MenuItemType extends
|
|
8
|
+
export interface MenuItemType extends AntdMenuItemProps {
|
|
9
9
|
key: Key;
|
|
10
|
+
danger?: boolean;
|
|
10
11
|
icon?: string | React.ReactNode;
|
|
11
12
|
ik?: string;
|
|
12
13
|
label?: React.ReactNode;
|
|
13
14
|
title?: string;
|
|
14
15
|
}
|
|
15
|
-
export interface SubMenuType<T extends MenuItemType = MenuItemType> extends Omit<
|
|
16
|
+
export interface SubMenuType<T extends MenuItemType = MenuItemType> extends Omit<AntdSubMenuProps, 'children'> {
|
|
16
17
|
key: Key;
|
|
17
18
|
icon?: string | React.ReactNode;
|
|
18
19
|
ik?: string;
|
|
@@ -20,10 +21,10 @@ export interface SubMenuType<T extends MenuItemType = MenuItemType> extends Omit
|
|
|
20
21
|
children: ItemType<T>[];
|
|
21
22
|
}
|
|
22
23
|
export type ItemType<T extends MenuItemType = MenuItemType> = T | SubMenuType<T> | null;
|
|
23
|
-
export type
|
|
24
|
+
export type MenuProps = AntdMenuProps & {
|
|
24
25
|
items?: ItemType[];
|
|
25
26
|
};
|
|
26
|
-
type MenuComponent = ExoticComponent<PropsWithChildren<
|
|
27
|
+
type MenuComponent = ExoticComponent<PropsWithChildren<MenuProps>> & {
|
|
27
28
|
Item: typeof AntdMenu.Item;
|
|
28
29
|
SubMenu: typeof AntdMenu.SubMenu;
|
|
29
30
|
ItemGroup: typeof AntdMenu.ItemGroup;
|
|
@@ -11,28 +11,20 @@ const i18n_1 = require("../../utils/i18n");
|
|
|
11
11
|
const Icon_1 = require("../_adapt/Icon");
|
|
12
12
|
const getMenuProps = (props) => {
|
|
13
13
|
const result = lodash_1.default.pick(props, ['className', 'key', 'disabled', 'onClick', 'level', 'onTitleClick']);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
lodash_1.default.isString(props.icon) ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon,
|
|
18
|
-
" ",
|
|
19
|
-
(0, i18n_1.txt)(props.ik));
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
result.title = react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
|
-
lodash_1.default.isString(props.icon) ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon,
|
|
24
|
-
" ",
|
|
25
|
-
props.label || props.title);
|
|
26
|
-
}
|
|
14
|
+
var title = props.label || props.title;
|
|
15
|
+
if (props.ik) {
|
|
16
|
+
title = (0, i18n_1.txt)(props.ik);
|
|
27
17
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
if (props.danger) {
|
|
19
|
+
title = react_1.default.createElement(antd_1.Typography.Text, { type: "danger" }, title);
|
|
20
|
+
}
|
|
21
|
+
if (props.icon) {
|
|
22
|
+
title = react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
|
+
lodash_1.default.isString(props.icon) ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon,
|
|
24
|
+
" ",
|
|
25
|
+
(0, i18n_1.txt)(props.ik));
|
|
35
26
|
}
|
|
27
|
+
result.title = title;
|
|
36
28
|
return result;
|
|
37
29
|
};
|
|
38
30
|
const renderGroup = (props) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import type { ModalProps } from 'antd/es/modal';
|
|
2
|
+
import type { ModalProps as AntdModalProps } from 'antd/es/modal';
|
|
3
3
|
import type { PlainObject } from '../../basetype';
|
|
4
|
-
export type
|
|
4
|
+
export type ModalProps = Omit<AntdModalProps, 'onOk' | 'onCancel' | 'visible'> & {
|
|
5
5
|
open?: boolean;
|
|
6
6
|
onOk?: (data?: PlainObject) => void;
|
|
7
7
|
onCancel?: () => void;
|
|
8
8
|
};
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export declare const useDestoryModal: (props: {
|
|
10
|
+
open?: boolean;
|
|
11
|
+
}) => [boolean, () => void];
|
|
12
|
+
export declare class Modal extends Component<ModalProps> {
|
|
13
13
|
static info: import("antd/lib/modal/Modal").ModalFunc;
|
|
14
14
|
static success: import("antd/lib/modal/Modal").ModalFunc;
|
|
15
15
|
static error: import("antd/lib/modal/Modal").ModalFunc;
|
|
@@ -17,7 +17,9 @@ export declare class Modal extends Component<VModalProps> {
|
|
|
17
17
|
static warning: import("antd/lib/modal/Modal").ModalFunc;
|
|
18
18
|
static confirm: import("antd/lib/modal/Modal").ModalFunc;
|
|
19
19
|
static destroyAll: () => void;
|
|
20
|
-
|
|
20
|
+
static useDestoryModal: (props: {
|
|
21
|
+
open?: boolean;
|
|
22
|
+
}) => [boolean, () => void];
|
|
21
23
|
renderFooter(): React.ReactNode;
|
|
22
24
|
render(): React.ReactNode;
|
|
23
25
|
}
|
|
@@ -23,28 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Modal = void 0;
|
|
26
|
+
exports.Modal = exports.useDestoryModal = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const utils_1 = require("../../utils");
|
|
29
29
|
const antd_1 = require("antd");
|
|
30
30
|
const Button_1 = require("./Button");
|
|
31
|
+
const useDestoryModal = (props) => {
|
|
32
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
33
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
34
|
+
if (props.open)
|
|
35
|
+
setOpen(true);
|
|
36
|
+
}, [props.open]);
|
|
37
|
+
return [open, () => setOpen(false)];
|
|
38
|
+
};
|
|
39
|
+
exports.useDestoryModal = useDestoryModal;
|
|
31
40
|
class Modal extends react_1.Component {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
this.state = { open: false };
|
|
35
|
-
}
|
|
36
|
-
componentDidUpdate(prevProps) {
|
|
37
|
-
if (prevProps.open) {
|
|
38
|
-
// if (this.props.open) {
|
|
39
|
-
// } else {
|
|
40
|
-
// }
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
if (this.props.open) {
|
|
44
|
-
this.setState({ open: true });
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
41
|
renderFooter() {
|
|
49
42
|
const { okText, okType = 'primary', cancelText, confirmLoading, onOk, onCancel, okButtonProps, cancelButtonProps, footer } = this.props;
|
|
50
43
|
if (footer !== undefined)
|
|
@@ -54,9 +47,7 @@ class Modal extends react_1.Component {
|
|
|
54
47
|
react_1.default.createElement(Button_1.Button, Object.assign({ onClick: evt => utils_1.PageUtil.stopEvent(evt, () => onCancel()) }, cancelButtonProps), cancelText || utils_1.i18n.ant('Modal.cancelText')));
|
|
55
48
|
}
|
|
56
49
|
render() {
|
|
57
|
-
|
|
58
|
-
return utils_1.Const.NONE;
|
|
59
|
-
return react_1.default.createElement(antd_1.Modal, Object.assign({}, this.props, { afterClose: () => this.setState({ open: false }), visible: this.props.open, footer: this.props.footer === null ? null : this.renderFooter() }));
|
|
50
|
+
return react_1.default.createElement(antd_1.Modal, Object.assign({}, this.props, { visible: this.props.open, footer: this.props.footer === null ? null : this.renderFooter() }));
|
|
60
51
|
}
|
|
61
52
|
}
|
|
62
53
|
exports.Modal = Modal;
|
|
@@ -67,3 +58,4 @@ Modal.warn = antd_1.Modal.warn;
|
|
|
67
58
|
Modal.warning = antd_1.Modal.warning;
|
|
68
59
|
Modal.confirm = antd_1.Modal.confirm;
|
|
69
60
|
Modal.destroyAll = antd_1.Modal.destroyAll;
|
|
61
|
+
Modal.useDestoryModal = exports.useDestoryModal;
|