elseware-ui 2.36.4 → 2.36.6
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/index.css +60 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +28 -5
- package/dist/index.d.ts +28 -5
- package/dist/index.js +164 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +164 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2204,18 +2204,41 @@ declare const ThemeSwitch: () => React__default.JSX.Element | null;
|
|
|
2204
2204
|
|
|
2205
2205
|
declare const ShapeSwitch: () => React__default.JSX.Element;
|
|
2206
2206
|
|
|
2207
|
+
type AsyncLoadingType = "spinner" | "skeleton";
|
|
2207
2208
|
interface AsyncComponentWrapperProps {
|
|
2208
2209
|
children: React__default.ReactNode;
|
|
2209
2210
|
isLoading?: boolean;
|
|
2211
|
+
isFetching?: boolean;
|
|
2210
2212
|
isSuccess?: boolean;
|
|
2211
2213
|
isError?: boolean;
|
|
2214
|
+
isUninitialized?: boolean;
|
|
2212
2215
|
error?: unknown;
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
+
isEmpty?: boolean;
|
|
2217
|
+
loadingText?: string;
|
|
2218
|
+
fetchingText?: string;
|
|
2219
|
+
emptyTitle?: string;
|
|
2220
|
+
emptyText?: string;
|
|
2221
|
+
errorTitle?: string;
|
|
2222
|
+
retryText?: string;
|
|
2223
|
+
loadingType?: AsyncLoadingType;
|
|
2224
|
+
skeletonCount?: number;
|
|
2225
|
+
skeletonClassName?: string;
|
|
2226
|
+
skeletonWrapperClassName?: string;
|
|
2227
|
+
spinnerProps?: Partial<SpinnerProps>;
|
|
2228
|
+
fetchingSpinnerProps?: Partial<SpinnerProps>;
|
|
2229
|
+
loadingFallback?: React__default.ReactNode;
|
|
2230
|
+
emptyFallback?: React__default.ReactNode;
|
|
2231
|
+
errorFallback?: React__default.ReactNode | ((message: string) => React__default.ReactNode);
|
|
2232
|
+
showFetchingIndicator?: boolean;
|
|
2233
|
+
onRetry?: () => void;
|
|
2216
2234
|
errorFormatter?: (error: unknown) => string;
|
|
2235
|
+
className?: string;
|
|
2236
|
+
contentClassName?: string;
|
|
2237
|
+
stateClassName?: string;
|
|
2217
2238
|
}
|
|
2218
|
-
|
|
2239
|
+
|
|
2240
|
+
declare function AsyncComponentWrapper({ children, isLoading, isFetching, isSuccess, isError, isUninitialized, error, isEmpty, loadingText, fetchingText, emptyTitle, emptyText, errorTitle, retryText, loadingType, skeletonCount, skeletonClassName, skeletonWrapperClassName, spinnerProps, fetchingSpinnerProps, loadingFallback, emptyFallback, errorFallback, showFetchingIndicator, onRetry, errorFormatter, className, contentClassName, stateClassName, }: AsyncComponentWrapperProps): React__default.JSX.Element | null;
|
|
2241
|
+
declare const _default: React__default.MemoExoticComponent<typeof AsyncComponentWrapper>;
|
|
2219
2242
|
|
|
2220
2243
|
interface GlowWrapperProps {
|
|
2221
2244
|
children: ReactNode;
|
|
@@ -2886,4 +2909,4 @@ type ConfigBootstrapProps = {
|
|
|
2886
2909
|
};
|
|
2887
2910
|
declare function ConfigBootstrap({ config, loadApp, ErrorComponent, LoadingComponent, loadingFallback, showStack, }: ConfigBootstrapProps): React$1.JSX.Element;
|
|
2888
2911
|
|
|
2889
|
-
export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AreaPlot, AsyncComponentWrapper, Avatar, Backdrop, Badge, type BarChartProps, BarPlot, type BaseAnimationConfig, BaseChartDataSource, type BaseChartProps, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, type BootstrapConfigLike, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, type BrowserRedirectURLOptions, Button, CHART_COLOR_PALETTE, CHART_DARK_THEME, CHART_DATA_MODES, CHART_DEFAULT_ACTIVE_DOT_RADIUS, CHART_DEFAULT_ANIMATION_DURATION, CHART_DEFAULT_BAR_RADIUS, CHART_DEFAULT_DOT_RADIUS, CHART_DEFAULT_HEIGHT, CHART_DEFAULT_MARGIN, CHART_DEFAULT_MAX_REALTIME_POINTS, CHART_DEFAULT_POLLING_INTERVAL, CHART_DEFAULT_STROKE_WIDTH, CHART_EMPTY_MESSAGE, CHART_ERROR_MESSAGE, CHART_LIGHT_THEME, CHART_LOADING_MESSAGE, CHART_STATUSES, CHART_STATUS_COLORS, CHART_VALUE_FORMATS, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Chart, type ChartAction, type ChartBarConfig, type ChartChartType, type ChartColorName, ChartContainer, type ChartContainerProps, ChartContext, type ChartContextValue, type ChartDataHandler, type ChartDataMode, type ChartDataPoint, type ChartDataSource, ChartEmptyState, type ChartEmptyStateProps, type ChartErrorHandler, ChartErrorState, type ChartErrorStateProps, type ChartGaugeConfig, ChartHeader, type ChartHeaderProps, ChartLegend, type ChartLegendItem, type ChartLegendProps, ChartLoadingState, type ChartLoadingStateProps, ChartPanel, type ChartPanelConfig, type ChartPanelProps, type ChartPieConfig, type ChartPrimitive, type ChartProps, ChartProvider, type ChartProviderProps, type ChartRenderChartProps, type ChartSeries, type ChartSeriesColor, type ChartSeriesType, type ChartStatConfig, type ChartState, type ChartStatus, type ChartTheme, type ChartThemeChart, type ChartThemeMode, type ChartThemePanel, type ChartThemeText, type ChartThemeTooltip, ChartToolbar, type ChartToolbarProps, ChartTooltip, type ChartTooltipFormatterOptions, type ChartTooltipPayload, type ChartTooltipProps, type ChartUnsubscribe, type ChartValueFormat, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentItemProps, type CommentListProps, type CommentMenuProps, type CommentPageResult, type CommentPermissions, type CommentQueryOptions, type CommentRepliesToggleProps, type CommentReplyCache, CommentThread, type CommentThreadConfig, type CommentThreadProps, ConfigBootstrap, type ConfigBootstrapProps, type ConfigSchema, type ConfigSchemaFailure, type ConfigSchemaResult, type ConfigSchemaSuccess, type ConfigTransform, type ConfigTransformContext, Configurator, ConfiguratorError, type ConfiguratorFailure, type ConfiguratorOptions, type ConfiguratorState, type ConfiguratorSuccess, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CreateURLResolverOptions, type CurrencyCode, DEFAULT_CHART_THEME, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, EnvErrorScreen, type EnvErrorScreenProps, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, type FormatChartValueOptions, type GaugeChartProps, GaugePlot, GenericLayout, type GetAllowedOriginsOptions, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, InfiniteScrollTrigger, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, type LimitRealtimePointsOptions, LinePlot, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, type NormalizeChartDataOptions, type NormalizedChartDataPoint, type NormalizedToastStatus, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, type PieChartProps, PiePlot, PollingChartDataSource, type PollingChartDataSourceConfig, type PollingChartDataSourceOptions, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type RawChartDataPoint, RealtimeChartDataSource, type RealtimeChartDataSourceConfig, type RealtimeChartDataSourceOptions, type ReplyComposerProps, type ResolveChartColorOptions, type ResolvedChartSeries, type RootAppModule, RouteTab, type RouteTabMode, RouteTabs, type SafeRedirectOptions, ScatterPlot, ScrollToTop, Section, Select, type SendToastOptions, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, Spinner, type SpinnerDirection, type SpinnerProps, type SpinnerType, StarRating, StarRatingDistribution, StarRatingInput, type StatChartProps, StatPlot, StaticChartDataSource, type StaticChartDataSourceConfig, type StaticChartDataSourceOptions, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToastItemData, type ToastProps, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionAccordion, TransitionBase, TransitionDropdown, TransitionFade, TransitionFadeIn, TransitionScale, TransitionSlide, Typography, type URLMap, type URLMapSource, type URLQueryParams, type URLQueryValue, UnderConstructionBanner, type UpdateCommentInput, type UseChartDataOptions, type UseChartDataReturn, type UseChartPollingOptions, type UseChartRealtimeOptions, type UseChartSeriesOptions, type UseChartThemeOptions, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, addReplyToCache, applyReactionState, assertAbsoluteURL, buildURL, chartReducer, cn, createConfigurator, createForceLayout, createGridLayout, createInitialChartState, createTreeLayout, createURLResolver, decrementReplyCount, enumValues, euiToast, formatChartValue, formatCommentDate, formatConfigError, getAllowedOrigins, getBrowserHref, getBrowserOrigin, getBrowserRedirectURL, getCurrencySymbol, getLayout, getOptimisticDislikeState, getOptimisticLikeState, getSafeRedirect, incrementReplyCount, isMatch, isRenderFn, limitRealtimePoints, normalize, normalizeChartData, normalizeChartDataPoint, parseJson, parseJsonRecord, parseUrlMap, registerLayout, removeComment, removeCommentTreeFromCache, replaceRealtimePoints, resolveAppearanceStyles, resolveChartColor, resolveChartColors, resolveWithGlobal, sendToast, toConfiguratorError, updateComment, updateReplyCacheComment, useChartContext, useChartData, useChartPolling, useChartRealtime, useChartSeries, useChartTheme, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
|
|
2912
|
+
export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AreaPlot, _default as AsyncComponentWrapper, Avatar, Backdrop, Badge, type BarChartProps, BarPlot, type BaseAnimationConfig, BaseChartDataSource, type BaseChartProps, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, type BootstrapConfigLike, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, type BrowserRedirectURLOptions, Button, CHART_COLOR_PALETTE, CHART_DARK_THEME, CHART_DATA_MODES, CHART_DEFAULT_ACTIVE_DOT_RADIUS, CHART_DEFAULT_ANIMATION_DURATION, CHART_DEFAULT_BAR_RADIUS, CHART_DEFAULT_DOT_RADIUS, CHART_DEFAULT_HEIGHT, CHART_DEFAULT_MARGIN, CHART_DEFAULT_MAX_REALTIME_POINTS, CHART_DEFAULT_POLLING_INTERVAL, CHART_DEFAULT_STROKE_WIDTH, CHART_EMPTY_MESSAGE, CHART_ERROR_MESSAGE, CHART_LIGHT_THEME, CHART_LOADING_MESSAGE, CHART_STATUSES, CHART_STATUS_COLORS, CHART_VALUE_FORMATS, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Chart, type ChartAction, type ChartBarConfig, type ChartChartType, type ChartColorName, ChartContainer, type ChartContainerProps, ChartContext, type ChartContextValue, type ChartDataHandler, type ChartDataMode, type ChartDataPoint, type ChartDataSource, ChartEmptyState, type ChartEmptyStateProps, type ChartErrorHandler, ChartErrorState, type ChartErrorStateProps, type ChartGaugeConfig, ChartHeader, type ChartHeaderProps, ChartLegend, type ChartLegendItem, type ChartLegendProps, ChartLoadingState, type ChartLoadingStateProps, ChartPanel, type ChartPanelConfig, type ChartPanelProps, type ChartPieConfig, type ChartPrimitive, type ChartProps, ChartProvider, type ChartProviderProps, type ChartRenderChartProps, type ChartSeries, type ChartSeriesColor, type ChartSeriesType, type ChartStatConfig, type ChartState, type ChartStatus, type ChartTheme, type ChartThemeChart, type ChartThemeMode, type ChartThemePanel, type ChartThemeText, type ChartThemeTooltip, ChartToolbar, type ChartToolbarProps, ChartTooltip, type ChartTooltipFormatterOptions, type ChartTooltipPayload, type ChartTooltipProps, type ChartUnsubscribe, type ChartValueFormat, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentItemProps, type CommentListProps, type CommentMenuProps, type CommentPageResult, type CommentPermissions, type CommentQueryOptions, type CommentRepliesToggleProps, type CommentReplyCache, CommentThread, type CommentThreadConfig, type CommentThreadProps, ConfigBootstrap, type ConfigBootstrapProps, type ConfigSchema, type ConfigSchemaFailure, type ConfigSchemaResult, type ConfigSchemaSuccess, type ConfigTransform, type ConfigTransformContext, Configurator, ConfiguratorError, type ConfiguratorFailure, type ConfiguratorOptions, type ConfiguratorState, type ConfiguratorSuccess, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CreateURLResolverOptions, type CurrencyCode, DEFAULT_CHART_THEME, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, EnvErrorScreen, type EnvErrorScreenProps, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, type FormatChartValueOptions, type GaugeChartProps, GaugePlot, GenericLayout, type GetAllowedOriginsOptions, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, InfiniteScrollTrigger, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, type LimitRealtimePointsOptions, LinePlot, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, type NormalizeChartDataOptions, type NormalizedChartDataPoint, type NormalizedToastStatus, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, type PieChartProps, PiePlot, PollingChartDataSource, type PollingChartDataSourceConfig, type PollingChartDataSourceOptions, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type RawChartDataPoint, RealtimeChartDataSource, type RealtimeChartDataSourceConfig, type RealtimeChartDataSourceOptions, type ReplyComposerProps, type ResolveChartColorOptions, type ResolvedChartSeries, type RootAppModule, RouteTab, type RouteTabMode, RouteTabs, type SafeRedirectOptions, ScatterPlot, ScrollToTop, Section, Select, type SendToastOptions, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, Spinner, type SpinnerDirection, type SpinnerProps, type SpinnerType, StarRating, StarRatingDistribution, StarRatingInput, type StatChartProps, StatPlot, StaticChartDataSource, type StaticChartDataSourceConfig, type StaticChartDataSourceOptions, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToastItemData, type ToastProps, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionAccordion, TransitionBase, TransitionDropdown, TransitionFade, TransitionFadeIn, TransitionScale, TransitionSlide, Typography, type URLMap, type URLMapSource, type URLQueryParams, type URLQueryValue, UnderConstructionBanner, type UpdateCommentInput, type UseChartDataOptions, type UseChartDataReturn, type UseChartPollingOptions, type UseChartRealtimeOptions, type UseChartSeriesOptions, type UseChartThemeOptions, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, addReplyToCache, applyReactionState, assertAbsoluteURL, buildURL, chartReducer, cn, createConfigurator, createForceLayout, createGridLayout, createInitialChartState, createTreeLayout, createURLResolver, decrementReplyCount, enumValues, euiToast, formatChartValue, formatCommentDate, formatConfigError, getAllowedOrigins, getBrowserHref, getBrowserOrigin, getBrowserRedirectURL, getCurrencySymbol, getLayout, getOptimisticDislikeState, getOptimisticLikeState, getSafeRedirect, incrementReplyCount, isMatch, isRenderFn, limitRealtimePoints, normalize, normalizeChartData, normalizeChartDataPoint, parseJson, parseJsonRecord, parseUrlMap, registerLayout, removeComment, removeCommentTreeFromCache, replaceRealtimePoints, resolveAppearanceStyles, resolveChartColor, resolveChartColors, resolveWithGlobal, sendToast, toConfiguratorError, updateComment, updateReplyCacheComment, useChartContext, useChartData, useChartPolling, useChartRealtime, useChartSeries, useChartTheme, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -2204,18 +2204,41 @@ declare const ThemeSwitch: () => React__default.JSX.Element | null;
|
|
|
2204
2204
|
|
|
2205
2205
|
declare const ShapeSwitch: () => React__default.JSX.Element;
|
|
2206
2206
|
|
|
2207
|
+
type AsyncLoadingType = "spinner" | "skeleton";
|
|
2207
2208
|
interface AsyncComponentWrapperProps {
|
|
2208
2209
|
children: React__default.ReactNode;
|
|
2209
2210
|
isLoading?: boolean;
|
|
2211
|
+
isFetching?: boolean;
|
|
2210
2212
|
isSuccess?: boolean;
|
|
2211
2213
|
isError?: boolean;
|
|
2214
|
+
isUninitialized?: boolean;
|
|
2212
2215
|
error?: unknown;
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
+
isEmpty?: boolean;
|
|
2217
|
+
loadingText?: string;
|
|
2218
|
+
fetchingText?: string;
|
|
2219
|
+
emptyTitle?: string;
|
|
2220
|
+
emptyText?: string;
|
|
2221
|
+
errorTitle?: string;
|
|
2222
|
+
retryText?: string;
|
|
2223
|
+
loadingType?: AsyncLoadingType;
|
|
2224
|
+
skeletonCount?: number;
|
|
2225
|
+
skeletonClassName?: string;
|
|
2226
|
+
skeletonWrapperClassName?: string;
|
|
2227
|
+
spinnerProps?: Partial<SpinnerProps>;
|
|
2228
|
+
fetchingSpinnerProps?: Partial<SpinnerProps>;
|
|
2229
|
+
loadingFallback?: React__default.ReactNode;
|
|
2230
|
+
emptyFallback?: React__default.ReactNode;
|
|
2231
|
+
errorFallback?: React__default.ReactNode | ((message: string) => React__default.ReactNode);
|
|
2232
|
+
showFetchingIndicator?: boolean;
|
|
2233
|
+
onRetry?: () => void;
|
|
2216
2234
|
errorFormatter?: (error: unknown) => string;
|
|
2235
|
+
className?: string;
|
|
2236
|
+
contentClassName?: string;
|
|
2237
|
+
stateClassName?: string;
|
|
2217
2238
|
}
|
|
2218
|
-
|
|
2239
|
+
|
|
2240
|
+
declare function AsyncComponentWrapper({ children, isLoading, isFetching, isSuccess, isError, isUninitialized, error, isEmpty, loadingText, fetchingText, emptyTitle, emptyText, errorTitle, retryText, loadingType, skeletonCount, skeletonClassName, skeletonWrapperClassName, spinnerProps, fetchingSpinnerProps, loadingFallback, emptyFallback, errorFallback, showFetchingIndicator, onRetry, errorFormatter, className, contentClassName, stateClassName, }: AsyncComponentWrapperProps): React__default.JSX.Element | null;
|
|
2241
|
+
declare const _default: React__default.MemoExoticComponent<typeof AsyncComponentWrapper>;
|
|
2219
2242
|
|
|
2220
2243
|
interface GlowWrapperProps {
|
|
2221
2244
|
children: ReactNode;
|
|
@@ -2886,4 +2909,4 @@ type ConfigBootstrapProps = {
|
|
|
2886
2909
|
};
|
|
2887
2910
|
declare function ConfigBootstrap({ config, loadApp, ErrorComponent, LoadingComponent, loadingFallback, showStack, }: ConfigBootstrapProps): React$1.JSX.Element;
|
|
2888
2911
|
|
|
2889
|
-
export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AreaPlot, AsyncComponentWrapper, Avatar, Backdrop, Badge, type BarChartProps, BarPlot, type BaseAnimationConfig, BaseChartDataSource, type BaseChartProps, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, type BootstrapConfigLike, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, type BrowserRedirectURLOptions, Button, CHART_COLOR_PALETTE, CHART_DARK_THEME, CHART_DATA_MODES, CHART_DEFAULT_ACTIVE_DOT_RADIUS, CHART_DEFAULT_ANIMATION_DURATION, CHART_DEFAULT_BAR_RADIUS, CHART_DEFAULT_DOT_RADIUS, CHART_DEFAULT_HEIGHT, CHART_DEFAULT_MARGIN, CHART_DEFAULT_MAX_REALTIME_POINTS, CHART_DEFAULT_POLLING_INTERVAL, CHART_DEFAULT_STROKE_WIDTH, CHART_EMPTY_MESSAGE, CHART_ERROR_MESSAGE, CHART_LIGHT_THEME, CHART_LOADING_MESSAGE, CHART_STATUSES, CHART_STATUS_COLORS, CHART_VALUE_FORMATS, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Chart, type ChartAction, type ChartBarConfig, type ChartChartType, type ChartColorName, ChartContainer, type ChartContainerProps, ChartContext, type ChartContextValue, type ChartDataHandler, type ChartDataMode, type ChartDataPoint, type ChartDataSource, ChartEmptyState, type ChartEmptyStateProps, type ChartErrorHandler, ChartErrorState, type ChartErrorStateProps, type ChartGaugeConfig, ChartHeader, type ChartHeaderProps, ChartLegend, type ChartLegendItem, type ChartLegendProps, ChartLoadingState, type ChartLoadingStateProps, ChartPanel, type ChartPanelConfig, type ChartPanelProps, type ChartPieConfig, type ChartPrimitive, type ChartProps, ChartProvider, type ChartProviderProps, type ChartRenderChartProps, type ChartSeries, type ChartSeriesColor, type ChartSeriesType, type ChartStatConfig, type ChartState, type ChartStatus, type ChartTheme, type ChartThemeChart, type ChartThemeMode, type ChartThemePanel, type ChartThemeText, type ChartThemeTooltip, ChartToolbar, type ChartToolbarProps, ChartTooltip, type ChartTooltipFormatterOptions, type ChartTooltipPayload, type ChartTooltipProps, type ChartUnsubscribe, type ChartValueFormat, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentItemProps, type CommentListProps, type CommentMenuProps, type CommentPageResult, type CommentPermissions, type CommentQueryOptions, type CommentRepliesToggleProps, type CommentReplyCache, CommentThread, type CommentThreadConfig, type CommentThreadProps, ConfigBootstrap, type ConfigBootstrapProps, type ConfigSchema, type ConfigSchemaFailure, type ConfigSchemaResult, type ConfigSchemaSuccess, type ConfigTransform, type ConfigTransformContext, Configurator, ConfiguratorError, type ConfiguratorFailure, type ConfiguratorOptions, type ConfiguratorState, type ConfiguratorSuccess, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CreateURLResolverOptions, type CurrencyCode, DEFAULT_CHART_THEME, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, EnvErrorScreen, type EnvErrorScreenProps, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, type FormatChartValueOptions, type GaugeChartProps, GaugePlot, GenericLayout, type GetAllowedOriginsOptions, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, InfiniteScrollTrigger, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, type LimitRealtimePointsOptions, LinePlot, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, type NormalizeChartDataOptions, type NormalizedChartDataPoint, type NormalizedToastStatus, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, type PieChartProps, PiePlot, PollingChartDataSource, type PollingChartDataSourceConfig, type PollingChartDataSourceOptions, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type RawChartDataPoint, RealtimeChartDataSource, type RealtimeChartDataSourceConfig, type RealtimeChartDataSourceOptions, type ReplyComposerProps, type ResolveChartColorOptions, type ResolvedChartSeries, type RootAppModule, RouteTab, type RouteTabMode, RouteTabs, type SafeRedirectOptions, ScatterPlot, ScrollToTop, Section, Select, type SendToastOptions, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, Spinner, type SpinnerDirection, type SpinnerProps, type SpinnerType, StarRating, StarRatingDistribution, StarRatingInput, type StatChartProps, StatPlot, StaticChartDataSource, type StaticChartDataSourceConfig, type StaticChartDataSourceOptions, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToastItemData, type ToastProps, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionAccordion, TransitionBase, TransitionDropdown, TransitionFade, TransitionFadeIn, TransitionScale, TransitionSlide, Typography, type URLMap, type URLMapSource, type URLQueryParams, type URLQueryValue, UnderConstructionBanner, type UpdateCommentInput, type UseChartDataOptions, type UseChartDataReturn, type UseChartPollingOptions, type UseChartRealtimeOptions, type UseChartSeriesOptions, type UseChartThemeOptions, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, addReplyToCache, applyReactionState, assertAbsoluteURL, buildURL, chartReducer, cn, createConfigurator, createForceLayout, createGridLayout, createInitialChartState, createTreeLayout, createURLResolver, decrementReplyCount, enumValues, euiToast, formatChartValue, formatCommentDate, formatConfigError, getAllowedOrigins, getBrowserHref, getBrowserOrigin, getBrowserRedirectURL, getCurrencySymbol, getLayout, getOptimisticDislikeState, getOptimisticLikeState, getSafeRedirect, incrementReplyCount, isMatch, isRenderFn, limitRealtimePoints, normalize, normalizeChartData, normalizeChartDataPoint, parseJson, parseJsonRecord, parseUrlMap, registerLayout, removeComment, removeCommentTreeFromCache, replaceRealtimePoints, resolveAppearanceStyles, resolveChartColor, resolveChartColors, resolveWithGlobal, sendToast, toConfiguratorError, updateComment, updateReplyCacheComment, useChartContext, useChartData, useChartPolling, useChartRealtime, useChartSeries, useChartTheme, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
|
|
2912
|
+
export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AreaPlot, _default as AsyncComponentWrapper, Avatar, Backdrop, Badge, type BarChartProps, BarPlot, type BaseAnimationConfig, BaseChartDataSource, type BaseChartProps, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, type BootstrapConfigLike, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, type BrowserRedirectURLOptions, Button, CHART_COLOR_PALETTE, CHART_DARK_THEME, CHART_DATA_MODES, CHART_DEFAULT_ACTIVE_DOT_RADIUS, CHART_DEFAULT_ANIMATION_DURATION, CHART_DEFAULT_BAR_RADIUS, CHART_DEFAULT_DOT_RADIUS, CHART_DEFAULT_HEIGHT, CHART_DEFAULT_MARGIN, CHART_DEFAULT_MAX_REALTIME_POINTS, CHART_DEFAULT_POLLING_INTERVAL, CHART_DEFAULT_STROKE_WIDTH, CHART_EMPTY_MESSAGE, CHART_ERROR_MESSAGE, CHART_LIGHT_THEME, CHART_LOADING_MESSAGE, CHART_STATUSES, CHART_STATUS_COLORS, CHART_VALUE_FORMATS, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Chart, type ChartAction, type ChartBarConfig, type ChartChartType, type ChartColorName, ChartContainer, type ChartContainerProps, ChartContext, type ChartContextValue, type ChartDataHandler, type ChartDataMode, type ChartDataPoint, type ChartDataSource, ChartEmptyState, type ChartEmptyStateProps, type ChartErrorHandler, ChartErrorState, type ChartErrorStateProps, type ChartGaugeConfig, ChartHeader, type ChartHeaderProps, ChartLegend, type ChartLegendItem, type ChartLegendProps, ChartLoadingState, type ChartLoadingStateProps, ChartPanel, type ChartPanelConfig, type ChartPanelProps, type ChartPieConfig, type ChartPrimitive, type ChartProps, ChartProvider, type ChartProviderProps, type ChartRenderChartProps, type ChartSeries, type ChartSeriesColor, type ChartSeriesType, type ChartStatConfig, type ChartState, type ChartStatus, type ChartTheme, type ChartThemeChart, type ChartThemeMode, type ChartThemePanel, type ChartThemeText, type ChartThemeTooltip, ChartToolbar, type ChartToolbarProps, ChartTooltip, type ChartTooltipFormatterOptions, type ChartTooltipPayload, type ChartTooltipProps, type ChartUnsubscribe, type ChartValueFormat, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentItemProps, type CommentListProps, type CommentMenuProps, type CommentPageResult, type CommentPermissions, type CommentQueryOptions, type CommentRepliesToggleProps, type CommentReplyCache, CommentThread, type CommentThreadConfig, type CommentThreadProps, ConfigBootstrap, type ConfigBootstrapProps, type ConfigSchema, type ConfigSchemaFailure, type ConfigSchemaResult, type ConfigSchemaSuccess, type ConfigTransform, type ConfigTransformContext, Configurator, ConfiguratorError, type ConfiguratorFailure, type ConfiguratorOptions, type ConfiguratorState, type ConfiguratorSuccess, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CreateURLResolverOptions, type CurrencyCode, DEFAULT_CHART_THEME, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, EnvErrorScreen, type EnvErrorScreenProps, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, type FormatChartValueOptions, type GaugeChartProps, GaugePlot, GenericLayout, type GetAllowedOriginsOptions, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, InfiniteScrollTrigger, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, type LimitRealtimePointsOptions, LinePlot, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, type NormalizeChartDataOptions, type NormalizedChartDataPoint, type NormalizedToastStatus, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, type PieChartProps, PiePlot, PollingChartDataSource, type PollingChartDataSourceConfig, type PollingChartDataSourceOptions, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type RawChartDataPoint, RealtimeChartDataSource, type RealtimeChartDataSourceConfig, type RealtimeChartDataSourceOptions, type ReplyComposerProps, type ResolveChartColorOptions, type ResolvedChartSeries, type RootAppModule, RouteTab, type RouteTabMode, RouteTabs, type SafeRedirectOptions, ScatterPlot, ScrollToTop, Section, Select, type SendToastOptions, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, Spinner, type SpinnerDirection, type SpinnerProps, type SpinnerType, StarRating, StarRatingDistribution, StarRatingInput, type StatChartProps, StatPlot, StaticChartDataSource, type StaticChartDataSourceConfig, type StaticChartDataSourceOptions, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToastItemData, type ToastProps, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionAccordion, TransitionBase, TransitionDropdown, TransitionFade, TransitionFadeIn, TransitionScale, TransitionSlide, Typography, type URLMap, type URLMapSource, type URLQueryParams, type URLQueryValue, UnderConstructionBanner, type UpdateCommentInput, type UseChartDataOptions, type UseChartDataReturn, type UseChartPollingOptions, type UseChartRealtimeOptions, type UseChartSeriesOptions, type UseChartThemeOptions, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, addReplyToCache, applyReactionState, assertAbsoluteURL, buildURL, chartReducer, cn, createConfigurator, createForceLayout, createGridLayout, createInitialChartState, createTreeLayout, createURLResolver, decrementReplyCount, enumValues, euiToast, formatChartValue, formatCommentDate, formatConfigError, getAllowedOrigins, getBrowserHref, getBrowserOrigin, getBrowserRedirectURL, getCurrencySymbol, getLayout, getOptimisticDislikeState, getOptimisticLikeState, getSafeRedirect, incrementReplyCount, isMatch, isRenderFn, limitRealtimePoints, normalize, normalizeChartData, normalizeChartDataPoint, parseJson, parseJsonRecord, parseUrlMap, registerLayout, removeComment, removeCommentTreeFromCache, replaceRealtimePoints, resolveAppearanceStyles, resolveChartColor, resolveChartColors, resolveWithGlobal, sendToast, toConfiguratorError, updateComment, updateReplyCacheComment, useChartContext, useChartData, useChartPolling, useChartRealtime, useChartSeries, useChartTheme, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -21068,16 +21068,70 @@ function UnderConstructionBanner({
|
|
|
21068
21068
|
}) {
|
|
21069
21069
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-5", children: /* @__PURE__ */ jsxRuntime.jsx(Info_default, { children: text ? text : "This component is currently under construction and will be made available soon" }) });
|
|
21070
21070
|
}
|
|
21071
|
+
function AsyncStateCard({
|
|
21072
|
+
type,
|
|
21073
|
+
title,
|
|
21074
|
+
message,
|
|
21075
|
+
actionText,
|
|
21076
|
+
actionLoading,
|
|
21077
|
+
onAction,
|
|
21078
|
+
className
|
|
21079
|
+
}) {
|
|
21080
|
+
const isError = type === "error";
|
|
21081
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21082
|
+
"div",
|
|
21083
|
+
{
|
|
21084
|
+
className: cn(
|
|
21085
|
+
"flex min-h-[220px] w-full items-center justify-center rounded-xl border p-6",
|
|
21086
|
+
"border-eui-dark-300/10 bg-white/70 shadow-sm",
|
|
21087
|
+
"dark:border-eui-light-400/10 dark:bg-eui-dark-900/40",
|
|
21088
|
+
className
|
|
21089
|
+
),
|
|
21090
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-md flex-col items-center gap-4 text-center", children: [
|
|
21091
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21092
|
+
"div",
|
|
21093
|
+
{
|
|
21094
|
+
className: cn(
|
|
21095
|
+
"flex h-12 w-12 items-center justify-center rounded-full text-xl font-bold",
|
|
21096
|
+
isError ? "bg-eui-danger-500/10 text-eui-danger-500" : "bg-eui-dark-500/10 text-eui-dark-500 dark:bg-eui-light-500/10 dark:text-eui-light-400"
|
|
21097
|
+
),
|
|
21098
|
+
children: isError ? "!" : "\u2013"
|
|
21099
|
+
}
|
|
21100
|
+
),
|
|
21101
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
21102
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-eui-dark-900 dark:text-eui-light-50", children: title }),
|
|
21103
|
+
isError ? /* @__PURE__ */ jsxRuntime.jsx(FormResponse_default, { text: message, variant: "danger" }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-eui-dark-500 dark:text-eui-light-400", children: message })
|
|
21104
|
+
] }),
|
|
21105
|
+
onAction && actionText && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21106
|
+
Button_default,
|
|
21107
|
+
{
|
|
21108
|
+
type: "button",
|
|
21109
|
+
text: actionText,
|
|
21110
|
+
loading: actionLoading,
|
|
21111
|
+
disabled: actionLoading,
|
|
21112
|
+
onClick: onAction,
|
|
21113
|
+
variant: isError ? "danger" : "primary",
|
|
21114
|
+
appearance: "solid",
|
|
21115
|
+
size: "sm"
|
|
21116
|
+
}
|
|
21117
|
+
)
|
|
21118
|
+
] })
|
|
21119
|
+
}
|
|
21120
|
+
);
|
|
21121
|
+
}
|
|
21122
|
+
var AsyncStateCard_default = React2__default.default.memo(AsyncStateCard);
|
|
21123
|
+
|
|
21124
|
+
// src/components/utils/async-component-wrapper/asyncError.utils.ts
|
|
21071
21125
|
var getDefaultErrorMessage = (error) => {
|
|
21072
21126
|
if (!error) return "Something went wrong.";
|
|
21073
21127
|
if (typeof error === "string") return error;
|
|
21074
21128
|
if (error instanceof Error) return error.message;
|
|
21075
21129
|
if (typeof error === "object") {
|
|
21076
21130
|
const anyErr = error;
|
|
21077
|
-
if (anyErr?.data?.message
|
|
21131
|
+
if (typeof anyErr?.data?.message === "string") {
|
|
21078
21132
|
return anyErr.data.message;
|
|
21079
21133
|
}
|
|
21080
|
-
if (
|
|
21134
|
+
if (typeof anyErr?.message === "string") {
|
|
21081
21135
|
return anyErr.message;
|
|
21082
21136
|
}
|
|
21083
21137
|
if (anyErr?.status) {
|
|
@@ -21093,20 +21147,118 @@ var getDefaultErrorMessage = (error) => {
|
|
|
21093
21147
|
};
|
|
21094
21148
|
function AsyncComponentWrapper({
|
|
21095
21149
|
children,
|
|
21096
|
-
isLoading,
|
|
21097
|
-
|
|
21098
|
-
|
|
21150
|
+
isLoading = false,
|
|
21151
|
+
isFetching = false,
|
|
21152
|
+
isSuccess,
|
|
21153
|
+
isError = false,
|
|
21154
|
+
isUninitialized = false,
|
|
21099
21155
|
error,
|
|
21100
|
-
|
|
21156
|
+
isEmpty = false,
|
|
21157
|
+
loadingText = "Loading...",
|
|
21158
|
+
fetchingText = "Updating...",
|
|
21159
|
+
emptyTitle = "No data found",
|
|
21160
|
+
emptyText = "No data available.",
|
|
21161
|
+
errorTitle = "Something went wrong",
|
|
21162
|
+
retryText = "Retry",
|
|
21163
|
+
loadingType = "spinner",
|
|
21164
|
+
skeletonCount = 3,
|
|
21165
|
+
skeletonClassName = "h-24 w-full rounded-md",
|
|
21166
|
+
skeletonWrapperClassName = "flex flex-col gap-3 py-4",
|
|
21167
|
+
spinnerProps,
|
|
21168
|
+
fetchingSpinnerProps,
|
|
21169
|
+
loadingFallback,
|
|
21170
|
+
emptyFallback,
|
|
21171
|
+
errorFallback,
|
|
21172
|
+
showFetchingIndicator = true,
|
|
21173
|
+
onRetry,
|
|
21174
|
+
errorFormatter,
|
|
21175
|
+
className,
|
|
21176
|
+
contentClassName,
|
|
21177
|
+
stateClassName
|
|
21101
21178
|
}) {
|
|
21102
|
-
const errorMessage =
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21179
|
+
const errorMessage = React2.useMemo(() => {
|
|
21180
|
+
if (!isError) return "";
|
|
21181
|
+
return errorFormatter ? errorFormatter(error) : getDefaultErrorMessage(error);
|
|
21182
|
+
}, [isError, error, errorFormatter]);
|
|
21183
|
+
const hasSuccess = isSuccess ?? (!isLoading && !isError && !isUninitialized);
|
|
21184
|
+
const renderLoading = () => {
|
|
21185
|
+
if (loadingFallback) return loadingFallback;
|
|
21186
|
+
if (loadingType === "skeleton") {
|
|
21187
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(skeletonWrapperClassName), children: Array.from({ length: skeletonCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: skeletonClassName }, index)) });
|
|
21188
|
+
}
|
|
21189
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21190
|
+
Spinner_default,
|
|
21191
|
+
{
|
|
21192
|
+
centered: true,
|
|
21193
|
+
label: loadingText,
|
|
21194
|
+
type: "bars",
|
|
21195
|
+
size: "md",
|
|
21196
|
+
variant: "primary",
|
|
21197
|
+
...spinnerProps
|
|
21198
|
+
}
|
|
21199
|
+
);
|
|
21200
|
+
};
|
|
21201
|
+
const renderError = () => {
|
|
21202
|
+
if (typeof errorFallback === "function") {
|
|
21203
|
+
return errorFallback(errorMessage);
|
|
21204
|
+
}
|
|
21205
|
+
if (errorFallback) return errorFallback;
|
|
21206
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21207
|
+
AsyncStateCard_default,
|
|
21208
|
+
{
|
|
21209
|
+
type: "error",
|
|
21210
|
+
title: errorTitle,
|
|
21211
|
+
message: errorMessage,
|
|
21212
|
+
actionText: onRetry ? retryText : void 0,
|
|
21213
|
+
actionLoading: isFetching,
|
|
21214
|
+
onAction: onRetry,
|
|
21215
|
+
className: stateClassName
|
|
21216
|
+
}
|
|
21217
|
+
);
|
|
21218
|
+
};
|
|
21219
|
+
const renderEmpty = () => {
|
|
21220
|
+
if (emptyFallback) return emptyFallback;
|
|
21221
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21222
|
+
AsyncStateCard_default,
|
|
21223
|
+
{
|
|
21224
|
+
type: "empty",
|
|
21225
|
+
title: emptyTitle,
|
|
21226
|
+
message: emptyText,
|
|
21227
|
+
className: stateClassName
|
|
21228
|
+
}
|
|
21229
|
+
);
|
|
21230
|
+
};
|
|
21231
|
+
if (isLoading) {
|
|
21232
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "aria-live": "polite", children: renderLoading() });
|
|
21233
|
+
}
|
|
21234
|
+
if (isError) {
|
|
21235
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "aria-live": "polite", children: renderError() });
|
|
21236
|
+
}
|
|
21237
|
+
if (hasSuccess && isEmpty) {
|
|
21238
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "aria-live": "polite", children: renderEmpty() });
|
|
21239
|
+
}
|
|
21240
|
+
if (!hasSuccess) {
|
|
21241
|
+
return null;
|
|
21242
|
+
}
|
|
21243
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
21244
|
+
showFetchingIndicator && isFetching && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-center gap-2 text-sm text-eui-dark-500 dark:text-eui-light-400", children: [
|
|
21245
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21246
|
+
Spinner_default,
|
|
21247
|
+
{
|
|
21248
|
+
size: "xs",
|
|
21249
|
+
type: "bars",
|
|
21250
|
+
variant: "primary",
|
|
21251
|
+
showLabel: false,
|
|
21252
|
+
ariaLabel: fetchingText,
|
|
21253
|
+
...fetchingSpinnerProps
|
|
21254
|
+
}
|
|
21255
|
+
),
|
|
21256
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: fetchingText })
|
|
21257
|
+
] }),
|
|
21258
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(contentClassName), children })
|
|
21107
21259
|
] });
|
|
21108
21260
|
}
|
|
21109
|
-
var AsyncComponentWrapper_default = AsyncComponentWrapper;
|
|
21261
|
+
var AsyncComponentWrapper_default = React2__default.default.memo(AsyncComponentWrapper);
|
|
21110
21262
|
function Modal({
|
|
21111
21263
|
title,
|
|
21112
21264
|
show = false,
|