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,21 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ export var componentUninstalledLocaleZhCN = {
8
+ dependencieMissingTitle: '集群扩展组件依赖缺失',
9
+ missingTips1: '集群 暂未安装',
10
+ missingTips2: '依赖扩展组件',
11
+ missingTips3: ',当前功能受限制。',
12
+ required: '依赖扩展组件:',
13
+ solutionMethod: '解决路径',
14
+ installNow: '立即安装',
15
+ installNowComponents: '需安装的扩展组件:',
16
+ authProcessing: '授权处理',
17
+ authProcessingTips: '联系 Kubernetes 集群管理员完成依赖扩展组件安装'
18
+ };
19
+ export function mergeComponentUninstalledTexts(texts) {
20
+ return _objectSpread(_objectSpread({}, componentUninstalledLocaleZhCN), texts);
21
+ }
@@ -0,0 +1,23 @@
1
+ import type { PopoverProps } from 'antd';
2
+ import type { ColumnsType } from 'antd/es/table';
3
+ import React from 'react';
4
+ import '../MetadataPopoverList/index.less';
5
+ import './index.less';
6
+ export type DataCountPopoverType = 'list' | 'interface' | 'tag';
7
+ export interface DataCountPopoverDataInterface {
8
+ service: (params: Record<string, unknown>) => Promise<unknown[]>;
9
+ params?: Record<string, unknown>;
10
+ }
11
+ export interface DataCountPopoverProps {
12
+ /** 展示方式:list 表格、interface 接口拉取、tag 标签列表 */
13
+ type?: DataCountPopoverType;
14
+ columns: ColumnsType<Record<string, unknown>>;
15
+ dataList?: unknown[];
16
+ dataInterface?: DataCountPopoverDataInterface;
17
+ /** 展示数量,默认取列表长度 */
18
+ count?: number;
19
+ iconName: string;
20
+ placement?: PopoverProps['placement'];
21
+ }
22
+ declare const DataCountPopover: React.FC<DataCountPopoverProps>;
23
+ export default DataCountPopover;
@@ -0,0 +1,121 @@
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 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
+ 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); } }
9
+ 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); }); }; }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ 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."); }
12
+ 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); }
13
+ 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; }
14
+ 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; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ import { Button, Popover, Table, Tag } from 'antd';
17
+ import React, { useCallback, useEffect, useState } from 'react';
18
+ import Icon from "../Icon";
19
+ import "../MetadataPopoverList/index.less";
20
+ import "./index.less";
21
+ var DataCountPopover = function DataCountPopover(props) {
22
+ var _props$type = props.type,
23
+ type = _props$type === void 0 ? 'list' : _props$type,
24
+ columns = props.columns,
25
+ dataList = props.dataList,
26
+ dataInterface = props.dataInterface,
27
+ count = props.count,
28
+ iconName = props.iconName,
29
+ placement = props.placement;
30
+ var _useState = useState([]),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ datasource = _useState2[0],
33
+ setDatasource = _useState2[1];
34
+ var getDataList = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
35
+ var _dataInterface$params;
36
+ var response;
37
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
38
+ while (1) switch (_context.prev = _context.next) {
39
+ case 0:
40
+ if (dataInterface !== null && dataInterface !== void 0 && dataInterface.service) {
41
+ _context.next = 2;
42
+ break;
43
+ }
44
+ return _context.abrupt("return");
45
+ case 2:
46
+ _context.next = 4;
47
+ return dataInterface.service(_objectSpread({}, (_dataInterface$params = dataInterface.params) !== null && _dataInterface$params !== void 0 ? _dataInterface$params : {}));
48
+ case 4:
49
+ response = _context.sent;
50
+ setDatasource(Array.isArray(response) ? response : []);
51
+ case 6:
52
+ case "end":
53
+ return _context.stop();
54
+ }
55
+ }, _callee);
56
+ })), [dataInterface]);
57
+ useEffect(function () {
58
+ if (type === 'interface') {
59
+ getDataList();
60
+ } else {
61
+ setDatasource(dataList !== null && dataList !== void 0 ? dataList : []);
62
+ }
63
+ }, [type, dataList, getDataList]);
64
+ var renderContent = function renderContent() {
65
+ if (type === 'tag') {
66
+ return /*#__PURE__*/React.createElement("div", {
67
+ className: "tag-list-wrapper"
68
+ }, datasource.map(function (item, index) {
69
+ var _text;
70
+ var text = item;
71
+ if (_typeof(item) === 'object' && item !== null && columns.length > 0) {
72
+ var _columns$;
73
+ //@ts-ignore
74
+ var dataIndex = (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.dataIndex;
75
+ if (typeof dataIndex === 'string') {
76
+ text = item[dataIndex];
77
+ }
78
+ }
79
+ return /*#__PURE__*/React.createElement(Tag, {
80
+ key: index,
81
+ className: "data-count-tag"
82
+ }, String((_text = text) !== null && _text !== void 0 ? _text : ''));
83
+ }));
84
+ }
85
+ return /*#__PURE__*/React.createElement(Table, {
86
+ columns: columns,
87
+ dataSource: datasource,
88
+ rowKey: function rowKey(_, index) {
89
+ return String(index);
90
+ },
91
+ pagination: false,
92
+ scroll: {
93
+ y: 250
94
+ }
95
+ });
96
+ };
97
+ var displayCount = count !== null && count !== void 0 ? count : datasource.length;
98
+ return /*#__PURE__*/React.createElement("div", {
99
+ className: "data-count-popover-wrap"
100
+ }, /*#__PURE__*/React.createElement("span", {
101
+ className: "count-icon"
102
+ }, /*#__PURE__*/React.createElement(Icon, {
103
+ name: iconName || 'v35_Tag'
104
+ })), /*#__PURE__*/React.createElement(Popover, {
105
+ content: renderContent(),
106
+ trigger: "click",
107
+ overlayClassName: type === 'tag' ? 'metadata-tag-popover' : 'metadata-table-popover',
108
+ overlayStyle: {
109
+ width: datasource.length === 0 ? 200 : 'auto'
110
+ },
111
+ placement: placement !== null && placement !== void 0 ? placement : 'bottom'
112
+ }, /*#__PURE__*/React.createElement(Button, {
113
+ type: "text",
114
+ size: "small",
115
+ className: "hc-metadata-count",
116
+ onClick: function onClick(e) {
117
+ e.stopPropagation();
118
+ }
119
+ }, /*#__PURE__*/React.createElement("span", null, displayCount))));
120
+ };
121
+ export default DataCountPopover;
@@ -0,0 +1,62 @@
1
+ .data-count-popover-wrap {
2
+ display: flex;
3
+ align-items: center;
4
+ min-height: 24px;
5
+ .count-icon {
6
+ font-size: 16px;
7
+ }
8
+ button.ant-btn {
9
+ margin-left: 4px;
10
+ padding: 1.6px 3px;
11
+ &.ant-popover-open,
12
+ &:active {
13
+ color: #2869f6;
14
+ background: rgba(40, 105, 246, 0.1);
15
+ & > span {
16
+ color: #2869f6;
17
+ &::after {
18
+ color: #2869f6;
19
+ }
20
+ }
21
+ }
22
+ &.ant-btn-icon-only {
23
+ display: none;
24
+ font-size: 16px;
25
+ line-height: 16px;
26
+ &.ant-btn-sm > * {
27
+ font-size: 16px;
28
+ }
29
+ }
30
+ }
31
+ &:hover,
32
+ &:focus {
33
+ button.ant-btn.ant-btn-icon-only {
34
+ display: block;
35
+ }
36
+ }
37
+ }
38
+
39
+ .metadata-tag-popover {
40
+ .ant-popover-inner-content {
41
+ padding: 8px;
42
+ }
43
+ .tag-list-wrapper {
44
+ display: flex;
45
+ flex-wrap: wrap;
46
+ gap: 8px;
47
+ max-width: 330px;
48
+ max-height: 250px;
49
+ overflow-y: auto;
50
+
51
+ .data-count-tag {
52
+ margin-right: 0;
53
+ padding: 0 7px;
54
+ color: rgba(0, 0, 0, 0.65);
55
+ font-size: 12px;
56
+ line-height: 20px;
57
+ background: #f0f2f5;
58
+ border: 1px solid #d9d9d9;
59
+ border-radius: 2px;
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,38 @@
1
+ import type { Dayjs } from 'dayjs';
2
+ import React from 'react';
3
+ import 'rc-calendar/assets/index.css';
4
+ import 'rc-time-picker/assets/index.css';
5
+ import './index.less';
6
+ export interface TimeRangeInfo {
7
+ inputValue: string;
8
+ from: string;
9
+ to: string;
10
+ diff: number;
11
+ sliderValue: number | null;
12
+ interval?: number;
13
+ timeUnitId?: number;
14
+ id?: number;
15
+ }
16
+ export interface QuickTimeOption {
17
+ id: number;
18
+ value: number;
19
+ label: string;
20
+ diff: number;
21
+ interval?: number;
22
+ timeUnitId?: number;
23
+ }
24
+ export interface DateRangePickerProps {
25
+ onChange?: (timeInfo: TimeRangeInfo) => void;
26
+ value?: TimeRangeInfo;
27
+ format?: string;
28
+ placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
29
+ quickTimeOptions?: QuickTimeOption[];
30
+ disabledDate?: (current: Dayjs | null, options: {
31
+ from: Dayjs[];
32
+ }) => boolean;
33
+ width?: number | string;
34
+ disabled?: boolean;
35
+ flat?: boolean;
36
+ }
37
+ declare const DateRangePicker: React.FC<DateRangePickerProps>;
38
+ export default DateRangePicker;