@nokecy/qc-ui 0.3.23 → 0.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ag-grid-plus/queryForm/index.js +20 -38
- package/dist/cjs/array-table/arrayBase.js +12 -1
- package/dist/cjs/index.d.ts +1 -2
- package/dist/cjs/index.js +0 -8
- package/dist/esm/ag-grid-plus/queryForm/index.js +21 -40
- package/dist/esm/array-table/arrayBase.js +11 -1
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +1 -2
- package/dist/umd/qc-ui.min.css +1 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +2 -14
- package/dist/cjs/elsa/components/finishNode.d.ts +0 -0
- package/dist/cjs/elsa/components/finishNode.js +0 -1
- package/dist/cjs/elsa/components/forkNode.d.ts +0 -0
- package/dist/cjs/elsa/components/forkNode.js +0 -1
- package/dist/cjs/elsa/components/ifNode.d.ts +0 -0
- package/dist/cjs/elsa/components/ifNode.js +0 -1
- package/dist/cjs/elsa/components/joinNode.d.ts +0 -0
- package/dist/cjs/elsa/components/joinNode.js +0 -1
- package/dist/cjs/elsa/components/setNameNode.d.ts +0 -0
- package/dist/cjs/elsa/components/setNameNode.js +0 -1
- package/dist/cjs/elsa/components/startNode.d.ts +0 -3
- package/dist/cjs/elsa/components/startNode.js +0 -24
- package/dist/cjs/elsa/components/switchNode.d.ts +0 -0
- package/dist/cjs/elsa/components/switchNode.js +0 -1
- package/dist/cjs/elsa/components/timerNode.d.ts +0 -0
- package/dist/cjs/elsa/components/timerNode.js +0 -1
- package/dist/cjs/elsa/components/userTaskNode/index.d.ts +0 -7
- package/dist/cjs/elsa/components/userTaskNode/index.js +0 -50
- package/dist/cjs/elsa/components/userTaskNode/index.less +0 -0
- package/dist/cjs/elsa/components/userTaskNode/register.d.ts +0 -1
- package/dist/cjs/elsa/components/userTaskNode/register.js +0 -54
- package/dist/cjs/elsa/elsa.design.d.ts +0 -4
- package/dist/cjs/elsa/elsa.design.js +0 -123
- package/dist/cjs/elsa/index.d.ts +0 -4
- package/dist/cjs/elsa/index.js +0 -40
- package/dist/cjs/elsa/index.less +0 -21
- package/dist/cjs/xflow/components/Wrapper.d.ts +0 -3
- package/dist/cjs/xflow/components/Wrapper.js +0 -26
- package/dist/cjs/xflow/components/XFlow.d.ts +0 -3
- package/dist/cjs/xflow/components/XFlow.js +0 -47
- package/dist/cjs/xflow/components/XFlowGraph.d.ts +0 -4
- package/dist/cjs/xflow/components/XFlowGraph.js +0 -73
- package/dist/cjs/xflow/components/graph-toolbar/index.d.ts +0 -19
- package/dist/cjs/xflow/components/graph-toolbar/index.js +0 -60
- package/dist/cjs/xflow/components/graph-toolbar/index.less +0 -11
- package/dist/cjs/xflow/components/index.d.ts +0 -3
- package/dist/cjs/xflow/components/index.js +0 -31
- package/dist/cjs/xflow/components/keyboard/index.d.ts +0 -3
- package/dist/cjs/xflow/components/keyboard/index.js +0 -40
- package/dist/cjs/xflow/components/minimap/index.d.ts +0 -3
- package/dist/cjs/xflow/components/minimap/index.js +0 -53
- package/dist/cjs/xflow/components/scroller/index.d.ts +0 -4
- package/dist/cjs/xflow/components/scroller/index.js +0 -49
- package/dist/cjs/xflow/components/selection/index.d.ts +0 -3
- package/dist/cjs/xflow/components/selection/index.js +0 -40
- package/dist/cjs/xflow/components/snapline/index.d.ts +0 -3
- package/dist/cjs/xflow/components/snapline/index.js +0 -40
- package/dist/cjs/xflow/components/transform/index.d.ts +0 -3
- package/dist/cjs/xflow/components/transform/index.js +0 -38
- package/dist/cjs/xflow/context/GraphContext.d.ts +0 -10
- package/dist/cjs/xflow/context/GraphContext.js +0 -21
- package/dist/cjs/xflow/hooks/clipboard/index.d.ts +0 -2
- package/dist/cjs/xflow/hooks/clipboard/index.js +0 -34
- package/dist/cjs/xflow/hooks/dnd/index.d.ts +0 -2
- package/dist/cjs/xflow/hooks/dnd/index.js +0 -29
- package/dist/cjs/xflow/hooks/format/index.d.ts +0 -5
- package/dist/cjs/xflow/hooks/format/index.js +0 -60
- package/dist/cjs/xflow/hooks/graph/index.d.ts +0 -1
- package/dist/cjs/xflow/hooks/graph/index.js +0 -19
- package/dist/cjs/xflow/hooks/history/index.d.ts +0 -4
- package/dist/cjs/xflow/hooks/history/index.js +0 -63
- package/dist/cjs/xflow/hooks/keyboard/index.d.ts +0 -13
- package/dist/cjs/xflow/hooks/keyboard/index.js +0 -55
- package/dist/cjs/xflow/hooks/selection/index.d.ts +0 -3
- package/dist/cjs/xflow/hooks/selection/index.js +0 -41
- package/dist/cjs/xflow/hooks/snapline/index.d.ts +0 -2
- package/dist/cjs/xflow/hooks/snapline/index.js +0 -21
- package/dist/cjs/xflow/hooks/transform/index.d.ts +0 -2
- package/dist/cjs/xflow/hooks/transform/index.js +0 -21
- package/dist/cjs/xflow/index.d.ts +0 -3
- package/dist/cjs/xflow/index.js +0 -44
- package/dist/cjs/xflow/styles/index.less +0 -0
- package/dist/cjs/xflow/types/index.d.ts +0 -19
- package/dist/cjs/xflow/types/index.js +0 -5
- package/dist/cjs/xflow/util/algorithm.d.ts +0 -1
- package/dist/cjs/xflow/util/algorithm.js +0 -10
- package/dist/cjs/xflow/util/index.d.ts +0 -2
- package/dist/cjs/xflow/util/index.js +0 -16
- package/dist/cjs/xflow/util/main.d.ts +0 -2
- package/dist/cjs/xflow/util/main.js +0 -31
- package/dist/cjs/xflow/util/model.d.ts +0 -2
- package/dist/cjs/xflow/util/model.js +0 -29
- package/dist/esm/elsa/components/finishNode.d.ts +0 -0
- package/dist/esm/elsa/components/finishNode.js +0 -0
- package/dist/esm/elsa/components/forkNode.d.ts +0 -0
- package/dist/esm/elsa/components/forkNode.js +0 -0
- package/dist/esm/elsa/components/ifNode.d.ts +0 -0
- package/dist/esm/elsa/components/ifNode.js +0 -0
- package/dist/esm/elsa/components/joinNode.d.ts +0 -0
- package/dist/esm/elsa/components/joinNode.js +0 -0
- package/dist/esm/elsa/components/setNameNode.d.ts +0 -0
- package/dist/esm/elsa/components/setNameNode.js +0 -0
- package/dist/esm/elsa/components/startNode.d.ts +0 -3
- package/dist/esm/elsa/components/startNode.js +0 -14
- package/dist/esm/elsa/components/switchNode.d.ts +0 -0
- package/dist/esm/elsa/components/switchNode.js +0 -0
- package/dist/esm/elsa/components/timerNode.d.ts +0 -0
- package/dist/esm/elsa/components/timerNode.js +0 -0
- package/dist/esm/elsa/components/userTaskNode/index.d.ts +0 -7
- package/dist/esm/elsa/components/userTaskNode/index.js +0 -33
- package/dist/esm/elsa/components/userTaskNode/index.less +0 -0
- package/dist/esm/elsa/components/userTaskNode/register.d.ts +0 -1
- package/dist/esm/elsa/components/userTaskNode/register.js +0 -48
- package/dist/esm/elsa/elsa.design.d.ts +0 -4
- package/dist/esm/elsa/elsa.design.js +0 -105
- package/dist/esm/elsa/index.d.ts +0 -4
- package/dist/esm/elsa/index.js +0 -25
- package/dist/esm/elsa/index.less +0 -21
- package/dist/esm/xflow/components/Wrapper.d.ts +0 -3
- package/dist/esm/xflow/components/Wrapper.js +0 -15
- package/dist/esm/xflow/components/XFlow.d.ts +0 -3
- package/dist/esm/xflow/components/XFlow.js +0 -32
- package/dist/esm/xflow/components/XFlowGraph.d.ts +0 -4
- package/dist/esm/xflow/components/XFlowGraph.js +0 -54
- package/dist/esm/xflow/components/graph-toolbar/index.d.ts +0 -19
- package/dist/esm/xflow/components/graph-toolbar/index.js +0 -44
- package/dist/esm/xflow/components/graph-toolbar/index.less +0 -11
- package/dist/esm/xflow/components/index.d.ts +0 -3
- package/dist/esm/xflow/components/index.js +0 -3
- package/dist/esm/xflow/components/keyboard/index.d.ts +0 -3
- package/dist/esm/xflow/components/keyboard/index.js +0 -22
- package/dist/esm/xflow/components/minimap/index.d.ts +0 -3
- package/dist/esm/xflow/components/minimap/index.js +0 -35
- package/dist/esm/xflow/components/scroller/index.d.ts +0 -4
- package/dist/esm/xflow/components/scroller/index.js +0 -28
- package/dist/esm/xflow/components/selection/index.d.ts +0 -3
- package/dist/esm/xflow/components/selection/index.js +0 -22
- package/dist/esm/xflow/components/snapline/index.d.ts +0 -3
- package/dist/esm/xflow/components/snapline/index.js +0 -22
- package/dist/esm/xflow/components/transform/index.d.ts +0 -3
- package/dist/esm/xflow/components/transform/index.js +0 -20
- package/dist/esm/xflow/context/GraphContext.d.ts +0 -10
- package/dist/esm/xflow/context/GraphContext.js +0 -9
- package/dist/esm/xflow/hooks/clipboard/index.d.ts +0 -2
- package/dist/esm/xflow/hooks/clipboard/index.js +0 -22
- package/dist/esm/xflow/hooks/dnd/index.d.ts +0 -2
- package/dist/esm/xflow/hooks/dnd/index.js +0 -17
- package/dist/esm/xflow/hooks/format/index.d.ts +0 -5
- package/dist/esm/xflow/hooks/format/index.js +0 -48
- package/dist/esm/xflow/hooks/graph/index.d.ts +0 -1
- package/dist/esm/xflow/hooks/graph/index.js +0 -8
- package/dist/esm/xflow/hooks/history/index.d.ts +0 -4
- package/dist/esm/xflow/hooks/history/index.js +0 -45
- package/dist/esm/xflow/hooks/keyboard/index.d.ts +0 -13
- package/dist/esm/xflow/hooks/keyboard/index.js +0 -40
- package/dist/esm/xflow/hooks/selection/index.d.ts +0 -3
- package/dist/esm/xflow/hooks/selection/index.js +0 -25
- package/dist/esm/xflow/hooks/snapline/index.d.ts +0 -2
- package/dist/esm/xflow/hooks/snapline/index.js +0 -9
- package/dist/esm/xflow/hooks/transform/index.d.ts +0 -2
- package/dist/esm/xflow/hooks/transform/index.js +0 -9
- package/dist/esm/xflow/index.d.ts +0 -3
- package/dist/esm/xflow/index.js +0 -3
- package/dist/esm/xflow/styles/index.less +0 -0
- package/dist/esm/xflow/types/index.d.ts +0 -19
- package/dist/esm/xflow/types/index.js +0 -1
- package/dist/esm/xflow/util/algorithm.d.ts +0 -1
- package/dist/esm/xflow/util/algorithm.js +0 -1
- package/dist/esm/xflow/util/index.d.ts +0 -2
- package/dist/esm/xflow/util/index.js +0 -2
- package/dist/esm/xflow/util/main.d.ts +0 -2
- package/dist/esm/xflow/util/main.js +0 -2
- package/dist/esm/xflow/util/model.d.ts +0 -2
- package/dist/esm/xflow/util/model.js +0 -19
|
@@ -37,12 +37,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
37
37
|
|
|
38
38
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
39
|
|
|
40
|
-
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, $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 generator._invoke = function (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); } }; }(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; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), 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 (object) { var 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; }
|
|
41
|
-
|
|
42
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
43
|
-
|
|
44
|
-
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); }); }; }
|
|
45
|
-
|
|
46
40
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
47
41
|
|
|
48
42
|
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."); }
|
|
@@ -71,7 +65,17 @@ var FormRender = function FormRender(props) {
|
|
|
71
65
|
setSchema = _useState2[1];
|
|
72
66
|
|
|
73
67
|
var form = (0, _react2.useMemo)(function () {
|
|
74
|
-
return (0, _core.createForm)(
|
|
68
|
+
return (0, _core.createForm)({
|
|
69
|
+
effects: function effects() {
|
|
70
|
+
return [(0, _core.onFieldInit)('queryForm', function (field) {
|
|
71
|
+
field.query('queryForm').take(function (node) {
|
|
72
|
+
node.setComponentProps({
|
|
73
|
+
onReset: onReset
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
})];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
75
79
|
}, [schema]);
|
|
76
80
|
var SchemaField = (0, _react2.useMemo)(function () {
|
|
77
81
|
return (0, _react.createSchemaField)({
|
|
@@ -93,30 +97,10 @@ var FormRender = function FormRender(props) {
|
|
|
93
97
|
onQuery && onQuery(form.values);
|
|
94
98
|
};
|
|
95
99
|
|
|
96
|
-
var onReset =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
switch (_context.prev = _context.next) {
|
|
101
|
-
case 0:
|
|
102
|
-
_context.next = 2;
|
|
103
|
-
return form.reset();
|
|
104
|
-
|
|
105
|
-
case 2:
|
|
106
|
-
onQuery({});
|
|
107
|
-
|
|
108
|
-
case 3:
|
|
109
|
-
case "end":
|
|
110
|
-
return _context.stop();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}, _callee);
|
|
114
|
-
}));
|
|
115
|
-
|
|
116
|
-
return function onReset() {
|
|
117
|
-
return _ref.apply(this, arguments);
|
|
118
|
-
};
|
|
119
|
-
}();
|
|
100
|
+
var onReset = function onReset() {
|
|
101
|
+
form.reset();
|
|
102
|
+
onQuery({});
|
|
103
|
+
};
|
|
120
104
|
|
|
121
105
|
var getComponent = function getComponent(colDef) {
|
|
122
106
|
var component = colDef.searchComponent ? colDef.searchComponent : undefined;
|
|
@@ -148,7 +132,7 @@ var FormRender = function FormRender(props) {
|
|
|
148
132
|
}
|
|
149
133
|
};
|
|
150
134
|
|
|
151
|
-
var getSchema = function getSchema() {
|
|
135
|
+
var getSchema = function getSchema(reset) {
|
|
152
136
|
var _columns, _columns2;
|
|
153
137
|
|
|
154
138
|
var rootSchema = {
|
|
@@ -162,10 +146,8 @@ var FormRender = function FormRender(props) {
|
|
|
162
146
|
|
|
163
147
|
var gridSchema = {
|
|
164
148
|
type: 'void',
|
|
149
|
+
"name": 'queryForm',
|
|
165
150
|
"x-component": 'QueryForm',
|
|
166
|
-
"x-component-props": {
|
|
167
|
-
onReset: onReset
|
|
168
|
-
},
|
|
169
151
|
properties: {}
|
|
170
152
|
};
|
|
171
153
|
var columns = colDefs === null || colDefs === void 0 ? void 0 : colDefs.map(function (colDef) {
|
|
@@ -213,18 +195,18 @@ var FormRender = function FormRender(props) {
|
|
|
213
195
|
}
|
|
214
196
|
}); ///@ts-ignore
|
|
215
197
|
|
|
216
|
-
rootSchema.properties["
|
|
198
|
+
rootSchema.properties["queryForm"] = gridSchema;
|
|
217
199
|
|
|
218
200
|
if (!((_columns2 = columns) !== null && _columns2 !== void 0 && _columns2.length)) {
|
|
219
201
|
///@ts-ignore
|
|
220
|
-
delete rootSchema.properties["
|
|
202
|
+
delete rootSchema.properties["queryForm"];
|
|
221
203
|
}
|
|
222
204
|
|
|
223
205
|
return rootSchema;
|
|
224
206
|
};
|
|
225
207
|
|
|
226
208
|
(0, _react2.useEffect)(function () {
|
|
227
|
-
var new_schema = getSchema();
|
|
209
|
+
var new_schema = getSchema(onReset);
|
|
228
210
|
setSchema(new_schema);
|
|
229
211
|
}, [JSON.stringify(columnStates)]);
|
|
230
212
|
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
@@ -21,6 +21,8 @@ var _builtins__ = require("@formily/antd-v5/lib/__builtins__");
|
|
|
21
21
|
|
|
22
22
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
23
|
|
|
24
|
+
var _uniqueId = _interopRequireDefault(require("lodash/uniqueId"));
|
|
25
|
+
|
|
24
26
|
var _excluded = ["children"];
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -29,6 +31,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
31
|
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
33
|
|
|
34
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
38
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
|
+
|
|
32
40
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
33
41
|
|
|
34
42
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -101,7 +109,10 @@ ArrayBase.Copy = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
101
109
|
if ((_array$props = array.props) !== null && _array$props !== void 0 && _array$props.disabled) return;
|
|
102
110
|
var value = (0, _shared.clone)(array === null || array === void 0 ? void 0 : (_array$field2 = array.field) === null || _array$field2 === void 0 ? void 0 : _array$field2.value[index]);
|
|
103
111
|
var distIndex = index + 1;
|
|
104
|
-
(_array$field3 = array.field) === null || _array$field3 === void 0 ? void 0 : (_array$field3$insert = _array$field3.insert) === null || _array$field3$insert === void 0 ? void 0 : _array$field3$insert.call(_array$field3, distIndex, value)
|
|
112
|
+
(_array$field3 = array.field) === null || _array$field3 === void 0 ? void 0 : (_array$field3$insert = _array$field3.insert) === null || _array$field3$insert === void 0 ? void 0 : _array$field3$insert.call(_array$field3, distIndex, _objectSpread(_objectSpread({}, value), {}, {
|
|
113
|
+
_id: (0, _uniqueId.default)(),
|
|
114
|
+
_isNew: true
|
|
115
|
+
}));
|
|
105
116
|
(_array$props2 = array.props) === null || _array$props2 === void 0 ? void 0 : (_array$props2$onCopy = _array$props2.onCopy) === null || _array$props2$onCopy === void 0 ? void 0 : _array$props2$onCopy.call(_array$props2, distIndex);
|
|
106
117
|
|
|
107
118
|
if (props.onClick) {
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -5,6 +5,5 @@ import ExtensibleGrid from "./extensible-grid";
|
|
|
5
5
|
import Editable from "./editable";
|
|
6
6
|
import DialogSelect from "./dialogSelect";
|
|
7
7
|
import Dashboard from "./dashboard";
|
|
8
|
-
|
|
9
|
-
export { Editable, DialogSelect, ArrayTable, ArrayTableIndex, AgGridColumn, AgGridPlus, ExtensibleGrid, Dashboard, Elsa };
|
|
8
|
+
export { Editable, DialogSelect, ArrayTable, ArrayTableIndex, AgGridColumn, AgGridPlus, ExtensibleGrid, Dashboard };
|
|
10
9
|
export { flattenTreeDeep };
|
package/dist/cjs/index.js
CHANGED
|
@@ -45,12 +45,6 @@ Object.defineProperty(exports, "Editable", {
|
|
|
45
45
|
return _editable.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "Elsa", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function get() {
|
|
51
|
-
return _elsa.default;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
48
|
Object.defineProperty(exports, "ExtensibleGrid", {
|
|
55
49
|
enumerable: true,
|
|
56
50
|
get: function get() {
|
|
@@ -78,6 +72,4 @@ var _dialogSelect = _interopRequireDefault(require("./dialogSelect"));
|
|
|
78
72
|
|
|
79
73
|
var _dashboard = _interopRequireDefault(require("./dashboard"));
|
|
80
74
|
|
|
81
|
-
var _elsa = _interopRequireDefault(require("./elsa"));
|
|
82
|
-
|
|
83
75
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,17 +1,9 @@
|
|
|
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
|
-
|
|
3
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
2
|
|
|
5
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; }
|
|
6
4
|
|
|
7
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
6
|
|
|
9
|
-
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, $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 generator._invoke = function (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); } }; }(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; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), 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 (object) { var 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; }
|
|
10
|
-
|
|
11
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
-
|
|
13
|
-
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); }); }; }
|
|
14
|
-
|
|
15
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
8
|
|
|
17
9
|
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,6 +18,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
26
18
|
|
|
27
19
|
import { DatePicker, FormButtonGroup, FormGrid, FormItem, Form, Input, Submit } from '@formily/antd-v5';
|
|
28
20
|
import { createForm } from '@formily/core';
|
|
21
|
+
import { onFieldInit } from '@formily/core';
|
|
29
22
|
import { createSchemaField } from '@formily/react';
|
|
30
23
|
import { Button } from 'antd';
|
|
31
24
|
import classNames from 'classnames';
|
|
@@ -50,7 +43,17 @@ var FormRender = function FormRender(props) {
|
|
|
50
43
|
setSchema = _useState2[1];
|
|
51
44
|
|
|
52
45
|
var form = useMemo(function () {
|
|
53
|
-
return createForm(
|
|
46
|
+
return createForm({
|
|
47
|
+
effects: function effects() {
|
|
48
|
+
return [onFieldInit('queryForm', function (field) {
|
|
49
|
+
field.query('queryForm').take(function (node) {
|
|
50
|
+
node.setComponentProps({
|
|
51
|
+
onReset: onReset
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
})];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
54
57
|
}, [schema]);
|
|
55
58
|
var SchemaField = useMemo(function () {
|
|
56
59
|
return createSchemaField({
|
|
@@ -72,30 +75,10 @@ var FormRender = function FormRender(props) {
|
|
|
72
75
|
onQuery && onQuery(form.values);
|
|
73
76
|
};
|
|
74
77
|
|
|
75
|
-
var onReset =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
switch (_context.prev = _context.next) {
|
|
80
|
-
case 0:
|
|
81
|
-
_context.next = 2;
|
|
82
|
-
return form.reset();
|
|
83
|
-
|
|
84
|
-
case 2:
|
|
85
|
-
onQuery({});
|
|
86
|
-
|
|
87
|
-
case 3:
|
|
88
|
-
case "end":
|
|
89
|
-
return _context.stop();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}, _callee);
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
return function onReset() {
|
|
96
|
-
return _ref.apply(this, arguments);
|
|
97
|
-
};
|
|
98
|
-
}();
|
|
78
|
+
var onReset = function onReset() {
|
|
79
|
+
form.reset();
|
|
80
|
+
onQuery({});
|
|
81
|
+
};
|
|
99
82
|
|
|
100
83
|
var getComponent = function getComponent(colDef) {
|
|
101
84
|
var component = colDef.searchComponent ? colDef.searchComponent : undefined;
|
|
@@ -127,7 +110,7 @@ var FormRender = function FormRender(props) {
|
|
|
127
110
|
}
|
|
128
111
|
};
|
|
129
112
|
|
|
130
|
-
var getSchema = function getSchema() {
|
|
113
|
+
var getSchema = function getSchema(reset) {
|
|
131
114
|
var _columns, _columns2;
|
|
132
115
|
|
|
133
116
|
var rootSchema = {
|
|
@@ -141,10 +124,8 @@ var FormRender = function FormRender(props) {
|
|
|
141
124
|
|
|
142
125
|
var gridSchema = {
|
|
143
126
|
type: 'void',
|
|
127
|
+
"name": 'queryForm',
|
|
144
128
|
"x-component": 'QueryForm',
|
|
145
|
-
"x-component-props": {
|
|
146
|
-
onReset: onReset
|
|
147
|
-
},
|
|
148
129
|
properties: {}
|
|
149
130
|
};
|
|
150
131
|
var columns = colDefs === null || colDefs === void 0 ? void 0 : colDefs.map(function (colDef) {
|
|
@@ -192,18 +173,18 @@ var FormRender = function FormRender(props) {
|
|
|
192
173
|
}
|
|
193
174
|
}); ///@ts-ignore
|
|
194
175
|
|
|
195
|
-
rootSchema.properties["
|
|
176
|
+
rootSchema.properties["queryForm"] = gridSchema;
|
|
196
177
|
|
|
197
178
|
if (!((_columns2 = columns) !== null && _columns2 !== void 0 && _columns2.length)) {
|
|
198
179
|
///@ts-ignore
|
|
199
|
-
delete rootSchema.properties["
|
|
180
|
+
delete rootSchema.properties["queryForm"];
|
|
200
181
|
}
|
|
201
182
|
|
|
202
183
|
return rootSchema;
|
|
203
184
|
};
|
|
204
185
|
|
|
205
186
|
useEffect(function () {
|
|
206
|
-
var new_schema = getSchema();
|
|
187
|
+
var new_schema = getSchema(onReset);
|
|
207
188
|
setSchema(new_schema);
|
|
208
189
|
}, [JSON.stringify(columnStates)]);
|
|
209
190
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
var _excluded = ["children"];
|
|
2
2
|
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
3
9
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
10
|
|
|
5
11
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -13,6 +19,7 @@ import { useField } from '@formily/react';
|
|
|
13
19
|
import { clone, isUndef } from '@formily/shared';
|
|
14
20
|
import { usePrefixCls } from '@formily/antd-v5/lib/__builtins__';
|
|
15
21
|
import cls from 'classnames';
|
|
22
|
+
import uniqueId from 'lodash/uniqueId';
|
|
16
23
|
var ItemContext = /*#__PURE__*/createContext(null);
|
|
17
24
|
|
|
18
25
|
var takeRecord = function takeRecord(val, index) {
|
|
@@ -77,7 +84,10 @@ ArrayBase.Copy = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
77
84
|
if ((_array$props = array.props) !== null && _array$props !== void 0 && _array$props.disabled) return;
|
|
78
85
|
var value = clone(array === null || array === void 0 ? void 0 : (_array$field2 = array.field) === null || _array$field2 === void 0 ? void 0 : _array$field2.value[index]);
|
|
79
86
|
var distIndex = index + 1;
|
|
80
|
-
(_array$field3 = array.field) === null || _array$field3 === void 0 ? void 0 : (_array$field3$insert = _array$field3.insert) === null || _array$field3$insert === void 0 ? void 0 : _array$field3$insert.call(_array$field3, distIndex, value)
|
|
87
|
+
(_array$field3 = array.field) === null || _array$field3 === void 0 ? void 0 : (_array$field3$insert = _array$field3.insert) === null || _array$field3$insert === void 0 ? void 0 : _array$field3$insert.call(_array$field3, distIndex, _objectSpread(_objectSpread({}, value), {}, {
|
|
88
|
+
_id: uniqueId(),
|
|
89
|
+
_isNew: true
|
|
90
|
+
}));
|
|
81
91
|
(_array$props2 = array.props) === null || _array$props2 === void 0 ? void 0 : (_array$props2$onCopy = _array$props2.onCopy) === null || _array$props2$onCopy === void 0 ? void 0 : _array$props2$onCopy.call(_array$props2, distIndex);
|
|
82
92
|
|
|
83
93
|
if (props.onClick) {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -5,6 +5,5 @@ import ExtensibleGrid from "./extensible-grid";
|
|
|
5
5
|
import Editable from "./editable";
|
|
6
6
|
import DialogSelect from "./dialogSelect";
|
|
7
7
|
import Dashboard from "./dashboard";
|
|
8
|
-
|
|
9
|
-
export { Editable, DialogSelect, ArrayTable, ArrayTableIndex, AgGridColumn, AgGridPlus, ExtensibleGrid, Dashboard, Elsa };
|
|
8
|
+
export { Editable, DialogSelect, ArrayTable, ArrayTableIndex, AgGridColumn, AgGridPlus, ExtensibleGrid, Dashboard };
|
|
10
9
|
export { flattenTreeDeep };
|
package/dist/esm/index.js
CHANGED
|
@@ -5,6 +5,5 @@ import ExtensibleGrid from "./extensible-grid";
|
|
|
5
5
|
import Editable from "./editable";
|
|
6
6
|
import DialogSelect from "./dialogSelect";
|
|
7
7
|
import Dashboard from "./dashboard";
|
|
8
|
-
|
|
9
|
-
export { Editable, DialogSelect, ArrayTable, ArrayTableIndex, AgGridColumn, AgGridPlus, ExtensibleGrid, Dashboard, Elsa };
|
|
8
|
+
export { Editable, DialogSelect, ArrayTable, ArrayTableIndex, AgGridColumn, AgGridPlus, ExtensibleGrid, Dashboard };
|
|
10
9
|
export { flattenTreeDeep };
|