@ccs-ui/rc-pro 2.3.4 → 2.3.5
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/dialog/button.d.ts +1 -1
- package/es/layout-keep-alive/index.d.ts +2 -9
- package/es/layout-keep-alive/index.js +4 -11
- package/es/layout-keep-alive/page.d.ts +2 -4
- package/es/layout-keep-alive/page.js +6 -2
- package/es/layout-single-page/index.d.ts +1 -2
- package/es/layout-single-page/index.js +6 -13
- package/es/layout-single-page/page.d.ts +2 -4
- package/es/layout-single-page/page.js +7 -2
- package/package.json +1 -1
package/es/dialog/button.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type DialogButtonsProps<T> = Pick<CcsDialogModalProps, 'okText' | 'onClos
|
|
|
16
16
|
export type DialogButtonRef = {
|
|
17
17
|
onSetButtons: (e: React.ReactElement) => void;
|
|
18
18
|
};
|
|
19
|
-
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "auth" | "
|
|
19
|
+
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "auth" | "onClose" | "onOk" | "extraBtn" | "request" | "requestFieldNames" | "preventRequestHandle"> & {
|
|
20
20
|
formRef: React.RefObject<DialogFormRef<TParams>>;
|
|
21
21
|
formInitialValues: FormProps['initialValues'];
|
|
22
22
|
buttonRef: RefObject<DialogButtonRef>;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
+
import { BreadcrumbProps } from 'antd';
|
|
1
2
|
import { JSXElementConstructor, ReactElement } from 'react';
|
|
2
3
|
import CCS from '..';
|
|
3
4
|
import { MenuType } from '../ccs';
|
|
4
5
|
import './index.less';
|
|
5
|
-
type LayoutMenuType = CCS.MenuType & {
|
|
6
|
-
/** 面包屑数据 */
|
|
7
|
-
breadcrumb?: {
|
|
8
|
-
key: any;
|
|
9
|
-
title: string;
|
|
10
|
-
href?: string;
|
|
11
|
-
}[];
|
|
12
|
-
};
|
|
13
6
|
export type CacheComponent = {
|
|
14
7
|
key: string;
|
|
15
8
|
label: string;
|
|
@@ -18,7 +11,7 @@ export type CacheComponent = {
|
|
|
18
11
|
timestamp: number;
|
|
19
12
|
outlet: ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
20
13
|
children?: ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
21
|
-
breadcrumb:
|
|
14
|
+
breadcrumb: BreadcrumbProps['items'];
|
|
22
15
|
};
|
|
23
16
|
type PropsType = {
|
|
24
17
|
maxLen?: number;
|
|
@@ -23,7 +23,6 @@ import { useMemo, useRef } from 'react';
|
|
|
23
23
|
import { useLocation } from 'react-router';
|
|
24
24
|
import { useOutlet } from 'react-router-dom';
|
|
25
25
|
import { useAppConfig } from '..';
|
|
26
|
-
import CcsBreadcrumb from "../breadcrumb";
|
|
27
26
|
import "./index.less";
|
|
28
27
|
import Page from "./page";
|
|
29
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -221,17 +220,15 @@ export default function KeepAliveTabs(_ref) {
|
|
|
221
220
|
if (menu) saveHistory();
|
|
222
221
|
|
|
223
222
|
// 面包屑数据
|
|
224
|
-
var breadcrumb = menus.map(function (m
|
|
223
|
+
var breadcrumb = menus.map(function (m) {
|
|
225
224
|
return {
|
|
226
225
|
key: m.key,
|
|
227
|
-
title: m.label
|
|
228
|
-
href: index !== menus.length - 1 ? m.url : undefined
|
|
226
|
+
title: m.label
|
|
229
227
|
};
|
|
230
228
|
});
|
|
231
229
|
breadcrumb.unshift({
|
|
232
230
|
key: '-1',
|
|
233
|
-
title: '首页'
|
|
234
|
-
href: '/'
|
|
231
|
+
title: '首页'
|
|
235
232
|
});
|
|
236
233
|
return _objectSpread(_objectSpread({}, menu), {}, {
|
|
237
234
|
breadcrumb: breadcrumb
|
|
@@ -344,11 +341,7 @@ export default function KeepAliveTabs(_ref) {
|
|
|
344
341
|
onDestroy: onDestroy,
|
|
345
342
|
urlAuthList: urlAuthList,
|
|
346
343
|
timestamp: timestamp,
|
|
347
|
-
|
|
348
|
-
history: history,
|
|
349
|
-
className: "ccs-breadcrumb",
|
|
350
|
-
items: breadcrumb
|
|
351
|
-
}),
|
|
344
|
+
breadcrumb: breadcrumb,
|
|
352
345
|
children: outlet
|
|
353
346
|
}, key);
|
|
354
347
|
})]
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { Location } from 'react-router';
|
|
3
3
|
import { CacheComponent } from '.';
|
|
4
|
-
export type CachePageProps = Pick<CacheComponent, 'urlAuthList' | 'children' | 'timestamp'> & {
|
|
4
|
+
export type CachePageProps = Pick<CacheComponent, 'breadcrumb' | 'urlAuthList' | 'children' | 'timestamp'> & {
|
|
5
5
|
/** 选中状态 */
|
|
6
6
|
active: boolean;
|
|
7
7
|
/** router location */
|
|
8
8
|
location: Location;
|
|
9
|
-
/** 面包屑 */
|
|
10
|
-
breadcrumbNode: ReactNode;
|
|
11
9
|
/** 销毁页面 */
|
|
12
10
|
onDestroy: (path: string) => void;
|
|
13
11
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Breadcrumb } from 'antd';
|
|
1
2
|
import classNames from 'classnames';
|
|
2
3
|
import { memo, useRef } from 'react';
|
|
3
4
|
import Scrollbars from 'react-custom-scrollbars';
|
|
@@ -11,7 +12,7 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
11
12
|
active = props.active,
|
|
12
13
|
urlAuthList = props.urlAuthList,
|
|
13
14
|
onDestroy = props.onDestroy,
|
|
14
|
-
|
|
15
|
+
breadcrumb = props.breadcrumb;
|
|
15
16
|
var id = "_tab_content_".concat(locationRef.current.key);
|
|
16
17
|
var dialogHolderRef = useRef(null);
|
|
17
18
|
return /*#__PURE__*/_jsx(PageContext.Provider, {
|
|
@@ -37,7 +38,10 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
37
38
|
className: classNames('ccs-sticky-scroll', {
|
|
38
39
|
'route-avtive': active
|
|
39
40
|
}),
|
|
40
|
-
children: [
|
|
41
|
+
children: [/*#__PURE__*/_jsx(Breadcrumb, {
|
|
42
|
+
items: breadcrumb,
|
|
43
|
+
className: "ccs-breadcrumb"
|
|
44
|
+
}), children, /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
41
45
|
ref: dialogHolderRef
|
|
42
46
|
}, "modal-drawer-holder")]
|
|
43
47
|
})
|
|
@@ -4,7 +4,6 @@ type PropsType = {
|
|
|
4
4
|
appName: string;
|
|
5
5
|
menuItems: CCS.MenuType[];
|
|
6
6
|
className?: string;
|
|
7
|
-
history: any;
|
|
8
7
|
};
|
|
9
|
-
export default function SinglePage({ appName, menuItems, className,
|
|
8
|
+
export default function SinglePage({ appName, menuItems, className, }: PropsType): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -2,7 +2,6 @@ import classnames from 'classnames';
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useLocation } from 'react-router';
|
|
4
4
|
import { useOutlet } from 'react-router-dom';
|
|
5
|
-
import CcsBreadcrumb from "../breadcrumb";
|
|
6
5
|
import { findMenusByUrl } from "../layout-keep-alive";
|
|
7
6
|
import CcsResult from "../result";
|
|
8
7
|
import "./index.less";
|
|
@@ -12,8 +11,7 @@ export default function SinglePage(_ref) {
|
|
|
12
11
|
var appName = _ref.appName,
|
|
13
12
|
_ref$menuItems = _ref.menuItems,
|
|
14
13
|
menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
|
|
15
|
-
className = _ref.className
|
|
16
|
-
history = _ref.history;
|
|
14
|
+
className = _ref.className;
|
|
17
15
|
var location = useLocation();
|
|
18
16
|
var pathname = location.pathname;
|
|
19
17
|
var outlet = useOutlet();
|
|
@@ -29,17 +27,16 @@ export default function SinglePage(_ref) {
|
|
|
29
27
|
setTimeout(function () {
|
|
30
28
|
document.title = "".concat((menu === null || menu === void 0 ? void 0 : menu.label) || (menu === null || menu === void 0 ? void 0 : menu.url), " - ").concat(appName);
|
|
31
29
|
}, 10);
|
|
32
|
-
var breadcrumb = menus.map(function (m
|
|
30
|
+
var breadcrumb = menus.map(function (m) {
|
|
33
31
|
return {
|
|
34
32
|
key: m.key,
|
|
35
|
-
title: m.label
|
|
36
|
-
href:
|
|
33
|
+
title: m.label
|
|
34
|
+
// href: m.url,
|
|
37
35
|
};
|
|
38
36
|
});
|
|
39
37
|
breadcrumb.unshift({
|
|
40
38
|
key: '-1',
|
|
41
|
-
title: '首页'
|
|
42
|
-
href: '/'
|
|
39
|
+
title: '首页'
|
|
43
40
|
});
|
|
44
41
|
return {
|
|
45
42
|
auth: ((_menu$btnAuth = menu.btnAuth) === null || _menu$btnAuth === void 0 ? void 0 : _menu$btnAuth.map(function (b) {
|
|
@@ -54,11 +51,7 @@ export default function SinglePage(_ref) {
|
|
|
54
51
|
children: menuInfo !== null && menuInfo !== void 0 && menuInfo.auth ? /*#__PURE__*/_jsx(Page, {
|
|
55
52
|
location: location,
|
|
56
53
|
urlAuthList: menuInfo.auth,
|
|
57
|
-
|
|
58
|
-
history: history,
|
|
59
|
-
className: "ccs-breadcrumb",
|
|
60
|
-
items: menuInfo.breadcrumb
|
|
61
|
-
}),
|
|
54
|
+
breadcrumb: menuInfo.breadcrumb,
|
|
62
55
|
children: outlet
|
|
63
56
|
}) : /*#__PURE__*/_jsx(CcsResult.NotFound, {
|
|
64
57
|
style: {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { JSXElementConstructor, ReactElement
|
|
1
|
+
import { JSXElementConstructor, ReactElement } from 'react';
|
|
2
2
|
import { Location } from 'react-router';
|
|
3
3
|
import { CacheComponent } from '../layout-keep-alive';
|
|
4
|
-
export type SinglePageProps = Pick<CacheComponent, 'urlAuthList'> & {
|
|
4
|
+
export type SinglePageProps = Pick<CacheComponent, 'breadcrumb' | 'urlAuthList'> & {
|
|
5
5
|
/** router location */
|
|
6
6
|
location: Location;
|
|
7
|
-
/** 面包屑 */
|
|
8
|
-
breadcrumbNode: ReactNode;
|
|
9
7
|
/** children */
|
|
10
8
|
children: ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
11
9
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Breadcrumb } from 'antd';
|
|
1
2
|
import { memo, useRef } from 'react';
|
|
2
3
|
import Scrollbars from 'react-custom-scrollbars';
|
|
3
4
|
import { PageContext } from "../context";
|
|
@@ -9,7 +10,8 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
9
10
|
var children = props.children,
|
|
10
11
|
_props$urlAuthList = props.urlAuthList,
|
|
11
12
|
urlAuthList = _props$urlAuthList === void 0 ? [] : _props$urlAuthList,
|
|
12
|
-
|
|
13
|
+
_props$breadcrumb = props.breadcrumb,
|
|
14
|
+
breadcrumb = _props$breadcrumb === void 0 ? [] : _props$breadcrumb;
|
|
13
15
|
var dialogHolderRef = useRef(null);
|
|
14
16
|
return /*#__PURE__*/_jsx(PageContext.Provider, {
|
|
15
17
|
value: {
|
|
@@ -27,7 +29,10 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
27
29
|
children: /*#__PURE__*/_jsxs(Scrollbars, {
|
|
28
30
|
autoHide: true,
|
|
29
31
|
className: "ccs-sticky-scroll",
|
|
30
|
-
children: [
|
|
32
|
+
children: [/*#__PURE__*/_jsx(Breadcrumb, {
|
|
33
|
+
items: breadcrumb,
|
|
34
|
+
className: "ccs-breadcrumb"
|
|
35
|
+
}), children, /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
31
36
|
ref: dialogHolderRef
|
|
32
37
|
}, "modal-drawer-holder")]
|
|
33
38
|
})
|