@ccs-ui/rc-pro 1.1.1-rc20 → 1.1.1-rc21

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.
@@ -1,6 +1,6 @@
1
1
  import { ButtonProps } from 'antd';
2
2
  import { ReactElement, ReactNode } from 'react';
3
- import { CCS } from '..';
3
+ import CCS from '..';
4
4
  export interface CcsAuthGroupProps {
5
5
  /** 按钮尺寸 */
6
6
  size?: ButtonProps['size'];
@@ -1,5 +1,5 @@
1
1
  import { CascaderProps } from 'antd';
2
- import { CCS } from '..';
2
+ import CCS from '..';
3
3
  type CacheType = {
4
4
  /** 缓存key,同一个key将共享数据 */
5
5
  cacheKey?: string;
@@ -2,7 +2,7 @@ import { TabPaneProps } from 'antd';
2
2
  import { Store } from 'antd/es/form/interface';
3
3
  import { Location } from 'history';
4
4
  import React from 'react';
5
- import { CCS } from '..';
5
+ import CCS from '..';
6
6
  type CcsTabsChangeProps = {
7
7
  /** 当前激活tab面板的key */
8
8
  activeKey?: string;
@@ -23,7 +23,7 @@ interface CcsTabsContextType {
23
23
  /** tab间传递的参数 */
24
24
  options: CCS.RecordType;
25
25
  /** 添加tab */
26
- onAddTabs: (tab: CcsTabProps | CcsTabProps[]) => void;
26
+ onAddTabs: (tab: CcsTabProps | CcsTabProps[], activeKey?: string) => void;
27
27
  /** 移除tab */
28
28
  onRemoveTabs: (key: string | string[]) => void;
29
29
  /** 改变tab间传递的参数 */
package/es/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { default as CcsAuth } from './auth';
2
2
  export { default as CcsApiCascader } from './cascader';
3
- export * as CCS from './ccs';
4
3
  export { default as CcsColorPicker } from './color-picker';
5
4
  export { default as CcsConfigProvider } from './config';
6
5
  export { default as CcsDatePicker } from './date-picker';
@@ -26,3 +25,5 @@ export { default as CcsUpload } from './upload';
26
25
  export { default as CcsUtils } from './utils';
27
26
  export { default as CcsVirtualList } from './virtual-list';
28
27
  export { default as CcsWaterMark } from './water-mark';
28
+ import * as CCS from './ccs';
29
+ export default CCS;
package/es/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  export { default as CcsAuth } from "./auth";
2
2
  export { default as CcsApiCascader } from "./cascader";
3
- import * as _CCS from "./ccs";
4
- export { _CCS as CCS };
5
3
  export { default as CcsColorPicker } from "./color-picker";
6
4
  export { default as CcsConfigProvider } from "./config";
7
5
  export { default as CcsDatePicker } from "./date-picker";
@@ -26,4 +24,6 @@ export { default as CcsTrigger } from "./trigger";
26
24
  export { default as CcsUpload } from "./upload";
27
25
  export { default as CcsUtils } from "./utils";
28
26
  export { default as CcsVirtualList } from "./virtual-list";
29
- export { default as CcsWaterMark } from "./water-mark";
27
+ export { default as CcsWaterMark } from "./water-mark";
28
+ import * as CCS from "./ccs";
29
+ export default CCS;
@@ -1,4 +1,4 @@
1
- import { CCS } from '../';
1
+ import CCS from '../';
2
2
  import './index.less';
3
3
  interface PropsType {
4
4
  maxLen?: number;
@@ -1,6 +1,6 @@
1
1
  import { TableProps } from 'antd';
2
2
  import { CSSProperties, ReactElement, ReactNode } from 'react';
3
- import { CCS } from '..';
3
+ import CCS from '..';
4
4
  import './index.less';
5
5
  type ParamType = Record<string, any>;
6
6
  export type ShowDependType = {
@@ -2,7 +2,7 @@ import { EventEmitter } from 'ahooks/lib/useEventEmitter';
2
2
  import { TableSticky } from 'rc-table/lib/interface';
3
3
  import { RefObject } from 'react';
4
4
  import { CcsProTableProps } from '.';
5
- import { CCS } from '..';
5
+ import CCS from '..';
6
6
  export type TreeInstance<T> = {
7
7
  onRequestTree: (query: any, record: T | any) => void;
8
8
  onExpandKeys: (ids: string[]) => void;
@@ -138,12 +138,19 @@ export default (function (_ref) {
138
138
  // add tabs
139
139
  var onAddTabs = function onAddTabs() {
140
140
  var tabs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
141
+ var activeKey = arguments.length > 1 ? arguments[1] : undefined;
141
142
  var isArray = Array.isArray(tabs);
142
- setTabsProps(update(tabsProps, {
143
+ var $update = {
143
144
  items: {
144
145
  $push: isArray ? tabs : [tabs]
145
146
  }
146
- }));
147
+ };
148
+ if (activeKey) {
149
+ $update.activeKey = {
150
+ $set: activeKey || tabsProps.activeKey
151
+ };
152
+ }
153
+ setTabsProps(update(tabsProps, $update));
147
154
  };
148
155
  return children ? /*#__PURE__*/_jsx(TabsContext.Provider, {
149
156
  value: {
@@ -1,5 +1,5 @@
1
1
  import { SelectProps } from 'antd';
2
- import { CCS } from '..';
2
+ import CCS from '..';
3
3
  type CacheType = {
4
4
  /** 缓存key,同一个key将共享数据 */
5
5
  cacheKey?: string;
@@ -1,5 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
- import { CCS } from '..';
2
+ import CCS from '..';
3
3
  interface DayjsType extends dayjs.Dayjs {
4
4
  fromNow(withoutSuffix?: boolean): string;
5
5
  from(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "1.1.1-rc20",
3
+ "version": "1.1.1-rc21",
4
4
  "description": "A react pro components",
5
5
  "license": "MIT",
6
6
  "module": "es/index.js",