hc-busin-components 1.0.0

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 (185) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +53 -0
  3. package/dist/Actions/index.d.ts +20 -0
  4. package/dist/Actions/index.js +142 -0
  5. package/dist/Actions/index.less +9 -0
  6. package/dist/AuthComponents/authDivider.d.ts +15 -0
  7. package/dist/AuthComponents/authDivider.js +104 -0
  8. package/dist/AuthComponents/index.d.ts +4 -0
  9. package/dist/AuthComponents/index.js +14 -0
  10. package/dist/BasicFilesRead/images/back.png +0 -0
  11. package/dist/BasicFilesRead/images/excel.png +0 -0
  12. package/dist/BasicFilesRead/images/folder.png +0 -0
  13. package/dist/BasicFilesRead/images/image.png +0 -0
  14. package/dist/BasicFilesRead/images/jpeg.png +0 -0
  15. package/dist/BasicFilesRead/images/jpg.png +0 -0
  16. package/dist/BasicFilesRead/images/normal.png +0 -0
  17. package/dist/BasicFilesRead/images/png.png +0 -0
  18. package/dist/BasicFilesRead/images/tar.png +0 -0
  19. package/dist/BasicFilesRead/images/text.png +0 -0
  20. package/dist/BasicFilesRead/images/zip.png +0 -0
  21. package/dist/BasicFilesRead/index.d.ts +31 -0
  22. package/dist/BasicFilesRead/index.js +286 -0
  23. package/dist/BasicFilesRead/styles/index.d.ts +3 -0
  24. package/dist/BasicFilesRead/styles/index.js +9 -0
  25. package/dist/CombinTable/components/RenderContent.d.ts +9 -0
  26. package/dist/CombinTable/components/RenderContent.js +201 -0
  27. package/dist/CombinTable/hooks/useTableParams.d.ts +20 -0
  28. package/dist/CombinTable/hooks/useTableParams.js +75 -0
  29. package/dist/CombinTable/hooks/useTableState.d.ts +5 -0
  30. package/dist/CombinTable/hooks/useTableState.js +22 -0
  31. package/dist/CombinTable/index.d.ts +4 -0
  32. package/dist/CombinTable/index.js +225 -0
  33. package/dist/CombinTable/styles/index.d.ts +3 -0
  34. package/dist/CombinTable/styles/index.js +11 -0
  35. package/dist/CombinTable/types/index.d.ts +21 -0
  36. package/dist/CombinTable/types/index.js +1 -0
  37. package/dist/CombineSearch/components/Content.d.ts +13 -0
  38. package/dist/CombineSearch/components/Content.js +249 -0
  39. package/dist/CombineSearch/components/Tags.d.ts +14 -0
  40. package/dist/CombineSearch/components/Tags.js +115 -0
  41. package/dist/CombineSearch/hooks/useCombineState.d.ts +5 -0
  42. package/dist/CombineSearch/hooks/useCombineState.js +17 -0
  43. package/dist/CombineSearch/index.d.ts +4 -0
  44. package/dist/CombineSearch/index.js +168 -0
  45. package/dist/CombineSearch/style/edit.svg +1 -0
  46. package/dist/CombineSearch/style/index.d.ts +14 -0
  47. package/dist/CombineSearch/style/index.js +26 -0
  48. package/dist/CombineSearch/types/index.d.ts +46 -0
  49. package/dist/CombineSearch/types/index.js +0 -0
  50. package/dist/ComponentUninstalled/assets/comp-unintall-background.png +0 -0
  51. package/dist/ComponentUninstalled/assets/comp-unintall-bg.png +0 -0
  52. package/dist/ComponentUninstalled/index.d.ts +32 -0
  53. package/dist/ComponentUninstalled/index.js +164 -0
  54. package/dist/ComponentUninstalled/index.less +108 -0
  55. package/dist/ComponentUninstalled/locale.d.ts +14 -0
  56. package/dist/ComponentUninstalled/locale.js +21 -0
  57. package/dist/DataCountPopover/index.d.ts +23 -0
  58. package/dist/DataCountPopover/index.js +121 -0
  59. package/dist/DataCountPopover/index.less +62 -0
  60. package/dist/DateRangePicker/index.d.ts +38 -0
  61. package/dist/DateRangePicker/index.js +483 -0
  62. package/dist/DateRangePicker/index.less +196 -0
  63. package/dist/DeleteConfirm/index.d.ts +23 -0
  64. package/dist/DeleteConfirm/index.js +109 -0
  65. package/dist/DeleteConfirm/index.less +44 -0
  66. package/dist/DeleteConfirm/locale.d.ts +7 -0
  67. package/dist/DeleteConfirm/locale.js +7 -0
  68. package/dist/DisplayButton/index.d.ts +7 -0
  69. package/dist/DisplayButton/index.js +23 -0
  70. package/dist/FileRead/images/back.png +0 -0
  71. package/dist/FileRead/images/excel.png +0 -0
  72. package/dist/FileRead/images/folder.png +0 -0
  73. package/dist/FileRead/images/image.png +0 -0
  74. package/dist/FileRead/images/jpeg.png +0 -0
  75. package/dist/FileRead/images/jpg.png +0 -0
  76. package/dist/FileRead/images/normal.png +0 -0
  77. package/dist/FileRead/images/png.png +0 -0
  78. package/dist/FileRead/images/tar.png +0 -0
  79. package/dist/FileRead/images/text.png +0 -0
  80. package/dist/FileRead/images/zip.png +0 -0
  81. package/dist/FileRead/index.d.ts +31 -0
  82. package/dist/FileRead/index.js +417 -0
  83. package/dist/FileRead/styles/index.d.ts +3 -0
  84. package/dist/FileRead/styles/index.js +9 -0
  85. package/dist/Icon/iconfont.d.ts +1 -0
  86. package/dist/Icon/iconfont.js +1 -0
  87. package/dist/Icon/index.d.ts +10 -0
  88. package/dist/Icon/index.js +20 -0
  89. package/dist/Icon/index.less +11 -0
  90. package/dist/IconPopTips/index.d.ts +10 -0
  91. package/dist/IconPopTips/index.js +26 -0
  92. package/dist/IconPopTips/index.less +33 -0
  93. package/dist/IconText/index.d.ts +15 -0
  94. package/dist/IconText/index.js +19 -0
  95. package/dist/IconText/index.less +38 -0
  96. package/dist/LogCenter/assets/empty.png +0 -0
  97. package/dist/LogCenter/context.d.ts +24 -0
  98. package/dist/LogCenter/context.js +66 -0
  99. package/dist/LogCenter/history-log.d.ts +35 -0
  100. package/dist/LogCenter/history-log.js +1214 -0
  101. package/dist/LogCenter/index.d.ts +8 -0
  102. package/dist/LogCenter/index.js +130 -0
  103. package/dist/LogCenter/index.less +577 -0
  104. package/dist/LogCenter/locale.d.ts +3 -0
  105. package/dist/LogCenter/locale.js +81 -0
  106. package/dist/LogCenter/realtime-log.d.ts +35 -0
  107. package/dist/LogCenter/realtime-log.js +641 -0
  108. package/dist/LogCenter/select-with-all.d.ts +28 -0
  109. package/dist/LogCenter/select-with-all.js +337 -0
  110. package/dist/LogCenter/select-with-all.less +81 -0
  111. package/dist/LogCenter/services.d.ts +27 -0
  112. package/dist/LogCenter/services.js +93 -0
  113. package/dist/LogCenter/tools.d.ts +9 -0
  114. package/dist/LogCenter/tools.js +137 -0
  115. package/dist/LogCenter/types.d.ts +133 -0
  116. package/dist/LogCenter/types.js +1 -0
  117. package/dist/LogicalResourceFilter/index.d.ts +7 -0
  118. package/dist/LogicalResourceFilter/index.js +426 -0
  119. package/dist/LogicalResourceFilter/index.less +139 -0
  120. package/dist/LogicalResourceFilter/locale.d.ts +2 -0
  121. package/dist/LogicalResourceFilter/locale.js +10 -0
  122. package/dist/LogicalResourceFilter/types.d.ts +58 -0
  123. package/dist/LogicalResourceFilter/types.js +1 -0
  124. package/dist/MetadataCount/index.d.ts +16 -0
  125. package/dist/MetadataCount/index.js +97 -0
  126. package/dist/MetadataCount/index.less +40 -0
  127. package/dist/MetadataForm/index.d.ts +18 -0
  128. package/dist/MetadataForm/index.js +85 -0
  129. package/dist/MetadataForm/index.less +108 -0
  130. package/dist/MetadataForm/label.d.ts +13 -0
  131. package/dist/MetadataForm/label.js +447 -0
  132. package/dist/MetadataPopoverList/fetchArray.d.ts +3 -0
  133. package/dist/MetadataPopoverList/fetchArray.js +74 -0
  134. package/dist/MetadataPopoverList/index.d.ts +13 -0
  135. package/dist/MetadataPopoverList/index.js +98 -0
  136. package/dist/MetadataPopoverList/index.less +74 -0
  137. package/dist/MetadataTags/index.d.ts +17 -0
  138. package/dist/MetadataTags/index.js +109 -0
  139. package/dist/MetadataTags/index.less +26 -0
  140. package/dist/OverFlow/index.d.ts +4 -0
  141. package/dist/OverFlow/index.js +66 -0
  142. package/dist/OverFlow/types/index.d.ts +11 -0
  143. package/dist/OverFlow/types/index.js +1 -0
  144. package/dist/PageHeader/index.d.ts +16 -0
  145. package/dist/PageHeader/index.js +41 -0
  146. package/dist/PageHeader/index.less +89 -0
  147. package/dist/ResourceProgress/index.d.ts +6 -0
  148. package/dist/ResourceProgress/index.js +102 -0
  149. package/dist/ResourceProgress/index.less +86 -0
  150. package/dist/ResourceProgress/types/index.d.ts +15 -0
  151. package/dist/ResourceProgress/types/index.js +1 -0
  152. package/dist/Terminal/index.d.ts +44 -0
  153. package/dist/Terminal/index.js +390 -0
  154. package/dist/Terminal/index.less +39 -0
  155. package/dist/TextCopy/index.d.ts +21 -0
  156. package/dist/TextCopy/index.js +38 -0
  157. package/dist/TextCopy/index.less +51 -0
  158. package/dist/TextEllipsis/index.d.ts +18 -0
  159. package/dist/TextEllipsis/index.js +31 -0
  160. package/dist/TextEllipsis/index.less +3 -0
  161. package/dist/ThemeForm/index.d.ts +6 -0
  162. package/dist/ThemeForm/index.js +15 -0
  163. package/dist/ThemeForm/index.less +15 -0
  164. package/dist/ThemeSubmit/index.d.ts +16 -0
  165. package/dist/ThemeSubmit/index.js +60 -0
  166. package/dist/ThemeSubmit/index.less +30 -0
  167. package/dist/TooltipSpan/index.d.ts +6 -0
  168. package/dist/TooltipSpan/index.js +72 -0
  169. package/dist/UsageCycle/index.d.ts +12 -0
  170. package/dist/UsageCycle/index.js +71 -0
  171. package/dist/UsageCycle/index.less +56 -0
  172. package/dist/Yaml/CodeMirrorWrapper.d.ts +14 -0
  173. package/dist/Yaml/CodeMirrorWrapper.js +106 -0
  174. package/dist/Yaml/index.d.ts +6 -0
  175. package/dist/Yaml/index.js +470 -0
  176. package/dist/Yaml/index.less +190 -0
  177. package/dist/Yaml/types.d.ts +38 -0
  178. package/dist/Yaml/types.js +1 -0
  179. package/dist/index.d.ts +52 -0
  180. package/dist/index.js +32 -0
  181. package/dist/metadata/locale.d.ts +52 -0
  182. package/dist/metadata/locale.js +69 -0
  183. package/dist/showMore/index.d.ts +6 -0
  184. package/dist/showMore/index.js +40 -0
  185. package/package.json +121 -0
@@ -0,0 +1,426 @@
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ 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; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
+ 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); }
16
+ import { SearchOutlined } from '@ant-design/icons';
17
+ import { Divider, Dropdown, Input, notification, Popover } from 'antd';
18
+ import React, { useEffect, useMemo, useState } from 'react';
19
+ import Icon from "../Icon";
20
+ import { logicalResourceLocaleZhCN } from "./locale";
21
+ import "./index.less";
22
+ export { logicalResourceLocaleZhCN } from "./locale";
23
+ var DEFAULT_INIT = {
24
+ name: null,
25
+ id: null,
26
+ dataCenterId: null,
27
+ logicalUnitId: null,
28
+ clusterName: null
29
+ };
30
+ var fetchTextOmit = function fetchTextOmit(val, len) {
31
+ if (val && val.length > len) {
32
+ return /*#__PURE__*/React.createElement(Popover, {
33
+ key: val,
34
+ content: val,
35
+ placement: "topLeft",
36
+ styles: {
37
+ root: {
38
+ maxWidth: 480,
39
+ zIndex: 1090
40
+ }
41
+ }
42
+ }, val.substr(0, len), "...");
43
+ }
44
+ return val;
45
+ };
46
+ var LogicalResourceFilter = function LogicalResourceFilter(_ref) {
47
+ var dataInterface = _ref.dataInterface,
48
+ onChange = _ref.onChange,
49
+ compoKey = _ref.compoKey,
50
+ _ref$initParams = _ref.initParams,
51
+ initParams = _ref$initParams === void 0 ? DEFAULT_INIT : _ref$initParams,
52
+ textsProp = _ref.texts;
53
+ var texts = useMemo(function () {
54
+ return _objectSpread(_objectSpread({}, logicalResourceLocaleZhCN), textsProp);
55
+ }, [textsProp]);
56
+ var _useState = useState([]),
57
+ _useState2 = _slicedToArray(_useState, 2),
58
+ datacenterList = _useState2[0],
59
+ setDatacenterList = _useState2[1];
60
+ var _useState3 = useState({
61
+ name: null,
62
+ id: null,
63
+ dataCenterId: null,
64
+ logicalUnitId: null
65
+ }),
66
+ _useState4 = _slicedToArray(_useState3, 2),
67
+ currentDatacenter = _useState4[0],
68
+ setCurrentDatacenter = _useState4[1];
69
+ var _useState5 = useState([]),
70
+ _useState6 = _slicedToArray(_useState5, 2),
71
+ resourceList = _useState6[0],
72
+ setResourceList = _useState6[1];
73
+ var _useState7 = useState([]),
74
+ _useState8 = _slicedToArray(_useState7, 2),
75
+ allResources = _useState8[0],
76
+ setAllResources = _useState8[1];
77
+ var _useState9 = useState(null),
78
+ _useState10 = _slicedToArray(_useState9, 2),
79
+ resourceKeyword = _useState10[0],
80
+ setResourceKeyword = _useState10[1];
81
+ var _useState11 = useState(''),
82
+ _useState12 = _slicedToArray(_useState11, 2),
83
+ currentCluster = _useState12[0],
84
+ setCurrentCluster = _useState12[1];
85
+ var getInitCluster = function getInitCluster(list, dcData) {
86
+ var _selected$clusterName;
87
+ var clusters = list.filter(function (item) {
88
+ return item.clusterStatus === 'online';
89
+ });
90
+ var selected = clusters.find(function (item) {
91
+ return item.clusterName === (initParams === null || initParams === void 0 ? void 0 : initParams.clusterName);
92
+ }) || clusters[0] || null;
93
+ var clusterName = (_selected$clusterName = selected === null || selected === void 0 ? void 0 : selected.clusterName) !== null && _selected$clusterName !== void 0 ? _selected$clusterName : '';
94
+ setCurrentCluster(clusterName);
95
+ if (clusterName) {
96
+ onChange(_objectSpread(_objectSpread({}, dcData), {}, {
97
+ clusterName: clusterName
98
+ }));
99
+ }
100
+ };
101
+ var getClusterList = /*#__PURE__*/function () {
102
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
103
+ var params,
104
+ response,
105
+ list,
106
+ _args = arguments;
107
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
108
+ while (1) switch (_context.prev = _context.next) {
109
+ case 0:
110
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : currentDatacenter;
111
+ if (dataInterface.resource.service) {
112
+ _context.next = 3;
113
+ break;
114
+ }
115
+ return _context.abrupt("return");
116
+ case 3:
117
+ _context.next = 5;
118
+ return dataInterface.resource.service(_objectSpread(_objectSpread({}, dataInterface.resource.params || {}), {}, {
119
+ dataCenterId: params === null || params === void 0 ? void 0 : params.dataCenterId,
120
+ logicalUnitId: params === null || params === void 0 ? void 0 : params.logicalUnitId
121
+ }));
122
+ case 5:
123
+ response = _context.sent;
124
+ list = response || [];
125
+ setAllResources(list);
126
+ setResourceList(list);
127
+ getInitCluster(list, params);
128
+ case 10:
129
+ case "end":
130
+ return _context.stop();
131
+ }
132
+ }, _callee);
133
+ }));
134
+ return function getClusterList() {
135
+ return _ref2.apply(this, arguments);
136
+ };
137
+ }();
138
+ var getLdcWriteBack = function getLdcWriteBack(list) {
139
+ if ((initParams === null || initParams === void 0 ? void 0 : initParams.id) === '-1') {
140
+ var datacenter = list.find(function (item) {
141
+ return String(item.id) === '-1';
142
+ });
143
+ if (datacenter) {
144
+ var _texts$unbound;
145
+ return {
146
+ name: (_texts$unbound = texts.unbound) !== null && _texts$unbound !== void 0 ? _texts$unbound : null,
147
+ id: '-1',
148
+ dataCenterId: null,
149
+ logicalUnitId: null
150
+ };
151
+ }
152
+ }
153
+ if (initParams !== null && initParams !== void 0 && initParams.dataCenterId) {
154
+ var _datacenter = list.find(function (item) {
155
+ return item.id === initParams.dataCenterId;
156
+ }) || list.find(function (item) {
157
+ return String(item.id) === String(initParams.dataCenterId);
158
+ });
159
+ if (_datacenter) {
160
+ var unit = initParams.logicalUnitId ? (_datacenter.logicalUnitList || []).find(function (item) {
161
+ return item.id === initParams.logicalUnitId || String(item.id) === String(initParams.logicalUnitId);
162
+ }) : undefined;
163
+ if (unit) {
164
+ return {
165
+ name: "".concat(_datacenter.name, "/").concat(unit.name),
166
+ id: String(unit.id),
167
+ dataCenterId: _datacenter.id,
168
+ logicalUnitId: unit.id
169
+ };
170
+ }
171
+ return {
172
+ name: _datacenter.name,
173
+ id: String(_datacenter.id),
174
+ dataCenterId: _datacenter.id,
175
+ logicalUnitId: null
176
+ };
177
+ }
178
+ }
179
+ return null;
180
+ };
181
+ var getInitDatacenter = function getInitDatacenter(list) {
182
+ var data = {
183
+ name: null,
184
+ id: null,
185
+ dataCenterId: null,
186
+ logicalUnitId: null
187
+ };
188
+ if (list.length > 0) {
189
+ var selected = getLdcWriteBack(list);
190
+ if (selected) {
191
+ data = selected;
192
+ } else {
193
+ data = {
194
+ name: list[0].name,
195
+ id: String(list[0].id),
196
+ dataCenterId: list[0].id === -1 ? null : list[0].id,
197
+ logicalUnitId: null
198
+ };
199
+ }
200
+ }
201
+ setCurrentDatacenter(data);
202
+ getClusterList(data);
203
+ };
204
+ var getDatacenterList = /*#__PURE__*/function () {
205
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
206
+ var response, list;
207
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
208
+ while (1) switch (_context2.prev = _context2.next) {
209
+ case 0:
210
+ if (dataInterface.datacenter.service) {
211
+ _context2.next = 2;
212
+ break;
213
+ }
214
+ return _context2.abrupt("return");
215
+ case 2:
216
+ _context2.next = 4;
217
+ return dataInterface.datacenter.service(_objectSpread({}, dataInterface.datacenter.params || {}));
218
+ case 4:
219
+ response = _context2.sent;
220
+ list = response || [];
221
+ setDatacenterList(list);
222
+ getInitDatacenter(list);
223
+ case 8:
224
+ case "end":
225
+ return _context2.stop();
226
+ }
227
+ }, _callee2);
228
+ }));
229
+ return function getDatacenterList() {
230
+ return _ref3.apply(this, arguments);
231
+ };
232
+ }();
233
+ useEffect(function () {
234
+ var _dataInterface$datace, _dataInterface$resour;
235
+ if (typeof (dataInterface === null || dataInterface === void 0 || (_dataInterface$datace = dataInterface.datacenter) === null || _dataInterface$datace === void 0 ? void 0 : _dataInterface$datace.service) === 'function' && typeof (dataInterface === null || dataInterface === void 0 || (_dataInterface$resour = dataInterface.resource) === null || _dataInterface$resour === void 0 ? void 0 : _dataInterface$resour.service) === 'function') {
236
+ getDatacenterList();
237
+ } else {
238
+ notification.warning({
239
+ message: texts.hint,
240
+ description: texts.noInterfaceTips,
241
+ placement: 'top'
242
+ });
243
+ }
244
+ // eslint-disable-next-line react-hooks/exhaustive-deps
245
+ }, [dataInterface, compoKey]);
246
+ var handleChangeData = function handleChangeData(data, key) {
247
+ setResourceKeyword(null);
248
+ var current = {
249
+ name: null,
250
+ id: null,
251
+ dataCenterId: null,
252
+ logicalUnitId: null
253
+ };
254
+ if (key === 'unbound') {
255
+ var _texts$unbound2;
256
+ current = {
257
+ name: (_texts$unbound2 = texts.unbound) !== null && _texts$unbound2 !== void 0 ? _texts$unbound2 : null,
258
+ id: String(data.id),
259
+ dataCenterId: null,
260
+ logicalUnitId: null
261
+ };
262
+ }
263
+ if (key === 'dataCenter') {
264
+ var dc = data;
265
+ current = {
266
+ name: dc.name,
267
+ id: String(dc.id),
268
+ dataCenterId: dc.id,
269
+ logicalUnitId: null
270
+ };
271
+ }
272
+ if (key === 'logicalUnit') {
273
+ var _unit$dataCenterId;
274
+ var unit = data;
275
+ current = {
276
+ name: "".concat(unit.dataCenterName, "/").concat(unit.name),
277
+ id: String(unit.id),
278
+ dataCenterId: (_unit$dataCenterId = unit.dataCenterId) !== null && _unit$dataCenterId !== void 0 ? _unit$dataCenterId : null,
279
+ logicalUnitId: unit.id
280
+ };
281
+ }
282
+ setCurrentDatacenter(current);
283
+ getClusterList(current);
284
+ };
285
+ var handleChangeCluster = function handleChangeCluster(cluster) {
286
+ setCurrentCluster(cluster.clusterName);
287
+ onChange(_objectSpread(_objectSpread({}, currentDatacenter), {}, {
288
+ clusterName: cluster.clusterName
289
+ }));
290
+ };
291
+ var handleFilterClusters = function handleFilterClusters(key) {
292
+ setResourceKeyword(key);
293
+ var list = allResources.filter(function (item) {
294
+ return item.clusterName.indexOf(key) > -1;
295
+ });
296
+ setResourceList(list);
297
+ };
298
+ var getDatacentersForDropdown = function getDatacentersForDropdown(list) {
299
+ var items = [];
300
+ list.forEach(function (item) {
301
+ if (item.id === -1) {
302
+ items.push({
303
+ key: '-1',
304
+ label: texts.unbound,
305
+ onClick: function onClick() {
306
+ return handleChangeData(item, 'unbound');
307
+ }
308
+ });
309
+ } else {
310
+ var children = (item.logicalUnitList || []).map(function (unit) {
311
+ return {
312
+ key: String(unit.id),
313
+ label: /*#__PURE__*/React.createElement("div", {
314
+ className: "ldc-sub-menu-item"
315
+ }, fetchTextOmit(unit.name, 15)),
316
+ onClick: function onClick() {
317
+ return handleChangeData(_objectSpread(_objectSpread({}, unit), {}, {
318
+ dataCenterId: item.id,
319
+ dataCenterName: item.name
320
+ }), 'logicalUnit');
321
+ }
322
+ };
323
+ });
324
+ items.push({
325
+ key: String(item.id),
326
+ label: /*#__PURE__*/React.createElement("div", {
327
+ className: "parent-menu-item",
328
+ onClick: function onClick() {
329
+ return handleChangeData(item, 'dataCenter');
330
+ }
331
+ }, fetchTextOmit(item.name, 15)),
332
+ children: children.length > 0 ? children : undefined
333
+ });
334
+ }
335
+ });
336
+ return items;
337
+ };
338
+ var getClustersForDropdown = function getClustersForDropdown(list) {
339
+ return list === null || list === void 0 ? void 0 : list.map(function (item) {
340
+ return {
341
+ key: item.clusterName,
342
+ label: /*#__PURE__*/React.createElement(Popover, {
343
+ placement: "right",
344
+ content: item.clusterStatus === 'online' ? null : texts.clusterOffline,
345
+ arrow: {
346
+ pointAtCenter: true
347
+ },
348
+ overlayClassName: "filter-dropdown-popover"
349
+ }, item.clusterName, item.clusterStatus !== 'online' && /*#__PURE__*/React.createElement(Icon, {
350
+ name: "v35_Disconnection"
351
+ })),
352
+ disabled: item.clusterStatus !== 'online',
353
+ onClick: function onClick() {
354
+ return handleChangeCluster(item);
355
+ }
356
+ };
357
+ });
358
+ };
359
+ var showDatacenter = !((datacenterList === null || datacenterList === void 0 ? void 0 : datacenterList.length) === 0 || (datacenterList === null || datacenterList === void 0 ? void 0 : datacenterList.length) === 1 && datacenterList[0].id === -1);
360
+ return /*#__PURE__*/React.createElement("div", {
361
+ className: "logical-resource-filter"
362
+ }, showDatacenter && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
363
+ className: "button-divider",
364
+ type: "vertical"
365
+ }), /*#__PURE__*/React.createElement(Dropdown, {
366
+ trigger: ['click'],
367
+ overlayClassName: "filter-dropdown-items",
368
+ menu: {
369
+ items: getDatacentersForDropdown(datacenterList),
370
+ selectable: true,
371
+ selectedKeys: currentDatacenter !== null && currentDatacenter !== void 0 && currentDatacenter.id ? [String(currentDatacenter.id)] : []
372
+ }
373
+ }, /*#__PURE__*/React.createElement("div", {
374
+ className: "filter-dropdown-header"
375
+ }, /*#__PURE__*/React.createElement(Icon, {
376
+ name: "v35_Datacenter"
377
+ }), currentDatacenter !== null && currentDatacenter !== void 0 && currentDatacenter.name ? fetchTextOmit(currentDatacenter.name, 15) : /*#__PURE__*/React.createElement("span", {
378
+ className: "placeholder"
379
+ }, texts.selectLogicalUnit), /*#__PURE__*/React.createElement(Icon, {
380
+ name: "v35_ArrowDown"
381
+ })))), (allResources === null || allResources === void 0 ? void 0 : allResources.length) > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
382
+ className: "button-divider",
383
+ type: "vertical"
384
+ }), /*#__PURE__*/React.createElement(Dropdown, {
385
+ trigger: ['click'],
386
+ overlayClassName: "filter-dropdown-items",
387
+ menu: {
388
+ items: getClustersForDropdown(resourceList),
389
+ selectable: true,
390
+ selectedKeys: currentCluster ? [currentCluster] : []
391
+ },
392
+ dropdownRender: function dropdownRender(menu) {
393
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input, {
394
+ placeholder: texts.searchByClusterName,
395
+ prefix: /*#__PURE__*/React.createElement(SearchOutlined, null),
396
+ variant: "borderless",
397
+ allowClear: true,
398
+ value: resourceKeyword !== null && resourceKeyword !== void 0 ? resourceKeyword : undefined,
399
+ onPressEnter: function onPressEnter(e) {
400
+ handleFilterClusters(e.target.value);
401
+ },
402
+ onChange: function onChange(e) {
403
+ if (e.type === 'click') {
404
+ setResourceList(allResources);
405
+ setResourceKeyword(null);
406
+ } else {
407
+ setResourceKeyword(e.target.value);
408
+ }
409
+ }
410
+ }), (resourceList === null || resourceList === void 0 ? void 0 : resourceList.length) > 0 ? menu : /*#__PURE__*/React.createElement("div", {
411
+ className: "no-data"
412
+ }, /*#__PURE__*/React.createElement(Icon, {
413
+ name: "no-data"
414
+ }), texts.nodata));
415
+ }
416
+ }, /*#__PURE__*/React.createElement("div", {
417
+ className: "filter-dropdown-header"
418
+ }, /*#__PURE__*/React.createElement(Icon, {
419
+ name: "v35_Clusters"
420
+ }), currentCluster ? fetchTextOmit(currentCluster, 20) : /*#__PURE__*/React.createElement("span", {
421
+ className: "placeholder"
422
+ }, texts.selectCluster), /*#__PURE__*/React.createElement(Icon, {
423
+ name: "v35_ArrowDown"
424
+ })))));
425
+ };
426
+ export default LogicalResourceFilter;
@@ -0,0 +1,139 @@
1
+ .logical-resource-filter {
2
+ display: flex;
3
+ align-items: center;
4
+ }
5
+
6
+ .filter-dropdown-items {
7
+ &.ant-dropdown {
8
+ min-width: 150px;
9
+ padding: 4px;
10
+ background-color: #fff;
11
+ border-radius: 4px;
12
+ box-shadow:
13
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
14
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
15
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05);
16
+
17
+ .ant-dropdown-menu {
18
+ max-height: 200px;
19
+ padding: 0;
20
+ overflow-y: auto;
21
+ box-shadow: none;
22
+
23
+ .ant-dropdown-menu-item,
24
+ .ant-dropdown-menu-submenu {
25
+ margin: 8px 0;
26
+ border-radius: 4px;
27
+
28
+ &.ant-dropdown-menu-item-active {
29
+ &:active {
30
+ color: var(--ant-color-primary, #1677ff);
31
+ background: rgba(40, 105, 246, 0.1);
32
+ }
33
+ }
34
+
35
+ &.ant-dropdown-menu-submenu-active {
36
+ .ant-dropdown-menu-submenu-title {
37
+ &:active {
38
+ color: var(--ant-color-primary, #1677ff);
39
+ background: rgba(40, 105, 246, 0.1);
40
+ }
41
+ }
42
+ }
43
+
44
+ .parent-menu-item {
45
+ display: inline-block;
46
+ width: 100%;
47
+ min-width: 124px;
48
+ }
49
+ }
50
+
51
+ .hc-icon {
52
+ margin-left: 4px;
53
+ }
54
+ }
55
+
56
+ .ant-dropdown-menu-item-selected,
57
+ .ant-dropdown-menu-submenu-title-selected {
58
+ background-color: rgba(40, 105, 246, 0.1);
59
+ }
60
+
61
+ .ant-input-affix-wrapper {
62
+ background: #f7f8fa;
63
+
64
+ .ant-input-prefix {
65
+ font-weight: 500;
66
+ font-size: 16px;
67
+ }
68
+
69
+ .ant-input {
70
+ background: none;
71
+ }
72
+ }
73
+
74
+ .no-data {
75
+ padding: 16px 24px 24px;
76
+ text-align: center;
77
+
78
+ .hc-icon {
79
+ display: block;
80
+ margin: 0 auto;
81
+ color: #333;
82
+ font-size: 72px;
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ .filter-dropdown-header {
89
+ color: rgba(0, 0, 0, 0.65);
90
+ cursor: pointer;
91
+
92
+ .placeholder {
93
+ color: #bfbfbf;
94
+ }
95
+
96
+ .hc-icon {
97
+ font-size: 16px;
98
+
99
+ &:first-child {
100
+ margin-right: 4px;
101
+ }
102
+
103
+ &:last-child {
104
+ margin-left: 4px;
105
+ }
106
+ }
107
+
108
+ &.ant-dropdown-open {
109
+ .hc-icon:last-child {
110
+ color: var(--ant-color-primary, #1677ff);
111
+ }
112
+ }
113
+ }
114
+
115
+ .filter-dropdown-popover {
116
+ &.ant-popover {
117
+ z-index: 1051;
118
+
119
+ .ant-popover-inner-content {
120
+ color: rgba(0, 0, 0, 0.65);
121
+ }
122
+ }
123
+ }
124
+
125
+ .ldc-sub-menu-item {
126
+ min-width: 124px;
127
+ }
128
+
129
+ .ant-dropdown-menu-submenu-popup {
130
+ border-radius: 4px;
131
+
132
+ .ant-dropdown-menu {
133
+ padding: 4px;
134
+
135
+ .ant-dropdown-menu-item {
136
+ border-radius: 4px;
137
+ }
138
+ }
139
+ }
@@ -0,0 +1,2 @@
1
+ import type { LogicalResourceFilterTexts } from './types';
2
+ export declare const logicalResourceLocaleZhCN: LogicalResourceFilterTexts;
@@ -0,0 +1,10 @@
1
+ export var logicalResourceLocaleZhCN = {
2
+ unbound: '未绑定',
3
+ clusterOffline: '集群处于离线状态',
4
+ searchByClusterName: '根据集群名称搜索',
5
+ selectCluster: '请选择集群',
6
+ selectLogicalUnit: '请选择逻辑单元',
7
+ nodata: '无数据',
8
+ hint: '提示',
9
+ noInterfaceTips: '请配置数据接口方法'
10
+ };
@@ -0,0 +1,58 @@
1
+ export interface LogicalResourceInitParams {
2
+ name?: string | null;
3
+ id?: string | null;
4
+ dataCenterId?: string | number | null;
5
+ logicalUnitId?: string | number | null;
6
+ clusterName?: string | null;
7
+ }
8
+ export interface LogicalResourceChangeValue {
9
+ name: string | null;
10
+ id: string | null;
11
+ dataCenterId: string | number | null;
12
+ logicalUnitId: string | number | null;
13
+ clusterName?: string;
14
+ }
15
+ export interface LogicalDatacenterUnit {
16
+ id: string | number;
17
+ name: string;
18
+ dataCenterId?: string | number;
19
+ dataCenterName?: string;
20
+ code?: string;
21
+ type?: string;
22
+ }
23
+ export interface LogicalDatacenterItem {
24
+ id: string | number;
25
+ name: string;
26
+ logicalUnitList?: LogicalDatacenterUnit[];
27
+ }
28
+ export interface LogicalClusterItem {
29
+ clusterName: string;
30
+ clusterStatus: string;
31
+ createTime?: string;
32
+ }
33
+ export interface LogicalResourceFilterTexts {
34
+ unbound?: string;
35
+ clusterOffline?: string;
36
+ searchByClusterName?: string;
37
+ selectCluster?: string;
38
+ selectLogicalUnit?: string;
39
+ nodata?: string;
40
+ hint?: string;
41
+ noInterfaceTips?: string;
42
+ }
43
+ export interface LogicalResourceFilterProps {
44
+ dataInterface: {
45
+ datacenter: {
46
+ service?: (params: Record<string, unknown>) => Promise<LogicalDatacenterItem[]>;
47
+ params?: Record<string, unknown>;
48
+ };
49
+ resource: {
50
+ service?: (params: Record<string, unknown>) => Promise<LogicalClusterItem[]>;
51
+ params?: Record<string, unknown>;
52
+ };
53
+ };
54
+ onChange: (value?: LogicalResourceChangeValue) => void;
55
+ compoKey?: string | number;
56
+ initParams?: LogicalResourceInitParams;
57
+ texts?: LogicalResourceFilterTexts;
58
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { PopoverProps } from 'antd';
2
+ import React from 'react';
3
+ import { type MetadataTexts } from '../metadata/locale';
4
+ import './index.less';
5
+ export interface MetadataCountProps {
6
+ type: 'labels' | 'taints' | 'annotations' | string;
7
+ datasource?: unknown;
8
+ needEdit?: boolean;
9
+ valueRequired?: boolean;
10
+ onCallback?: (data: Record<string, string>[]) => void;
11
+ isHasAuth?: boolean;
12
+ placement?: PopoverProps['placement'];
13
+ texts?: MetadataTexts;
14
+ }
15
+ declare const MetadataCount: React.FC<MetadataCountProps>;
16
+ export default MetadataCount;