@nokecy/qc-ui 1.0.59 → 1.0.60

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 (180) hide show
  1. package/dist/cjs/deleteConfirm/index.d.ts +31 -0
  2. package/dist/cjs/deleteConfirm/index.js +64 -0
  3. package/dist/cjs/fullScreenAlert/index.d.ts +25 -4
  4. package/dist/cjs/fullScreenAlert/index.js +50 -17
  5. package/dist/cjs/generatedListPage/ConfigurableToolbar.d.ts +35 -0
  6. package/dist/cjs/generatedListPage/ConfigurableToolbar.js +179 -0
  7. package/dist/cjs/generatedListPage/GeneratedListPage.d.ts +8 -0
  8. package/dist/cjs/generatedListPage/GeneratedListPage.js +545 -0
  9. package/dist/cjs/generatedListPage/OptionsColumn.d.ts +9 -0
  10. package/dist/cjs/generatedListPage/OptionsColumn.js +135 -0
  11. package/dist/cjs/generatedListPage/PerformanceMonitor.d.ts +55 -0
  12. package/dist/cjs/generatedListPage/PerformanceMonitor.js +277 -0
  13. package/dist/cjs/generatedListPage/RequestManager.d.ts +97 -0
  14. package/dist/cjs/generatedListPage/RequestManager.js +404 -0
  15. package/dist/cjs/generatedListPage/_utils/AccessWrapper.d.ts +16 -0
  16. package/dist/cjs/generatedListPage/_utils/AccessWrapper.js +26 -0
  17. package/dist/cjs/generatedListPage/_utils/defaultHandlers.d.ts +22 -0
  18. package/dist/cjs/generatedListPage/_utils/defaultHandlers.js +127 -0
  19. package/dist/cjs/generatedListPage/index.d.ts +20 -0
  20. package/dist/cjs/generatedListPage/index.js +92 -0
  21. package/dist/cjs/generatedListPage/types.d.ts +221 -0
  22. package/dist/cjs/generatedListPage/types.js +5 -0
  23. package/dist/cjs/generatedListPage/usePermissionCheck.d.ts +66 -0
  24. package/dist/cjs/generatedListPage/usePermissionCheck.js +150 -0
  25. package/dist/cjs/generatedListPage/useRequestManager.d.ts +35 -0
  26. package/dist/cjs/generatedListPage/useRequestManager.js +121 -0
  27. package/dist/cjs/importModal/index.d.ts +21 -3
  28. package/dist/cjs/importModal/index.js +30 -10
  29. package/dist/cjs/index.d.ts +9 -1
  30. package/dist/cjs/index.js +21 -0
  31. package/dist/cjs/standardFormDialog/FormValidation.d.ts +150 -0
  32. package/dist/cjs/standardFormDialog/FormValidation.js +229 -0
  33. package/dist/cjs/standardFormDialog/PortalManager.d.ts +94 -0
  34. package/dist/cjs/standardFormDialog/PortalManager.js +259 -0
  35. package/dist/cjs/standardFormDialog/StandardFormDialog.d.ts +10 -0
  36. package/dist/cjs/standardFormDialog/StandardFormDialog.js +516 -0
  37. package/dist/cjs/standardFormDialog/index.d.ts +7 -0
  38. package/dist/cjs/standardFormDialog/index.js +83 -0
  39. package/dist/cjs/standardFormDialog/types.d.ts +107 -0
  40. package/dist/cjs/standardFormDialog/types.js +5 -0
  41. package/dist/cjs/standardFormDialog/useStandardFormSchema.d.ts +68 -0
  42. package/dist/cjs/standardFormDialog/useStandardFormSchema.js +197 -0
  43. package/dist/cjs/standardFormDialog/withStandardForm.d.ts +193 -0
  44. package/dist/cjs/standardFormDialog/withStandardForm.js +388 -0
  45. package/dist/esm/deleteConfirm/index.d.ts +31 -0
  46. package/dist/esm/deleteConfirm/index.js +57 -0
  47. package/dist/esm/fullScreenAlert/index.d.ts +25 -4
  48. package/dist/esm/fullScreenAlert/index.js +50 -18
  49. package/dist/esm/generatedListPage/ConfigurableToolbar.d.ts +35 -0
  50. package/dist/esm/generatedListPage/ConfigurableToolbar.js +171 -0
  51. package/dist/esm/generatedListPage/GeneratedListPage.d.ts +8 -0
  52. package/dist/esm/generatedListPage/GeneratedListPage.js +535 -0
  53. package/dist/esm/generatedListPage/OptionsColumn.d.ts +9 -0
  54. package/dist/esm/generatedListPage/OptionsColumn.js +127 -0
  55. package/dist/esm/generatedListPage/PerformanceMonitor.d.ts +55 -0
  56. package/dist/esm/generatedListPage/PerformanceMonitor.js +272 -0
  57. package/dist/esm/generatedListPage/RequestManager.d.ts +97 -0
  58. package/dist/esm/generatedListPage/RequestManager.js +398 -0
  59. package/dist/esm/generatedListPage/_utils/AccessWrapper.d.ts +16 -0
  60. package/dist/esm/generatedListPage/_utils/AccessWrapper.js +20 -0
  61. package/dist/esm/generatedListPage/_utils/defaultHandlers.d.ts +22 -0
  62. package/dist/esm/generatedListPage/_utils/defaultHandlers.js +122 -0
  63. package/dist/esm/generatedListPage/index.d.ts +20 -0
  64. package/dist/esm/generatedListPage/index.js +26 -0
  65. package/dist/esm/generatedListPage/types.d.ts +221 -0
  66. package/dist/esm/generatedListPage/types.js +1 -0
  67. package/dist/esm/generatedListPage/usePermissionCheck.d.ts +66 -0
  68. package/dist/esm/generatedListPage/usePermissionCheck.js +145 -0
  69. package/dist/esm/generatedListPage/useRequestManager.d.ts +35 -0
  70. package/dist/esm/generatedListPage/useRequestManager.js +116 -0
  71. package/dist/esm/importModal/index.d.ts +21 -3
  72. package/dist/esm/importModal/index.js +29 -10
  73. package/dist/esm/index.d.ts +9 -1
  74. package/dist/esm/index.js +6 -1
  75. package/dist/esm/standardFormDialog/FormValidation.d.ts +150 -0
  76. package/dist/esm/standardFormDialog/FormValidation.js +223 -0
  77. package/dist/esm/standardFormDialog/PortalManager.d.ts +94 -0
  78. package/dist/esm/standardFormDialog/PortalManager.js +253 -0
  79. package/dist/esm/standardFormDialog/StandardFormDialog.d.ts +10 -0
  80. package/dist/esm/standardFormDialog/StandardFormDialog.js +508 -0
  81. package/dist/esm/standardFormDialog/index.d.ts +7 -0
  82. package/dist/esm/standardFormDialog/index.js +6 -0
  83. package/dist/esm/standardFormDialog/types.d.ts +107 -0
  84. package/dist/esm/standardFormDialog/types.js +1 -0
  85. package/dist/esm/standardFormDialog/useStandardFormSchema.d.ts +68 -0
  86. package/dist/esm/standardFormDialog/useStandardFormSchema.js +191 -0
  87. package/dist/esm/standardFormDialog/withStandardForm.d.ts +193 -0
  88. package/dist/esm/standardFormDialog/withStandardForm.js +382 -0
  89. package/dist/umd/qc-ui.min.js +1 -1
  90. package/package.json +1 -1
  91. package/dist/esm/ConfirmPro/index.d.ts.map +0 -1
  92. package/dist/esm/ag-grid-plus/_utils/boolSelect.d.ts.map +0 -1
  93. package/dist/esm/ag-grid-plus/_utils/customGroupCellRenderer.d.ts.map +0 -1
  94. package/dist/esm/ag-grid-plus/_utils/processColumnGroups.d.ts.map +0 -1
  95. package/dist/esm/ag-grid-plus/_utils/processFormColumnState.d.ts.map +0 -1
  96. package/dist/esm/ag-grid-plus/ag-gridPlus.d.ts.map +0 -1
  97. package/dist/esm/ag-grid-plus/context/gridContext.d.ts.map +0 -1
  98. package/dist/esm/ag-grid-plus/gridManager/index.d.ts.map +0 -1
  99. package/dist/esm/ag-grid-plus/index.d.ts.map +0 -1
  100. package/dist/esm/ag-grid-plus/interface.d.ts.map +0 -1
  101. package/dist/esm/ag-grid-plus/locale.d.ts.map +0 -1
  102. package/dist/esm/ag-grid-plus/queryForm/index.d.ts.map +0 -1
  103. package/dist/esm/ag-grid-plus/queryForm/queryForm.d.ts.map +0 -1
  104. package/dist/esm/ag-grid-plus/setting/diySetting/index.d.ts.map +0 -1
  105. package/dist/esm/ag-grid-plus/setting/index.d.ts.map +0 -1
  106. package/dist/esm/ag-grid-plus/settingItem/index.d.ts.map +0 -1
  107. package/dist/esm/ag-grid-plus/toolBar/index.d.ts.map +0 -1
  108. package/dist/esm/ag-grid-plus/toolBar/style.d.ts.map +0 -1
  109. package/dist/esm/ag-grid-plus/utils.d.ts.map +0 -1
  110. package/dist/esm/array-table/arrayAddBtn.d.ts.map +0 -1
  111. package/dist/esm/array-table/arrayBase.d.ts.map +0 -1
  112. package/dist/esm/array-table/index.d.ts.map +0 -1
  113. package/dist/esm/array-table/interface.d.ts.map +0 -1
  114. package/dist/esm/array-table/preview.d.ts.map +0 -1
  115. package/dist/esm/array-table/utils.d.ts.map +0 -1
  116. package/dist/esm/array-table-index/index.d.ts.map +0 -1
  117. package/dist/esm/card/index.d.ts.map +0 -1
  118. package/dist/esm/dashboard/dashboard/components/index.d.ts.map +0 -1
  119. package/dist/esm/dashboard/dashboard/components/modal/index.d.ts.map +0 -1
  120. package/dist/esm/dashboard/dashboard/components/toolbar/index.d.ts.map +0 -1
  121. package/dist/esm/dashboard/dashboard/components/toolbar/style/index.d.ts.map +0 -1
  122. package/dist/esm/dashboard/dashboard/index.d.ts.map +0 -1
  123. package/dist/esm/dashboard/dashboard/service.d.ts.map +0 -1
  124. package/dist/esm/dashboard/dashboard/utils.d.ts.map +0 -1
  125. package/dist/esm/dashboard/index.d.ts.map +0 -1
  126. package/dist/esm/dashboard/utils.d.ts.map +0 -1
  127. package/dist/esm/dashboard/widget/index.d.ts.map +0 -1
  128. package/dist/esm/dashboard/widget/selector/index.d.ts.map +0 -1
  129. package/dist/esm/dashboard/widget/utils.d.ts.map +0 -1
  130. package/dist/esm/dialogSelect/index.d.ts.map +0 -1
  131. package/dist/esm/draggableModal/index.d.ts.map +0 -1
  132. package/dist/esm/editable/index.d.ts.map +0 -1
  133. package/dist/esm/editable/style.d.ts.map +0 -1
  134. package/dist/esm/extensible-grid/index.d.ts.map +0 -1
  135. package/dist/esm/extensible-grid/interface.d.ts.map +0 -1
  136. package/dist/esm/formDesigner/FormDesigner.d.ts.map +0 -1
  137. package/dist/esm/formDesigner/ProCard/index.d.ts.map +0 -1
  138. package/dist/esm/formDesigner/arrayTable/arrayTableSchema.d.ts.map +0 -1
  139. package/dist/esm/formDesigner/arrayTable/index.d.ts.map +0 -1
  140. package/dist/esm/formDesigner/arrayTable/preview.d.ts.map +0 -1
  141. package/dist/esm/formDesigner/index.d.ts.map +0 -1
  142. package/dist/esm/formDesigner/preWidgets/arrayTableIndex/index.d.ts.map +0 -1
  143. package/dist/esm/formDesigner/preWidgets/arrayTableIndex/preview.d.ts.map +0 -1
  144. package/dist/esm/formDesigner/preWidgets/card/index.d.ts.map +0 -1
  145. package/dist/esm/formDesigner/preWidgets/card/preview.d.ts.map +0 -1
  146. package/dist/esm/formDesigner/preWidgets/index.d.ts.map +0 -1
  147. package/dist/esm/formDesigner/preWidgets/preDefineProperty1/index.d.ts.map +0 -1
  148. package/dist/esm/formDesigner/preWidgets/preDefineProperty1/preview.d.ts.map +0 -1
  149. package/dist/esm/formDesigner/preWidgets/preDefineProperty10/index.d.ts.map +0 -1
  150. package/dist/esm/formDesigner/preWidgets/preDefineProperty10/preview.d.ts.map +0 -1
  151. package/dist/esm/formDesigner/preWidgets/preDefineProperty2/index.d.ts.map +0 -1
  152. package/dist/esm/formDesigner/preWidgets/preDefineProperty2/preview.d.ts.map +0 -1
  153. package/dist/esm/formDesigner/preWidgets/preDefineProperty3/index.d.ts.map +0 -1
  154. package/dist/esm/formDesigner/preWidgets/preDefineProperty3/preview.d.ts.map +0 -1
  155. package/dist/esm/formDesigner/preWidgets/preDefineProperty4/index.d.ts.map +0 -1
  156. package/dist/esm/formDesigner/preWidgets/preDefineProperty4/preview.d.ts.map +0 -1
  157. package/dist/esm/formDesigner/preWidgets/preDefineProperty5/index.d.ts.map +0 -1
  158. package/dist/esm/formDesigner/preWidgets/preDefineProperty5/preview.d.ts.map +0 -1
  159. package/dist/esm/formDesigner/preWidgets/preDefineProperty6/index.d.ts.map +0 -1
  160. package/dist/esm/formDesigner/preWidgets/preDefineProperty6/preview.d.ts.map +0 -1
  161. package/dist/esm/formDesigner/preWidgets/preDefineProperty7/index.d.ts.map +0 -1
  162. package/dist/esm/formDesigner/preWidgets/preDefineProperty7/preview.d.ts.map +0 -1
  163. package/dist/esm/formDesigner/preWidgets/preDefineProperty8/index.d.ts.map +0 -1
  164. package/dist/esm/formDesigner/preWidgets/preDefineProperty8/preview.d.ts.map +0 -1
  165. package/dist/esm/formDesigner/preWidgets/preDefineProperty9/index.d.ts.map +0 -1
  166. package/dist/esm/formDesigner/preWidgets/preDefineProperty9/preview.d.ts.map +0 -1
  167. package/dist/esm/formDesigner/preWidgets/utils.d.ts.map +0 -1
  168. package/dist/esm/formDesigner/widgets/ActionsWidget.d.ts.map +0 -1
  169. package/dist/esm/formDesigner/widgets/LogoWidget.d.ts.map +0 -1
  170. package/dist/esm/formDesigner/widgets/PreviewWidget.d.ts.map +0 -1
  171. package/dist/esm/formDesigner/widgets/SchemaEditorWidget.d.ts.map +0 -1
  172. package/dist/esm/formDesigner/widgets/index.d.ts.map +0 -1
  173. package/dist/esm/formPro/context/formProContext.d.ts.map +0 -1
  174. package/dist/esm/formPro/formLayoutPro.d.ts.map +0 -1
  175. package/dist/esm/formPro/index.d.ts.map +0 -1
  176. package/dist/esm/fullScreenAlert/index.d.ts.map +0 -1
  177. package/dist/esm/importModal/index.d.ts.map +0 -1
  178. package/dist/esm/index.d.ts.map +0 -1
  179. package/dist/esm/queryBuilder/index.d.ts.map +0 -1
  180. package/dist/esm/toolBar/index.d.ts.map +0 -1
@@ -0,0 +1,398 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
13
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
+ /**
18
+ * 请求管理器
19
+ *
20
+ * 负责管理和优化 API 请求,包括:
21
+ * - 请求防抖和节流
22
+ * - 请求取消
23
+ * - 请求去重
24
+ * - 请求缓存
25
+ * - 并发控制
26
+ */
27
+
28
+ /**
29
+ * 请求管理器类
30
+ */
31
+ export var RequestManager = /*#__PURE__*/function () {
32
+ function RequestManager() {
33
+ var _options$debounceDela, _options$enableCache, _options$cacheTTL, _options$enableDedup, _options$maxConcurren;
34
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35
+ _classCallCheck(this, RequestManager);
36
+ _defineProperty(this, "options", void 0);
37
+ _defineProperty(this, "cache", new Map());
38
+ _defineProperty(this, "pendingRequests", new Map());
39
+ _defineProperty(this, "debounceTimers", new Map());
40
+ _defineProperty(this, "lastRequestTime", 0);
41
+ _defineProperty(this, "requestQueue", []);
42
+ _defineProperty(this, "activeRequests", 0);
43
+ this.options = {
44
+ debounceDelay: (_options$debounceDela = options.debounceDelay) !== null && _options$debounceDela !== void 0 ? _options$debounceDela : 300,
45
+ enableCache: (_options$enableCache = options.enableCache) !== null && _options$enableCache !== void 0 ? _options$enableCache : true,
46
+ cacheTTL: (_options$cacheTTL = options.cacheTTL) !== null && _options$cacheTTL !== void 0 ? _options$cacheTTL : 60000,
47
+ // 默认1分钟
48
+ enableDedup: (_options$enableDedup = options.enableDedup) !== null && _options$enableDedup !== void 0 ? _options$enableDedup : true,
49
+ maxConcurrent: (_options$maxConcurren = options.maxConcurrent) !== null && _options$maxConcurren !== void 0 ? _options$maxConcurren : 3
50
+ };
51
+ }
52
+
53
+ /**
54
+ * 生成请求缓存键
55
+ */
56
+ _createClass(RequestManager, [{
57
+ key: "generateCacheKey",
58
+ value: function generateCacheKey(params) {
59
+ return JSON.stringify(params);
60
+ }
61
+
62
+ /**
63
+ * 检查缓存是否有效
64
+ */
65
+ }, {
66
+ key: "isCacheValid",
67
+ value: function isCacheValid(entry) {
68
+ var now = Date.now();
69
+ return now - entry.timestamp < this.options.cacheTTL;
70
+ }
71
+
72
+ /**
73
+ * 从缓存获取数据
74
+ */
75
+ }, {
76
+ key: "getFromCache",
77
+ value: function getFromCache(key) {
78
+ var entry = this.cache.get(key);
79
+ if (entry && this.isCacheValid(entry)) {
80
+ return entry.data;
81
+ }
82
+ // 清理过期缓存
83
+ if (entry) {
84
+ this.cache.delete(key);
85
+ }
86
+ return null;
87
+ }
88
+
89
+ /**
90
+ * 保存到缓存
91
+ */
92
+ }, {
93
+ key: "saveToCache",
94
+ value: function saveToCache(key, data) {
95
+ this.cache.set(key, {
96
+ data: data,
97
+ timestamp: Date.now(),
98
+ key: key
99
+ });
100
+ }
101
+
102
+ /**
103
+ * 清理所有缓存
104
+ */
105
+ }, {
106
+ key: "clearCache",
107
+ value: function clearCache() {
108
+ this.cache.clear();
109
+ }
110
+
111
+ /**
112
+ * 清理过期缓存
113
+ */
114
+ }, {
115
+ key: "cleanupExpiredCache",
116
+ value: function cleanupExpiredCache() {
117
+ var _this = this;
118
+ var now = Date.now();
119
+ Array.from(this.cache.entries()).forEach(function (_ref) {
120
+ var _ref2 = _slicedToArray(_ref, 2),
121
+ key = _ref2[0],
122
+ entry = _ref2[1];
123
+ if (now - entry.timestamp >= _this.options.cacheTTL) {
124
+ _this.cache.delete(key);
125
+ }
126
+ });
127
+ }
128
+
129
+ /**
130
+ * 取消所有待处理的请求
131
+ */
132
+ }, {
133
+ key: "cancelAllPendingRequests",
134
+ value: function cancelAllPendingRequests() {
135
+ var _this2 = this;
136
+ Array.from(this.pendingRequests.entries()).forEach(function (_ref3) {
137
+ var _ref4 = _slicedToArray(_ref3, 2),
138
+ key = _ref4[0],
139
+ request = _ref4[1];
140
+ request.abortController.abort();
141
+ _this2.pendingRequests.delete(key);
142
+ });
143
+ }
144
+
145
+ /**
146
+ * 取消特定请求
147
+ */
148
+ }, {
149
+ key: "cancelRequest",
150
+ value: function cancelRequest(params) {
151
+ var key = this.generateCacheKey(params);
152
+ var request = this.pendingRequests.get(key);
153
+ if (request) {
154
+ request.abortController.abort();
155
+ this.pendingRequests.delete(key);
156
+ }
157
+ }
158
+
159
+ /**
160
+ * 等待并发槽位
161
+ */
162
+ }, {
163
+ key: "waitForSlot",
164
+ value: (function () {
165
+ var _waitForSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
166
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
167
+ while (1) switch (_context.prev = _context.next) {
168
+ case 0:
169
+ if (!(this.activeRequests >= this.options.maxConcurrent)) {
170
+ _context.next = 5;
171
+ break;
172
+ }
173
+ _context.next = 3;
174
+ return new Promise(function (resolve) {
175
+ return setTimeout(resolve, 50);
176
+ });
177
+ case 3:
178
+ _context.next = 0;
179
+ break;
180
+ case 5:
181
+ case "end":
182
+ return _context.stop();
183
+ }
184
+ }, _callee, this);
185
+ }));
186
+ function waitForSlot() {
187
+ return _waitForSlot.apply(this, arguments);
188
+ }
189
+ return waitForSlot;
190
+ }()
191
+ /**
192
+ * 执行请求
193
+ */
194
+ )
195
+ }, {
196
+ key: "request",
197
+ value: (function () {
198
+ var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params, requestFn) {
199
+ var _this3 = this;
200
+ var key, cachedData, pending, abortController, promise;
201
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
202
+ while (1) switch (_context3.prev = _context3.next) {
203
+ case 0:
204
+ key = this.generateCacheKey(params); // 1. 检查缓存
205
+ if (!this.options.enableCache) {
206
+ _context3.next = 6;
207
+ break;
208
+ }
209
+ cachedData = this.getFromCache(key);
210
+ if (!(cachedData !== null)) {
211
+ _context3.next = 6;
212
+ break;
213
+ }
214
+ console.debug('[RequestManager] Cache hit:', key);
215
+ return _context3.abrupt("return", cachedData);
216
+ case 6:
217
+ if (!this.options.enableDedup) {
218
+ _context3.next = 11;
219
+ break;
220
+ }
221
+ pending = this.pendingRequests.get(key);
222
+ if (!pending) {
223
+ _context3.next = 11;
224
+ break;
225
+ }
226
+ console.debug('[RequestManager] Dedup request:', key);
227
+ return _context3.abrupt("return", pending.promise);
228
+ case 11:
229
+ _context3.next = 13;
230
+ return this.waitForSlot();
231
+ case 13:
232
+ // 4. 创建新请求
233
+ abortController = new AbortController();
234
+ this.activeRequests++;
235
+ promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
236
+ var now, timeSinceLastRequest, delay, data;
237
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
238
+ while (1) switch (_context2.prev = _context2.next) {
239
+ case 0:
240
+ _context2.prev = 0;
241
+ // 防抖处理
242
+ now = Date.now();
243
+ timeSinceLastRequest = now - _this3.lastRequestTime;
244
+ if (!(timeSinceLastRequest < _this3.options.debounceDelay)) {
245
+ _context2.next = 7;
246
+ break;
247
+ }
248
+ delay = _this3.options.debounceDelay - timeSinceLastRequest;
249
+ _context2.next = 7;
250
+ return new Promise(function (resolve) {
251
+ return setTimeout(resolve, delay);
252
+ });
253
+ case 7:
254
+ _this3.lastRequestTime = Date.now();
255
+
256
+ // 执行请求
257
+ _context2.next = 10;
258
+ return requestFn(params, abortController.signal);
259
+ case 10:
260
+ data = _context2.sent;
261
+ // 保存到缓存
262
+ if (_this3.options.enableCache) {
263
+ _this3.saveToCache(key, data);
264
+ }
265
+ return _context2.abrupt("return", data);
266
+ case 13:
267
+ _context2.prev = 13;
268
+ // 清理
269
+ _this3.pendingRequests.delete(key);
270
+ _this3.activeRequests--;
271
+ return _context2.finish(13);
272
+ case 17:
273
+ case "end":
274
+ return _context2.stop();
275
+ }
276
+ }, _callee2, null, [[0,, 13, 17]]);
277
+ }))(); // 注册待处理请求
278
+ this.pendingRequests.set(key, {
279
+ promise: promise,
280
+ abortController: abortController,
281
+ timestamp: Date.now(),
282
+ key: key
283
+ });
284
+ return _context3.abrupt("return", promise);
285
+ case 18:
286
+ case "end":
287
+ return _context3.stop();
288
+ }
289
+ }, _callee3, this);
290
+ }));
291
+ function request(_x, _x2) {
292
+ return _request.apply(this, arguments);
293
+ }
294
+ return request;
295
+ }()
296
+ /**
297
+ * 防抖请求
298
+ */
299
+ )
300
+ }, {
301
+ key: "debouncedRequest",
302
+ value: (function () {
303
+ var _debouncedRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, params, requestFn) {
304
+ var _this4 = this;
305
+ var existingTimer;
306
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
307
+ while (1) switch (_context5.prev = _context5.next) {
308
+ case 0:
309
+ // 取消之前的防抖定时器
310
+ existingTimer = this.debounceTimers.get(key);
311
+ if (existingTimer) {
312
+ clearTimeout(existingTimer);
313
+ }
314
+ return _context5.abrupt("return", new Promise(function (resolve, reject) {
315
+ var timer = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
316
+ var result;
317
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
318
+ while (1) switch (_context4.prev = _context4.next) {
319
+ case 0:
320
+ _this4.debounceTimers.delete(key);
321
+ _context4.prev = 1;
322
+ _context4.next = 4;
323
+ return _this4.request(params, requestFn);
324
+ case 4:
325
+ result = _context4.sent;
326
+ resolve(result);
327
+ _context4.next = 11;
328
+ break;
329
+ case 8:
330
+ _context4.prev = 8;
331
+ _context4.t0 = _context4["catch"](1);
332
+ reject(_context4.t0);
333
+ case 11:
334
+ case "end":
335
+ return _context4.stop();
336
+ }
337
+ }, _callee4, null, [[1, 8]]);
338
+ })), _this4.options.debounceDelay);
339
+ _this4.debounceTimers.set(key, timer);
340
+ }));
341
+ case 3:
342
+ case "end":
343
+ return _context5.stop();
344
+ }
345
+ }, _callee5, this);
346
+ }));
347
+ function debouncedRequest(_x3, _x4, _x5) {
348
+ return _debouncedRequest.apply(this, arguments);
349
+ }
350
+ return debouncedRequest;
351
+ }()
352
+ /**
353
+ * 获取统计信息
354
+ */
355
+ )
356
+ }, {
357
+ key: "getStats",
358
+ value: function getStats() {
359
+ return {
360
+ cacheSize: this.cache.size,
361
+ pendingRequests: this.pendingRequests.size,
362
+ activeRequests: this.activeRequests,
363
+ queueSize: this.requestQueue.length
364
+ };
365
+ }
366
+
367
+ /**
368
+ * 清理所有资源
369
+ */
370
+ }, {
371
+ key: "cleanup",
372
+ value: function cleanup() {
373
+ // 取消所有待处理请求
374
+ this.cancelAllPendingRequests();
375
+
376
+ // 清除所有防抖定时器
377
+ Array.from(this.debounceTimers.values()).forEach(function (timer) {
378
+ clearTimeout(timer);
379
+ });
380
+ this.debounceTimers.clear();
381
+
382
+ // 清理缓存
383
+ this.clearCache();
384
+
385
+ // 清空请求队列
386
+ this.requestQueue = [];
387
+ }
388
+ }]);
389
+ return RequestManager;
390
+ }();
391
+
392
+ /**
393
+ * 创建请求管理器实例的工厂函数
394
+ */
395
+ export function createRequestManager(options) {
396
+ return new RequestManager(options);
397
+ }
398
+ export default RequestManager;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ /**
3
+ * 权限包装组件
4
+ *
5
+ * 提供与 umijs Access 组件兼容的接口
6
+ * 如果没有传入 accessible 或值为 true,则渲染子组件
7
+ * 否则不渲染
8
+ */
9
+ interface AccessWrapperProps {
10
+ /** 是否可访问 */
11
+ accessible?: boolean;
12
+ /** 子元素 */
13
+ children: React.ReactNode;
14
+ }
15
+ declare const AccessWrapper: React.FC<AccessWrapperProps>;
16
+ export default AccessWrapper;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * 权限包装组件
5
+ *
6
+ * 提供与 umijs Access 组件兼容的接口
7
+ * 如果没有传入 accessible 或值为 true,则渲染子组件
8
+ * 否则不渲染
9
+ */
10
+
11
+ var AccessWrapper = function AccessWrapper(_ref) {
12
+ var _ref$accessible = _ref.accessible,
13
+ accessible = _ref$accessible === void 0 ? true : _ref$accessible,
14
+ children = _ref.children;
15
+ if (!accessible) {
16
+ return null;
17
+ }
18
+ return /*#__PURE__*/React.createElement(React.Fragment, null, children);
19
+ };
20
+ export default AccessWrapper;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 默认的导出处理器
3
+ * @param exportApi 导出API函数
4
+ * @param params 导出参数
5
+ * @param fileName 文件名
6
+ */
7
+ export declare const defaultHandleExport: (exportApi: (params: any) => Promise<Blob>, params: any, fileName: string) => Promise<void>;
8
+ /**
9
+ * 默认的删除处理器
10
+ * @param deleteApi 删除API函数
11
+ * @param id 要删除的ID
12
+ * @param onSuccess 成功回调
13
+ */
14
+ export declare const defaultHandleDelete: (deleteApi: (params: {
15
+ id: any;
16
+ }) => Promise<void>, id: any, onSuccess?: () => void) => Promise<void>;
17
+ /**
18
+ * 文件下载工具函数
19
+ * @param blob 文件Blob对象
20
+ * @param fileName 文件名
21
+ */
22
+ export declare const downloadFile: (blob: Blob, fileName: string) => void;
@@ -0,0 +1,122 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ import { message } from 'antd';
6
+
7
+ /**
8
+ * 默认的导出处理器
9
+ * @param exportApi 导出API函数
10
+ * @param params 导出参数
11
+ * @param fileName 文件名
12
+ */
13
+ export var defaultHandleExport = /*#__PURE__*/function () {
14
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(exportApi, params, fileName) {
15
+ var hide, blob, url, link, _error$response, errorMessage;
16
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
17
+ while (1) switch (_context.prev = _context.next) {
18
+ case 0:
19
+ hide = message.loading('正在导出,请稍后', 0);
20
+ _context.prev = 1;
21
+ _context.next = 4;
22
+ return exportApi(params);
23
+ case 4:
24
+ blob = _context.sent;
25
+ // 创建下载链接
26
+ url = window.URL.createObjectURL(blob);
27
+ link = document.createElement('a');
28
+ link.href = url;
29
+ link.download = fileName;
30
+ document.body.appendChild(link);
31
+ link.click();
32
+
33
+ // 清理
34
+ document.body.removeChild(link);
35
+ window.URL.revokeObjectURL(url);
36
+ message.success('导出成功');
37
+ _context.next = 22;
38
+ break;
39
+ case 16:
40
+ _context.prev = 16;
41
+ _context.t0 = _context["catch"](1);
42
+ console.error('导出失败:', _context.t0);
43
+ errorMessage = ((_error$response = _context.t0.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 || (_error$response = _error$response.error) === null || _error$response === void 0 ? void 0 : _error$response.message) || _context.t0.message || '导出失败';
44
+ message.error("\u5BFC\u51FA\u5931\u8D25\uFF1A".concat(errorMessage));
45
+ throw _context.t0;
46
+ case 22:
47
+ _context.prev = 22;
48
+ hide();
49
+ return _context.finish(22);
50
+ case 25:
51
+ case "end":
52
+ return _context.stop();
53
+ }
54
+ }, _callee, null, [[1, 16, 22, 25]]);
55
+ }));
56
+ return function defaultHandleExport(_x, _x2, _x3) {
57
+ return _ref.apply(this, arguments);
58
+ };
59
+ }();
60
+
61
+ /**
62
+ * 默认的删除处理器
63
+ * @param deleteApi 删除API函数
64
+ * @param id 要删除的ID
65
+ * @param onSuccess 成功回调
66
+ */
67
+ export var defaultHandleDelete = /*#__PURE__*/function () {
68
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(deleteApi, id, onSuccess) {
69
+ var hide, _error$response2, errorMessage;
70
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
71
+ while (1) switch (_context2.prev = _context2.next) {
72
+ case 0:
73
+ hide = message.loading('正在删除,请稍后', 0);
74
+ _context2.prev = 1;
75
+ _context2.next = 4;
76
+ return deleteApi({
77
+ id: id
78
+ });
79
+ case 4:
80
+ message.success('删除成功');
81
+ if (onSuccess) {
82
+ onSuccess();
83
+ }
84
+ _context2.next = 14;
85
+ break;
86
+ case 8:
87
+ _context2.prev = 8;
88
+ _context2.t0 = _context2["catch"](1);
89
+ console.error('删除失败:', _context2.t0);
90
+ errorMessage = ((_error$response2 = _context2.t0.response) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.data) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.error) === null || _error$response2 === void 0 ? void 0 : _error$response2.message) || _context2.t0.message || '删除失败';
91
+ message.error("\u5220\u9664\u5931\u8D25\uFF1A".concat(errorMessage));
92
+ throw _context2.t0;
93
+ case 14:
94
+ _context2.prev = 14;
95
+ hide();
96
+ return _context2.finish(14);
97
+ case 17:
98
+ case "end":
99
+ return _context2.stop();
100
+ }
101
+ }, _callee2, null, [[1, 8, 14, 17]]);
102
+ }));
103
+ return function defaultHandleDelete(_x4, _x5, _x6) {
104
+ return _ref2.apply(this, arguments);
105
+ };
106
+ }();
107
+
108
+ /**
109
+ * 文件下载工具函数
110
+ * @param blob 文件Blob对象
111
+ * @param fileName 文件名
112
+ */
113
+ export var downloadFile = function downloadFile(blob, fileName) {
114
+ var url = window.URL.createObjectURL(blob);
115
+ var link = document.createElement('a');
116
+ link.href = url;
117
+ link.download = fileName;
118
+ document.body.appendChild(link);
119
+ link.click();
120
+ document.body.removeChild(link);
121
+ window.URL.revokeObjectURL(url);
122
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * GeneratedListPage - 通用列表页面生成器
3
+ *
4
+ * 基于配置自动生成标准化的列表页面,包含:
5
+ * - AgGridPlus表格
6
+ * - 配置化工具栏
7
+ * - 标准化操作列
8
+ * - 树形数据支持
9
+ * - 统一的API调用和错误处理
10
+ */
11
+ export { default } from './GeneratedListPage';
12
+ export { default as GeneratedListPage } from './GeneratedListPage';
13
+ export { default as ConfigurableToolbar } from './ConfigurableToolbar';
14
+ export { default as OptionsColumn } from './OptionsColumn';
15
+ export type { GeneratedListPageConfig, PermissionConfig, ApiConfig, ListParams, PagedResult, DeleteParams, ExportParams, ToolbarActionConfig, FormDialogConfig, TreeDataConfig, OptionsComponentProps } from './types';
16
+ export { usePermissionCheck, PermissionChecker } from './usePermissionCheck';
17
+ export { usePerformanceMonitor, PerformanceDevTools } from './PerformanceMonitor';
18
+ export { useRequestManager } from './useRequestManager';
19
+ export { default as AccessWrapper } from './_utils/AccessWrapper';
20
+ export { defaultHandleExport, defaultHandleDelete, downloadFile } from './_utils/defaultHandlers';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * GeneratedListPage - 通用列表页面生成器
3
+ *
4
+ * 基于配置自动生成标准化的列表页面,包含:
5
+ * - AgGridPlus表格
6
+ * - 配置化工具栏
7
+ * - 标准化操作列
8
+ * - 树形数据支持
9
+ * - 统一的API调用和错误处理
10
+ */
11
+
12
+ export { default } from "./GeneratedListPage";
13
+ export { default as GeneratedListPage } from "./GeneratedListPage";
14
+ export { default as ConfigurableToolbar } from "./ConfigurableToolbar";
15
+ export { default as OptionsColumn } from "./OptionsColumn";
16
+
17
+ // 导出类型定义
18
+
19
+ // 导出工具函数和 Hooks
20
+ export { usePermissionCheck, PermissionChecker } from "./usePermissionCheck";
21
+ export { usePerformanceMonitor, PerformanceDevTools } from "./PerformanceMonitor";
22
+ export { useRequestManager } from "./useRequestManager";
23
+
24
+ // 导出内部工具(可选,供高级用户使用)
25
+ export { default as AccessWrapper } from "./_utils/AccessWrapper";
26
+ export { defaultHandleExport, defaultHandleDelete, downloadFile } from "./_utils/defaultHandlers";