@ccs-ui/rc-pro 2.3.3 → 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/breadcrumb.js CHANGED
@@ -16,18 +16,21 @@ export default function CcsBreadcrumb(_ref) {
16
16
  className: className,
17
17
  style: style,
18
18
  children: items.map(function (item, index) {
19
+ var isLast = index === items.length - 1;
20
+ var grayColor = 'rgba(0, 0, 0, 0.45)';
19
21
  return /*#__PURE__*/_jsxs(_Fragment, {
20
22
  children: [/*#__PURE__*/_jsx("div", {
21
- style: item.href ? {
22
- color: 'rgba(0, 0, 0, 0.45)'
23
- } : {},
23
+ style: {
24
+ color: !isLast ? grayColor : undefined,
25
+ cursor: !!item.href ? 'pointer' : 'unset'
26
+ },
24
27
  onClick: function onClick() {
25
28
  return _onClick(item.href);
26
29
  },
27
30
  children: item.title
28
- }, index), index !== items.length - 1 && /*#__PURE__*/_jsx("div", {
31
+ }, index), !isLast && /*#__PURE__*/_jsx("div", {
29
32
  style: {
30
- color: 'rgba(0, 0, 0, 0.45)'
33
+ color: grayColor
31
34
  },
32
35
  children: "/"
33
36
  })]
@@ -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>, "onClose" | "onOk" | "auth" | "extraBtn" | "request" | "requestFieldNames" | "preventRequestHandle"> & {
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: LayoutMenuType['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";
@@ -224,14 +223,12 @@ export default function KeepAliveTabs(_ref) {
224
223
  var breadcrumb = menus.map(function (m) {
225
224
  return {
226
225
  key: m.key,
227
- title: m.label,
228
- href: m.url
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
- breadcrumbNode: /*#__PURE__*/_jsx(CcsBreadcrumb, {
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
- import { ReactNode } from 'react';
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
- breadcrumbNode = props.breadcrumbNode;
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: [breadcrumbNode, children, /*#__PURE__*/_jsx(DialogElementsHolder, {
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
  })
@@ -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";
@@ -31,14 +30,13 @@ export default function SinglePage(_ref) {
31
30
  var breadcrumb = menus.map(function (m) {
32
31
  return {
33
32
  key: m.key,
34
- title: m.label,
35
- href: m.url
33
+ title: m.label
34
+ // href: m.url,
36
35
  };
37
36
  });
38
37
  breadcrumb.unshift({
39
38
  key: '-1',
40
- title: '首页',
41
- href: '/'
39
+ title: '首页'
42
40
  });
43
41
  return {
44
42
  auth: ((_menu$btnAuth = menu.btnAuth) === null || _menu$btnAuth === void 0 ? void 0 : _menu$btnAuth.map(function (b) {
@@ -53,11 +51,7 @@ export default function SinglePage(_ref) {
53
51
  children: menuInfo !== null && menuInfo !== void 0 && menuInfo.auth ? /*#__PURE__*/_jsx(Page, {
54
52
  location: location,
55
53
  urlAuthList: menuInfo.auth,
56
- breadcrumbNode: /*#__PURE__*/_jsx(CcsBreadcrumb, {
57
- history: history,
58
- className: "ccs-breadcrumb",
59
- items: menuInfo.breadcrumb
60
- }),
54
+ breadcrumb: menuInfo.breadcrumb,
61
55
  children: outlet
62
56
  }) : /*#__PURE__*/_jsx(CcsResult.NotFound, {
63
57
  style: {
@@ -1,11 +1,9 @@
1
- import { JSXElementConstructor, ReactElement, ReactNode } from 'react';
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
- breadcrumbNode = props.breadcrumbNode;
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: [breadcrumbNode, children, /*#__PURE__*/_jsx(DialogElementsHolder, {
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
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {