@gpustack/core-ui 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 (266) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/invert-worker-CFNPVgCi.js +1 -0
  3. package/dist/assets/json-parser-worker-DtJw0BTZ.js +1 -0
  4. package/dist/assets/offscreen-worker-DL5yJmAw.js +1 -0
  5. package/dist/assets/parse-worker-Dzai8qsE.js +5 -0
  6. package/dist/favicon.ico +0 -0
  7. package/dist/index.cjs.js +2613 -0
  8. package/dist/index.css +1 -0
  9. package/dist/index.es.js +179547 -0
  10. package/dist/monaco-editor-CHfVLkob.js +103874 -0
  11. package/dist/monaco-editor-Df8eM8W1.js +802 -0
  12. package/dist/monaco-editor.css +1 -0
  13. package/dist/rolldown-runtime-BETGA6I9.js +23 -0
  14. package/dist/rolldown-runtime-D_0Db6FZ.js +1 -0
  15. package/dist/src/index.d.ts +1 -0
  16. package/dist/src/lib/components/alert-info/block.d.ts +16 -0
  17. package/dist/src/lib/components/alert-info/index.d.ts +11 -0
  18. package/dist/src/lib/components/audio-animation/index.d.ts +16 -0
  19. package/dist/src/lib/components/audio-player/audio-element.d.ts +3 -0
  20. package/dist/src/lib/components/audio-player/config/type.d.ts +25 -0
  21. package/dist/src/lib/components/audio-player/index.d.ts +14 -0
  22. package/dist/src/lib/components/audio-player/raw-audio-player.d.ts +4 -0
  23. package/dist/src/lib/components/audio-player/simple-audio.d.ts +16 -0
  24. package/dist/src/lib/components/auto-image/index.d.ts +10 -0
  25. package/dist/src/lib/components/auto-image/single-image.d.ts +26 -0
  26. package/dist/src/lib/components/auto-tooltip/index.d.ts +18 -0
  27. package/dist/src/lib/components/auto-tooltip/title-tip.d.ts +9 -0
  28. package/dist/src/lib/components/bibtex-viewer/index.d.ts +5 -0
  29. package/dist/src/lib/components/card-wrapper/index.d.ts +2 -0
  30. package/dist/src/lib/components/card-wrapper/simple-card.d.ts +20 -0
  31. package/dist/src/lib/components/check-buttons/index.d.ts +10 -0
  32. package/dist/src/lib/components/collapse-container/headless-collapse.d.ts +9 -0
  33. package/dist/src/lib/components/collapse-container/index.d.ts +24 -0
  34. package/dist/src/lib/components/collapse-panel/index.d.ts +11 -0
  35. package/dist/src/lib/components/column-settings/index.d.ts +21 -0
  36. package/dist/src/lib/components/column-wrapper/index.d.ts +13 -0
  37. package/dist/src/lib/components/column-wrapper/use-wrapper-context.d.ts +17 -0
  38. package/dist/src/lib/components/command-viewer/index.d.ts +14 -0
  39. package/dist/src/lib/components/content-wrapper/index.d.ts +8 -0
  40. package/dist/src/lib/components/copy-button/index.d.ts +15 -0
  41. package/dist/src/lib/components/delete-modal/index.d.ts +2 -0
  42. package/dist/src/lib/components/divider-line/index.d.ts +2 -0
  43. package/dist/src/lib/components/doc-link/index.d.ts +6 -0
  44. package/dist/src/lib/components/drop-down-actions/index.d.ts +4 -0
  45. package/dist/src/lib/components/drop-down-buttons/index.d.ts +18 -0
  46. package/dist/src/lib/components/dynamic-form/components/field-item.d.ts +9 -0
  47. package/dist/src/lib/components/dynamic-form/components/form-widget.d.ts +6 -0
  48. package/dist/src/lib/components/dynamic-form/components/list-map.d.ts +17 -0
  49. package/dist/src/lib/components/dynamic-form/config/types.d.ts +39 -0
  50. package/dist/src/lib/components/dynamic-form/hooks/use-parse-fields.d.ts +7 -0
  51. package/dist/src/lib/components/dynamic-form/hooks/use-validate-fields.d.ts +10 -0
  52. package/dist/src/lib/components/dynamic-form/index.d.ts +8 -0
  53. package/dist/src/lib/components/echarts/bar-chart.d.ts +4 -0
  54. package/dist/src/lib/components/echarts/chart-tooltip.d.ts +7 -0
  55. package/dist/src/lib/components/echarts/chart.d.ts +10 -0
  56. package/dist/src/lib/components/echarts/config.d.ts +178 -0
  57. package/dist/src/lib/components/echarts/gauge.d.ts +4 -0
  58. package/dist/src/lib/components/echarts/h-bar.d.ts +6 -0
  59. package/dist/src/lib/components/echarts/index.d.ts +7 -0
  60. package/dist/src/lib/components/echarts/line-chart.d.ts +4 -0
  61. package/dist/src/lib/components/echarts/mix-line-bar.d.ts +9 -0
  62. package/dist/src/lib/components/echarts/scatter.d.ts +7 -0
  63. package/dist/src/lib/components/echarts/types.d.ts +44 -0
  64. package/dist/src/lib/components/editor-wrap/index.d.ts +14 -0
  65. package/dist/src/lib/components/empty-data/index.d.ts +6 -0
  66. package/dist/src/lib/components/error-message-content/index.d.ts +4 -0
  67. package/dist/src/lib/components/filter-form/index.d.ts +17 -0
  68. package/dist/src/lib/components/footer/index.d.ts +6 -0
  69. package/dist/src/lib/components/form/auto-complete.d.ts +9 -0
  70. package/dist/src/lib/components/form/base/select.d.ts +7 -0
  71. package/dist/src/lib/components/form/cascader.d.ts +10 -0
  72. package/dist/src/lib/components/form/checkbox-field.d.ts +10 -0
  73. package/dist/src/lib/components/form/checkbox.d.ts +7 -0
  74. package/dist/src/lib/components/form/components/label-info.d.ts +9 -0
  75. package/dist/src/lib/components/form/components/not-found-content.d.ts +7 -0
  76. package/dist/src/lib/components/form/config/components.d.ts +17 -0
  77. package/dist/src/lib/components/form/config/index.d.ts +7 -0
  78. package/dist/src/lib/components/form/field-component.d.ts +4 -0
  79. package/dist/src/lib/components/form/hooks/use-select-render.d.ts +11 -0
  80. package/dist/src/lib/components/form/input-number.d.ts +5 -0
  81. package/dist/src/lib/components/form/input-search.d.ts +5 -0
  82. package/dist/src/lib/components/form/input.d.ts +7 -0
  83. package/dist/src/lib/components/form/multiple-select.d.ts +7 -0
  84. package/dist/src/lib/components/form/password.d.ts +6 -0
  85. package/dist/src/lib/components/form/row-textarea.d.ts +36 -0
  86. package/dist/src/lib/components/form/select.d.ts +8 -0
  87. package/dist/src/lib/components/form/simple-select.d.ts +7 -0
  88. package/dist/src/lib/components/form/slider.d.ts +13 -0
  89. package/dist/src/lib/components/form/switch-input.d.ts +15 -0
  90. package/dist/src/lib/components/form/switch.d.ts +12 -0
  91. package/dist/src/lib/components/form/textarea.d.ts +9 -0
  92. package/dist/src/lib/components/form/types.d.ts +14 -0
  93. package/dist/src/lib/components/form/wrapper/auto-complete-label.d.ts +2 -0
  94. package/dist/src/lib/components/form/wrapper/index.d.ts +32 -0
  95. package/dist/src/lib/components/form/wrapper/input.d.ts +2 -0
  96. package/dist/src/lib/components/form/wrapper/select.d.ts +2 -0
  97. package/dist/src/lib/components/form/wrapper/slider.d.ts +2 -0
  98. package/dist/src/lib/components/form-buttons/index.d.ts +11 -0
  99. package/dist/src/lib/components/form-drawer/index.d.ts +13 -0
  100. package/dist/src/lib/components/grafana-icon/index.d.ts +6 -0
  101. package/dist/src/lib/components/highlight-code/code-viewer-dark.d.ts +13 -0
  102. package/dist/src/lib/components/highlight-code/code-viewer-light.d.ts +13 -0
  103. package/dist/src/lib/components/highlight-code/code-viewer.d.ts +14 -0
  104. package/dist/src/lib/components/highlight-code/index.d.ts +13 -0
  105. package/dist/src/lib/components/highlight-code/utils.d.ts +1 -0
  106. package/dist/src/lib/components/icon-font/icons.d.ts +153 -0
  107. package/dist/src/lib/components/icon-font/index.d.ts +7 -0
  108. package/dist/src/lib/components/image-editor/extract-image-colors.d.ts +10 -0
  109. package/dist/src/lib/components/image-editor/hooks/use-drawing.d.ts +66 -0
  110. package/dist/src/lib/components/image-editor/hooks/use-zoom.d.ts +21 -0
  111. package/dist/src/lib/components/image-editor/index.d.ts +30 -0
  112. package/dist/src/lib/components/image-editor/invert-worker.d.ts +1 -0
  113. package/dist/src/lib/components/image-editor/offscreen-worker.d.ts +1 -0
  114. package/dist/src/lib/components/image-editor/tools-bar.d.ts +28 -0
  115. package/dist/src/lib/components/index.d.ts +127 -0
  116. package/dist/src/lib/components/infinite-scroller/index.d.ts +6 -0
  117. package/dist/src/lib/components/infinite-scroller/infinite-scroller-provider.d.ts +7 -0
  118. package/dist/src/lib/components/infinite-scroller/use-infinite-scroll.d.ts +12 -0
  119. package/dist/src/lib/components/infinite-scroller/use-scroller-context.d.ts +10 -0
  120. package/dist/src/lib/components/label-cell/index.d.ts +6 -0
  121. package/dist/src/lib/components/label-selector/autocomplete-item.d.ts +27 -0
  122. package/dist/src/lib/components/label-selector/context.d.ts +15 -0
  123. package/dist/src/lib/components/label-selector/index.d.ts +15 -0
  124. package/dist/src/lib/components/label-selector/inner.d.ts +23 -0
  125. package/dist/src/lib/components/label-selector/label-item.d.ts +26 -0
  126. package/dist/src/lib/components/label-selector/label-selector-provider.d.ts +6 -0
  127. package/dist/src/lib/components/label-selector/wrapper.d.ts +17 -0
  128. package/dist/src/lib/components/list-input/hint-input.d.ts +13 -0
  129. package/dist/src/lib/components/list-input/index.d.ts +25 -0
  130. package/dist/src/lib/components/list-input/list-item.d.ts +21 -0
  131. package/dist/src/lib/components/logs-viewer/config.d.ts +4 -0
  132. package/dist/src/lib/components/logs-viewer/index.d.ts +14 -0
  133. package/dist/src/lib/components/logs-viewer/logs-list.d.ts +14 -0
  134. package/dist/src/lib/components/logs-viewer/logs-pagination.d.ts +12 -0
  135. package/dist/src/lib/components/logs-viewer/parse-worker.d.ts +1 -0
  136. package/dist/src/lib/components/logs-viewer/use-logs-pagination.d.ts +11 -0
  137. package/dist/src/lib/components/logs-viewer/use-size.d.ts +5 -0
  138. package/dist/src/lib/components/logs-viewer/xterm-viewer.d.ts +9 -0
  139. package/dist/src/lib/components/markdown-viewer/full-markdown.d.ts +7 -0
  140. package/dist/src/lib/components/markdown-viewer/index.d.ts +9 -0
  141. package/dist/src/lib/components/markdown-viewer/utils.d.ts +4 -0
  142. package/dist/src/lib/components/metadata-list/index.d.ts +16 -0
  143. package/dist/src/lib/components/modal-footer/index.d.ts +22 -0
  144. package/dist/src/lib/components/more-button/index.d.ts +8 -0
  145. package/dist/src/lib/components/no-result/index.d.ts +14 -0
  146. package/dist/src/lib/components/overlay-scroller/index.d.ts +26 -0
  147. package/dist/src/lib/components/page-breadcrumb/index.d.ts +4 -0
  148. package/dist/src/lib/components/page-tools/index.d.ts +56 -0
  149. package/dist/src/lib/components/popover/index.d.ts +3 -0
  150. package/dist/src/lib/components/progress-bar/index.d.ts +11 -0
  151. package/dist/src/lib/components/radio-buttons/index.d.ts +12 -0
  152. package/dist/src/lib/components/resize-container/index.d.ts +8 -0
  153. package/dist/src/lib/components/scroll-spy-tabs/index.d.ts +36 -0
  154. package/dist/src/lib/components/scroll-spy-tabs/use-field-scroll.d.ts +27 -0
  155. package/dist/src/lib/components/scroll-spy-tabs/use-finish-failed.d.ts +14 -0
  156. package/dist/src/lib/components/scroll-spy-tabs/use-scroll-active-change.d.ts +12 -0
  157. package/dist/src/lib/components/scroller-modal/gs-drawer.d.ts +9 -0
  158. package/dist/src/lib/components/scroller-modal/index.d.ts +5 -0
  159. package/dist/src/lib/components/scroller-modal/use-scroller-context.d.ts +6 -0
  160. package/dist/src/lib/components/segment-line/index.d.ts +9 -0
  161. package/dist/src/lib/components/select-panel/index.d.ts +15 -0
  162. package/dist/src/lib/components/select-panel/list.d.ts +16 -0
  163. package/dist/src/lib/components/select-panel/selected-list.d.ts +14 -0
  164. package/dist/src/lib/components/shortcut/index.d.ts +17 -0
  165. package/dist/src/lib/components/shortcut/keymap.d.ts +6 -0
  166. package/dist/src/lib/components/simple-overlay/index.d.ts +10 -0
  167. package/dist/src/lib/components/simple-table/header.d.ts +9 -0
  168. package/dist/src/lib/components/simple-table/index.d.ts +39 -0
  169. package/dist/src/lib/components/simple-table/info-column.d.ts +13 -0
  170. package/dist/src/lib/components/simple-table/row.d.ts +8 -0
  171. package/dist/src/lib/components/small-close-button/index.d.ts +5 -0
  172. package/dist/src/lib/components/speech-content/audio-player.d.ts +19 -0
  173. package/dist/src/lib/components/speech-content/index.d.ts +16 -0
  174. package/dist/src/lib/components/speech-content/speech-item.d.ts +20 -0
  175. package/dist/src/lib/components/status-icon/error.d.ts +4 -0
  176. package/dist/src/lib/components/status-tag/index.d.ts +33 -0
  177. package/dist/src/lib/components/table/components/cell-content.d.ts +4 -0
  178. package/dist/src/lib/components/table/components/header-prefix.d.ts +14 -0
  179. package/dist/src/lib/components/table/components/header.d.ts +11 -0
  180. package/dist/src/lib/components/table/components/layout.d.ts +21 -0
  181. package/dist/src/lib/components/table/components/pagination.d.ts +3 -0
  182. package/dist/src/lib/components/table/components/row-children.d.ts +2 -0
  183. package/dist/src/lib/components/table/components/row-prefix.d.ts +12 -0
  184. package/dist/src/lib/components/table/components/table-body.d.ts +21 -0
  185. package/dist/src/lib/components/table/components/table-cell.d.ts +4 -0
  186. package/dist/src/lib/components/table/components/table-header.d.ts +4 -0
  187. package/dist/src/lib/components/table/components/table-row.d.ts +4 -0
  188. package/dist/src/lib/components/table/components/table-skeleton.d.ts +3 -0
  189. package/dist/src/lib/components/table/index.d.ts +7 -0
  190. package/dist/src/lib/components/table/row-context.d.ts +11 -0
  191. package/dist/src/lib/components/table/table-context.d.ts +3 -0
  192. package/dist/src/lib/components/table/table-provider.d.ts +9 -0
  193. package/dist/src/lib/components/table/table-row-provider.d.ts +6 -0
  194. package/dist/src/lib/components/table/types.d.ts +106 -0
  195. package/dist/src/lib/components/table/use-sorter.d.ts +11 -0
  196. package/dist/src/lib/components/tags-wrapper/index.d.ts +8 -0
  197. package/dist/src/lib/components/tags-wrapper/more-dropdown.d.ts +6 -0
  198. package/dist/src/lib/components/tags-wrapper/theme-tag.d.ts +6 -0
  199. package/dist/src/lib/components/templates/card-list.d.ts +12 -0
  200. package/dist/src/lib/components/templates/card-skeleton.d.ts +7 -0
  201. package/dist/src/lib/components/templates/card.d.ts +17 -0
  202. package/dist/src/lib/components/terminal-tabs/index.d.ts +11 -0
  203. package/dist/src/lib/components/terminal-tabs/resize-container.d.ts +15 -0
  204. package/dist/src/lib/components/terminal-tabs/tabs.d.ts +9 -0
  205. package/dist/src/lib/components/terminal-tabs/types.d.ts +4 -0
  206. package/dist/src/lib/components/thumb-image/index.d.ts +20 -0
  207. package/dist/src/lib/components/tooltip-list/index.d.ts +9 -0
  208. package/dist/src/lib/components/transfer/index.d.ts +14 -0
  209. package/dist/src/lib/components/transition/index.d.ts +10 -0
  210. package/dist/src/lib/components/upload-audio/index.d.ts +16 -0
  211. package/dist/src/lib/components/upload-image/index.d.ts +20 -0
  212. package/dist/src/lib/components/viewer-editor/index.d.ts +15 -0
  213. package/dist/src/lib/components/x-terminal/index.d.ts +8 -0
  214. package/dist/src/lib/components/yaml-editor/editor.d.ts +15 -0
  215. package/dist/src/lib/components/yaml-editor/index.d.ts +17 -0
  216. package/dist/src/lib/config/hotkeys.d.ts +40 -0
  217. package/dist/src/lib/config/index.d.ts +20 -0
  218. package/dist/src/lib/constants/index.d.ts +6 -0
  219. package/dist/src/lib/context/CoreUIContext.d.ts +83 -0
  220. package/dist/src/lib/context/CoreUIProvider.d.ts +4 -0
  221. package/dist/src/lib/hooks/index.d.ts +23 -0
  222. package/dist/src/lib/hooks/json-parser-worker.d.ts +1 -0
  223. package/dist/src/lib/hooks/use-actions.d.ts +11 -0
  224. package/dist/src/lib/hooks/use-add-image.d.ts +15 -0
  225. package/dist/src/lib/hooks/use-app-utils.d.ts +6 -0
  226. package/dist/src/lib/hooks/use-body-scroll.d.ts +5 -0
  227. package/dist/src/lib/hooks/use-chunk-fetch.d.ts +20 -0
  228. package/dist/src/lib/hooks/use-chunk-request.d.ts +20 -0
  229. package/dist/src/lib/hooks/use-container-scroll.d.ts +7 -0
  230. package/dist/src/lib/hooks/use-deferred-request.d.ts +1 -0
  231. package/dist/src/lib/hooks/use-download-logs.d.ts +8 -0
  232. package/dist/src/lib/hooks/use-download-stream.d.ts +12 -0
  233. package/dist/src/lib/hooks/use-esc-hint.d.ts +7 -0
  234. package/dist/src/lib/hooks/use-expanded-row-keys.d.ts +10 -0
  235. package/dist/src/lib/hooks/use-overlay-scroller.d.ts +45 -0
  236. package/dist/src/lib/hooks/use-query-data-list.d.ts +35 -0
  237. package/dist/src/lib/hooks/use-request-token.d.ts +13 -0
  238. package/dist/src/lib/hooks/use-responsive.d.ts +10 -0
  239. package/dist/src/lib/hooks/use-stream-core/buffer-queue.d.ts +8 -0
  240. package/dist/src/lib/hooks/use-stream-core/fetch-stream.d.ts +1 -0
  241. package/dist/src/lib/hooks/use-stream-core/speed-monitor.d.ts +8 -0
  242. package/dist/src/lib/hooks/use-stream-core/stream-processor.d.ts +18 -0
  243. package/dist/src/lib/hooks/use-stream-core/use-chunk-fetch.d.ts +7 -0
  244. package/dist/src/lib/hooks/use-table-row-selection.d.ts +12 -0
  245. package/dist/src/lib/hooks/use-table-sort.d.ts +17 -0
  246. package/dist/src/lib/hooks/use-update-chunk-list.d.ts +26 -0
  247. package/dist/src/lib/hooks/use-watch-list.d.ts +4 -0
  248. package/dist/src/lib/hooks/use-window-resize.d.ts +10 -0
  249. package/dist/src/lib/hooks/useCoreUIContext.d.ts +2 -0
  250. package/dist/src/lib/hooks/useIntl.d.ts +7 -0
  251. package/dist/src/lib/index.d.ts +6 -0
  252. package/dist/src/lib/types/index.d.ts +40 -0
  253. package/dist/src/lib/types/table-fetch.d.ts +71 -0
  254. package/dist/src/lib/utils/download-stream.d.ts +1 -0
  255. package/dist/src/lib/utils/epub-reader.d.ts +1 -0
  256. package/dist/src/lib/utils/excel-reader.d.ts +19 -0
  257. package/dist/src/lib/utils/fetch-chunk-data.d.ts +55 -0
  258. package/dist/src/lib/utils/index.d.ts +52 -0
  259. package/dist/src/lib/utils/load-audio-file.d.ts +14 -0
  260. package/dist/src/lib/utils/pcm-to-wav.d.ts +9 -0
  261. package/dist/src/lib/utils/pdf-reader.d.ts +2 -0
  262. package/dist/src/lib/utils/pptx-reader.d.ts +2 -0
  263. package/dist/src/lib/utils/read-html.d.ts +1 -0
  264. package/dist/src/lib/utils/watch-request.d.ts +18 -0
  265. package/dist/src/lib/utils/word-reader.d.ts +1 -0
  266. package/package.json +138 -0
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ interface XTerminalProps {
3
+ height: number;
4
+ url: string;
5
+ theme?: 'light' | 'dark' | 'realDark';
6
+ }
7
+ declare const XTerminal: React.FC<XTerminalProps>;
8
+ export default XTerminal;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ interface ViewerProps {
3
+ ref?: any;
4
+ defaultLang?: string;
5
+ config?: any;
6
+ value: string;
7
+ height?: string | number;
8
+ theme?: string;
9
+ header?: React.ReactNode;
10
+ placeholder?: string;
11
+ variant?: 'bordered' | 'borderless';
12
+ schema?: any;
13
+ }
14
+ declare const EditorInner: React.FC<ViewerProps>;
15
+ export default EditorInner;
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ interface ViewerProps {
3
+ ref?: any;
4
+ title?: React.ReactNode;
5
+ defaultLang?: string;
6
+ config?: any;
7
+ value: string;
8
+ height?: string | number;
9
+ placeholder?: string;
10
+ variant?: 'bordered' | 'borderless';
11
+ validateMessage?: React.ReactNode;
12
+ schema?: any;
13
+ isDarkTheme?: boolean;
14
+ onUpload?: (content: string) => void;
15
+ }
16
+ declare const YamlEditor: React.FC<ViewerProps>;
17
+ export default YamlEditor;
@@ -0,0 +1,40 @@
1
+ declare const KeybindingsMap: {
2
+ CREATE: string[];
3
+ CLEAR: string[];
4
+ RIGHT: string[];
5
+ SAVE: string[];
6
+ SUBMIT: string[];
7
+ ENTER: string[];
8
+ SHIFT: string[];
9
+ CTRL: string[];
10
+ OPTION: string[];
11
+ SAVEAS: string[];
12
+ OPEN: string[];
13
+ UNDO: string[];
14
+ CANCEL: string[];
15
+ DELETE: string[];
16
+ COPY: string[];
17
+ REFRESH: string[];
18
+ EDIT: string[];
19
+ SEARCH: string[];
20
+ RESET: string[];
21
+ INPUT: string[];
22
+ NEW1: string[];
23
+ NEW2: string[];
24
+ NEW3: string[];
25
+ NEW4: string[];
26
+ FOCUS: string[];
27
+ ADD: string[];
28
+ ESC: string[];
29
+ };
30
+ type KeyBindingType = keyof typeof KeybindingsMap;
31
+ type KeybindingValue = {
32
+ keybinding: string;
33
+ command: KeyBindingType;
34
+ textKeybinding: string;
35
+ iconKeybinding: string;
36
+ };
37
+ declare const KeybiningList: KeybindingValue[];
38
+ declare const KeyMap: Record<KeyBindingType, KeybindingValue>;
39
+ export { KeybiningList, KeyMap };
40
+ export default KeybindingsMap;
@@ -0,0 +1,20 @@
1
+ import { StatusType } from '../types';
2
+ export declare const breakpoints: {
3
+ xs: number;
4
+ sm: number;
5
+ md: number;
6
+ lg: number;
7
+ xl: number;
8
+ xxl: number;
9
+ };
10
+ export declare const WatchEventType: {
11
+ CREATE: number;
12
+ UPDATE: number;
13
+ DELETE: number;
14
+ };
15
+ export declare const StatusColorMap: Record<StatusType, {
16
+ text: string;
17
+ bg: string;
18
+ border?: string;
19
+ }>;
20
+ export declare const StatusMaps: Record<string, StatusType>;
@@ -0,0 +1,6 @@
1
+ export declare const INPUT_WIDTH: {
2
+ default: number;
3
+ large: number;
4
+ small: number;
5
+ mini: number;
6
+ };
@@ -0,0 +1,83 @@
1
+ import { CancelTokenSource } from 'axios';
2
+ import { TableFetchType } from '../types/table-fetch';
3
+ export interface CoreUIConfig {
4
+ apiBaseUrl: string;
5
+ iconUrl?: string;
6
+ theme?: 'light' | 'realDark' | 'dark';
7
+ isDarkTheme?: boolean;
8
+ defaultColorPrimary?: string;
9
+ }
10
+ export interface CoreUII18n {
11
+ formatMessage: (descriptor: {
12
+ id: string;
13
+ }, values?: any) => string;
14
+ }
15
+ export interface CoreUILocale {
16
+ getAllLocales: () => string[];
17
+ setLocale: (locale: string, reload?: boolean) => void;
18
+ }
19
+ export interface RequestOptions {
20
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
21
+ params?: Record<string, any>;
22
+ data?: any;
23
+ skipErrorHandler?: boolean;
24
+ getResponse?: boolean;
25
+ cancelToken?: CancelTokenSource;
26
+ headers?: Record<string, string>;
27
+ onDownloadProgress?: (progressEvent: any) => void;
28
+ }
29
+ export interface RequestService {
30
+ <T = any>(url: string, options?: RequestOptions): Promise<T>;
31
+ }
32
+ export interface Services {
33
+ request: RequestService;
34
+ router?: {
35
+ push: (path: string) => void;
36
+ replace: (path: string) => void;
37
+ goBack: () => void;
38
+ };
39
+ }
40
+ export interface CoreHooks {
41
+ useIntl: () => CoreUII18n;
42
+ usePaginationStatus?: (key: string) => {
43
+ pagination: any;
44
+ getPaginationStatus: () => any;
45
+ setPagination: (pagination: any) => void;
46
+ getPagination: () => any;
47
+ clearPagination: () => void;
48
+ };
49
+ useTabActive?: () => {
50
+ setTabActive: (tabKey: string, value: any) => void;
51
+ getTabActive: (tabKey: string) => any;
52
+ tabsMap: Record<string, string>;
53
+ };
54
+ useTableFetch?: TableFetchType;
55
+ useUserSettings?: () => {
56
+ userSettings: any;
57
+ setUserSettings: any;
58
+ setTheme: (mode: string) => void;
59
+ isDarkTheme: boolean;
60
+ themeData: any;
61
+ componentSize: string;
62
+ };
63
+ useUserSettingsStorage?: () => {
64
+ setStorageUserSettings: (value: Record<string, any>) => void;
65
+ getStorageUserSettings: () => any;
66
+ };
67
+ }
68
+ export interface CoreUIContextProps {
69
+ config: CoreUIConfig;
70
+ tokens?: Record<string, string>;
71
+ i18n: CoreUII18n;
72
+ locale: CoreUILocale;
73
+ services: Services;
74
+ hooks: CoreHooks;
75
+ localStore?: {
76
+ readColumnSettings: (key: string) => string[] | null;
77
+ readState: (key: string) => void;
78
+ writeColumnSettings: (key: string, value: any) => void;
79
+ writeState: (key: string, value: any) => void;
80
+ };
81
+ }
82
+ declare const CoreUIContext: import('react').Context<CoreUIContextProps>;
83
+ export default CoreUIContext;
@@ -0,0 +1,4 @@
1
+ import { CoreUIContextProps } from './CoreUIContext';
2
+ export declare const CoreUIProvider: React.FC<CoreUIContextProps & {
3
+ children: React.ReactNode;
4
+ }>;
@@ -0,0 +1,23 @@
1
+ export { default as useActions } from './use-actions';
2
+ export { default as useAddImage } from './use-add-image';
3
+ export { default as useAppUtils } from './use-app-utils';
4
+ export { default as useBodyScroll } from './use-body-scroll';
5
+ export { default as useChunkFetch } from './use-chunk-fetch';
6
+ export type { HandlerOptions } from './use-chunk-fetch';
7
+ export { default as useChunkRequest } from './use-chunk-request';
8
+ export { default as useContainerScroll } from './use-container-scroll';
9
+ export { default as useDeferredRequest } from './use-deferred-request';
10
+ export { default as useDownloadLogs } from './use-download-logs';
11
+ export { default as useDownloadStream } from './use-download-stream';
12
+ export { default as useExpandedRowKeys } from './use-expanded-row-keys';
13
+ export { default as useOverlayScroller } from './use-overlay-scroller';
14
+ export { useQueryData, useQueryDataList } from './use-query-data-list';
15
+ export { default as useRequestToken } from './use-request-token';
16
+ export { default as useResponsive } from './use-responsive';
17
+ export { default as useTableRowSelection } from './use-table-row-selection';
18
+ export { useTableMultiSort, default as useTableSort } from './use-table-sort';
19
+ export { default as useUpdateChunkedList } from './use-update-chunk-list';
20
+ export { default as useWatchList } from './use-watch-list';
21
+ export { default as useWindowResize } from './use-window-resize';
22
+ export { default as useCoreUIContext } from './useCoreUIContext';
23
+ export { default as useIntl } from './useIntl';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ export default function useActions<T>(actions: Global.ActionItem<T>[], ctx: T): {
2
+ disabled: boolean | undefined;
3
+ label: string;
4
+ key: string;
5
+ icon: React.ReactNode;
6
+ locale?: boolean;
7
+ props?: {
8
+ danger?: boolean;
9
+ };
10
+ visible?: ((record: T) => boolean) | undefined;
11
+ }[];
@@ -0,0 +1,15 @@
1
+ declare const useAddImage: (options: {
2
+ size?: "small" | "middle" | "large";
3
+ inputProps?: Record<string, any>;
4
+ handleUpdateImgList: (list: {
5
+ uid: number | string;
6
+ dataUrl: string;
7
+ }[]) => void;
8
+ updateUidCount: () => number | string;
9
+ }) => {
10
+ isFromUrl: boolean;
11
+ ImageURLInput: import("react/jsx-runtime").JSX.Element | null;
12
+ dropDownOpen: boolean;
13
+ UploadImageButton: import("react/jsx-runtime").JSX.Element;
14
+ };
15
+ export default useAddImage;
@@ -0,0 +1,6 @@
1
+ type MessageType = 'input' | 'select';
2
+ declare const useAppUtils: () => {
3
+ getRuleMessage: (type: MessageType | MessageType[], name: string, locale?: boolean) => string;
4
+ showSuccess: (msg?: string) => void;
5
+ };
6
+ export default useAppUtils;
@@ -0,0 +1,5 @@
1
+ export default function useBodyScroll(): {
2
+ saveScrollHeight: () => void;
3
+ restoreScrollHeight: () => void;
4
+ bodyScroller: any;
5
+ };
@@ -0,0 +1,20 @@
1
+ export interface HandlerOptions {
2
+ isComplete?: boolean | null;
3
+ percent?: number;
4
+ progress?: number;
5
+ contentLength?: number | null;
6
+ }
7
+ type HandlerFunction = (data: any, options?: HandlerOptions) => any;
8
+ interface RequestConfig {
9
+ url: string;
10
+ handler: HandlerFunction;
11
+ errorHandler?: (error: any) => void;
12
+ beforeReconnect?: () => void;
13
+ params?: object;
14
+ watch?: boolean;
15
+ contentType?: 'json' | 'text';
16
+ }
17
+ declare const useSetChunkFetch: () => {
18
+ setChunkFetch: (this: unknown, config: RequestConfig) => import('react').MutableRefObject<any>;
19
+ };
20
+ export default useSetChunkFetch;
@@ -0,0 +1,20 @@
1
+ import { CancelTokenSource } from 'axios';
2
+ interface RequestConfig {
3
+ url: string;
4
+ handler: (data: any) => any;
5
+ beforeReconnect?: () => void;
6
+ params?: object;
7
+ contentType?: 'json' | 'text';
8
+ }
9
+ export declare const sliceJsonStr: (text: string) => string[];
10
+ export declare const createAxiosToken: () => CancelTokenSource;
11
+ export declare const sliceData: (data: string, loaded: number, loadedSize: any) => string;
12
+ declare const useSetChunkRequest: () => {
13
+ setChunkRequest: (config: RequestConfig) => import('react').MutableRefObject<any>;
14
+ createAxiosToken: () => {
15
+ id: number;
16
+ token: import('axios').CancelToken;
17
+ cancel(): void;
18
+ };
19
+ };
20
+ export default useSetChunkRequest;
@@ -0,0 +1,7 @@
1
+ export default function useContainerScroll(container: any, options?: {
2
+ toBottom?: boolean;
3
+ }): {
4
+ handleContentWheel: (e: any) => void;
5
+ updateScrollerPosition: () => void;
6
+ scroller: import('react').MutableRefObject<any>;
7
+ };
@@ -0,0 +1 @@
1
+ export default function useDeferredRequest<P extends any[], R>(requestFn: (...args: P) => Promise<R>, delay?: number): import('ahooks/lib/useRequest/src/types').Result<R, P>;
@@ -0,0 +1,8 @@
1
+ declare const useDownloadLogs: () => {
2
+ onDownloadLog: (params: {
3
+ url: string;
4
+ name: string;
5
+ }) => Promise<void>;
6
+ contextHolder: import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
7
+ };
8
+ export default useDownloadLogs;
@@ -0,0 +1,12 @@
1
+ export default function useDownloadStream(): {
2
+ downloadStream: (props: {
3
+ data?: any;
4
+ url: string;
5
+ params?: any;
6
+ signal?: AbortSignal;
7
+ method?: string;
8
+ headers?: any;
9
+ filename?: string;
10
+ downloadNotification?: (data: any) => void;
11
+ }) => Promise<void>;
12
+ };
@@ -0,0 +1,7 @@
1
+ export declare function useEscHint(options?: {
2
+ enabled?: boolean;
3
+ message?: string;
4
+ throttleDelay?: number;
5
+ }): {
6
+ EscHint: import("react/jsx-runtime").JSX.Element | null;
7
+ };
@@ -0,0 +1,10 @@
1
+ export default function useExpandedRowKeys(defaultKeys?: React.Key[]): {
2
+ expandedRowKeys: import('react').Key[];
3
+ currentExpand: import('react').Key | null;
4
+ setCurrentExpand: import('react').Dispatch<import('react').SetStateAction<import('react').Key | null>>;
5
+ clearExpandedRowKeys: () => void;
6
+ updateExpandedRowKeys: (keys: React.Key[]) => void;
7
+ removeExpandedRowKey: (keys: React.Key[]) => void;
8
+ handleExpandChange: (expanded: boolean, record: any, rowKey: any) => void;
9
+ handleExpandAll: (expanded: boolean, keys?: React.Key[]) => void;
10
+ };
@@ -0,0 +1,45 @@
1
+ import { UseOverlayScrollbarsParams } from 'overlayscrollbars-react';
2
+ import { default as React } from 'react';
3
+ type OverflowBehavior = 'hidden' | 'scroll' | 'visible' | 'visible-hidden' | 'visible-scroll';
4
+ export interface OverlayScrollerOptions {
5
+ oppositeTheme?: boolean;
6
+ overflow?: {
7
+ x?: OverflowBehavior;
8
+ y?: OverflowBehavior;
9
+ };
10
+ scrollbars?: {
11
+ theme?: 'os-theme-light' | 'os-theme-dark';
12
+ autoHide?: 'never' | 'scroll' | 'leave' | 'move';
13
+ autoHideDelay?: number;
14
+ clickScroll?: boolean | 'instant';
15
+ };
16
+ }
17
+ export declare const overlaySollerOptions: UseOverlayScrollbarsParams;
18
+ /**
19
+ *
20
+ * @param options.theme: if set theme, it will fix the theme
21
+ * @returns
22
+ */
23
+ export default function useOverlayScroller(data?: {
24
+ options?: OverlayScrollerOptions;
25
+ events?: any;
26
+ defer?: boolean;
27
+ }): {
28
+ initialize: (this: unknown, el: any) => any;
29
+ instance: React.MutableRefObject<any>;
30
+ scrollEventElement: React.MutableRefObject<any>;
31
+ initialized: React.MutableRefObject<boolean>;
32
+ getScrollElementScrollableHeight: () => {
33
+ scrollTop: any;
34
+ scrollHeight: number;
35
+ };
36
+ getScrollElement: () => React.MutableRefObject<any>;
37
+ generateInstance: () => void;
38
+ destroyInstance: () => void;
39
+ updateScrollerPosition: (this: unknown, delay?: number | undefined) => void;
40
+ updateScrollerPositionToTop: (this: unknown) => void;
41
+ scrollToBottom: (this: unknown) => void;
42
+ scrollToTop: (this: unknown) => void;
43
+ scrollToTarget: (target: any, offset?: number) => void;
44
+ };
45
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+
3
+ * generic hook to query data list
4
+ * @template ListItem
5
+ * @param Params - query params type, e.g. { page: number; perPage: number }
6
+ * @param option.fetchList: (params, extra) => Promise<{ items: ListItem[] }>
7
+ * @returns loading, dataList, fetchData, cancelRequest
8
+ */
9
+ export declare function useQueryDataList<ListItem, Params = any>(option: {
10
+ key: string;
11
+ fetchList: (params: Params, options?: any) => Promise<Global.PageResponse<ListItem>>;
12
+ getLabel?: (item: ListItem) => string;
13
+ getValue?: (item: ListItem) => any;
14
+ errorMsg?: string;
15
+ }): {
16
+ loading: boolean;
17
+ dataList: Array<ListItem & {
18
+ label: string;
19
+ value: any;
20
+ }>;
21
+ cancelRequest: () => void;
22
+ fetchData: (params: Params, extra?: any) => Promise<ListItem[]>;
23
+ };
24
+ export declare function useQueryData<Detail, Params = any>(option: {
25
+ key: string;
26
+ delay?: number;
27
+ fetchDetail: (params: Params, options?: any) => Promise<Detail>;
28
+ getData?: (response: Detail, params?: any) => any;
29
+ errorMsg?: string;
30
+ }): {
31
+ loading: boolean;
32
+ detailData: Detail;
33
+ cancelRequest: () => void;
34
+ fetchData: (params: Params, extra?: any) => Promise<Detail>;
35
+ };
@@ -0,0 +1,13 @@
1
+ export default function useRequestToken(): () => import('axios').CancelTokenSource;
2
+ export declare function useCancelToken(): {
3
+ updateCancelToken: () => void;
4
+ cancelRequest: () => void;
5
+ getCanceltToken: () => any;
6
+ source: () => import('axios').CancelTokenSource;
7
+ };
8
+ export declare function useAbortController(): {
9
+ getController: () => AbortController;
10
+ updateController: () => void;
11
+ abortController: () => void;
12
+ controller: import('react').MutableRefObject<AbortController | null>;
13
+ };
@@ -0,0 +1,10 @@
1
+ declare const useResponsive: ({ defaultSpan }: {
2
+ defaultSpan?: number;
3
+ }) => {
4
+ span: number;
5
+ handleResize: (this: unknown, size: {
6
+ width: number;
7
+ height: number;
8
+ }) => void | undefined;
9
+ };
10
+ export default useResponsive;
@@ -0,0 +1,8 @@
1
+ export declare class BufferQueue<T = any> {
2
+ private queue;
3
+ private batchSize;
4
+ push(item: T): void;
5
+ drain(): T[];
6
+ size(): number;
7
+ clear(): void;
8
+ }
@@ -0,0 +1 @@
1
+ export declare function fetchStream(url: string, handler: (chunk: string, meta?: any) => void, signal?: AbortSignal): Promise<void>;
@@ -0,0 +1,8 @@
1
+ export declare class SpeedMonitor {
2
+ private lastTime;
3
+ private lastBytes;
4
+ private history;
5
+ private max;
6
+ update(totalBytes: number): void;
7
+ avg(): number;
8
+ }
@@ -0,0 +1,18 @@
1
+ export interface StreamMeta {
2
+ isComplete?: boolean;
3
+ progress?: number;
4
+ speed?: number;
5
+ }
6
+ type Handler = (data: string, meta?: StreamMeta) => void;
7
+ export declare class StreamProcessor {
8
+ private handler;
9
+ private buffer;
10
+ private speed;
11
+ private encoder;
12
+ private totalBytes;
13
+ private flushing;
14
+ constructor(handler: Handler);
15
+ push(chunk: string): void;
16
+ flush(done?: boolean): Promise<void>;
17
+ }
18
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface RequestConfig {
2
+ url: string;
3
+ handler: (data: any, meta?: any) => void;
4
+ }
5
+ export declare const useChunkFetch: () => {
6
+ run: (this: unknown, config: RequestConfig) => Promise<void>;
7
+ };
@@ -0,0 +1,12 @@
1
+ export default function useTableRowSelection(): {
2
+ selectedRowKeys: import('react').Key[];
3
+ selectedRows: any[];
4
+ enableSelection: boolean;
5
+ getCheckboxProps: (record: Record<string, any>) => {
6
+ disabled: any;
7
+ };
8
+ clearSelections: () => void;
9
+ onChange: (selectedRowKeys: React.Key[], selectedRows: any[]) => void;
10
+ removeSelectedKeys: (rowKeys: React.Key[]) => import('react').Key[];
11
+ removeSelectedKey: (rowKey: React.Key | React.Key[]) => import('react').Key[];
12
+ };
@@ -0,0 +1,17 @@
1
+ import { SortOrder } from 'antd/es/table/interface';
2
+ export default function useTableSort({ defaultSortOrder }: {
3
+ defaultSortOrder?: SortOrder;
4
+ }): {
5
+ sortOrder: SortOrder;
6
+ setSortOrder: (order: SortOrder) => void;
7
+ };
8
+ type orderType = {
9
+ columnKey?: string;
10
+ field?: string;
11
+ order: SortOrder;
12
+ };
13
+ export declare function useTableMultiSort(): {
14
+ sortOrder: string[];
15
+ handleMultiSortChange: (order: orderType | orderType[]) => string[];
16
+ };
17
+ export {};
@@ -0,0 +1,26 @@
1
+ interface ChunkedCollection {
2
+ ids: string[] | number[];
3
+ data: any;
4
+ collection: any[];
5
+ type: string | number;
6
+ }
7
+ type EventsType = 'CREATE' | 'UPDATE' | 'DELETE' | 'INSERT';
8
+ export declare function useUpdateChunkedList(options: {
9
+ events?: EventsType[];
10
+ dataList?: any[];
11
+ triggerAt?: React.MutableRefObject<number>;
12
+ limit?: number;
13
+ onCreate?: (args: any) => void;
14
+ onUpdate?: (args: any) => void;
15
+ onDelete?: (args: any) => void;
16
+ setDataList?: (args: any, opts?: any) => void;
17
+ callback?: (args: any) => void;
18
+ filterFun?: (args: any) => boolean;
19
+ mapFun?: (args: any) => any;
20
+ computedID?: (d: object) => string;
21
+ }): {
22
+ updateChunkedList: (data: ChunkedCollection) => void;
23
+ cacheDataListRef: import('react').MutableRefObject<any[]>;
24
+ deletedIdsRef: import('react').MutableRefObject<Set<string | number>>;
25
+ };
26
+ export default useUpdateChunkedList;
@@ -0,0 +1,4 @@
1
+ export default function useWatchList<T = Record<string, any>>(API: string): {
2
+ watchDataList: T[];
3
+ deleteItemFromCache: (id: number) => void;
4
+ };
@@ -0,0 +1,10 @@
1
+ export default function useWindowResize(): {
2
+ size: {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ isMobile: boolean;
7
+ isTablet: boolean;
8
+ isDesktop: boolean;
9
+ currentPoint: string;
10
+ };
@@ -0,0 +1,2 @@
1
+ declare const useCoreUIContext: () => import('../context/CoreUIContext').CoreUIContextProps;
2
+ export default useCoreUIContext;
@@ -0,0 +1,7 @@
1
+ export declare const useIntl: () => {
2
+ locale: any;
3
+ formatMessage: (descriptor: {
4
+ id: string;
5
+ }, values?: any) => string;
6
+ };
7
+ export default useIntl;
@@ -0,0 +1,6 @@
1
+ export * from './components';
2
+ export * as config from './config';
3
+ export * from './constants';
4
+ export * from './hooks';
5
+ export * from './types';
6
+ export * as utils from './utils';