@ccs-ui/rc-pro 2.3.6-alpha-31 → 2.3.6-alpha-33
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/package.json +6 -27
- package/LICENSE +0 -21
- package/README.md +0 -37
- package/es/aj-captcha/index.d.ts +0 -34
- package/es/aj-captcha/index.js +0 -302
- package/es/aj-captcha/index.less +0 -89
- package/es/auth/index.d.ts +0 -15
- package/es/auth/index.js +0 -38
- package/es/breadcrumb.d.ts +0 -8
- package/es/breadcrumb.js +0 -40
- package/es/button/dropdown.d.ts +0 -6
- package/es/button/dropdown.js +0 -72
- package/es/button/group.d.ts +0 -2
- package/es/button/group.js +0 -176
- package/es/button/index.d.ts +0 -65
- package/es/button/index.js +0 -133
- package/es/cascader/index.d.ts +0 -33
- package/es/cascader/index.js +0 -120
- package/es/ccs.d.ts +0 -131
- package/es/ccs.js +0 -1
- package/es/color-picker/index.d.ts +0 -7
- package/es/color-picker/index.js +0 -142
- package/es/color-picker/index.less +0 -8
- package/es/config.d.ts +0 -6
- package/es/config.js +0 -126
- package/es/context/index.d.ts +0 -115
- package/es/context/index.js +0 -6
- package/es/date-picker/index.d.ts +0 -19
- package/es/date-picker/index.js +0 -72
- package/es/dialog/HookDrawer.d.ts +0 -9
- package/es/dialog/HookDrawer.js +0 -156
- package/es/dialog/HookModal.d.ts +0 -10
- package/es/dialog/HookModal.js +0 -213
- package/es/dialog/button.d.ts +0 -24
- package/es/dialog/button.js +0 -256
- package/es/dialog/context.d.ts +0 -25
- package/es/dialog/context.js +0 -13
- package/es/dialog/drawer-footer.d.ts +0 -16
- package/es/dialog/drawer-footer.js +0 -43
- package/es/dialog/form.d.ts +0 -16
- package/es/dialog/form.js +0 -53
- package/es/dialog/hook.d.ts +0 -80
- package/es/dialog/hook.js +0 -234
- package/es/dialog/index.d.ts +0 -19
- package/es/dialog/index.js +0 -14
- package/es/dialog/usePatchElement.d.ts +0 -5
- package/es/dialog/usePatchElement.js +0 -35
- package/es/editor/index.d.ts +0 -22
- package/es/editor/index.js +0 -18
- package/es/editor/index.less +0 -19
- package/es/editor/javascript.d.ts +0 -2
- package/es/editor/javascript.js +0 -56
- package/es/editor/json.d.ts +0 -7
- package/es/editor/json.js +0 -82
- package/es/editor/sql.d.ts +0 -2
- package/es/editor/sql.js +0 -54
- package/es/ellipsis/index.d.ts +0 -22
- package/es/ellipsis/index.js +0 -129
- package/es/ellipsis/index.less +0 -5
- package/es/ellipsis/useMeasure.d.ts +0 -9
- package/es/ellipsis/useMeasure.js +0 -142
- package/es/ellipsis/useResizeEffect.d.ts +0 -2
- package/es/ellipsis/useResizeEffect.js +0 -14
- package/es/ellipsis/withStopPropagation.d.ts +0 -4
- package/es/ellipsis/withStopPropagation.js +0 -38
- package/es/full-screen/index.d.ts +0 -3
- package/es/full-screen/index.js +0 -49
- package/es/group-form-item/index.d.ts +0 -11
- package/es/group-form-item/index.js +0 -124
- package/es/hooks/use-app.d.ts +0 -25
- package/es/hooks/use-app.js +0 -52
- package/es/hooks/use-event.d.ts +0 -10
- package/es/hooks/use-event.js +0 -69
- package/es/hooks/use-once-event.d.ts +0 -2
- package/es/hooks/use-once-event.js +0 -16
- package/es/hooks/use-page.d.ts +0 -10
- package/es/hooks/use-page.js +0 -10
- package/es/hooks/use-selection.d.ts +0 -17
- package/es/hooks/use-selection.js +0 -172
- package/es/hooks/use-tabs.d.ts +0 -2
- package/es/hooks/use-tabs.js +0 -10
- package/es/hooks/use-window.d.ts +0 -8
- package/es/hooks/use-window.js +0 -15
- package/es/index.d.ts +0 -37
- package/es/index.js +0 -37
- package/es/interval-button/index.d.ts +0 -14
- package/es/interval-button/index.js +0 -128
- package/es/layout-keep-alive/index.d.ts +0 -29
- package/es/layout-keep-alive/index.js +0 -400
- package/es/layout-keep-alive/index.less +0 -79
- package/es/layout-keep-alive/page.d.ts +0 -14
- package/es/layout-keep-alive/page.js +0 -53
- package/es/layout-single-page/index.d.ts +0 -14
- package/es/layout-single-page/index.js +0 -71
- package/es/layout-single-page/index.less +0 -15
- package/es/layout-single-page/page.d.ts +0 -13
- package/es/layout-single-page/page.js +0 -41
- package/es/loading/index.d.ts +0 -14
- package/es/loading/index.js +0 -43
- package/es/pro-grid/index.d.ts +0 -15
- package/es/pro-grid/index.js +0 -58
- package/es/pro-table/_utils.d.ts +0 -12
- package/es/pro-table/_utils.js +0 -94
- package/es/pro-table/form-item.d.ts +0 -9
- package/es/pro-table/form-item.js +0 -44
- package/es/pro-table/head.d.ts +0 -16
- package/es/pro-table/head.js +0 -225
- package/es/pro-table/index.d.ts +0 -23
- package/es/pro-table/index.js +0 -37
- package/es/pro-table/index.less +0 -82
- package/es/pro-table/operation.d.ts +0 -14
- package/es/pro-table/operation.js +0 -194
- package/es/pro-table/selection-alert.d.ts +0 -20
- package/es/pro-table/selection-alert.js +0 -64
- package/es/pro-table/size.d.ts +0 -10
- package/es/pro-table/size.js +0 -17
- package/es/pro-table/summary.d.ts +0 -8
- package/es/pro-table/summary.js +0 -32
- package/es/pro-table/table.d.ts +0 -104
- package/es/pro-table/table.js +0 -712
- package/es/pro-table/tree.d.ts +0 -24
- package/es/pro-table/tree.js +0 -197
- package/es/pro-tabs/index.d.ts +0 -9
- package/es/pro-tabs/index.js +0 -174
- package/es/resize-observer.d.ts +0 -15
- package/es/resize-observer.js +0 -37
- package/es/result/icon.d.ts +0 -3
- package/es/result/icon.js +0 -3
- package/es/result/index.d.ts +0 -12
- package/es/result/index.js +0 -68
- package/es/select/ modal.d.ts +0 -10
- package/es/select/ modal.js +0 -141
- package/es/select/api.d.ts +0 -25
- package/es/select/api.js +0 -67
- package/es/select/customize.d.ts +0 -25
- package/es/select/customize.js +0 -139
- package/es/select/index.d.ts +0 -31
- package/es/select/index.js +0 -108
- package/es/status-tag/index.d.ts +0 -13
- package/es/status-tag/index.js +0 -31
- package/es/table/index.d.ts +0 -19
- package/es/table/index.js +0 -253
- package/es/table/index.less +0 -29
- package/es/theme-dialog.d.ts +0 -28
- package/es/theme-dialog.js +0 -81
- package/es/time-picker/index.d.ts +0 -15
- package/es/time-picker/index.js +0 -49
- package/es/trigger/index.d.ts +0 -43
- package/es/trigger/index.js +0 -298
- package/es/trigger/index.less +0 -42
- package/es/types.d.ts +0 -0
- package/es/types.js +0 -0
- package/es/upload/index.d.ts +0 -42
- package/es/upload/index.js +0 -167
- package/es/upload/upload-image.d.ts +0 -6
- package/es/upload/upload-image.js +0 -205
- package/es/virtual-list/index.d.ts +0 -51
- package/es/virtual-list/index.js +0 -132
- package/es/water-mark/index.d.ts +0 -65
- package/es/water-mark/index.js +0 -141
- package/es/water-mark/relative.d.ts +0 -62
- package/es/water-mark/relative.js +0 -130
package/es/ccs.d.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { ButtonProps, PaginationProps } from 'antd';
|
|
2
|
-
import { Rule } from 'antd/es/form';
|
|
3
|
-
import { NamePath } from 'antd/es/form/interface';
|
|
4
|
-
import { CSSProperties, MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
5
|
-
import { TableColumn } from './pro-table/table';
|
|
6
|
-
type MenuType = {
|
|
7
|
-
key: string;
|
|
8
|
-
/** 菜单名称 */
|
|
9
|
-
label: string;
|
|
10
|
-
/** 图标 */
|
|
11
|
-
icon?: string;
|
|
12
|
-
/** url地址 */
|
|
13
|
-
url?: string;
|
|
14
|
-
/** 菜单权限编码 */
|
|
15
|
-
btnAuth?: {
|
|
16
|
-
name: string;
|
|
17
|
-
code: string;
|
|
18
|
-
}[];
|
|
19
|
-
/** 下级菜单 */
|
|
20
|
-
children?: MenuType[];
|
|
21
|
-
};
|
|
22
|
-
type TableData<T> = {
|
|
23
|
-
/** loading */
|
|
24
|
-
loading?: boolean;
|
|
25
|
-
/** Array List 数据 */
|
|
26
|
-
dataSource?: T[];
|
|
27
|
-
} & PaginationProps;
|
|
28
|
-
type RecordType = Record<string, any>;
|
|
29
|
-
type RouteHistory = {
|
|
30
|
-
menuName: string;
|
|
31
|
-
pathName: string;
|
|
32
|
-
time: Date;
|
|
33
|
-
};
|
|
34
|
-
type TableDataType<T> = {
|
|
35
|
-
/** loading */
|
|
36
|
-
loading?: boolean;
|
|
37
|
-
/** 总条数 */
|
|
38
|
-
totalNum?: number;
|
|
39
|
-
/** 单页记录数 */
|
|
40
|
-
pageSize?: number;
|
|
41
|
-
/** 页码 */
|
|
42
|
-
pageNo?: number;
|
|
43
|
-
/** Array List 数据 */
|
|
44
|
-
result?: T[];
|
|
45
|
-
};
|
|
46
|
-
type TableInstance<T = any> = {
|
|
47
|
-
/** 获取当前表单数据 */
|
|
48
|
-
getFormValues: () => Promise<Record<string, any>>;
|
|
49
|
-
/** 获取当前表单数据 */
|
|
50
|
-
data: TableData<T>;
|
|
51
|
-
/** 查询数据,根据条件,从第一页开始显示 */
|
|
52
|
-
onSearch: () => void;
|
|
53
|
-
/** 刷新数据、根据条件,当前页 */
|
|
54
|
-
onReload: () => void;
|
|
55
|
-
/** 异步树、局部刷新方法 */
|
|
56
|
-
onPartialReload: (id: React.Key) => void;
|
|
57
|
-
/** 重置数据,清空选择 */
|
|
58
|
-
onReset: () => void;
|
|
59
|
-
/** 改变data 数据 */
|
|
60
|
-
onChangeData: React.Dispatch<React.SetStateAction<TableDataType<T>>>;
|
|
61
|
-
};
|
|
62
|
-
type AuthButtonItem = {
|
|
63
|
-
key: string;
|
|
64
|
-
/** 按钮名称 */
|
|
65
|
-
label: string;
|
|
66
|
-
/** 按钮权限 */
|
|
67
|
-
auth?: string;
|
|
68
|
-
/** 按钮类型 */
|
|
69
|
-
type?: ButtonProps['type'];
|
|
70
|
-
/** 按钮禁用 */
|
|
71
|
-
disabled?: boolean;
|
|
72
|
-
/** 按钮隐藏 */
|
|
73
|
-
hidden?: boolean;
|
|
74
|
-
/** 警告按钮 */
|
|
75
|
-
danger?: boolean;
|
|
76
|
-
/** 按钮图标 */
|
|
77
|
-
icon?: ReactNode;
|
|
78
|
-
/** 按钮操作确认消息 */
|
|
79
|
-
confirm?: string;
|
|
80
|
-
};
|
|
81
|
-
type TriggerChildrenProps<T = any> = {
|
|
82
|
-
/** 选中值 */
|
|
83
|
-
value?: T;
|
|
84
|
-
/** 选择框loading状态 */
|
|
85
|
-
onLoading?: (loading: boolean) => void;
|
|
86
|
-
/** 关闭弹框 */
|
|
87
|
-
onVisible?: (visible: boolean) => void;
|
|
88
|
-
/** 选中值改变事件 */
|
|
89
|
-
onChange?: ({}: T) => void;
|
|
90
|
-
/** 选择框显示名称 */
|
|
91
|
-
onChangeLabel?: (text: string | undefined) => void;
|
|
92
|
-
};
|
|
93
|
-
type ShowDependType = {
|
|
94
|
-
name: string;
|
|
95
|
-
value: any;
|
|
96
|
-
};
|
|
97
|
-
export type TableFormItem = {
|
|
98
|
-
/** label 标题 */
|
|
99
|
-
label?: string;
|
|
100
|
-
/** form name */
|
|
101
|
-
name?: NamePath;
|
|
102
|
-
/** form item element */
|
|
103
|
-
value: ReactElement;
|
|
104
|
-
/** 数据依赖、依赖项对应的name数组 */
|
|
105
|
-
depends?: string[];
|
|
106
|
-
/** 显示依赖 */
|
|
107
|
-
showDepends?: ShowDependType[];
|
|
108
|
-
/** 必填规则 */
|
|
109
|
-
rules?: Rule[];
|
|
110
|
-
/** 在发起请求时调用方法,格式化值 */
|
|
111
|
-
onFormat?: (e: any) => any;
|
|
112
|
-
/** 分组表单项,将解构name,生成独立的字段值,如时间范围选择,将数组结果解构成独立的字段值 */
|
|
113
|
-
isGroupItem?: boolean;
|
|
114
|
-
};
|
|
115
|
-
type TableFormItems = TableFormItem[];
|
|
116
|
-
type TableInstanceRef<T = any> = MutableRefObject<TableInstance<T> | undefined> | React.RefObject<TableInstance<T>>;
|
|
117
|
-
type TableColumns<RecordType = any> = TableColumn<RecordType>[];
|
|
118
|
-
type PropsWithCss = {
|
|
119
|
-
style?: CSSProperties;
|
|
120
|
-
className?: string;
|
|
121
|
-
};
|
|
122
|
-
type PropsWithNodeChildren = {
|
|
123
|
-
children?: ReactNode;
|
|
124
|
-
};
|
|
125
|
-
type PropsWithElementChildren = {
|
|
126
|
-
children?: ReactElement;
|
|
127
|
-
};
|
|
128
|
-
type PropsWithChildren<T> = T & {
|
|
129
|
-
children?: T[];
|
|
130
|
-
};
|
|
131
|
-
export type { AuthButtonItem, MenuType, PropsWithChildren, PropsWithCss, PropsWithElementChildren, PropsWithNodeChildren, RecordType, RouteHistory, TableColumns, TableData, TableFormItems, TableInstance, TableInstanceRef, TriggerChildrenProps, };
|
package/es/ccs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ColorPickerProps } from 'antd';
|
|
2
|
-
import './index.less';
|
|
3
|
-
declare function CcsColorPicker({ mode, children, onChange, ...otherProps }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace CcsColorPicker {
|
|
5
|
-
var displayName: string;
|
|
6
|
-
}
|
|
7
|
-
export default CcsColorPicker;
|
package/es/color-picker/index.js
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["mode", "children", "onChange"];
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
import { blue, cyan, gray, green, magenta, orange, presetPalettes, red } from '@ant-design/colors';
|
|
17
|
-
import { Col, ColorPicker, Divider, Row, Select } from 'antd';
|
|
18
|
-
import "./index.less";
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
-
function genPresets() {
|
|
23
|
-
var presets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : presetPalettes;
|
|
24
|
-
return Object.entries(presets).map(function (_ref) {
|
|
25
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
26
|
-
label = _ref2[0],
|
|
27
|
-
colors = _ref2[1];
|
|
28
|
-
return {
|
|
29
|
-
label: label,
|
|
30
|
-
colors: colors,
|
|
31
|
-
key: label
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
var presets = genPresets({
|
|
36
|
-
blue: blue,
|
|
37
|
-
red: red,
|
|
38
|
-
green: green,
|
|
39
|
-
cyan: cyan,
|
|
40
|
-
orange: orange,
|
|
41
|
-
magenta: magenta,
|
|
42
|
-
gray: gray
|
|
43
|
-
});
|
|
44
|
-
presets.forEach(function (f) {
|
|
45
|
-
f.colors = f.colors.slice(0, 6);
|
|
46
|
-
});
|
|
47
|
-
function CcsColorPicker(_ref3) {
|
|
48
|
-
var _ref3$mode = _ref3.mode,
|
|
49
|
-
mode = _ref3$mode === void 0 ? 'single' : _ref3$mode,
|
|
50
|
-
children = _ref3.children,
|
|
51
|
-
_onChange = _ref3.onChange,
|
|
52
|
-
otherProps = _objectWithoutProperties(_ref3, _excluded);
|
|
53
|
-
var renderValueStr = function renderValueStr() {
|
|
54
|
-
var value = otherProps.value;
|
|
55
|
-
if (typeof value === 'string') {
|
|
56
|
-
return value;
|
|
57
|
-
}
|
|
58
|
-
if (Array.isArray(value)) {
|
|
59
|
-
return "linear-gradient(".concat(value.map(function (s) {
|
|
60
|
-
return "".concat(s.color, " ").concat(s.percent, "%");
|
|
61
|
-
}).join(','), ")");
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var customPanelRender = function customPanelRender(_, _ref4) {
|
|
65
|
-
var _ref4$components = _ref4.components,
|
|
66
|
-
Picker = _ref4$components.Picker,
|
|
67
|
-
Presets = _ref4$components.Presets;
|
|
68
|
-
return /*#__PURE__*/_jsxs(Row, {
|
|
69
|
-
justify: "space-between",
|
|
70
|
-
wrap: false,
|
|
71
|
-
style: {
|
|
72
|
-
width: 420
|
|
73
|
-
},
|
|
74
|
-
children: [/*#__PURE__*/_jsx(Col, {
|
|
75
|
-
span: 12,
|
|
76
|
-
children: /*#__PURE__*/_jsx(Presets, {})
|
|
77
|
-
}), /*#__PURE__*/_jsx(Divider, {
|
|
78
|
-
type: "vertical",
|
|
79
|
-
style: {
|
|
80
|
-
height: 'auto'
|
|
81
|
-
}
|
|
82
|
-
}), /*#__PURE__*/_jsxs(Col, {
|
|
83
|
-
flex: "auto",
|
|
84
|
-
children: [/*#__PURE__*/_jsx(Picker, {}), /*#__PURE__*/_jsx("div", {
|
|
85
|
-
style: {
|
|
86
|
-
marginTop: 10,
|
|
87
|
-
color: 'rgba(0,0,0,0.65)'
|
|
88
|
-
},
|
|
89
|
-
children: renderValueStr()
|
|
90
|
-
})]
|
|
91
|
-
})]
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
var renderValue = function renderValue() {
|
|
95
|
-
if (!otherProps.value) {
|
|
96
|
-
return /*#__PURE__*/_jsx(Select, {
|
|
97
|
-
popupClassName: "ccs-color-picker-select",
|
|
98
|
-
placeholder: "\u8BF7\u9009\u62E9",
|
|
99
|
-
dropdownRender: function dropdownRender() {
|
|
100
|
-
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
return undefined;
|
|
105
|
-
};
|
|
106
|
-
return /*#__PURE__*/_jsx(ColorPicker, _objectSpread(_objectSpread({
|
|
107
|
-
className: "ccs-color-picker",
|
|
108
|
-
allowClear: true,
|
|
109
|
-
showText: true,
|
|
110
|
-
mode: mode,
|
|
111
|
-
onChange: function onChange(value, css) {
|
|
112
|
-
if (!_onChange) return;
|
|
113
|
-
var colors = value.getColors();
|
|
114
|
-
// 渐变色
|
|
115
|
-
if (colors.length > 1) {
|
|
116
|
-
var gradientColors = colors.map(function (c) {
|
|
117
|
-
return {
|
|
118
|
-
color: c.color.toRgbString(),
|
|
119
|
-
percent: c.percent
|
|
120
|
-
};
|
|
121
|
-
});
|
|
122
|
-
_onChange(gradientColors, css);
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (colors.length === 1) {
|
|
126
|
-
_onChange(value.toCssString(), css);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
onClear: function onClear() {
|
|
131
|
-
if (_onChange) _onChange(undefined, '');
|
|
132
|
-
},
|
|
133
|
-
presets: presets,
|
|
134
|
-
panelRender: customPanelRender
|
|
135
|
-
}, otherProps), {}, {
|
|
136
|
-
children: children || renderValue()
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
140
|
-
CcsColorPicker.displayName = 'CcsColorPicker';
|
|
141
|
-
}
|
|
142
|
-
export default CcsColorPicker;
|
package/es/config.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PropsWithElementChildren } from './ccs';
|
|
2
|
-
import { CssAppConfigType } from './context';
|
|
3
|
-
export declare function onDefaultFormat(data: any): any;
|
|
4
|
-
type AppConfigProps = PropsWithElementChildren & CssAppConfigType;
|
|
5
|
-
export default function CssAppConfig(props: AppConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
package/es/config.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["theme", "prefixCls"],
|
|
3
|
-
_excluded2 = ["token", "components"];
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import { darkTheme, defaultTheme } from '@ant-design/compatible';
|
|
18
|
-
import { theme as antTheme, App, ConfigProvider, message, Modal, notification } from 'antd';
|
|
19
|
-
import zhCN from 'antd/locale/zh_CN';
|
|
20
|
-
import { insertCss } from 'insert-css';
|
|
21
|
-
import React, { useEffect, useState } from 'react';
|
|
22
|
-
import { AppConfigContext } from "./context";
|
|
23
|
-
import { DialogElementsHolder } from "./dialog/hook";
|
|
24
|
-
import ThemeDialog from "./theme-dialog";
|
|
25
|
-
import WaterMarkRelative from "./water-mark/relative";
|
|
26
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
-
function AppDialog() {
|
|
30
|
-
var _message$useMessage = message.useMessage(),
|
|
31
|
-
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
32
|
-
messageApi = _message$useMessage2[0],
|
|
33
|
-
contextMsgHolder = _message$useMessage2[1];
|
|
34
|
-
var _notification$useNoti = notification.useNotification(),
|
|
35
|
-
_notification$useNoti2 = _slicedToArray(_notification$useNoti, 2),
|
|
36
|
-
noticeApi = _notification$useNoti2[0],
|
|
37
|
-
contextNotifHolder = _notification$useNoti2[1];
|
|
38
|
-
var _Modal$useModal = Modal.useModal(),
|
|
39
|
-
_Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
|
|
40
|
-
modalApi = _Modal$useModal2[0],
|
|
41
|
-
contextModalHolder = _Modal$useModal2[1];
|
|
42
|
-
useState(function () {
|
|
43
|
-
ThemeDialog.setConfig(messageApi, noticeApi, modalApi);
|
|
44
|
-
});
|
|
45
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
|
-
children: [contextMsgHolder, contextNotifHolder, contextModalHolder]
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
export function onDefaultFormat(data) {
|
|
50
|
-
return data;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** 主题设置 */
|
|
54
|
-
function AppConfig(_ref) {
|
|
55
|
-
var children = _ref.children,
|
|
56
|
-
_ref$theme = _ref.theme,
|
|
57
|
-
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
58
|
-
isCompact = _ref.isCompact,
|
|
59
|
-
watermark = _ref.watermark,
|
|
60
|
-
antConfig = _ref.antConfig,
|
|
61
|
-
fieldNames = _ref.fieldNames;
|
|
62
|
-
var dialogHolderRef = React.useRef(null);
|
|
63
|
-
// 主题
|
|
64
|
-
var appTheme = theme === 'dark' ? darkTheme : defaultTheme;
|
|
65
|
-
var _ref2 = antConfig || {},
|
|
66
|
-
themeConfig = _ref2.theme,
|
|
67
|
-
_ref2$prefixCls = _ref2.prefixCls,
|
|
68
|
-
prefixCls = _ref2$prefixCls === void 0 ? 'ant' : _ref2$prefixCls,
|
|
69
|
-
otherAntConfig = _objectWithoutProperties(_ref2, _excluded);
|
|
70
|
-
|
|
71
|
-
// 传入的配置参数
|
|
72
|
-
var _ref3 = themeConfig || {},
|
|
73
|
-
token = _ref3.token,
|
|
74
|
-
components = _ref3.components,
|
|
75
|
-
otherThemeConfig = _objectWithoutProperties(_ref3, _excluded2);
|
|
76
|
-
|
|
77
|
-
// 主题算法
|
|
78
|
-
var algorithm = function algorithm() {
|
|
79
|
-
var algorithms = theme === 'dark' ? [antTheme.darkAlgorithm] : [antTheme.defaultAlgorithm];
|
|
80
|
-
if (isCompact) {
|
|
81
|
-
algorithms.push(antTheme.compactAlgorithm);
|
|
82
|
-
}
|
|
83
|
-
return algorithms;
|
|
84
|
-
};
|
|
85
|
-
useEffect(function () {
|
|
86
|
-
var csss = [".".concat(prefixCls, "-drawer .").concat(prefixCls, "-drawer-extra >.").concat(prefixCls, "-btn+.").concat(prefixCls, "-btn {margin-inline-start: 8px;}"), ".ccs-dialog-drawer .".concat(prefixCls, "-drawer-footer{padding:0 !important;}"), ".ccs-tabs-auto-height > .".concat(prefixCls, "-tabs-content-holder,\n .ccs-tabs-auto-height > .").concat(prefixCls, "-tabs-content-holder > .").concat(prefixCls, "-tabs-content,\n .ccs-tabs-auto-height > .").concat(prefixCls, "-tabs-content-holder > .").concat(prefixCls, "-tabs-content > div,\n .ccs-tabs-auto-height> .").concat(prefixCls, "-tabs-content-holder> .").concat(prefixCls, "-tabs-content> div> .ccs-pl { height: 100%;}"), ".ccs-keep-alive-nav .".concat(prefixCls, "-tabs-tab {border: 0 !important;border-radius: 0 !important;}"), ".ccs-keep-alive-nav .".concat(prefixCls, "-tabs-tab-active {background-color: #f0f2f5 !important;}"), ".ccs-keep-alive .dark .ccs-keep-alive-nav .".concat(prefixCls, "-tabs-tab-active {background-color: #2b2c2c !important;} "), ".ccs-pl .".concat(prefixCls, "-table-title {padding: 0 !important;} ")];
|
|
87
|
-
insertCss(csss.join(''));
|
|
88
|
-
}, []);
|
|
89
|
-
|
|
90
|
-
// 合并token
|
|
91
|
-
var newToken = _objectSpread(_objectSpread({}, appTheme.token), token);
|
|
92
|
-
// 暗黑模式背景色
|
|
93
|
-
if (theme === 'dark') newToken.colorBgContainer = 'rgb(36, 37, 37)';
|
|
94
|
-
return /*#__PURE__*/_jsx(ConfigProvider, _objectSpread(_objectSpread({
|
|
95
|
-
locale: zhCN,
|
|
96
|
-
prefixCls: prefixCls
|
|
97
|
-
}, otherAntConfig), {}, {
|
|
98
|
-
theme: _objectSpread(_objectSpread(_objectSpread({}, appTheme), otherThemeConfig), {}, {
|
|
99
|
-
token: newToken,
|
|
100
|
-
components: _objectSpread(_objectSpread({}, appTheme.components), components),
|
|
101
|
-
algorithm: algorithm()
|
|
102
|
-
}),
|
|
103
|
-
children: /*#__PURE__*/_jsxs(AppConfigContext.Provider, {
|
|
104
|
-
value: {
|
|
105
|
-
theme: theme,
|
|
106
|
-
dialogHolderRef: dialogHolderRef,
|
|
107
|
-
fieldNames: fieldNames
|
|
108
|
-
},
|
|
109
|
-
children: [children, /*#__PURE__*/_jsx(AppDialog, {}), /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
110
|
-
ref: dialogHolderRef
|
|
111
|
-
}, "modal-drawer-holder"), (watermark === null || watermark === void 0 ? void 0 : watermark.content) && /*#__PURE__*/_jsx(WaterMarkRelative, {
|
|
112
|
-
content: watermark.content,
|
|
113
|
-
fontColor: "rgba(0,0,0,.15)",
|
|
114
|
-
zIndex: 105
|
|
115
|
-
})]
|
|
116
|
-
})
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
export default function CssAppConfig(props) {
|
|
120
|
-
return /*#__PURE__*/_jsx(App, {
|
|
121
|
-
style: {
|
|
122
|
-
height: '100%'
|
|
123
|
-
},
|
|
124
|
-
children: /*#__PURE__*/_jsx(AppConfig, _objectSpread({}, props))
|
|
125
|
-
});
|
|
126
|
-
}
|
package/es/context/index.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { ConfigProviderProps, TabPaneProps } from 'antd';
|
|
2
|
-
import { Store } from 'antd/es/form/interface';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Location } from 'react-router';
|
|
5
|
-
import CCS from '..';
|
|
6
|
-
import { ElementsHolderRef } from '../dialog/hook';
|
|
7
|
-
import { WaterMarkProps } from '../water-mark/relative';
|
|
8
|
-
type CcsTabsChangeProps = {
|
|
9
|
-
/** 当前激活tab面板的key */
|
|
10
|
-
activeKey?: string;
|
|
11
|
-
/** 启用tab keys */
|
|
12
|
-
enableKeys?: string[];
|
|
13
|
-
/** 禁用tab keys */
|
|
14
|
-
disableKeys?: string[];
|
|
15
|
-
/** tab间传递的参数 */
|
|
16
|
-
options?: CCS.RecordType;
|
|
17
|
-
};
|
|
18
|
-
export type CcsTabProps = Omit<TabPaneProps, 'tab'> & {
|
|
19
|
-
key: string;
|
|
20
|
-
label: React.ReactNode;
|
|
21
|
-
};
|
|
22
|
-
type CcsTabsContextType = {
|
|
23
|
-
/** dom id */
|
|
24
|
-
tabsId: string;
|
|
25
|
-
/** 当前激活tab面板的key */
|
|
26
|
-
activeKey: string;
|
|
27
|
-
/** tab间传递的参数 */
|
|
28
|
-
options: CCS.RecordType;
|
|
29
|
-
/** 添加tab */
|
|
30
|
-
onAddTabs: (tab: CcsTabProps | CcsTabProps[], activeKey?: string) => void;
|
|
31
|
-
/** 移除tab */
|
|
32
|
-
onRemoveTabs: (key: string | string[]) => void;
|
|
33
|
-
/** 改变tab间传递的参数 */
|
|
34
|
-
onTabChange: (tab: CcsTabsChangeProps) => void;
|
|
35
|
-
};
|
|
36
|
-
type PageContextType = {
|
|
37
|
-
/** ID */
|
|
38
|
-
id: string;
|
|
39
|
-
/** history Location */
|
|
40
|
-
location: Location;
|
|
41
|
-
/** 当前页面是否选中 */
|
|
42
|
-
isActive: boolean;
|
|
43
|
-
/** dialog holder */
|
|
44
|
-
dialogHolderRef: React.RefObject<ElementsHolderRef>;
|
|
45
|
-
/** 销毁页面 */
|
|
46
|
-
onDestroy: (path: string) => void;
|
|
47
|
-
/** 获取按钮权限 */
|
|
48
|
-
onAuth: (code: string) => boolean;
|
|
49
|
-
};
|
|
50
|
-
type FnContextType<T = Store> = {
|
|
51
|
-
locationKey: string;
|
|
52
|
-
formInitialValues: T;
|
|
53
|
-
close: () => void;
|
|
54
|
-
};
|
|
55
|
-
type CcsFieldNamesType = {
|
|
56
|
-
/** 数据源 */
|
|
57
|
-
dataSource?: string[];
|
|
58
|
-
/** 数据总条数 */
|
|
59
|
-
total?: string[];
|
|
60
|
-
/** 自定义接口请求属性对象,
|
|
61
|
-
* 默认配置
|
|
62
|
-
* { pageNo:['pageNo'],
|
|
63
|
-
* pageSize: ['pageSize'],
|
|
64
|
-
* filters':['filters'],
|
|
65
|
-
* orderProps: ['orderProps'],
|
|
66
|
-
* query: ['query'] }
|
|
67
|
-
* */
|
|
68
|
-
requestParam?: {
|
|
69
|
-
/** 页码 */
|
|
70
|
-
pageNo: string[];
|
|
71
|
-
/** 页记录数 */
|
|
72
|
-
pageSize: string[];
|
|
73
|
-
/** 查询条件 */
|
|
74
|
-
query?: string[];
|
|
75
|
-
/** 排序 */
|
|
76
|
-
orderProps?: string[];
|
|
77
|
-
/** 列过滤条件 */
|
|
78
|
-
filters?: string[];
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
type CcsDialogFieldNames = {
|
|
82
|
-
/** 成功标识字段 */
|
|
83
|
-
success?: string[];
|
|
84
|
-
/** 成功标识值 */
|
|
85
|
-
successTag?: any;
|
|
86
|
-
/** 错误信息提示 */
|
|
87
|
-
errorMsg?: string[];
|
|
88
|
-
};
|
|
89
|
-
type CssAppConfigType = {
|
|
90
|
-
/** 主题 */
|
|
91
|
-
theme?: 'dark' | 'light' | 'colorful';
|
|
92
|
-
/** 主题参数配置 */
|
|
93
|
-
antConfig?: ConfigProviderProps;
|
|
94
|
-
/** 紧凑模式 */
|
|
95
|
-
isCompact?: boolean;
|
|
96
|
-
/** 全局水印 */
|
|
97
|
-
watermark?: WaterMarkProps;
|
|
98
|
-
/** modal or drawer holder */
|
|
99
|
-
dialogHolderRef?: React.RefObject<ElementsHolderRef>;
|
|
100
|
-
/** 接口字段指定 */
|
|
101
|
-
fieldNames?: {
|
|
102
|
-
/** CcsProTable 组件字段全局指定 */
|
|
103
|
-
proTable?: CcsFieldNamesType;
|
|
104
|
-
/** CcsProTable.Tree 组件字段全局指定 */
|
|
105
|
-
proTableTree?: Pick<CcsFieldNamesType, 'dataSource'>;
|
|
106
|
-
/** dialog request 判定字段 */
|
|
107
|
-
dialog?: CcsDialogFieldNames;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
declare const DrawerAndModalContext: React.Context<FnContextType<any>>;
|
|
111
|
-
declare const PageContext: React.Context<PageContextType>;
|
|
112
|
-
declare const TabsContext: React.Context<CcsTabsContextType>;
|
|
113
|
-
declare const AppConfigContext: React.Context<CssAppConfigType>;
|
|
114
|
-
export { AppConfigContext, DrawerAndModalContext, PageContext, TabsContext };
|
|
115
|
-
export type { CcsFieldNamesType, CcsTabsChangeProps, CcsTabsContextType, CssAppConfigType, FnContextType, };
|
package/es/context/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { createContext } from 'react';
|
|
2
|
-
var DrawerAndModalContext = /*#__PURE__*/createContext({});
|
|
3
|
-
var PageContext = /*#__PURE__*/createContext({});
|
|
4
|
-
var TabsContext = /*#__PURE__*/React.createContext({});
|
|
5
|
-
var AppConfigContext = /*#__PURE__*/React.createContext({});
|
|
6
|
-
export { AppConfigContext, DrawerAndModalContext, PageContext, TabsContext };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DatePickerProps } from 'antd';
|
|
2
|
-
import { RangePickerProps } from 'antd/es/date-picker';
|
|
3
|
-
type CcsDatePickerProps = {
|
|
4
|
-
value?: string;
|
|
5
|
-
picker?: 'year' | 'month' | 'date';
|
|
6
|
-
onChange?: (e: string) => void;
|
|
7
|
-
} & Omit<DatePickerProps, 'value' | 'onChange' | 'picker'>;
|
|
8
|
-
type CcsRangePickerProps = {
|
|
9
|
-
showTime?: boolean;
|
|
10
|
-
value?: [string, string];
|
|
11
|
-
picker?: 'year' | 'month' | 'date';
|
|
12
|
-
onChange?: (e: [string, string]) => void;
|
|
13
|
-
} & Omit<RangePickerProps, 'value' | 'onChange'>;
|
|
14
|
-
declare function CcsDatePicker({ value, onChange, ...restProps }: CcsDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare namespace CcsDatePicker {
|
|
16
|
-
var RangePicker: ({ value, onChange, ...restProps }: CcsRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
var displayName: string;
|
|
18
|
-
}
|
|
19
|
-
export default CcsDatePicker;
|
package/es/date-picker/index.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["value", "onChange"],
|
|
3
|
-
_excluded2 = ["value", "onChange"];
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
import { DatePicker } from 'antd';
|
|
12
|
-
import dayjs from 'dayjs';
|
|
13
|
-
import _isArray from 'lodash.isarray';
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
var rangePresets = [{
|
|
16
|
-
label: '今天',
|
|
17
|
-
value: [dayjs().startOf('day'), dayjs().endOf('day')]
|
|
18
|
-
}, {
|
|
19
|
-
label: '最近3天',
|
|
20
|
-
value: [dayjs().add(-3, 'd'), dayjs()]
|
|
21
|
-
}, {
|
|
22
|
-
label: '最近7天',
|
|
23
|
-
value: [dayjs().add(-7, 'd'), dayjs()]
|
|
24
|
-
}, {
|
|
25
|
-
label: '最近14天',
|
|
26
|
-
value: [dayjs().add(-14, 'd'), dayjs()]
|
|
27
|
-
}, {
|
|
28
|
-
label: '最近30天',
|
|
29
|
-
value: [dayjs().add(-30, 'd'), dayjs()]
|
|
30
|
-
}, {
|
|
31
|
-
label: '最近90天',
|
|
32
|
-
value: [dayjs().add(-90, 'd'), dayjs()]
|
|
33
|
-
}];
|
|
34
|
-
function CcsDatePicker(_ref) {
|
|
35
|
-
var value = _ref.value,
|
|
36
|
-
onChange = _ref.onChange,
|
|
37
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
-
var handleOnChange = function handleOnChange(_, dateString) {
|
|
39
|
-
if (onChange) onChange(dateString || undefined);
|
|
40
|
-
};
|
|
41
|
-
var dateValue = typeof value === 'string' ? dayjs(value) : value;
|
|
42
|
-
return /*#__PURE__*/_jsx(DatePicker, _objectSpread({
|
|
43
|
-
value: dateValue,
|
|
44
|
-
onChange: handleOnChange
|
|
45
|
-
}, restProps));
|
|
46
|
-
}
|
|
47
|
-
function RangePicker(_ref2) {
|
|
48
|
-
var value = _ref2.value,
|
|
49
|
-
onChange = _ref2.onChange,
|
|
50
|
-
restProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
51
|
-
var getDateValue = function getDateValue() {
|
|
52
|
-
if (_isArray(value)) {
|
|
53
|
-
var st = value[0] ? dayjs(value[0]) : undefined;
|
|
54
|
-
var et = value[1] ? dayjs(value[1]) : undefined;
|
|
55
|
-
return [st, et];
|
|
56
|
-
}
|
|
57
|
-
return null;
|
|
58
|
-
};
|
|
59
|
-
var handleOnChange = function handleOnChange(_, dateString) {
|
|
60
|
-
if (onChange) onChange(dateString || undefined);
|
|
61
|
-
};
|
|
62
|
-
return /*#__PURE__*/_jsx(DatePicker.RangePicker, _objectSpread({
|
|
63
|
-
presets: restProps.picker === 'date' || !restProps.picker ? rangePresets : undefined,
|
|
64
|
-
value: getDateValue(),
|
|
65
|
-
onChange: handleOnChange
|
|
66
|
-
}, restProps));
|
|
67
|
-
}
|
|
68
|
-
CcsDatePicker.RangePicker = RangePicker;
|
|
69
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
70
|
-
CcsDatePicker.displayName = 'CcsDatePicker';
|
|
71
|
-
}
|
|
72
|
-
export default CcsDatePicker;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CcsDialogDrawer, CcsDialogDrawerProps } from './hook';
|
|
2
|
-
export type HookDrawerProps<TParams, TData> = {
|
|
3
|
-
afterClose: () => void;
|
|
4
|
-
config: CcsDialogDrawerProps<TParams, TData>;
|
|
5
|
-
};
|
|
6
|
-
declare const HookDrawer: <TParams, TData>(props: HookDrawerProps<TParams, TData> & {
|
|
7
|
-
dialogRef: React.RefObject<CcsDialogDrawer>;
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default HookDrawer;
|