@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
@@ -1,14 +1 @@
1
- export declare const useRoleResourceValues: (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 useRoleResourceValues: (options: any) => any;
@@ -9,18 +9,5 @@ export declare type ResourceActionOptions<P = any> = {
9
9
  };
10
10
  export declare function useRequest<P>(service: AxiosRequestConfig<P> | ResourceActionOptions<P> | FunctionService, options?: Options<any, any> & {
11
11
  uid?: string;
12
- }): {
13
- state: {};
14
- setState: import("ahooks/lib/useSetState").SetState<{}>;
15
- loading: boolean;
16
- data?: any;
17
- error?: Error;
18
- params: any;
19
- cancel: () => void;
20
- refresh: () => void;
21
- refreshAsync: () => Promise<any>;
22
- run: (...params: any) => void;
23
- runAsync: (...params: any) => Promise<any>;
24
- mutate: (data?: any) => void;
25
- };
12
+ }): any;
26
13
  export {};
@@ -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
- 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; }
3
- 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); } }
4
- 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); }); }; }
5
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
4
  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; }
8
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
6
  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); }
7
+ 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; }
8
+ 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); } }
9
+ 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); }); }; }
10
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
11
  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."); }
12
12
  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); }
@@ -28,64 +28,59 @@ export function useRequest(service) {
28
28
  state = _useSetState2[0],
29
29
  setState = _useSetState2[1];
30
30
  var api = useContext(APIClientContext);
31
+ var tempOptions, tempService;
31
32
  if (typeof service === 'function') {
32
- var _result = useReq(service, _objectSpread(_objectSpread({}, options), {}, {
33
- onSuccess: function onSuccess() {
34
- var _options$onSuccess;
35
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
36
- args[_key] = arguments[_key];
37
- }
38
- (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call.apply(_options$onSuccess, [options].concat(args));
39
- if (options.uid) {
40
- api.services[options.uid] = _result;
41
- }
42
- }
43
- }));
44
- return _objectSpread(_objectSpread({}, _result), {}, {
45
- state: state,
46
- setState: setState
47
- });
48
- }
49
- var result = useReq( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
50
- var params,
51
- resource,
52
- args,
53
- response,
54
- _args = arguments;
55
- return _regeneratorRuntime().wrap(function _callee$(_context) {
56
- while (1) switch (_context.prev = _context.next) {
57
- case 0:
58
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
59
- resource = service.resource;
60
- args = cloneDeep(service);
61
- if (resource) {
62
- args.params = args.params || {};
63
- assign(args.params, params);
64
- } else {
65
- args = merge(args, params);
33
+ tempService = service;
34
+ } else {
35
+ tempService = /*#__PURE__*/function () {
36
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
37
+ var params,
38
+ resource,
39
+ args,
40
+ response,
41
+ _args = arguments;
42
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
43
+ while (1) switch (_context.prev = _context.next) {
44
+ case 0:
45
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
46
+ resource = service.resource;
47
+ args = cloneDeep(service);
48
+ if (resource) {
49
+ args.params = args.params || {};
50
+ assign(args.params, params);
51
+ } else {
52
+ args = merge(args, params);
53
+ }
54
+ _context.next = 6;
55
+ return api.request(args);
56
+ case 6:
57
+ response = _context.sent;
58
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
59
+ case 8:
60
+ case "end":
61
+ return _context.stop();
66
62
  }
67
- _context.next = 6;
68
- return api.request(args);
69
- case 6:
70
- response = _context.sent;
71
- return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
72
- case 8:
73
- case "end":
74
- return _context.stop();
75
- }
76
- }, _callee);
77
- })), _objectSpread(_objectSpread({}, options), {}, {
63
+ }, _callee);
64
+ }));
65
+ return function tempService() {
66
+ return _ref.apply(this, arguments);
67
+ };
68
+ }();
69
+ }
70
+ tempOptions = _objectSpread(_objectSpread({}, options), {}, {
78
71
  onSuccess: function onSuccess() {
79
- var _options$onSuccess2;
80
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
81
- args[_key2] = arguments[_key2];
72
+ var _options$onSuccess;
73
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
74
+ args[_key] = arguments[_key];
82
75
  }
83
- (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 ? void 0 : _options$onSuccess2.call.apply(_options$onSuccess2, [options].concat(args));
76
+ // @ts-ignore
77
+ (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call.apply(_options$onSuccess, [options].concat(args));
84
78
  if (options.uid) {
85
79
  api.services[options.uid] = result;
86
80
  }
87
81
  }
88
- }));
82
+ });
83
+ var result = useReq(tempService, tempOptions);
89
84
  return _objectSpread(_objectSpread({}, result), {}, {
90
85
  state: state,
91
86
  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: () => {
@@ -19,7 +19,7 @@ import parse from 'json-templates';
19
19
  import { cloneDeep } from 'lodash';
20
20
  import get from 'lodash/get';
21
21
  import omit from 'lodash/omit';
22
- import { useContext } from 'react';
22
+ import { useContext, useEffect } from 'react';
23
23
  import { useTranslation } from 'react-i18next';
24
24
  import { useHistory } from 'react-router-dom';
25
25
  import { useReactToPrint } from 'react-to-print';
@@ -1301,16 +1301,42 @@ var isOptionalField = function isOptionalField(field) {
1301
1301
  return optionalInterfaces.includes(field.interface);
1302
1302
  };
1303
1303
  export var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
1304
+ var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _field$componentProps3, _field$componentProps4;
1304
1305
  var collectionField = AssociationFilter.useAssociationField();
1305
1306
  var fieldSchema = useFieldSchema();
1306
1307
  var optionalFieldList = useOptionalFieldList();
1307
1308
  var _useFilterBlock3 = useFilterBlock(),
1308
1309
  getDataBlocks = _useFilterBlock3.getDataBlocks;
1309
1310
  var collectionFieldName = collectionField.name;
1311
+ var field = useField();
1310
1312
  var list, onSelected, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
1313
+ valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1314
+ 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;
1315
+ var _useRequest2 = useRequest({
1316
+ resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
1317
+ action: 'list',
1318
+ params: _objectSpread({
1319
+ fields: [labelKey, valueKey],
1320
+ pageSize: 200,
1321
+ page: 1
1322
+ }, (_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : _field$componentProps4.params)
1323
+ }, {
1324
+ // 由于 选项字段不需要触发当前请求,所以当前请求更改为手动触发
1325
+ manual: true,
1326
+ debounceWait: 300
1327
+ });
1328
+ data = _useRequest2.data;
1329
+ params = _useRequest2.params;
1330
+ run = _useRequest2.run;
1331
+ useEffect(function () {
1332
+ // 由于 选项字段不需要触发当前请求,所以请求单独在 关系字段的时候触发
1333
+ if (!isOptionalField(fieldSchema)) {
1334
+ run();
1335
+ }
1336
+ }, [labelKey, valueKey, JSON.stringify(((_field$componentProps3 = field.componentProps) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.params) || {}), isOptionalField(fieldSchema)]);
1311
1337
  if (isOptionalField(fieldSchema)) {
1312
1338
  var _field$uiSchema;
1313
- var field = optionalFieldList.find(function (field) {
1339
+ var _field = optionalFieldList.find(function (field) {
1314
1340
  return field.name === fieldSchema.name;
1315
1341
  });
1316
1342
  var operatorMap = {
@@ -1319,13 +1345,13 @@ export var useAssociationFilterBlockProps = function useAssociationFilterBlockPr
1319
1345
  checkbox: '$in',
1320
1346
  checkboxGroup: '$anyOf'
1321
1347
  };
1322
- var _list = (field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.enum) || [];
1348
+ var _list = (_field === null || _field === void 0 ? void 0 : (_field$uiSchema = _field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.enum) || [];
1323
1349
  valueKey = 'value';
1324
1350
  labelKey = 'label';
1325
1351
  list = _list;
1326
1352
  params = {};
1327
1353
  run = function run() {};
1328
- filterKey = "".concat(field.name, ".").concat(operatorMap[field.interface]);
1354
+ filterKey = "".concat(_field.name, ".").concat(operatorMap[_field.interface]);
1329
1355
  handleSearchInput = function handleSearchInput(e) {
1330
1356
  // TODO: 列表没有刷新,在这个 hook 中使用 useState 会产生 re-render 次数过多的错误
1331
1357
  var value = e.target.value;
@@ -1338,24 +1364,7 @@ export var useAssociationFilterBlockProps = function useAssociationFilterBlockPr
1338
1364
  });
1339
1365
  };
1340
1366
  } else {
1341
- var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _data;
1342
- valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1343
- 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;
1344
- var _useRequest2 = useRequest({
1345
- resource: collectionField.target,
1346
- action: 'list',
1347
- params: {
1348
- fields: [labelKey, valueKey],
1349
- pageSize: 200,
1350
- page: 1
1351
- }
1352
- }, {
1353
- refreshDeps: [labelKey, valueKey],
1354
- debounceWait: 300
1355
- });
1356
- data = _useRequest2.data;
1357
- params = _useRequest2.params;
1358
- run = _useRequest2.run;
1367
+ var _data;
1359
1368
  filterKey = "".concat(collectionFieldName, ".").concat(valueKey, ".$in");
1360
1369
  list = ((_data = data) === null || _data === void 0 ? void 0 : _data.data) || [];
1361
1370
  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
  };
@@ -53,6 +53,7 @@ var getSchema = function getSchema(schema, record, compile, getContainer) {
53
53
  }
54
54
  }
55
55
  };
56
+ properties['defaultValue']['x-disabled'] = record.overriding;
56
57
  }
57
58
  return {
58
59
  type: 'object',
@@ -38,6 +38,7 @@ var getSchema = function getSchema(schema, record, compile, getContainer) {
38
38
  properties['defaultValue'] = cloneDeep(schema.default.uiSchema);
39
39
  properties['defaultValue']['title'] = compile('{{ t("Default value") }}');
40
40
  properties['defaultValue']['x-decorator'] = 'FormItem';
41
+ properties['defaultValue']['x-disabled'] = true;
41
42
  }
42
43
  return {
43
44
  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
  };
@@ -180,5 +180,6 @@ export var linkTo = {
180
180
  // },
181
181
  // },
182
182
  ]
183
- }
183
+ },
184
+ invariable: true
184
185
  };
@@ -279,5 +279,6 @@ export var m2m = {
279
279
  // },
280
280
  // },
281
281
  ]
282
- }
282
+ },
283
+ invariable: true
283
284
  };
@@ -211,5 +211,6 @@ export var m2o = {
211
211
  // },
212
212
  // },
213
213
  ]
214
- }
214
+ },
215
+ invariable: true
215
216
  };
@@ -269,5 +269,6 @@ export var o2m = {
269
269
  // },
270
270
  // },
271
271
  ]
272
- }
272
+ },
273
+ invariable: true
273
274
  };
@@ -254,7 +254,8 @@ export var o2o = {
254
254
  // },
255
255
  // },
256
256
  ]
257
- }
257
+ },
258
+ invariable: true
258
259
  };
259
260
  export var oho = {
260
261
  name: 'oho',
@@ -427,7 +428,8 @@ export var oho = {
427
428
  // },
428
429
  // },
429
430
  ]
430
- }
431
+ },
432
+ invariable: true
431
433
  };
432
434
  export var obo = {
433
435
  name: 'obo',
@@ -617,5 +619,6 @@ export var obo = {
617
619
  // },
618
620
  // },
619
621
  ]
620
- }
622
+ },
623
+ invariable: true
621
624
  };
@@ -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;
@@ -210,7 +210,7 @@ export default {
210
210
  "Association fields filter": "Association fields filter",
211
211
  "PK & FK fields": "PK & FK fields",
212
212
  "Association fields": "Association fields",
213
- "Optional fields": "Optional fields",
213
+ "Choices fields": "Choices fields",
214
214
  "System fields": "System fields",
215
215
  "General fields": "General fields",
216
216
  "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;
@@ -577,7 +577,7 @@ export default {
577
577
  "Enable SMS authentication": "SMS認証を有効にする",
578
578
  "Display association fields": "関連付けられたコレクションのフィールドを表示",
579
579
  "Set default value": "デフォルト値を設定",
580
- "Optional fields": "オプションフィールド",
580
+ "Choices fields": "チョイスフィールド",
581
581
  "Editable": "編集可能",
582
582
  "Readonly": "読み取り専用(編集不可)",
583
583
  "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;
@@ -170,7 +170,7 @@ export default {
170
170
  "Association fields filter": "Filtro de campos de associação",
171
171
  "PK & FK fields": "Campos PK & FK",
172
172
  "Association fields": "Campos de associação",
173
- "Optional fields": "Campos opcionais",
173
+ "Choices fields": "Campos de opções",
174
174
  "System fields": "Campos do sistema",
175
175
  "General fields": "Campos gerais",
176
176
  "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;
@@ -221,7 +221,7 @@ export default {
221
221
  "Association fields filter": "关系筛选",
222
222
  "PK & FK fields": "主外键字段",
223
223
  "Association fields": "关系字段",
224
- "Optional fields": "可选字段",
224
+ "Choices fields": "选项字段",
225
225
  "System fields": "系统字段",
226
226
  "General fields": "普通字段",
227
227
  "Inherited fields": "继承字段",
@@ -63,10 +63,10 @@ export var AssociationFilterFilterBlockInitializer = function AssociationFilterF
63
63
  title: t('Association fields'),
64
64
  children: children
65
65
  };
66
- // 可选项字段
66
+ // 选项字段
67
67
  var optionalFieldGroup = {
68
68
  type: 'itemGroup',
69
- title: t('Optional fields'),
69
+ title: t('Choices fields'),
70
70
  children: optionalChildren
71
71
  };
72
72
  var dividerItem = {