@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.
- package/README.md +1 -0
- package/dist/assets/invert-worker-CFNPVgCi.js +1 -0
- package/dist/assets/json-parser-worker-DtJw0BTZ.js +1 -0
- package/dist/assets/offscreen-worker-DL5yJmAw.js +1 -0
- package/dist/assets/parse-worker-Dzai8qsE.js +5 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.cjs.js +2613 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +179547 -0
- package/dist/monaco-editor-CHfVLkob.js +103874 -0
- package/dist/monaco-editor-Df8eM8W1.js +802 -0
- package/dist/monaco-editor.css +1 -0
- package/dist/rolldown-runtime-BETGA6I9.js +23 -0
- package/dist/rolldown-runtime-D_0Db6FZ.js +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/components/alert-info/block.d.ts +16 -0
- package/dist/src/lib/components/alert-info/index.d.ts +11 -0
- package/dist/src/lib/components/audio-animation/index.d.ts +16 -0
- package/dist/src/lib/components/audio-player/audio-element.d.ts +3 -0
- package/dist/src/lib/components/audio-player/config/type.d.ts +25 -0
- package/dist/src/lib/components/audio-player/index.d.ts +14 -0
- package/dist/src/lib/components/audio-player/raw-audio-player.d.ts +4 -0
- package/dist/src/lib/components/audio-player/simple-audio.d.ts +16 -0
- package/dist/src/lib/components/auto-image/index.d.ts +10 -0
- package/dist/src/lib/components/auto-image/single-image.d.ts +26 -0
- package/dist/src/lib/components/auto-tooltip/index.d.ts +18 -0
- package/dist/src/lib/components/auto-tooltip/title-tip.d.ts +9 -0
- package/dist/src/lib/components/bibtex-viewer/index.d.ts +5 -0
- package/dist/src/lib/components/card-wrapper/index.d.ts +2 -0
- package/dist/src/lib/components/card-wrapper/simple-card.d.ts +20 -0
- package/dist/src/lib/components/check-buttons/index.d.ts +10 -0
- package/dist/src/lib/components/collapse-container/headless-collapse.d.ts +9 -0
- package/dist/src/lib/components/collapse-container/index.d.ts +24 -0
- package/dist/src/lib/components/collapse-panel/index.d.ts +11 -0
- package/dist/src/lib/components/column-settings/index.d.ts +21 -0
- package/dist/src/lib/components/column-wrapper/index.d.ts +13 -0
- package/dist/src/lib/components/column-wrapper/use-wrapper-context.d.ts +17 -0
- package/dist/src/lib/components/command-viewer/index.d.ts +14 -0
- package/dist/src/lib/components/content-wrapper/index.d.ts +8 -0
- package/dist/src/lib/components/copy-button/index.d.ts +15 -0
- package/dist/src/lib/components/delete-modal/index.d.ts +2 -0
- package/dist/src/lib/components/divider-line/index.d.ts +2 -0
- package/dist/src/lib/components/doc-link/index.d.ts +6 -0
- package/dist/src/lib/components/drop-down-actions/index.d.ts +4 -0
- package/dist/src/lib/components/drop-down-buttons/index.d.ts +18 -0
- package/dist/src/lib/components/dynamic-form/components/field-item.d.ts +9 -0
- package/dist/src/lib/components/dynamic-form/components/form-widget.d.ts +6 -0
- package/dist/src/lib/components/dynamic-form/components/list-map.d.ts +17 -0
- package/dist/src/lib/components/dynamic-form/config/types.d.ts +39 -0
- package/dist/src/lib/components/dynamic-form/hooks/use-parse-fields.d.ts +7 -0
- package/dist/src/lib/components/dynamic-form/hooks/use-validate-fields.d.ts +10 -0
- package/dist/src/lib/components/dynamic-form/index.d.ts +8 -0
- package/dist/src/lib/components/echarts/bar-chart.d.ts +4 -0
- package/dist/src/lib/components/echarts/chart-tooltip.d.ts +7 -0
- package/dist/src/lib/components/echarts/chart.d.ts +10 -0
- package/dist/src/lib/components/echarts/config.d.ts +178 -0
- package/dist/src/lib/components/echarts/gauge.d.ts +4 -0
- package/dist/src/lib/components/echarts/h-bar.d.ts +6 -0
- package/dist/src/lib/components/echarts/index.d.ts +7 -0
- package/dist/src/lib/components/echarts/line-chart.d.ts +4 -0
- package/dist/src/lib/components/echarts/mix-line-bar.d.ts +9 -0
- package/dist/src/lib/components/echarts/scatter.d.ts +7 -0
- package/dist/src/lib/components/echarts/types.d.ts +44 -0
- package/dist/src/lib/components/editor-wrap/index.d.ts +14 -0
- package/dist/src/lib/components/empty-data/index.d.ts +6 -0
- package/dist/src/lib/components/error-message-content/index.d.ts +4 -0
- package/dist/src/lib/components/filter-form/index.d.ts +17 -0
- package/dist/src/lib/components/footer/index.d.ts +6 -0
- package/dist/src/lib/components/form/auto-complete.d.ts +9 -0
- package/dist/src/lib/components/form/base/select.d.ts +7 -0
- package/dist/src/lib/components/form/cascader.d.ts +10 -0
- package/dist/src/lib/components/form/checkbox-field.d.ts +10 -0
- package/dist/src/lib/components/form/checkbox.d.ts +7 -0
- package/dist/src/lib/components/form/components/label-info.d.ts +9 -0
- package/dist/src/lib/components/form/components/not-found-content.d.ts +7 -0
- package/dist/src/lib/components/form/config/components.d.ts +17 -0
- package/dist/src/lib/components/form/config/index.d.ts +7 -0
- package/dist/src/lib/components/form/field-component.d.ts +4 -0
- package/dist/src/lib/components/form/hooks/use-select-render.d.ts +11 -0
- package/dist/src/lib/components/form/input-number.d.ts +5 -0
- package/dist/src/lib/components/form/input-search.d.ts +5 -0
- package/dist/src/lib/components/form/input.d.ts +7 -0
- package/dist/src/lib/components/form/multiple-select.d.ts +7 -0
- package/dist/src/lib/components/form/password.d.ts +6 -0
- package/dist/src/lib/components/form/row-textarea.d.ts +36 -0
- package/dist/src/lib/components/form/select.d.ts +8 -0
- package/dist/src/lib/components/form/simple-select.d.ts +7 -0
- package/dist/src/lib/components/form/slider.d.ts +13 -0
- package/dist/src/lib/components/form/switch-input.d.ts +15 -0
- package/dist/src/lib/components/form/switch.d.ts +12 -0
- package/dist/src/lib/components/form/textarea.d.ts +9 -0
- package/dist/src/lib/components/form/types.d.ts +14 -0
- package/dist/src/lib/components/form/wrapper/auto-complete-label.d.ts +2 -0
- package/dist/src/lib/components/form/wrapper/index.d.ts +32 -0
- package/dist/src/lib/components/form/wrapper/input.d.ts +2 -0
- package/dist/src/lib/components/form/wrapper/select.d.ts +2 -0
- package/dist/src/lib/components/form/wrapper/slider.d.ts +2 -0
- package/dist/src/lib/components/form-buttons/index.d.ts +11 -0
- package/dist/src/lib/components/form-drawer/index.d.ts +13 -0
- package/dist/src/lib/components/grafana-icon/index.d.ts +6 -0
- package/dist/src/lib/components/highlight-code/code-viewer-dark.d.ts +13 -0
- package/dist/src/lib/components/highlight-code/code-viewer-light.d.ts +13 -0
- package/dist/src/lib/components/highlight-code/code-viewer.d.ts +14 -0
- package/dist/src/lib/components/highlight-code/index.d.ts +13 -0
- package/dist/src/lib/components/highlight-code/utils.d.ts +1 -0
- package/dist/src/lib/components/icon-font/icons.d.ts +153 -0
- package/dist/src/lib/components/icon-font/index.d.ts +7 -0
- package/dist/src/lib/components/image-editor/extract-image-colors.d.ts +10 -0
- package/dist/src/lib/components/image-editor/hooks/use-drawing.d.ts +66 -0
- package/dist/src/lib/components/image-editor/hooks/use-zoom.d.ts +21 -0
- package/dist/src/lib/components/image-editor/index.d.ts +30 -0
- package/dist/src/lib/components/image-editor/invert-worker.d.ts +1 -0
- package/dist/src/lib/components/image-editor/offscreen-worker.d.ts +1 -0
- package/dist/src/lib/components/image-editor/tools-bar.d.ts +28 -0
- package/dist/src/lib/components/index.d.ts +127 -0
- package/dist/src/lib/components/infinite-scroller/index.d.ts +6 -0
- package/dist/src/lib/components/infinite-scroller/infinite-scroller-provider.d.ts +7 -0
- package/dist/src/lib/components/infinite-scroller/use-infinite-scroll.d.ts +12 -0
- package/dist/src/lib/components/infinite-scroller/use-scroller-context.d.ts +10 -0
- package/dist/src/lib/components/label-cell/index.d.ts +6 -0
- package/dist/src/lib/components/label-selector/autocomplete-item.d.ts +27 -0
- package/dist/src/lib/components/label-selector/context.d.ts +15 -0
- package/dist/src/lib/components/label-selector/index.d.ts +15 -0
- package/dist/src/lib/components/label-selector/inner.d.ts +23 -0
- package/dist/src/lib/components/label-selector/label-item.d.ts +26 -0
- package/dist/src/lib/components/label-selector/label-selector-provider.d.ts +6 -0
- package/dist/src/lib/components/label-selector/wrapper.d.ts +17 -0
- package/dist/src/lib/components/list-input/hint-input.d.ts +13 -0
- package/dist/src/lib/components/list-input/index.d.ts +25 -0
- package/dist/src/lib/components/list-input/list-item.d.ts +21 -0
- package/dist/src/lib/components/logs-viewer/config.d.ts +4 -0
- package/dist/src/lib/components/logs-viewer/index.d.ts +14 -0
- package/dist/src/lib/components/logs-viewer/logs-list.d.ts +14 -0
- package/dist/src/lib/components/logs-viewer/logs-pagination.d.ts +12 -0
- package/dist/src/lib/components/logs-viewer/parse-worker.d.ts +1 -0
- package/dist/src/lib/components/logs-viewer/use-logs-pagination.d.ts +11 -0
- package/dist/src/lib/components/logs-viewer/use-size.d.ts +5 -0
- package/dist/src/lib/components/logs-viewer/xterm-viewer.d.ts +9 -0
- package/dist/src/lib/components/markdown-viewer/full-markdown.d.ts +7 -0
- package/dist/src/lib/components/markdown-viewer/index.d.ts +9 -0
- package/dist/src/lib/components/markdown-viewer/utils.d.ts +4 -0
- package/dist/src/lib/components/metadata-list/index.d.ts +16 -0
- package/dist/src/lib/components/modal-footer/index.d.ts +22 -0
- package/dist/src/lib/components/more-button/index.d.ts +8 -0
- package/dist/src/lib/components/no-result/index.d.ts +14 -0
- package/dist/src/lib/components/overlay-scroller/index.d.ts +26 -0
- package/dist/src/lib/components/page-breadcrumb/index.d.ts +4 -0
- package/dist/src/lib/components/page-tools/index.d.ts +56 -0
- package/dist/src/lib/components/popover/index.d.ts +3 -0
- package/dist/src/lib/components/progress-bar/index.d.ts +11 -0
- package/dist/src/lib/components/radio-buttons/index.d.ts +12 -0
- package/dist/src/lib/components/resize-container/index.d.ts +8 -0
- package/dist/src/lib/components/scroll-spy-tabs/index.d.ts +36 -0
- package/dist/src/lib/components/scroll-spy-tabs/use-field-scroll.d.ts +27 -0
- package/dist/src/lib/components/scroll-spy-tabs/use-finish-failed.d.ts +14 -0
- package/dist/src/lib/components/scroll-spy-tabs/use-scroll-active-change.d.ts +12 -0
- package/dist/src/lib/components/scroller-modal/gs-drawer.d.ts +9 -0
- package/dist/src/lib/components/scroller-modal/index.d.ts +5 -0
- package/dist/src/lib/components/scroller-modal/use-scroller-context.d.ts +6 -0
- package/dist/src/lib/components/segment-line/index.d.ts +9 -0
- package/dist/src/lib/components/select-panel/index.d.ts +15 -0
- package/dist/src/lib/components/select-panel/list.d.ts +16 -0
- package/dist/src/lib/components/select-panel/selected-list.d.ts +14 -0
- package/dist/src/lib/components/shortcut/index.d.ts +17 -0
- package/dist/src/lib/components/shortcut/keymap.d.ts +6 -0
- package/dist/src/lib/components/simple-overlay/index.d.ts +10 -0
- package/dist/src/lib/components/simple-table/header.d.ts +9 -0
- package/dist/src/lib/components/simple-table/index.d.ts +39 -0
- package/dist/src/lib/components/simple-table/info-column.d.ts +13 -0
- package/dist/src/lib/components/simple-table/row.d.ts +8 -0
- package/dist/src/lib/components/small-close-button/index.d.ts +5 -0
- package/dist/src/lib/components/speech-content/audio-player.d.ts +19 -0
- package/dist/src/lib/components/speech-content/index.d.ts +16 -0
- package/dist/src/lib/components/speech-content/speech-item.d.ts +20 -0
- package/dist/src/lib/components/status-icon/error.d.ts +4 -0
- package/dist/src/lib/components/status-tag/index.d.ts +33 -0
- package/dist/src/lib/components/table/components/cell-content.d.ts +4 -0
- package/dist/src/lib/components/table/components/header-prefix.d.ts +14 -0
- package/dist/src/lib/components/table/components/header.d.ts +11 -0
- package/dist/src/lib/components/table/components/layout.d.ts +21 -0
- package/dist/src/lib/components/table/components/pagination.d.ts +3 -0
- package/dist/src/lib/components/table/components/row-children.d.ts +2 -0
- package/dist/src/lib/components/table/components/row-prefix.d.ts +12 -0
- package/dist/src/lib/components/table/components/table-body.d.ts +21 -0
- package/dist/src/lib/components/table/components/table-cell.d.ts +4 -0
- package/dist/src/lib/components/table/components/table-header.d.ts +4 -0
- package/dist/src/lib/components/table/components/table-row.d.ts +4 -0
- package/dist/src/lib/components/table/components/table-skeleton.d.ts +3 -0
- package/dist/src/lib/components/table/index.d.ts +7 -0
- package/dist/src/lib/components/table/row-context.d.ts +11 -0
- package/dist/src/lib/components/table/table-context.d.ts +3 -0
- package/dist/src/lib/components/table/table-provider.d.ts +9 -0
- package/dist/src/lib/components/table/table-row-provider.d.ts +6 -0
- package/dist/src/lib/components/table/types.d.ts +106 -0
- package/dist/src/lib/components/table/use-sorter.d.ts +11 -0
- package/dist/src/lib/components/tags-wrapper/index.d.ts +8 -0
- package/dist/src/lib/components/tags-wrapper/more-dropdown.d.ts +6 -0
- package/dist/src/lib/components/tags-wrapper/theme-tag.d.ts +6 -0
- package/dist/src/lib/components/templates/card-list.d.ts +12 -0
- package/dist/src/lib/components/templates/card-skeleton.d.ts +7 -0
- package/dist/src/lib/components/templates/card.d.ts +17 -0
- package/dist/src/lib/components/terminal-tabs/index.d.ts +11 -0
- package/dist/src/lib/components/terminal-tabs/resize-container.d.ts +15 -0
- package/dist/src/lib/components/terminal-tabs/tabs.d.ts +9 -0
- package/dist/src/lib/components/terminal-tabs/types.d.ts +4 -0
- package/dist/src/lib/components/thumb-image/index.d.ts +20 -0
- package/dist/src/lib/components/tooltip-list/index.d.ts +9 -0
- package/dist/src/lib/components/transfer/index.d.ts +14 -0
- package/dist/src/lib/components/transition/index.d.ts +10 -0
- package/dist/src/lib/components/upload-audio/index.d.ts +16 -0
- package/dist/src/lib/components/upload-image/index.d.ts +20 -0
- package/dist/src/lib/components/viewer-editor/index.d.ts +15 -0
- package/dist/src/lib/components/x-terminal/index.d.ts +8 -0
- package/dist/src/lib/components/yaml-editor/editor.d.ts +15 -0
- package/dist/src/lib/components/yaml-editor/index.d.ts +17 -0
- package/dist/src/lib/config/hotkeys.d.ts +40 -0
- package/dist/src/lib/config/index.d.ts +20 -0
- package/dist/src/lib/constants/index.d.ts +6 -0
- package/dist/src/lib/context/CoreUIContext.d.ts +83 -0
- package/dist/src/lib/context/CoreUIProvider.d.ts +4 -0
- package/dist/src/lib/hooks/index.d.ts +23 -0
- package/dist/src/lib/hooks/json-parser-worker.d.ts +1 -0
- package/dist/src/lib/hooks/use-actions.d.ts +11 -0
- package/dist/src/lib/hooks/use-add-image.d.ts +15 -0
- package/dist/src/lib/hooks/use-app-utils.d.ts +6 -0
- package/dist/src/lib/hooks/use-body-scroll.d.ts +5 -0
- package/dist/src/lib/hooks/use-chunk-fetch.d.ts +20 -0
- package/dist/src/lib/hooks/use-chunk-request.d.ts +20 -0
- package/dist/src/lib/hooks/use-container-scroll.d.ts +7 -0
- package/dist/src/lib/hooks/use-deferred-request.d.ts +1 -0
- package/dist/src/lib/hooks/use-download-logs.d.ts +8 -0
- package/dist/src/lib/hooks/use-download-stream.d.ts +12 -0
- package/dist/src/lib/hooks/use-esc-hint.d.ts +7 -0
- package/dist/src/lib/hooks/use-expanded-row-keys.d.ts +10 -0
- package/dist/src/lib/hooks/use-overlay-scroller.d.ts +45 -0
- package/dist/src/lib/hooks/use-query-data-list.d.ts +35 -0
- package/dist/src/lib/hooks/use-request-token.d.ts +13 -0
- package/dist/src/lib/hooks/use-responsive.d.ts +10 -0
- package/dist/src/lib/hooks/use-stream-core/buffer-queue.d.ts +8 -0
- package/dist/src/lib/hooks/use-stream-core/fetch-stream.d.ts +1 -0
- package/dist/src/lib/hooks/use-stream-core/speed-monitor.d.ts +8 -0
- package/dist/src/lib/hooks/use-stream-core/stream-processor.d.ts +18 -0
- package/dist/src/lib/hooks/use-stream-core/use-chunk-fetch.d.ts +7 -0
- package/dist/src/lib/hooks/use-table-row-selection.d.ts +12 -0
- package/dist/src/lib/hooks/use-table-sort.d.ts +17 -0
- package/dist/src/lib/hooks/use-update-chunk-list.d.ts +26 -0
- package/dist/src/lib/hooks/use-watch-list.d.ts +4 -0
- package/dist/src/lib/hooks/use-window-resize.d.ts +10 -0
- package/dist/src/lib/hooks/useCoreUIContext.d.ts +2 -0
- package/dist/src/lib/hooks/useIntl.d.ts +7 -0
- package/dist/src/lib/index.d.ts +6 -0
- package/dist/src/lib/types/index.d.ts +40 -0
- package/dist/src/lib/types/table-fetch.d.ts +71 -0
- package/dist/src/lib/utils/download-stream.d.ts +1 -0
- package/dist/src/lib/utils/epub-reader.d.ts +1 -0
- package/dist/src/lib/utils/excel-reader.d.ts +19 -0
- package/dist/src/lib/utils/fetch-chunk-data.d.ts +55 -0
- package/dist/src/lib/utils/index.d.ts +52 -0
- package/dist/src/lib/utils/load-audio-file.d.ts +14 -0
- package/dist/src/lib/utils/pcm-to-wav.d.ts +9 -0
- package/dist/src/lib/utils/pdf-reader.d.ts +2 -0
- package/dist/src/lib/utils/pptx-reader.d.ts +2 -0
- package/dist/src/lib/utils/read-html.d.ts +1 -0
- package/dist/src/lib/utils/watch-request.d.ts +18 -0
- package/dist/src/lib/utils/word-reader.d.ts +1 -0
- package/package.json +138 -0
|
@@ -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,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,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,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 @@
|
|
|
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,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 @@
|
|
|
1
|
+
export declare function fetchStream(url: string, handler: (chunk: string, meta?: any) => void, signal?: AbortSignal): Promise<void>;
|
|
@@ -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,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;
|