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,470 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ 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."); }
11
+ 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); }
12
+ 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; }
13
+ 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; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ 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; }
16
+ 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; }
17
+ 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; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
19
+ 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); }
20
+ import { FullscreenExitOutlined } from '@ant-design/icons';
21
+ import { Button, notification, Popover } from 'antd';
22
+ import jsYaml from 'js-yaml';
23
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
24
+ import YAML from 'yaml';
25
+ import Icon from "../Icon";
26
+ import CodeMirrorWrapper from "./CodeMirrorWrapper";
27
+ import "./index.less";
28
+ var DEFAULT_TEXTS = {
29
+ inputYaml: '请输入 YAML',
30
+ copySuccess: '复制成功',
31
+ copyFail: '复制失败',
32
+ save: '保存',
33
+ cancel: '取消',
34
+ edit: '编辑',
35
+ validate: '校验',
36
+ validatePopTip: '点击进行后端校验',
37
+ start: '运行',
38
+ tipMessage: '提示信息',
39
+ editYaml: '编辑 YAML',
40
+ formatOk: 'YAML: Format check successful'
41
+ };
42
+ var Yaml = function Yaml(props) {
43
+ var _props$height = props.height,
44
+ height = _props$height === void 0 ? 200 : _props$height,
45
+ _props$title = props.title,
46
+ title = _props$title === void 0 ? 'yaml' : _props$title,
47
+ _props$mode = props.mode,
48
+ mode = _props$mode === void 0 ? 'yaml' : _props$mode,
49
+ _props$edit = props.edit,
50
+ edit = _props$edit === void 0 ? false : _props$edit,
51
+ _props$changeModeAfte = props.changeModeAfterSave,
52
+ changeModeAfterSave = _props$changeModeAfte === void 0 ? true : _props$changeModeAfte,
53
+ content = props.content,
54
+ validateMethod = props.validateMethod,
55
+ _props$validator = props.validator,
56
+ validator = _props$validator === void 0 ? false : _props$validator,
57
+ _props$canOperate = props.canOperate,
58
+ canOperate = _props$canOperate === void 0 ? true : _props$canOperate,
59
+ _props$onChange = props.onChange,
60
+ onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
61
+ _props$onCancel = props.onCancel,
62
+ onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
63
+ _props$onEdit = props.onEdit,
64
+ onEdit = _props$onEdit === void 0 ? function () {} : _props$onEdit,
65
+ _props$onSave = props.onSave,
66
+ onSave = _props$onSave === void 0 ? function () {} : _props$onSave,
67
+ onValidatorChange = props.onValidatorChange,
68
+ _props$changeImmediat = props.changeImmediately,
69
+ changeImmediately = _props$changeImmediat === void 0 ? false : _props$changeImmediat,
70
+ textsProp = props.texts;
71
+ var texts = useMemo(function () {
72
+ return _objectSpread(_objectSpread({}, DEFAULT_TEXTS), textsProp);
73
+ }, [textsProp]);
74
+ var codemirrorDefault = {
75
+ mode: mode,
76
+ height: height,
77
+ readOnly: !edit,
78
+ placeholder: ''
79
+ };
80
+ var _useState = useState(''),
81
+ _useState2 = _slicedToArray(_useState, 2),
82
+ yamlContent = _useState2[0],
83
+ setYamlContent = _useState2[1];
84
+ var _useState3 = useState([]),
85
+ _useState4 = _slicedToArray(_useState3, 2),
86
+ yamlMsg = _useState4[0],
87
+ setYamlMsg = _useState4[1];
88
+ var _useState5 = useState(edit),
89
+ _useState6 = _slicedToArray(_useState5, 2),
90
+ editMode = _useState6[0],
91
+ setEditMode = _useState6[1];
92
+ var _useState7 = useState(''),
93
+ _useState8 = _slicedToArray(_useState7, 2),
94
+ contentBak = _useState8[0],
95
+ setContentBak = _useState8[1];
96
+ var _useState9 = useState(false),
97
+ _useState10 = _slicedToArray(_useState9, 2),
98
+ fullscreen = _useState10[0],
99
+ setFullscreen = _useState10[1];
100
+ var _useState11 = useState(codemirrorDefault),
101
+ _useState12 = _slicedToArray(_useState11, 2),
102
+ options = _useState12[0],
103
+ setOptions = _useState12[1];
104
+ var _useState13 = useState(true),
105
+ _useState14 = _slicedToArray(_useState13, 2),
106
+ contentChange = _useState14[0],
107
+ setContentChange = _useState14[1];
108
+ var _useState15 = useState(true),
109
+ _useState16 = _slicedToArray(_useState15, 2),
110
+ formatValidateRes = _useState16[0],
111
+ setFormatValidateRes = _useState16[1];
112
+ var _useState17 = useState(!validateMethod),
113
+ _useState18 = _slicedToArray(_useState17, 2),
114
+ validateRes = _useState18[0],
115
+ setValidateRes = _useState18[1];
116
+ var timeoutId = useRef(undefined);
117
+ var msgColor = {
118
+ 1: '#f9a144',
119
+ 2: '#EF595C',
120
+ 3: '#68B642'
121
+ };
122
+ var json2yaml = function json2yaml(json) {
123
+ try {
124
+ return jsYaml.dump(json, {
125
+ skipInvalid: true,
126
+ replacer: function replacer(_key, value) {
127
+ if (value === null) return undefined;
128
+ return value;
129
+ }
130
+ });
131
+ } catch (err) {
132
+ onValidatorChange === null || onValidatorChange === void 0 || onValidatorChange(false, 2, err);
133
+ return undefined;
134
+ }
135
+ };
136
+ var yaml2json = function yaml2json(yamlStr) {
137
+ try {
138
+ return YAML.parse(yamlStr);
139
+ } catch (err) {
140
+ onValidatorChange === null || onValidatorChange === void 0 || onValidatorChange(false, 2, err);
141
+ return undefined;
142
+ }
143
+ };
144
+ var addYamlMsg = function addYamlMsg(msg, status) {
145
+ setYamlMsg(function (prev) {
146
+ return [{
147
+ time: "[".concat(new Date().toLocaleString(), "] "),
148
+ msg: msg,
149
+ messageStatus: status
150
+ }].concat(_toConsumableArray(prev));
151
+ });
152
+ };
153
+ var toEdit = function toEdit(con) {
154
+ setEditMode(true);
155
+ setContentBak(con);
156
+ setOptions(function (prev) {
157
+ return _objectSpread(_objectSpread({}, prev), {}, {
158
+ readOnly: false,
159
+ placeholder: texts.inputYaml
160
+ });
161
+ });
162
+ };
163
+ useEffect(function () {
164
+ var onFullscreenChange = function onFullscreenChange() {
165
+ if (!document.fullscreenElement) setFullscreen(false);
166
+ };
167
+ document.addEventListener('fullscreenchange', onFullscreenChange);
168
+ return function () {
169
+ return document.removeEventListener('fullscreenchange', onFullscreenChange);
170
+ };
171
+ }, []);
172
+ useEffect(function () {
173
+ setEditMode(edit);
174
+ if (edit) {
175
+ var _json2yaml;
176
+ var str = typeof content === 'string' ? content : content != null ? (_json2yaml = json2yaml(content)) !== null && _json2yaml !== void 0 ? _json2yaml : '' : '';
177
+ toEdit(str);
178
+ } else {
179
+ setOptions(function (prev) {
180
+ return _objectSpread(_objectSpread({}, prev), {}, {
181
+ readOnly: true,
182
+ placeholder: ''
183
+ });
184
+ });
185
+ }
186
+ // eslint-disable-next-line react-hooks/exhaustive-deps
187
+ }, [edit]);
188
+ useEffect(function () {
189
+ setContentChange(true);
190
+ var con = '';
191
+ if (typeof content === 'string') {
192
+ con = content;
193
+ } else if (content != null) {
194
+ var _json2yaml2;
195
+ con = (_json2yaml2 = json2yaml(content)) !== null && _json2yaml2 !== void 0 ? _json2yaml2 : '';
196
+ }
197
+ setContentBak(con);
198
+ setYamlContent(con);
199
+ // eslint-disable-next-line react-hooks/exhaustive-deps
200
+ }, [content]);
201
+ useEffect(function () {
202
+ var _texts$formatOk;
203
+ var con = typeof content === 'string' ? yamlContent : yaml2json(yamlContent);
204
+ if (editMode && (!canOperate || changeImmediately)) {
205
+ onChange(con, 'change', contentChange);
206
+ }
207
+ setValidateRes(false);
208
+ if (!yamlContent) return undefined;
209
+ var formatOkMsg = (_texts$formatOk = texts.formatOk) !== null && _texts$formatOk !== void 0 ? _texts$formatOk : DEFAULT_TEXTS.formatOk;
210
+ var parseYaml = function parseYaml() {
211
+ try {
212
+ jsYaml.loadAll(yamlContent);
213
+ addYamlMsg(formatOkMsg, 1);
214
+ setFormatValidateRes(true);
215
+ onValidatorChange === null || onValidatorChange === void 0 || onValidatorChange(true, 1, null);
216
+ } catch (err) {
217
+ var _e$name, _e$message, _e$message2;
218
+ var e = err;
219
+ addYamlMsg("".concat((_e$name = e.name) !== null && _e$name !== void 0 ? _e$name : 'Error', ": ").concat((_e$message = e.message) !== null && _e$message !== void 0 ? _e$message : String(err)), 2);
220
+ setFormatValidateRes(false);
221
+ onValidatorChange === null || onValidatorChange === void 0 || onValidatorChange(false, 1, (_e$message2 = e.message) !== null && _e$message2 !== void 0 ? _e$message2 : String(err));
222
+ }
223
+ };
224
+ timeoutId.current = setTimeout(parseYaml, 500);
225
+ return function () {
226
+ return clearTimeout(timeoutId.current);
227
+ };
228
+ // eslint-disable-next-line react-hooks/exhaustive-deps
229
+ }, [yamlContent]);
230
+ var save = function save() {
231
+ var con = typeof content === 'string' ? yamlContent : yaml2json(yamlContent);
232
+ onChange(con, 'save');
233
+ onSave(con);
234
+ if (changeModeAfterSave) {
235
+ setEditMode(false);
236
+ setOptions(function (prev) {
237
+ return _objectSpread(_objectSpread({}, prev), {}, {
238
+ readOnly: true,
239
+ placeholder: ''
240
+ });
241
+ });
242
+ }
243
+ };
244
+ var cancel = function cancel() {
245
+ var _json2yaml3;
246
+ setEditMode(false);
247
+ var str = typeof contentBak === 'string' ? contentBak : (_json2yaml3 = json2yaml(contentBak)) !== null && _json2yaml3 !== void 0 ? _json2yaml3 : '';
248
+ setYamlContent(str);
249
+ var changeCon = typeof contentBak === 'string' ? yaml2json(contentBak) : contentBak;
250
+ onChange(changeCon, 'cancel');
251
+ onCancel(changeCon);
252
+ setOptions(function (prev) {
253
+ return _objectSpread(_objectSpread({}, prev), {}, {
254
+ readOnly: true,
255
+ placeholder: ''
256
+ });
257
+ });
258
+ };
259
+ var copy = /*#__PURE__*/function () {
260
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
261
+ var notify, _navigator$clipboard, tempTextArea;
262
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
263
+ while (1) switch (_context.prev = _context.next) {
264
+ case 0:
265
+ notify = function notify() {
266
+ return notification.success({
267
+ message: texts.copySuccess
268
+ });
269
+ };
270
+ _context.prev = 1;
271
+ if (!((_navigator$clipboard = navigator.clipboard) !== null && _navigator$clipboard !== void 0 && _navigator$clipboard.writeText)) {
272
+ _context.next = 7;
273
+ break;
274
+ }
275
+ _context.next = 5;
276
+ return navigator.clipboard.writeText(yamlContent);
277
+ case 5:
278
+ notify();
279
+ return _context.abrupt("return");
280
+ case 7:
281
+ _context.next = 11;
282
+ break;
283
+ case 9:
284
+ _context.prev = 9;
285
+ _context.t0 = _context["catch"](1);
286
+ case 11:
287
+ tempTextArea = document.createElement('textarea');
288
+ tempTextArea.value = yamlContent;
289
+ document.body.appendChild(tempTextArea);
290
+ tempTextArea.select();
291
+ try {
292
+ document.execCommand('copy');
293
+ notify();
294
+ } catch (_unused2) {
295
+ notification.error({
296
+ message: texts.copyFail
297
+ });
298
+ }
299
+ document.body.removeChild(tempTextArea);
300
+ case 17:
301
+ case "end":
302
+ return _context.stop();
303
+ }
304
+ }, _callee, null, [[1, 9]]);
305
+ }));
306
+ return function copy() {
307
+ return _ref.apply(this, arguments);
308
+ };
309
+ }();
310
+ var toFullScreen = function toFullScreen(e) {
311
+ var _e$currentTarget$pare;
312
+ setFullscreen(true);
313
+ var fullScreenEle = (_e$currentTarget$pare = e.currentTarget.parentElement) === null || _e$currentTarget$pare === void 0 || (_e$currentTarget$pare = _e$currentTarget$pare.parentElement) === null || _e$currentTarget$pare === void 0 ? void 0 : _e$currentTarget$pare.parentElement;
314
+ if (fullScreenEle instanceof HTMLElement) {
315
+ fullScreenEle.requestFullscreen();
316
+ }
317
+ };
318
+ var exitFullScreen = function exitFullScreen() {
319
+ setFullscreen(false);
320
+ if (document.fullscreenElement) {
321
+ document.exitFullscreen();
322
+ }
323
+ };
324
+ var download = function download() {
325
+ if (!yamlContent) return;
326
+ var fileTitle = typeof title === 'string' ? title : "Yaml-".concat(new Date().toLocaleString());
327
+ var exportBlob = new Blob([yamlContent]);
328
+ var saveLink = document.createElement('a');
329
+ saveLink.href = window.URL.createObjectURL(exportBlob);
330
+ saveLink.download = "".concat(fileTitle, ".yml");
331
+ saveLink.dispatchEvent(new MouseEvent('click'));
332
+ };
333
+ var validate = /*#__PURE__*/function () {
334
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
335
+ var res, _res$errorMsg, _res$errorMsg2;
336
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
337
+ while (1) switch (_context2.prev = _context2.next) {
338
+ case 0:
339
+ if (!(!formatValidateRes || !validateMethod)) {
340
+ _context2.next = 2;
341
+ break;
342
+ }
343
+ return _context2.abrupt("return");
344
+ case 2:
345
+ _context2.next = 4;
346
+ return validateMethod();
347
+ case 4:
348
+ res = _context2.sent;
349
+ if (res !== null && res !== void 0 && res.success) {
350
+ setValidateRes(true);
351
+ } else {
352
+ setValidateRes(false);
353
+ if (res !== null && res !== void 0 && res.errorDetail) {
354
+ addYamlMsg("[".concat((_res$errorMsg = res.errorMsg) !== null && _res$errorMsg !== void 0 ? _res$errorMsg : '', "]-").concat(res.errorDetail), 2);
355
+ } else {
356
+ addYamlMsg((_res$errorMsg2 = res === null || res === void 0 ? void 0 : res.errorMsg) !== null && _res$errorMsg2 !== void 0 ? _res$errorMsg2 : '校验失败', 2);
357
+ }
358
+ }
359
+ case 6:
360
+ case "end":
361
+ return _context2.stop();
362
+ }
363
+ }, _callee2);
364
+ }));
365
+ return function validate() {
366
+ return _ref2.apply(this, arguments);
367
+ };
368
+ }();
369
+ return /*#__PURE__*/React.createElement("div", {
370
+ className: "yaml-content",
371
+ style: {
372
+ height: height
373
+ }
374
+ }, /*#__PURE__*/React.createElement("div", {
375
+ className: validator ? 'header hasValidator' : 'header'
376
+ }, /*#__PURE__*/React.createElement("p", null, title), /*#__PURE__*/React.createElement("div", {
377
+ className: "operate"
378
+ }, !editMode && canOperate && !validator && /*#__PURE__*/React.createElement(Button, {
379
+ type: "primary",
380
+ size: "small",
381
+ onClick: function onClick() {
382
+ onEdit(yamlContent);
383
+ toEdit(yamlContent);
384
+ }
385
+ }, texts.edit), editMode && canOperate && !validator && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
386
+ type: "primary",
387
+ size: "small",
388
+ onClick: save
389
+ }, texts.save), /*#__PURE__*/React.createElement(Button, {
390
+ size: "small",
391
+ onClick: cancel
392
+ }, texts.cancel)), /*#__PURE__*/React.createElement("span", {
393
+ className: "copy",
394
+ role: "presentation",
395
+ onClick: copy
396
+ }, /*#__PURE__*/React.createElement(Icon, {
397
+ name: "copy"
398
+ })), /*#__PURE__*/React.createElement("span", {
399
+ className: "download",
400
+ role: "presentation",
401
+ onClick: download
402
+ }, /*#__PURE__*/React.createElement(Icon, {
403
+ name: "download"
404
+ })), !fullscreen && /*#__PURE__*/React.createElement("span", {
405
+ className: "fullscreen",
406
+ role: "presentation",
407
+ onClick: toFullScreen
408
+ }, /*#__PURE__*/React.createElement(Icon, {
409
+ name: "fullScreen"
410
+ })), fullscreen && /*#__PURE__*/React.createElement("span", {
411
+ className: "exitFullscreen",
412
+ role: "presentation",
413
+ onClick: exitFullScreen
414
+ }, /*#__PURE__*/React.createElement(FullscreenExitOutlined, null)))), /*#__PURE__*/React.createElement("div", {
415
+ className: validator && editMode ? 'codeBox edit' : validator && !editMode ? 'codeBox view' : 'codeBox'
416
+ }, /*#__PURE__*/React.createElement(CodeMirrorWrapper, {
417
+ content: yamlContent,
418
+ options: options,
419
+ onBeforeChange: function onBeforeChange(_editor, _data, value) {
420
+ setContentChange(false);
421
+ setYamlContent(value);
422
+ }
423
+ })), validator && editMode && /*#__PURE__*/React.createElement("div", {
424
+ className: "validator"
425
+ }, /*#__PURE__*/React.createElement("div", {
426
+ className: "v-header"
427
+ }, /*#__PURE__*/React.createElement("span", null, texts.tipMessage), /*#__PURE__*/React.createElement("div", {
428
+ className: "operate"
429
+ }, validateMethod && /*#__PURE__*/React.createElement(Popover, {
430
+ content: texts.validatePopTip
431
+ }, /*#__PURE__*/React.createElement("p", {
432
+ role: "presentation",
433
+ onClick: validate,
434
+ className: formatValidateRes ? 'normal' : 'disable'
435
+ }, /*#__PURE__*/React.createElement(Icon, {
436
+ name: "yaml"
437
+ }), texts.validate)), /*#__PURE__*/React.createElement("p", {
438
+ role: "presentation",
439
+ onClick: function onClick() {
440
+ if (validateRes) save();
441
+ },
442
+ className: validateRes ? 'normal' : 'disable'
443
+ }, /*#__PURE__*/React.createElement(Icon, {
444
+ name: "start"
445
+ }), texts.start))), /*#__PURE__*/React.createElement("ul", null, yamlMsg.map(function (msg, index) {
446
+ return /*#__PURE__*/React.createElement("li", {
447
+ key: index
448
+ }, /*#__PURE__*/React.createElement("pre", {
449
+ className: "msg-time"
450
+ }, msg.time), /*#__PURE__*/React.createElement("pre", {
451
+ className: "msg-content",
452
+ style: {
453
+ color: msgColor[msg.messageStatus]
454
+ }
455
+ }, msg.msg));
456
+ }))), validator && !editMode && canOperate && /*#__PURE__*/React.createElement("div", {
457
+ className: "operate-bar"
458
+ }, /*#__PURE__*/React.createElement("div", {
459
+ className: "v-header"
460
+ }, /*#__PURE__*/React.createElement("p", {
461
+ className: "normal",
462
+ role: "presentation",
463
+ onClick: function onClick() {
464
+ return toEdit(yamlContent);
465
+ }
466
+ }, /*#__PURE__*/React.createElement(Icon, {
467
+ name: "v35_Edit"
468
+ }), /*#__PURE__*/React.createElement("span", null, texts.editYaml)))));
469
+ };
470
+ export default Yaml;
@@ -0,0 +1,190 @@
1
+ .yaml-content {
2
+ position: relative;
3
+ display: block !important;
4
+
5
+ .header {
6
+ display: flex;
7
+ justify-content: space-between;
8
+ height: 40px;
9
+ padding-right: 12px;
10
+ padding-left: 12px;
11
+ color: #e8dfdf;
12
+ line-height: 40px;
13
+ background-color: #333;
14
+ border-top-left-radius: 4px;
15
+ border-top-right-radius: 4px;
16
+
17
+ &.hasValidator {
18
+ border-bottom-right-radius: 0;
19
+ border-bottom-left-radius: 0;
20
+ }
21
+
22
+ .operate {
23
+ display: flex;
24
+ align-items: center;
25
+ height: 100%;
26
+ cursor: pointer;
27
+
28
+ button {
29
+ margin-left: 8px;
30
+ }
31
+
32
+ &>span {
33
+ display: inline-flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ width: 20px;
37
+ height: 20px;
38
+ margin-left: 16px;
39
+ color: #fff;
40
+
41
+ &.copy {
42
+ font-size: 16px;
43
+ line-height: 16px;
44
+ }
45
+
46
+ &.fullscreen {
47
+ font-size: 17px;
48
+ line-height: 17px;
49
+ }
50
+
51
+ &.exitFullscreen {
52
+ .anticon {
53
+ display: block;
54
+ font-size: 15px;
55
+ line-height: 25px;
56
+ }
57
+ }
58
+
59
+ &.download {
60
+ font-size: 13px;
61
+ line-height: 17px;
62
+ }
63
+
64
+ .hc-icon {
65
+ font-size: inherit;
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ .codeBox {
72
+ height: calc(100% - 40px);
73
+ background-color: #1e1e1e;
74
+
75
+ .cm-editor {
76
+ height: 100%;
77
+ }
78
+
79
+ &.edit {
80
+ height: calc(70% - 40px);
81
+ }
82
+
83
+ &.view {
84
+ height: calc(100% - 75px);
85
+ }
86
+ }
87
+
88
+ .validator {
89
+ height: 30%;
90
+ overflow: hidden;
91
+
92
+ .v-header {
93
+ display: flex;
94
+ justify-content: space-between;
95
+ height: 36px;
96
+ padding-left: 10px;
97
+ color: #bfbfbf;
98
+ line-height: 36px;
99
+ background-color: #333;
100
+
101
+ .operate {
102
+ display: flex;
103
+
104
+ p {
105
+ display: flex;
106
+ align-items: center;
107
+ justify-content: center;
108
+ width: 86px;
109
+ height: 36px;
110
+ margin: 0;
111
+ font-size: 14px;
112
+ text-align: center;
113
+
114
+ &.normal {
115
+ color: white;
116
+ background-color: var(--ant-color-primary, #1677ff);
117
+ cursor: pointer;
118
+ }
119
+
120
+ &.disable {
121
+ background-color: #595959;
122
+ cursor: not-allowed;
123
+ opacity: 0.5;
124
+ }
125
+
126
+ .hc-icon {
127
+ margin-right: 4px;
128
+ font-size: 18px;
129
+ }
130
+ }
131
+ }
132
+ }
133
+
134
+ ul {
135
+ height: calc(100% - 40px);
136
+ margin: 0;
137
+ padding: 5px 20px 0;
138
+ overflow-y: auto;
139
+ background: #272822;
140
+
141
+ li {
142
+ margin-top: 12px;
143
+ list-style: none;
144
+
145
+ pre {
146
+ margin: 0;
147
+ }
148
+ }
149
+
150
+ .msg-time {
151
+ color: #fff;
152
+ }
153
+ }
154
+ }
155
+
156
+ .operate-bar {
157
+ position: absolute;
158
+ bottom: 0;
159
+ display: flex;
160
+ justify-content: flex-end;
161
+ width: 100%;
162
+ height: 36px;
163
+ // padding-left: 10px;
164
+ color: #bfbfbf;
165
+ line-height: 36px;
166
+ background-color: #333;
167
+
168
+ p {
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ height: 36px;
173
+ margin: 0;
174
+ padding: 0 16px;
175
+ font-size: 14px;
176
+ text-align: center;
177
+
178
+ &.normal {
179
+ color: white;
180
+ background-color: var(--ant-color-primary, #1677ff);
181
+ cursor: pointer;
182
+ }
183
+
184
+ .hc-icon {
185
+ margin-right: 4px;
186
+ font-size: 18px;
187
+ }
188
+ }
189
+ }
190
+ }