@teamix/pro 1.5.37 → 1.5.39

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.
@@ -1,12 +1,12 @@
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 = ["addonAfter", "addonBefore", "mode", "purePanel", "expand", "formRef", "defaultFilterValue", "filterValues", "filterDebounce", "bindUrl", "onFilter", "onInit", "onReset", "onExpand", "onChange", "form"];
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) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
4
  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
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
6
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ 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; }
8
+ 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; }
9
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
10
  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 method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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; }
11
11
  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); } }
12
12
  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); }); }; }
@@ -322,7 +322,17 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
322
322
  }, []);
323
323
  // 设置筛选数据
324
324
  var configFilterItem = useCallback(function (form) {
325
- filterItem.current = getFilterDisplayValues(form);
325
+ var _getFilterDisplayValu;
326
+ filterItem.current = (_getFilterDisplayValu = getFilterDisplayValues(form)) === null || _getFilterDisplayValu === void 0 ? void 0 : _getFilterDisplayValu.map(function (item) {
327
+ var _props$schema, _props$schema$find;
328
+ // 需要找到 props 作为 proField 标签内渲染用
329
+ var schemaFieldProps = (_props$schema = props.schema) === null || _props$schema === void 0 ? void 0 : (_props$schema$find = _props$schema.find) === null || _props$schema$find === void 0 ? void 0 : _props$schema$find.call(_props$schema, function (schemaItem) {
330
+ return (item === null || item === void 0 ? void 0 : item.key) === (schemaItem === null || schemaItem === void 0 ? void 0 : schemaItem.name);
331
+ });
332
+ return _objectSpread(_objectSpread({}, item), {}, {
333
+ props: schemaFieldProps === null || schemaFieldProps === void 0 ? void 0 : schemaFieldProps.props
334
+ });
335
+ });
326
336
  }, []);
327
337
  // 设置标签数据
328
338
  var configTag = useCallback(function () {
@@ -487,7 +497,8 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
487
497
  label = _ref8.label,
488
498
  value = _ref8.value,
489
499
  type = _ref8.type,
490
- index = _ref8.index;
500
+ index = _ref8.index,
501
+ props = _ref8.props;
491
502
  return /*#__PURE__*/React.createElement(Tag.Closeable, {
492
503
  key: isNum(index) ? key + label : key,
493
504
  afterClose: function afterClose() {
@@ -497,10 +508,10 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
497
508
  className: prefixCls('tag-title')
498
509
  }, label), /*#__PURE__*/React.createElement("span", {
499
510
  className: prefixCls('tag-content')
500
- }, /*#__PURE__*/React.createElement(ProField, {
511
+ }, /*#__PURE__*/React.createElement(ProField, _objectSpread({
501
512
  type: type,
502
513
  value: value
503
- })));
514
+ }, props !== null && props !== void 0 ? props : {}))));
504
515
  })) : null);
505
516
  });
506
517
  QueryFilter.defaultProps = {
package/es/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.37";
33
+ declare const version = "1.5.39";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -37,7 +37,7 @@ export * from './sidebar';
37
37
  export * from './utils';
38
38
  export * from './timeline';
39
39
  export * from './image';
40
- var version = '1.5.37';
40
+ var version = '1.5.39';
41
41
  // By TeamixTest
42
42
  window.postMessage({
43
43
  source: 'teamix-test-devtools',
@@ -76,7 +76,7 @@ var Cell = function Cell(props) {
76
76
  }
77
77
  }, itemProps);
78
78
  }
79
- if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
79
+ if ((render === null || render === void 0 ? void 0 : render.type) === 'step' || (render === null || render === void 0 ? void 0 : render.type) === 'groupTag') {
80
80
  newRender = _objectSpread(_objectSpread({}, newRender), {}, {
81
81
  ellipsis: false
82
82
  });
package/es/table/index.js CHANGED
@@ -545,7 +545,7 @@ var ProTable = function ProTable(props) {
545
545
  }
546
546
  });
547
547
  // 绑定 Actions
548
- useActionType(actionRef, {
548
+ actionRef.current = useActionType(actionRef, {
549
549
  fullScreen: function fullScreen() {
550
550
  var _actionRef$current2, _actionRef$current2$s;
551
551
  var state = !fullscreenState;
@@ -815,7 +815,7 @@ var ProTable = function ProTable(props) {
815
815
  });
816
816
  // 请求函数
817
817
  var _request = useCallback(function (params, noLoading, filterParams, isReset) {
818
- var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread3;
818
+ var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _actionRef$current7, _actionRef$current7$p, _actionRef$current8, _actionRef$current8$p, _objectSpread3;
819
819
  // 首次渲染表格,获取 urlState 上的 表头 filter 数据
820
820
  if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && dataRef.current.flag) {
821
821
  getUrlStateFilter(urlState !== null && urlState !== void 0 ? urlState : {}, actionRef);
@@ -836,7 +836,7 @@ var ProTable = function ProTable(props) {
836
836
  var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
837
837
  // 格式化后的请求参数
838
838
  var requestData = {};
839
- var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3))), params);
839
+ var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, (actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$p = _actionRef$current7.pageInfo) === null || _actionRef$current7$p === void 0 ? void 0 : _actionRef$current7$p.current) || currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, (actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$p = _actionRef$current8.pageInfo) === null || _actionRef$current8$p === void 0 ? void 0 : _actionRef$current8$p.pageSize) || pageSize), _objectSpread3))), params);
840
840
  if (typeof formatParams === 'string') {
841
841
  requestData = getTargetValue(formatParams, {
842
842
  params: preParams
@@ -929,7 +929,7 @@ var ProTable = function ProTable(props) {
929
929
  getData.run(requestData);
930
930
  }
931
931
  }
932
- }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams]);
932
+ }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams, actionRef.current]);
933
933
  var onSort = useCallback(function (dataIndex, order) {
934
934
  var nextSort = _defineProperty({}, dataIndex, order);
935
935
  setSort(nextSort);
@@ -949,7 +949,7 @@ var ProTable = function ProTable(props) {
949
949
  return true;
950
950
  } : undefined,
951
951
  onFilter: function onFilter(values) {
952
- var _actionRef$current7, _actionRef$current7$c, _request8;
952
+ var _actionRef$current9, _actionRef$current9$c, _request8;
953
953
  // 全屏状态,判断全屏表单onFilter是否禁用
954
954
  if (fullscreenState && !filterEnableRef.current.fullscreen) {
955
955
  filterEnableRef.current.fullscreen = true;
@@ -968,7 +968,7 @@ var ProTable = function ProTable(props) {
968
968
  }
969
969
  }
970
970
  // 搜索变化时,暂时先清空选择
971
- (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
971
+ (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$c = _actionRef$current9.clearRowSelection) === null || _actionRef$current9$c === void 0 ? void 0 : _actionRef$current9$c.call(_actionRef$current9);
972
972
  setCurrentPage(1);
973
973
  _request((_request8 = {}, _defineProperty(_request8, targetPageKey, 1), _defineProperty(_request8, targetPageSizeKey, pageSize), _request8), false, values);
974
974
  },
@@ -1007,7 +1007,9 @@ var ProTable = function ProTable(props) {
1007
1007
  mainAction: mainAction,
1008
1008
  extra: extra,
1009
1009
  toolBar: toolBar,
1010
- actionRef: actionRef,
1010
+ actionRef: {
1011
+ current: actionRef.current
1012
+ },
1011
1013
  columns: propsColumns,
1012
1014
  dataFilter: dataFilter,
1013
1015
  afterDataFilter: afterDataFilter,
@@ -1094,8 +1096,8 @@ var ProTable = function ProTable(props) {
1094
1096
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1095
1097
  // 翻页默认清空选择
1096
1098
  if (!reserveSelectedRecords) {
1097
- var _actionRef$current8, _actionRef$current8$c;
1098
- (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
1099
+ var _actionRef$current10, _actionRef$current10$;
1100
+ (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.clearRowSelection) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10);
1099
1101
  }
1100
1102
  setCurrentPage(currentPage);
1101
1103
  _request(_objectSpread((_objectSpread4 = {}, _defineProperty(_objectSpread4, targetPageKey, currentPage), _defineProperty(_objectSpread4, "pageSize", pageSize), _objectSpread4), params));
@@ -1104,13 +1106,13 @@ var ProTable = function ProTable(props) {
1104
1106
  var _request10;
1105
1107
  // 翻页默认清空选择
1106
1108
  if (!reserveSelectedRecords) {
1107
- var _actionRef$current9, _actionRef$current9$c;
1108
- (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$c = _actionRef$current9.clearRowSelection) === null || _actionRef$current9$c === void 0 ? void 0 : _actionRef$current9$c.call(_actionRef$current9);
1109
+ var _actionRef$current11, _actionRef$current11$;
1110
+ (_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.clearRowSelection) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11);
1109
1111
  }
1110
1112
  setPageSize(currentPageSize);
1111
1113
  setCurrentPage(1);
1112
1114
  _request((_request10 = {}, _defineProperty(_request10, targetPageSizeKey, currentPageSize), _defineProperty(_request10, targetPageKey, 1), _request10));
1113
- }, [reserveSelectedRecords, actionRef, targetPageSizeKey, targetPageKey, currentPage]);
1115
+ }, [reserveSelectedRecords, actionRef.current, targetPageSizeKey, targetPageKey, currentPage]);
1114
1116
  var renderFooter = function renderFooter() {
1115
1117
  function renderRowSelection() {
1116
1118
  if (rowSelection) {
@@ -9,7 +9,71 @@ export declare function off(key: string): void;
9
9
  /** table 组件内触发事件 不对外暴露 */
10
10
  export declare function emit(key: string, ...args: any): void;
11
11
  export declare function initActionRef(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
12
- export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
12
+ export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): {
13
+ fullScreen?: (() => boolean) | undefined;
14
+ setColumn?: ((newColumns: ProTableColumnProps[], update?: boolean | undefined) => void) | undefined;
15
+ size?: "medium" | "small" | undefined;
16
+ setSize?: ((mode: "medium" | "small") => void) | undefined;
17
+ refresh?: ((params?: any) => void) | undefined;
18
+ request?: ((params?: any) => void) | undefined;
19
+ reset?: (() => void) | undefined;
20
+ rowSelection?: import("..").innerRowSelectionType | ({
21
+ getProps?: ((record: any, index: number) => any) | undefined;
22
+ onChange?: ((selectedRowKeys: any[], records: any[]) => void) | undefined;
23
+ onSelect?: ((selected: boolean, record: any, records: any[]) => void) | undefined;
24
+ onSelectAll?: ((selected: boolean, records: any[]) => void) | undefined;
25
+ selectedRowKeys?: any[] | undefined;
26
+ selectedRecords?: any[] | undefined;
27
+ mode?: "multiple" | "single" | undefined;
28
+ titleProps?: (() => any) | undefined;
29
+ columnProps?: (() => any) | undefined;
30
+ titleAddons?: (() => any) | undefined;
31
+ defaultSelectedRowKeys?: any[] | undefined;
32
+ defaultSelectedRecords?: any[] | undefined;
33
+ } & {
34
+ getProps?: ((record: any, index: number) => void) | undefined;
35
+ onChange?: ((selectedRowKeys: any[], records: any[]) => void) | undefined;
36
+ onSelect?: ((selected: boolean, record: any, records: any[]) => void) | undefined;
37
+ onSelectAll?: ((selected: boolean, records: any[]) => void) | undefined;
38
+ selectedRowKeys?: any[] | undefined;
39
+ mode?: "multiple" | "single" | undefined;
40
+ titleProps?: (() => any) | undefined;
41
+ columnProps?: (() => any) | undefined;
42
+ titleAddons?: (() => any) | undefined;
43
+ }) | undefined;
44
+ clearRowSelection?: (() => void) | undefined;
45
+ filterDataSource?: ((dataIndex: string) => void) | undefined;
46
+ pageInfo?: {
47
+ total?: number | undefined;
48
+ current?: number | undefined;
49
+ pageSize?: number | undefined;
50
+ targetPageKey?: string | undefined;
51
+ targetPageSizeKey?: string | undefined;
52
+ } | undefined;
53
+ resetPage?: (() => void) | undefined;
54
+ nextPage?: (() => void) | undefined;
55
+ dataFilterForm?: import("../..").ProFormType | undefined;
56
+ dataFilterFormRef?: import("react").MutableRefObject<import("../..").ProFormType> | undefined;
57
+ normalDataFilterForm?: import("../..").ProFormType | undefined;
58
+ fullscreenDataFilterForm?: import("../..").ProFormType | undefined;
59
+ filterEnableRef?: any;
60
+ data?: any[] | undefined;
61
+ switchView?: ((view: "table" | "card") => void) | undefined;
62
+ setData?: ((data: any[]) => void) | undefined;
63
+ setCardViewScrollPosition?: ((scrollTop: number) => void) | undefined;
64
+ setAutoRefreshTimers?: ((timers: number) => void) | undefined;
65
+ clearAutoRefreshTimers?: (() => void) | undefined;
66
+ getState?: (() => import("..").ProTableActionTypeState) | undefined;
67
+ setState?: ((key: string, value: any) => void) | undefined;
68
+ setFullScreenState?: ((state: boolean) => void) | undefined;
69
+ on?: ((...args: any) => void) | undefined;
70
+ off?: ((...args: any) => void) | undefined;
71
+ setFilterRules?: ((rules: import("..").ProTableColumnsFilterRulesItem) => void) | undefined;
72
+ getFilterRules?: (() => object) | undefined;
73
+ resetTableMaxBodyHeight?: ((offset: number) => void) | undefined;
74
+ filterColumns?: any[] | undefined;
75
+ getCallback?: (() => any) | undefined;
76
+ };
13
77
  export declare function cloneDeep<T>(obj: T): T;
14
78
  /**
15
79
  * 处理默认过滤参数
@@ -92,6 +92,7 @@ export function initActionRef(ref, action) {
92
92
  }
93
93
  export function useActionType(ref, action) {
94
94
  ref.current = _objectSpread(_objectSpread({}, ref.current), action);
95
+ return _objectSpread(_objectSpread({}, ref.current), action);
95
96
  }
96
97
  export function cloneDeep(obj) {
97
98
  return cloneDeepLodash(obj);
@@ -18,7 +18,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  * 处理表格 rowSelection hooks
19
19
  * 除了基本 rowSelection 之外返回平铺后的 selectedRowKeys、selectedRecords
20
20
  */
21
- import React, { useState } from 'react';
21
+ import React, { useEffect, useState } from 'react';
22
22
  import { getDeepValue } from '@teamix/utils';
23
23
  import { Balloon, Checkbox } from '@alicloudfe/components';
24
24
  var Tooltip = Balloon.Tooltip;
@@ -30,7 +30,7 @@ function useTableSelection() {
30
30
  defaultSelectedRecords = _config$defaultSelect === void 0 ? [] : _config$defaultSelect,
31
31
  _config$defaultSelect2 = config.defaultSelectedRowKeys,
32
32
  defaultSelectedRowKeys = _config$defaultSelect2 === void 0 ? [] : _config$defaultSelect2;
33
- var _useState = useState(defaultSelectedRowKeys),
33
+ var _useState = useState(config.selectedRowKeys || defaultSelectedRowKeys),
34
34
  _useState2 = _slicedToArray(_useState, 2),
35
35
  selectedRowKeys = _useState2[0],
36
36
  setSelectedRowKeys = _useState2[1];
@@ -38,6 +38,10 @@ function useTableSelection() {
38
38
  _useState4 = _slicedToArray(_useState3, 2),
39
39
  selectedRecords = _useState4[0],
40
40
  setSelectedRecords = _useState4[1];
41
+ useEffect(function () {
42
+ var _config$selectedRowKe;
43
+ setSelectedRowKeys((_config$selectedRowKe = config === null || config === void 0 ? void 0 : config.selectedRowKeys) !== null && _config$selectedRowKe !== void 0 ? _config$selectedRowKe : []);
44
+ }, [config.selectedRowKeys]);
41
45
  function _onChange(value, records) {
42
46
  if (primaryKey) {
43
47
  var newValue = value.filter(function (v) {
@@ -31,13 +31,13 @@ var _excluded = ["addonAfter", "addonBefore", "mode", "purePanel", "expand", "fo
31
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
33
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
34
- 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; }
35
- 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; }
36
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
37
34
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
38
35
  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."); }
39
36
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
40
37
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
38
+ 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; }
39
+ 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; }
40
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
41
  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 method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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; }
42
42
  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); } }
43
43
  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); }); }; }
@@ -337,7 +337,17 @@ var QueryFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
337
337
  }, []);
338
338
  // 设置筛选数据
339
339
  var configFilterItem = (0, _react.useCallback)(function (form) {
340
- filterItem.current = getFilterDisplayValues(form);
340
+ var _getFilterDisplayValu;
341
+ filterItem.current = (_getFilterDisplayValu = getFilterDisplayValues(form)) === null || _getFilterDisplayValu === void 0 ? void 0 : _getFilterDisplayValu.map(function (item) {
342
+ var _props$schema, _props$schema$find;
343
+ // 需要找到 props 作为 proField 标签内渲染用
344
+ var schemaFieldProps = (_props$schema = props.schema) === null || _props$schema === void 0 ? void 0 : (_props$schema$find = _props$schema.find) === null || _props$schema$find === void 0 ? void 0 : _props$schema$find.call(_props$schema, function (schemaItem) {
345
+ return (item === null || item === void 0 ? void 0 : item.key) === (schemaItem === null || schemaItem === void 0 ? void 0 : schemaItem.name);
346
+ });
347
+ return _objectSpread(_objectSpread({}, item), {}, {
348
+ props: schemaFieldProps === null || schemaFieldProps === void 0 ? void 0 : schemaFieldProps.props
349
+ });
350
+ });
341
351
  }, []);
342
352
  // 设置标签数据
343
353
  var configTag = (0, _react.useCallback)(function () {
@@ -502,7 +512,8 @@ var QueryFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
502
512
  label = _ref8.label,
503
513
  value = _ref8.value,
504
514
  type = _ref8.type,
505
- index = _ref8.index;
515
+ index = _ref8.index,
516
+ props = _ref8.props;
506
517
  return /*#__PURE__*/_react.default.createElement(_components.Tag.Closeable, {
507
518
  key: (0, _utils.isNum)(index) ? key + label : key,
508
519
  afterClose: function afterClose() {
@@ -512,10 +523,10 @@ var QueryFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
512
523
  className: prefixCls('tag-title')
513
524
  }, label), /*#__PURE__*/_react.default.createElement("span", {
514
525
  className: prefixCls('tag-content')
515
- }, /*#__PURE__*/_react.default.createElement(_index.default, {
526
+ }, /*#__PURE__*/_react.default.createElement(_index.default, _objectSpread({
516
527
  type: type,
517
528
  value: value
518
- })));
529
+ }, props !== null && props !== void 0 ? props : {}))));
519
530
  })) : null);
520
531
  });
521
532
  exports.QueryFilter = QueryFilter;
package/lib/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.37";
33
+ declare const version = "1.5.39";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/lib/index.js CHANGED
@@ -299,7 +299,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
299
299
  if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
300
300
  _icon.default.setConfig(_utils.default.getTeamixIconConfig());
301
301
  }
302
- var version = '1.5.37';
302
+ var version = '1.5.39';
303
303
  // By TeamixTest
304
304
  exports.version = version;
305
305
  window.postMessage({
@@ -80,7 +80,7 @@ var Cell = function Cell(props) {
80
80
  }
81
81
  }, itemProps);
82
82
  }
83
- if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
83
+ if ((render === null || render === void 0 ? void 0 : render.type) === 'step' || (render === null || render === void 0 ? void 0 : render.type) === 'groupTag') {
84
84
  newRender = _objectSpread(_objectSpread({}, newRender), {}, {
85
85
  ellipsis: false
86
86
  });
@@ -566,7 +566,7 @@ var ProTable = function ProTable(props) {
566
566
  }
567
567
  });
568
568
  // 绑定 Actions
569
- (0, _utils2.useActionType)(actionRef, {
569
+ actionRef.current = (0, _utils2.useActionType)(actionRef, {
570
570
  fullScreen: function fullScreen() {
571
571
  var _actionRef$current2, _actionRef$current2$s;
572
572
  var state = !fullscreenState;
@@ -836,7 +836,7 @@ var ProTable = function ProTable(props) {
836
836
  });
837
837
  // 请求函数
838
838
  var _request = (0, _react.useCallback)(function (params, noLoading, filterParams, isReset) {
839
- var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread3;
839
+ var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _actionRef$current7, _actionRef$current7$p, _actionRef$current8, _actionRef$current8$p, _objectSpread3;
840
840
  // 首次渲染表格,获取 urlState 上的 表头 filter 数据
841
841
  if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && dataRef.current.flag) {
842
842
  (0, _util.getUrlStateFilter)(urlState !== null && urlState !== void 0 ? urlState : {}, actionRef);
@@ -857,7 +857,7 @@ var ProTable = function ProTable(props) {
857
857
  var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
858
858
  // 格式化后的请求参数
859
859
  var requestData = {};
860
- var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3))), params);
860
+ var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, (actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$p = _actionRef$current7.pageInfo) === null || _actionRef$current7$p === void 0 ? void 0 : _actionRef$current7$p.current) || currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, (actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$p = _actionRef$current8.pageInfo) === null || _actionRef$current8$p === void 0 ? void 0 : _actionRef$current8$p.pageSize) || pageSize), _objectSpread3))), params);
861
861
  if (typeof formatParams === 'string') {
862
862
  requestData = (0, _utils.getTargetValue)(formatParams, {
863
863
  params: preParams
@@ -950,7 +950,7 @@ var ProTable = function ProTable(props) {
950
950
  getData.run(requestData);
951
951
  }
952
952
  }
953
- }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams]);
953
+ }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams, actionRef.current]);
954
954
  var onSort = (0, _react.useCallback)(function (dataIndex, order) {
955
955
  var nextSort = _defineProperty({}, dataIndex, order);
956
956
  setSort(nextSort);
@@ -970,7 +970,7 @@ var ProTable = function ProTable(props) {
970
970
  return true;
971
971
  } : undefined,
972
972
  onFilter: function onFilter(values) {
973
- var _actionRef$current7, _actionRef$current7$c, _request8;
973
+ var _actionRef$current9, _actionRef$current9$c, _request8;
974
974
  // 全屏状态,判断全屏表单onFilter是否禁用
975
975
  if (fullscreenState && !filterEnableRef.current.fullscreen) {
976
976
  filterEnableRef.current.fullscreen = true;
@@ -989,7 +989,7 @@ var ProTable = function ProTable(props) {
989
989
  }
990
990
  }
991
991
  // 搜索变化时,暂时先清空选择
992
- (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
992
+ (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$c = _actionRef$current9.clearRowSelection) === null || _actionRef$current9$c === void 0 ? void 0 : _actionRef$current9$c.call(_actionRef$current9);
993
993
  setCurrentPage(1);
994
994
  _request((_request8 = {}, _defineProperty(_request8, targetPageKey, 1), _defineProperty(_request8, targetPageSizeKey, pageSize), _request8), false, values);
995
995
  },
@@ -1028,7 +1028,9 @@ var ProTable = function ProTable(props) {
1028
1028
  mainAction: mainAction,
1029
1029
  extra: extra,
1030
1030
  toolBar: toolBar,
1031
- actionRef: actionRef,
1031
+ actionRef: {
1032
+ current: actionRef.current
1033
+ },
1032
1034
  columns: propsColumns,
1033
1035
  dataFilter: dataFilter,
1034
1036
  afterDataFilter: afterDataFilter,
@@ -1115,8 +1117,8 @@ var ProTable = function ProTable(props) {
1115
1117
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1116
1118
  // 翻页默认清空选择
1117
1119
  if (!reserveSelectedRecords) {
1118
- var _actionRef$current8, _actionRef$current8$c;
1119
- (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
1120
+ var _actionRef$current10, _actionRef$current10$;
1121
+ (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.clearRowSelection) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10);
1120
1122
  }
1121
1123
  setCurrentPage(currentPage);
1122
1124
  _request(_objectSpread((_objectSpread4 = {}, _defineProperty(_objectSpread4, targetPageKey, currentPage), _defineProperty(_objectSpread4, "pageSize", pageSize), _objectSpread4), params));
@@ -1125,13 +1127,13 @@ var ProTable = function ProTable(props) {
1125
1127
  var _request10;
1126
1128
  // 翻页默认清空选择
1127
1129
  if (!reserveSelectedRecords) {
1128
- var _actionRef$current9, _actionRef$current9$c;
1129
- (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$c = _actionRef$current9.clearRowSelection) === null || _actionRef$current9$c === void 0 ? void 0 : _actionRef$current9$c.call(_actionRef$current9);
1130
+ var _actionRef$current11, _actionRef$current11$;
1131
+ (_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.clearRowSelection) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11);
1130
1132
  }
1131
1133
  setPageSize(currentPageSize);
1132
1134
  setCurrentPage(1);
1133
1135
  _request((_request10 = {}, _defineProperty(_request10, targetPageSizeKey, currentPageSize), _defineProperty(_request10, targetPageKey, 1), _request10));
1134
- }, [reserveSelectedRecords, actionRef, targetPageSizeKey, targetPageKey, currentPage]);
1136
+ }, [reserveSelectedRecords, actionRef.current, targetPageSizeKey, targetPageKey, currentPage]);
1135
1137
  var renderFooter = function renderFooter() {
1136
1138
  function renderRowSelection() {
1137
1139
  if (rowSelection) {
@@ -9,7 +9,71 @@ export declare function off(key: string): void;
9
9
  /** table 组件内触发事件 不对外暴露 */
10
10
  export declare function emit(key: string, ...args: any): void;
11
11
  export declare function initActionRef(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
12
- export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
12
+ export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): {
13
+ fullScreen?: (() => boolean) | undefined;
14
+ setColumn?: ((newColumns: ProTableColumnProps[], update?: boolean | undefined) => void) | undefined;
15
+ size?: "medium" | "small" | undefined;
16
+ setSize?: ((mode: "medium" | "small") => void) | undefined;
17
+ refresh?: ((params?: any) => void) | undefined;
18
+ request?: ((params?: any) => void) | undefined;
19
+ reset?: (() => void) | undefined;
20
+ rowSelection?: import("..").innerRowSelectionType | ({
21
+ getProps?: ((record: any, index: number) => any) | undefined;
22
+ onChange?: ((selectedRowKeys: any[], records: any[]) => void) | undefined;
23
+ onSelect?: ((selected: boolean, record: any, records: any[]) => void) | undefined;
24
+ onSelectAll?: ((selected: boolean, records: any[]) => void) | undefined;
25
+ selectedRowKeys?: any[] | undefined;
26
+ selectedRecords?: any[] | undefined;
27
+ mode?: "multiple" | "single" | undefined;
28
+ titleProps?: (() => any) | undefined;
29
+ columnProps?: (() => any) | undefined;
30
+ titleAddons?: (() => any) | undefined;
31
+ defaultSelectedRowKeys?: any[] | undefined;
32
+ defaultSelectedRecords?: any[] | undefined;
33
+ } & {
34
+ getProps?: ((record: any, index: number) => void) | undefined;
35
+ onChange?: ((selectedRowKeys: any[], records: any[]) => void) | undefined;
36
+ onSelect?: ((selected: boolean, record: any, records: any[]) => void) | undefined;
37
+ onSelectAll?: ((selected: boolean, records: any[]) => void) | undefined;
38
+ selectedRowKeys?: any[] | undefined;
39
+ mode?: "multiple" | "single" | undefined;
40
+ titleProps?: (() => any) | undefined;
41
+ columnProps?: (() => any) | undefined;
42
+ titleAddons?: (() => any) | undefined;
43
+ }) | undefined;
44
+ clearRowSelection?: (() => void) | undefined;
45
+ filterDataSource?: ((dataIndex: string) => void) | undefined;
46
+ pageInfo?: {
47
+ total?: number | undefined;
48
+ current?: number | undefined;
49
+ pageSize?: number | undefined;
50
+ targetPageKey?: string | undefined;
51
+ targetPageSizeKey?: string | undefined;
52
+ } | undefined;
53
+ resetPage?: (() => void) | undefined;
54
+ nextPage?: (() => void) | undefined;
55
+ dataFilterForm?: import("../..").ProFormType | undefined;
56
+ dataFilterFormRef?: import("react").MutableRefObject<import("../..").ProFormType> | undefined;
57
+ normalDataFilterForm?: import("../..").ProFormType | undefined;
58
+ fullscreenDataFilterForm?: import("../..").ProFormType | undefined;
59
+ filterEnableRef?: any;
60
+ data?: any[] | undefined;
61
+ switchView?: ((view: "table" | "card") => void) | undefined;
62
+ setData?: ((data: any[]) => void) | undefined;
63
+ setCardViewScrollPosition?: ((scrollTop: number) => void) | undefined;
64
+ setAutoRefreshTimers?: ((timers: number) => void) | undefined;
65
+ clearAutoRefreshTimers?: (() => void) | undefined;
66
+ getState?: (() => import("..").ProTableActionTypeState) | undefined;
67
+ setState?: ((key: string, value: any) => void) | undefined;
68
+ setFullScreenState?: ((state: boolean) => void) | undefined;
69
+ on?: ((...args: any) => void) | undefined;
70
+ off?: ((...args: any) => void) | undefined;
71
+ setFilterRules?: ((rules: import("..").ProTableColumnsFilterRulesItem) => void) | undefined;
72
+ getFilterRules?: (() => object) | undefined;
73
+ resetTableMaxBodyHeight?: ((offset: number) => void) | undefined;
74
+ filterColumns?: any[] | undefined;
75
+ getCallback?: (() => any) | undefined;
76
+ };
13
77
  export declare function cloneDeep<T>(obj: T): T;
14
78
  /**
15
79
  * 处理默认过滤参数
@@ -106,6 +106,7 @@ function initActionRef(ref, action) {
106
106
  }
107
107
  function useActionType(ref, action) {
108
108
  ref.current = _objectSpread(_objectSpread({}, ref.current), action);
109
+ return _objectSpread(_objectSpread({}, ref.current), action);
109
110
  }
110
111
  function cloneDeep(obj) {
111
112
  return (0, _lodash.default)(obj);