@nocobase/client 0.9.2-alpha.3 → 0.9.2-alpha.4

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.
Files changed (75) hide show
  1. package/es/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
  2. package/es/api-client/hooks/useRequest.d.ts +1 -14
  3. package/es/api-client/hooks/useRequest.js +48 -53
  4. package/es/block-provider/hooks/index.d.ts +1 -1
  5. package/es/block-provider/hooks/index.js +31 -22
  6. package/es/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
  7. package/es/collection-manager/Configuration/EditFieldAction.js +1 -0
  8. package/es/collection-manager/Configuration/OverridingCollectionField.js +1 -0
  9. package/es/collection-manager/action-hooks.d.ts +3 -42
  10. package/es/collection-manager/interfaces/linkTo.js +2 -1
  11. package/es/collection-manager/interfaces/m2m.js +2 -1
  12. package/es/collection-manager/interfaces/m2o.js +2 -1
  13. package/es/collection-manager/interfaces/o2m.js +2 -1
  14. package/es/collection-manager/interfaces/o2o.js +6 -3
  15. package/es/collection-manager/interfaces/types.d.ts +2 -0
  16. package/es/collection-manager/sub-table.d.ts +1 -14
  17. package/es/locale/en_US.d.ts +1 -1
  18. package/es/locale/en_US.js +1 -1
  19. package/es/locale/ja_JP.d.ts +1 -1
  20. package/es/locale/ja_JP.js +1 -1
  21. package/es/locale/pt_BR.d.ts +1 -1
  22. package/es/locale/pt_BR.js +1 -1
  23. package/es/locale/zh_CN.d.ts +1 -1
  24. package/es/locale/zh_CN.js +1 -1
  25. package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
  26. package/es/schema-component/antd/association-select/AssociationSelect.js +11 -2
  27. package/es/schema-component/antd/form-item/FormItem.js +25 -8
  28. package/es/schema-component/antd/form-v2/utils.js +3 -3
  29. package/es/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
  30. package/es/schema-component/antd/record-picker/InputRecordPicker.js +8 -5
  31. package/es/schema-component/antd/variable/Input.js +12 -13
  32. package/es/schema-component/antd/variable/Variable.d.ts +2 -0
  33. package/es/schema-component/antd/variable/Variable.js +5 -2
  34. package/es/schema-initializer/utils.js +37 -35
  35. package/es/schema-settings/SchemaSettings.js +1 -1
  36. package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -2
  37. package/es/schema-settings/VariableInput/VariableInput.js +3 -1
  38. package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
  39. package/lib/api-client/hooks/useRequest.d.ts +1 -14
  40. package/lib/api-client/hooks/useRequest.js +48 -53
  41. package/lib/block-provider/hooks/index.d.ts +1 -1
  42. package/lib/block-provider/hooks/index.js +30 -21
  43. package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
  44. package/lib/collection-manager/Configuration/EditFieldAction.js +1 -0
  45. package/lib/collection-manager/Configuration/OverridingCollectionField.js +1 -0
  46. package/lib/collection-manager/action-hooks.d.ts +3 -42
  47. package/lib/collection-manager/interfaces/linkTo.js +2 -1
  48. package/lib/collection-manager/interfaces/m2m.js +2 -1
  49. package/lib/collection-manager/interfaces/m2o.js +2 -1
  50. package/lib/collection-manager/interfaces/o2m.js +2 -1
  51. package/lib/collection-manager/interfaces/o2o.js +6 -3
  52. package/lib/collection-manager/interfaces/types.d.ts +2 -0
  53. package/lib/collection-manager/sub-table.d.ts +1 -14
  54. package/lib/locale/en_US.d.ts +1 -1
  55. package/lib/locale/en_US.js +1 -1
  56. package/lib/locale/ja_JP.d.ts +1 -1
  57. package/lib/locale/ja_JP.js +1 -1
  58. package/lib/locale/pt_BR.d.ts +1 -1
  59. package/lib/locale/pt_BR.js +1 -1
  60. package/lib/locale/zh_CN.d.ts +1 -1
  61. package/lib/locale/zh_CN.js +1 -1
  62. package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
  63. package/lib/schema-component/antd/association-select/AssociationSelect.js +10 -1
  64. package/lib/schema-component/antd/form-item/FormItem.js +26 -9
  65. package/lib/schema-component/antd/form-v2/utils.js +3 -4
  66. package/lib/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
  67. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +8 -5
  68. package/lib/schema-component/antd/variable/Input.js +12 -13
  69. package/lib/schema-component/antd/variable/Variable.d.ts +2 -0
  70. package/lib/schema-component/antd/variable/Variable.js +6 -2
  71. package/lib/schema-initializer/utils.js +36 -34
  72. package/lib/schema-settings/SchemaSettings.js +1 -1
  73. package/lib/schema-settings/VariableInput/VariableInput.d.ts +3 -2
  74. package/lib/schema-settings/VariableInput/VariableInput.js +3 -1
  75. package/package.json +5 -5
@@ -13,14 +13,14 @@ var _react = require("react");
13
13
  var _context2 = require("../context");
14
14
  var _assign = require("./assign");
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
17
- 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); } }
18
- 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); }); }; }
19
16
  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; }
20
17
  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; }
21
18
  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; }
22
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
23
20
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
21
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
22
+ 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); } }
23
+ 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); }); }; }
24
24
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
25
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
26
26
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -35,64 +35,59 @@ function useRequest(service) {
35
35
  state = _useSetState2[0],
36
36
  setState = _useSetState2[1];
37
37
  var api = (0, _react.useContext)(_context2.APIClientContext);
38
+ var tempOptions, tempService;
38
39
  if (typeof service === 'function') {
39
- var _result = (0, _useRequest.default)(service, _objectSpread(_objectSpread({}, options), {}, {
40
- onSuccess: function onSuccess() {
41
- var _options$onSuccess;
42
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
- args[_key] = arguments[_key];
44
- }
45
- (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call.apply(_options$onSuccess, [options].concat(args));
46
- if (options.uid) {
47
- api.services[options.uid] = _result;
48
- }
49
- }
50
- }));
51
- return _objectSpread(_objectSpread({}, _result), {}, {
52
- state: state,
53
- setState: setState
54
- });
55
- }
56
- var result = (0, _useRequest.default)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
57
- var params,
58
- resource,
59
- args,
60
- response,
61
- _args = arguments;
62
- return _regeneratorRuntime().wrap(function _callee$(_context) {
63
- while (1) switch (_context.prev = _context.next) {
64
- case 0:
65
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
66
- resource = service.resource;
67
- args = (0, _cloneDeep.default)(service);
68
- if (resource) {
69
- args.params = args.params || {};
70
- (0, _assign.assign)(args.params, params);
71
- } else {
72
- args = (0, _shared.merge)(args, params);
40
+ tempService = service;
41
+ } else {
42
+ tempService = /*#__PURE__*/function () {
43
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
44
+ var params,
45
+ resource,
46
+ args,
47
+ response,
48
+ _args = arguments;
49
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
50
+ while (1) switch (_context.prev = _context.next) {
51
+ case 0:
52
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
53
+ resource = service.resource;
54
+ args = (0, _cloneDeep.default)(service);
55
+ if (resource) {
56
+ args.params = args.params || {};
57
+ (0, _assign.assign)(args.params, params);
58
+ } else {
59
+ args = (0, _shared.merge)(args, params);
60
+ }
61
+ _context.next = 6;
62
+ return api.request(args);
63
+ case 6:
64
+ response = _context.sent;
65
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
66
+ case 8:
67
+ case "end":
68
+ return _context.stop();
73
69
  }
74
- _context.next = 6;
75
- return api.request(args);
76
- case 6:
77
- response = _context.sent;
78
- return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
79
- case 8:
80
- case "end":
81
- return _context.stop();
82
- }
83
- }, _callee);
84
- })), _objectSpread(_objectSpread({}, options), {}, {
70
+ }, _callee);
71
+ }));
72
+ return function tempService() {
73
+ return _ref.apply(this, arguments);
74
+ };
75
+ }();
76
+ }
77
+ tempOptions = _objectSpread(_objectSpread({}, options), {}, {
85
78
  onSuccess: function onSuccess() {
86
- var _options$onSuccess2;
87
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
88
- args[_key2] = arguments[_key2];
79
+ var _options$onSuccess;
80
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
81
+ args[_key] = arguments[_key];
89
82
  }
90
- (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 ? void 0 : _options$onSuccess2.call.apply(_options$onSuccess2, [options].concat(args));
83
+ // @ts-ignore
84
+ (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call.apply(_options$onSuccess, [options].concat(args));
91
85
  if (options.uid) {
92
86
  api.services[options.uid] = result;
93
87
  }
94
88
  }
95
- }));
89
+ });
90
+ var result = (0, _useRequest.default)(tempService, tempOptions);
96
91
  return _objectSpread(_objectSpread({}, result), {}, {
97
92
  state: state,
98
93
  setState: setState
@@ -67,7 +67,7 @@ export declare const useAssociationFilterProps: () => {
67
67
  onSelected: (value: any) => void;
68
68
  handleSearchInput: (e: ChangeEvent<any>) => void;
69
69
  params: any;
70
- run: (...params: any) => void;
70
+ run: any;
71
71
  };
72
72
  export declare const useOptionalFieldList: () => import("../..").FieldOptions[];
73
73
  export declare const useAssociationFilterBlockProps: () => {
@@ -1326,16 +1326,42 @@ var isOptionalField = function isOptionalField(field) {
1326
1326
  return optionalInterfaces.includes(field.interface);
1327
1327
  };
1328
1328
  var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
1329
+ var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _field$componentProps3, _field$componentProps4;
1329
1330
  var collectionField = _2.AssociationFilter.useAssociationField();
1330
1331
  var fieldSchema = (0, _react.useFieldSchema)();
1331
1332
  var optionalFieldList = useOptionalFieldList();
1332
1333
  var _useFilterBlock3 = (0, _FilterProvider.useFilterBlock)(),
1333
1334
  getDataBlocks = _useFilterBlock3.getDataBlocks;
1334
1335
  var collectionFieldName = collectionField.name;
1336
+ var field = (0, _react.useField)();
1335
1337
  var list, onSelected, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
1338
+ valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1339
+ labelKey = ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : (_fieldSchema$xCompon5 = _fieldSchema$xCompon4.fieldNames) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : _fieldSchema$xCompon5.label) || valueKey;
1340
+ var _useRequest2 = (0, _apiClient.useRequest)({
1341
+ resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
1342
+ action: 'list',
1343
+ params: _objectSpread({
1344
+ fields: [labelKey, valueKey],
1345
+ pageSize: 200,
1346
+ page: 1
1347
+ }, (_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : _field$componentProps4.params)
1348
+ }, {
1349
+ // 由于 选项字段不需要触发当前请求,所以当前请求更改为手动触发
1350
+ manual: true,
1351
+ debounceWait: 300
1352
+ });
1353
+ data = _useRequest2.data;
1354
+ params = _useRequest2.params;
1355
+ run = _useRequest2.run;
1356
+ (0, _react2.useEffect)(function () {
1357
+ // 由于 选项字段不需要触发当前请求,所以请求单独在 关系字段的时候触发
1358
+ if (!isOptionalField(fieldSchema)) {
1359
+ run();
1360
+ }
1361
+ }, [labelKey, valueKey, JSON.stringify(((_field$componentProps3 = field.componentProps) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.params) || {}), isOptionalField(fieldSchema)]);
1336
1362
  if (isOptionalField(fieldSchema)) {
1337
1363
  var _field$uiSchema;
1338
- var field = optionalFieldList.find(function (field) {
1364
+ var _field = optionalFieldList.find(function (field) {
1339
1365
  return field.name === fieldSchema.name;
1340
1366
  });
1341
1367
  var operatorMap = {
@@ -1344,13 +1370,13 @@ var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
1344
1370
  checkbox: '$in',
1345
1371
  checkboxGroup: '$anyOf'
1346
1372
  };
1347
- var _list = (field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.enum) || [];
1373
+ var _list = (_field === null || _field === void 0 ? void 0 : (_field$uiSchema = _field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.enum) || [];
1348
1374
  valueKey = 'value';
1349
1375
  labelKey = 'label';
1350
1376
  list = _list;
1351
1377
  params = {};
1352
1378
  run = function run() {};
1353
- filterKey = "".concat(field.name, ".").concat(operatorMap[field.interface]);
1379
+ filterKey = "".concat(_field.name, ".").concat(operatorMap[_field.interface]);
1354
1380
  handleSearchInput = function handleSearchInput(e) {
1355
1381
  // TODO: 列表没有刷新,在这个 hook 中使用 useState 会产生 re-render 次数过多的错误
1356
1382
  var value = e.target.value;
@@ -1363,24 +1389,7 @@ var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
1363
1389
  });
1364
1390
  };
1365
1391
  } else {
1366
- var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _data;
1367
- valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1368
- labelKey = ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : (_fieldSchema$xCompon5 = _fieldSchema$xCompon4.fieldNames) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : _fieldSchema$xCompon5.label) || valueKey;
1369
- var _useRequest2 = (0, _apiClient.useRequest)({
1370
- resource: collectionField.target,
1371
- action: 'list',
1372
- params: {
1373
- fields: [labelKey, valueKey],
1374
- pageSize: 200,
1375
- page: 1
1376
- }
1377
- }, {
1378
- refreshDeps: [labelKey, valueKey],
1379
- debounceWait: 300
1380
- });
1381
- data = _useRequest2.data;
1382
- params = _useRequest2.params;
1383
- run = _useRequest2.run;
1392
+ var _data;
1384
1393
  filterKey = "".concat(collectionFieldName, ".").concat(valueKey, ".$in");
1385
1394
  list = ((_data = data) === null || _data === void 0 ? void 0 : _data.data) || [];
1386
1395
  handleSearchInput = function handleSearchInput(e) {
@@ -1,17 +1,4 @@
1
- export declare const useValuesFromRecord: (options: any) => {
2
- state: {};
3
- setState: import("ahooks/lib/useSetState").SetState<{}>;
4
- loading: boolean;
5
- data?: any;
6
- error?: Error;
7
- params: any;
8
- cancel: () => void;
9
- refresh: () => void;
10
- refreshAsync: () => Promise<any>;
11
- run: (...params: any) => void;
12
- runAsync: (...params: any) => Promise<any>;
13
- mutate: (data?: any) => void;
14
- };
1
+ export declare const useValuesFromRecord: (options: any) => any;
15
2
  export declare const useUpdateCollectionActionAndRefreshCM: (options: any) => {
16
3
  run(): Promise<void>;
17
4
  };
@@ -62,6 +62,7 @@ var getSchema = function getSchema(schema, record, compile, getContainer) {
62
62
  }
63
63
  }
64
64
  };
65
+ properties['defaultValue']['x-disabled'] = record.overriding;
65
66
  }
66
67
  return {
67
68
  type: 'object',
@@ -47,6 +47,7 @@ var getSchema = function getSchema(schema, record, compile, getContainer) {
47
47
  properties['defaultValue'] = (0, _cloneDeep.default)(schema.default.uiSchema);
48
48
  properties['defaultValue']['title'] = compile('{{ t("Default value") }}');
49
49
  properties['defaultValue']['x-decorator'] = 'FormItem';
50
+ properties['defaultValue']['x-disabled'] = true;
50
51
  }
51
52
  return {
52
53
  type: 'object',
@@ -1,20 +1,7 @@
1
1
  export declare const useCancelAction: () => {
2
2
  run(): Promise<void>;
3
3
  };
4
- export declare const useValuesFromRecord: (options: any) => {
5
- state: {};
6
- setState: import("ahooks/lib/useSetState").SetState<{}>;
7
- loading: boolean;
8
- data?: any;
9
- error?: Error;
10
- params: any;
11
- cancel: () => void;
12
- refresh: () => void;
13
- refreshAsync: () => Promise<any>;
14
- run: (...params: any) => void;
15
- runAsync: (...params: any) => Promise<any>;
16
- mutate: (data?: any) => void;
17
- };
4
+ export declare const useValuesFromRecord: (options: any) => any;
18
5
  export declare const useResetFilterAction: () => {
19
6
  run(): Promise<void>;
20
7
  };
@@ -40,20 +27,7 @@ export declare const useChildrenCollections: (collectionName: string) => {
40
27
  }[];
41
28
  export declare const useCollectionFilterOptions: (collectionName: string) => any[];
42
29
  export declare const useLinkageCollectionFilterOptions: (collectionName: string) => any[];
43
- export declare const useFilterDataSource: (options: any) => {
44
- state: {};
45
- setState: import("ahooks/lib/useSetState").SetState<{}>;
46
- loading: boolean;
47
- data?: any;
48
- error?: Error;
49
- params: any;
50
- cancel: () => void;
51
- refresh: () => void;
52
- refreshAsync: () => Promise<any>;
53
- run: (...params: any) => void;
54
- runAsync: (...params: any) => Promise<any>;
55
- mutate: (data?: any) => void;
56
- };
30
+ export declare const useFilterDataSource: (options: any) => any;
57
31
  export declare const useFilterAction: () => {
58
32
  run(): Promise<void>;
59
33
  };
@@ -78,20 +52,7 @@ export declare const useDestroyAction: () => {
78
52
  export declare const useBulkDestroyAction: () => {
79
53
  run(): Promise<void>;
80
54
  };
81
- export declare const useValuesFromRA: (options: any) => {
82
- state: {};
83
- setState: import("ahooks/lib/useSetState").SetState<{}>;
84
- loading: boolean;
85
- data?: any;
86
- error?: Error;
87
- params: any;
88
- cancel: () => void;
89
- refresh: () => void;
90
- refreshAsync: () => Promise<any>;
91
- run: (...params: any) => void;
92
- runAsync: (...params: any) => Promise<any>;
93
- mutate: (data?: any) => void;
94
- };
55
+ export declare const useValuesFromRA: (options: any) => any;
95
56
  export declare const useCreateActionAndRefreshCM: () => {
96
57
  run(): Promise<void>;
97
58
  };
@@ -186,6 +186,7 @@ var linkTo = {
186
186
  // },
187
187
  // },
188
188
  ]
189
- }
189
+ },
190
+ invariable: true
190
191
  };
191
192
  exports.linkTo = linkTo;
@@ -285,6 +285,7 @@ var m2m = {
285
285
  // },
286
286
  // },
287
287
  ]
288
- }
288
+ },
289
+ invariable: true
289
290
  };
290
291
  exports.m2m = m2m;
@@ -217,6 +217,7 @@ var m2o = {
217
217
  // },
218
218
  // },
219
219
  ]
220
- }
220
+ },
221
+ invariable: true
221
222
  };
222
223
  exports.m2o = m2o;
@@ -275,6 +275,7 @@ var o2m = {
275
275
  // },
276
276
  // },
277
277
  ]
278
- }
278
+ },
279
+ invariable: true
279
280
  };
280
281
  exports.o2m = o2m;
@@ -260,7 +260,8 @@ var o2o = {
260
260
  // },
261
261
  // },
262
262
  ]
263
- }
263
+ },
264
+ invariable: true
264
265
  };
265
266
  exports.o2o = o2o;
266
267
  var oho = {
@@ -434,7 +435,8 @@ var oho = {
434
435
  // },
435
436
  // },
436
437
  ]
437
- }
438
+ },
439
+ invariable: true
438
440
  };
439
441
  exports.oho = oho;
440
442
  var obo = {
@@ -625,6 +627,7 @@ var obo = {
625
627
  // },
626
628
  // },
627
629
  ]
628
- }
630
+ },
631
+ invariable: true
629
632
  };
630
633
  exports.obo = obo;
@@ -8,6 +8,8 @@ export interface IField extends ISchema {
8
8
  default?: IDefault;
9
9
  operators?: any[];
10
10
  filterable?: any;
11
+ /** 不支持使用变量的值进行设置 */
12
+ invariable?: boolean;
11
13
  [key: string]: any;
12
14
  }
13
15
  export {};
@@ -2,20 +2,7 @@ import React from 'react';
2
2
  export declare const DataSourceContext: React.Context<any>;
3
3
  export declare const ds: {
4
4
  useSelectedRowKeys: () => any[];
5
- useDataSource: (options: any) => {
6
- state: {};
7
- setState: import("ahooks/lib/useSetState").SetState<{}>;
8
- loading: boolean;
9
- data?: any;
10
- error?: Error;
11
- params: any;
12
- cancel: () => void;
13
- refresh: () => void;
14
- refreshAsync: () => Promise<any>;
15
- run: (...params: any) => void;
16
- runAsync: (...params: any) => Promise<any>;
17
- mutate: (data?: any) => void;
18
- };
5
+ useDataSource: (options: any) => any;
19
6
  useCreateAction: () => {
20
7
  run(): Promise<void>;
21
8
  };
@@ -210,7 +210,7 @@ declare const _default: {
210
210
  "Association fields filter": string;
211
211
  "PK & FK fields": string;
212
212
  "Association fields": string;
213
- "Optional fields": string;
213
+ "Choices fields": string;
214
214
  "System fields": string;
215
215
  "General fields": string;
216
216
  "Inherited fields": string;
@@ -216,7 +216,7 @@ var _default = {
216
216
  "Association fields filter": "Association fields filter",
217
217
  "PK & FK fields": "PK & FK fields",
218
218
  "Association fields": "Association fields",
219
- "Optional fields": "Optional fields",
219
+ "Choices fields": "Choices fields",
220
220
  "System fields": "System fields",
221
221
  "General fields": "General fields",
222
222
  "Inherited fields": "Inherited fields",
@@ -576,7 +576,7 @@ declare const _default: {
576
576
  "Enable SMS authentication": string;
577
577
  "Display association fields": string;
578
578
  "Set default value": string;
579
- "Optional fields": string;
579
+ "Choices fields": string;
580
580
  Editable: string;
581
581
  Readonly: string;
582
582
  "Easy-reading": string;
@@ -583,7 +583,7 @@ var _default = {
583
583
  "Enable SMS authentication": "SMS認証を有効にする",
584
584
  "Display association fields": "関連付けられたコレクションのフィールドを表示",
585
585
  "Set default value": "デフォルト値を設定",
586
- "Optional fields": "オプションフィールド",
586
+ "Choices fields": "チョイスフィールド",
587
587
  "Editable": "編集可能",
588
588
  "Readonly": "読み取り専用(編集不可)",
589
589
  "Easy-reading": "読取り専用(読取りモード)",
@@ -170,7 +170,7 @@ declare const _default: {
170
170
  "Association fields filter": string;
171
171
  "PK & FK fields": string;
172
172
  "Association fields": string;
173
- "Optional fields": string;
173
+ "Choices fields": string;
174
174
  "System fields": string;
175
175
  "General fields": string;
176
176
  "Inherited fields": string;
@@ -176,7 +176,7 @@ var _default = {
176
176
  "Association fields filter": "Filtro de campos de associação",
177
177
  "PK & FK fields": "Campos PK & FK",
178
178
  "Association fields": "Campos de associação",
179
- "Optional fields": "Campos opcionais",
179
+ "Choices fields": "Campos de opções",
180
180
  "System fields": "Campos do sistema",
181
181
  "General fields": "Campos gerais",
182
182
  "Inherited fields": "Campos herdados",
@@ -221,7 +221,7 @@ declare const _default: {
221
221
  "Association fields filter": string;
222
222
  "PK & FK fields": string;
223
223
  "Association fields": string;
224
- "Optional fields": string;
224
+ "Choices fields": string;
225
225
  "System fields": string;
226
226
  "General fields": string;
227
227
  "Inherited fields": string;
@@ -227,7 +227,7 @@ var _default = {
227
227
  "Association fields filter": "关系筛选",
228
228
  "PK & FK fields": "主外键字段",
229
229
  "Association fields": "关系字段",
230
- "Optional fields": "可选字段",
230
+ "Choices fields": "选项字段",
231
231
  "System fields": "系统字段",
232
232
  "General fields": "普通字段",
233
233
  "Inherited fields": "继承字段",
@@ -70,10 +70,10 @@ var AssociationFilterFilterBlockInitializer = function AssociationFilterFilterBl
70
70
  title: t('Association fields'),
71
71
  children: children
72
72
  };
73
- // 可选项字段
73
+ // 选项字段
74
74
  var optionalFieldGroup = {
75
75
  type: 'itemGroup',
76
- title: t('Optional fields'),
76
+ title: t('Choices fields'),
77
77
  children: optionalChildren
78
78
  };
79
79
  var dividerItem = {
@@ -114,6 +114,13 @@ AssociationSelect.Designer = function Designer() {
114
114
  var defaultSort = ((_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : (_field$componentProps2 = _field$componentProps.service) === null || _field$componentProps2 === void 0 ? void 0 : (_field$componentProps3 = _field$componentProps2.params) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.sort) || [];
115
115
  var defaultFilter = ((_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : (_field$componentProps5 = _field$componentProps4.service) === null || _field$componentProps5 === void 0 ? void 0 : (_field$componentProps6 = _field$componentProps5.params) === null || _field$componentProps6 === void 0 ? void 0 : _field$componentProps6.filter) || {};
116
116
  var dataSource = (0, _collectionManager.useCollectionFilterOptions)(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
117
+ // TODO: 这里 fieldSchema['x-read-pretty'] 的值为 true,但是 field.readPretty 的值却为 false,不知道什么原因
118
+ (0, _react2.useEffect)(function () {
119
+ // 没有这一步判断会出现禁用状态失效的情况
120
+ if (field.readPretty !== fieldSchema['x-read-pretty']) {
121
+ field.readPretty = !!fieldSchema['x-read-pretty'];
122
+ }
123
+ }, [fieldSchema['x-read-pretty']]);
117
124
  var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
118
125
  return item.startsWith('-') ? {
119
126
  field: item.substring(1),
@@ -399,7 +406,9 @@ AssociationSelect.Designer = function Designer() {
399
406
  }),
400
407
  name: 'default',
401
408
  title: t('Default value'),
402
- default: fieldSchema.default || collectionField.defaultValue
409
+ default: fieldSchema.default || collectionField.defaultValue,
410
+ 'x-read-pretty': false,
411
+ 'x-disabled': false
403
412
  })
404
413
  }
405
414
  },