@ccs-ui/rc-pro 2.3.6-beta-40 → 2.4.0-beta.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/docs-dist/1449.2b56219b.async.js +15 -0
- package/docs-dist/1449.e8c51481.chunk.css +5 -0
- package/docs-dist/1474.20b8cea1.async.js +578 -0
- package/docs-dist/2085.27b7a56c.async.js +5 -0
- package/docs-dist/27.cf0e6aaf.async.js +11 -0
- package/docs-dist/404.html +15 -0
- package/docs-dist/4859.645461e8.async.js +18 -0
- package/docs-dist/9510.92d7c9e5.async.js +137 -0
- package/docs-dist/auth__demos.3be7cd2a.async.js +1 -0
- package/docs-dist/button__demos.a0dc2689.async.js +1 -0
- package/docs-dist/cascader__demos.d47af25c.async.js +1 -0
- package/docs-dist/date-picker__demos.259c9ecb.async.js +1 -0
- package/docs-dist/demos.a585b64a.async.js +1 -0
- package/docs-dist/dialog__demos.03d15fe7.async.js +1 -0
- package/docs-dist/docs__guide.md.33be0665.chunk.css +1 -0
- package/docs-dist/docs__guide.md.e5041fb4.async.js +1 -0
- package/docs-dist/docs__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/docs__index.md.75a9a568.async.js +1 -0
- package/docs-dist/dumi__tmp-production__dumi__theme__ContextWrapper.ef64dc7c.async.js +1 -0
- package/docs-dist/editor__demos.88663d1e.async.js +6 -0
- package/docs-dist/favicon.png +0 -0
- package/docs-dist/group-form-item__demos.4b5b499b.async.js +1 -0
- package/docs-dist/guide/index.html +15 -0
- package/docs-dist/index.html +15 -0
- package/docs-dist/interval-button__demos.d647fbab.async.js +1 -0
- package/docs-dist/loading__demos.fe7b1e59.async.js +1 -0
- package/docs-dist/logo.svg +48 -0
- package/docs-dist/meta__docs.56a19a6a.async.js +1 -0
- package/docs-dist/meta__packages.6c636f9a.async.js +13817 -0
- package/docs-dist/meta__packages.9ed2b563.chunk.css +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__404.3097fa22.async.js +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__404.8b85f2d9.chunk.css +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__Demo__index.578aa5c0.chunk.css +1 -0
- package/docs-dist/nm__dumi__dist__client__pages__Demo__index.83a2c730.async.js +1 -0
- package/docs-dist/nm__dumi__theme-default__layouts__DocLayout__index.e556091c.async.js +1 -0
- package/docs-dist/packages__plugin-eui__src__free.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__plugin-eui__src__free.md.9706dcd8.async.js +1 -0
- package/docs-dist/packages__plugin-eui__src__table-tree.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__plugin-eui__src__table-tree.md.63bc8653.async.js +1 -0
- package/docs-dist/packages__plugin-eui__src__table.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__plugin-eui__src__table.md.58c0aeec.async.js +1 -0
- package/docs-dist/packages__plugin-eui__src__tabs.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__plugin-eui__src__tabs.md.5cd12eb6.async.js +1 -0
- package/docs-dist/packages__plugin-openapi__src__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__plugin-openapi__src__index.md.ac4ed387.async.js +54 -0
- package/docs-dist/packages__rc-pro__src__auth__index.md.09d47ed9.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__auth__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__button__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__button__index.md.e4392f5d.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__cascader__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__cascader__index.md.83dd07db.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__date-picker__index.md.1954391f.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__date-picker__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__dialog__index.md.0ab8f5d9.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__dialog__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__editor__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__editor__index.md.571e2c64.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__group-form-item__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__group-form-item__index.md.ae7880a8.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__index.md.2043702c.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__interval-button__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__interval-button__index.md.4ee5873c.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__layout-keep-alive__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__layout-keep-alive__index.md.9bbd4cba.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__loading__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__loading__index.md.ffd4e9c3.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__pro-table__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__pro-table__index.md.e8542cec.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__pro-tabs__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__pro-tabs__index.md.5c2c6378.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__result__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__result__index.md.bf4bb31c.async.js +2 -0
- package/docs-dist/packages__rc-pro__src__select__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__select__index.md.f739fe71.async.js +2 -0
- package/docs-dist/packages__rc-pro__src__time-picker__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__time-picker__index.md.cdc2078f.async.js +1 -0
- package/docs-dist/packages__rc-pro__src__water-mark__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/packages__rc-pro__src__water-mark__index.md.7d0bee7d.async.js +1 -0
- package/docs-dist/packages__utils__src__utils__index.md.2e9b549d.async.js +1 -0
- package/docs-dist/packages__utils__src__utils__index.md.33be0665.chunk.css +1 -0
- package/docs-dist/plugin-euis/free/index.html +15 -0
- package/docs-dist/plugin-euis/table/index.html +15 -0
- package/docs-dist/plugin-euis/table-tree/index.html +15 -0
- package/docs-dist/plugin-euis/tabs/index.html +15 -0
- package/docs-dist/plugin-openapis/index.html +15 -0
- package/docs-dist/preload_helper.b6bb2ecb.js +1 -0
- package/docs-dist/pro-table__demos.ca265923.async.js +1 -0
- package/docs-dist/pro-tabs__demos.1edccbc5.async.js +1 -0
- package/docs-dist/rc-pros/auth/index.html +15 -0
- package/docs-dist/rc-pros/button/index.html +15 -0
- package/docs-dist/rc-pros/cascader/index.html +15 -0
- package/docs-dist/rc-pros/date-picker/index.html +15 -0
- package/docs-dist/rc-pros/dialog/index.html +15 -0
- package/docs-dist/rc-pros/editor/index.html +15 -0
- package/docs-dist/rc-pros/group-form-item/index.html +15 -0
- package/docs-dist/rc-pros/index.html +15 -0
- package/docs-dist/rc-pros/interval-button/index.html +15 -0
- package/docs-dist/rc-pros/layout-keep-alive/index.html +15 -0
- package/docs-dist/rc-pros/loading/index.html +15 -0
- package/docs-dist/rc-pros/pro-table/index.html +15 -0
- package/docs-dist/rc-pros/pro-tabs/index.html +15 -0
- package/docs-dist/rc-pros/result/index.html +15 -0
- package/docs-dist/rc-pros/select/index.html +15 -0
- package/docs-dist/rc-pros/time-picker/index.html +15 -0
- package/docs-dist/rc-pros/water-mark/index.html +15 -0
- package/docs-dist/result__demos.7ad0defe.async.js +1 -0
- package/docs-dist/select__demos.c6a6d803.async.js +1 -0
- package/docs-dist/time-picker__demos.8beda018.async.js +1 -0
- package/docs-dist/umi.4859fef9.js +108 -0
- package/docs-dist/umi.4e0bcd92.css +1 -0
- package/docs-dist/utils/utils/index.html +15 -0
- package/docs-dist/utils__demos.4d502190.async.js +1 -0
- package/docs-dist/water-mark__demos.26d16c3b.async.js +1 -0
- package/docs-dist/~demos/:id/index.html +15 -0
- package/docs-dist/~demos/auth-demo-basic/index.html +15 -0
- package/docs-dist/~demos/button-demo-button/index.html +15 -0
- package/docs-dist/~demos/button-demo-group/index.html +15 -0
- package/docs-dist/~demos/cascader-demo-basic/index.html +15 -0
- package/docs-dist/~demos/cascader-demo-cache/index.html +15 -0
- package/docs-dist/~demos/date-picker-demo-basic/index.html +15 -0
- package/docs-dist/~demos/date-picker-demo-range/index.html +15 -0
- package/docs-dist/~demos/dialog-demo-demos/index.html +15 -0
- package/docs-dist/~demos/editor-demo-demos/index.html +15 -0
- package/docs-dist/~demos/group-form-item-demo-basic/index.html +15 -0
- package/docs-dist/~demos/interval-button-demo-basic/index.html +15 -0
- package/docs-dist/~demos/loading-demo-basic/index.html +15 -0
- package/docs-dist/~demos/packages-plugin-eui-src-free-demo-free/index.html +15 -0
- package/docs-dist/~demos/packages-plugin-eui-src-table-demo-table/index.html +15 -0
- package/docs-dist/~demos/packages-plugin-eui-src-table-tree-demo-table-tree/index.html +15 -0
- package/docs-dist/~demos/packages-plugin-eui-src-tabs-demo-tabs/index.html +15 -0
- package/docs-dist/~demos/pro-table-demo-basic/index.html +15 -0
- package/docs-dist/~demos/pro-table-demo-fixed/index.html +15 -0
- package/docs-dist/~demos/pro-table-demo-selection/index.html +15 -0
- package/docs-dist/~demos/pro-tabs-demo-basic/index.html +15 -0
- package/docs-dist/~demos/pro-tabs-demo-tab/index.html +15 -0
- package/docs-dist/~demos/result-demo-basic/index.html +15 -0
- package/docs-dist/~demos/select-demo-api/index.html +15 -0
- package/docs-dist/~demos/select-demo-basic/index.html +15 -0
- package/docs-dist/~demos/select-demo-customize/index.html +15 -0
- package/docs-dist/~demos/select-demo-customize-label/index.html +15 -0
- package/docs-dist/~demos/time-picker-demo-basic/index.html +15 -0
- package/docs-dist/~demos/utils-demo-demos/index.html +15 -0
- package/docs-dist/~demos/water-mark-demo-basic/index.html +15 -0
- package/es/Foo/d +0 -0
- package/es/aj-captcha/index.less +9 -23
- package/es/auth/index.d.ts +7 -0
- package/es/auth/index.js +14 -0
- package/es/cascader/index.js +4 -4
- package/es/ccs.d.ts +7 -13
- package/es/config.js +33 -11
- package/es/context/index.d.ts +2 -2
- package/es/date-picker/index.js +20 -0
- package/es/dialog/button.d.ts +1 -1
- package/es/dialog/button.js +3 -3
- package/es/dialog/index.d.ts +0 -1
- package/es/dialog/index.js +0 -1
- package/es/ellipsis/index.js +4 -2
- package/es/ellipsis/useResizeEffect.js +10 -24
- package/es/group-form-item/index.d.ts +11 -0
- package/es/group-form-item/index.js +124 -0
- package/es/hooks/use-selection.d.ts +12 -23
- package/es/hooks/use-selection.js +51 -25
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -3
- package/es/interval-button/index.js +4 -4
- package/es/layout-keep-alive/index.d.ts +1 -1
- package/es/layout-keep-alive/index.js +26 -20
- package/es/layout-keep-alive/index.less +19 -23
- package/es/layout-keep-alive/page.d.ts +3 -2
- package/es/layout-keep-alive/page.js +4 -3
- package/es/layout-single-page/index.d.ts +4 -2
- package/es/layout-single-page/index.js +12 -5
- package/es/layout-single-page/index.less +2 -8
- package/es/layout-single-page/page.d.ts +3 -1
- package/es/layout-single-page/page.js +2 -1
- package/es/pro-table/_utils.d.ts +1 -1
- package/es/pro-table/_utils.js +7 -7
- package/es/pro-table/form-item.d.ts +5 -3
- package/es/pro-table/form-item.js +28 -11
- package/es/pro-table/head.js +88 -63
- package/es/pro-table/index.less +20 -175
- package/es/pro-table/selection-alert.d.ts +4 -2
- package/es/pro-table/selection-alert.js +16 -4
- package/es/pro-table/table.d.ts +13 -24
- package/es/pro-table/table.js +128 -250
- package/es/pro-table/tree.d.ts +3 -3
- package/es/pro-table/tree.js +28 -17
- package/es/select/ modal.d.ts +3 -9
- package/es/select/ modal.js +63 -22
- package/es/select/customize.d.ts +7 -15
- package/es/select/customize.js +58 -48
- package/es/select/index.d.ts +2 -1
- package/es/select/index.js +9 -9
- package/es/table/index.js +12 -14
- package/es/table/index.less +0 -129
- package/package.json +11 -29
- package/LICENSE +0 -21
- package/README.md +0 -37
- package/es/breadcrumb.d.ts +0 -8
- package/es/breadcrumb.js +0 -40
- package/es/dialog/index.less +0 -16
- package/es/pro-grid/index.d.ts +0 -15
- package/es/pro-grid/index.js +0 -58
- package/es/trigger/index.d.ts +0 -43
- package/es/trigger/index.js +0 -298
- package/es/trigger/index.less +0 -42
- package/es/virtual-list/index.d.ts +0 -51
- package/es/virtual-list/index.js +0 -132
package/es/pro-table/table.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
var _excluded = ["selectedRowKeys", "onChange"];
|
|
2
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); }
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
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; }
|
|
6
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
9
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
10
7
|
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; }
|
|
11
8
|
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; }
|
|
12
9
|
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; }
|
|
@@ -20,15 +17,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
17
|
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; }
|
|
21
18
|
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; } }
|
|
22
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
import CcsUtils from '@ccs-ui/utils';
|
|
24
20
|
import { useUpdateEffect } from 'ahooks';
|
|
25
21
|
import { theme as antTheme, Card, Empty } from 'antd';
|
|
22
|
+
import { ConfigContext } from 'antd/es/config-provider';
|
|
26
23
|
import classNames from 'classnames';
|
|
27
24
|
import _debounce from 'lodash.debounce';
|
|
28
|
-
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
25
|
+
import React, { useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
29
26
|
import { CcsResizeObserver, useAppConfig, useCcsPage } from '..';
|
|
30
27
|
import { useProTableFields } from "../hooks/use-app";
|
|
31
|
-
import {
|
|
28
|
+
import { getDataByNamePath } from "../select";
|
|
32
29
|
import CcsTable from "../table";
|
|
33
30
|
import { getAllChildrenId, getDataById, onTableInModalOrDrawer, onTableInTabItem } from "./_utils";
|
|
34
31
|
import HeadComponent from "./head";
|
|
@@ -59,8 +56,10 @@ export var TableEvent = /*#__PURE__*/function (TableEvent) {
|
|
|
59
56
|
TableEvent["FullScreen"] = "fullScreen";
|
|
60
57
|
TableEvent["ColumnFilter"] = "columnFilter";
|
|
61
58
|
TableEvent["SelectedRows"] = "SelectedRows";
|
|
59
|
+
TableEvent["Expand"] = "Expand";
|
|
60
|
+
TableEvent["PartialReload"] = "PartialReload";
|
|
62
61
|
return TableEvent;
|
|
63
|
-
}({});
|
|
62
|
+
}({}); // 异步树局部刷新
|
|
64
63
|
export var classPrefix = 'ccs-pl';
|
|
65
64
|
|
|
66
65
|
/**
|
|
@@ -91,14 +90,14 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
91
90
|
onEvent = props.onEvent;
|
|
92
91
|
var _useCcsPage = useCcsPage(),
|
|
93
92
|
onAuth = _useCcsPage.onAuth;
|
|
93
|
+
var config = useContext(ConfigContext);
|
|
94
94
|
var _ref = table || {},
|
|
95
95
|
pagination = _ref.pagination,
|
|
96
96
|
_ref$requestParam = _ref.requestParam,
|
|
97
97
|
requestParam = _ref$requestParam === void 0 ? {} : _ref$requestParam,
|
|
98
98
|
columns = _ref.columns,
|
|
99
99
|
rowKey = _ref.rowKey,
|
|
100
|
-
httpRequest = _ref.request
|
|
101
|
-
rowSelection = _ref.rowSelection;
|
|
100
|
+
httpRequest = _ref.request;
|
|
102
101
|
// table sticky
|
|
103
102
|
var stickyRef = useRef(false);
|
|
104
103
|
|
|
@@ -129,8 +128,6 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
129
128
|
var filterOrderRef = useRef(defaultColumnValues);
|
|
130
129
|
// table content
|
|
131
130
|
var tableContentRef = useRef(null);
|
|
132
|
-
// 接口查询条件
|
|
133
|
-
var searchParamRef = useRef({});
|
|
134
131
|
// container
|
|
135
132
|
var containerRef = useRef(null);
|
|
136
133
|
// table ref
|
|
@@ -148,23 +145,17 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
148
145
|
data = _useState2[0],
|
|
149
146
|
setData = _useState2[1];
|
|
150
147
|
var treeRef = useRef(null);
|
|
151
|
-
|
|
152
|
-
// table?.rowSelection?.defaultSelectedRowKeys || [],
|
|
153
|
-
// );
|
|
154
|
-
var _useState3 = useState({}),
|
|
148
|
+
var _useState3 = useState((table === null || table === void 0 ? void 0 : table.size) || 'middle'),
|
|
155
149
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
// const selectedRowsRef = useRef<RecordType[]>([]);
|
|
159
|
-
var _useState5 = useState((table === null || table === void 0 ? void 0 : table.size) || 'middle'),
|
|
160
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
161
|
-
tableRowSize = _useState6[0],
|
|
162
|
-
setTableRowSize = _useState6[1];
|
|
150
|
+
tableRowSize = _useState4[0],
|
|
151
|
+
setTableRowSize = _useState4[1];
|
|
163
152
|
// 上下文配置
|
|
164
153
|
var _useAppConfig = useAppConfig(),
|
|
165
154
|
theme = _useAppConfig.theme;
|
|
166
155
|
// 接口字段指定全局配置
|
|
167
156
|
var globalFieldNames = useProTableFields();
|
|
157
|
+
var _antTheme$useToken = antTheme.useToken(),
|
|
158
|
+
token = _antTheme$useToken.token;
|
|
168
159
|
|
|
169
160
|
// 暗黑模式
|
|
170
161
|
var isDark = theme === 'dark';
|
|
@@ -173,21 +164,67 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
173
164
|
var isAuth = useMemo(function () {
|
|
174
165
|
if (auth) return onAuth && onAuth(auth);
|
|
175
166
|
return true;
|
|
176
|
-
}, []);
|
|
167
|
+
}, [auth]);
|
|
177
168
|
var formatFormItems = useMemo(function () {
|
|
178
169
|
return formItems.flat(Infinity).filter(function (f) {
|
|
179
170
|
return f.onFormat;
|
|
180
171
|
});
|
|
181
172
|
}, []);
|
|
182
173
|
|
|
174
|
+
// 构建查询条件:表单数据、请求额外参数、分页参数、其他参数
|
|
175
|
+
var getFormValues = /*#__PURE__*/function () {
|
|
176
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
177
|
+
var _formRef$current;
|
|
178
|
+
var formValues, _delField;
|
|
179
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
180
|
+
while (1) switch (_context.prev = _context.next) {
|
|
181
|
+
case 0:
|
|
182
|
+
_context.next = 2;
|
|
183
|
+
return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.validateFields();
|
|
184
|
+
case 2:
|
|
185
|
+
formValues = _context.sent;
|
|
186
|
+
// 删除无意义字段
|
|
187
|
+
if (formValues) {
|
|
188
|
+
_delField = Object.keys(formValues).filter(function (k) {
|
|
189
|
+
return k.startsWith('_') && k.endsWith('_');
|
|
190
|
+
});
|
|
191
|
+
if (_delField.length > 0) {
|
|
192
|
+
_delField.forEach(function (d) {
|
|
193
|
+
return delete formValues[d];
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (formatFormItems.length) {
|
|
198
|
+
// 格式化条件
|
|
199
|
+
Object.keys(formValues).forEach(function (k) {
|
|
200
|
+
if (formValues[k] !== undefined) {
|
|
201
|
+
var s = formatFormItems.find(function (f) {
|
|
202
|
+
return f.name === k;
|
|
203
|
+
});
|
|
204
|
+
if (s) formValues[k] = s.onFormat && s.onFormat(formValues[k]);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, requestParam), formInitValues), formValues));
|
|
209
|
+
case 6:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context.stop();
|
|
212
|
+
}
|
|
213
|
+
}, _callee);
|
|
214
|
+
}));
|
|
215
|
+
return function getFormValues() {
|
|
216
|
+
return _ref2.apply(this, arguments);
|
|
217
|
+
};
|
|
218
|
+
}();
|
|
219
|
+
|
|
183
220
|
// 获取数据
|
|
184
221
|
var onRequest = /*#__PURE__*/function () {
|
|
185
|
-
var
|
|
186
|
-
var
|
|
222
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(eventType) {
|
|
223
|
+
var _props$table;
|
|
187
224
|
var pageNo,
|
|
188
225
|
pageSize,
|
|
189
226
|
record,
|
|
190
|
-
|
|
227
|
+
allParams,
|
|
191
228
|
fieldNames,
|
|
192
229
|
_fieldNames$requestPa,
|
|
193
230
|
_fieldNames$requestPa2,
|
|
@@ -208,43 +245,31 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
208
245
|
dataSource,
|
|
209
246
|
total,
|
|
210
247
|
newData,
|
|
211
|
-
|
|
212
|
-
return _regeneratorRuntime().wrap(function
|
|
213
|
-
while (1) switch (
|
|
248
|
+
_args2 = arguments;
|
|
249
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
250
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
214
251
|
case 0:
|
|
215
|
-
pageNo =
|
|
216
|
-
pageSize =
|
|
217
|
-
record =
|
|
252
|
+
pageNo = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 1;
|
|
253
|
+
pageSize = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : (pagination ? pagination.defaultPageSize : 10) || 10;
|
|
254
|
+
record = _args2.length > 3 ? _args2[3] : undefined;
|
|
218
255
|
if (!(!isAuth || !httpRequest)) {
|
|
219
|
-
|
|
256
|
+
_context2.next = 5;
|
|
220
257
|
break;
|
|
221
258
|
}
|
|
222
|
-
return
|
|
259
|
+
return _context2.abrupt("return");
|
|
223
260
|
case 5:
|
|
224
|
-
|
|
225
|
-
return (
|
|
261
|
+
_context2.next = 7;
|
|
262
|
+
return getFormValues();
|
|
226
263
|
case 7:
|
|
227
|
-
|
|
264
|
+
allParams = _context2.sent;
|
|
228
265
|
// 接口字段指定
|
|
229
|
-
fieldNames = _objectSpread(_objectSpread({}, globalFieldNames), (_props$table = props.table) === null || _props$table === void 0 ? void 0 : _props$table.fieldNames); //
|
|
230
|
-
if (formatFormItems.length) {
|
|
231
|
-
Object.keys(formValues).forEach(function (k) {
|
|
232
|
-
if (formValues[k] !== undefined) {
|
|
233
|
-
var s = formatFormItems.find(function (f) {
|
|
234
|
-
return f.name === k;
|
|
235
|
-
});
|
|
236
|
-
if (s) formValues[k] = s.onFormat && s.onFormat(formValues[k]);
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// 请求字段
|
|
266
|
+
fieldNames = _objectSpread(_objectSpread({}, globalFieldNames), (_props$table = props.table) === null || _props$table === void 0 ? void 0 : _props$table.fieldNames); // 请求字段
|
|
242
267
|
_fieldNames$requestPa = fieldNames.requestParam, _fieldNames$requestPa2 = _fieldNames$requestPa.filters, fsFilters = _fieldNames$requestPa2 === void 0 ? ['filters'] : _fieldNames$requestPa2, _fieldNames$requestPa3 = _fieldNames$requestPa.pageNo, fsPageNo = _fieldNames$requestPa3 === void 0 ? ['pageNo'] : _fieldNames$requestPa3, _fieldNames$requestPa4 = _fieldNames$requestPa.pageSize, fsPageSize = _fieldNames$requestPa4 === void 0 ? ['pageSize'] : _fieldNames$requestPa4, _fieldNames$requestPa5 = _fieldNames$requestPa.orderProps, fsOrderProps = _fieldNames$requestPa5 === void 0 ? ['orderProps'] : _fieldNames$requestPa5, fsQuery = _fieldNames$requestPa.query; // 构建请求参数
|
|
243
268
|
params = {};
|
|
244
269
|
if (fsQuery && fsQuery.length > 0) {
|
|
245
|
-
onSetObj(params, _toConsumableArray(fsQuery),
|
|
270
|
+
onSetObj(params, _toConsumableArray(fsQuery), allParams);
|
|
246
271
|
} else {
|
|
247
|
-
params =
|
|
272
|
+
params = allParams;
|
|
248
273
|
}
|
|
249
274
|
if (pagination !== false) {
|
|
250
275
|
// 分页
|
|
@@ -263,14 +288,13 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
263
288
|
|
|
264
289
|
// 异步树
|
|
265
290
|
if (!parentFieldName) {
|
|
266
|
-
|
|
291
|
+
_context2.next = 19;
|
|
267
292
|
break;
|
|
268
293
|
}
|
|
269
|
-
(_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 || _treeRef$current.onRequestTree(params.query, record);
|
|
270
|
-
return
|
|
271
|
-
case
|
|
272
|
-
//
|
|
273
|
-
searchParamRef.current = params;
|
|
294
|
+
(_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 || _treeRef$current.onRequestTree(eventType, params.query, record);
|
|
295
|
+
return _context2.abrupt("return");
|
|
296
|
+
case 19:
|
|
297
|
+
// 事件回调,请求中
|
|
274
298
|
onEvent === null || onEvent === void 0 || onEvent(eventType, {
|
|
275
299
|
loading: true,
|
|
276
300
|
params: params
|
|
@@ -282,10 +306,11 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
282
306
|
loading: true
|
|
283
307
|
});
|
|
284
308
|
});
|
|
285
|
-
|
|
309
|
+
_context2.next = 23;
|
|
286
310
|
return httpRequest(params);
|
|
287
|
-
case
|
|
288
|
-
requestResult =
|
|
311
|
+
case 23:
|
|
312
|
+
requestResult = _context2.sent;
|
|
313
|
+
// 事件回调,请求完成
|
|
289
314
|
onEvent === null || onEvent === void 0 || onEvent(eventType, {
|
|
290
315
|
loading: false,
|
|
291
316
|
params: params,
|
|
@@ -294,17 +319,17 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
294
319
|
|
|
295
320
|
// 请求结果
|
|
296
321
|
if (!requestResult) {
|
|
297
|
-
|
|
322
|
+
_context2.next = 35;
|
|
298
323
|
break;
|
|
299
324
|
}
|
|
300
325
|
// 获取table数据
|
|
301
|
-
dataSource =
|
|
326
|
+
dataSource = getDataByNamePath(requestResult, fieldNames.dataSource); // 默认添加一条数据
|
|
302
327
|
if (table !== null && table !== void 0 && table.emptyDefaultOne && dataSource && dataSource.length === 0) {
|
|
303
328
|
dataSource.push(_defineProperty({}, rowKey || 'id', '0'));
|
|
304
329
|
}
|
|
305
|
-
total =
|
|
330
|
+
total = getDataByNamePath(requestResult, fieldNames.total);
|
|
306
331
|
if (!(total === undefined || dataSource === undefined)) {
|
|
307
|
-
|
|
332
|
+
_context2.next = 33;
|
|
308
333
|
break;
|
|
309
334
|
}
|
|
310
335
|
newData = {
|
|
@@ -315,8 +340,8 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
315
340
|
loading: false
|
|
316
341
|
};
|
|
317
342
|
setData(newData);
|
|
318
|
-
return
|
|
319
|
-
case
|
|
343
|
+
return _context2.abrupt("return");
|
|
344
|
+
case 33:
|
|
320
345
|
// 当前页无数据,返回上一页
|
|
321
346
|
if (!dataSource.length && pageNo !== 1) {
|
|
322
347
|
onRequest(TableEvent.Reload, pageNo - 1);
|
|
@@ -329,21 +354,21 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
329
354
|
total: total || 0
|
|
330
355
|
});
|
|
331
356
|
}
|
|
332
|
-
return
|
|
333
|
-
case
|
|
357
|
+
return _context2.abrupt("return");
|
|
358
|
+
case 35:
|
|
334
359
|
setData(function (d) {
|
|
335
360
|
return _objectSpread(_objectSpread({}, d), {}, {
|
|
336
361
|
loading: false
|
|
337
362
|
});
|
|
338
363
|
});
|
|
339
|
-
case
|
|
364
|
+
case 36:
|
|
340
365
|
case "end":
|
|
341
|
-
return
|
|
366
|
+
return _context2.stop();
|
|
342
367
|
}
|
|
343
|
-
},
|
|
368
|
+
}, _callee2);
|
|
344
369
|
}));
|
|
345
370
|
return function onRequest(_x) {
|
|
346
|
-
return
|
|
371
|
+
return _ref3.apply(this, arguments);
|
|
347
372
|
};
|
|
348
373
|
}();
|
|
349
374
|
|
|
@@ -361,11 +386,11 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
361
386
|
var ids = getAllChildrenId(treeNode.children || [], rowKey);
|
|
362
387
|
// 局部重载
|
|
363
388
|
(_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 || _treeRef$current2.onExpandKeys(ids);
|
|
364
|
-
(_treeRef$current3 = treeRef.current) === null || _treeRef$current3 === void 0 || _treeRef$current3.onRequestTree({}, treeNode);
|
|
389
|
+
(_treeRef$current3 = treeRef.current) === null || _treeRef$current3 === void 0 || _treeRef$current3.onRequestTree(TableEvent.PartialReload, {}, treeNode);
|
|
365
390
|
};
|
|
366
391
|
useEffect(function () {
|
|
367
392
|
// 判断是否在弹出框中
|
|
368
|
-
var inMd = onTableInModalOrDrawer(tableContentRef.current);
|
|
393
|
+
var inMd = onTableInModalOrDrawer(tableContentRef.current, config.getPrefixCls());
|
|
369
394
|
if (inMd) {
|
|
370
395
|
stickyRef.current = inMd;
|
|
371
396
|
// 弹框中行尺寸默认设置为small
|
|
@@ -393,147 +418,19 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
393
418
|
}
|
|
394
419
|
}, [Object.keys(requestParam || {}).toString(), Object.values(requestParam || {}).toString()]);
|
|
395
420
|
|
|
396
|
-
// 初始状态,记录选中key和选中记录,用作选中数据回显
|
|
397
|
-
// useEffect(() => {
|
|
398
|
-
// if (!rowSelectionDefaultRows) return;
|
|
399
|
-
|
|
400
|
-
// const { selectedRowKeys } = table?.rowSelection || {};
|
|
401
|
-
// if (
|
|
402
|
-
// selectedRowKeys &&
|
|
403
|
-
// selectedRowKeys.length > 0 &&
|
|
404
|
-
// !rowSelectionRef.current.selectedRowKeys &&
|
|
405
|
-
// rowSelectionDefaultRows.length > 0
|
|
406
|
-
// ) {
|
|
407
|
-
// rowSelectionRef.current = {
|
|
408
|
-
// selectedRowKeys,
|
|
409
|
-
// selectedRows: rowSelectionDefaultRows,
|
|
410
|
-
// };
|
|
411
|
-
// update({});
|
|
412
|
-
// }
|
|
413
|
-
// }, [rowSelectionDefaultRows]);
|
|
414
|
-
|
|
415
421
|
// 查询按钮
|
|
416
422
|
var onSearch = function onSearch() {
|
|
423
|
+
var _table$rowSelection, _table$rowSelection$o;
|
|
424
|
+
// @ts-ignore
|
|
425
|
+
table === null || table === void 0 || (_table$rowSelection = table.rowSelection) === null || _table$rowSelection === void 0 || (_table$rowSelection$o = _table$rowSelection.onClearByProTable) === null || _table$rowSelection$o === void 0 || _table$rowSelection$o.call(_table$rowSelection);
|
|
417
426
|
onRequest(TableEvent.Search);
|
|
418
427
|
};
|
|
419
428
|
|
|
420
|
-
// ==================== 封装table行选中逻辑 start====================
|
|
421
|
-
var _ref3 = rowSelection || {},
|
|
422
|
-
selectedRowKeys = _ref3.selectedRowKeys,
|
|
423
|
-
onRowChange = _ref3.onChange,
|
|
424
|
-
rsProps = _objectWithoutProperties(_ref3, _excluded);
|
|
425
|
-
var _rowSelectionRef$curr = rowSelectionRef.current.selectedRowKeys,
|
|
426
|
-
keys = _rowSelectionRef$curr === void 0 ? [] : _rowSelectionRef$curr;
|
|
427
|
-
|
|
428
|
-
// // 传入了选中的key,生成与之匹配的selectedRows数据
|
|
429
|
-
// if (
|
|
430
|
-
// rowSelection &&
|
|
431
|
-
// 'selectedRowKeys' in rowSelection &&
|
|
432
|
-
// !isEqual(selectedRowKeys, keys)
|
|
433
|
-
// ) {
|
|
434
|
-
// // 初始状态,传入了默认值,根据rowSelectionDefaultRows 生成选中rows
|
|
435
|
-
// if (
|
|
436
|
-
// selectedRowKeys.length > 0 &&
|
|
437
|
-
// keys.length === 0 &&
|
|
438
|
-
// (rowSelectionDefaultRows || []).length > 0
|
|
439
|
-
// ) {
|
|
440
|
-
// rowSelectionRef.current = {
|
|
441
|
-
// selectedRowKeys,
|
|
442
|
-
// selectedRows: rowSelectionDefaultRows,
|
|
443
|
-
// };
|
|
444
|
-
// }
|
|
445
|
-
|
|
446
|
-
// // 选中数据清空了,清空当前rowSelectionRef.current 数据
|
|
447
|
-
// if (selectedRowKeys.length === 0 && keys.length !== 0) {
|
|
448
|
-
// rowSelectionRef.current = { selectedRowKeys: [], selectedRows: [] };
|
|
449
|
-
// }
|
|
450
|
-
// }
|
|
451
|
-
|
|
452
|
-
// 行选择配置
|
|
453
|
-
var newRowSelection = rowSelection ? _objectSpread({
|
|
454
|
-
selectedRowKeys: selectedRowKeys || keys,
|
|
455
|
-
onChange: function onChange(keys, rows, info) {
|
|
456
|
-
onRowChange === null || onRowChange === void 0 || onRowChange(keys, rows, info);
|
|
457
|
-
// // row 中存在undefined记录,由于初始渲染造成无法获取选中记录,需从rowSelectionDefaultRows 中获取
|
|
458
|
-
// rows.forEach((row, index) => {
|
|
459
|
-
// if (!row) {
|
|
460
|
-
// const defaultRow = rowSelectionDefaultRows?.find(
|
|
461
|
-
// (rs: any) => rs[rowKey || 'id'] === keys[index],
|
|
462
|
-
// );
|
|
463
|
-
// CcsUtils.showWarning(
|
|
464
|
-
// !!defaultRow,
|
|
465
|
-
// 'CcsProTable:存在未知选中记录,请使用rowSelectionDefaultRows传入初始选中记录',
|
|
466
|
-
// );
|
|
467
|
-
// rows[index] = defaultRow || ({} as RecordType);
|
|
468
|
-
// }
|
|
469
|
-
// });
|
|
470
|
-
// rowSelectionRef.current = {
|
|
471
|
-
// selectedRowKeys: keys,
|
|
472
|
-
// selectedRows: rows,
|
|
473
|
-
// };
|
|
474
|
-
onEvent === null || onEvent === void 0 || onEvent(TableEvent.SelectedRows, {
|
|
475
|
-
keys: keys,
|
|
476
|
-
rows: rows
|
|
477
|
-
});
|
|
478
|
-
|
|
479
|
-
// 未传入onChange则更新状态
|
|
480
|
-
if (!onRowChange) update({});
|
|
481
|
-
},
|
|
482
|
-
preserveSelectedRowKeys: true
|
|
483
|
-
}, rsProps) : undefined;
|
|
484
|
-
// ==================== 当处于受控状态,处理table选中记录 end====================
|
|
485
|
-
|
|
486
|
-
// 清除选择
|
|
487
|
-
var onClearSelected = function onClearSelected(key, noUpdate) {
|
|
488
|
-
var _rowSelection$onChang2;
|
|
489
|
-
// 指定删除
|
|
490
|
-
if (key !== undefined) {
|
|
491
|
-
var _rowSelectionRef$curr2 = rowSelectionRef.current,
|
|
492
|
-
_rowSelectionRef$curr3 = _rowSelectionRef$curr2.selectedRowKeys,
|
|
493
|
-
_selectedRowKeys = _rowSelectionRef$curr3 === void 0 ? [] : _rowSelectionRef$curr3,
|
|
494
|
-
_rowSelectionRef$curr4 = _rowSelectionRef$curr2.selectedRows,
|
|
495
|
-
selectedRows = _rowSelectionRef$curr4 === void 0 ? [] : _rowSelectionRef$curr4;
|
|
496
|
-
rowSelectionRef.current = {
|
|
497
|
-
selectedRowKeys: _selectedRowKeys.filter(function (r) {
|
|
498
|
-
return r !== key;
|
|
499
|
-
}),
|
|
500
|
-
selectedRows: selectedRows.filter(function (r) {
|
|
501
|
-
return r[rowKey || 'id'] !== key;
|
|
502
|
-
})
|
|
503
|
-
};
|
|
504
|
-
} else {
|
|
505
|
-
// 删除全部
|
|
506
|
-
rowSelectionRef.current = {
|
|
507
|
-
selectedRowKeys: undefined,
|
|
508
|
-
selectedRows: undefined
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
var _rowSelectionRef$curr5 = rowSelectionRef.current,
|
|
512
|
-
keys = _rowSelectionRef$curr5.selectedRowKeys,
|
|
513
|
-
_rowSelectionRef$curr6 = _rowSelectionRef$curr5.selectedRows,
|
|
514
|
-
rows = _rowSelectionRef$curr6 === void 0 ? [] : _rowSelectionRef$curr6;
|
|
515
|
-
onEvent === null || onEvent === void 0 || onEvent(TableEvent.SelectedRows, {
|
|
516
|
-
keys: keys,
|
|
517
|
-
rows: rows
|
|
518
|
-
});
|
|
519
|
-
|
|
520
|
-
// 受控状态,需要调用onchange
|
|
521
|
-
if (rowSelection !== null && rowSelection !== void 0 && rowSelection.onChange) {
|
|
522
|
-
var _rowSelection$onChang;
|
|
523
|
-
rowSelection === null || rowSelection === void 0 || (_rowSelection$onChang = rowSelection.onChange) === null || _rowSelection$onChang === void 0 || _rowSelection$onChang.call(rowSelection, keys, rows, {});
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
if (!noUpdate)
|
|
527
|
-
// 需要更新状态
|
|
528
|
-
update({});
|
|
529
|
-
rowSelection === null || rowSelection === void 0 || (_rowSelection$onChang2 = rowSelection.onChange) === null || _rowSelection$onChang2 === void 0 || _rowSelection$onChang2.call(rowSelection, selectedRowKeys, rows, {});
|
|
530
|
-
};
|
|
531
|
-
|
|
532
429
|
// 重置
|
|
533
430
|
var onReset = function onReset() {
|
|
534
|
-
var _formRef$current2;
|
|
535
|
-
//
|
|
536
|
-
|
|
431
|
+
var _table$rowSelection2, _table$rowSelection2$, _formRef$current2;
|
|
432
|
+
// @ts-ignore
|
|
433
|
+
table === null || table === void 0 || (_table$rowSelection2 = table.rowSelection) === null || _table$rowSelection2 === void 0 || (_table$rowSelection2$ = _table$rowSelection2.onClearByProTable) === null || _table$rowSelection2$ === void 0 || _table$rowSelection2$.call(_table$rowSelection2);
|
|
537
434
|
// 重置表单
|
|
538
435
|
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.resetFields();
|
|
539
436
|
// 清空columns显示filter和sort值
|
|
@@ -552,7 +449,9 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
552
449
|
|
|
553
450
|
// 刷新
|
|
554
451
|
var onReload = function onReload() {
|
|
555
|
-
|
|
452
|
+
var _table$rowSelection3, _table$rowSelection3$;
|
|
453
|
+
// @ts-ignore
|
|
454
|
+
table === null || table === void 0 || (_table$rowSelection3 = table.rowSelection) === null || _table$rowSelection3 === void 0 || (_table$rowSelection3$ = _table$rowSelection3.onClearByProTable) === null || _table$rowSelection3$ === void 0 || _table$rowSelection3$.call(_table$rowSelection3);
|
|
556
455
|
onRequest(TableEvent.Reload, data.current, data.pageSize);
|
|
557
456
|
};
|
|
558
457
|
|
|
@@ -560,17 +459,14 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
560
459
|
useImperativeHandle(proRef, function () {
|
|
561
460
|
return {
|
|
562
461
|
data: data,
|
|
563
|
-
|
|
564
|
-
formValues: searchParamRef.current,
|
|
565
|
-
searchParam: searchParamRef.current,
|
|
462
|
+
getFormValues: getFormValues,
|
|
566
463
|
onSearch: onSearch,
|
|
567
464
|
onReload: onReload,
|
|
568
465
|
onPartialReload: function onPartialReload(param) {
|
|
569
466
|
_onPartialReload(param);
|
|
570
467
|
},
|
|
571
468
|
onReset: onReset,
|
|
572
|
-
onChangeData: setData
|
|
573
|
-
onClearSelected: onClearSelected
|
|
469
|
+
onChangeData: setData
|
|
574
470
|
};
|
|
575
471
|
});
|
|
576
472
|
|
|
@@ -632,12 +528,6 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
632
528
|
}
|
|
633
529
|
onRequest(TableEvent.ChangePage, paginationTable.current || 0, paginationTable.pageSize || 10);
|
|
634
530
|
};
|
|
635
|
-
|
|
636
|
-
// 扩展组件传递参数
|
|
637
|
-
var extraProps = _objectSpread(_objectSpread({}, rowSelectionRef.current), {}, {
|
|
638
|
-
data: data.dataSource || [],
|
|
639
|
-
onClear: onClearSelected
|
|
640
|
-
});
|
|
641
531
|
var renderTable = function renderTable() {
|
|
642
532
|
if (!table) return null;
|
|
643
533
|
if (!isAuth) {
|
|
@@ -645,7 +535,8 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
645
535
|
style: {
|
|
646
536
|
margin: 0,
|
|
647
537
|
padding: '32px 0',
|
|
648
|
-
color: 'red'
|
|
538
|
+
color: 'red',
|
|
539
|
+
background: '#fff'
|
|
649
540
|
},
|
|
650
541
|
image: Empty.PRESENTED_IMAGE_DEFAULT,
|
|
651
542
|
description: "\u6CA1\u6709\u6570\u636E\u8BF7\u6C42\u6743\u9650"
|
|
@@ -663,19 +554,11 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
663
554
|
}
|
|
664
555
|
}
|
|
665
556
|
|
|
666
|
-
// table title
|
|
667
|
-
var tableTitle = CcsUtils.isFunction(table.title) ? table.title(extraProps) : undefined;
|
|
668
|
-
|
|
669
557
|
// 异步树
|
|
670
558
|
if (parentFieldName) {
|
|
671
559
|
return /*#__PURE__*/_jsx(TableTree, {
|
|
672
560
|
data: data,
|
|
673
|
-
table:
|
|
674
|
-
rowSelection: newRowSelection,
|
|
675
|
-
title: tableTitle ? function () {
|
|
676
|
-
return tableTitle;
|
|
677
|
-
} : undefined
|
|
678
|
-
}),
|
|
561
|
+
table: table,
|
|
679
562
|
leafNode: leafNode,
|
|
680
563
|
treeRef: treeRef,
|
|
681
564
|
tableRef: tableRef,
|
|
@@ -684,6 +567,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
684
567
|
sticky: stickyRef.current || true,
|
|
685
568
|
parentFieldName: parentFieldName,
|
|
686
569
|
setData: setData,
|
|
570
|
+
onEvent: onEvent,
|
|
687
571
|
handlePageChange: handlePageChange
|
|
688
572
|
});
|
|
689
573
|
}
|
|
@@ -697,17 +581,11 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
697
581
|
size: tableRowSize,
|
|
698
582
|
columns: columns,
|
|
699
583
|
showSorterTooltip: true,
|
|
700
|
-
rowSelection: newRowSelection,
|
|
701
584
|
showNumber: props.showNumber,
|
|
702
585
|
loading: table.loading || data.loading || false,
|
|
703
|
-
title: tableTitle ? function () {
|
|
704
|
-
return tableTitle;
|
|
705
|
-
} : undefined,
|
|
706
586
|
onEvent: onEvent
|
|
707
587
|
}));
|
|
708
588
|
};
|
|
709
|
-
var _antTheme$useToken = antTheme.useToken(),
|
|
710
|
-
token = _antTheme$useToken.token;
|
|
711
589
|
var rootStyle = styles.root || {};
|
|
712
590
|
if (bordered) {
|
|
713
591
|
rootStyle = _objectSpread({
|
|
@@ -754,34 +632,34 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
754
632
|
|
|
755
633
|
// 有查询条件
|
|
756
634
|
var hasFormItem = formItems.length > 0;
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
var tableToolbar = CcsUtils.isFunction(toolbar) ? toolbar(extraProps) : toolbar;
|
|
635
|
+
// 头部间距
|
|
636
|
+
var tokenPadding = tableRowSize === 'small' ? token.paddingSM : token.padding;
|
|
760
637
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
761
638
|
children: [/*#__PURE__*/_jsx(CcsResizeObserver.Target, {
|
|
762
639
|
targetRef: tableContentRef,
|
|
763
640
|
onResize: onResize
|
|
764
641
|
}), /*#__PURE__*/_jsxs("div", {
|
|
765
642
|
className: classNames(classPrefix, className, _defineProperty({}, 'dark-table', isDark)),
|
|
766
|
-
style: _objectSpread(_objectSpread({}, rootStyle),
|
|
767
|
-
overflow:
|
|
768
|
-
|
|
643
|
+
style: _objectSpread(_objectSpread({}, rootStyle), (table === null || table === void 0 || (_table$scroll2 = table.scroll) === null || _table$scroll2 === void 0 ? void 0 : _table$scroll2.y) === 'auto' ? {
|
|
644
|
+
overflow: 'hidden',
|
|
645
|
+
height: '100%'
|
|
646
|
+
} : {}),
|
|
769
647
|
ref: containerRef,
|
|
770
648
|
children: [/*#__PURE__*/_jsx(Card, {
|
|
771
|
-
className: "ccs-pl-adaptation",
|
|
772
649
|
style: {
|
|
773
|
-
boxShadow: 'none'
|
|
650
|
+
boxShadow: 'none',
|
|
651
|
+
borderRadius: 0
|
|
774
652
|
},
|
|
775
653
|
styles: {
|
|
776
654
|
body: {
|
|
777
|
-
padding: hasFormItem ?
|
|
655
|
+
padding: hasFormItem ? tokenPadding : 0
|
|
778
656
|
}
|
|
779
657
|
},
|
|
780
658
|
variant: "borderless",
|
|
781
659
|
title: props.title,
|
|
782
660
|
children: hasFormItem && /*#__PURE__*/_jsx(HeadComponent, {
|
|
783
661
|
formRef: formRef,
|
|
784
|
-
toolbar:
|
|
662
|
+
toolbar: toolbar,
|
|
785
663
|
formItems: formItems,
|
|
786
664
|
expandForm: expandForm,
|
|
787
665
|
formInitValues: formInitValues,
|
|
@@ -798,7 +676,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
798
676
|
display: 'flex',
|
|
799
677
|
justifyContent: 'space-between',
|
|
800
678
|
width: '100%',
|
|
801
|
-
padding:
|
|
679
|
+
padding: "".concat(token.paddingSM, "px ").concat(tokenPadding, "px"),
|
|
802
680
|
alignContent: 'center'
|
|
803
681
|
}
|
|
804
682
|
},
|
|
@@ -813,7 +691,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
813
691
|
style: {
|
|
814
692
|
flex: '1 1 auto'
|
|
815
693
|
},
|
|
816
|
-
children:
|
|
694
|
+
children: toolbar
|
|
817
695
|
}), /*#__PURE__*/_jsx("div", {
|
|
818
696
|
style: {
|
|
819
697
|
flex: '0 0 auto'
|