@nokecy/qc-ui 0.0.1

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 (128) hide show
  1. package/README.md +23 -0
  2. package/dist/cjs/ag-grid-plus/ag-gridPlus.d.ts +5 -0
  3. package/dist/cjs/ag-grid-plus/ag-gridPlus.js +191 -0
  4. package/dist/cjs/ag-grid-plus/global.scss +65 -0
  5. package/dist/cjs/ag-grid-plus/gridManager/index.d.ts +8 -0
  6. package/dist/cjs/ag-grid-plus/gridManager/index.js +51 -0
  7. package/dist/cjs/ag-grid-plus/index.d.ts +3 -0
  8. package/dist/cjs/ag-grid-plus/index.js +23 -0
  9. package/dist/cjs/ag-grid-plus/interface.d.ts +25 -0
  10. package/dist/cjs/ag-grid-plus/interface.js +17 -0
  11. package/dist/cjs/ag-grid-plus/queryForm/index.d.ts +10 -0
  12. package/dist/cjs/ag-grid-plus/queryForm/index.js +210 -0
  13. package/dist/cjs/ag-grid-plus/queryForm/index.less +48 -0
  14. package/dist/cjs/ag-grid-plus/queryForm/queryForm.d.ts +3 -0
  15. package/dist/cjs/ag-grid-plus/queryForm/queryForm.js +110 -0
  16. package/dist/cjs/array-table/index.d.ts +10 -0
  17. package/dist/cjs/array-table/index.js +205 -0
  18. package/dist/cjs/dashboard/dashboard/components/index.d.ts +2 -0
  19. package/dist/cjs/dashboard/dashboard/components/index.js +15 -0
  20. package/dist/cjs/dashboard/dashboard/components/modal/index.d.ts +3 -0
  21. package/dist/cjs/dashboard/dashboard/components/modal/index.js +26 -0
  22. package/dist/cjs/dashboard/dashboard/components/toolbar/index.d.ts +11 -0
  23. package/dist/cjs/dashboard/dashboard/components/toolbar/index.js +37 -0
  24. package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.d.ts +1 -0
  25. package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.js +3 -0
  26. package/dist/cjs/dashboard/dashboard/components/toolbar/style/index.less +49 -0
  27. package/dist/cjs/dashboard/dashboard/index.d.ts +62 -0
  28. package/dist/cjs/dashboard/dashboard/index.js +603 -0
  29. package/dist/cjs/dashboard/dashboard/index.less +173 -0
  30. package/dist/cjs/dashboard/dashboard/service.d.ts +8 -0
  31. package/dist/cjs/dashboard/dashboard/service.js +114 -0
  32. package/dist/cjs/dashboard/dashboard/utils.d.ts +9 -0
  33. package/dist/cjs/dashboard/dashboard/utils.js +126 -0
  34. package/dist/cjs/dashboard/index.d.ts +3 -0
  35. package/dist/cjs/dashboard/index.js +30 -0
  36. package/dist/cjs/dashboard/utils.d.ts +24 -0
  37. package/dist/cjs/dashboard/utils.js +162 -0
  38. package/dist/cjs/dashboard/widget/index.d.ts +13 -0
  39. package/dist/cjs/dashboard/widget/index.js +79 -0
  40. package/dist/cjs/dashboard/widget/index.less +7 -0
  41. package/dist/cjs/dashboard/widget/selector/index.d.ts +4 -0
  42. package/dist/cjs/dashboard/widget/selector/index.js +271 -0
  43. package/dist/cjs/dashboard/widget/selector/index.less +434 -0
  44. package/dist/cjs/dashboard/widget/utils.d.ts +4 -0
  45. package/dist/cjs/dashboard/widget/utils.js +116 -0
  46. package/dist/cjs/elsaFlow/config-graph.d.ts +1 -0
  47. package/dist/cjs/elsaFlow/config-graph.js +57 -0
  48. package/dist/cjs/elsaFlow/index.d.ts +6 -0
  49. package/dist/cjs/elsaFlow/index.js +199 -0
  50. package/dist/cjs/elsaFlow/react-edge/edge1.d.ts +4 -0
  51. package/dist/cjs/elsaFlow/react-edge/edge1.js +31 -0
  52. package/dist/cjs/elsaFlow/react-edge/edge1.less +0 -0
  53. package/dist/cjs/elsaFlow/react-edge/edge2.d.ts +4 -0
  54. package/dist/cjs/elsaFlow/react-edge/edge2.js +31 -0
  55. package/dist/cjs/elsaFlow/react-edge/edge2.less +0 -0
  56. package/dist/cjs/elsaFlow/react-node/node1.d.ts +4 -0
  57. package/dist/cjs/elsaFlow/react-node/node1.js +28 -0
  58. package/dist/cjs/elsaFlow/react-node/node1.less +11 -0
  59. package/dist/cjs/elsaFlow/react-node/node2.d.ts +4 -0
  60. package/dist/cjs/elsaFlow/react-node/node2.js +28 -0
  61. package/dist/cjs/elsaFlow/react-node/node2.less +11 -0
  62. package/dist/cjs/index.d.ts +4 -0
  63. package/dist/cjs/index.js +37 -0
  64. package/dist/esm/ag-grid-plus/ag-gridPlus.d.ts +5 -0
  65. package/dist/esm/ag-grid-plus/ag-gridPlus.js +169 -0
  66. package/dist/esm/ag-grid-plus/global.scss +65 -0
  67. package/dist/esm/ag-grid-plus/gridManager/index.d.ts +8 -0
  68. package/dist/esm/ag-grid-plus/gridManager/index.js +44 -0
  69. package/dist/esm/ag-grid-plus/index.d.ts +3 -0
  70. package/dist/esm/ag-grid-plus/index.js +3 -0
  71. package/dist/esm/ag-grid-plus/interface.d.ts +25 -0
  72. package/dist/esm/ag-grid-plus/interface.js +9 -0
  73. package/dist/esm/ag-grid-plus/queryForm/index.d.ts +10 -0
  74. package/dist/esm/ag-grid-plus/queryForm/index.js +189 -0
  75. package/dist/esm/ag-grid-plus/queryForm/index.less +48 -0
  76. package/dist/esm/ag-grid-plus/queryForm/queryForm.d.ts +3 -0
  77. package/dist/esm/ag-grid-plus/queryForm/queryForm.js +92 -0
  78. package/dist/esm/array-table/index.d.ts +10 -0
  79. package/dist/esm/array-table/index.js +179 -0
  80. package/dist/esm/dashboard/dashboard/components/index.d.ts +2 -0
  81. package/dist/esm/dashboard/dashboard/components/index.js +2 -0
  82. package/dist/esm/dashboard/dashboard/components/modal/index.d.ts +3 -0
  83. package/dist/esm/dashboard/dashboard/components/modal/index.js +17 -0
  84. package/dist/esm/dashboard/dashboard/components/toolbar/index.d.ts +11 -0
  85. package/dist/esm/dashboard/dashboard/components/toolbar/index.js +24 -0
  86. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.d.ts +1 -0
  87. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.js +1 -0
  88. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.less +49 -0
  89. package/dist/esm/dashboard/dashboard/index.d.ts +62 -0
  90. package/dist/esm/dashboard/dashboard/index.js +571 -0
  91. package/dist/esm/dashboard/dashboard/index.less +173 -0
  92. package/dist/esm/dashboard/dashboard/service.d.ts +8 -0
  93. package/dist/esm/dashboard/dashboard/service.js +102 -0
  94. package/dist/esm/dashboard/dashboard/utils.d.ts +9 -0
  95. package/dist/esm/dashboard/dashboard/utils.js +106 -0
  96. package/dist/esm/dashboard/index.d.ts +3 -0
  97. package/dist/esm/dashboard/index.js +3 -0
  98. package/dist/esm/dashboard/utils.d.ts +24 -0
  99. package/dist/esm/dashboard/utils.js +142 -0
  100. package/dist/esm/dashboard/widget/index.d.ts +13 -0
  101. package/dist/esm/dashboard/widget/index.js +59 -0
  102. package/dist/esm/dashboard/widget/index.less +7 -0
  103. package/dist/esm/dashboard/widget/selector/index.d.ts +4 -0
  104. package/dist/esm/dashboard/widget/selector/index.js +249 -0
  105. package/dist/esm/dashboard/widget/selector/index.less +434 -0
  106. package/dist/esm/dashboard/widget/utils.d.ts +4 -0
  107. package/dist/esm/dashboard/widget/utils.js +88 -0
  108. package/dist/esm/elsaFlow/config-graph.d.ts +1 -0
  109. package/dist/esm/elsaFlow/config-graph.js +42 -0
  110. package/dist/esm/elsaFlow/index.d.ts +6 -0
  111. package/dist/esm/elsaFlow/index.js +189 -0
  112. package/dist/esm/elsaFlow/react-edge/edge1.d.ts +4 -0
  113. package/dist/esm/elsaFlow/react-edge/edge1.js +18 -0
  114. package/dist/esm/elsaFlow/react-edge/edge1.less +0 -0
  115. package/dist/esm/elsaFlow/react-edge/edge2.d.ts +4 -0
  116. package/dist/esm/elsaFlow/react-edge/edge2.js +18 -0
  117. package/dist/esm/elsaFlow/react-edge/edge2.less +0 -0
  118. package/dist/esm/elsaFlow/react-node/node1.d.ts +4 -0
  119. package/dist/esm/elsaFlow/react-node/node1.js +16 -0
  120. package/dist/esm/elsaFlow/react-node/node1.less +11 -0
  121. package/dist/esm/elsaFlow/react-node/node2.d.ts +4 -0
  122. package/dist/esm/elsaFlow/react-node/node2.js +16 -0
  123. package/dist/esm/elsaFlow/react-node/node2.less +11 -0
  124. package/dist/esm/index.d.ts +4 -0
  125. package/dist/esm/index.js +5 -0
  126. package/dist/umd/qc-ui.min.css +1 -0
  127. package/dist/umd/qc-ui.min.js +1 -0
  128. package/package.json +61 -0
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _antd = require("@formily/antd");
11
+
12
+ var _core = require("@formily/core");
13
+
14
+ var _react = require("@formily/react");
15
+
16
+ var _antd2 = require("antd");
17
+
18
+ var _classnames = _interopRequireDefault(require("classnames"));
19
+
20
+ var _react2 = _interopRequireWildcard(require("react"));
21
+
22
+ var _queryForm = _interopRequireDefault(require("./queryForm"));
23
+
24
+ require("./index.less");
25
+
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+
28
+ 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; }
29
+
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+
32
+ 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; }
33
+
34
+ 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; }
35
+
36
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
37
+
38
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
+
40
+ 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."); }
41
+
42
+ 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); }
43
+
44
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
45
+
46
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
47
+
48
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
+
50
+ 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; }
51
+
52
+ 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); } }
53
+
54
+ 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); }); }; }
55
+
56
+ var FormRender = function FormRender(props) {
57
+ var className = props.className,
58
+ gridApi = props.gridApi,
59
+ columns = props.columns,
60
+ onQuery = props.onQuery;
61
+ var form = (0, _react2.useMemo)(function () {
62
+ return (0, _core.createForm)();
63
+ }, []);
64
+ var SchemaField = (0, _react2.useMemo)(function () {
65
+ return (0, _react.createSchemaField)({
66
+ components: {
67
+ QueryForm: _queryForm.default,
68
+ Input: _antd.Input,
69
+ DatePicker: _antd.DatePicker,
70
+ FormItem: _antd.FormItem,
71
+ FormGrid: _antd.FormGrid,
72
+ FormButtonGroup: _antd.FormButtonGroup,
73
+ Submit: _antd.Submit,
74
+ Button: _antd2.Button
75
+ }
76
+ });
77
+ }, []);
78
+
79
+ var onSubmit = function onSubmit() {
80
+ form.submit(function (formValues) {
81
+ onQuery(formValues);
82
+ });
83
+ };
84
+
85
+ var onReset = /*#__PURE__*/function () {
86
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
87
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
88
+ while (1) {
89
+ switch (_context.prev = _context.next) {
90
+ case 0:
91
+ _context.next = 2;
92
+ return form.reset();
93
+
94
+ case 2:
95
+ onQuery({});
96
+
97
+ case 3:
98
+ case "end":
99
+ return _context.stop();
100
+ }
101
+ }
102
+ }, _callee);
103
+ }));
104
+
105
+ return function onReset() {
106
+ return _ref.apply(this, arguments);
107
+ };
108
+ }();
109
+
110
+ var _useState = (0, _react2.useState)({
111
+ type: 'object',
112
+ properties: {}
113
+ }),
114
+ _useState2 = _slicedToArray(_useState, 2),
115
+ schema = _useState2[0],
116
+ setSchema = _useState2[1];
117
+
118
+ var getSchema = function getSchema() {
119
+ var rootSchema = {
120
+ type: 'object',
121
+ properties: {}
122
+ };
123
+
124
+ if (!columns) {
125
+ return rootSchema;
126
+ }
127
+
128
+ var gridSchema = {
129
+ type: 'void',
130
+ "x-component": 'QueryForm',
131
+ "x-component-props": {
132
+ onReset: onReset
133
+ },
134
+ properties: {}
135
+ };
136
+ columns.forEach(function (i, index) {
137
+ i.searchSort = i.getColDef().searchSort === 0 ? i.getColDef().searchSort : i.getColDef().searchSort || index;
138
+ }); //ag-grid 列 添加属性 searchSort,冒泡排序表单
139
+
140
+ for (var i = 0; i < columns.length - 1; i++) {
141
+ for (var j = 0; j < columns.length - 1 - i; j++) {
142
+ if (columns[j].searchSort > columns[j + 1].searchSort) {
143
+ var temp = columns[j];
144
+ columns[j] = columns[j + 1];
145
+ columns[j + 1] = temp;
146
+ }
147
+ }
148
+ }
149
+
150
+ var arr = columns.filter(function (i) {
151
+ return (i === null || i === void 0 ? void 0 : i.visible) != false && !i.getColDef().hideInSearch || i.getColDef().hideInTable;
152
+ });
153
+ arr.map(function (col) {
154
+ var colDef = col.getColDef();
155
+ var name = colDef.field;
156
+ var headerName = colDef.headerName; //表单自定义组件
157
+
158
+ var component = colDef.searchComponent ? colDef.searchComponent : colDef.filter == "agDateColumnFilter" ? "DatePicker.RangePicker" : "Input";
159
+
160
+ if (colDef.filter != false) {
161
+ var _colDef$searchCompone, _colDef$searchCompone2;
162
+
163
+ var filedSchema = {
164
+ type: 'string',
165
+ title: headerName,
166
+ required: (colDef === null || colDef === void 0 ? void 0 : (_colDef$searchCompone = colDef.searchComponentProps) === null || _colDef$searchCompone === void 0 ? void 0 : _colDef$searchCompone.required) || false,
167
+ default: colDef === null || colDef === void 0 ? void 0 : (_colDef$searchCompone2 = colDef.searchComponentProps) === null || _colDef$searchCompone2 === void 0 ? void 0 : _colDef$searchCompone2.default,
168
+ "x-component": component,
169
+ "x-component-props": _objectSpread({
170
+ placeholder: "\u8BF7\u8F93\u5165".concat(headerName),
171
+ allowClear: true,
172
+ style: {
173
+ maxWidth: 200
174
+ }
175
+ }, colDef === null || colDef === void 0 ? void 0 : colDef.searchComponentProps),
176
+ "x-decorator": 'FormItem'
177
+ }; ///@ts-ignore
178
+
179
+ gridSchema.properties[name] = filedSchema;
180
+ }
181
+ }); ///@ts-ignore
182
+
183
+ rootSchema.properties["grid"] = gridSchema;
184
+
185
+ if (!arr.length) {
186
+ ///@ts-ignore
187
+ delete rootSchema.properties["grid"];
188
+ }
189
+
190
+ return rootSchema;
191
+ };
192
+
193
+ (0, _react2.useEffect)(function () {
194
+ var new_schema = getSchema();
195
+ setSchema(new_schema);
196
+ }, [columns]);
197
+ return /*#__PURE__*/_react2.default.createElement("div", {
198
+ className: (0, _classnames.default)(className, "ag-grid-table-search ag-grid-table-search-query-filter")
199
+ }, /*#__PURE__*/_react2.default.createElement(_antd.Form, {
200
+ form: form,
201
+ labelWidth: 100,
202
+ feedbackLayout: "none",
203
+ onAutoSubmit: onSubmit
204
+ }, /*#__PURE__*/_react2.default.createElement(SchemaField, {
205
+ schema: schema
206
+ })));
207
+ };
208
+
209
+ var _default = FormRender;
210
+ exports.default = _default;
@@ -0,0 +1,48 @@
1
+
2
+ @pro-table-search-prefix-cls: ~'ag-grid-table-search';
3
+
4
+ @pro-table-form-prefix-cls: ~'ag-grid-table-form';
5
+
6
+ .@{pro-table-search-prefix-cls} {
7
+ margin-bottom: 8px;
8
+ padding: 8px;
9
+ // padding-bottom: 0;
10
+ background-color: #fff;
11
+
12
+ &.@{pro-table-form-prefix-cls} {
13
+ margin: 0;
14
+ padding: 0 16px;
15
+ overflow: unset;
16
+ }
17
+
18
+ &-light {
19
+ margin-bottom: 0;
20
+ padding: 16px 0;
21
+ }
22
+
23
+ &-form-option {
24
+ .ant-form-item {
25
+ margin: 0;
26
+ }
27
+
28
+ .ant-form-item-label {
29
+ opacity: 0;
30
+ }
31
+
32
+ .ant-form-item-control-input {
33
+ justify-content: flex-start;
34
+ }
35
+ }
36
+ }
37
+
38
+ @media (max-width: 575px) {
39
+ .@{pro-table-search-prefix-cls} {
40
+ height: auto !important;
41
+ padding-bottom: 24px;
42
+
43
+ .ant-form-item-label {
44
+ min-width: 80px;
45
+ text-align: left;
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const QueryForm: React.FC;
3
+ export default QueryForm;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _antd = require("@formily/antd");
13
+
14
+ var _icons = require("@ant-design/icons");
15
+
16
+ var _antd2 = require("antd");
17
+
18
+ var _react2 = require("@formily/react");
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ 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; }
23
+
24
+ var useCollapseGrid = function useCollapseGrid(maxRows) {
25
+ var grid = (0, _react.useMemo)(function () {
26
+ return _antd.FormGrid.createFormGrid({
27
+ maxColumns: 5,
28
+ maxWidth: 240,
29
+ maxRows: maxRows,
30
+ shouldVisible: function shouldVisible(node, grid) {
31
+ if (node.index === grid.childSize - 1) return true;
32
+ if (grid.maxRows === Infinity) return true;
33
+ return node.shadowRow < maxRows + 1 && node.index < grid.maxColumns - 1;
34
+ }
35
+ });
36
+ }, []);
37
+ var expanded = grid.maxRows === Infinity;
38
+ var realRows = grid.shadowRows;
39
+ var computeRows = grid.fullnessLastColumn ? grid.shadowRows - 1 : grid.shadowRows;
40
+
41
+ var toggle = function toggle() {
42
+ if (grid.maxRows === Infinity) {
43
+ grid.maxRows = maxRows;
44
+ } else {
45
+ grid.maxRows = Infinity;
46
+ }
47
+ };
48
+
49
+ var takeType = function takeType() {
50
+ if (realRows < maxRows + 1) return 'incomplete-wrap';
51
+ if (computeRows > maxRows) return 'collapsible';
52
+ return 'complete-wrap';
53
+ };
54
+
55
+ return {
56
+ grid: grid,
57
+ expanded: expanded,
58
+ toggle: toggle,
59
+ type: takeType()
60
+ };
61
+ };
62
+
63
+ var QueryForm = (0, _react2.observer)(function (props) {
64
+ var onReset = props.onReset;
65
+
66
+ var _useCollapseGrid = useCollapseGrid(1),
67
+ grid = _useCollapseGrid.grid,
68
+ expanded = _useCollapseGrid.expanded,
69
+ toggle = _useCollapseGrid.toggle,
70
+ type = _useCollapseGrid.type;
71
+
72
+ var renderActions = function renderActions() {
73
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.Submit, null, "\u67E5\u8BE2"), /*#__PURE__*/_react.default.createElement(_antd2.Button, {
74
+ onClick: onReset
75
+ }, "\u91CD\u7F6E"));
76
+ };
77
+
78
+ var renderExpanded = function renderExpanded() {
79
+ return /*#__PURE__*/_react.default.createElement("a", {
80
+ onClick: function onClick(e) {
81
+ e.preventDefault();
82
+ toggle();
83
+ }
84
+ }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, expanded ? '收起' : '展开', /*#__PURE__*/_react.default.createElement(_icons.DownOutlined, {
85
+ style: {
86
+ marginLeft: '0.5em',
87
+ transition: '0.3s all',
88
+ transform: "rotate(".concat(expanded ? 0 : 0.5, "turn)")
89
+ }
90
+ })));
91
+ };
92
+
93
+ var renderButtonGroup = function renderButtonGroup() {
94
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.FormButtonGroup, {
95
+ align: "right"
96
+ }, renderActions(), type === 'collapsible' ? renderExpanded() : null));
97
+ };
98
+
99
+ return /*#__PURE__*/_react.default.createElement(_antd.FormGrid, {
100
+ grid: grid
101
+ }, props.children, /*#__PURE__*/_react.default.createElement(_antd.FormGrid.GridColumn, {
102
+ gridSpan: -1,
103
+ style: {
104
+ display: 'flex',
105
+ justifyContent: 'right'
106
+ }
107
+ }, renderButtonGroup()));
108
+ });
109
+ var _default = QueryForm;
110
+ exports.default = _default;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AgGridReactProps, AgGridColumnProps } from 'ag-grid-react';
3
+ import { ArrayBaseMixins } from '@formily/antd';
4
+ import '@ag-grid-community/core/dist/styles/ag-grid.css';
5
+ import '@ag-grid-community/core/dist/styles/ag-theme-alpine.css';
6
+ declare type ComposedArrayTable = React.FC<React.PropsWithChildren<AgGridReactProps>> & ArrayBaseMixins & {
7
+ Column?: React.FC<React.PropsWithChildren<AgGridColumnProps>>;
8
+ };
9
+ export declare const ArrayTable: ComposedArrayTable;
10
+ export default ArrayTable;
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.ArrayTable = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _agGridReact = require("ag-grid-react");
13
+
14
+ var _react2 = require("@formily/react");
15
+
16
+ var _shared = require("@formily/shared");
17
+
18
+ var _antd = require("@formily/antd");
19
+
20
+ var _uniqueId = _interopRequireDefault(require("lodash/uniqueId"));
21
+
22
+ require("@ag-grid-community/core/dist/styles/ag-grid.css");
23
+
24
+ require("@ag-grid-community/core/dist/styles/ag-theme-alpine.css");
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
+
28
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
+
30
+ 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
+
32
+ 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
+
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
+
40
+ var isColumnComponent = function isColumnComponent(schema) {
41
+ var _schema$xComponent;
42
+
43
+ return ((_schema$xComponent = schema['x-component']) === null || _schema$xComponent === void 0 ? void 0 : _schema$xComponent.indexOf('Column')) > -1;
44
+ };
45
+
46
+ var isOperationsComponent = function isOperationsComponent(schema) {
47
+ var _schema$xComponent2;
48
+
49
+ return ((_schema$xComponent2 = schema['x-component']) === null || _schema$xComponent2 === void 0 ? void 0 : _schema$xComponent2.indexOf('Operations')) > -1;
50
+ };
51
+
52
+ var isAdditionComponent = function isAdditionComponent(schema) {
53
+ var _schema$xComponent3;
54
+
55
+ return ((_schema$xComponent3 = schema['x-component']) === null || _schema$xComponent3 === void 0 ? void 0 : _schema$xComponent3.indexOf('Addition')) > -1;
56
+ };
57
+
58
+ var useArrayTableSources = function useArrayTableSources() {
59
+ var arrayField = (0, _react2.useField)();
60
+ var schema = (0, _react2.useFieldSchema)();
61
+
62
+ var parseSources = function parseSources(schema) {
63
+ if (isColumnComponent(schema) || isOperationsComponent(schema) || isAdditionComponent(schema)) {
64
+ var _schema$xComponentP, _schema$xComponentP2, _field$component;
65
+
66
+ if (!((_schema$xComponentP = schema['x-component-props']) !== null && _schema$xComponentP !== void 0 && _schema$xComponentP['dataIndex']) && !schema['name']) return [];
67
+ var name = ((_schema$xComponentP2 = schema['x-component-props']) === null || _schema$xComponentP2 === void 0 ? void 0 : _schema$xComponentP2['dataIndex']) || schema['name'];
68
+ var field = arrayField.query(arrayField.address.concat(name)).take();
69
+ var columnProps = (field === null || field === void 0 ? void 0 : (_field$component = field.component) === null || _field$component === void 0 ? void 0 : _field$component[1]) || schema['x-component-props'] || {};
70
+ var display = (field === null || field === void 0 ? void 0 : field.display) || schema['x-display'];
71
+ return [{
72
+ name: name,
73
+ display: display,
74
+ field: field,
75
+ schema: schema,
76
+ columnProps: columnProps
77
+ }];
78
+ } else if (schema.properties) {
79
+ return schema.reduceProperties(function (buf, schema) {
80
+ return buf.concat(parseSources(schema));
81
+ }, []);
82
+ }
83
+ };
84
+
85
+ var parseArrayItems = function parseArrayItems(schema) {
86
+ if (!schema) return [];
87
+ var sources = [];
88
+ var items = (0, _shared.isArr)(schema) ? schema : [schema];
89
+ return items.reduce(function (columns, schema) {
90
+ var item = parseSources(schema);
91
+
92
+ if (item) {
93
+ return columns.concat(item);
94
+ }
95
+
96
+ return columns;
97
+ }, sources);
98
+ };
99
+
100
+ if (!schema) throw new Error('can not found schema object');
101
+ return parseArrayItems(schema.items);
102
+ };
103
+
104
+ var useArrayTableColumns = function useArrayTableColumns(field, sources) {
105
+ return sources.reduce(function (buf, _ref, key) {
106
+ var name = _ref.name,
107
+ columnProps = _ref.columnProps,
108
+ schema = _ref.schema,
109
+ display = _ref.display;
110
+ if (display !== 'visible') return buf;
111
+ if (!isColumnComponent(schema)) return buf;
112
+ return buf.concat(_objectSpread(_objectSpread({}, columnProps), {}, {
113
+ field: name,
114
+ cellRenderer: function cellRenderer(_ref2) {
115
+ var _field$value;
116
+
117
+ var value = _ref2.value,
118
+ record = _ref2.data;
119
+ var index = field === null || field === void 0 ? void 0 : (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.indexOf(record);
120
+
121
+ var children = /*#__PURE__*/_react.default.createElement(_antd.ArrayBase.Item, {
122
+ index: index,
123
+ record: function record() {
124
+ var _field$value2;
125
+
126
+ return field === null || field === void 0 ? void 0 : (_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2[index];
127
+ }
128
+ }, /*#__PURE__*/_react.default.createElement(_react2.RecursionField, {
129
+ schema: schema,
130
+ name: index,
131
+ onlyRenderProperties: true
132
+ }));
133
+
134
+ return children;
135
+ }
136
+ }));
137
+ }, []);
138
+ };
139
+
140
+ var useAddition = function useAddition() {
141
+ var schema = (0, _react2.useFieldSchema)();
142
+ return schema.reduceProperties(function (addition, schema, key) {
143
+ if (isAdditionComponent(schema)) {
144
+ return /*#__PURE__*/_react.default.createElement(_react2.RecursionField, {
145
+ schema: schema,
146
+ name: key
147
+ });
148
+ }
149
+
150
+ return addition;
151
+ }, null);
152
+ };
153
+
154
+ var ArrayTable = (0, _react2.observer)(function (props) {
155
+ var ref = (0, _react.useRef)();
156
+ var field = (0, _react2.useField)();
157
+ var dataSource = Array.isArray(field.value) ? field.value.slice() : [];
158
+ var sources = useArrayTableSources();
159
+ var columns = useArrayTableColumns(field, sources);
160
+ var addition = useAddition();
161
+ return /*#__PURE__*/_react.default.createElement("div", {
162
+ ref: ref,
163
+ style: {
164
+ height: 600
165
+ }
166
+ }, /*#__PURE__*/_react.default.createElement(_antd.ArrayBase, null, /*#__PURE__*/_react.default.createElement(_agGridReact.AgGridReact, {
167
+ className: "ag-theme-alpine",
168
+ getRowId: function getRowId(_ref3) {
169
+ var data = _ref3.data;
170
+ return data._id;
171
+ },
172
+ pagination: false,
173
+ columnDefs: columns,
174
+ rowData: dataSource
175
+ }), sources.map(function (column, key) {
176
+ //专门用来承接对Column的状态管理
177
+ if (!isColumnComponent(column.schema)) return;
178
+ return /*#__PURE__*/_react.default.createElement(_react2.RecursionField, {
179
+ name: column.name,
180
+ schema: column.schema,
181
+ onlyRenderSelf: true,
182
+ key: key
183
+ });
184
+ }), addition));
185
+ });
186
+ exports.ArrayTable = ArrayTable;
187
+ ArrayTable.displayName = 'ArrayTable';
188
+
189
+ ArrayTable.Column = function () {
190
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null);
191
+ };
192
+
193
+ _antd.ArrayBase.mixin(ArrayTable);
194
+
195
+ var Addition = function Addition(props) {
196
+ return /*#__PURE__*/_react.default.createElement(_antd.ArrayBase.Addition, _extends({}, props, {
197
+ defaultValue: _objectSpread(_objectSpread({}, props.defaultValue), {}, {
198
+ _id: (0, _uniqueId.default)()
199
+ })
200
+ }));
201
+ };
202
+
203
+ ArrayTable.Addition = Addition;
204
+ var _default = ArrayTable;
205
+ exports.default = _default;
@@ -0,0 +1,2 @@
1
+ import Toolbar from './toolbar';
2
+ export { Toolbar };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Toolbar", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _toolbar.default;
10
+ }
11
+ });
12
+
13
+ var _toolbar = _interopRequireDefault(require("./toolbar"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _default = function _default() {
9
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
10
+ className: "modal-state",
11
+ id: "modal-2",
12
+ type: "checkbox"
13
+ }), /*#__PURE__*/React.createElement("div", {
14
+ className: "modal"
15
+ }, /*#__PURE__*/React.createElement("label", {
16
+ className: "modal__bg",
17
+ for: "modal-2"
18
+ }), /*#__PURE__*/React.createElement("div", {
19
+ className: "modal__inner"
20
+ }, /*#__PURE__*/React.createElement("label", {
21
+ className: "modal__close",
22
+ for: "modal-2"
23
+ }))));
24
+ };
25
+
26
+ exports.default = _default;