@ccs-ui/rc-pro 1.1.0 → 1.1.1-rc10
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/auth/auth-button.js +25 -12
- package/es/auth/index.d.ts +7 -13
- package/es/auth/index.js +96 -74
- package/es/dialog/HookDrawer.d.ts +1 -1
- package/es/dialog/HookDrawer.js +31 -19
- package/es/dialog/HookModal.d.ts +1 -1
- package/es/dialog/HookModal.js +25 -20
- package/es/dialog/button.d.ts +3 -1
- package/es/dialog/button.js +28 -16
- package/es/dialog/context.d.ts +8 -7
- package/es/dialog/context.js +4 -4
- package/es/dialog/form.d.ts +2 -2
- package/es/dialog/form.js +4 -3
- package/es/dialog/{dialog.d.ts → hook.d.ts} +9 -1
- package/es/dialog/{dialog.js → hook.js} +11 -11
- package/es/dialog/index.d.ts +4 -4
- package/es/dialog/index.js +2 -2
- package/es/dialog/index.less +14 -17
- package/es/drawer.zip +0 -0
- package/es/index.d.ts +11 -8
- package/es/index.js +0 -2
- package/es/keep-alive-tabs/index.d.ts +1 -1
- package/es/keep-alive-tabs/index.js +46 -41
- package/es/keep-alive-tabs/index.less +2 -2
- package/es/modal.zip +0 -0
- package/es/pro-table/index.d.ts +3 -3
- package/es/pro-table/index.js +69 -179
- package/es/pro-table/index.less +3 -13
- package/es/pro-table/search.js +7 -4
- package/es/pro-table/tree.d.ts +22 -0
- package/es/pro-table/tree.js +184 -0
- package/es/table/index.js +70 -59
- package/es/upload/upload-image.js +33 -15
- package/package.json +3 -2
- package/es/drawer/buttons.d.ts +0 -14
- package/es/drawer/buttons.js +0 -93
- package/es/drawer/index.d.ts +0 -13
- package/es/drawer/index.js +0 -11
- package/es/drawer/index.less +0 -5
- package/es/drawer/open/content.d.ts +0 -20
- package/es/drawer/open/content.js +0 -43
- package/es/drawer/open/destory-fns.d.ts +0 -2
- package/es/drawer/open/destory-fns.js +0 -3
- package/es/drawer/open/form.d.ts +0 -12
- package/es/drawer/open/form.js +0 -32
- package/es/drawer/open/index.d.ts +0 -18
- package/es/drawer/open/index.js +0 -166
- package/es/modal/buttons.d.ts +0 -14
- package/es/modal/buttons.js +0 -90
- package/es/modal/index.d.ts +0 -12
- package/es/modal/index.js +0 -11
- package/es/modal/index.less +0 -26
- package/es/modal/open/destory-fns.d.ts +0 -2
- package/es/modal/open/destory-fns.js +0 -3
- package/es/modal/open/drag.d.ts +0 -1
- package/es/modal/open/drag.js +0 -104
- package/es/modal/open/form.d.ts +0 -12
- package/es/modal/open/form.js +0 -35
- package/es/modal/open/index.d.ts +0 -19
- package/es/modal/open/index.js +0 -93
package/es/dialog/button.js
CHANGED
|
@@ -6,21 +6,26 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import { CcsAuth } from "./..";
|
|
8
8
|
import { Button, Form } from 'antd';
|
|
9
|
-
import
|
|
9
|
+
import { useEffect } from 'react';
|
|
10
10
|
import CcsDialog from '.';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
14
|
export default function CcsDialogButtons(_ref) {
|
|
12
15
|
var okText = _ref.okText,
|
|
13
16
|
okAuth = _ref.okAuth,
|
|
14
17
|
loading = _ref.loading,
|
|
15
18
|
children = _ref.children,
|
|
19
|
+
hideCancel = _ref.hideCancel,
|
|
20
|
+
cancelText = _ref.cancelText,
|
|
16
21
|
onOk = _ref.onOk;
|
|
17
|
-
var _CcsDialog$
|
|
18
|
-
closeDialog = _CcsDialog$
|
|
19
|
-
|
|
20
|
-
formInitialValues = _CcsDialog$
|
|
22
|
+
var _CcsDialog$useInstanc = CcsDialog.useInstance(),
|
|
23
|
+
closeDialog = _CcsDialog$useInstanc.closeDialog,
|
|
24
|
+
onHasModalButtons = _CcsDialog$useInstanc.onHasModalButtons,
|
|
25
|
+
formInitialValues = _CcsDialog$useInstanc.formInitialValues;
|
|
21
26
|
var form = Form.useFormInstance();
|
|
22
27
|
useEffect(function () {
|
|
23
|
-
|
|
28
|
+
if (onHasModalButtons) onHasModalButtons();
|
|
24
29
|
}, []);
|
|
25
30
|
var onOkClick = function onOkClick() {
|
|
26
31
|
if (!onOk) return;
|
|
@@ -34,14 +39,21 @@ export default function CcsDialogButtons(_ref) {
|
|
|
34
39
|
}
|
|
35
40
|
onOk();
|
|
36
41
|
};
|
|
37
|
-
return onOk
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
return onOk || children ? /*#__PURE__*/_jsx(_Fragment, {
|
|
43
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
44
|
+
className: "ccs-dialog-buttons",
|
|
45
|
+
children: [children, onOk && /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
|
+
children: [!hideCancel && /*#__PURE__*/_jsx(Button, {
|
|
47
|
+
onClick: closeDialog,
|
|
48
|
+
children: cancelText || '取消'
|
|
49
|
+
}), /*#__PURE__*/_jsx(CcsAuth.Button, {
|
|
50
|
+
auth: okAuth || '',
|
|
51
|
+
type: "primary",
|
|
52
|
+
loading: loading,
|
|
53
|
+
onClick: onOkClick,
|
|
54
|
+
children: okText || '确定'
|
|
55
|
+
})]
|
|
56
|
+
})]
|
|
57
|
+
})
|
|
58
|
+
}) : null;
|
|
47
59
|
}
|
package/es/dialog/context.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Store } from 'antd/es/form/interface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
interface
|
|
4
|
-
|
|
3
|
+
export interface DialogContextType<T = Store> {
|
|
4
|
+
/** 表单初始值 */
|
|
5
5
|
formInitialValues: T;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/** 关闭弹框,可以设置返回值 */
|
|
7
|
+
closeDialog: (e?: any) => void;
|
|
8
|
+
onHasModalButtons?: () => void;
|
|
8
9
|
}
|
|
9
|
-
declare const
|
|
10
|
-
declare const useDialogContext: <T = Store>() =>
|
|
11
|
-
export { useDialogContext,
|
|
10
|
+
declare const DialogContentContext: React.Context<DialogContextType<any>>;
|
|
11
|
+
declare const useDialogContext: <T = Store>() => DialogContextType<T>;
|
|
12
|
+
export { useDialogContext, DialogContentContext };
|
package/es/dialog/context.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
var
|
|
2
|
+
var DialogContentContext = /*#__PURE__*/React.createContext({});
|
|
3
3
|
var useDialogContext = function useDialogContext() {
|
|
4
|
-
var context = useContext(
|
|
4
|
+
var context = useContext(DialogContentContext);
|
|
5
5
|
if (context === undefined) {
|
|
6
|
-
throw new Error('
|
|
6
|
+
throw new Error('DialogContentContext not found');
|
|
7
7
|
}
|
|
8
8
|
return context;
|
|
9
9
|
};
|
|
10
|
-
export { useDialogContext,
|
|
10
|
+
export { useDialogContext, DialogContentContext };
|
package/es/dialog/form.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { CSSProperties, ReactNode } from 'react';
|
|
|
3
3
|
interface PropsType {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
formProps: FormProps;
|
|
6
|
-
|
|
6
|
+
styles?: CSSProperties;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* 添加form实例
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
|
-
export default function DialogForm({ children,
|
|
12
|
+
export default function DialogForm({ children, styles, formProps: { labelCol, wrapperCol, ...restProps }, }: PropsType): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
package/es/dialog/form.js
CHANGED
|
@@ -21,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
21
21
|
*/
|
|
22
22
|
export default function DialogForm(_ref) {
|
|
23
23
|
var children = _ref.children,
|
|
24
|
-
|
|
24
|
+
styles = _ref.styles,
|
|
25
25
|
_ref$formProps = _ref.formProps,
|
|
26
26
|
labelCol = _ref$formProps.labelCol,
|
|
27
27
|
wrapperCol = _ref$formProps.wrapperCol,
|
|
@@ -36,12 +36,13 @@ export default function DialogForm(_ref) {
|
|
|
36
36
|
},
|
|
37
37
|
wrapperCol: wrapperCol || {
|
|
38
38
|
span: 14
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
preserve: false
|
|
40
41
|
}, restProps), {}, {
|
|
41
42
|
style: _objectSpread(_objectSpread({
|
|
42
43
|
height: '100%',
|
|
43
44
|
overflow: 'auto'
|
|
44
|
-
},
|
|
45
|
+
}, styles), restProps.style),
|
|
45
46
|
children: children
|
|
46
47
|
}));
|
|
47
48
|
}
|
|
@@ -23,12 +23,20 @@ export type CcsDialogModalProps = ModalFuncProps & {
|
|
|
23
23
|
form?: FormProps;
|
|
24
24
|
/** 关闭后销毁组件,默认true */
|
|
25
25
|
destroyOnClose?: boolean;
|
|
26
|
+
/** 通过closeDialog方法关闭dialog */
|
|
27
|
+
afterCloseByOk?: (e: any) => void;
|
|
28
|
+
/** 通过点击关闭按钮或取消按钮关闭 */
|
|
29
|
+
afterCloseByCancel?: (e: any) => void;
|
|
26
30
|
};
|
|
27
|
-
export type CcsDialogDrawerProps = DrawerProps & {
|
|
31
|
+
export type CcsDialogDrawerProps = Omit<DrawerProps, 'extra'> & {
|
|
28
32
|
/** antd form */
|
|
29
33
|
form?: FormProps;
|
|
30
34
|
/** 抽屉内容 */
|
|
31
35
|
content?: ReactNode;
|
|
36
|
+
/** 通过closeDialog方法关闭dialog */
|
|
37
|
+
afterCloseByOk?: (e: any) => void;
|
|
38
|
+
/** 通过点击关闭按钮或取消按钮关闭 */
|
|
39
|
+
afterCloseByCancel?: (e: any) => void;
|
|
32
40
|
};
|
|
33
41
|
export type ModalDialog = (...args: Parameters<ModalFunc>) => ReturnType<ModalFunc>;
|
|
34
42
|
export type DrawerDialog = (...args: Parameters<ModalFunc>) => ReturnType<DrawerFunc>;
|
|
@@ -16,7 +16,8 @@ import HookModal from "./HookModal";
|
|
|
16
16
|
import usePatchElement from "./usePatchElement";
|
|
17
17
|
|
|
18
18
|
// Add `then` field for `ModalFunc` return instance.
|
|
19
|
-
|
|
19
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
21
|
var ElementsHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (_props, ref) {
|
|
21
22
|
var _usePatchElement = usePatchElement(),
|
|
22
23
|
_usePatchElement2 = _slicedToArray(_usePatchElement, 2),
|
|
@@ -28,7 +29,9 @@ var ElementsHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(func
|
|
|
28
29
|
};
|
|
29
30
|
}, []);
|
|
30
31
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
33
|
+
children: elements
|
|
34
|
+
});
|
|
32
35
|
}));
|
|
33
36
|
var modalUuid = 0;
|
|
34
37
|
var drawerUuid = 0;
|
|
@@ -53,15 +56,14 @@ export default function useCcsDialog() {
|
|
|
53
56
|
modalUuid += 1;
|
|
54
57
|
var modalRef = /*#__PURE__*/React.createRef();
|
|
55
58
|
var closeFunc;
|
|
56
|
-
var modal = /*#__PURE__*/
|
|
57
|
-
key: "modal-".concat(modalUuid),
|
|
59
|
+
var modal = /*#__PURE__*/_jsx(HookModal, {
|
|
58
60
|
config: config,
|
|
59
61
|
afterClose: function afterClose() {
|
|
60
62
|
var _closeFunc;
|
|
61
63
|
(_closeFunc = closeFunc) === null || _closeFunc === void 0 ? void 0 : _closeFunc();
|
|
62
64
|
},
|
|
63
65
|
ref: modalRef
|
|
64
|
-
});
|
|
66
|
+
}, "modal-".concat(modalUuid));
|
|
65
67
|
closeFunc = (_holderRef$current = holderRef.current) === null || _holderRef$current === void 0 ? void 0 : _holderRef$current.patchElement(modal);
|
|
66
68
|
if (closeFunc) {
|
|
67
69
|
destroyFns.push(closeFunc);
|
|
@@ -101,15 +103,14 @@ export default function useCcsDialog() {
|
|
|
101
103
|
drawerUuid += 1;
|
|
102
104
|
var modalRef = /*#__PURE__*/React.createRef();
|
|
103
105
|
var closeFunc;
|
|
104
|
-
var modal = /*#__PURE__*/
|
|
105
|
-
key: "drawer-".concat(drawerUuid),
|
|
106
|
+
var modal = /*#__PURE__*/_jsx(HookDrawer, {
|
|
106
107
|
config: config,
|
|
107
108
|
afterClose: function afterClose() {
|
|
108
109
|
var _closeFunc2;
|
|
109
110
|
(_closeFunc2 = closeFunc) === null || _closeFunc2 === void 0 ? void 0 : _closeFunc2();
|
|
110
111
|
},
|
|
111
112
|
ref: modalRef
|
|
112
|
-
});
|
|
113
|
+
}, "drawer-".concat(drawerUuid));
|
|
113
114
|
closeFunc = (_holderRef$current2 = holderRef.current) === null || _holderRef$current2 === void 0 ? void 0 : _holderRef$current2.patchElement(modal);
|
|
114
115
|
if (closeFunc) {
|
|
115
116
|
destroyFns.push(closeFunc);
|
|
@@ -159,9 +160,8 @@ export default function useCcsDialog() {
|
|
|
159
160
|
return {
|
|
160
161
|
openDrawer: fns.openDrawer,
|
|
161
162
|
openModal: fns.openModal,
|
|
162
|
-
contextHolder: /*#__PURE__*/
|
|
163
|
-
key: "modal-holder",
|
|
163
|
+
contextHolder: /*#__PURE__*/_jsx(ElementsHolder, {
|
|
164
164
|
ref: holderRef
|
|
165
|
-
})
|
|
165
|
+
}, "modal-holder")
|
|
166
166
|
};
|
|
167
167
|
}
|
package/es/dialog/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import CcsDialogButtons from './button';
|
|
2
2
|
import { useDialogContext } from './context';
|
|
3
|
-
import useCcsDialog from './
|
|
3
|
+
import useCcsDialog from './hook';
|
|
4
4
|
import './index.less';
|
|
5
|
-
interface
|
|
5
|
+
interface DialogInterface {
|
|
6
6
|
Buttons: typeof CcsDialogButtons;
|
|
7
7
|
useDialog: typeof useCcsDialog;
|
|
8
|
-
|
|
8
|
+
useInstance: typeof useDialogContext;
|
|
9
9
|
}
|
|
10
|
-
declare const CcsDialog:
|
|
10
|
+
declare const CcsDialog: DialogInterface;
|
|
11
11
|
export default CcsDialog;
|
package/es/dialog/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import CcsDialogButtons from "./button";
|
|
2
2
|
import { useDialogContext } from "./context";
|
|
3
|
-
import useCcsDialog from "./
|
|
3
|
+
import useCcsDialog from "./hook";
|
|
4
4
|
import "./index.less";
|
|
5
5
|
var CcsDialog = {};
|
|
6
6
|
CcsDialog.Buttons = CcsDialogButtons;
|
|
7
7
|
CcsDialog.useDialog = useCcsDialog;
|
|
8
|
-
CcsDialog.
|
|
8
|
+
CcsDialog.useInstance = useDialogContext;
|
|
9
9
|
export default CcsDialog;
|
package/es/dialog/index.less
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
.ccs-dialog {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
z-index: 1;
|
|
1
|
+
.ccs-dialog-buttons {
|
|
2
|
+
position: absolute;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
z-index: 1;
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
.ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
|
|
8
|
+
margin-bottom: 0;
|
|
9
|
+
margin-left: 8px;
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
.ccs-dialog-drawer {
|
|
16
14
|
.ccs-dialog-buttons {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
text-align: center;
|
|
15
|
+
right: 16px;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: auto;
|
|
18
|
+
height: 57px;
|
|
19
|
+
line-height: 56px;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
.ant-drawer-header {
|
|
26
|
-
padding:
|
|
23
|
+
padding: 16px;
|
|
27
24
|
}
|
|
28
25
|
}
|
package/es/drawer.zip
ADDED
|
Binary file
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MenuProps } from 'antd';
|
|
2
|
-
|
|
1
|
+
import { MenuProps, ThemeConfig } from 'antd';
|
|
2
|
+
type ReactText = 'string' | 'number';
|
|
3
3
|
interface MenuTreeNodeData {
|
|
4
4
|
buttonUrlId: number;
|
|
5
5
|
createTime: string;
|
|
@@ -37,11 +37,16 @@ interface CcsUserDetailType {
|
|
|
37
37
|
/** 用户名 */
|
|
38
38
|
workerName: string;
|
|
39
39
|
}
|
|
40
|
+
type ThemeType = ThemeConfig & {
|
|
41
|
+
token: {
|
|
42
|
+
isDark?: boolean;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
40
45
|
export interface CcsGlobalConfigType {
|
|
41
46
|
/** app名称 */
|
|
42
47
|
AppName: string;
|
|
43
|
-
/**
|
|
44
|
-
|
|
48
|
+
/** 主题 */
|
|
49
|
+
AppTheme: 'default' | 'dark';
|
|
45
50
|
/** 菜单展开宽度 */
|
|
46
51
|
MenuExpandWidth: number;
|
|
47
52
|
/** 菜单收起宽度 */
|
|
@@ -51,7 +56,7 @@ export interface CcsGlobalConfigType {
|
|
|
51
56
|
/** 启用按钮权限 */
|
|
52
57
|
IsAuthButton: boolean;
|
|
53
58
|
/** ant 主题 */
|
|
54
|
-
theme:
|
|
59
|
+
theme: ThemeType;
|
|
55
60
|
/** 菜单类型,现在支持垂直、水平、和内嵌模式三种 */
|
|
56
61
|
MenuExpandMode: MenuProps['mode'];
|
|
57
62
|
/** 菜单始终收起状态? */
|
|
@@ -135,7 +140,6 @@ export { default as CcsColorPicker } from './color-picker';
|
|
|
135
140
|
export { default as CcsConfigProvider } from './config';
|
|
136
141
|
export { default as CcsDatePicker } from './date-picker';
|
|
137
142
|
export { default as CcsDialog } from './dialog';
|
|
138
|
-
export { default as CcsDrawer } from './drawer';
|
|
139
143
|
export { default as CcsFullScreenButton } from './full-screen';
|
|
140
144
|
export { default as useCcsGlobal } from './hooks/use-global';
|
|
141
145
|
export { default as useCcsOnceEvent } from './hooks/use-once-event';
|
|
@@ -145,7 +149,6 @@ export { default as useCcsWindow } from './hooks/use-window';
|
|
|
145
149
|
export { default as CcsIntervalButton } from './interval-button';
|
|
146
150
|
export { default as CcsKeepAliveTabs } from './keep-alive-tabs';
|
|
147
151
|
export { default as CcsLoading } from './loading';
|
|
148
|
-
export { default as CcsModal } from './modal';
|
|
149
152
|
export { default as CcsProGrid } from './pro-grid';
|
|
150
153
|
export { default as CcsProTable } from './pro-table';
|
|
151
154
|
export { default as CcsProTabs } from './pro-tabs';
|
|
@@ -158,4 +161,4 @@ export { default as CcsUpload } from './upload';
|
|
|
158
161
|
export { default as CcsUtils } from './utils';
|
|
159
162
|
export { default as CcsVirtualList } from './virtual-list';
|
|
160
163
|
export { default as CcsWaterMark } from './water-mark';
|
|
161
|
-
export type { PageType, HttpResult, RecordType, MenuTreeNode, PageQueryType, TableDataType, ListQueryType, HttpListResult, HttpPageResult, MenuTreeNodeData, CcsUserDetailType, RouteHistoryType, };
|
|
164
|
+
export type { PageType, ReactText, HttpResult, RecordType, MenuTreeNode, PageQueryType, TableDataType, ListQueryType, HttpListResult, HttpPageResult, MenuTreeNodeData, CcsUserDetailType, RouteHistoryType, };
|
package/es/index.js
CHANGED
|
@@ -7,7 +7,6 @@ export { default as CcsColorPicker } from "./color-picker";
|
|
|
7
7
|
export { default as CcsConfigProvider } from "./config";
|
|
8
8
|
export { default as CcsDatePicker } from "./date-picker";
|
|
9
9
|
export { default as CcsDialog } from "./dialog";
|
|
10
|
-
export { default as CcsDrawer } from "./drawer";
|
|
11
10
|
export { default as CcsFullScreenButton } from "./full-screen";
|
|
12
11
|
export { default as useCcsGlobal } from "./hooks/use-global";
|
|
13
12
|
export { default as useCcsOnceEvent } from "./hooks/use-once-event";
|
|
@@ -17,7 +16,6 @@ export { default as useCcsWindow } from "./hooks/use-window";
|
|
|
17
16
|
export { default as CcsIntervalButton } from "./interval-button";
|
|
18
17
|
export { default as CcsKeepAliveTabs } from "./keep-alive-tabs";
|
|
19
18
|
export { default as CcsLoading } from "./loading";
|
|
20
|
-
export { default as CcsModal } from "./modal";
|
|
21
19
|
export { default as CcsProGrid } from "./pro-grid";
|
|
22
20
|
export { default as CcsProTable } from "./pro-table";
|
|
23
21
|
export { default as CcsProTabs } from "./pro-tabs";
|
|
@@ -14,12 +14,14 @@ import { Button, Dropdown, Empty, Tabs } from 'antd';
|
|
|
14
14
|
import classnames from 'classnames';
|
|
15
15
|
import _debounce from 'lodash/debounce';
|
|
16
16
|
import ResizeObserver from 'rc-resize-observer';
|
|
17
|
-
import
|
|
17
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
18
18
|
import { useLocation } from 'react-router';
|
|
19
19
|
import { useOutlet } from 'react-router-dom';
|
|
20
20
|
import { CCS, CcsUtils } from "../";
|
|
21
21
|
import "./index.less";
|
|
22
22
|
import Page from "./page";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
25
|
var extraItems = [{
|
|
24
26
|
key: '1',
|
|
25
27
|
label: '关闭其他标签'
|
|
@@ -141,7 +143,7 @@ export default (function (_ref) {
|
|
|
141
143
|
key: pathname,
|
|
142
144
|
timestamp: new Date().getTime(),
|
|
143
145
|
label: curMenu ? curMenu.nodeName : '未知',
|
|
144
|
-
outlet: curMenu ? outlet : /*#__PURE__*/
|
|
146
|
+
outlet: curMenu ? outlet : /*#__PURE__*/_jsx(Empty, {
|
|
145
147
|
description: "\u672A\u77E5\u9875\u9762"
|
|
146
148
|
}),
|
|
147
149
|
urlAuthList: urlAuthList
|
|
@@ -192,18 +194,19 @@ export default (function (_ref) {
|
|
|
192
194
|
history.push('/');
|
|
193
195
|
}
|
|
194
196
|
};
|
|
195
|
-
var tabBarExtraContent = /*#__PURE__*/
|
|
197
|
+
var tabBarExtraContent = /*#__PURE__*/_jsx(Dropdown, {
|
|
196
198
|
menu: {
|
|
197
199
|
items: extraItems,
|
|
198
200
|
onClick: function onClick(e) {
|
|
199
201
|
onCloseTab(e.key);
|
|
200
202
|
}
|
|
201
203
|
},
|
|
202
|
-
placement: "bottomRight"
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
placement: "bottomRight",
|
|
205
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
206
|
+
icon: /*#__PURE__*/_jsx(MoreOutlined, {}),
|
|
207
|
+
type: "text"
|
|
208
|
+
})
|
|
209
|
+
});
|
|
207
210
|
var tabRef = useRef();
|
|
208
211
|
var resizeFn = _debounce(function (width) {
|
|
209
212
|
if (tabRef.current) tabRef.current.style.maxWidth = "".concat(width, "px");
|
|
@@ -214,37 +217,39 @@ export default (function (_ref) {
|
|
|
214
217
|
var onResize = function onResize(size) {
|
|
215
218
|
resizeFn(size.width);
|
|
216
219
|
};
|
|
217
|
-
return /*#__PURE__*/
|
|
218
|
-
className: classnames(className, "".concat(classPrefix, "-keep-alive"))
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
220
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
221
|
+
className: classnames(className, "".concat(classPrefix, "-keep-alive")),
|
|
222
|
+
children: [/*#__PURE__*/_jsx(ResizeObserver, {
|
|
223
|
+
onResize: onResize,
|
|
224
|
+
children: /*#__PURE__*/_jsx("div", {})
|
|
225
|
+
}), /*#__PURE__*/_jsx(Tabs, {
|
|
226
|
+
id: "keep-alive-tabs",
|
|
227
|
+
hideAdd: true,
|
|
228
|
+
size: "small",
|
|
229
|
+
onChange: function onChange(e) {
|
|
230
|
+
history.push(e);
|
|
231
|
+
},
|
|
232
|
+
className: "".concat(classPrefix, "-keep-alive-tabs"),
|
|
233
|
+
activeKey: pathname,
|
|
234
|
+
type: "editable-card",
|
|
235
|
+
onEdit: function onEdit(e) {
|
|
236
|
+
return onDestroy(e);
|
|
237
|
+
},
|
|
238
|
+
items: components.current,
|
|
239
|
+
tabBarExtraContent: components.current.length > 2 ? tabBarExtraContent : null
|
|
240
|
+
}), components.current.map(function (_ref3) {
|
|
241
|
+
var key = _ref3.key,
|
|
242
|
+
urlAuthList = _ref3.urlAuthList,
|
|
243
|
+
timestamp = _ref3.timestamp,
|
|
244
|
+
outlet = _ref3.outlet;
|
|
245
|
+
return /*#__PURE__*/_jsx(Page, {
|
|
246
|
+
active: key === pathname,
|
|
247
|
+
location: location,
|
|
248
|
+
onDestroy: onDestroy,
|
|
249
|
+
urlAuthList: urlAuthList,
|
|
250
|
+
timestamp: timestamp,
|
|
251
|
+
children: outlet
|
|
252
|
+
}, key);
|
|
253
|
+
})]
|
|
254
|
+
});
|
|
250
255
|
});
|
package/es/modal.zip
ADDED
|
Binary file
|
package/es/pro-table/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TableProps } from 'antd';
|
|
2
2
|
import { Rule } from 'antd/es/form';
|
|
3
|
-
import React, { CSSProperties, MutableRefObject, ReactElement, ReactNode
|
|
3
|
+
import React, { CSSProperties, MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { ReactText } from '..';
|
|
4
5
|
import './index.less';
|
|
5
6
|
type ParamType = Record<string, any>;
|
|
6
7
|
export type ShowDependType = {
|
|
@@ -73,14 +74,13 @@ export interface CcsTableProps<T> extends TableProps<T> {
|
|
|
73
74
|
className?: string;
|
|
74
75
|
/** useEventEmitter事件 */
|
|
75
76
|
event$?: any;
|
|
77
|
+
/** style */
|
|
76
78
|
style?: CSSProperties;
|
|
77
79
|
}
|
|
78
80
|
export type ProTableInstanceRef<T = any> = MutableRefObject<ProTableInstance<T> | undefined> | React.RefObject<ProTableInstance<T>>;
|
|
79
81
|
export interface CcsProTableProps<T> {
|
|
80
82
|
/** api权限标识 */
|
|
81
83
|
auth?: string | 'ignore';
|
|
82
|
-
/** 标题 */
|
|
83
|
-
title?: string;
|
|
84
84
|
/** 是否初始查询,默认true */
|
|
85
85
|
init?: boolean;
|
|
86
86
|
/** loading */
|