@ccs-ui/rc-pro 1.1.1-rc8 → 1.1.2
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/auth/auth-button.js +2 -3
- package/es/auth/auth-dropdown.js +16 -12
- package/es/auth/index.d.ts +2 -12
- package/es/auth/index.js +3 -5
- package/es/cascader/index.d.ts +3 -3
- package/es/cascader/index.js +3 -3
- package/es/ccs.d.ts +207 -25
- package/es/ccs.js +1 -79
- package/es/color-picker/index.js +30 -26
- package/es/context/index.d.ts +5 -5
- package/es/date-picker/index.js +9 -3
- package/es/dialog/HookDrawer.js +24 -8
- package/es/dialog/HookModal.d.ts +4 -0
- package/es/dialog/HookModal.js +93 -29
- package/es/dialog/button.d.ts +6 -2
- package/es/dialog/button.js +45 -13
- package/es/dialog/context.d.ts +8 -2
- package/es/dialog/drawer-footer.d.ts +12 -0
- package/es/dialog/drawer-footer.js +62 -0
- package/es/dialog/form.d.ts +7 -4
- package/es/dialog/form.js +9 -2
- package/es/dialog/hook.d.ts +9 -2
- package/es/dialog/hook.js +16 -4
- package/es/dialog/index.d.ts +9 -2
- package/es/dialog/index.js +4 -1
- package/es/dialog/index.less +12 -15
- package/es/hooks/use-global.d.ts +1 -1
- package/es/index.d.ts +3 -133
- package/es/index.js +4 -4
- package/es/interval-button/index.js +12 -6
- package/es/keep-alive-tabs/index.d.ts +4 -3
- package/es/keep-alive-tabs/index.js +5 -10
- package/es/keep-alive-tabs/page.d.ts +2 -2
- package/es/keep-alive-tabs/page.js +20 -16
- package/es/pro-grid/index.d.ts +0 -1
- package/es/pro-grid/index.js +51 -39
- package/es/pro-table/index.d.ts +11 -57
- package/es/pro-table/index.js +13 -13
- package/es/pro-table/index.less +17 -9
- package/es/pro-table/search.d.ts +5 -2
- package/es/pro-table/search.js +32 -9
- package/es/pro-table/tree.d.ts +5 -5
- package/es/pro-table/tree.js +1 -2
- package/es/pro-tabs/index.d.ts +0 -1
- package/es/pro-tabs/index.js +25 -8
- package/es/select/index.d.ts +3 -3
- package/es/select/index.js +3 -3
- package/es/theme-dialog.d.ts +24 -0
- package/es/theme-dialog.js +70 -0
- package/es/theme.d.ts +17 -0
- package/es/theme.js +66 -0
- package/es/time-picker/index.js +10 -4
- package/es/trigger/index.d.ts +0 -12
- package/es/trigger/index.js +78 -68
- package/es/upload/index.js +16 -7
- package/es/utils/index.d.ts +0 -15
- package/es/utils/index.js +3 -47
- package/es/virtual-list/index.js +34 -29
- package/es/water-mark/index.js +20 -17
- package/package.json +3 -1
- package/es/drawer.zip +0 -0
- package/es/modal.zip +0 -0
- package/es/pro-tabs/index.less +0 -5
package/es/dialog/index.less
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
.
|
|
2
|
-
position: absolute;
|
|
3
|
-
bottom: 0;
|
|
4
|
-
right: 0;
|
|
5
|
-
z-index: 1;
|
|
6
|
-
|
|
1
|
+
.ant-drawer-extra {
|
|
7
2
|
.ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
|
|
8
3
|
margin-bottom: 0;
|
|
9
|
-
margin-
|
|
4
|
+
margin-inline-start: 8px;
|
|
10
5
|
}
|
|
11
6
|
}
|
|
12
7
|
|
|
8
|
+
.ant-drawer-footer {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
13
12
|
.ccs-dialog-drawer {
|
|
14
|
-
.
|
|
15
|
-
|
|
16
|
-
top: 0;
|
|
17
|
-
bottom: auto;
|
|
18
|
-
height: 57px;
|
|
19
|
-
line-height: 56px;
|
|
13
|
+
.ant-drawer-footer {
|
|
14
|
+
padding: 0;
|
|
20
15
|
}
|
|
16
|
+
}
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
.ccs-dialog-modal {
|
|
19
|
+
.ant-modal-footer {
|
|
20
|
+
padding: 0;
|
|
24
21
|
}
|
|
25
22
|
}
|
package/es/hooks/use-global.d.ts
CHANGED
package/es/index.d.ts
CHANGED
|
@@ -1,137 +1,5 @@
|
|
|
1
|
-
import { MenuProps } from 'antd';
|
|
2
|
-
import { ConfigProviderProps } from 'antd/lib/config-provider';
|
|
3
|
-
type ReactText = 'string' | 'number';
|
|
4
|
-
interface MenuTreeNodeData {
|
|
5
|
-
buttonUrlId: number;
|
|
6
|
-
createTime: string;
|
|
7
|
-
icon?: string;
|
|
8
|
-
menuCode: string;
|
|
9
|
-
menuDesc: string;
|
|
10
|
-
menuName: string;
|
|
11
|
-
menuType: number;
|
|
12
|
-
menuUrl: string;
|
|
13
|
-
parentMenuCode: string;
|
|
14
|
-
sortId: number;
|
|
15
|
-
state: number;
|
|
16
|
-
updateTime: string;
|
|
17
|
-
urlName: string;
|
|
18
|
-
urlPath: string;
|
|
19
|
-
}
|
|
20
|
-
interface MenuParentType {
|
|
21
|
-
key: string;
|
|
22
|
-
url: string;
|
|
23
|
-
name: string;
|
|
24
|
-
}
|
|
25
|
-
interface MenuTreeNode {
|
|
26
|
-
nodeId: string;
|
|
27
|
-
nodeName: string;
|
|
28
|
-
icon: string;
|
|
29
|
-
leaf: boolean;
|
|
30
|
-
nodeData: MenuTreeNodeData;
|
|
31
|
-
children?: MenuTreeNode[];
|
|
32
|
-
topUrl?: string;
|
|
33
|
-
parents?: MenuParentType[];
|
|
34
|
-
}
|
|
35
|
-
interface CcsUserDetailType {
|
|
36
|
-
/** 头像 */
|
|
37
|
-
avatar?: string;
|
|
38
|
-
/** 用户名 */
|
|
39
|
-
workerName: string;
|
|
40
|
-
}
|
|
41
|
-
export interface CcsGlobalConfigType {
|
|
42
|
-
/** app名称 */
|
|
43
|
-
AppName: string;
|
|
44
|
-
/** 主题色 */
|
|
45
|
-
BrandPrimary: string;
|
|
46
|
-
/** 菜单展开宽度 */
|
|
47
|
-
MenuExpandWidth: number;
|
|
48
|
-
/** 菜单收起宽度 */
|
|
49
|
-
MenuCollapsedWidth: number;
|
|
50
|
-
/** 启用tabs缓存页面 */
|
|
51
|
-
IsTabsPage: boolean;
|
|
52
|
-
/** 启用按钮权限 */
|
|
53
|
-
IsAuthButton: boolean;
|
|
54
|
-
/** ant 主题 */
|
|
55
|
-
theme: ConfigProviderProps['theme'];
|
|
56
|
-
/** 菜单类型,现在支持垂直、水平、和内嵌模式三种 */
|
|
57
|
-
MenuExpandMode: MenuProps['mode'];
|
|
58
|
-
/** 菜单始终收起状态? */
|
|
59
|
-
MenuCollapsed?: boolean;
|
|
60
|
-
/** 接口名称统一前缀 */
|
|
61
|
-
Api: string;
|
|
62
|
-
/** url上下文名称 */
|
|
63
|
-
Context: string;
|
|
64
|
-
/** 样式前缀 */
|
|
65
|
-
classPrefix?: string;
|
|
66
|
-
}
|
|
67
|
-
interface TableDataType<T> {
|
|
68
|
-
/** loading */
|
|
69
|
-
loading?: boolean;
|
|
70
|
-
/** 总条数 */
|
|
71
|
-
totalNum?: number;
|
|
72
|
-
/** 单页记录数 */
|
|
73
|
-
pageSize?: number;
|
|
74
|
-
/** 页码 */
|
|
75
|
-
pageNo?: number;
|
|
76
|
-
/** Array List 数据 */
|
|
77
|
-
result?: T[];
|
|
78
|
-
}
|
|
79
|
-
interface HttpResult<T = any> {
|
|
80
|
-
code: string;
|
|
81
|
-
success: boolean;
|
|
82
|
-
data: T;
|
|
83
|
-
msg: string;
|
|
84
|
-
}
|
|
85
|
-
interface PageType<T> {
|
|
86
|
-
hasNext: boolean;
|
|
87
|
-
totalNum: number;
|
|
88
|
-
pageNo: number;
|
|
89
|
-
pageSize: number;
|
|
90
|
-
result: T[];
|
|
91
|
-
}
|
|
92
|
-
interface HttpPageResult<T = any> extends Omit<HttpResult<T>, 'data'> {
|
|
93
|
-
data: PageType<T>;
|
|
94
|
-
}
|
|
95
|
-
interface HttpListResult<T = any> extends Omit<HttpResult<T>, 'data'> {
|
|
96
|
-
data: T[];
|
|
97
|
-
}
|
|
98
|
-
interface OrderProp {
|
|
99
|
-
ascending: boolean;
|
|
100
|
-
prop: string;
|
|
101
|
-
}
|
|
102
|
-
interface QueryLimit {
|
|
103
|
-
fetchSize: number;
|
|
104
|
-
startIndex: number;
|
|
105
|
-
}
|
|
106
|
-
interface PageQueryType<T = any> {
|
|
107
|
-
/** 查询的开始行数和取多少行,从0开始 */
|
|
108
|
-
limit?: QueryLimit;
|
|
109
|
-
/** 排序字段,一般前端不传,由后端指定 */
|
|
110
|
-
orderProps?: OrderProp[];
|
|
111
|
-
/** 页码 */
|
|
112
|
-
pageNo?: number;
|
|
113
|
-
/** 页长 */
|
|
114
|
-
pageSize?: number;
|
|
115
|
-
/** 查询条件 */
|
|
116
|
-
query: T;
|
|
117
|
-
}
|
|
118
|
-
interface ListQueryType<T = any> {
|
|
119
|
-
/** 查询的开始行数和取多少行,从0开始 */
|
|
120
|
-
limit?: QueryLimit;
|
|
121
|
-
/** 排序字段,一般前端不传,由后端指定 */
|
|
122
|
-
orderProps?: OrderProp[];
|
|
123
|
-
/** 查询条件 */
|
|
124
|
-
query: T;
|
|
125
|
-
}
|
|
126
|
-
type RecordType = Record<string, any>;
|
|
127
|
-
interface RouteHistoryType {
|
|
128
|
-
menuName: string;
|
|
129
|
-
pathName: string;
|
|
130
|
-
time: Date;
|
|
131
|
-
}
|
|
132
1
|
export { default as CcsAuth } from './auth';
|
|
133
2
|
export { default as CcsApiCascader } from './cascader';
|
|
134
|
-
export { default as CCS } from './ccs';
|
|
135
3
|
export { default as CcsColorPicker } from './color-picker';
|
|
136
4
|
export { default as CcsConfigProvider } from './config';
|
|
137
5
|
export { default as CcsDatePicker } from './date-picker';
|
|
@@ -151,10 +19,12 @@ export { default as CcsProTabs } from './pro-tabs';
|
|
|
151
19
|
export { default as CcsApiSelect } from './select';
|
|
152
20
|
export { default as CcsStatusTag } from './status-tag';
|
|
153
21
|
export { default as CcsTable } from './table';
|
|
22
|
+
export { default as CcsAppTheme } from './theme';
|
|
154
23
|
export { default as CcsTimePicker } from './time-picker';
|
|
155
24
|
export { default as CcsTrigger } from './trigger';
|
|
156
25
|
export { default as CcsUpload } from './upload';
|
|
157
26
|
export { default as CcsUtils } from './utils';
|
|
158
27
|
export { default as CcsVirtualList } from './virtual-list';
|
|
159
28
|
export { default as CcsWaterMark } from './water-mark';
|
|
160
|
-
|
|
29
|
+
import * as CCS from './ccs';
|
|
30
|
+
export default CCS;
|
package/es/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// any param
|
|
2
|
-
|
|
3
1
|
export { default as CcsAuth } from "./auth";
|
|
4
2
|
export { default as CcsApiCascader } from "./cascader";
|
|
5
|
-
export { default as CCS } from "./ccs";
|
|
6
3
|
export { default as CcsColorPicker } from "./color-picker";
|
|
7
4
|
export { default as CcsConfigProvider } from "./config";
|
|
8
5
|
export { default as CcsDatePicker } from "./date-picker";
|
|
@@ -22,9 +19,12 @@ export { default as CcsProTabs } from "./pro-tabs";
|
|
|
22
19
|
export { default as CcsApiSelect } from "./select";
|
|
23
20
|
export { default as CcsStatusTag } from "./status-tag";
|
|
24
21
|
export { default as CcsTable } from "./table";
|
|
22
|
+
export { default as CcsAppTheme } from "./theme";
|
|
25
23
|
export { default as CcsTimePicker } from "./time-picker";
|
|
26
24
|
export { default as CcsTrigger } from "./trigger";
|
|
27
25
|
export { default as CcsUpload } from "./upload";
|
|
28
26
|
export { default as CcsUtils } from "./utils";
|
|
29
27
|
export { default as CcsVirtualList } from "./virtual-list";
|
|
30
|
-
export { default as CcsWaterMark } from "./water-mark";
|
|
28
|
+
export { default as CcsWaterMark } from "./water-mark";
|
|
29
|
+
import * as CCS from "./ccs";
|
|
30
|
+
export default CCS;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["num", "cacheKey", "disabledText", "children"];
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
8
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
5
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -14,8 +18,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
14
18
|
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; }
|
|
15
19
|
import { useInterval } from 'ahooks';
|
|
16
20
|
import { Button } from 'antd';
|
|
17
|
-
import
|
|
21
|
+
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
18
22
|
import { CcsUtils } from "../";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
24
|
/**
|
|
20
25
|
* 倒计时按钮组件
|
|
21
26
|
* @param PropsType
|
|
@@ -103,11 +108,12 @@ function IntervalButton(_ref) {
|
|
|
103
108
|
});
|
|
104
109
|
}
|
|
105
110
|
};
|
|
106
|
-
return count === -1 ? null : /*#__PURE__*/
|
|
111
|
+
return count === -1 ? null : /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
107
112
|
type: "primary"
|
|
108
|
-
}, restProps, {
|
|
113
|
+
}, restProps), {}, {
|
|
109
114
|
onClick: onStart,
|
|
110
|
-
disabled: restProps.disabled ? true : disabled
|
|
111
|
-
|
|
115
|
+
disabled: restProps.disabled ? true : disabled,
|
|
116
|
+
children: disabled ? "".concat(count, "\u79D2").concat(disabledText) : "".concat(children)
|
|
117
|
+
}));
|
|
112
118
|
}
|
|
113
119
|
export default IntervalButton;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import CCS from '../';
|
|
2
2
|
import './index.less';
|
|
3
3
|
interface PropsType {
|
|
4
4
|
maxLen?: number;
|
|
5
|
-
|
|
5
|
+
appName: string;
|
|
6
|
+
menus: CCS.MenuTreeNode[];
|
|
6
7
|
className?: string;
|
|
7
8
|
history: any;
|
|
8
9
|
}
|
|
9
|
-
declare const _default: ({ maxLen, history, menus, className }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const _default: ({ maxLen, appName, history, menus, className, }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default _default;
|
|
@@ -17,7 +17,7 @@ import ResizeObserver from 'rc-resize-observer';
|
|
|
17
17
|
import { useEffect, useMemo, useRef } from 'react';
|
|
18
18
|
import { useLocation } from 'react-router';
|
|
19
19
|
import { useOutlet } from 'react-router-dom';
|
|
20
|
-
import {
|
|
20
|
+
import { CcsUtils } from "../";
|
|
21
21
|
import "./index.less";
|
|
22
22
|
import Page from "./page";
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -33,6 +33,7 @@ var RouteHistorys = [];
|
|
|
33
33
|
export default (function (_ref) {
|
|
34
34
|
var _ref$maxLen = _ref.maxLen,
|
|
35
35
|
maxLen = _ref$maxLen === void 0 ? 10 : _ref$maxLen,
|
|
36
|
+
appName = _ref.appName,
|
|
36
37
|
history = _ref.history,
|
|
37
38
|
_ref$menus = _ref.menus,
|
|
38
39
|
menus = _ref$menus === void 0 ? [] : _ref$menus,
|
|
@@ -43,9 +44,6 @@ export default (function (_ref) {
|
|
|
43
44
|
locationKey = location.key;
|
|
44
45
|
var outlet = useOutlet();
|
|
45
46
|
var update = useUpdate();
|
|
46
|
-
var _CCS$GlobalConfig = CCS.GlobalConfig,
|
|
47
|
-
classPrefix = _CCS$GlobalConfig.classPrefix,
|
|
48
|
-
AppName = _CCS$GlobalConfig.AppName;
|
|
49
47
|
|
|
50
48
|
// 超过缓存数量,删除第一个
|
|
51
49
|
if (components.current.length >= maxLen) {
|
|
@@ -79,7 +77,7 @@ export default (function (_ref) {
|
|
|
79
77
|
|
|
80
78
|
// add document title
|
|
81
79
|
setTimeout(function () {
|
|
82
|
-
document.title = "".concat(
|
|
80
|
+
document.title = "".concat(appName, " - ").concat((menu === null || menu === void 0 ? void 0 : menu.nodeName) || (menu === null || menu === void 0 ? void 0 : menu.nodeData.menuUrl));
|
|
83
81
|
}, 10);
|
|
84
82
|
|
|
85
83
|
// save history route
|
|
@@ -148,9 +146,6 @@ export default (function (_ref) {
|
|
|
148
146
|
}),
|
|
149
147
|
urlAuthList: urlAuthList
|
|
150
148
|
}]);
|
|
151
|
-
|
|
152
|
-
// button auth
|
|
153
|
-
CCS.setAuthList(locationKey, urlAuthList);
|
|
154
149
|
}
|
|
155
150
|
|
|
156
151
|
// 页面主动销毁或关闭tab
|
|
@@ -218,7 +213,7 @@ export default (function (_ref) {
|
|
|
218
213
|
resizeFn(size.width);
|
|
219
214
|
};
|
|
220
215
|
return /*#__PURE__*/_jsxs("div", {
|
|
221
|
-
className: classnames(className, "
|
|
216
|
+
className: classnames(className, "ccs-keep-alive"),
|
|
222
217
|
children: [/*#__PURE__*/_jsx(ResizeObserver, {
|
|
223
218
|
onResize: onResize,
|
|
224
219
|
children: /*#__PURE__*/_jsx("div", {})
|
|
@@ -229,7 +224,7 @@ export default (function (_ref) {
|
|
|
229
224
|
onChange: function onChange(e) {
|
|
230
225
|
history.push(e);
|
|
231
226
|
},
|
|
232
|
-
className: "
|
|
227
|
+
className: "ccs-keep-alive-tabs",
|
|
233
228
|
activeKey: pathname,
|
|
234
229
|
type: "editable-card",
|
|
235
230
|
onEdit: function onEdit(e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Location } from 'history';
|
|
2
|
-
import
|
|
2
|
+
import { JSXElementConstructor, ReactElement } from 'react';
|
|
3
3
|
export interface CachePageProps {
|
|
4
4
|
/** 选中状态 */
|
|
5
5
|
active: boolean;
|
|
@@ -13,5 +13,5 @@ export interface CachePageProps {
|
|
|
13
13
|
/** 销毁页面 */
|
|
14
14
|
onDestroy: (path: string) => void;
|
|
15
15
|
}
|
|
16
|
-
declare const _default:
|
|
16
|
+
declare const _default: import("react").MemoExoticComponent<(props: CachePageProps) => import("react/jsx-runtime").JSX.Element>;
|
|
17
17
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { memo, useRef } from 'react';
|
|
2
2
|
import Scrollbars from 'react-custom-scrollbars';
|
|
3
3
|
import { PageContext } from "../context";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export default /*#__PURE__*/memo(function (props) {
|
|
5
6
|
var locationRef = useRef(props.location);
|
|
6
7
|
var children = props.children,
|
|
@@ -8,7 +9,7 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
8
9
|
urlAuthList = props.urlAuthList,
|
|
9
10
|
onDestroy = props.onDestroy;
|
|
10
11
|
var id = "_tab_content_".concat(locationRef.current.key);
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
+
return /*#__PURE__*/_jsx(PageContext.Provider, {
|
|
12
13
|
value: {
|
|
13
14
|
id: id,
|
|
14
15
|
isActive: active,
|
|
@@ -17,21 +18,24 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
17
18
|
onAuth: function onAuth(e) {
|
|
18
19
|
return urlAuthList.includes(e);
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
style: {
|
|
23
|
-
flex: '1 1 auto',
|
|
24
|
-
display: active ? 'block' : 'none',
|
|
25
|
-
position: 'relative'
|
|
26
21
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
23
|
+
style: {
|
|
24
|
+
flex: '1 1 auto',
|
|
25
|
+
display: active ? 'block' : 'none',
|
|
26
|
+
position: 'relative'
|
|
27
|
+
},
|
|
28
|
+
id: id,
|
|
29
|
+
"data-display": active,
|
|
30
|
+
children: /*#__PURE__*/_jsx(Scrollbars, {
|
|
31
|
+
style: {
|
|
32
|
+
display: active ? 'block' : 'none'
|
|
33
|
+
},
|
|
34
|
+
autoHide: true,
|
|
35
|
+
children: children
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
});
|
|
35
39
|
}, function (l, n) {
|
|
36
40
|
return l.active === n.active && l.timestamp === n.timestamp;
|
|
37
41
|
});
|
package/es/pro-grid/index.d.ts
CHANGED
package/es/pro-grid/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["colSpan", "colClassName", "colStyle"],
|
|
3
|
-
_excluded2 = ["title", "
|
|
4
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
_excluded2 = ["title", "titleExtra", "hideTitle", "bordered", "children"];
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
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; }
|
|
@@ -11,60 +10,73 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
11
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; }
|
|
12
11
|
import { Card } from 'antd';
|
|
13
12
|
import classNames from 'classnames';
|
|
14
|
-
import React from 'react';
|
|
15
13
|
import { GridContext } from "./context";
|
|
16
14
|
import "./index.less";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
var GridCol = function GridCol(_ref) {
|
|
18
19
|
var colSpan = _ref.colSpan,
|
|
19
20
|
colClassName = _ref.colClassName,
|
|
20
21
|
colStyle = _ref.colStyle,
|
|
21
22
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
24
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
25
|
+
className: classNames('ccs-pg-col', colClassName),
|
|
26
|
+
style: colSpan ? _objectSpread({
|
|
27
|
+
width: colSpan,
|
|
28
|
+
flexShrink: 0
|
|
29
|
+
}, colStyle) : _objectSpread({
|
|
30
|
+
display: 'flex',
|
|
31
|
+
width: 0,
|
|
32
|
+
flex: 'auto',
|
|
33
|
+
flexDirection: 'column'
|
|
34
|
+
}, colStyle),
|
|
35
|
+
children: /*#__PURE__*/_jsx(Card, _objectSpread({
|
|
36
|
+
bodyStyle: {
|
|
37
|
+
padding: 0
|
|
38
|
+
}
|
|
39
|
+
}, otherProps))
|
|
40
|
+
})
|
|
41
|
+
});
|
|
34
42
|
};
|
|
35
43
|
var Grid = function Grid(_ref2) {
|
|
36
44
|
var title = _ref2.title,
|
|
37
|
-
_ref2$titleStyle = _ref2.titleStyle,
|
|
38
|
-
titleStyle = _ref2$titleStyle === void 0 ? {} : _ref2$titleStyle,
|
|
39
45
|
titleExtra = _ref2.titleExtra,
|
|
40
46
|
hideTitle = _ref2.hideTitle,
|
|
41
47
|
bordered = _ref2.bordered,
|
|
42
48
|
children = _ref2.children,
|
|
43
49
|
restProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
44
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/_jsx(GridContext.Provider, {
|
|
45
51
|
value: {
|
|
46
52
|
inProGrid: true
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
},
|
|
54
|
+
children: /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, restProps), {}, {
|
|
55
|
+
className: classNames({
|
|
56
|
+
'ccs-pg-border': bordered
|
|
57
|
+
}),
|
|
58
|
+
children: [!hideTitle && title ? /*#__PURE__*/_jsx(Card, {
|
|
59
|
+
title: title,
|
|
60
|
+
extra: titleExtra,
|
|
61
|
+
bordered: false,
|
|
62
|
+
style: {
|
|
63
|
+
borderRadius: 0
|
|
64
|
+
},
|
|
65
|
+
bodyStyle: {
|
|
66
|
+
padding: 0
|
|
67
|
+
}
|
|
68
|
+
}) : null, /*#__PURE__*/_jsx("div", {
|
|
69
|
+
className: "ccs-pl-table-content",
|
|
70
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
71
|
+
style: {
|
|
72
|
+
display: 'flex',
|
|
73
|
+
padding: 10
|
|
74
|
+
},
|
|
75
|
+
children: children
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
}))
|
|
79
|
+
});
|
|
68
80
|
};
|
|
69
81
|
var ProGrid = Grid;
|
|
70
82
|
ProGrid.Col = GridCol;
|