backend.ai-ui 0.0.1 → 25.16.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/dist/__generated__/BAIActivateArtifactsModalArtifactsFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAIActivateArtifactsModalArtifactsFragmentRestoreArtifactsMutation.graphql.d.ts +22 -0
- package/dist/__generated__/BAIArtifactDescriptionsFragment.graphql.d.ts +17 -0
- package/dist/__generated__/BAIArtifactRevisionDeleteButtonFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAIArtifactRevisionDownloadButtonFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAIArtifactRevisionTableArtifactRevisionFragment.graphql.d.ts +17 -0
- package/dist/__generated__/BAIArtifactRevisionTableLatestRevisionFragment.graphql.d.ts +11 -0
- package/dist/__generated__/BAIArtifactStatusTagFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAIArtifactTableArtifactFragment.graphql.d.ts +30 -0
- package/dist/__generated__/BAIArtifactTypeTagFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAIBucketSelectQuery.graphql.d.ts +29 -0
- package/dist/__generated__/BAIDeactivateArtifactsModalArtifactsFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAIDeactivateArtifactsModalDeleteArtifactsMutation.graphql.d.ts +22 -0
- package/dist/__generated__/BAIDeleteArtifactRevisionsModalArtifactFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAIDeleteArtifactRevisionsModalArtifactRevisionFragment.graphql.d.ts +15 -0
- package/dist/__generated__/BAIDeleteArtifactRevisionsModalCleanupVersionMutation.graphql.d.ts +25 -0
- package/dist/__generated__/BAIImportArtifactModalArtifactFragment.graphql.d.ts +13 -0
- package/dist/__generated__/BAIImportArtifactModalArtifactRevisionFragment.graphql.d.ts +15 -0
- package/dist/__generated__/BAIImportArtifactModalImportArtifactsMutation.graphql.d.ts +33 -0
- package/dist/__generated__/BAIImportFromHuggingFaceModalScanArtifactModelsMutation.graphql.d.ts +32 -0
- package/dist/__generated__/BAIObjectStorageSelectQuery.graphql.d.ts +22 -0
- package/dist/__generated__/BAIPullingArtifactRevisionAlertCancelMutation.graphql.d.ts +22 -0
- package/dist/__generated__/BAIPullingArtifactRevisionAlertFragment.graphql.d.ts +14 -0
- package/dist/__generated__/BAISessionAgentIdsFragment.graphql.d.ts +11 -0
- package/dist/__generated__/BAISessionClusterModeFragment.graphql.d.ts +12 -0
- package/dist/__generated__/BAISessionTypeTagStoriesQuery.graphql.d.ts +13 -0
- package/dist/__generated__/UNSAFELazyUserEmailViewQuery.graphql.d.ts +15 -0
- package/dist/__generated__/useViewerQuery.graphql.d.ts +16 -0
- package/dist/backend.ai-ui.js +22220 -6991
- package/dist/backend.ai-ui.js.map +1 -1
- package/dist/common-CMrtHk6c.js.map +1 -1
- package/dist/components/BAIAlertIconWithTooltip.d.ts +9 -0
- package/dist/components/BAIBackButton.d.ts +7 -0
- package/dist/components/BAIBoardItemTitle.d.ts +9 -0
- package/dist/components/BAICard.d.ts +52 -1
- package/dist/components/BAIConfirmModalWithInput.d.ts +11 -0
- package/dist/components/{Flex.d.ts → BAIFlex.d.ts} +4 -4
- package/dist/components/BAIGraphQLPropertyFilter.d.ts +76 -0
- package/dist/components/BAIImportFromHuggingFaceModal.d.ts +6 -0
- package/dist/components/BAILink.d.ts +13 -0
- package/dist/components/BAIModal.d.ts +8 -0
- package/dist/components/BAINotificationItem.d.ts +17 -0
- package/dist/components/BAIPropertyFilter.d.ts +99 -0
- package/dist/components/BAIRowWrapWithDividers.d.ts +20 -0
- package/dist/components/BAISelect.d.ts +18 -0
- package/dist/components/BAIStatistic.d.ts +13 -0
- package/dist/components/BAITag.d.ts +6 -0
- package/dist/components/BAIText.d.ts +7 -0
- package/dist/components/BAIUnmountAfterClose.d.ts +26 -0
- package/dist/components/ResourceStatistics.d.ts +57 -0
- package/dist/components/Table/BAIPaginationInfoText.d.ts +7 -0
- package/dist/components/Table/BAITable.d.ts +133 -0
- package/dist/components/Table/BAITableSettingModal.d.ts +62 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/TotalFooter.d.ts +5 -0
- package/dist/components/baiClient/FileExplorer/BAIFileExplorer.d.ts +20 -0
- package/dist/components/baiClient/FileExplorer/CreateDirectoryModal.d.ts +7 -0
- package/dist/components/baiClient/FileExplorer/DeleteSelectedItemsModal.d.ts +8 -0
- package/dist/components/baiClient/FileExplorer/DragAndDrop.d.ts +8 -0
- package/dist/components/baiClient/FileExplorer/EditableFileName.d.ts +14 -0
- package/dist/components/baiClient/FileExplorer/ExplorerActionControls.d.ts +11 -0
- package/dist/components/baiClient/FileExplorer/FileItemControls.d.ts +9 -0
- package/dist/components/baiClient/FileExplorer/hooks.d.ts +19 -0
- package/dist/components/baiClient/FileExplorer/index.d.ts +2 -0
- package/dist/components/baiClient/index.d.ts +1 -0
- package/dist/components/fragments/BAIActivateArtifactsModal.d.ts +8 -0
- package/dist/components/fragments/BAIArtifactDescriptions.d.ts +6 -0
- package/dist/components/fragments/BAIArtifactRevisionDeleteButton.d.ts +8 -0
- package/dist/components/fragments/BAIArtifactRevisionDownloadButton.d.ts +8 -0
- package/dist/components/fragments/BAIArtifactRevisionTable.d.ts +12 -0
- package/dist/components/fragments/BAIArtifactStatusTag.d.ts +6 -0
- package/dist/components/fragments/BAIArtifactTable.d.ts +14 -0
- package/dist/components/fragments/BAIArtifactTypeTag.d.ts +6 -0
- package/dist/components/fragments/BAIBucketSelect.d.ts +7 -0
- package/dist/components/fragments/BAIDeactivateArtifactsModal.d.ts +8 -0
- package/dist/components/fragments/BAIDeleteArtifactRevisionsModal.d.ts +13 -0
- package/dist/components/fragments/BAIImportArtifactModal.d.ts +21 -0
- package/dist/components/fragments/BAIObjectStorageSelect.d.ts +6 -0
- package/dist/components/fragments/BAIPullingArtifactRevisionAlert.d.ts +7 -0
- package/dist/components/fragments/BAISessionAgentIds.d.ts +9 -0
- package/dist/components/fragments/BAISessionClusterMode.d.ts +7 -0
- package/dist/components/fragments/BAISessionTypeTag.d.ts +1 -1
- package/dist/components/fragments/index.d.ts +32 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/components/provider/BAIClientProvider/BAIClientProvider.d.ts +9 -0
- package/dist/components/provider/BAIClientProvider/context.d.ts +4 -0
- package/dist/components/provider/BAIClientProvider/hooks/useAnonymousBAIClient.d.ts +3 -0
- package/dist/components/provider/BAIClientProvider/hooks/useConnectedBAIClient.d.ts +3 -0
- package/dist/components/provider/BAIClientProvider/index.d.ts +6 -0
- package/dist/components/provider/BAIClientProvider/types.d.ts +72 -0
- package/dist/components/provider/BAIConfigProvider/BAIConfigProvider.d.ts +10 -0
- package/dist/components/provider/BAIConfigProvider/index.d.ts +2 -0
- package/dist/components/provider/index.d.ts +2 -0
- package/dist/components/unsafe/UNSAFELazyUserEmailView.d.ts +11 -0
- package/dist/components/unsafe/index.d.ts +1 -0
- package/dist/helper/index.d.ts +154 -0
- package/dist/hooks/index.d.ts +20 -0
- package/dist/hooks/useErrorMessageResolver.d.ts +26 -0
- package/dist/hooks/useEventNotStable.d.ts +1 -0
- package/dist/hooks/usePaginatedQuery.d.ts +20 -0
- package/dist/hooks/useViewer.d.ts +10 -0
- package/dist/icons/BAIAppIcon.d.ts +5 -0
- package/dist/icons/BAIBatchSessionIcon.d.ts +5 -0
- package/dist/icons/BAICalculateResourceIcon.d.ts +5 -0
- package/dist/icons/BAICephIcon.d.ts +5 -0
- package/dist/icons/BAIContainerCommitIcon.d.ts +5 -0
- package/dist/icons/BAIDashboardIcon.d.ts +5 -0
- package/dist/icons/BAIEndpointIcon.d.ts +5 -0
- package/dist/icons/BAIEndpointsIcon.d.ts +5 -0
- package/dist/icons/BAIExampleStartIcon.d.ts +5 -0
- package/dist/icons/BAIExamplesIcon.d.ts +5 -0
- package/dist/icons/BAIHuggingFaceIcon.d.ts +5 -0
- package/dist/icons/BAIInteractiveSessionIcon.d.ts +5 -0
- package/dist/icons/BAIListIcon.d.ts +5 -0
- package/dist/icons/BAIModelServiceIcon.d.ts +5 -0
- package/dist/icons/BAIModelStoreIcon.d.ts +5 -0
- package/dist/icons/BAIModelsIcon.d.ts +5 -0
- package/dist/icons/BAIMyEnvironmentsIcon.d.ts +5 -0
- package/dist/icons/BAINewFolderIcon.d.ts +5 -0
- package/dist/icons/BAINvidiaIcon.d.ts +6 -0
- package/dist/icons/BAIPipelineIcon.d.ts +5 -0
- package/dist/icons/BAIPipelinesIcon.d.ts +5 -0
- package/dist/icons/BAIPureStorageIcon.d.ts +5 -0
- package/dist/icons/BAIPurgeIcon.d.ts +5 -0
- package/dist/icons/BAIRecalculateResourcesIcon.d.ts +5 -0
- package/dist/icons/BAIRescanImagesIcon.d.ts +5 -0
- package/dist/icons/BAIRestoreIcon.d.ts +5 -0
- package/dist/icons/BAISessionLogIcon.d.ts +5 -0
- package/dist/icons/BAISessionStartIcon.d.ts +5 -0
- package/dist/icons/BAISessionsIcon.d.ts +5 -0
- package/dist/icons/BAISftpIcon.d.ts +5 -0
- package/dist/icons/BAIShareAltIcon.d.ts +5 -0
- package/dist/icons/BAIStartCircleIcon.d.ts +5 -0
- package/dist/icons/BAISystemMonitorIcon.d.ts +5 -0
- package/dist/icons/BAITerminalAppIcon.d.ts +5 -0
- package/dist/icons/BAITerminateIcon.d.ts +5 -0
- package/dist/icons/BAITrailsIcon.d.ts +5 -0
- package/dist/icons/BAITrashBinIcon.d.ts +5 -0
- package/dist/icons/BAIURLStartIcon.d.ts +5 -0
- package/dist/icons/BAIUpdateEnvironmentImagesIcon.d.ts +5 -0
- package/dist/icons/BAIUploadIcon.d.ts +5 -0
- package/dist/icons/BAIUserOutlinedIcon.d.ts +5 -0
- package/dist/icons/BAIUserUnionIcon.d.ts +5 -0
- package/dist/icons/index.d.ts +42 -0
- package/dist/index.d.ts +5 -4
- package/dist/locale/de_DE.js +6 -4
- package/dist/locale/de_DE.js.map +1 -1
- package/dist/locale/el_GR.js +6 -4
- package/dist/locale/el_GR.js.map +1 -1
- package/dist/locale/en_US.js +6 -4
- package/dist/locale/en_US.js.map +1 -1
- package/dist/locale/es_ES.js +9 -7
- package/dist/locale/es_ES.js.map +1 -1
- package/dist/locale/fi_FI.js +12 -3
- package/dist/locale/fi_FI.js.map +1 -1
- package/dist/locale/fr_FR.js +7 -3
- package/dist/locale/fr_FR.js.map +1 -1
- package/dist/locale/id_ID.js +6 -4
- package/dist/locale/id_ID.js.map +1 -1
- package/dist/locale/it_IT.js +22 -9
- package/dist/locale/it_IT.js.map +1 -1
- package/dist/locale/ja_JP.js +6 -4
- package/dist/locale/ja_JP.js.map +1 -1
- package/dist/locale/ko_KR.js +6 -4
- package/dist/locale/ko_KR.js.map +1 -1
- package/dist/locale/mn_MN.js +13 -6
- package/dist/locale/mn_MN.js.map +1 -1
- package/dist/locale/ms_MY.js +6 -4
- package/dist/locale/ms_MY.js.map +1 -1
- package/dist/locale/pl_PL.js +6 -4
- package/dist/locale/pl_PL.js.map +1 -1
- package/dist/locale/pt_BR.js +6 -4
- package/dist/locale/pt_BR.js.map +1 -1
- package/dist/locale/pt_PT.js +6 -4
- package/dist/locale/pt_PT.js.map +1 -1
- package/dist/locale/ru_RU.js +6 -4
- package/dist/locale/ru_RU.js.map +1 -1
- package/dist/locale/th_TH.js +6 -4
- package/dist/locale/th_TH.js.map +1 -1
- package/dist/locale/tr_TR.js +8 -5
- package/dist/locale/tr_TR.js.map +1 -1
- package/dist/locale/vi_VN.js +23 -10
- package/dist/locale/vi_VN.js.map +1 -1
- package/dist/locale/zh_CN.js +6 -4
- package/dist/locale/zh_CN.js.map +1 -1
- package/dist/locale/zh_TW.js +6 -4
- package/dist/locale/zh_TW.js.map +1 -1
- package/dist/tests/RelayResolver.d.ts +7 -0
- package/dist/tests/index.d.ts +1 -0
- package/package.json +132 -32
- package/dist/common-BqeHlhne.js +0 -62
- package/dist/common-BqeHlhne.js.map +0 -1
- package/dist/components/BAIConfigProvider.d.ts +0 -7
- package/dist/components/BAIResourceWithSteppedProgress.d.ts +0 -11
- package/dist/components/Flex.stories.d.ts +0 -7
- /package/dist/{components/tests → tests}/BAITestButton.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-CMrtHk6c.js","sources":["../../../node_modules/.pnpm/rc-picker@4.11.3_date-fns@3.6.0_dayjs@1.11.
|
|
1
|
+
{"version":3,"file":"common-CMrtHk6c.js","sources":["../../../node_modules/.pnpm/rc-picker@4.11.3_date-fns@3.6.0_dayjs@1.11.18_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/rc-picker/es/locale/common.js"],"sourcesContent":["export var commonLocale = {\n yearFormat: 'YYYY',\n dayFormat: 'D',\n cellMeridiemFormat: 'A',\n monthBeforeYear: true\n};"],"names":["commonLocale"],"mappings":"AAAU,IAACA,IAAe;AAAA,EACxB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,iBAAiB;AACnB;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TooltipPropsWithTitle } from 'antd/es/tooltip';
|
|
2
|
+
import { CircleAlertIcon } from 'lucide-react';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
interface BAIAlertIconWithTooltipProps extends Omit<TooltipPropsWithTitle, 'children'> {
|
|
5
|
+
iconProps?: React.ComponentProps<typeof CircleAlertIcon>;
|
|
6
|
+
type?: 'warning' | 'error';
|
|
7
|
+
}
|
|
8
|
+
declare const BAIAlertIconWithTooltip: ({ iconProps, type, ...tooltipProps }: BAIAlertIconWithTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default BAIAlertIconWithTooltip;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NavigateOptions, To } from 'react-router-dom';
|
|
2
|
+
export interface BAIBackButtonProps {
|
|
3
|
+
to: To;
|
|
4
|
+
options?: NavigateOptions;
|
|
5
|
+
}
|
|
6
|
+
declare const BAIBackButton: ({ to, options }: BAIBackButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default BAIBackButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface BAIBoardItemTitleProps {
|
|
3
|
+
title: React.ReactNode | string;
|
|
4
|
+
tooltip?: React.ReactNode;
|
|
5
|
+
extra?: React.ReactNode;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
declare const BAIBoardItemTitle: React.FC<BAIBoardItemTitleProps>;
|
|
9
|
+
export default BAIBoardItemTitle;
|
|
@@ -1,12 +1,63 @@
|
|
|
1
1
|
import { CardProps } from 'antd';
|
|
2
2
|
import { default as React, ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Props interface for BAICard component.
|
|
5
|
+
* Extends Ant Design Card props with additional Backend.AI-specific customizations.
|
|
6
|
+
*/
|
|
3
7
|
export interface BAICardProps extends Omit<CardProps, 'extra'> {
|
|
8
|
+
/** Visual status of the card affecting border color and extra button icons */
|
|
4
9
|
status?: 'success' | 'error' | 'warning' | 'default';
|
|
10
|
+
/** Custom content to display in the header area */
|
|
5
11
|
extra?: ReactNode;
|
|
12
|
+
/** Title for the extra button that appears in the header */
|
|
6
13
|
extraButtonTitle?: string | ReactNode;
|
|
14
|
+
/** Show header divider. Automatically enabled when tabList is specified */
|
|
7
15
|
showDivider?: boolean;
|
|
16
|
+
/** Callback function triggered when the extra button is clicked */
|
|
8
17
|
onClickExtraButton?: () => void;
|
|
9
|
-
|
|
18
|
+
/** React ref for the card container */
|
|
19
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
10
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* BAICard component - Enhanced Ant Design Card with Backend.AI-specific features.
|
|
23
|
+
*
|
|
24
|
+
* Provides a flexible card interface with status-based styling, customizable headers,
|
|
25
|
+
* and integrated action buttons. Supports all standard Ant Design Card features
|
|
26
|
+
* while adding Backend.AI design system enhancements.
|
|
27
|
+
*
|
|
28
|
+
* @param props - BAICardProps configuration object
|
|
29
|
+
* @returns React functional component
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* // Basic usage
|
|
34
|
+
* <BAICard title="Basic Card">
|
|
35
|
+
* <p>Card content goes here</p>
|
|
36
|
+
* </BAICard>
|
|
37
|
+
*
|
|
38
|
+
* // With status and extra button
|
|
39
|
+
* <BAICard
|
|
40
|
+
* title="Error Card"
|
|
41
|
+
* status="error"
|
|
42
|
+
* extraButtonTitle="Fix Error"
|
|
43
|
+
* onClickExtraButton={() => handleError()}
|
|
44
|
+
* >
|
|
45
|
+
* <p>Error details...</p>
|
|
46
|
+
* </BAICard>
|
|
47
|
+
*
|
|
48
|
+
* // With tabs
|
|
49
|
+
* <BAICard
|
|
50
|
+
* title="Tabbed Card"
|
|
51
|
+
* tabList={[
|
|
52
|
+
* { key: 'tab1', label: 'Tab 1' },
|
|
53
|
+
* { key: 'tab2', label: 'Tab 2' }
|
|
54
|
+
* ]}
|
|
55
|
+
* activeTabKey="tab1"
|
|
56
|
+
* onTabChange={(key) => setActiveTab(key)}
|
|
57
|
+
* >
|
|
58
|
+
* <p>Tab content...</p>
|
|
59
|
+
* </BAICard>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
11
62
|
declare const BAICard: React.FC<BAICardProps>;
|
|
12
63
|
export default BAICard;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BAIModalProps } from './BAIModal';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface BAIConfirmModalWithInputProps extends Omit<BAIModalProps, 'icon' | 'okButtonProps'> {
|
|
4
|
+
confirmText: string;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
okButtonProps?: Omit<BAIModalProps['okButtonProps'], 'disabled' | 'danger'>;
|
|
9
|
+
}
|
|
10
|
+
declare const BAIConfirmModalWithInput: React.FC<BAIConfirmModalWithInputProps>;
|
|
11
|
+
export default BAIConfirmModalWithInput;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren } from 'react';
|
|
2
2
|
type GapSize = number | 'xxs' | 'xs' | 'sm' | 'ms' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
3
|
-
type GapProp = GapSize | [GapSize, GapSize];
|
|
4
|
-
export interface
|
|
3
|
+
type GapProp = GapSize | [GapSize | undefined, GapSize | undefined];
|
|
4
|
+
export interface BAIFlexProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'dir'>, PropsWithChildren {
|
|
5
5
|
direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
6
6
|
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
7
7
|
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
|
|
8
8
|
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
9
9
|
gap?: GapProp;
|
|
10
10
|
}
|
|
11
|
-
declare const
|
|
12
|
-
export default
|
|
11
|
+
declare const BAIFlex: React.ForwardRefExoticComponent<BAIFlexProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default BAIFlex;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { default as BAIFlex } from './BAIFlex';
|
|
2
|
+
import { AutoCompleteProps } from 'antd';
|
|
3
|
+
import { default as React, ComponentProps } from 'react';
|
|
4
|
+
export type StringFilter = {
|
|
5
|
+
contains?: string | null;
|
|
6
|
+
startsWith?: string | null;
|
|
7
|
+
endsWith?: string | null;
|
|
8
|
+
equals?: string | null;
|
|
9
|
+
notEquals?: string | null;
|
|
10
|
+
iContains?: string | null;
|
|
11
|
+
iStartsWith?: string | null;
|
|
12
|
+
iEndsWith?: string | null;
|
|
13
|
+
iEquals?: string | null;
|
|
14
|
+
iNotEquals?: string | null;
|
|
15
|
+
};
|
|
16
|
+
export type NumberFilter = {
|
|
17
|
+
equals?: number | null;
|
|
18
|
+
notEquals?: number | null;
|
|
19
|
+
greaterThan?: number | null;
|
|
20
|
+
greaterOrEqual?: number | null;
|
|
21
|
+
lessThan?: number | null;
|
|
22
|
+
lessOrEqual?: number | null;
|
|
23
|
+
in?: number[] | null;
|
|
24
|
+
notIn?: number[] | null;
|
|
25
|
+
};
|
|
26
|
+
export type BooleanFilter = boolean;
|
|
27
|
+
export type EnumFilter<T = string> = {
|
|
28
|
+
equals?: T | null;
|
|
29
|
+
notEquals?: T | null;
|
|
30
|
+
in?: T[] | null;
|
|
31
|
+
notIn?: T[] | null;
|
|
32
|
+
};
|
|
33
|
+
export type BaseFilter<T = any> = {
|
|
34
|
+
AND?: T[] | T | null;
|
|
35
|
+
OR?: T[] | T | null;
|
|
36
|
+
NOT?: T | null;
|
|
37
|
+
};
|
|
38
|
+
export type GraphQLFilter = BaseFilter & {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
};
|
|
41
|
+
export type FilterPropertyType = 'string' | 'number' | 'boolean' | 'enum';
|
|
42
|
+
export type FilterOperator = 'contains' | 'startsWith' | 'endsWith' | 'equals' | 'notEquals' | 'iContains' | 'iStartsWith' | 'iEndsWith' | 'iEquals' | 'iNotEquals' | 'greaterThan' | 'greaterOrEqual' | 'lessThan' | 'lessOrEqual' | 'in' | 'notIn' | (string & NonNullable<unknown>);
|
|
43
|
+
type BaseFilterProperty = {
|
|
44
|
+
key: string;
|
|
45
|
+
propertyLabel: string;
|
|
46
|
+
type: FilterPropertyType;
|
|
47
|
+
operators?: FilterOperator[];
|
|
48
|
+
options?: AutoCompleteProps['options'];
|
|
49
|
+
strictSelection?: boolean;
|
|
50
|
+
rule?: {
|
|
51
|
+
message: string;
|
|
52
|
+
validate: (value: any) => boolean;
|
|
53
|
+
};
|
|
54
|
+
valueMode?: 'scalar' | 'operator';
|
|
55
|
+
implicitOperator?: FilterOperator;
|
|
56
|
+
};
|
|
57
|
+
export type FilterProperty = BaseFilterProperty & ({
|
|
58
|
+
fixedOperator: FilterOperator;
|
|
59
|
+
defaultOperator?: never;
|
|
60
|
+
} | {
|
|
61
|
+
defaultOperator?: FilterOperator;
|
|
62
|
+
fixedOperator?: never;
|
|
63
|
+
} | {
|
|
64
|
+
defaultOperator?: never;
|
|
65
|
+
fixedOperator?: never;
|
|
66
|
+
});
|
|
67
|
+
export interface BAIGraphQLPropertyFilterProps extends Omit<ComponentProps<typeof BAIFlex>, 'value' | 'onChange' | 'defaultValue'> {
|
|
68
|
+
value?: GraphQLFilter;
|
|
69
|
+
onChange?: (value: GraphQLFilter | undefined) => void;
|
|
70
|
+
defaultValue?: GraphQLFilter;
|
|
71
|
+
filterProperties: Array<FilterProperty>;
|
|
72
|
+
loading?: boolean;
|
|
73
|
+
combinationMode?: 'AND' | 'OR';
|
|
74
|
+
}
|
|
75
|
+
declare const BAIGraphQLPropertyFilter: React.FC<BAIGraphQLPropertyFilterProps>;
|
|
76
|
+
export default BAIGraphQLPropertyFilter;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModalProps } from 'antd';
|
|
2
|
+
export interface BAIImportFromHuggingFaceModalProps extends Omit<ModalProps, 'onOk'> {
|
|
3
|
+
onOk: (e: React.MouseEvent<HTMLElement>, artifactId: string) => void;
|
|
4
|
+
}
|
|
5
|
+
declare const BAIImportFromHuggingFaceModal: ({ onOk, onCancel, ...modalProps }: BAIImportFromHuggingFaceModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default BAIImportFromHuggingFaceModal;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LinkProps } from 'react-router-dom';
|
|
3
|
+
export interface BAILinkProps extends Omit<LinkProps, 'to'> {
|
|
4
|
+
type?: 'hover' | 'disabled' | undefined;
|
|
5
|
+
to?: LinkProps['to'];
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
ellipsis?: boolean | {
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
};
|
|
10
|
+
children?: string | React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const BAILink: React.FC<BAILinkProps>;
|
|
13
|
+
export default BAILink;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModalProps } from 'antd';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export declare const DEFAULT_BAI_MODAL_Z_INDEX = 1001;
|
|
4
|
+
export interface BAIModalProps extends ModalProps {
|
|
5
|
+
draggable?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const BAIModal: React.FC<BAIModalProps>;
|
|
8
|
+
export default BAIModal;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface NotificationItemTemplateStyles {
|
|
3
|
+
title?: React.CSSProperties;
|
|
4
|
+
description?: React.CSSProperties;
|
|
5
|
+
action?: React.CSSProperties;
|
|
6
|
+
footer?: React.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
export interface NotificationItemTemplateProps {
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
footer?: ReactNode;
|
|
13
|
+
styles?: NotificationItemTemplateStyles;
|
|
14
|
+
}
|
|
15
|
+
declare const NotificationItemTemplate: React.FC<NotificationItemTemplateProps>;
|
|
16
|
+
export { NotificationItemTemplate };
|
|
17
|
+
export default NotificationItemTemplate;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { default as BAIFlex } from './BAIFlex';
|
|
2
|
+
import { AutoCompleteProps } from 'antd';
|
|
3
|
+
import { default as React, ComponentProps } from 'react';
|
|
4
|
+
export type FilterProperty = {
|
|
5
|
+
key: string;
|
|
6
|
+
defaultOperator?: string;
|
|
7
|
+
propertyLabel: string;
|
|
8
|
+
type: 'string' | 'boolean';
|
|
9
|
+
options?: AutoCompleteProps['options'];
|
|
10
|
+
strictSelection?: boolean;
|
|
11
|
+
rule?: {
|
|
12
|
+
message: string;
|
|
13
|
+
validate: (value: string) => boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export interface BAIPropertyFilterProps extends Omit<ComponentProps<typeof BAIFlex>, 'value' | 'onChange'> {
|
|
17
|
+
value?: string;
|
|
18
|
+
onChange?: (value: string) => void;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
filterProperties: Array<FilterProperty>;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function mergeFilterValues(filterStrings: Array<string | undefined | null>, operator?: string): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Parses the filter value and returns an object containing the property, operator, and value.
|
|
26
|
+
* @param filter - The filter string to parse.
|
|
27
|
+
* @returns An object containing the parsed property, operator, and value.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseFilterValue(filter: string): {
|
|
30
|
+
property: string;
|
|
31
|
+
operator: string;
|
|
32
|
+
value: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* BAIPropertyFilter component - Advanced property filtering interface for Backend.AI applications.
|
|
36
|
+
*
|
|
37
|
+
* Provides a sophisticated filtering interface for constructing complex filter queries with support for:
|
|
38
|
+
* - Multiple property types (string and boolean) with type-specific operators
|
|
39
|
+
* - Dynamic query building through a visual interface
|
|
40
|
+
* - Autocomplete support with predefined options and suggestions
|
|
41
|
+
* - Custom validation rules for property values
|
|
42
|
+
* - Backend.AI query filter minilang compatibility
|
|
43
|
+
*
|
|
44
|
+
* The component generates filter query strings compatible with Backend.AI's query system,
|
|
45
|
+
* enabling powerful data filtering capabilities across the platform.
|
|
46
|
+
*
|
|
47
|
+
* @param props - BAIPropertyFilterProps configuration object
|
|
48
|
+
* @returns React functional component
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* // Basic usage with string and boolean properties
|
|
53
|
+
* <BAIPropertyFilter
|
|
54
|
+
* filterProperties={[
|
|
55
|
+
* {
|
|
56
|
+
* key: 'name',
|
|
57
|
+
* propertyLabel: 'Name',
|
|
58
|
+
* type: 'string',
|
|
59
|
+
* defaultOperator: 'ilike',
|
|
60
|
+
* },
|
|
61
|
+
* {
|
|
62
|
+
* key: 'active',
|
|
63
|
+
* propertyLabel: 'Active Status',
|
|
64
|
+
* type: 'boolean',
|
|
65
|
+
* },
|
|
66
|
+
* ]}
|
|
67
|
+
* value="name ilike %test% & active == true"
|
|
68
|
+
* onChange={(value) => setFilterValue(value)}
|
|
69
|
+
* />
|
|
70
|
+
*
|
|
71
|
+
* // With custom validation and options
|
|
72
|
+
* <BAIPropertyFilter
|
|
73
|
+
* filterProperties={[
|
|
74
|
+
* {
|
|
75
|
+
* key: 'email',
|
|
76
|
+
* propertyLabel: 'Email',
|
|
77
|
+
* type: 'string',
|
|
78
|
+
* rule: {
|
|
79
|
+
* message: 'Please enter a valid email address',
|
|
80
|
+
* validate: (value) => /\S+@\S+\.\S+/.test(value),
|
|
81
|
+
* },
|
|
82
|
+
* },
|
|
83
|
+
* {
|
|
84
|
+
* key: 'status',
|
|
85
|
+
* propertyLabel: 'Status',
|
|
86
|
+
* type: 'string',
|
|
87
|
+
* options: [
|
|
88
|
+
* { label: 'Active', value: 'active' },
|
|
89
|
+
* { label: 'Inactive', value: 'inactive' },
|
|
90
|
+
* ],
|
|
91
|
+
* strictSelection: true,
|
|
92
|
+
* },
|
|
93
|
+
* ]}
|
|
94
|
+
* onChange={handleFilterChange}
|
|
95
|
+
* />
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
declare const BAIPropertyFilter: React.FC<BAIPropertyFilterProps>;
|
|
99
|
+
export default BAIPropertyFilter;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface BAIRowWrapWithDividersProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
wrap?: boolean;
|
|
5
|
+
rowGap?: number | string;
|
|
6
|
+
columnGap?: number | string;
|
|
7
|
+
dividerWidth?: number;
|
|
8
|
+
dividerColor?: string;
|
|
9
|
+
/** Top/bottom inset of the vertical divider. Does not affect container size. */
|
|
10
|
+
dividerInset?: number;
|
|
11
|
+
itemStyle?: React.CSSProperties;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Wraps like flex-wrap and draws vertical dividers only between items on the same row.
|
|
17
|
+
* dividerInset shortens only the divider line without changing the container padding.
|
|
18
|
+
*/
|
|
19
|
+
declare const BAIRowWrapWithDividers: React.FC<BAIRowWrapWithDividersProps>;
|
|
20
|
+
export default BAIRowWrapWithDividers;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Select, SelectProps } from 'antd';
|
|
2
|
+
import { BaseOptionType, DefaultOptionType } from 'antd/es/select';
|
|
3
|
+
import { GetRef } from 'antd/lib';
|
|
4
|
+
import { default as React } from 'react';
|
|
5
|
+
export interface BAISelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends SelectProps<ValueType, OptionType> {
|
|
6
|
+
ref?: React.RefObject<GetRef<typeof Select<ValueType, OptionType>> | null>;
|
|
7
|
+
ghost?: boolean;
|
|
8
|
+
autoSelectOption?: boolean | ((options: SelectProps<ValueType, OptionType>['options']) => ValueType);
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
atBottomThreshold?: number;
|
|
11
|
+
atBottomStateChange?: (atBottom: boolean) => void;
|
|
12
|
+
bottomLoading?: boolean;
|
|
13
|
+
footer?: React.ReactNode;
|
|
14
|
+
endReached?: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare function BAISelect<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>({ ref, autoSelectOption, ghost, tooltip, atBottomThreshold, atBottomStateChange, footer, endReached, // Destructure the new prop
|
|
17
|
+
...selectProps }: BAISelectProps<ValueType, OptionType>): React.ReactElement;
|
|
18
|
+
export default BAISelect;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface BAIStatisticProps {
|
|
3
|
+
title: string;
|
|
4
|
+
current?: number;
|
|
5
|
+
total?: number;
|
|
6
|
+
unit?: string;
|
|
7
|
+
precision?: number;
|
|
8
|
+
infinityDisplay?: string;
|
|
9
|
+
showProgress?: boolean;
|
|
10
|
+
progressSteps?: number;
|
|
11
|
+
}
|
|
12
|
+
declare const BAIStatistic: React.FC<BAIStatisticProps>;
|
|
13
|
+
export default BAIStatistic;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextProps as AntdTextProps } from 'antd/es/typography/Text';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface BAITextProps extends AntdTextProps {
|
|
4
|
+
monospace?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const BAIText: React.FC<BAITextProps>;
|
|
7
|
+
export default BAIText;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DrawerProps, ModalProps } from 'antd';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface BAIUnmountModalAfterCloseProps {
|
|
4
|
+
children: React.ReactElement<ModalProps | DrawerProps>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A React component that conditionally unmounts its child modal or drawer component
|
|
8
|
+
* after it has been closed, preserving exit animations.
|
|
9
|
+
*
|
|
10
|
+
* This component expects a single child element (such as a Modal or Drawer) with an `open` prop.
|
|
11
|
+
* It manages an internal mount state to ensure the child remains mounted during exit animations,
|
|
12
|
+
* and only unmounts after the close animation completes.
|
|
13
|
+
*
|
|
14
|
+
* The component intercepts the child's `afterClose` (for Modal) and `afterOpenChange` (for Drawer)
|
|
15
|
+
* callbacks to update its internal state, while preserving any original callbacks provided.
|
|
16
|
+
*
|
|
17
|
+
* @param {BAIUnmountModalAfterCloseProps} props - The props containing a single child element.
|
|
18
|
+
* @returns {React.ReactElement | null} The cloned child element with enhanced unmounting logic, or null if unmounted.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <UnmountAfterClose>
|
|
22
|
+
* <Modal open={isOpen} afterClose={handleAfterClose} />
|
|
23
|
+
* </UnmountAfterClose>
|
|
24
|
+
*/
|
|
25
|
+
declare const BAIUnmountAfterClose: React.FC<BAIUnmountModalAfterCloseProps>;
|
|
26
|
+
export default BAIUnmountAfterClose;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ResourceData {
|
|
3
|
+
cpu: {
|
|
4
|
+
using: {
|
|
5
|
+
current: number;
|
|
6
|
+
total?: number;
|
|
7
|
+
};
|
|
8
|
+
remaining: {
|
|
9
|
+
current: number;
|
|
10
|
+
total?: number;
|
|
11
|
+
};
|
|
12
|
+
metadata: {
|
|
13
|
+
title: string;
|
|
14
|
+
displayUnit: string;
|
|
15
|
+
};
|
|
16
|
+
} | null;
|
|
17
|
+
memory: {
|
|
18
|
+
using: {
|
|
19
|
+
current: number;
|
|
20
|
+
total?: number;
|
|
21
|
+
};
|
|
22
|
+
remaining: {
|
|
23
|
+
current: number;
|
|
24
|
+
total?: number;
|
|
25
|
+
};
|
|
26
|
+
metadata: {
|
|
27
|
+
title: string;
|
|
28
|
+
displayUnit: string;
|
|
29
|
+
};
|
|
30
|
+
} | null;
|
|
31
|
+
accelerators: Array<{
|
|
32
|
+
key: string;
|
|
33
|
+
using: {
|
|
34
|
+
current: number;
|
|
35
|
+
total?: number;
|
|
36
|
+
};
|
|
37
|
+
remaining: {
|
|
38
|
+
current: number;
|
|
39
|
+
total?: number;
|
|
40
|
+
};
|
|
41
|
+
metadata: {
|
|
42
|
+
title: string;
|
|
43
|
+
displayUnit: string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
interface ResourceStatisticsProps {
|
|
48
|
+
resourceData: ResourceData;
|
|
49
|
+
displayType: 'using' | 'remaining';
|
|
50
|
+
showProgress?: boolean;
|
|
51
|
+
precision?: number;
|
|
52
|
+
progressSteps?: number;
|
|
53
|
+
}
|
|
54
|
+
export declare const processMemoryValue: (value: any, displayUnit: string) => number;
|
|
55
|
+
export declare const convertToNumber: (value: any) => number;
|
|
56
|
+
declare const ResourceStatistics: React.FC<ResourceStatisticsProps>;
|
|
57
|
+
export default ResourceStatistics;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { TablePaginationConfig, TableProps } from 'antd';
|
|
2
|
+
import { AnyObject } from 'antd/es/_util/type';
|
|
3
|
+
import { ColumnType } from 'antd/es/table';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration interface for BAITable pagination
|
|
7
|
+
* Extends Ant Design's TablePaginationConfig but omits 'position' property
|
|
8
|
+
*/
|
|
9
|
+
interface BAITablePaginationConfig extends Omit<TablePaginationConfig, 'position'> {
|
|
10
|
+
/** Additional content to display in the pagination area */
|
|
11
|
+
extraContent?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Column override properties that can be customized
|
|
15
|
+
* Used to override default column behavior like visibility
|
|
16
|
+
*/
|
|
17
|
+
export interface BAITableColumnOverrideItem {
|
|
18
|
+
/** Override the default visibility of a column */
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Record type mapping column keys to their override configurations
|
|
23
|
+
*/
|
|
24
|
+
export type BAITableColumnOverrideRecord = Record<string, BAITableColumnOverrideItem>;
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for table settings including column overrides
|
|
27
|
+
* Supports controllable column visibility and customization
|
|
28
|
+
*/
|
|
29
|
+
export interface BAITableSettings {
|
|
30
|
+
/** Current column property overrides that differ from defaults (controllable) */
|
|
31
|
+
columnOverrides?: Record<string, BAITableColumnOverrideItem>;
|
|
32
|
+
/** Default column overrides to use initially */
|
|
33
|
+
defaultColumnOverrides?: Record<string, BAITableColumnOverrideItem>;
|
|
34
|
+
/** Callback function called when column overrides change */
|
|
35
|
+
onColumnOverridesChange?: (overrides: Record<string, BAITableColumnOverrideItem>) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Extended column type for BAITable with additional properties
|
|
39
|
+
* Extends Ant Design's ColumnType with custom BAI-specific features
|
|
40
|
+
*/
|
|
41
|
+
export interface BAIColumnType<RecordType = any> extends ColumnType<RecordType> {
|
|
42
|
+
/** Whether this column should be hidden by default */
|
|
43
|
+
defaultHidden?: boolean;
|
|
44
|
+
/** Whether this column is required and cannot be hidden by users */
|
|
45
|
+
required?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Array type for BAI table columns
|
|
49
|
+
*/
|
|
50
|
+
export type BAIColumnsType<RecordType = any> = BAIColumnType<RecordType>[];
|
|
51
|
+
/**
|
|
52
|
+
* Utility function to determine if a column should be visible
|
|
53
|
+
* Takes into account required columns, overrides, and default visibility
|
|
54
|
+
*
|
|
55
|
+
* @param column - The column configuration
|
|
56
|
+
* @param columnKey - The unique key for the column
|
|
57
|
+
* @param overrides - Column override settings
|
|
58
|
+
* @returns Whether the column should be visible
|
|
59
|
+
*/
|
|
60
|
+
export declare const isColumnVisible: (column: BAIColumnType<any>, columnKey: string, overrides?: Record<string, BAITableColumnOverrideItem>) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Filters columns to return only visible ones based on overrides
|
|
63
|
+
*
|
|
64
|
+
* @param columns - Array of column configurations
|
|
65
|
+
* @param overrides - Column override settings
|
|
66
|
+
* @returns Filtered array of visible columns
|
|
67
|
+
*/
|
|
68
|
+
export declare const getVisibleColumns: (columns: BAIColumnsType, overrides?: Record<string, BAITableColumnOverrideItem>) => BAIColumnsType;
|
|
69
|
+
/**
|
|
70
|
+
* Restores a specific column to its default settings by removing its override
|
|
71
|
+
*
|
|
72
|
+
* @param overrides - Current column overrides
|
|
73
|
+
* @param columnKey - Key of the column to restore
|
|
74
|
+
* @returns New overrides object without the specified column override
|
|
75
|
+
*/
|
|
76
|
+
export declare const restoreColumnToDefault: (overrides: Record<string, BAITableColumnOverrideItem>, columnKey: string) => Record<string, BAITableColumnOverrideItem>;
|
|
77
|
+
/**
|
|
78
|
+
* Restores all columns to their default settings by clearing all overrides
|
|
79
|
+
*
|
|
80
|
+
* @returns Empty overrides object
|
|
81
|
+
*/
|
|
82
|
+
export declare const restoreAllColumnsToDefault: () => Record<string, BAITableColumnOverrideItem>;
|
|
83
|
+
type BAITableBaseProps<RecordType> = Omit<TableProps<RecordType>, 'onChange'>;
|
|
84
|
+
/**
|
|
85
|
+
* Props interface for BAITable component
|
|
86
|
+
* Extends Ant Design's TableProps with additional BAI-specific features
|
|
87
|
+
*/
|
|
88
|
+
export interface BAITableProps<RecordType extends AnyObject> extends BAITableBaseProps<RecordType> {
|
|
89
|
+
/** Pagination configuration or false to disable pagination */
|
|
90
|
+
pagination?: false | BAITablePaginationConfig;
|
|
91
|
+
/** Whether columns should be resizable */
|
|
92
|
+
resizable?: boolean;
|
|
93
|
+
/** Current sort order string (e.g., 'name' or '-name' for descending) */
|
|
94
|
+
order?: string;
|
|
95
|
+
/** Callback function called when sort order changes */
|
|
96
|
+
onChangeOrder?: (order?: string) => void;
|
|
97
|
+
/** Table settings including column visibility controls */
|
|
98
|
+
tableSettings?: BAITableSettings;
|
|
99
|
+
/** Array of column configurations using BAIColumnType */
|
|
100
|
+
columns?: BAIColumnsType<RecordType>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* BAITable - Enhanced table component with column management and sorting
|
|
104
|
+
*
|
|
105
|
+
* A comprehensive table component that extends Ant Design's Table with:
|
|
106
|
+
* - Column visibility controls with settings modal
|
|
107
|
+
* - Resizable columns support
|
|
108
|
+
* - Enhanced sorting with order string support
|
|
109
|
+
* - Persistent column overrides
|
|
110
|
+
* - Custom pagination layout
|
|
111
|
+
*
|
|
112
|
+
* @param props - BAITableProps configuration
|
|
113
|
+
* @returns React element
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```tsx
|
|
117
|
+
* const columns = [
|
|
118
|
+
* { title: 'Name', dataIndex: 'name', key: 'name' },
|
|
119
|
+
* { title: 'Age', dataIndex: 'age', key: 'age', defaultHidden: true }
|
|
120
|
+
* ];
|
|
121
|
+
*
|
|
122
|
+
* <BAITable
|
|
123
|
+
* columns={columns}
|
|
124
|
+
* dataSource={data}
|
|
125
|
+
* tableSettings={{
|
|
126
|
+
* columnOverrides: {},
|
|
127
|
+
* onColumnOverridesChange: setColumnOverrides
|
|
128
|
+
* }}
|
|
129
|
+
* />
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
declare const BAITable: <RecordType extends object = any>({ resizable, columns, components, loading, order, onChangeOrder, tableSettings, ...tableProps }: BAITableProps<RecordType>) => React.ReactElement;
|
|
133
|
+
export default BAITable;
|