@ccs-ui/rc-pro 1.1.20 → 1.1.21-beta-1

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.
@@ -0,0 +1,18 @@
1
+ import { CSSProperties } from 'react';
2
+ import { RGBColor } from 'react-color';
3
+ import './index.less';
4
+ export type PropsType = {
5
+ /** 指定选中项 */
6
+ value?: RGBColor;
7
+ /** 占位 */
8
+ placeholder?: string;
9
+ /** 内部样式 */
10
+ style?: CSSProperties;
11
+ /** 选择完成后的回调 */
12
+ onChange?: (value: RGBColor) => void;
13
+ };
14
+ /**
15
+ * 颜色选择组件
16
+ */
17
+ declare const ColorPicker: ({ onChange, value, style }: PropsType) => import("react/jsx-runtime").JSX.Element;
18
+ export default ColorPicker;
@@ -0,0 +1,20 @@
1
+ import { DatePickerProps } from 'antd';
2
+ import { PickerPanelDateProps } from 'antd/es/calendar/generateCalendar';
3
+ import { RangePickerProps } from 'antd/es/date-picker';
4
+ import { Dayjs } from 'dayjs';
5
+ type CcsDatePickerProps = {
6
+ value?: string;
7
+ picker?: 'year' | 'month' | 'date';
8
+ onChange?: (e: string) => void;
9
+ } & Omit<PickerPanelDateProps<Dayjs>, 'value' | 'onChange' | 'picker'> & Omit<DatePickerProps, 'value' | 'onChange' | 'picker'>;
10
+ type CcsRangePickerProps = {
11
+ showTime?: boolean;
12
+ value?: [string, string];
13
+ picker?: 'year' | 'month' | 'date';
14
+ onChange?: (e: [string, string]) => void;
15
+ } & Omit<RangePickerProps, 'value' | 'onChange'>;
16
+ declare function CcsDatePicker({ value, onChange, ...restProps }: CcsDatePickerProps): import("react/jsx-runtime").JSX.Element;
17
+ declare namespace CcsDatePicker {
18
+ var RangePicker: ({ value, onChange, ...restProps }: CcsRangePickerProps) => import("react/jsx-runtime").JSX.Element;
19
+ }
20
+ export default CcsDatePicker;
@@ -2,7 +2,7 @@
2
2
  import { FormProps } from 'antd';
3
3
  import { DialogFormRef } from './form';
4
4
  import { CcsDialogModal, CcsDialogModalProps } from './hook';
5
- export declare const DialogSelfButton: ({ auth, formRef, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "request" | "auth" | "onRequestBefore" | "onCancel"> & {
5
+ export declare const DialogSelfButton: ({ auth, formRef, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onCancel" | "onRequestBefore"> & {
6
6
  formRef: React.RefObject<DialogFormRef>;
7
7
  formInitialValues: FormProps['initialValues'];
8
8
  }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { FormInstance, FormProps } from 'antd';
2
+ import React, { CSSProperties, ReactNode } from 'react';
3
+ type PropsType = {
4
+ children: ReactNode;
5
+ formProps: FormProps;
6
+ styles?: CSSProperties;
7
+ };
8
+ export type DialogFormRef = {
9
+ formInstance: FormInstance;
10
+ };
11
+ /**
12
+ * 添加form实例
13
+ * @returns
14
+ */
15
+ declare const DialogForm: React.ForwardRefExoticComponent<PropsType & React.RefAttributes<DialogFormRef>>;
16
+ export default DialogForm;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export default function usePatchElement(): [
3
+ React.ReactElement[],
4
+ (element: React.ReactElement) => Function
5
+ ];
@@ -0,0 +1,10 @@
1
+ export declare class EventInstance<T = any, ActionType = any> {
2
+ private subscriptions;
3
+ emit: (val: T, actionType?: ActionType) => void;
4
+ useSubscription: (callback: (val: T) => void, actionType?: ActionType) => T;
5
+ }
6
+ /**
7
+ * 组件消息订阅方式传值
8
+ * @returns
9
+ */
10
+ export default function Event<T = void, ActionType = any>(): EventInstance<T, ActionType>;
@@ -0,0 +1,2 @@
1
+ declare const useOnceEvent: (fn: (...params: any) => void) => (...args: any) => void;
2
+ export default useOnceEvent;
@@ -0,0 +1,11 @@
1
+ type CcsLoadingProps = {
2
+ /**
3
+ * loading 状态
4
+ * @default false
5
+ */
6
+ loading?: boolean;
7
+ /** loading 文字说明 */
8
+ loadingTip?: string;
9
+ };
10
+ declare const Loading: ({ loading, loadingTip }: CcsLoadingProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ export default Loading;
@@ -88,7 +88,13 @@ function SearchComponent(_ref) {
88
88
  });
89
89
 
90
90
  // 所有都是主条件
91
- if (hasMain.length === formItems.length) return false;
91
+ if (hasMain.length === formItems.length) {
92
+ // 收起已展开
93
+ if (isShowMore === true) {
94
+ setIsShowMore(false);
95
+ }
96
+ return false;
97
+ }
92
98
 
93
99
  // 条件数大于1,有更多
94
100
  return formItems.length > 1;
@@ -28,12 +28,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
28
28
  import { jsxs as _jsxs } from "react/jsx-runtime";
29
29
  // 判断组件所处dom
30
30
  var onIsInModalOrDrawer = function onIsInModalOrDrawer(node) {
31
- var _parent$classList, _parent$classList2, _parent$classList3, _parent$classList4;
31
+ var _parent$classList, _parent$classList2, _parent$classList3, _parent$classList4, _parent$classList5;
32
32
  var parent = node.parentNode;
33
33
  if (!parent) return false;
34
34
  if (
35
35
  // 通过指定dom吸顶
36
- (_parent$classList = parent.classList) !== null && _parent$classList !== void 0 && _parent$classList.contains('ccs-trigger-container') || (_parent$classList2 = parent.classList) !== null && _parent$classList2 !== void 0 && _parent$classList2.contains('ccs-drawer-content')) {
36
+ (_parent$classList = parent.classList) !== null && _parent$classList !== void 0 && _parent$classList.contains('ccs-trigger-container') || (_parent$classList2 = parent.classList) !== null && _parent$classList2 !== void 0 && _parent$classList2.contains('ccs-drawer-content') || (_parent$classList3 = parent.classList) !== null && _parent$classList3 !== void 0 && _parent$classList3.contains('ant-drawer-body')) {
37
37
  return {
38
38
  getContainer: function getContainer() {
39
39
  return parent;
@@ -41,7 +41,7 @@ var onIsInModalOrDrawer = function onIsInModalOrDrawer(node) {
41
41
  };
42
42
  }
43
43
  // 在弹出框中吸顶top
44
- if ((_parent$classList3 = parent.classList) !== null && _parent$classList3 !== void 0 && _parent$classList3.contains('ant-modal') || (_parent$classList4 = parent.classList) !== null && _parent$classList4 !== void 0 && _parent$classList4.contains('ant-drawer')) {
44
+ if ((_parent$classList4 = parent.classList) !== null && _parent$classList4 !== void 0 && _parent$classList4.contains('ant-modal') || (_parent$classList5 = parent.classList) !== null && _parent$classList5 !== void 0 && _parent$classList5.contains('ant-drawer')) {
45
45
  return {
46
46
  offsetHeader: 0
47
47
  };
@@ -299,6 +299,7 @@ var InternalProTable = function InternalProTable(props) {
299
299
  useEffect(function () {
300
300
  // 判断当前dom所处的滚动区域
301
301
  var inMd = onIsInModalOrDrawer(tableRef.current);
302
+ console.log('inMd', inMd);
302
303
  if (inMd) stickyRef.current = inMd;
303
304
 
304
305
  // // 监听resize
@@ -0,0 +1,9 @@
1
+ export type CcsStatusTagProps = {
2
+ value: any;
3
+ options: {
4
+ value: any;
5
+ label: string;
6
+ tag: string[];
7
+ }[];
8
+ };
9
+ export default function CcsStatusTag({ value, options, }: CcsStatusTagProps): any;
@@ -0,0 +1,16 @@
1
+ import { TimePickerProps } from 'antd';
2
+ import { RangePickerTimeProps } from 'antd/es/date-picker/generatePicker';
3
+ import { Dayjs } from 'dayjs';
4
+ type CcsTimePickerProps = {
5
+ value?: string;
6
+ onChange?: (e: string) => void;
7
+ } & Omit<TimePickerProps, 'value' | 'onChange'>;
8
+ type CcsRangePickerProps = {
9
+ value?: [string, string];
10
+ onChange?: (e: [string, string]) => void;
11
+ } & Omit<RangePickerTimeProps<Dayjs>, 'value' | 'onChange' | 'picker'>;
12
+ declare function CcsDatePicker({ value, onChange, ...restProps }: CcsTimePickerProps): import("react/jsx-runtime").JSX.Element;
13
+ declare namespace CcsDatePicker {
14
+ var RangePicker: ({ value, onChange, ...restProps }: CcsRangePickerProps) => import("react/jsx-runtime").JSX.Element;
15
+ }
16
+ export default CcsDatePicker;
@@ -0,0 +1,48 @@
1
+ import { CSSProperties, ReactElement } from 'react';
2
+ import { SizeType } from 'antd/es/config-provider/SizeContext';
3
+ import './index.less';
4
+ export type CcsTriggerProps = {
5
+ /** 下拉框宽度 */
6
+ width?: number;
7
+ /** 下拉框高度 */
8
+ height?: number;
9
+ /**
10
+ * @description input size:'small' | 'middle' | 'large'
11
+ * @default 'middle'
12
+ */
13
+ size?: SizeType;
14
+ /**
15
+ * @description 禁用选择
16
+ * @default false
17
+ */
18
+ disabled?: boolean;
19
+ /** 选择内容 */
20
+ children?: ReactElement;
21
+ /** Form.Item value */
22
+ value?: any;
23
+ /** style */
24
+ style?: CSSProperties;
25
+ /** class */
26
+ className?: string;
27
+ /** input placeholder */
28
+ placeholder?: string;
29
+ /**
30
+ * 是否在首次显示前渲染弹出内容
31
+ * @default false
32
+ */
33
+ forceRender?: boolean;
34
+ /**
35
+ * @description popup挂载的html节点,默认:document.body、true:当前dom
36
+ * @default document.body
37
+ */
38
+ popupContainer?: boolean;
39
+ /** Form.Item onChange */
40
+ onChange?: (value?: any) => void;
41
+ };
42
+ /**
43
+ * 适用于Form.Item中的 trigger组件,其内容自行定义,遵循ant form 自定义组件规范
44
+ * @param CcsTriggerPropsType
45
+ * @returns
46
+ */
47
+ declare const TriggerComponent: (props: CcsTriggerProps) => import("react/jsx-runtime").JSX.Element;
48
+ export default TriggerComponent;
package/es/types.d.ts ADDED
File without changes
@@ -0,0 +1,105 @@
1
+ import dayjs from 'dayjs';
2
+ type DayjsType = dayjs.Dayjs & {
3
+ fromNow(withoutSuffix?: boolean): string;
4
+ from(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
5
+ toNow(withoutSuffix?: boolean): string;
6
+ to(compared: dayjs.ConfigType, withoutSuffix?: boolean): string;
7
+ };
8
+ export default class utils {
9
+ /**
10
+ * 是函数?
11
+ * @param obj
12
+ * @returns
13
+ */
14
+ static isFunction(obj: any): obj is Function;
15
+ /**
16
+ * 获取stroage
17
+ * @param key
18
+ * @returns
19
+ */
20
+ static getStroage(key: string): Promise<unknown>;
21
+ /**
22
+ * 设置stroage
23
+ * @param key
24
+ * @param value
25
+ * @returns
26
+ */
27
+ static setStroage(key: string, value: any): Promise<any>;
28
+ /** 删除stroage */
29
+ static removeStroage(key: string): Promise<void>;
30
+ static showLogWarning(message: string): void;
31
+ /**
32
+ * 开发环境抛警告
33
+ * @param valid
34
+ * @param message
35
+ */
36
+ static showWarning(valid: boolean, message: string): void;
37
+ /** nodejs 环境 */
38
+ static isNode: boolean;
39
+ /**
40
+ * 浏览器环境
41
+ * @returns
42
+ */
43
+ static isBrowser(): boolean;
44
+ /**
45
+ * 格式化成dayjs
46
+ * @param date
47
+ * @returns
48
+ */
49
+ static dayjs(date?: string | number | Date | dayjs.Dayjs | null | undefined): DayjsType;
50
+ /**
51
+ * 空判断
52
+ * @param val
53
+ * @returns
54
+ */
55
+ static isEmpty: (val: unknown) => boolean;
56
+ /**
57
+ * 非空
58
+ * @param val
59
+ * @returns
60
+ */
61
+ static isNotEmpty: (val: unknown) => boolean;
62
+ /**
63
+ * json转base64
64
+ * @param value
65
+ * @returns
66
+ */
67
+ static jsonToBase64(value: any): string;
68
+ /**
69
+ * base64转json
70
+ * @param value
71
+ * @returns
72
+ */
73
+ static base64ToJson<T = any>(value: string): T | null;
74
+ /**
75
+ * JSON.parse
76
+ * @param value
77
+ * @returns
78
+ */
79
+ static jsonParse<T = any>(value: string): T;
80
+ /**
81
+ * string to HEX
82
+ * @param {*} str
83
+ */
84
+ static stringToHex(str: string): string;
85
+ /**
86
+ * string to dayjs
87
+ * @param val
88
+ * @param formartType // YYYY-MM-DD HH:mm:ss https://dayjs.fenxianglu.cn/category/display.html#%E6%A0%BC%E5%BC%8F%E5%8C%96
89
+ * @returns
90
+ */
91
+ static dayjsFmt(val: string | undefined, formartType?: string): dayjs.Dayjs | undefined;
92
+ /**
93
+ * 空对象?
94
+ * @param obj
95
+ * @returns
96
+ */
97
+ static objIsEmpty(obj: any): boolean;
98
+ /**
99
+ * 判断值不为空
100
+ * @param str string,object,array
101
+ * @returns
102
+ */
103
+ static isNil(str: any): boolean;
104
+ }
105
+ export {};
@@ -0,0 +1,52 @@
1
+ import { CSSProperties, ReactNode, RefObject } from 'react';
2
+ type Position = {
3
+ left: number;
4
+ top: number;
5
+ };
6
+ export type RowRendererProps = {
7
+ rowHeight: number;
8
+ index: number;
9
+ };
10
+ export type VirtualInstance = {
11
+ scrollTop: (top: number) => void;
12
+ };
13
+ export type VirtualListProps = {
14
+ /** 容器高度 */
15
+ height?: number;
16
+ /** 记录条数 */
17
+ rowCount: number;
18
+ /** 行高 */
19
+ rowHeight: number;
20
+ /**
21
+ * 自动隐藏滚动条
22
+ * @default true
23
+ */
24
+ autoHideScroll?: boolean;
25
+ /** 显示条数 */
26
+ overscanRowCount: number;
27
+ /** 条数改变定位顶部 */
28
+ rowCountChangeScrollTop?: boolean;
29
+ /** instance */
30
+ virtualRef?: RefObject<VirtualInstance>;
31
+ style?: CSSProperties;
32
+ className?: string;
33
+ /** 渲染row */
34
+ rowRenderer: ({ rowHeight, index }: RowRendererProps) => ReactNode;
35
+ /** scroll event */
36
+ onScroll?: (position: Position) => void;
37
+ };
38
+ export type VirtualListItemProps = Pick<VirtualListProps, 'rowHeight' | 'rowRenderer'> & {
39
+ index: number;
40
+ };
41
+ export type ListItemProps = {
42
+ prefix: ReactNode;
43
+ title: ReactNode;
44
+ extra?: ReactNode;
45
+ extraIcon?: ReactNode;
46
+ height: number;
47
+ className?: string;
48
+ description?: ReactNode;
49
+ onClick?: () => void;
50
+ };
51
+ declare const VirtualList: ({ height, rowCount, rowHeight, className, style, virtualRef, onScroll, rowRenderer, autoHideScroll, overscanRowCount, rowCountChangeScrollTop, }: VirtualListProps) => import("react/jsx-runtime").JSX.Element;
52
+ export default VirtualList;
@@ -0,0 +1,69 @@
1
+ import React, { ReactNode } from 'react';
2
+ export type WaterMarkProps = {
3
+ /** 水印文字内容 */
4
+ content?: string;
5
+ /** 类名 */
6
+ className?: string;
7
+ /** 样式 */
8
+ style?: React.CSSProperties;
9
+ /** 水印样式 */
10
+ markStyle?: React.CSSProperties;
11
+ /** 水印类名 */
12
+ markClassName?: string;
13
+ /** 水印之间的水平间距 */
14
+ gapX?: number;
15
+ /** 水印之间的垂直间距 */
16
+ gapY?: number;
17
+ /** 追加的水印元素的z-index */
18
+ zIndex?: number;
19
+ /** 水印的宽度 */
20
+ width?: number;
21
+ /** 水印的高度 */
22
+ height?: number;
23
+ /** 水印在canvas 画布上绘制的垂直偏移量,正常情况下,水印绘制在中间位置, 即 offsetTop = gapY / 2 */
24
+ offsetTop?: number;
25
+ /** 水印在canvas 画布上绘制的水平偏移量, 正常情况下,水印绘制在中间位置, 即 offsetTop = gapX / 2 */
26
+ offsetLeft?: number;
27
+ /** 水印绘制时,旋转的角度,单位 ° */
28
+ rotate?: number;
29
+ /** ClassName 前缀 */
30
+ prefixCls?: string;
31
+ /** 高清印图片源, 为了高清屏幕显示,建议使用 2倍或3倍图,优先使用图片渲染水印。 */
32
+ image?: string;
33
+ /**
34
+ * @description 文字颜色
35
+ * @default rgba(0,0,0,.15)
36
+ */
37
+ fontColor?: string;
38
+ /**
39
+ * @description 文字样式
40
+ * @default normal
41
+ */
42
+ fontStyle?: 'none' | 'normal' | 'italic' | 'oblique';
43
+ /**
44
+ * @description 文字族
45
+ * @default sans-serif
46
+ */
47
+ fontFamily?: string;
48
+ /**
49
+ * @description 文字粗细
50
+ * @default normal
51
+ */
52
+ fontWeight?: 'normal' | 'light' | 'weight' | number;
53
+ /**
54
+ * @description 文字大小
55
+ * @default 16
56
+ */
57
+ fontSize?: number | string;
58
+ /**
59
+ * 组件 children
60
+ */
61
+ children?: ReactNode;
62
+ };
63
+ /**
64
+ * 水印组件
65
+ * @param WaterMarkProps
66
+ * @returns
67
+ */
68
+ declare const WaterMarkComponent: (props: WaterMarkProps) => import("react/jsx-runtime").JSX.Element;
69
+ export default WaterMarkComponent;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "1.1.20",
4
- "description": "ProGrid 调整;ProTable 传入列宽度为number类型拖拽才生效;ProTable传入pagination分页显示异常",
3
+ "version": "1.1.21-beta-1",
4
+ "description": "ProTable在抽屉中吸顶异常",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Hong",
@@ -68,6 +68,7 @@
68
68
  "react-color": "^2.19.3",
69
69
  "react-custom-scrollbars": "^4.2.1",
70
70
  "react-draggable": "^4.4.5",
71
+ "react-error-overlay": "^6.0.11",
71
72
  "react-resizable": "^3.0.5",
72
73
  "react-router": "^6.11.2",
73
74
  "react-router-dom": "^6.11.2",