@ccs-ui/rc-pro 2.3.3-beta-10 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/breadcrumb.d.ts +8 -0
- package/es/breadcrumb.js +37 -0
- package/es/button/group.js +2 -2
- package/es/ccs.d.ts +2 -2
- package/es/dialog/button.d.ts +1 -1
- package/es/layout-keep-alive/index.js +6 -1
- package/es/layout-keep-alive/page.d.ts +4 -2
- package/es/layout-keep-alive/page.js +2 -6
- package/es/layout-single-page/index.js +6 -1
- package/es/layout-single-page/page.d.ts +4 -2
- package/es/layout-single-page/page.js +2 -7
- package/es/pro-table/table.js +49 -17
- package/es/upload/index.d.ts +8 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BreadcrumbProps } from 'antd/lib';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
export default function CcsBreadcrumb({ items, style, className, history, }: {
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
className?: string;
|
|
6
|
+
history: any;
|
|
7
|
+
items: BreadcrumbProps['items'];
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/es/breadcrumb.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Space } from 'antd';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export default function CcsBreadcrumb(_ref) {
|
|
6
|
+
var _ref$items = _ref.items,
|
|
7
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
8
|
+
style = _ref.style,
|
|
9
|
+
className = _ref.className,
|
|
10
|
+
history = _ref.history;
|
|
11
|
+
var _onClick = function onClick(href) {
|
|
12
|
+
if (!href || !history) return;
|
|
13
|
+
history.push(href);
|
|
14
|
+
};
|
|
15
|
+
return /*#__PURE__*/_jsx(Space, {
|
|
16
|
+
className: className,
|
|
17
|
+
style: style,
|
|
18
|
+
children: items.map(function (item, index) {
|
|
19
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
20
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
21
|
+
style: item.href ? {
|
|
22
|
+
color: 'rgba(0, 0, 0, 0.45)'
|
|
23
|
+
} : {},
|
|
24
|
+
onClick: function onClick() {
|
|
25
|
+
return _onClick(item.href);
|
|
26
|
+
},
|
|
27
|
+
children: item.title
|
|
28
|
+
}, index), index !== items.length - 1 && /*#__PURE__*/_jsx("div", {
|
|
29
|
+
style: {
|
|
30
|
+
color: 'rgba(0, 0, 0, 0.45)'
|
|
31
|
+
},
|
|
32
|
+
children: "/"
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
package/es/button/group.js
CHANGED
|
@@ -37,7 +37,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
37
37
|
|
|
38
38
|
// 过滤隐藏按钮
|
|
39
39
|
authButtons = items.filter(function (item) {
|
|
40
|
-
return !item.hidden && !(item.onHidden && item.onHidden(selectedRows));
|
|
40
|
+
return !item.hidden && !(item.onHidden && item.onHidden(selectedRows || []));
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
// link按钮删除无用参数
|
|
@@ -150,7 +150,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
150
150
|
onHidden = _ref6.onHidden,
|
|
151
151
|
restProps = _objectWithoutProperties(_ref6, _excluded3);
|
|
152
152
|
// 按钮禁用
|
|
153
|
-
var isDisabled = disabled || onDisabled && onDisabled(selectedRows);
|
|
153
|
+
var isDisabled = disabled || onDisabled && onDisabled(selectedRows || []);
|
|
154
154
|
|
|
155
155
|
// 更多按钮
|
|
156
156
|
if (index === showBtns.length - 1 && authButtons.length > 0) {
|
package/es/ccs.d.ts
CHANGED
|
@@ -73,9 +73,9 @@ type AuthButtonItem = {
|
|
|
73
73
|
/** 按钮禁用 */
|
|
74
74
|
disabled?: boolean;
|
|
75
75
|
/** 根据选中数据判断是否禁用 */
|
|
76
|
-
onDisabled?: (selectedRows
|
|
76
|
+
onDisabled?: (selectedRows: any[]) => boolean;
|
|
77
77
|
/** 根据选中数据判断是否隐藏 */
|
|
78
|
-
onHidden?: (selectedRows
|
|
78
|
+
onHidden?: (selectedRows: any[]) => boolean;
|
|
79
79
|
/** 按钮隐藏 */
|
|
80
80
|
hidden?: boolean;
|
|
81
81
|
/** 警告按钮 */
|
package/es/dialog/button.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type DialogButtonsProps<T> = Pick<CcsDialogModalProps, 'okText' | 'onClos
|
|
|
16
16
|
export type DialogButtonRef = {
|
|
17
17
|
onSetButtons: (e: React.ReactElement) => void;
|
|
18
18
|
};
|
|
19
|
-
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "
|
|
19
|
+
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "onClose" | "onOk" | "auth" | "extraBtn" | "request" | "requestFieldNames" | "preventRequestHandle"> & {
|
|
20
20
|
formRef: React.RefObject<DialogFormRef<TParams>>;
|
|
21
21
|
formInitialValues: FormProps['initialValues'];
|
|
22
22
|
buttonRef: RefObject<DialogButtonRef>;
|
|
@@ -23,6 +23,7 @@ import { useMemo, useRef } from 'react';
|
|
|
23
23
|
import { useLocation } from 'react-router';
|
|
24
24
|
import { useOutlet } from 'react-router-dom';
|
|
25
25
|
import { useAppConfig } from '..';
|
|
26
|
+
import CcsBreadcrumb from "../breadcrumb";
|
|
26
27
|
import "./index.less";
|
|
27
28
|
import Page from "./page";
|
|
28
29
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -343,7 +344,11 @@ export default function KeepAliveTabs(_ref) {
|
|
|
343
344
|
onDestroy: onDestroy,
|
|
344
345
|
urlAuthList: urlAuthList,
|
|
345
346
|
timestamp: timestamp,
|
|
346
|
-
|
|
347
|
+
breadcrumbNode: /*#__PURE__*/_jsx(CcsBreadcrumb, {
|
|
348
|
+
history: history,
|
|
349
|
+
className: "ccs-breadcrumb",
|
|
350
|
+
items: breadcrumb
|
|
351
|
+
}),
|
|
347
352
|
children: outlet
|
|
348
353
|
}, key);
|
|
349
354
|
})]
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { Location } from 'react-router';
|
|
3
3
|
import { CacheComponent } from '.';
|
|
4
|
-
export type CachePageProps = Pick<CacheComponent, '
|
|
4
|
+
export type CachePageProps = Pick<CacheComponent, 'urlAuthList' | 'children' | 'timestamp'> & {
|
|
5
5
|
/** 选中状态 */
|
|
6
6
|
active: boolean;
|
|
7
7
|
/** router location */
|
|
8
8
|
location: Location;
|
|
9
|
+
/** 面包屑 */
|
|
10
|
+
breadcrumbNode: ReactNode;
|
|
9
11
|
/** 销毁页面 */
|
|
10
12
|
onDestroy: (path: string) => void;
|
|
11
13
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Breadcrumb } from 'antd';
|
|
2
1
|
import classNames from 'classnames';
|
|
3
2
|
import { memo, useRef } from 'react';
|
|
4
3
|
import Scrollbars from 'react-custom-scrollbars';
|
|
@@ -12,7 +11,7 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
12
11
|
active = props.active,
|
|
13
12
|
urlAuthList = props.urlAuthList,
|
|
14
13
|
onDestroy = props.onDestroy,
|
|
15
|
-
|
|
14
|
+
breadcrumbNode = props.breadcrumbNode;
|
|
16
15
|
var id = "_tab_content_".concat(locationRef.current.key);
|
|
17
16
|
var dialogHolderRef = useRef(null);
|
|
18
17
|
return /*#__PURE__*/_jsx(PageContext.Provider, {
|
|
@@ -38,10 +37,7 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
38
37
|
className: classNames('ccs-sticky-scroll', {
|
|
39
38
|
'route-avtive': active
|
|
40
39
|
}),
|
|
41
|
-
children: [/*#__PURE__*/_jsx(
|
|
42
|
-
items: breadcrumb,
|
|
43
|
-
className: "ccs-breadcrumb"
|
|
44
|
-
}), children, /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
40
|
+
children: [breadcrumbNode, children, /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
45
41
|
ref: dialogHolderRef
|
|
46
42
|
}, "modal-drawer-holder")]
|
|
47
43
|
})
|
|
@@ -2,6 +2,7 @@ import classnames from 'classnames';
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useLocation } from 'react-router';
|
|
4
4
|
import { useOutlet } from 'react-router-dom';
|
|
5
|
+
import CcsBreadcrumb from "../breadcrumb";
|
|
5
6
|
import { findMenusByUrl } from "../layout-keep-alive";
|
|
6
7
|
import CcsResult from "../result";
|
|
7
8
|
import "./index.less";
|
|
@@ -52,7 +53,11 @@ export default function SinglePage(_ref) {
|
|
|
52
53
|
children: menuInfo !== null && menuInfo !== void 0 && menuInfo.auth ? /*#__PURE__*/_jsx(Page, {
|
|
53
54
|
location: location,
|
|
54
55
|
urlAuthList: menuInfo.auth,
|
|
55
|
-
|
|
56
|
+
breadcrumbNode: /*#__PURE__*/_jsx(CcsBreadcrumb, {
|
|
57
|
+
history: history,
|
|
58
|
+
className: "ccs-breadcrumb",
|
|
59
|
+
items: menuInfo.breadcrumb
|
|
60
|
+
}),
|
|
56
61
|
children: outlet
|
|
57
62
|
}) : /*#__PURE__*/_jsx(CcsResult.NotFound, {
|
|
58
63
|
style: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { JSXElementConstructor, ReactElement } from 'react';
|
|
1
|
+
import { JSXElementConstructor, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { Location } from 'react-router';
|
|
3
3
|
import { CacheComponent } from '../layout-keep-alive';
|
|
4
|
-
export type SinglePageProps = Pick<CacheComponent, '
|
|
4
|
+
export type SinglePageProps = Pick<CacheComponent, 'urlAuthList'> & {
|
|
5
5
|
/** router location */
|
|
6
6
|
location: Location;
|
|
7
|
+
/** 面包屑 */
|
|
8
|
+
breadcrumbNode: ReactNode;
|
|
7
9
|
/** children */
|
|
8
10
|
children: ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
9
11
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Breadcrumb } from 'antd';
|
|
2
1
|
import { memo, useRef } from 'react';
|
|
3
2
|
import Scrollbars from 'react-custom-scrollbars';
|
|
4
3
|
import { PageContext } from "../context";
|
|
@@ -10,8 +9,7 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
10
9
|
var children = props.children,
|
|
11
10
|
_props$urlAuthList = props.urlAuthList,
|
|
12
11
|
urlAuthList = _props$urlAuthList === void 0 ? [] : _props$urlAuthList,
|
|
13
|
-
|
|
14
|
-
breadcrumb = _props$breadcrumb === void 0 ? [] : _props$breadcrumb;
|
|
12
|
+
breadcrumbNode = props.breadcrumbNode;
|
|
15
13
|
var dialogHolderRef = useRef(null);
|
|
16
14
|
return /*#__PURE__*/_jsx(PageContext.Provider, {
|
|
17
15
|
value: {
|
|
@@ -29,10 +27,7 @@ export default /*#__PURE__*/memo(function (props) {
|
|
|
29
27
|
children: /*#__PURE__*/_jsxs(Scrollbars, {
|
|
30
28
|
autoHide: true,
|
|
31
29
|
className: "ccs-sticky-scroll",
|
|
32
|
-
children: [/*#__PURE__*/_jsx(
|
|
33
|
-
items: breadcrumb,
|
|
34
|
-
className: "ccs-breadcrumb"
|
|
35
|
-
}), children, /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
30
|
+
children: [breadcrumbNode, children, /*#__PURE__*/_jsx(DialogElementsHolder, {
|
|
36
31
|
ref: dialogHolderRef
|
|
37
32
|
}, "modal-drawer-holder")]
|
|
38
33
|
})
|
package/es/pro-table/table.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var _excluded = ["type"];
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
1
4
|
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
5
|
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
6
|
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); } }
|
|
@@ -15,7 +18,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
15
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
19
|
import CcsUtils from '@ccs-ui/utils';
|
|
17
20
|
import { useSize, useUpdateEffect } from 'ahooks';
|
|
18
|
-
import {
|
|
21
|
+
import { theme as antTheme, Empty, Form } from 'antd';
|
|
19
22
|
import classNames from 'classnames';
|
|
20
23
|
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
21
24
|
import { useAppConfig, useCcsPage } from '..';
|
|
@@ -73,8 +76,32 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
73
76
|
rowKey = _ref.rowKey;
|
|
74
77
|
// table sticky
|
|
75
78
|
var stickyRef = useRef(false);
|
|
79
|
+
|
|
80
|
+
// 字段默认过滤,排序值
|
|
81
|
+
var defaultColumnValues = useMemo(function () {
|
|
82
|
+
var defaultValue = {
|
|
83
|
+
filters: {},
|
|
84
|
+
orderProps: []
|
|
85
|
+
};
|
|
86
|
+
columns === null || columns === void 0 || columns.forEach(function (c) {
|
|
87
|
+
// 排序
|
|
88
|
+
if (c.sorter && c.defaultSortOrder !== undefined) {
|
|
89
|
+
defaultValue.orderProps.push({
|
|
90
|
+
prop: c.dataIndex,
|
|
91
|
+
ascending: c.defaultSortOrder === 'ascend'
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 过滤
|
|
96
|
+
if (c.filters && c.defaultFilteredValue !== undefined) {
|
|
97
|
+
defaultValue.filters[c.dataIndex] = c.defaultFilteredValue;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return defaultValue;
|
|
101
|
+
}, []);
|
|
102
|
+
|
|
76
103
|
// column filter
|
|
77
|
-
var filtersRef = useRef(
|
|
104
|
+
var filtersRef = useRef(defaultColumnValues);
|
|
78
105
|
// table content
|
|
79
106
|
var tableContentRef = useRef(null);
|
|
80
107
|
// container
|
|
@@ -330,14 +357,14 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
330
357
|
// 清空columns显示filter和sort值
|
|
331
358
|
columns === null || columns === void 0 || columns.forEach(function (c) {
|
|
332
359
|
if (c.filterDropdown || c.filters) {
|
|
333
|
-
c.filteredValue =
|
|
360
|
+
c.filteredValue = c.defaultFilteredValue;
|
|
334
361
|
}
|
|
335
362
|
if (c.sorter) {
|
|
336
|
-
c.sortOrder =
|
|
363
|
+
c.sortOrder = c.defaultSortOrder;
|
|
337
364
|
}
|
|
338
365
|
});
|
|
339
366
|
// 清空filter请求值
|
|
340
|
-
filtersRef.current =
|
|
367
|
+
filtersRef.current = defaultColumnValues;
|
|
341
368
|
onRequest('reset');
|
|
342
369
|
};
|
|
343
370
|
|
|
@@ -386,18 +413,17 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
386
413
|
filters: filters
|
|
387
414
|
});
|
|
388
415
|
}
|
|
389
|
-
|
|
390
|
-
// @ts-ignore
|
|
391
416
|
if (sorter) {
|
|
392
417
|
columns === null || columns === void 0 || columns.forEach(function (c) {
|
|
393
418
|
if (c.sorter) {
|
|
419
|
+
var curSorter = Array.isArray(sorter) ?
|
|
394
420
|
// @ts-ignore
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
421
|
+
sorter.find(function (sort) {
|
|
422
|
+
return sort.field === c.dataIndex;
|
|
423
|
+
}) : sorter;
|
|
424
|
+
|
|
399
425
|
// @ts-ignore
|
|
400
|
-
c.sortOrder =
|
|
426
|
+
c.sortOrder = curSorter === null || curSorter === void 0 ? void 0 : curSorter.order;
|
|
401
427
|
}
|
|
402
428
|
});
|
|
403
429
|
|
|
@@ -449,8 +475,14 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
449
475
|
}
|
|
450
476
|
}
|
|
451
477
|
|
|
452
|
-
//
|
|
453
|
-
var
|
|
478
|
+
// 选择,只传入一个type参数或不传,封装选择行为
|
|
479
|
+
var _ref4 = table.rowSelection || {},
|
|
480
|
+
_ref4$type = _ref4.type,
|
|
481
|
+
type = _ref4$type === void 0 ? 'checkbox' : _ref4$type,
|
|
482
|
+
restSelection = _objectWithoutProperties(_ref4, _excluded);
|
|
483
|
+
var hasSelection = table.rowSelection && CcsUtils.isEmpty(restSelection);
|
|
484
|
+
var rowSelection = hasSelection ? {
|
|
485
|
+
type: type,
|
|
454
486
|
selectedRowKeys: selectedRows.map(function (k) {
|
|
455
487
|
return k[rowKey];
|
|
456
488
|
}),
|
|
@@ -532,9 +564,9 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
532
564
|
}, rootStyle);
|
|
533
565
|
}
|
|
534
566
|
var onFullScreen = function onFullScreen(isFull) {
|
|
535
|
-
var
|
|
536
|
-
classList =
|
|
537
|
-
style =
|
|
567
|
+
var _ref5 = containerRef.current || {},
|
|
568
|
+
classList = _ref5.classList,
|
|
569
|
+
style = _ref5.style;
|
|
538
570
|
if (isFull) {
|
|
539
571
|
classList === null || classList === void 0 || classList.add('css-table-full');
|
|
540
572
|
style.backgroundColor = token.colorBgContainer;
|
package/es/upload/index.d.ts
CHANGED
|
@@ -20,7 +20,14 @@ export type CcsUploadProps = Pick<UploadProps, 'maxCount' | 'data' | 'multiple'
|
|
|
20
20
|
/** 上传change事件 */
|
|
21
21
|
onChange?: (value: any) => void;
|
|
22
22
|
/** 上传请求 */
|
|
23
|
-
uploadRequest:
|
|
23
|
+
uploadRequest: (file: File, options?: RecordType) => Promise<{
|
|
24
|
+
/** 成功标识 */
|
|
25
|
+
success: boolean;
|
|
26
|
+
/** 返回文件id */
|
|
27
|
+
data: string;
|
|
28
|
+
/** 异常消息 */
|
|
29
|
+
msg?: string;
|
|
30
|
+
}>;
|
|
24
31
|
};
|
|
25
32
|
export type FileUploadList = UploadChangeParam['fileList'][0] & {
|
|
26
33
|
fileId?: string;
|