it-data-nexus-ui-library 2.8.4 → 2.9.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/components/Charts/NexusBarChart.mjs +1 -1
- package/dist/components/NotificationBell.mjs +1 -0
- package/dist/components/NotificationListItem.mjs +1 -0
- package/dist/components/Slider.mjs +1 -0
- package/dist/generated/version.mjs +1 -1
- package/dist/index.d.ts +46 -7
- package/dist/index.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/BarChart/BarChart.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/BarChart/useRegisterItemClickHandlers.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/ChartsDataProvider/ChartsDataProvider.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/LineChart/AreaPlot.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/LineChart/LineChart.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/LineChart/LinePlot.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/LineChart/MarkPlot.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/LineChart/useLineItemClickHandler.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/PieChart/PieArcPlot.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/PieChart/PieChart.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/ScatterChart/Scatter.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/ScatterChart/ScatterChart.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/ScatterChart/async/ScatterAsync.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.mjs +1 -1
- package/dist/node_modules/@mui/x-charts/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.mjs +1 -1
- package/package.json +1 -1
- package/readme.md +111 -111
- package/dist/components/_Primitives/Slider.mjs +0 -1
- package/dist/node_modules/@mui/x-charts/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.mjs +0 -1
- package/dist/node_modules/@mui/x-charts/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.mjs +0 -1
- package/dist/node_modules/@mui/x-charts/internals/useRegisterItemActivation.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useId as r}from"react";import{useTheme as e,alpha as i}from"@mui/material/styles";import{getChartColours as s}from"../Theme/chartColours.mjs";import{ChartFrame as p}from"./chartFrame.mjs";import{BarChart as l}from"../../node_modules/@mui/x-charts/BarChart/BarChart.mjs";function a({slotProps:a,slots:n,title:
|
|
1
|
+
import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useId as r}from"react";import{useTheme as e,alpha as i}from"@mui/material/styles";import{getChartColours as s}from"../Theme/chartColours.mjs";import{ChartFrame as p}from"./chartFrame.mjs";import{BarChart as l}from"../../node_modules/@mui/x-charts/BarChart/BarChart.mjs";function a({slotProps:a,slots:n,title:d,titleComponent:m,titleHidden:c,description:f,actions:h,isLoading:x,isError:u,errorMessage:y,paperSx:C,gradientColors:g,...j}){const z=e(),O=g??s(z.palette.mode),$=r().replace(/:/g,""),b="horizontal"===j.layout,B=O.map((o,t)=>({id:`${$}bg${t}`,color:o}));return o(p,{title:d,titleComponent:m,titleHidden:c,description:f,actions:h,isLoading:x,isError:u,errorMessage:y,paperSx:C,children:o(l,{colors:B.map(({id:o})=>`url(#${o})`),...j,grid:{vertical:!0,horizontal:!0},slots:n,slotProps:{...a,tooltip:{popperOptions:{strategy:"fixed"},sx:{zIndex:1300},container:()=>document.body,...a?.tooltip}},children:o("defs",{children:B.map(({id:r,color:e})=>t("linearGradient",b?{id:r,x1:"0",y1:"0",x2:"1",y2:"0",children:[o("stop",{offset:"0%",stopColor:i(e,.15)}),o("stop",{offset:"100%",stopColor:e,stopOpacity:1})]}:{id:r,x1:"0",y1:"0",x2:"0",y2:"1",children:[o("stop",{offset:"0%",stopColor:e,stopOpacity:1}),o("stop",{offset:"100%",stopColor:i(e,.15)})]},r))})})})}export{a as NexusBarChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as i,Fragment as o,jsx as t}from"react/jsx-runtime";import{Badge as r,Box as e}from"@mui/material";import n from"@mui/icons-material/NotificationsOutlined";import{IconButton as a}from"./Buttons/IconButton.mjs";const l={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},c=({count:c,onClick:d,max:m=99,label:p="Notifications",disabled:s=!1})=>{const u=c>0,h=u?`${p}, ${c} unread`:p;return i(o,{children:[t(a,{ariaLabel:h,title:p,onClick:d,disabled:s,children:t(r,{badgeContent:c,max:m,color:"error",invisible:!u,children:t(n,{})})}),t(e,{"aria-live":"polite",sx:l,children:h})]})};export{c as NotificationBell};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Box as o}from"@mui/material";import{Body1 as n,Caption as r,Body2 as i}from"./Typography.mjs";const a=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"}),d=e=>{const t=e instanceof Date?e:new Date(e),o=Math.round((t.getTime()-Date.now())/1e3);for(const[e,t]of a)if(Math.abs(o)>=t)return l.format(Math.round(o/t),e);return l.format(o,"second")},s=({title:a,timestamp:l,body:s,read:c=!1,onClick:m})=>e(o,{component:"li",onClick:m,sx:e=>({display:"flex",flexDirection:"column",gap:.25,listStyle:"none",width:"100%",minWidth:0,px:1.5,py:1,borderRadius:1,cursor:m?"pointer":"default",backgroundColor:c?"transparent":e.palette.action.hover,"&:hover":m?{backgroundColor:e.palette.action.selected}:void 0}),children:[e(o,{sx:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:1,minWidth:0},children:[t(n,{sx:{fontWeight:c?400:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:a}),t(r,{sx:{color:"text.secondary",flexShrink:0},children:d(l)})]}),s?t(i,{sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}):null]});export{s as NotificationListItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{useId as t}from"react";import{Slider as i}from"@mui/material";import{alpha as a}from"@mui/material/styles";import{Body2 as o,Caption as s}from"./Typography.mjs";import{Stack as m}from"./_Primitives/Stack.mjs";const l=r=>{if(Number.isInteger(r))return 0;const[,e]=r.toString().split(".");return e?.length??0},n=({value:n,onChange:d,min:x,max:u,step:c,disabled:p=!1,label:b,marks:h,...y})=>{const f=t(),g=l(c),M=n.toFixed(g);return r(m,{sx:{gap:.5,width:"100%"},children:[b?r(m,{direction:"row",sx:{alignItems:"baseline",justifyContent:"space-between"},children:[e(o,{id:f,sx:{color:p?"text.disabled":"text.primary"},children:b}),e(s,{"aria-live":"polite",sx:{fontVariantNumeric:"tabular-nums",color:p?"text.disabled":"text.secondary"},children:M})]}):null,e(i,{...y,value:n,min:x,max:u,step:c,disabled:p,marks:h,"aria-labelledby":b?f:void 0,"aria-valuetext":M,onChange:(r,e)=>{const t=Array.isArray(e)?e[0]:e;d(r,((r,e,t,i)=>{const a=l(i),o=Math.min(Math.max(r,e),t),s=e+Math.round((o-e)/i)*i;return Number(Math.min(Math.max(s,e),t).toFixed(a))})(t,x,u,c))},sx:[r=>({color:r.palette.primary.main,"& .MuiSlider-thumb":{"&:hover, &.Mui-focusVisible":{boxShadow:`0 0 0 8px ${a(r.palette.primary.main,.16)}`}},"&.Mui-disabled":{color:r.palette.action.disabled}}),...Array.isArray(y.sx)?y.sx:y.sx?[y.sx]:[]]})]})};export{n as Slider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="2.
|
|
1
|
+
const o="2.9.0";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ReactNode, Ref, ReactElement, FormEventHandler, RefObject, ComponentType, CSSProperties, PropsWithChildren } from 'react';
|
|
3
|
-
import { AlertProps, BoxProps, SxProps as SxProps$1, Theme as Theme$1, TypographyProps, ContainerProps, GridProps, LinkProps as LinkProps$1, SelectProps as SelectProps$1, ToggleButtonGroupProps, SwitchProps, SliderProps, AccordionSummaryProps, ButtonProps, ChipProps, CardProps as CardProps$1, PaperProps, CircularProgressProps, CollapseProps, ButtonBaseProps, CheckboxProps, FormControlLabelProps, FormGroupProps, DialogProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogTitleProps, DividerProps, TableProps, TableBodyProps, TableCellProps, TableHeadProps, TableRowProps, IconButtonProps as IconButtonProps$1, SkeletonProps as SkeletonProps$1, StackProps, TabProps, TabsProps, TextFieldProps, TooltipProps as TooltipProps$1 } from '@mui/material';
|
|
4
|
-
export { AlertProps, AlertTitle, BoxProps, ButtonBaseProps, CheckboxProps, ChipProps, CircularProgressProps, CollapseProps, ContainerProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogProps, DialogTitleProps, DividerProps, FormControlLabelProps, FormGroupProps, GridProps, MenuItem, PaperProps,
|
|
3
|
+
import { AlertProps, BoxProps, SxProps as SxProps$1, Theme as Theme$1, TypographyProps, ContainerProps, GridProps, LinkProps as LinkProps$1, SelectProps as SelectProps$1, ToggleButtonGroupProps, SwitchProps, SliderProps as SliderProps$1, AccordionSummaryProps, ButtonProps, ChipProps, CardProps as CardProps$1, PaperProps, CircularProgressProps, CollapseProps, ButtonBaseProps, CheckboxProps, FormControlLabelProps, FormGroupProps, DialogProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogTitleProps, DividerProps, TableProps, TableBodyProps, TableCellProps, TableHeadProps, TableRowProps, IconButtonProps as IconButtonProps$1, SkeletonProps as SkeletonProps$1, StackProps, TabProps, TabsProps, TextFieldProps, TooltipProps as TooltipProps$1 } from '@mui/material';
|
|
4
|
+
export { AlertProps, AlertTitle, BoxProps, ButtonBaseProps, CheckboxProps, ChipProps, CircularProgressProps, CollapseProps, ContainerProps, DialogActionsProps, DialogContentProps, DialogContentTextProps, DialogProps, DialogTitleProps, DividerProps, FormControlLabelProps, FormGroupProps, GridProps, MenuItem, PaperProps, StackProps, SwitchProps, TabProps, TableBodyProps, TableCellProps, TableHeadProps, TableProps, TableRowProps, TabsProps, TextFieldProps, Theme, alpha, useMediaQuery, useTheme } from '@mui/material';
|
|
5
5
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
6
6
|
import { Components } from 'react-markdown';
|
|
7
7
|
import SvgIcon from '@mui/material/SvgIcon';
|
|
@@ -552,7 +552,43 @@ declare const Breadcrumbs: ({ items, ariaLabel, maxItems, }: BreadcrumbsProps) =
|
|
|
552
552
|
|
|
553
553
|
declare const Switch: ({ sx, ...props }: SwitchProps) => react.JSX.Element;
|
|
554
554
|
|
|
555
|
-
|
|
555
|
+
interface SliderMarkOption {
|
|
556
|
+
value: number;
|
|
557
|
+
label?: string;
|
|
558
|
+
}
|
|
559
|
+
interface SliderProps extends Omit<SliderProps$1, "value" | "onChange" | "min" | "max" | "step" | "marks" | "aria-labelledby"> {
|
|
560
|
+
value: number;
|
|
561
|
+
onChange: (event: Event, value: number) => void;
|
|
562
|
+
min: number;
|
|
563
|
+
max: number;
|
|
564
|
+
step: number;
|
|
565
|
+
/** Visible label rendered above the track with the current value. Omit to
|
|
566
|
+
* render the bare track only (e.g. an existing caller supplying its own
|
|
567
|
+
* label/value display and an `aria-label` directly). */
|
|
568
|
+
label?: string;
|
|
569
|
+
marks?: SliderMarkOption[];
|
|
570
|
+
}
|
|
571
|
+
declare const Slider: ({ value, onChange, min, max, step, disabled, label, marks, ...rest }: SliderProps) => react.JSX.Element;
|
|
572
|
+
|
|
573
|
+
interface NotificationBellProps {
|
|
574
|
+
count: number;
|
|
575
|
+
onClick: () => void;
|
|
576
|
+
/** Cap above which the badge shows `${max}+` instead of the exact count. Default 99. */
|
|
577
|
+
max?: number;
|
|
578
|
+
/** Accessible/base label, e.g. "Notifications". Unread count is appended automatically. */
|
|
579
|
+
label?: string;
|
|
580
|
+
disabled?: boolean;
|
|
581
|
+
}
|
|
582
|
+
declare const NotificationBell: ({ count, onClick, max, label, disabled, }: NotificationBellProps) => react.JSX.Element;
|
|
583
|
+
|
|
584
|
+
interface NotificationListItemProps {
|
|
585
|
+
title: string;
|
|
586
|
+
timestamp: Date | string | number;
|
|
587
|
+
body?: string;
|
|
588
|
+
read?: boolean;
|
|
589
|
+
onClick?: () => void;
|
|
590
|
+
}
|
|
591
|
+
declare const NotificationListItem: ({ title, timestamp, body, read, onClick, }: NotificationListItemProps) => react.JSX.Element;
|
|
556
592
|
|
|
557
593
|
/**
|
|
558
594
|
* Typed wrappers around MUI Typography that fix the `variant` prop and
|
|
@@ -1306,8 +1342,11 @@ type NexusLineChartProps = Omit<LineChartProps, "colors"> & ChartAsyncProps & {
|
|
|
1306
1342
|
};
|
|
1307
1343
|
declare function NexusLineChart({ sx, xAxis, grid, series, slots, slotProps, children, title, titleComponent, titleHidden, description, actions, isLoading, isError, errorMessage, paperSx, ...props }: NexusLineChartProps): react.JSX.Element;
|
|
1308
1344
|
|
|
1309
|
-
type NexusBarChartProps = Omit<BarChartProps, "colors"> & ChartAsyncProps
|
|
1310
|
-
|
|
1345
|
+
type NexusBarChartProps = Omit<BarChartProps, "colors"> & ChartAsyncProps & {
|
|
1346
|
+
/** Base colours used to generate the per-series gradients. */
|
|
1347
|
+
gradientColors?: string[];
|
|
1348
|
+
};
|
|
1349
|
+
declare function NexusBarChart({ slotProps, slots, title, titleComponent, titleHidden, description, actions, isLoading, isError, errorMessage, paperSx, gradientColors, ...props }: NexusBarChartProps): react.JSX.Element;
|
|
1311
1350
|
|
|
1312
1351
|
type NexusPieChartProps = Omit<PieChartProps, "colors"> & ChartAsyncProps;
|
|
1313
1352
|
declare function NexusPieChart({ slotProps, slots, title, titleComponent, titleHidden, description, actions, isLoading, isError, errorMessage, paperSx, ...props }: NexusPieChartProps): react.JSX.Element;
|
|
@@ -1488,5 +1527,5 @@ declare const getGradientBorderStyles: (theme: Theme, options?: GradientBorderOp
|
|
|
1488
1527
|
declare const leftPipe: SxProps<Theme>;
|
|
1489
1528
|
declare const expandableText: (isExpanded: boolean) => SxProps<Theme>;
|
|
1490
1529
|
|
|
1491
|
-
export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AgentChatDialog, AgentChatWidget, AgentChatWindow, AgentChatWindowHeader, AiButton, AiButtonTile, AiCard, AiChip, AiGlassCard, AiGlassPaper, AiPaper, Alert, Avatar, Body1, Body2, Box, Breadcrumbs, ButtonBase, ButtonTile, Caption, Card, ChatAvatar, ChatHistory, ChatHistoryAgentItem, ChatHistoryButtonBase, ChatHistoryHeader, ChatInput, ChatWindowBody, Checkbox, CheckboxGroup, Chip, CircularProgress, Code, Collapse, Container, CopyableTableContainer, DateRangeFilter, DateRangePicker, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, EmptyState, FABButton, FaviconLinks, FormControlLabel, FormDialog, FormGroup, GhostButton, GlassCard, GlassPaper, GlassPaperAsync, GreenWaveBackground, Grid, H1, H2, H3, H4, IconButton, Link, LoadingSpinnerNexus, LocationMultiSelect, LogoOptions, MarkdownContent, MessageBubble, MessageFeedbackBar, MessageList, MetricCard, MetricStat, MetricValue, MuiAppThemeProvider, NEXUS_THEME_STORAGE_KEY, NexusBarChart, NexusDataGrid, NexusHeatmap, NexusHome, NexusLineChart, NexusLogo, NexusNodeIcon, NexusPieChart, NexusScatterChart, NexusiFrame, Paper, PaperAsync, PrimaryButton, PrimaryButtonLink, RagChip, RagDot, SageLogoSvg, SearchInput, SecondaryButton, SecondaryButtonLink, SegmentedControl, Select, SelectableList, SideBlade, SideBladeNavList, SideBladeNavListItem, Skeleton, SkillChip, SkipLink, Slider, SourceCitations, Span, Stack, StatusBadge, StatusChip, StreamingBubble, SuggestedPrompts, Switch, Tab, Table, TableBody, TableCell, TableHead, TableRow, Tabs, TextField, ThemeModeContext, ThemeModeProvider, ThemeToggle, Tooltip, TypingIndicator, chatHistoryMatchesQuery, chatWindowMarkdownComponents, colours, createSageTheme, expandableText, filterChatHistoryConversations, fontSageHeadline, fontSageText, fontSageUI, formatDate, formatSurnameFirstname, getFaviconUrls, getFiscalPeriod, getGradientBorderStyles, getModeTokens, gradients, latestTraceLabel, leftPipe, ragColorForDelta, useThemeMode, useTokens };
|
|
1492
|
-
export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, ActivitySummary, AgentChatDialogProps, AgentChatWidgetProps, AgentChatWindowHeaderProps, AgentChatWindowProps, AiButtonProps, AiButtonTileProps, AiCardProps, AiChipProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, AvatarProps, AvatarSize, AvatarVariant, BreadcrumbItem, BreadcrumbsProps, ButtonTileProps, CardProps, CardTrend, ChartAsyncProps, ChatAvatarProps, ChatHistoryAgent, ChatHistoryAgentItemProps, ChatHistoryButtonBaseProps, ChatHistoryConversation, ChatHistoryHeaderProps, ChatHistoryProps, ChatInputProps, ChatMessage, CodeBlock, CopyableTableContainerProps, DateRangeFilterProps, DateRangePickerProps, DateRangePreset, DateRangeValue, EmptyStateProps, FABButtonProps, FileArtifact, FormDialogProps, GhostButtonProps, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, IconButtonVariant, LatencyMetrics, LinkProps, LoadingSpinnerNexusProps, MarkdownContentProps, MessageBubbleProps, MessageFeedbackBarProps, MessageListProps, MetricCardProps, MetricStatProps, MetricValueSize, ModeTokens, NexusBarChartProps, NexusHeatmapAxisItem, NexusHeatmapCell, NexusHeatmapProps, NexusHeatmapStatus, NexusLineChartProps, NexusNodeIconProps, NexusNodeIconSize, NexusNodeIconTone, NexusPieChartProps, NexusScatterChartProps, NexusiFrameProps, PaperAsyncProps, ParsedActivity, PrimaryButtonLinkProps, PrimaryButtonProps, SecondaryButtonLinkProps, SecondaryButtonProps, SegmentedControlOption, SegmentedControlProps, SelectOption, SelectProps, SelectableListItem, SelectableListProps, SideBladeNavItem, SideBladeNavListItemProps, SideBladeNavListProps, SideBladeProps, SkeletonProps, SkipLinkProps, SourceCitationsProps, StatusBadgeProps, StatusBadgeVariant, StreamingBubbleProps, SuggestedPromptsProps, ThemeMode, ThemeModeContextValue, ThemeModeProviderProps, TooltipProps, TraceEvent, TypingIndicatorProps };
|
|
1530
|
+
export { AccordionGroup, AccordionGroupItem, AccordionSingle, ActionBar, ActionBarTitle, AgentChatDialog, AgentChatWidget, AgentChatWindow, AgentChatWindowHeader, AiButton, AiButtonTile, AiCard, AiChip, AiGlassCard, AiGlassPaper, AiPaper, Alert, Avatar, Body1, Body2, Box, Breadcrumbs, ButtonBase, ButtonTile, Caption, Card, ChatAvatar, ChatHistory, ChatHistoryAgentItem, ChatHistoryButtonBase, ChatHistoryHeader, ChatInput, ChatWindowBody, Checkbox, CheckboxGroup, Chip, CircularProgress, Code, Collapse, Container, CopyableTableContainer, DateRangeFilter, DateRangePicker, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, EmptyState, FABButton, FaviconLinks, FormControlLabel, FormDialog, FormGroup, GhostButton, GlassCard, GlassPaper, GlassPaperAsync, GreenWaveBackground, Grid, H1, H2, H3, H4, IconButton, Link, LoadingSpinnerNexus, LocationMultiSelect, LogoOptions, MarkdownContent, MessageBubble, MessageFeedbackBar, MessageList, MetricCard, MetricStat, MetricValue, MuiAppThemeProvider, NEXUS_THEME_STORAGE_KEY, NexusBarChart, NexusDataGrid, NexusHeatmap, NexusHome, NexusLineChart, NexusLogo, NexusNodeIcon, NexusPieChart, NexusScatterChart, NexusiFrame, NotificationBell, NotificationListItem, Paper, PaperAsync, PrimaryButton, PrimaryButtonLink, RagChip, RagDot, SageLogoSvg, SearchInput, SecondaryButton, SecondaryButtonLink, SegmentedControl, Select, SelectableList, SideBlade, SideBladeNavList, SideBladeNavListItem, Skeleton, SkillChip, SkipLink, Slider, SourceCitations, Span, Stack, StatusBadge, StatusChip, StreamingBubble, SuggestedPrompts, Switch, Tab, Table, TableBody, TableCell, TableHead, TableRow, Tabs, TextField, ThemeModeContext, ThemeModeProvider, ThemeToggle, Tooltip, TypingIndicator, chatHistoryMatchesQuery, chatWindowMarkdownComponents, colours, createSageTheme, expandableText, filterChatHistoryConversations, fontSageHeadline, fontSageText, fontSageUI, formatDate, formatSurnameFirstname, getFaviconUrls, getFiscalPeriod, getGradientBorderStyles, getModeTokens, gradients, latestTraceLabel, leftPipe, ragColorForDelta, useThemeMode, useTokens };
|
|
1531
|
+
export type { AccordionGroupItemProps, AccordionGroupProps, AccordionSingleProps, ActivitySummary, AgentChatDialogProps, AgentChatWidgetProps, AgentChatWindowHeaderProps, AgentChatWindowProps, AiButtonProps, AiButtonTileProps, AiCardProps, AiChipProps, AiGlassCardProps, AiGlassPaperProps, AiPaperProps, AvatarProps, AvatarSize, AvatarVariant, BreadcrumbItem, BreadcrumbsProps, ButtonTileProps, CardProps, CardTrend, ChartAsyncProps, ChatAvatarProps, ChatHistoryAgent, ChatHistoryAgentItemProps, ChatHistoryButtonBaseProps, ChatHistoryConversation, ChatHistoryHeaderProps, ChatHistoryProps, ChatInputProps, ChatMessage, CodeBlock, CopyableTableContainerProps, DateRangeFilterProps, DateRangePickerProps, DateRangePreset, DateRangeValue, EmptyStateProps, FABButtonProps, FileArtifact, FormDialogProps, GhostButtonProps, GlassCardProps, GlassPaperAsyncProps, GlassPaperProps, GradientBorderOptions, GreenWaveBackgroundProps, IconButtonProps, IconButtonVariant, LatencyMetrics, LinkProps, LoadingSpinnerNexusProps, MarkdownContentProps, MessageBubbleProps, MessageFeedbackBarProps, MessageListProps, MetricCardProps, MetricStatProps, MetricValueSize, ModeTokens, NexusBarChartProps, NexusHeatmapAxisItem, NexusHeatmapCell, NexusHeatmapProps, NexusHeatmapStatus, NexusLineChartProps, NexusNodeIconProps, NexusNodeIconSize, NexusNodeIconTone, NexusPieChartProps, NexusScatterChartProps, NexusiFrameProps, NotificationBellProps, NotificationListItemProps, PaperAsyncProps, ParsedActivity, PrimaryButtonLinkProps, PrimaryButtonProps, SecondaryButtonLinkProps, SecondaryButtonProps, SegmentedControlOption, SegmentedControlProps, SelectOption, SelectProps, SelectableListItem, SelectableListProps, SideBladeNavItem, SideBladeNavListItemProps, SideBladeNavListProps, SideBladeProps, SkeletonProps, SkipLinkProps, SliderMarkOption, SliderProps, SourceCitationsProps, StatusBadgeProps, StatusBadgeVariant, StreamingBubbleProps, SuggestedPromptsProps, ThemeMode, ThemeModeContextValue, ThemeModeProviderProps, TooltipProps, TraceEvent, TypingIndicatorProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DateRangeFilter}from"./components/DateRangeFilter.mjs";export{DateRangePicker}from"./components/DateRangePicker.mjs";export{Alert}from"./components/_Primitives/Alert.mjs";export{AgentChatWidget}from"./components/AgentChat/AgentChatWidget.mjs";export{AgentChatDialog}from"./components/AgentChat/AgentChatDialog.mjs";export{FABButton}from"./components/AgentChat/FABButton.mjs";export{AgentChatWindow}from"./components/AgentChat/AgentChatWindow.mjs";export{AgentChatWindowHeader}from"./components/AgentChat/AgentChatWindowHeader.mjs";export{ChatInput}from"./components/AgentChat/ChatInput.mjs";export{ChatHistory}from"./components/AgentChat/ChatHistory.mjs";export{ChatHistoryHeader}from"./components/AgentChat/ChatHistoryHeader.mjs";export{ChatHistoryButtonBase}from"./components/AgentChat/ChatHistoryButtonBase.mjs";export{ChatHistoryAgentItem}from"./components/AgentChat/ChatHistoryAgentItem.mjs";export{chatHistoryMatchesQuery,filterChatHistoryConversations}from"./components/AgentChat/ChatHistorySearch.mjs";export{CopyableTableContainer}from"./components/AgentChat/ChatComponents/CopyableTableContainer.mjs";export{default as ChatAvatar}from"./components/AgentChat/ChatComponents/ChatAvatar.mjs";export{default as MarkdownContent,chatWindowMarkdownComponents}from"./components/AgentChat/ChatComponents/MarkdownContent.mjs";export{default as MessageBubble}from"./components/AgentChat/ChatComponents/MessageBubble.mjs";export{default as MessageFeedbackBar}from"./components/AgentChat/ChatComponents/MessageFeedbackBar.mjs";export{default as StreamingBubble}from"./components/AgentChat/ChatComponents/StreamingBubble.mjs";export{default as TypingIndicator}from"./components/AgentChat/ChatComponents/TypingIndicator.mjs";export{default as SuggestedPrompts}from"./components/AgentChat/ChatComponents/SuggestedPrompts.mjs";export{default as MessageList}from"./components/AgentChat/ChatComponents/MessageList.mjs";export{default as EmptyState}from"./components/AgentChat/ChatComponents/EmptyState.mjs";export{default as SourceCitations}from"./components/AgentChat/ChatComponents/SourceCitations.mjs";export{latestTraceLabel}from"./components/AgentChat/ChatComponents/latestTraceLabel.mjs";export{Code}from"./components/Code.mjs";export{Container}from"./components/_Primitives/Container.mjs";export{Grid}from"./components/_Primitives/Grid.mjs";export{Link}from"./components/_Primitives/Link.mjs";export{Select}from"./components/Select.mjs";export{SkipLink}from"./components/SkipLink.mjs";export{StatusBadge}from"./components/StatusBadge.mjs";export{SegmentedControl}from"./components/SegmentedControl.mjs";export{Breadcrumbs}from"./components/Breadcrumbs.mjs";export{Switch}from"./components/_Primitives/Switch.mjs";export{Slider}from"./components/
|
|
1
|
+
export{DateRangeFilter}from"./components/DateRangeFilter.mjs";export{DateRangePicker}from"./components/DateRangePicker.mjs";export{Alert}from"./components/_Primitives/Alert.mjs";export{AgentChatWidget}from"./components/AgentChat/AgentChatWidget.mjs";export{AgentChatDialog}from"./components/AgentChat/AgentChatDialog.mjs";export{FABButton}from"./components/AgentChat/FABButton.mjs";export{AgentChatWindow}from"./components/AgentChat/AgentChatWindow.mjs";export{AgentChatWindowHeader}from"./components/AgentChat/AgentChatWindowHeader.mjs";export{ChatInput}from"./components/AgentChat/ChatInput.mjs";export{ChatHistory}from"./components/AgentChat/ChatHistory.mjs";export{ChatHistoryHeader}from"./components/AgentChat/ChatHistoryHeader.mjs";export{ChatHistoryButtonBase}from"./components/AgentChat/ChatHistoryButtonBase.mjs";export{ChatHistoryAgentItem}from"./components/AgentChat/ChatHistoryAgentItem.mjs";export{chatHistoryMatchesQuery,filterChatHistoryConversations}from"./components/AgentChat/ChatHistorySearch.mjs";export{CopyableTableContainer}from"./components/AgentChat/ChatComponents/CopyableTableContainer.mjs";export{default as ChatAvatar}from"./components/AgentChat/ChatComponents/ChatAvatar.mjs";export{default as MarkdownContent,chatWindowMarkdownComponents}from"./components/AgentChat/ChatComponents/MarkdownContent.mjs";export{default as MessageBubble}from"./components/AgentChat/ChatComponents/MessageBubble.mjs";export{default as MessageFeedbackBar}from"./components/AgentChat/ChatComponents/MessageFeedbackBar.mjs";export{default as StreamingBubble}from"./components/AgentChat/ChatComponents/StreamingBubble.mjs";export{default as TypingIndicator}from"./components/AgentChat/ChatComponents/TypingIndicator.mjs";export{default as SuggestedPrompts}from"./components/AgentChat/ChatComponents/SuggestedPrompts.mjs";export{default as MessageList}from"./components/AgentChat/ChatComponents/MessageList.mjs";export{default as EmptyState}from"./components/AgentChat/ChatComponents/EmptyState.mjs";export{default as SourceCitations}from"./components/AgentChat/ChatComponents/SourceCitations.mjs";export{latestTraceLabel}from"./components/AgentChat/ChatComponents/latestTraceLabel.mjs";export{Code}from"./components/Code.mjs";export{Container}from"./components/_Primitives/Container.mjs";export{Grid}from"./components/_Primitives/Grid.mjs";export{Link}from"./components/_Primitives/Link.mjs";export{Select}from"./components/Select.mjs";export{SkipLink}from"./components/SkipLink.mjs";export{StatusBadge}from"./components/StatusBadge.mjs";export{SegmentedControl}from"./components/SegmentedControl.mjs";export{Breadcrumbs}from"./components/Breadcrumbs.mjs";export{Switch}from"./components/_Primitives/Switch.mjs";export{Slider}from"./components/Slider.mjs";export{NotificationBell}from"./components/NotificationBell.mjs";export{NotificationListItem}from"./components/NotificationListItem.mjs";export{ActionBarTitle,Body1,Body2,Caption,ChatWindowBody,H1,H2,H3,H4,MetricValue,Span}from"./components/Typography.mjs";export{MetricStat}from"./components/MetricStat.mjs";export{MetricCard}from"./components/MetricCard.mjs";export{ActionBar}from"./components/ActionBar.mjs";export{AccordionGroup,AccordionGroupItem}from"./components/AccordionGroup.mjs";export{AccordionSingle}from"./components/AccordionSingle.mjs";export{AiButton}from"./components/Buttons/AiButton.mjs";export{AiChip}from"./components/AiChip.mjs";export{AiCard}from"./components/AiCard.mjs";export{AiGlassCard}from"./components/AiGlassCard.mjs";export{AiPaper}from"./components/AiPaper.mjs";export{AiGlassPaper}from"./components/AiGlassPaper.mjs";export{Box}from"./components/_Primitives/Box.mjs";export{CircularProgress}from"./components/_Primitives/CircularProgress.mjs";export{Collapse}from"./components/_Primitives/Collapse.mjs";export{NexusDataGrid}from"./components/NexusDataGrid.mjs";export{ButtonBase}from"./components/Buttons/ButtonBase.mjs";export{AiButtonTile,ButtonTile}from"./components/ButtonTile.mjs";export{GhostButton}from"./components/Buttons/GhostButton.mjs";export{SelectableList}from"./components/Buttons/SelectableList.mjs";export{Card}from"./components/Card.mjs";export{Checkbox}from"./components/Forms/Checkbox.mjs";export{FormControlLabel}from"./components/Forms/FormControlLabel.mjs";export{FormGroup}from"./components/Forms/FormGroup.mjs";export{CheckboxGroup}from"./components/Forms/CheckboxGroup.mjs";export{FormDialog}from"./components/Forms/FormDialog.mjs";export{Chip}from"./components/_Primitives/Chip.mjs";export{Dialog,DialogActions,DialogContent,DialogContentText,DialogTitle}from"./components/_Primitives/Dialog.mjs";export{Divider}from"./components/_Primitives/Divider.mjs";export{Table,TableBody,TableCell,TableHead,TableRow}from"./components/_Primitives/Table.mjs";export{GlassCard}from"./components/GlassCard.mjs";export{GlassPaper}from"./components/GlassPaper.mjs";export{GlassPaperAsync}from"./components/GlassPaperAsync.mjs";export{PaperAsync}from"./components/PaperAsync.mjs";export{GreenWaveBackground}from"./components/GreenWaveBackground.mjs";export{IconButton}from"./components/Buttons/IconButton.mjs";export{Avatar}from"./components/Avatar.mjs";export{LoadingSpinnerNexus}from"./components/LoadingSpinnerNexus.mjs";export{LocationMultiSelect}from"./components/LocationMultiSelect.mjs";export{LogoOptions}from"./components/Logo/LogoOptions/index.mjs";export{NexusHome}from"./components/Logo/NexusHome.mjs";export{default as NexusLogo}from"./components/Logo/NexusLogo.mjs";export{NexusNodeIcon}from"./components/Logo/NexusNodeIcon.mjs";export{SageLogoSvg}from"./components/Logo/LogoOptions/SageLogo.mjs";export{Paper}from"./components/_Primitives/Paper.mjs";export{PrimaryButton}from"./components/Buttons/PrimaryButton.mjs";export{PrimaryButtonLink}from"./components/Buttons/PrimaryButtonLink.mjs";export{SecondaryButton}from"./components/Buttons/SecondaryButton.mjs";export{RagDot}from"./components/RagDot.mjs";export{RagChip}from"./components/RagChip.mjs";export{ragColorForDelta}from"./components/ragColorForDelta.mjs";export{SecondaryButtonLink}from"./components/Buttons/SecondaryButtonLink.mjs";export{SearchInput}from"./components/SearchInput.mjs";export{SideBlade}from"./components/SideBlade/SideBlade.mjs";export{SideBladeNavList}from"./components/SideBlade/SideBladeNavList.mjs";export{SideBladeNavListItem}from"./components/SideBlade/SideBladeNavListItem.mjs";export{Skeleton}from"./components/_Primitives/Skeleton.mjs";export{SkillChip}from"./components/SkillChip.mjs";export{Stack}from"./components/_Primitives/Stack.mjs";export{StatusChip}from"./components/StatusChip.mjs";export{Tab}from"./components/_Primitives/Tab.mjs";export{Tabs}from"./components/_Primitives/Tabs.mjs";export{TextField}from"./components/_Primitives/TextField.mjs";export{ThemeToggle}from"./components/Theme/ThemeToggle.mjs";export{Tooltip}from"./components/Tooltip.mjs";export{NexusiFrame}from"./components/NexusiFrame.mjs";export{NexusLineChart}from"./components/Charts/NexusLineChart.mjs";export{NexusBarChart}from"./components/Charts/NexusBarChart.mjs";export{NexusPieChart}from"./components/Charts/NexusPieChart.mjs";export{NexusScatterChart}from"./components/Charts/NexusScatterChart.mjs";export{NexusHeatmap}from"./components/Charts/NexusHeatmap.mjs";export{default as nexusLogoNode}from"./assets/images/nexus-logo-node.svg.mjs";export{default as nexusLogoFavicon}from"./assets/images/nexus-logo-favicon.svg.mjs";export{default as nexusLogoIco}from"./assets/images/favicon.ico.mjs";export{getFaviconUrls}from"./assets/images/urls.mjs";export{FaviconLinks}from"./components/FaviconLinks.mjs";export{createSageTheme}from"./components/Theme/sageTheme.mjs";export{colours,fontSageHeadline,fontSageText,fontSageUI,getModeTokens,gradients}from"./components/Theme/tokens.mjs";export{useTokens}from"./components/Theme/useTokens.mjs";export{default as MuiAppThemeProvider}from"./components/Theme/MuiAppThemeProvider.mjs";export{NEXUS_THEME_STORAGE_KEY,ThemeModeContext,ThemeModeProvider,useThemeMode}from"./components/Theme/ThemeContext.mjs";export{AlertTitle,MenuItem,alpha,useMediaQuery,useTheme}from"@mui/material";export{formatSurnameFirstname}from"./utils/nameFormats.mjs";export{formatDate,getFiscalPeriod}from"./utils/dateFormats.mjs";export{expandableText,getGradientBorderStyles,leftPipe}from"./components/Theme/sxHelpers.mjs";export{ChartsReferenceLine}from"./node_modules/@mui/x-charts/ChartsReferenceLine/ChartsReferenceLine.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import*as r from"react";import i from"../../../../_virtual/index.mjs";import{useThemeProps as o}from"@mui/material/styles";import{BarPlot as s}from"./BarPlot.mjs";import{ChartsOverlay as t}from"../ChartsOverlay/ChartsOverlay.mjs";import{useBarChartProps as a}from"./useBarChartProps.mjs";import{useChartsContainerProps as n}from"../ChartsContainer/useChartsContainerProps.mjs";import{FocusedBar as p}from"./FocusedBar.mjs";import{jsx as d,jsxs as h}from"react/jsx-runtime";import{ChartsTooltip as m}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as l}from"../ChartsDataProvider/ChartsDataProvider.mjs";import{ChartsWrapper as u}from"../ChartsWrapper/ChartsWrapper.mjs";import{ChartsLegend as f}from"../ChartsLegend/ChartsLegend.mjs";import{ChartsSurface as b}from"../ChartsSurface/ChartsSurface.mjs";import{ChartsGrid as c}from"../ChartsGrid/ChartsGrid.mjs";import{ChartsAxisHighlight as g}from"../ChartsAxisHighlight/ChartsAxisHighlight.mjs";import{ChartsAxis as C}from"../ChartsAxis/ChartsAxis.mjs";import{ChartsClipPath as x}from"../ChartsClipPath/ChartsClipPath.mjs";const y=r.forwardRef(function(r,i){const y=o({props:r,name:"MuiBarChart"}),{chartsWrapperProps:O,chartsContainerProps:j,barPlotProps:I,gridProps:P,clipPathProps:R,clipPathGroupProps:q,overlayProps:T,chartsAxisProps:v,axisHighlightProps:A,legendProps:H,children:N}=a(y),{chartsDataProviderProps:
|
|
1
|
+
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import*as r from"react";import i from"../../../../_virtual/index.mjs";import{useThemeProps as o}from"@mui/material/styles";import{BarPlot as s}from"./BarPlot.mjs";import{ChartsOverlay as t}from"../ChartsOverlay/ChartsOverlay.mjs";import{useBarChartProps as a}from"./useBarChartProps.mjs";import{useChartsContainerProps as n}from"../ChartsContainer/useChartsContainerProps.mjs";import{FocusedBar as p}from"./FocusedBar.mjs";import{jsx as d,jsxs as h}from"react/jsx-runtime";import{ChartsTooltip as m}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as l}from"../ChartsDataProvider/ChartsDataProvider.mjs";import{ChartsWrapper as u}from"../ChartsWrapper/ChartsWrapper.mjs";import{ChartsLegend as f}from"../ChartsLegend/ChartsLegend.mjs";import{ChartsSurface as b}from"../ChartsSurface/ChartsSurface.mjs";import{ChartsGrid as c}from"../ChartsGrid/ChartsGrid.mjs";import{ChartsAxisHighlight as g}from"../ChartsAxisHighlight/ChartsAxisHighlight.mjs";import{ChartsAxis as C}from"../ChartsAxis/ChartsAxis.mjs";import{ChartsClipPath as x}from"../ChartsClipPath/ChartsClipPath.mjs";const y=r.forwardRef(function(r,i){const y=o({props:r,name:"MuiBarChart"}),{chartsWrapperProps:O,chartsContainerProps:j,barPlotProps:I,gridProps:P,clipPathProps:R,clipPathGroupProps:q,overlayProps:T,chartsAxisProps:v,axisHighlightProps:A,legendProps:H,children:N}=a(y),{chartsDataProviderProps:B,chartsSurfaceProps:D}=n(j),L=y.slots?.tooltip??m,k=y.slots?.toolbar;return d(l,e({},B,{children:h(u,e({},O,{ref:i,children:[y.showToolbar&&k?d(k,e({},y.slotProps?.toolbar)):null,!y.hideLegend&&d(f,e({},H)),h(b,e({},D,{children:[d(c,e({},P)),h("g",e({},q,{children:[d(s,e({},I)),d(t,e({},T)),d(g,e({},A)),d(p,{})]})),d(C,e({},v)),d(x,e({},R)),N]})),!y.loading&&d(L,e({},y.slotProps?.tooltip))]}))}))});"production"!==process.env.NODE_ENV&&(y.displayName="BarChart"),"production"!==process.env.NODE_ENV&&(y.propTypes={apiRef:i.shape({current:i.object}),axesGap:i.number,axisHighlight:i.shape({x:i.oneOf(["band","line","none"]),y:i.oneOf(["band","line","none"])}),borderRadius:i.number,brushConfig:i.shape({enabled:i.bool,preventHighlight:i.bool,preventTooltip:i.bool}),children:i.node,className:i.string,colors:i.oneOfType([i.arrayOf(i.string),i.func]),dataset:i.arrayOf(i.object),desc:i.string,disableAxisListener:i.bool,disableKeyboardNavigation:i.bool,experimentalFeatures:i.object,grid:i.shape({horizontal:i.bool,vertical:i.bool}),height:i.number,hiddenItems:i.arrayOf(i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["bar"]).isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["bar"])})]).isRequired),hideLegend:i.bool,highlightedAxis:i.arrayOf(i.shape({axisId:i.oneOfType([i.number,i.string]).isRequired,dataIndex:i.number.isRequired})),highlightedItem:i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["bar"]).isRequired})]),id:i.string,initialHiddenItems:i.arrayOf(i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["bar"]).isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["bar"])})]).isRequired),layout:i.oneOf(["horizontal","vertical"]),loading:i.bool,localeText:i.object,margin:i.oneOfType([i.number,i.shape({bottom:i.number,left:i.number,right:i.number,top:i.number})]),onAxisClick:i.func,onHiddenItemsChange:i.func,onHighlightChange:i.func,onHighlightedAxisChange:i.func,onItemClick:i.func,onTooltipAxisChange:i.func,onTooltipItemChange:i.func,renderer:i.oneOf(["svg-batch","svg-single"]),series:i.arrayOf(i.object).isRequired,showToolbar:i.bool,skipAnimation:i.bool,slotProps:i.object,slots:i.object,sx:i.oneOfType([i.arrayOf(i.oneOfType([i.func,i.object,i.bool])),i.func,i.object]),theme:i.oneOf(["dark","light"]),title:i.string,tooltipAxis:i.arrayOf(i.shape({axisId:i.oneOfType([i.number,i.string]).isRequired,dataIndex:i.number.isRequired})),tooltipItem:i.oneOfType([i.shape({dataIndex:i.number.isRequired,seriesId:i.string.isRequired}),i.shape({dataIndex:i.number.isRequired,seriesId:i.string.isRequired,type:i.oneOf(["bar"]).isRequired})]),width:i.number,xAxis:i.arrayOf(i.object),yAxis:i.arrayOf(i.object)});export{y as BarChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import{useChartsLayerContainerRef as e}from"../hooks/useChartsLayerContainerRef.mjs";import{getChartPoint as n}from"../internals/getChartPoint.mjs";import{useStore as r}from"../internals/store/useStore.mjs";import{selectorBarItemAtPosition as s}from"../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.mjs";import{
|
|
1
|
+
import*as t from"react";import{useChartsLayerContainerRef as e}from"../hooks/useChartsLayerContainerRef.mjs";import{getChartPoint as n}from"../internals/getChartPoint.mjs";import{useStore as r}from"../internals/store/useStore.mjs";import{selectorBarItemAtPosition as s}from"../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.mjs";import{useChartsContext as i}from"../context/ChartsProvider/useChartsContext.mjs";function o(o){const{instance:a}=i(),c=e(),l=r();t.useEffect(()=>{const t=c.current;if(!t||!o)return;let e=null;const r=function(r){let i=r;e&&Math.abs(r.clientX-e.clientX)<=1&&Math.abs(r.clientY-e.clientY)<=1&&(i={clientX:e.clientX,clientY:e.clientY}),e=null;const c=n(t,i);if(!a.isPointInside(c.x,c.y))return;const u=s(l.state,c);u&&o(r,{type:"bar",seriesId:u.seriesId,dataIndex:u.dataIndex})},i=function(t){e=t};return t.addEventListener("click",r),t.addEventListener("pointerup",i),()=>{t.removeEventListener("click",r),t.removeEventListener("pointerup",i)}},[a,o,l,c])}export{o as useRegisterItemClickHandlers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"../../../@babel/runtime/helpers/esm/extends.mjs";import"react";import e from"../../../../_virtual/index.mjs";import{defaultSlotsMaterial as t}from"../internals/material/index.mjs";import{ChartsSlotsProvider as o}from"../context/ChartsSlotsContext.mjs";import{useChartsDataProviderProps as s}from"./useChartsDataProviderProps.mjs";import{jsx as i}from"react/jsx-runtime";import{ChartsProvider as a}from"../context/ChartsProvider/ChartsProvider.mjs";import{ChartsLocalizationProvider as n}from"../ChartsLocalizationProvider/ChartsLocalizationProvider.mjs";function m(e){const{children:m,localeText:l,chartProviderProps:p,slots:c,slotProps:h}=s(e);return i(a,r({},p,{children:i(n,{localeText:l,children:i(o,{slots:c,slotProps:h,defaultSlots:t,children:m})})}))}"production"!==process.env.NODE_ENV&&(m.propTypes={apiRef:e.shape({current:e.any}),colors:e.oneOfType([e.arrayOf(e.string),e.func]),dataset:e.arrayOf(e.object),experimentalFeatures:e.
|
|
1
|
+
import r from"../../../@babel/runtime/helpers/esm/extends.mjs";import"react";import e from"../../../../_virtual/index.mjs";import{defaultSlotsMaterial as t}from"../internals/material/index.mjs";import{ChartsSlotsProvider as o}from"../context/ChartsSlotsContext.mjs";import{useChartsDataProviderProps as s}from"./useChartsDataProviderProps.mjs";import{jsx as i}from"react/jsx-runtime";import{ChartsProvider as a}from"../context/ChartsProvider/ChartsProvider.mjs";import{ChartsLocalizationProvider as n}from"../ChartsLocalizationProvider/ChartsLocalizationProvider.mjs";function m(e){const{children:m,localeText:l,chartProviderProps:p,slots:c,slotProps:h}=s(e);return i(a,r({},p,{children:i(n,{localeText:l,children:i(o,{slots:c,slotProps:h,defaultSlots:t,children:m})})}))}"production"!==process.env.NODE_ENV&&(m.propTypes={apiRef:e.shape({current:e.any}),colors:e.oneOfType([e.arrayOf(e.string),e.func]),dataset:e.arrayOf(e.object),experimentalFeatures:e.any,height:e.number,id:e.string,localeText:e.object,margin:e.oneOfType([e.number,e.shape({bottom:e.number,left:e.number,right:e.number,top:e.number})]),series:e.arrayOf(e.object),skipAnimation:e.bool,slotProps:e.object,slots:e.object,theme:e.oneOf(["dark","light"]),width:e.number});export{m as ChartsDataProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"../../../@babel/runtime/helpers/esm/extends.mjs";import s from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import t from"../../../../_virtual/index.mjs";import{styled as i}from"@mui/material/styles";import{clsx as r}from"../../../clsx/dist/clsx.mjs";import{AreaElement as e}from"./AreaElement.mjs";import{useSkipAnimation as m}from"../hooks/useSkipAnimation.mjs";import{useXAxes as n,useYAxes as a}from"../hooks/useAxis.mjs";import{useInternalIsZoomInteracting as l}from"../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.mjs";import{useAreaPlotData as p}from"./useAreaPlotData.mjs";import{useLineItemClickHandler as c
|
|
1
|
+
import o from"../../../@babel/runtime/helpers/esm/extends.mjs";import s from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import t from"../../../../_virtual/index.mjs";import{styled as i}from"@mui/material/styles";import{clsx as r}from"../../../clsx/dist/clsx.mjs";import{AreaElement as e}from"./AreaElement.mjs";import{useSkipAnimation as m}from"../hooks/useSkipAnimation.mjs";import{useXAxes as n,useYAxes as a}from"../hooks/useAxis.mjs";import{useInternalIsZoomInteracting as l}from"../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.mjs";import{useAreaPlotData as p}from"./useAreaPlotData.mjs";import{useLineItemClickHandler as c}from"./useLineItemClickHandler.mjs";import{ANIMATION_TIMING_FUNCTION as u,ANIMATION_DURATION_MS as f}from"../internals/animation/animation.mjs";import{useUtilityClasses as j,lineClasses as d}from"./lineClasses.mjs";import{jsx as k}from"react/jsx-runtime";const A=["slots","slotProps","onItemClick","skipAnimation","className"],x=i("g",{name:"MuiAreaPlot",slot:"Root"})({[`& .${d.area}`]:{transitionProperty:"opacity, fill",transitionDuration:`${f}ms`,transitionTimingFunction:u}});function I(t){const{slots:i,slotProps:u,onItemClick:f,skipAnimation:d,className:I}=t,P=s(t,A),b=l(),C=m(b||d),g=(()=>{const{xAxis:o}=n(),{yAxis:s}=a();return p(o,s)})(),h=j(),y=c(f);return k(x,o({className:r(h.areaPlot,I)},P,{children:g.map(({d:o,seriesId:s,color:t,area:r,gradientId:m})=>!!r&&k(e,{seriesId:s,d:o,color:t,gradientId:m,slots:i,slotProps:u,onClick:y&&(o=>y(o,s)),skipAnimation:C},s))}))}"production"!==process.env.NODE_ENV&&(I.propTypes={onItemClick:t.func,skipAnimation:t.bool,slotProps:t.object,slots:t.object});export{I as AreaPlot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import*as r from"react";import i from"../../../../_virtual/index.mjs";import{useThemeProps as o}from"@mui/material/styles";import{AreaPlot as s}from"./AreaPlot.mjs";import{LinePlot as t}from"./LinePlot.mjs";import{MarkPlot as a}from"./MarkPlot.mjs";import{ChartsAxis as n}from"../ChartsAxis/ChartsAxis.mjs";import{LineHighlightPlot as p}from"./LineHighlightPlot.mjs";import{useLineChartProps as l}from"./useLineChartProps.mjs";import{useChartsContainerProps as d}from"../ChartsContainer/useChartsContainerProps.mjs";import{FocusedLineMark as m}from"./FocusedLineMark.mjs";import{jsx as h,jsxs as f}from"react/jsx-runtime";import{ChartsTooltip as u}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as
|
|
1
|
+
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import*as r from"react";import i from"../../../../_virtual/index.mjs";import{useThemeProps as o}from"@mui/material/styles";import{AreaPlot as s}from"./AreaPlot.mjs";import{LinePlot as t}from"./LinePlot.mjs";import{MarkPlot as a}from"./MarkPlot.mjs";import{ChartsAxis as n}from"../ChartsAxis/ChartsAxis.mjs";import{LineHighlightPlot as p}from"./LineHighlightPlot.mjs";import{useLineChartProps as l}from"./useLineChartProps.mjs";import{useChartsContainerProps as d}from"../ChartsContainer/useChartsContainerProps.mjs";import{FocusedLineMark as m}from"./FocusedLineMark.mjs";import{jsx as h,jsxs as f}from"react/jsx-runtime";import{ChartsTooltip as u}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as g}from"../ChartsDataProvider/ChartsDataProvider.mjs";import{ChartsWrapper as c}from"../ChartsWrapper/ChartsWrapper.mjs";import{ChartsLegend as b}from"../ChartsLegend/ChartsLegend.mjs";import{ChartsSurface as C}from"../ChartsSurface/ChartsSurface.mjs";import{ChartsGrid as x}from"../ChartsGrid/ChartsGrid.mjs";import{ChartsOverlay as P}from"../ChartsOverlay/ChartsOverlay.mjs";import{ChartsAxisHighlight as y}from"../ChartsAxisHighlight/ChartsAxisHighlight.mjs";import{ChartsClipPath as O}from"../ChartsClipPath/ChartsClipPath.mjs";const j=r.forwardRef(function(r,i){const j=o({props:r,name:"MuiLineChart"}),{chartsWrapperProps:I,chartsContainerProps:R,gridProps:q,clipPathProps:T,clipPathGroupProps:A,areaPlotProps:v,linePlotProps:L,markPlotProps:H,overlayProps:k,chartsAxisProps:N,axisHighlightProps:w,lineHighlightPlotProps:D,legendProps:E,children:G}=l(j),{chartsDataProviderProps:M,chartsSurfaceProps:S}=d(R),W=j.slots?.tooltip??u,_=j.slots?.toolbar;return h(g,e({},M,{children:f(c,e({},I,{ref:i,children:[j.showToolbar&&_?h(_,e({},j.slotProps?.toolbar)):null,!j.hideLegend&&h(b,e({},E)),f(C,e({},S,{children:[h(x,e({},q)),f("g",e({},A,{children:[h(s,e({},v)),h(t,e({},L)),h(P,e({},k)),h(y,e({},w))]})),h(m,{}),h(n,e({},N)),h("g",{"data-drawing-container":!0,children:h(a,e({},H))}),h(p,e({},D)),h(O,e({},T)),G]})),!j.loading&&h(W,e({},j.slotProps?.tooltip))]}))}))});"production"!==process.env.NODE_ENV&&(j.displayName="LineChart"),"production"!==process.env.NODE_ENV&&(j.propTypes={apiRef:i.shape({current:i.object}),axesGap:i.number,axisHighlight:i.shape({x:i.oneOf(["band","line","none"]),y:i.oneOf(["band","line","none"])}),brushConfig:i.shape({enabled:i.bool,preventHighlight:i.bool,preventTooltip:i.bool}),children:i.node,className:i.string,colors:i.oneOfType([i.arrayOf(i.string),i.func]),dataset:i.arrayOf(i.object),desc:i.string,disableAxisListener:i.bool,disableKeyboardNavigation:i.bool,disableLineItemHighlight:i.bool,experimentalFeatures:i.shape({enablePositionBasedPointerInteraction:i.bool}),grid:i.shape({horizontal:i.bool,vertical:i.bool}),height:i.number,hiddenItems:i.arrayOf(i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["line"]).isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["line"])})]).isRequired),hideLegend:i.bool,highlightedAxis:i.arrayOf(i.shape({axisId:i.oneOfType([i.number,i.string]).isRequired,dataIndex:i.number.isRequired})),highlightedItem:i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["line"]).isRequired})]),id:i.string,initialHiddenItems:i.arrayOf(i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["line"]).isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["line"])})]).isRequired),loading:i.bool,localeText:i.object,margin:i.oneOfType([i.number,i.shape({bottom:i.number,left:i.number,right:i.number,top:i.number})]),onAreaClick:i.func,onAxisClick:i.func,onHiddenItemsChange:i.func,onHighlightChange:i.func,onHighlightedAxisChange:i.func,onLineClick:i.func,onMarkClick:i.func,onTooltipAxisChange:i.func,onTooltipItemChange:i.func,series:i.arrayOf(i.object).isRequired,showToolbar:i.bool,skipAnimation:i.bool,slotProps:i.object,slots:i.object,sx:i.oneOfType([i.arrayOf(i.oneOfType([i.func,i.object,i.bool])),i.func,i.object]),theme:i.oneOf(["dark","light"]),title:i.string,tooltipAxis:i.arrayOf(i.shape({axisId:i.oneOfType([i.number,i.string]).isRequired,dataIndex:i.number.isRequired})),tooltipItem:i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["line"]).isRequired})]),width:i.number,xAxis:i.arrayOf(i.object),yAxis:i.arrayOf(i.object)});export{j as LineChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"../../../@babel/runtime/helpers/esm/extends.mjs";import i from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import s from"../../../../_virtual/index.mjs";import{styled as t}from"@mui/material/styles";import{clsx as e}from"../../../clsx/dist/clsx.mjs";import{LineElement as r}from"./LineElement.mjs";import{useSkipAnimation as
|
|
1
|
+
import o from"../../../@babel/runtime/helpers/esm/extends.mjs";import i from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import s from"../../../../_virtual/index.mjs";import{styled as t}from"@mui/material/styles";import{clsx as e}from"../../../clsx/dist/clsx.mjs";import{LineElement as r}from"./LineElement.mjs";import{useSkipAnimation as m}from"../hooks/useSkipAnimation.mjs";import{useInternalIsZoomInteracting as n}from"../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.mjs";import{useLinePlotData as l}from"./useLinePlotData.mjs";import{useLineItemClickHandler as a}from"./useLineItemClickHandler.mjs";import{ANIMATION_TIMING_FUNCTION as p,ANIMATION_DURATION_MS as c}from"../internals/animation/animation.mjs";import{useUtilityClasses as u,lineClasses as d}from"./lineClasses.mjs";import{jsx as f}from"react/jsx-runtime";import{useXAxes as j,useYAxes as k}from"../hooks/useAxis.mjs";const x=["slots","slotProps","skipAnimation","onItemClick","className"],I=t("g",{name:"MuiLinePlot",slot:"Root"})({[`& .${d.line}`]:{transitionProperty:"opacity, fill",transitionDuration:`${c}ms`,transitionTimingFunction:p}});function P(s){const{slots:t,slotProps:p,skipAnimation:c,onItemClick:d,className:P}=s,h=i(s,x),A=n(),b=m(A||c),C=(()=>{const{xAxis:o}=j(),{yAxis:i}=k();return l(o,i)})(),g=u(),y=a(d);return f(I,o({className:e(g.linePlot,P)},h,{children:C.map(({d:o,seriesId:i,color:s,gradientId:e,hidden:m,isSampled:n})=>f(r,{seriesId:i,d:o,color:s,gradientId:e,hidden:m,skipAnimation:b||n,slots:t,slotProps:p,onClick:y&&(o=>y(o,i))},i))}))}"production"!==process.env.NODE_ENV&&(P.propTypes={onItemClick:s.func,skipAnimation:s.bool,slotProps:s.object,slots:s.object});export{P as LinePlot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"../../../@babel/runtime/helpers/esm/extends.mjs";import e from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import{styled as
|
|
1
|
+
import s from"../../../@babel/runtime/helpers/esm/extends.mjs";import e from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import t from"../../../../_virtual/index.mjs";import*as o from"react";import{styled as r}from"@mui/material/styles";import{clsx as i}from"../../../clsx/dist/clsx.mjs";import{useSkipAnimation as m}from"../hooks/useSkipAnimation.mjs";import{CircleMarkElement as a}from"./CircleMarkElement.mjs";import{MarkElement as n}from"./MarkElement.mjs";import{useInternalIsZoomInteracting as l}from"../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.mjs";import{useMarkPlotData as p}from"./useMarkPlotData.mjs";import{useUtilityClasses as c}from"./lineClasses.mjs";import{jsx as d}from"react/jsx-runtime";import{useXAxes as u,useYAxes as h}from"../hooks/useAxis.mjs";import{useChartsContext as f}from"../context/ChartsProvider/useChartsContext.mjs";import{useItemHighlightStateGetter as x}from"../hooks/useItemHighlightStateGetter.mjs";import{selectorChartsHighlightXAxisIndex as k}from"../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.mjs";const j=["slots","slotProps","skipAnimation","onItemClick","className"],I=r("g",{name:"MuiMarkPlot",slot:"Root"})({});function g(t){const{slots:r,slotProps:g,skipAnimation:C,onItemClick:A,className:P}=t,b=e(t,j),y=l(),M=m(y||C),{xAxis:N}=u(),{yAxis:v}=h(),{store:E}=f(),H=x(),S=E.use(k),$=o.useMemo(()=>{const s={};for(const{dataIndex:e,axisId:t}of S)void 0===s[t]?s[t]=new Set([e]):s[t].add(e);return s},[S]),D=p(N,v),_=c();return d(I,s({className:i(_.markPlot,P)},b,{children:D.map(({seriesId:e,clipId:t,shape:o,xAxisId:i,marks:m,hidden:l})=>{const p=r?.mark??("circle"===o?a:n),c=H({type:"line",seriesId:e}),u="highlighted"===c,h="faded"===c;return d("g",{clipPath:`url(#${t})`,"data-series":e,children:m.map(({x:t,y:r,index:m,color:a})=>d(p,s({seriesId:e,dataIndex:m,shape:o,color:a,x:t,y:r,skipAnimation:M,onClick:A&&(s=>A(s,{type:"line",seriesId:e,dataIndex:m})),isHighlighted:$[i]?.has(m)||u,isFaded:h,hidden:l},g?.mark),`${e}-${m}`))},e)})}))}"production"!==process.env.NODE_ENV&&(g.propTypes={onItemClick:t.func,skipAnimation:t.bool,slotProps:t.object,slots:t.object});export{g as MarkPlot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as s from"react";import{useChartsLayerContainerRef as r}from"../hooks/useChartsLayerContainerRef.mjs";import{useXAxes as e}from"../hooks/useAxis.mjs";import{useLineSeriesContext as i}from"../hooks/useLineSeries.mjs";import{getChartPoint as o}from"../internals/getChartPoint.mjs";import{getAxisIndex as t}from"../internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.mjs";function n(n){const m=r(),{xAxis:a,xAxisIds:u}=e(),x=i(),f=u[0];return s.useMemo(()=>{if(n)return(s,r)=>{const e=m.current,i=x?.series[r]?.xAxisId??f,u=void 0===i?void 0:a[i];if(null===e||void 0===u)return;const p=o(e,s),d=t(u,p.x);-1!==d&&n(s,{type:"line",seriesId:r,dataIndex:d})}},[n,m,x,f,a])}export{n as useLineItemClickHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import i from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import r from"../../../../_virtual/index.mjs";import{styled as n}from"@mui/material/styles";import{PieArc as s}from"./PieArc.mjs";import{useTransformData as d}from"./dataTransform/useTransformData.mjs";import{
|
|
1
|
+
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import i from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import r from"../../../../_virtual/index.mjs";import{styled as n}from"@mui/material/styles";import{PieArc as s}from"./PieArc.mjs";import{useTransformData as d}from"./dataTransform/useTransformData.mjs";import{jsx as a}from"react/jsx-runtime";const o=["slots","slotProps","innerRadius","outerRadius","cornerRadius","paddingAngle","seriesId","highlighted","faded","data","onItemClick","skipAnimation"],u=n("g",{name:"MuiPieArcPlot",slot:"Root"})();function t(r){const{slots:n,slotProps:t,innerRadius:l=0,outerRadius:m,cornerRadius:p=0,paddingAngle:g=0,seriesId:c,highlighted:R,faded:b={additionalRadius:-5},data:h,onItemClick:f,skipAnimation:A}=r,q=i(r,o),I=d({innerRadius:l,outerRadius:m,cornerRadius:p,paddingAngle:g,id:c,highlighted:R,faded:b,data:h});if(0===h.length)return null;const k=n?.pieArc??s;return a(u,e({},q,{children:I.map((i,r)=>a(k,e({startAngle:i.startAngle,endAngle:i.endAngle,paddingAngle:i.paddingAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius,cornerRadius:i.cornerRadius,skipAnimation:A??!1,seriesId:c,color:i.color,dataIndex:r,isFaded:i.isFaded,isHighlighted:i.isHighlighted,isFocused:i.isFocused,onClick:f&&(e=>{f(e,{type:"pie",seriesId:c,dataIndex:r},i)})},t?.pieArc),i.dataIndex))}))}"production"!==process.env.NODE_ENV&&(t.propTypes={arcLabelRadius:r.number,cornerRadius:r.number,data:r.arrayOf(r.shape({color:r.string.isRequired,endAngle:r.number.isRequired,formattedValue:r.string.isRequired,hidden:r.bool.isRequired,id:r.oneOfType([r.number,r.string]),index:r.number.isRequired,label:r.oneOfType([r.func,r.string]),labelMarkType:r.oneOfType([r.oneOf(["circle","line","line+mark","square"]),r.func]),padAngle:r.number.isRequired,startAngle:r.number.isRequired,value:r.number.isRequired})).isRequired,faded:r.shape({additionalRadius:r.number,arcLabelRadius:r.number,color:r.string,cornerRadius:r.number,innerRadius:r.number,outerRadius:r.number,paddingAngle:r.number}),highlighted:r.shape({additionalRadius:r.number,arcLabelRadius:r.number,color:r.string,cornerRadius:r.number,innerRadius:r.number,outerRadius:r.number,paddingAngle:r.number}),innerRadius:r.number,onItemClick:r.func,outerRadius:r.number.isRequired,paddingAngle:r.number,seriesId:r.string.isRequired,skipAnimation:r.bool,slotProps:r.object,slots:r.object});export{t as PieArcPlot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import r from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import*as i from"react";import t from"../../../../_virtual/index.mjs";import{useThemeProps as o}from"@mui/material/styles";import{DEFAULT_PIE_CHART_MARGIN as s}from"../internals/constants.mjs";import{PiePlot as n}from"./PiePlot.mjs";import{useChartsContainerProps as a}from"../ChartsContainer/useChartsContainerProps.mjs";import{PIE_CHART_PLUGINS as m}from"./PieChart.plugins.mjs";import{defaultizeMargin as d}from"../internals/defaultizeMargin.mjs";import{FocusedPieArc as p}from"./FocusedPieArc.mjs";import{jsx as l,jsxs as h}from"react/jsx-runtime";import{ChartsTooltip as g}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as c}from"../ChartsDataProvider/ChartsDataProvider.mjs";import{ChartsWrapper as u}from"../ChartsWrapper/ChartsWrapper.mjs";import{ChartsLegend as f}from"../ChartsLegend/ChartsLegend.mjs";import{ChartsSurface as b}from"../ChartsSurface/ChartsSurface.mjs";import{ChartsOverlay as C}from"../ChartsOverlay/ChartsOverlay.mjs";const I=["series","width","height","margin","colors","sx","skipAnimation","hideLegend","children","slots","slotProps","onItemClick","loading","highlightedItem","onHighlightChange","className","showToolbar"],y=i.forwardRef(function(i,t){const y=o({props:i,name:"MuiPieChart"}),{series:j,width:O,height:P,margin:R,colors:x,sx:q,skipAnimation:T,hideLegend:v,children:
|
|
1
|
+
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import r from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import*as i from"react";import t from"../../../../_virtual/index.mjs";import{useThemeProps as o}from"@mui/material/styles";import{DEFAULT_PIE_CHART_MARGIN as s}from"../internals/constants.mjs";import{PiePlot as n}from"./PiePlot.mjs";import{useChartsContainerProps as a}from"../ChartsContainer/useChartsContainerProps.mjs";import{PIE_CHART_PLUGINS as m}from"./PieChart.plugins.mjs";import{defaultizeMargin as d}from"../internals/defaultizeMargin.mjs";import{FocusedPieArc as p}from"./FocusedPieArc.mjs";import{jsx as l,jsxs as h}from"react/jsx-runtime";import{ChartsTooltip as g}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as c}from"../ChartsDataProvider/ChartsDataProvider.mjs";import{ChartsWrapper as u}from"../ChartsWrapper/ChartsWrapper.mjs";import{ChartsLegend as f}from"../ChartsLegend/ChartsLegend.mjs";import{ChartsSurface as b}from"../ChartsSurface/ChartsSurface.mjs";import{ChartsOverlay as C}from"../ChartsOverlay/ChartsOverlay.mjs";const I=["series","width","height","margin","colors","sx","skipAnimation","hideLegend","children","slots","slotProps","onItemClick","loading","highlightedItem","onHighlightChange","className","showToolbar"],y=i.forwardRef(function(i,t){const y=o({props:i,name:"MuiPieChart"}),{series:j,width:O,height:P,margin:R,colors:x,sx:q,skipAnimation:T,hideLegend:v,children:N,slots:k,slotProps:w,onItemClick:L,loading:D,highlightedItem:H,onHighlightChange:A,className:E,showToolbar:S}=y,W=r(y,I),_=d(R,s),{chartsDataProviderProps:F,chartsSurfaceProps:M}=a(e({},W,{series:j.map(r=>e({type:"pie"},r)),width:O,height:P,margin:_,colors:x,highlightedItem:H,onHighlightChange:A,skipAnimation:T,plugins:m})),V=k?.tooltip??g,z=k?.toolbar;return l(c,e({},F,{children:h(u,{legendPosition:w?.legend?.position,legendDirection:w?.legend?.direction??"vertical",sx:q,hideLegend:v??!1,className:E,ref:t,children:[S&&z?l(z,e({},w?.toolbar)):null,!v&&l(f,{direction:w?.legend?.direction??"vertical",slots:k,slotProps:w}),h(b,e({},M,{children:[l(n,{slots:k,slotProps:w,onItemClick:L}),l(p,{}),l(C,{loading:D,slots:k,slotProps:w}),N]})),!D&&l(V,e({trigger:"item"},w?.tooltip))]})}))});"production"!==process.env.NODE_ENV&&(y.displayName="PieChart"),"production"!==process.env.NODE_ENV&&(y.propTypes={apiRef:t.shape({current:t.object}),children:t.node,className:t.string,colors:t.oneOfType([t.arrayOf(t.string),t.func]),dataset:t.arrayOf(t.object),desc:t.string,disableKeyboardNavigation:t.bool,experimentalFeatures:t.object,height:t.number,hiddenItems:t.arrayOf(t.oneOfType([t.shape({dataIndex:t.number,seriesId:t.string.isRequired,type:t.oneOf(["pie"]).isRequired}),t.shape({dataIndex:t.number,seriesId:t.string.isRequired,type:t.oneOf(["pie"])})]).isRequired),hideLegend:t.bool,highlightedItem:t.oneOfType([t.shape({dataIndex:t.number,seriesId:t.string.isRequired}),t.shape({dataIndex:t.number,seriesId:t.string.isRequired,type:t.oneOf(["pie"]).isRequired})]),id:t.string,initialHiddenItems:t.arrayOf(t.oneOfType([t.shape({dataIndex:t.number,seriesId:t.string.isRequired,type:t.oneOf(["pie"]).isRequired}),t.shape({dataIndex:t.number,seriesId:t.string.isRequired,type:t.oneOf(["pie"])})]).isRequired),loading:t.bool,localeText:t.object,margin:t.oneOfType([t.number,t.shape({bottom:t.number,left:t.number,right:t.number,top:t.number})]),onHiddenItemsChange:t.func,onHighlightChange:t.func,onItemClick:t.func,onTooltipItemChange:t.func,series:t.arrayOf(t.object).isRequired,showToolbar:t.bool,skipAnimation:t.bool,slotProps:t.object,slots:t.object,sx:t.oneOfType([t.arrayOf(t.oneOfType([t.func,t.object,t.bool])),t.func,t.object]),theme:t.oneOf(["dark","light"]),title:t.string,tooltipItem:t.oneOfType([t.shape({dataIndex:t.number.isRequired,seriesId:t.string.isRequired}),t.shape({dataIndex:t.number.isRequired,seriesId:t.string.isRequired,type:t.oneOf(["pie"]).isRequired})]),width:t.number});export{y as PieChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import t from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import s from"../../../../_virtual/index.mjs";import{clsx as r}from"../../../clsx/dist/clsx.mjs";import{getInteractionItemProps as o}from"../hooks/useInteractionItemProps.mjs";import{useStore as i}from"../internals/store/useStore.mjs";import{useItemHighlightStateGetter as a}from"../hooks/useItemHighlightStateGetter.mjs";import{ScatterMarker as m}from"./ScatterMarker.mjs";import{useUtilityClasses as
|
|
1
|
+
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import t from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.mjs";import"react";import s from"../../../../_virtual/index.mjs";import{clsx as r}from"../../../clsx/dist/clsx.mjs";import{getInteractionItemProps as o}from"../hooks/useInteractionItemProps.mjs";import{useStore as i}from"../internals/store/useStore.mjs";import{useItemHighlightStateGetter as a}from"../hooks/useItemHighlightStateGetter.mjs";import{ScatterMarker as m}from"./ScatterMarker.mjs";import{useUtilityClasses as n}from"./scatterClasses.mjs";import{useScatterPlotData as d}from"./useScatterPlotData.mjs";import{jsx as l}from"react/jsx-runtime";import{useChartsContext as c}from"../context/ChartsProvider/useChartsContext.mjs";import{selectorChartsIsVoronoiEnabled as p}from"../internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.mjs";import u from"../../utils/useSlotProps/useSlotProps.mjs";const f=["ownerState"];function h(s){const{series:h,xScale:x,yScale:j,colorGetter:I,sizeGetter:P,onItemClick:S,classes:g,slots:C,slotProps:b}=s,{instance:k}=c(),y=i().use(p),q=a(),v=d(h,x,j,k.isPointInside),R=C?.marker??m,G=u({elementType:R,externalSlotProps:b?.marker,additionalProps:{seriesId:h.id},ownerState:{}}),N=t(G,f),z=n({classes:g});return l("g",{"data-series":h.id,className:z.series,children:v.map(t=>{const s=q(t),i="highlighted"===s,a="faded"===s;return l(R,e({className:r(z.marker,N.className),dataIndex:t.dataIndex,color:I(t.dataIndex),size:P(t.dataIndex),isHighlighted:i,isFaded:a,x:t.x,y:t.y,onClick:S&&(e=>S(e,{type:"scatter",seriesId:h.id,dataIndex:t.dataIndex})),"data-highlighted":i||void 0,"data-faded":a||void 0},y?void 0:o(k,t),N),t.id??t.dataIndex)})})}"production"!==process.env.NODE_ENV&&(h.propTypes={classes:s.object,color:s.string.isRequired,colorGetter:s.func.isRequired,onItemClick:s.func,series:s.object.isRequired,sizeGetter:s.func.isRequired,slotProps:s.object,slots:s.object,xScale:s.func.isRequired,yScale:s.func.isRequired});export{h as Scatter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import*as r from"react";import i from"../../../../_virtual/index.mjs";import{useThemeProps as s}from"@mui/material/styles";import{ScatterPlot as o}from"./ScatterPlot.mjs";import{useScatterChartProps as t}from"./useScatterChartProps.mjs";import{useChartsContainerProps as n}from"../ChartsContainer/useChartsContainerProps.mjs";import{FocusedScatterMark as a}from"./FocusedScatterMark.mjs";import{jsx as p,jsxs as d}from"react/jsx-runtime";import{ChartsTooltip as u}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as m}from"../ChartsDataProvider/ChartsDataProvider.mjs";import{ChartsWrapper as f}from"../ChartsWrapper/ChartsWrapper.mjs";import{ChartsLegend as l}from"../ChartsLegend/ChartsLegend.mjs";import{ChartsSurface as h}from"../ChartsSurface/ChartsSurface.mjs";import{ChartsAxis as c}from"../ChartsAxis/ChartsAxis.mjs";import{ChartsGrid as b}from"../ChartsGrid/ChartsGrid.mjs";import{ChartsOverlay as O}from"../ChartsOverlay/ChartsOverlay.mjs";import{ChartsAxisHighlight as g}from"../ChartsAxisHighlight/ChartsAxisHighlight.mjs";const y=r.forwardRef(function(r,i){const y=s({props:r,name:"MuiScatterChart"}),{chartsWrapperProps:R,chartsContainerProps:q,chartsAxisProps:x,gridProps:C,scatterPlotProps:T,overlayProps:j,legendProps:I,axisHighlightProps:v,children:P}=t(y),{chartsDataProviderProps:A,chartsSurfaceProps:D}=n(q),w=y.slots?.tooltip??u,k=y.slots?.toolbar;return p(m,e({},A,{children:d(f,e({},R,{ref:i,children:[y.showToolbar&&k?p(k,e({},y.slotProps?.toolbar)):null,!y.hideLegend&&p(l,e({},I)),d(h,e({},D,{children:[p(c,e({},x)),p(b,e({},C)),p("g",{"data-drawing-container":!0,children:p(o,e({},T))}),p(O,e({},j)),p(g,e({},v)),p(a,{}),P]})),!y.loading&&p(w,e({trigger:"item"},y.slotProps?.tooltip))]}))}))});"production"!==process.env.NODE_ENV&&(y.displayName="ScatterChart"),"production"!==process.env.NODE_ENV&&(y.propTypes={apiRef:i.shape({current:i.object}),axesGap:i.number,axisHighlight:i.shape({x:i.oneOf(["band","line","none"]),y:i.oneOf(["band","line","none"])}),brushConfig:i.shape({enabled:i.bool,preventHighlight:i.bool,preventTooltip:i.bool}),children:i.node,className:i.string,colors:i.oneOfType([i.arrayOf(i.string),i.func]),dataset:i.arrayOf(i.object),desc:i.string,disableAxisListener:i.bool,disableClosestPoint:i.bool,disableHitArea:i.bool,disableKeyboardNavigation:i.bool,disableVoronoi:i.bool,experimentalFeatures:i.shape({
|
|
1
|
+
import e from"../../../@babel/runtime/helpers/esm/extends.mjs";import*as r from"react";import i from"../../../../_virtual/index.mjs";import{useThemeProps as s}from"@mui/material/styles";import{ScatterPlot as o}from"./ScatterPlot.mjs";import{useScatterChartProps as t}from"./useScatterChartProps.mjs";import{useChartsContainerProps as n}from"../ChartsContainer/useChartsContainerProps.mjs";import{FocusedScatterMark as a}from"./FocusedScatterMark.mjs";import{jsx as p,jsxs as d}from"react/jsx-runtime";import{ChartsTooltip as u}from"../ChartsTooltip/ChartsTooltip.mjs";import{ChartsDataProvider as m}from"../ChartsDataProvider/ChartsDataProvider.mjs";import{ChartsWrapper as f}from"../ChartsWrapper/ChartsWrapper.mjs";import{ChartsLegend as l}from"../ChartsLegend/ChartsLegend.mjs";import{ChartsSurface as h}from"../ChartsSurface/ChartsSurface.mjs";import{ChartsAxis as c}from"../ChartsAxis/ChartsAxis.mjs";import{ChartsGrid as b}from"../ChartsGrid/ChartsGrid.mjs";import{ChartsOverlay as O}from"../ChartsOverlay/ChartsOverlay.mjs";import{ChartsAxisHighlight as g}from"../ChartsAxisHighlight/ChartsAxisHighlight.mjs";const y=r.forwardRef(function(r,i){const y=s({props:r,name:"MuiScatterChart"}),{chartsWrapperProps:R,chartsContainerProps:q,chartsAxisProps:x,gridProps:C,scatterPlotProps:T,overlayProps:j,legendProps:I,axisHighlightProps:v,children:P}=t(y),{chartsDataProviderProps:A,chartsSurfaceProps:D}=n(q),w=y.slots?.tooltip??u,k=y.slots?.toolbar;return p(m,e({},A,{children:d(f,e({},R,{ref:i,children:[y.showToolbar&&k?p(k,e({},y.slotProps?.toolbar)):null,!y.hideLegend&&p(l,e({},I)),d(h,e({},D,{children:[p(c,e({},x)),p(b,e({},C)),p("g",{"data-drawing-container":!0,children:p(o,e({},T))}),p(O,e({},j)),p(g,e({},v)),p(a,{}),P]})),!y.loading&&p(w,e({trigger:"item"},y.slotProps?.tooltip))]}))}))});"production"!==process.env.NODE_ENV&&(y.displayName="ScatterChart"),"production"!==process.env.NODE_ENV&&(y.propTypes={apiRef:i.shape({current:i.object}),axesGap:i.number,axisHighlight:i.shape({x:i.oneOf(["band","line","none"]),y:i.oneOf(["band","line","none"])}),brushConfig:i.shape({enabled:i.bool,preventHighlight:i.bool,preventTooltip:i.bool}),children:i.node,className:i.string,colors:i.oneOfType([i.arrayOf(i.string),i.func]),dataset:i.arrayOf(i.object),desc:i.string,disableAxisListener:i.bool,disableClosestPoint:i.bool,disableHitArea:i.bool,disableKeyboardNavigation:i.bool,disableVoronoi:i.bool,experimentalFeatures:i.shape({progressiveRendering:i.bool}),grid:i.shape({horizontal:i.bool,vertical:i.bool}),height:i.number,hiddenItems:i.arrayOf(i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["scatter"]).isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["scatter"])})]).isRequired),hideLegend:i.bool,highlightedItem:i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["scatter"]).isRequired})]),hitAreaRadius:i.oneOfType([i.oneOf(["item"]),i.number]),id:i.string,initialHiddenItems:i.arrayOf(i.oneOfType([i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["scatter"]).isRequired}),i.shape({dataIndex:i.number,seriesId:i.string.isRequired,type:i.oneOf(["scatter"])})]).isRequired),loading:i.bool,localeText:i.object,margin:i.oneOfType([i.number,i.shape({bottom:i.number,left:i.number,right:i.number,top:i.number})]),onAxisClick:i.func,onHiddenItemsChange:i.func,onHighlightChange:i.func,onItemClick:i.func,onTooltipAxisChange:i.func,onTooltipItemChange:i.func,renderer:i.oneOf(["svg-batch","svg-progressive","svg-single"]),series:i.arrayOf(i.object).isRequired,showToolbar:i.bool,skipAnimation:i.bool,slotProps:i.object,slots:i.object,sx:i.oneOfType([i.arrayOf(i.oneOfType([i.func,i.object,i.bool])),i.func,i.object]),theme:i.oneOf(["dark","light"]),title:i.string,tooltipAxis:i.arrayOf(i.shape({axisId:i.oneOfType([i.number,i.string]).isRequired,dataIndex:i.number.isRequired})),tooltipItem:i.oneOfType([i.shape({dataIndex:i.number.isRequired,seriesId:i.string.isRequired}),i.shape({dataIndex:i.number.isRequired,seriesId:i.string.isRequired,type:i.oneOf(["scatter"]).isRequired})]),width:i.number,xAxis:i.arrayOf(i.object),yAxis:i.arrayOf(i.object),zAxis:i.arrayOf(i.shape({colorMap:i.oneOfType([i.shape({color:i.oneOfType([i.arrayOf(i.string.isRequired),i.func]).isRequired,max:i.oneOfType([i.instanceOf(Date),i.number]),min:i.oneOfType([i.instanceOf(Date),i.number]),type:i.oneOf(["continuous"]).isRequired,unknownColor:i.string}),i.shape({colors:i.arrayOf(i.string).isRequired,thresholds:i.arrayOf(i.oneOfType([i.instanceOf(Date),i.number]).isRequired).isRequired,type:i.oneOf(["piecewise"]).isRequired,unknownColor:i.string}),i.shape({colors:i.arrayOf(i.string).isRequired,type:i.oneOf(["ordinal"]).isRequired,unknownColor:i.string,values:i.arrayOf(i.oneOfType([i.instanceOf(Date),i.number,i.string]).isRequired)})]),data:i.array,dataKey:i.string,id:i.string,max:i.number,min:i.number,sizeMap:i.oneOfType([i.shape({interpolator:i.oneOf(["linear","log","sqrt"]),max:i.oneOfType([i.instanceOf(Date),i.number]),min:i.oneOfType([i.instanceOf(Date),i.number]),size:i.arrayOf(i.number.isRequired).isRequired,type:i.oneOf(["continuous"]).isRequired}),i.shape({max:i.oneOfType([i.instanceOf(Date),i.number]),min:i.oneOfType([i.instanceOf(Date),i.number]),size:i.func.isRequired,type:i.oneOf(["continuous"]).isRequired}),i.shape({sizes:i.arrayOf(i.number).isRequired,thresholds:i.arrayOf(i.oneOfType([i.instanceOf(Date),i.number]).isRequired).isRequired,type:i.oneOf(["piecewise"]).isRequired}),i.shape({sizes:i.arrayOf(i.number).isRequired,type:i.oneOf(["ordinal"]).isRequired,unknownSize:i.number,values:i.arrayOf(i.oneOfType([i.instanceOf(Date),i.number,i.string]).isRequired)})]),valueGetter:i.func}))});export{y as ScatterChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import s from"../../../../../_virtual/index.mjs";import{ScatterAsyncBatch as
|
|
1
|
+
import*as e from"react";import s from"../../../../../_virtual/index.mjs";import{ScatterAsyncBatch as r}from"./ScatterAsyncBatch.mjs";import{useStore as t}from"../../internals/store/useStore.mjs";import{selectorScatterSeriesRenderData as o}from"./scatterRenderData.selectors.mjs";import{jsx as i}from"react/jsx-runtime";import{selectorProgressiveBatchSize as n,selectorProgressiveSeriesRevealedBatches as c}from"../../internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.mjs";import{selectorChartZoomIsInteracting as a}from"../../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs";function l(e,s,r){return s<=0?1:s*Math.max(1,Math.ceil(e/(r*s)))}function u(s){const{series:u,colorGetter:m,onItemClick:p,slots:f,slotProps:d,classes:g}=s,j=t(),h=j.use(n),R=j.use(c,u.id),x=j.use(a),C=j.use(o,u.id),P=C?.count??0,q=0===P?0:Math.ceil(P/Math.max(1,h)),v=x?Math.min(1,q):q,M=l(P,q,2e3),b=[];for(let e=0;e<v;e+=1)b.push(i(r,{series:u,colorGetter:m,onItemClick:p,slots:f,slotProps:d,start:x?0:e,step:x?M:q,classes:g,revealed:x||e<R,isInteracting:x},e));return i(e.Fragment,{children:b})}"production"!==process.env.NODE_ENV&&(u.propTypes={classes:s.object,color:s.string.isRequired,colorGetter:s.func.isRequired,onItemClick:s.func,series:s.object.isRequired,slotProps:s.object,slots:s.object,xScale:s.func.isRequired,yScale:s.func.isRequired});export{u as ScatterAsync,l as getInteractionStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{GestureManager as r}from"../../../../../x-internal-gestures/core/GestureManager.mjs";import{PanGesture as t}from"../../../../../x-internal-gestures/core/gestures/PanGesture.mjs";import{MoveGesture as n}from"../../../../../x-internal-gestures/core/gestures/MoveGesture.mjs";import{TapGesture as s}from"../../../../../x-internal-gestures/core/gestures/TapGesture.mjs";import{PressGesture as a}from"../../../../../x-internal-gestures/core/gestures/PressGesture.mjs";const u=e=>e.preventDefault(),o=({instance:o})=>{const{chartsLayerContainerRef:c}=o,i=e.useRef(null);e.useEffect(()=>{const e=c.current;i.current||(i.current=new r({gestures:[new t({name:"pan",threshold:0,maxPointers:1}),new n({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new s({name:"tap",preventIf:["zoomPinch","zoomPan"]}),new a({name:"quickPress",duration:50}),new t({name:"brush",threshold:0,maxPointers:1})]}));const u=i.current;if(e&&u)return u.registerElement(["pan","move","tap","quickPress","brush"],e),()=>{u.
|
|
1
|
+
import*as e from"react";import{GestureManager as r}from"../../../../../x-internal-gestures/core/GestureManager.mjs";import{PanGesture as t}from"../../../../../x-internal-gestures/core/gestures/PanGesture.mjs";import{MoveGesture as n}from"../../../../../x-internal-gestures/core/gestures/MoveGesture.mjs";import{TapGesture as s}from"../../../../../x-internal-gestures/core/gestures/TapGesture.mjs";import{PressGesture as a}from"../../../../../x-internal-gestures/core/gestures/PressGesture.mjs";const u=e=>e.preventDefault(),o=({instance:o})=>{const{chartsLayerContainerRef:c}=o,i=e.useRef(null);e.useEffect(()=>{const e=c.current;i.current||(i.current=new r({gestures:[new t({name:"pan",threshold:0,maxPointers:1}),new n({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new s({name:"tap",preventIf:["pan","zoomPinch","zoomPan"]}),new a({name:"quickPress",duration:50}),new t({name:"brush",threshold:0,maxPointers:1})]}));const u=i.current;if(e&&u)return u.registerElement(["pan","move","tap","quickPress","brush"],e),()=>{u.unregisterAllGestures(e)}},[c,i]);const m=e.useCallback((e,r,t)=>{const n=c.current;return n?.addEventListener(e,r,t),{cleanup:()=>n?.removeEventListener(e,r,t)}},[c]),g=e.useCallback((e,r)=>{const t=c.current,n=i.current;n&&t&&n.setGestureOptions(e,t,r??{})},[c,i]);e.useEffect(()=>{const e=c.current;return e?.addEventListener("gesturestart",u),e?.addEventListener("gesturechange",u),e?.addEventListener("gestureend",u),()=>{e?.removeEventListener("gesturestart",u),e?.removeEventListener("gesturechange",u),e?.removeEventListener("gestureend",u)}},[c]);return{instance:{addInteractionListener:m,updateZoomInteractionListeners:g,registerGestures:e.useCallback(e=>{const r=c.current,t=i.current;if(!t||!r)return()=>{};const n=e.map(e=>e.name);return t.addGestures(e),t.registerElement(n,r),()=>{t.removeGestures(n)}},[c,i])}}};o.params={},o.getInitialState=()=>({});export{o as useChartInteractionListener};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../../../../@babel/runtime/helpers/esm/extends.mjs";import*as t from"react";import{selectorChartSeriesProcessed as i}from"../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";import{defaultizeYAxis as s,defaultizeXAxis as a}from"./defaultizeAxis.mjs";import{selectorChartXAxis as r,selectorChartYAxis as n}from"./useChartCartesianAxisRendering.selectors.mjs";import{getAxisIndex as o}from"./getAxisValue.mjs";import{getChartPoint as l}from"../../../getChartPoint.mjs";import{selectorChartAxisInteraction as c}from"./useChartCartesianInteraction.selectors.mjs";import{checkHasInteractionPlugin as d}from"../useChartInteraction/checkHasInteractionPlugin.mjs";import{
|
|
1
|
+
import e from"../../../../../../@babel/runtime/helpers/esm/extends.mjs";import*as t from"react";import{selectorChartSeriesProcessed as i}from"../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";import{defaultizeYAxis as s,defaultizeXAxis as a}from"./defaultizeAxis.mjs";import{selectorChartXAxis as r,selectorChartYAxis as n}from"./useChartCartesianAxisRendering.selectors.mjs";import{getAxisIndex as o}from"./getAxisValue.mjs";import{getChartPoint as l}from"../../../getChartPoint.mjs";import{selectorChartAxisInteraction as c}from"./useChartCartesianInteraction.selectors.mjs";import{checkHasInteractionPlugin as d}from"../useChartInteraction/checkHasInteractionPlugin.mjs";import{warnOnce as x}from"../../../../../x-internals/warning/warning.mjs";import{selectorChartsInteractionIsInitialized as u}from"../useChartInteraction/useChartInteraction.selectors.mjs";import{useAssertModelConsistency as h}from"../../../../../x-internals/useAssertModelConsistency/useAssertModelConsistency.mjs";import m from"../../../../../utils/useEnhancedEffect/useEnhancedEffect.mjs";import{useStoreEffect as p}from"../../../../../x-internals/store/useStoreEffect.mjs";import{rainbowSurgePalette as f}from"../../../../colorPalettes/categorical/rainbowSurge.mjs";const g=new Set(["bar","rangeBar","line"]),A=({params:e,store:f,instance:A})=>{const{chartsLayerContainerRef:I}=A,{xAxis:C,yAxis:v,dataset:E,onHighlightedAxisChange:j,onTooltipAxisChange:P,axesGap:y}=e;if("production"!==process.env.NODE_ENV){const e=[...C??[],...v??[]].filter(e=>e.id).map(e=>e.id),t=new Set(e.filter((t,i)=>e.indexOf(t)!==i));t.size>0&&x([`MUI X Charts: The following axis ids are duplicated: ${Array.from(t).join(", ")}.`,"Please make sure that each axis has a unique id."].join("\n"),"error")}const G=f.use(i),L=f.use(u),{axis:b,axisIds:k}=f.use(r),{axis:w,axisIds:z}=f.use(n);h({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"highlightedAxis",controlled:e.highlightedAxis,defaultValue:void 0}),h({warningPrefix:"MUI X Charts",componentName:"Chart",propName:"tooltipAxis",controlled:e.tooltipAxis,defaultValue:void 0}),m(()=>{void 0!==e.highlightedAxis&&f.set("controlledCartesianAxisHighlight",e.highlightedAxis)},[f,e.highlightedAxis]),m(()=>{void 0!==e.tooltipAxis&&f.set("controlledCartesianAxisTooltip",e.tooltipAxis)},[f,e.tooltipAxis]);const S=t.useRef(!0);t.useEffect(()=>{S.current?S.current=!1:f.set("cartesianAxis",{axesGap:y,x:a(C,E,y),y:s(v,E,y)})},[C,v,E,y,f]);const N=k[0],V=z[0];p(f,c,(e,t)=>{if((j||P)&&!Object.is(e,t))return e.length!==t.length?(j?.(t),void P?.(t)):void(e?.some(({axisId:e,dataIndex:i},s)=>t[s].axisId!==e||t[s].dataIndex!==i)&&(j?.(t),P?.(t)))});const H=d(A);return t.useEffect(()=>{const t=I.current;if(!L||!H||!t||e.disableAxisListener)return()=>{};const i=A.addInteractionListener("moveEnd",e=>{e.detail.activeGestures.pan||A.cleanInteraction()}),s=A.addInteractionListener("panEnd",e=>{e.detail.activeGestures.move||A.cleanInteraction()}),a=A.addInteractionListener("quickPressEnd",e=>{e.detail.activeGestures.move||e.detail.activeGestures.pan||A.cleanInteraction()}),r=e=>{const i=e.detail.srcEvent,s=e.detail.target,a=l(t,i);e.detail.srcEvent.buttons>=1&&s?.hasPointerCapture(e.detail.srcEvent.pointerId)&&!s?.closest("[data-charts-zoom-slider]")&&s?.releasePointerCapture(e.detail.srcEvent.pointerId),A.isPointInside(a.x,a.y,s)?A.setPointerCoordinate(a):A.cleanInteraction?.()},n=A.addInteractionListener("move",r),o=A.addInteractionListener("pan",r),c=A.addInteractionListener("quickPress",r);return()=>{n.cleanup(),i.cleanup(),o.cleanup(),s.cleanup(),c.cleanup(),a.cleanup()}},[I,f,b,N,w,V,A,e.disableAxisListener,L,H]),t.useEffect(()=>{const t=I.current,i=e.onAxisClick;if(null===t||!i)return()=>{};const s=A.addInteractionListener("tap",e=>{let s=null,a=!1;const r=l(t,e.detail.srcEvent),n=o(b[N],r.x);a=-1!==n,s=a?n:o(w[V],r.y);const c=a?k[0]:z[0];if(null==s||-1===s)return;const d=(a?b:w)[c].data[s],x={};Object.keys(G).filter(e=>g.has(e)).forEach(e=>{const t=G[e];t?.seriesOrder.forEach(e=>{const i=t.series[e],r=i.xAxisId,n=i.yAxisId,o=a?r:n;void 0!==o&&o!==c||(x[e]=i.data[s])})}),i(e.detail.srcEvent,{dataIndex:s,axisValue:d,seriesValues:x})});return()=>{s.cleanup()}},[e.onAxisClick,G,I,b,k,w,z,N,V,A]),{}};A.params={xAxis:!0,yAxis:!0,dataset:!0,onAxisClick:!0,disableAxisListener:!0,onHighlightedAxisChange:!0,highlightedAxis:!0,onTooltipAxisChange:!0,tooltipAxis:!0,axesGap:!0},A.getDefaultizedParams=({params:t})=>e({},t,{axesGap:t.axesGap??0,colors:t.colors??f,theme:t.theme??"light",defaultizedXAxis:a(t.xAxis,t.dataset,t.axesGap??0),defaultizedYAxis:s(t.yAxis,t.dataset,t.axesGap??0)}),A.getInitialState=t=>e({cartesianAxis:{axesGap:t.axesGap,x:t.defaultizedXAxis,y:t.defaultizedYAxis}},void 0===t.highlightedAxis?{}:{controlledCartesianAxisHighlight:t.highlightedAxis});export{A as useChartCartesianAxis};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../../../../@babel/runtime/helpers/esm/extends.mjs";import*as t from"react";import{getChartPoint as i}from"../../../getChartPoint.mjs";import{selectorChartSeriesProcessed as s}from"../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";import{findClosestPoints as a}from"./findClosestPoints.mjs";import{selectorChartXAxis as
|
|
1
|
+
import e from"../../../../../../@babel/runtime/helpers/esm/extends.mjs";import*as t from"react";import{getChartPoint as i}from"../../../getChartPoint.mjs";import{selectorChartSeriesProcessed as s}from"../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";import{findClosestPoints as a}from"./findClosestPoints.mjs";import{selectorChartXAxis as n,selectorChartYAxis as r,selectorChartZoomIsInteracting as o,selectorChartSeriesEmptyFlatbushMap as d,selectorChartSeriesFlatbushMap as c,selectorChartAxisZoomData as l}from"../useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs";import u from"../../../../../utils/useEnhancedEffect/useEnhancedEffect.mjs";import m from"../../../../../utils/useEventCallback/useEventCallback.mjs";function I(e,t){if(void 0===t)return!0;if(e.edgeDistance<=0){if(t.edgeDistance>0)return!0;return e.edgeDistance+e.radius<t.edgeDistance+t.radius}return!(t.edgeDistance<=0)&&e.edgeDistance<t.edgeDistance}const p=({params:e,store:p,instance:f})=>{const{chartsLayerContainerRef:h}=f,{disableHitArea:v,hitAreaRadius:g,onItemClick:x}=e,b=v,E=g,{axis:y,axisIds:C}=p.use(n),{axis:A,axisIds:H}=p.use(r),D=p.use(o),{series:L,seriesOrder:j}=p.use(s)?.scatter??{},P=p.use(D?d:c),T=C[0],k=H[0];u(()=>{p.set("voronoi",{isVoronoiEnabled:!b})},[p,b]),t.useEffect(()=>{if(null===h.current||b)return;const e=h.current;function t(t){const s=i(e,t);if(!f.isPointInside(s.x,s.y))return"outside-chart";let n;for(const e of j??[]){const t=(L??{})[e],i=P.get(e);if(!i||t.hidden)continue;const{flatbush:r,getItemRadius:o,maxItemRadius:d}=i,c=t.xAxisId??T,u=t.yAxisId??k,m=l(p.state,c),f=l(p.state,u),h="item"===E?d:E,v=(m?.start??0)/100,g=(m?.end??100)/100,x=(f?.start??0)/100,b=(f?.end??100)/100,C=y[c].scale,H=A[u].scale,D=a(r,t.data,C,H,v,g,x,b,s.x,s.y,h,1,o)[0];if(void 0===D)continue;const j=t.data[D],R=C(j.x),V=H(j.y),G=Math.hypot(R-s.x,V-s.y),S="number"==typeof o?o:o(D),q=G-S;if("item"===E&&q>0)continue;const z={dataIndex:D,seriesId:e,edgeDistance:q,radius:S};I(z,n)&&(n=z)}return void 0===n?"no-point-found":{seriesId:n.seriesId,dataIndex:n.dataIndex}}const s=f.addInteractionListener("moveEnd",e=>{e.detail.activeGestures.pan||(f.cleanInteraction?.(),f.clearHighlight?.(),f.removeTooltipItem?.())}),n=f.addInteractionListener("panEnd",e=>{e.detail.activeGestures.move||(f.cleanInteraction?.(),f.clearHighlight?.(),f.removeTooltipItem?.())}),r=f.addInteractionListener("quickPressEnd",e=>{e.detail.activeGestures.move||e.detail.activeGestures.pan||(f.cleanInteraction?.(),f.clearHighlight?.(),f.removeTooltipItem?.())}),o=e=>{const i=t(e.detail.srcEvent);if("outside-chart"===i)return f.cleanInteraction?.(),f.clearHighlight?.(),void f.removeTooltipItem?.();if("outside-voronoi-max-radius"===i||"no-point-found"===i)return f.removeTooltipItem?.(),f.clearHighlight?.(),void f.removeTooltipItem?.();const{seriesId:s,dataIndex:a}=i;f.setTooltipItem?.({type:"scatter",seriesId:s,dataIndex:a}),f.setLastUpdateSource?.("pointer"),f.setHighlight?.({type:"scatter",seriesId:s,dataIndex:a})},d=f.addInteractionListener("tap",e=>{const i=t(e.detail.srcEvent);if("string"!=typeof i&&x){const{seriesId:t,dataIndex:s}=i;x(e.detail.srcEvent,{type:"scatter",seriesId:t,dataIndex:s})}}),c=f.addInteractionListener("move",o),u=f.addInteractionListener("pan",o),m=f.addInteractionListener("quickPress",o);return()=>{d.cleanup(),c.cleanup(),s.cleanup(),u.cleanup(),n.cleanup(),m.cleanup(),r.cleanup()}},[h,A,y,E,x,b,f,j,L,P,T,k,p]);return{instance:{enableVoronoi:m(()=>{p.set("voronoi",{isVoronoiEnabled:!0})}),disableVoronoi:m(()=>{p.set("voronoi",{isVoronoiEnabled:!1})})}}};p.getDefaultizedParams=({params:t})=>e({},t,{disableHitArea:t.disableHitArea??!t.series.some(e=>"scatter"===e.type)}),p.getInitialState=e=>({voronoi:{isVoronoiEnabled:!e.disableHitArea}}),p.params={disableHitArea:!0,hitAreaRadius:!0,onItemClick:!0};export{p as useChartClosestPoint};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../../../../@babel/runtime/helpers/esm/extends.mjs";import*as t from"react";import{selectorChartDefaultizedSeries as a}from"../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";import
|
|
1
|
+
import e from"../../../../../../@babel/runtime/helpers/esm/extends.mjs";import*as t from"react";import{selectorChartDefaultizedSeries as a}from"../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";import i from"../../../../../utils/useEnhancedEffect/useEnhancedEffect.mjs";import{selectorChartSeriesConfig as o}from"../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.selectors.mjs";const s=({params:s,store:n,instance:r})=>{const{chartsLayerContainerRef:d}=r;return t.useEffect(()=>{const t=d.current;if(t&&!s.disableKeyboardNavigation)return t.addEventListener("keydown",c),t.addEventListener("focusout",i),t.addEventListener("focusin",r),()=>{t.removeEventListener("keydown",c),t.removeEventListener("focusout",i),t.removeEventListener("focusin",r)};function i(t){const a=t.currentTarget,i=t.relatedTarget;a&&i instanceof Node&&!a.contains(i)&&n.state.keyboardNavigation.isFocused&&n.set("keyboardNavigation",e({},n.state.keyboardNavigation,{isFocused:!1}))}function r(){n.state.keyboardNavigation.isFocused||n.update(e({},n.state.highlight&&{highlight:e({},n.state.highlight,{lastUpdate:"keyboard"})},n.state.interaction&&{interaction:e({},n.state.interaction,{lastUpdate:"keyboard"})},{keyboardNavigation:e({},n.state.keyboardNavigation,{isFocused:!0})}))}function c(t){let i=n.state.keyboardNavigation.item;const s=o(n.state);let r=i?.type;if(!r&&(r=Object.keys(a(n.state)).find(e=>void 0!==s[e]),void 0===r))return;const d=s[r]?.keyboardFocusHandler?.(t);d&&(i=d(i,n.state),i!==n.state.keyboardNavigation.item&&(t.preventDefault(),n.update(e({},n.state.highlight&&{highlight:e({},n.state.highlight,{lastUpdate:"keyboard"})},n.state.interaction&&{interaction:e({},n.state.interaction,{lastUpdate:"keyboard"})},{keyboardNavigation:e({},n.state.keyboardNavigation,{item:i})}))))}},[d,s.disableKeyboardNavigation,n]),i(()=>{n.set("keyboardNavigation",e({},n.state.keyboardNavigation,{enabled:!s.disableKeyboardNavigation}))},[n,s.disableKeyboardNavigation]),{}};s.getInitialState=e=>({keyboardNavigation:{item:null,isFocused:!1,enabled:!e.disableKeyboardNavigation}}),s.params={disableKeyboardNavigation:!0};export{s as useChartKeyboardNavigation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{selectorChartXAxis as e,selectorChartYAxis as i}from"../useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs";import{createSelector as
|
|
1
|
+
import{selectorChartXAxis as e,selectorChartYAxis as i}from"../useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs";import{createSelector as s,createSelectorMemoized as t}from"../../../../../x-internals/store/createSelector.mjs";import{selectorChartSeriesProcessed as r}from"../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";import{fastObjectShallowCompare as n}from"../../../../../x-internals/fastObjectShallowCompare/fastObjectShallowCompare.mjs";const o=e=>e.keyboardNavigation,a=s(o,(e,i)=>!0===e?.isFocused&&null!=e?.item&&n(e.item,i)),l=s(o,e=>!0===e?.isFocused&&null!=e?.item),d=s(o,e=>!0===e?.isFocused?e?.item??null:null),u=s(o,e=>e?.item??null),m=s(o,e=>!!e?.enabled),x=e=>(i,s,t)=>{if(null==i||!("dataIndex"in i)||void 0===i.dataIndex)return;const r=t[i.type]?.series[i.seriesId];if(!r)return;let n="x"===e?"xAxisId"in r&&r.xAxisId:"yAxisId"in r&&r.yAxisId;return void 0!==n&&!1!==n||(n=s.axisIds[0]),{axisId:n,dataIndex:i.dataIndex}},c=s(d,e,r,x("x")),I=s(d,i,r,x("y")),f=t(o,function(e){if(!0!==e?.isFocused||null==e?.item)return null;const{type:i,seriesId:s}=e.item;return void 0===i||void 0===s?null:e.item});export{d as selectorChartsFocusedItem,u as selectorChartsFocusedOrToFocusedItem,l as selectorChartsHasFocusedItem,m as selectorChartsIsKeyboardNavigationEnabled,a as selectorChartsItemIsFocused,f as selectorChartsKeyboardItem,c as selectorChartsKeyboardXAxisIndex,I as selectorChartsKeyboardYAxisIndex};
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
Small component library for personal use.
|
|
2
|
-
|
|
3
|
-
<!-- test change -->
|
|
4
|
-
|
|
5
|
-
## Favicon usage
|
|
6
|
-
|
|
7
|
-
This package exports the favicon assets and a small helper to make adding
|
|
8
|
-
favicon links in consuming apps trivial.
|
|
9
|
-
|
|
10
|
-
Files available in package:
|
|
11
|
-
|
|
12
|
-
- `nexus-logo-favicon.svg` — modern SVG favicon
|
|
13
|
-
- `favicon.ico` — multi-size ICO (legacy support)
|
|
14
|
-
|
|
15
|
-
Quick copy approach (recommended):
|
|
16
|
-
|
|
17
|
-
1. Add and then run these asset copy scripts in the consuming project's package.json:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
"scripts": {
|
|
21
|
-
"copy-sage-assets": "cpx \"node_modules/it-data-nexus-ui-library/dist/assets/images/*\" public/assets/it-data-nexus-ui-library/",
|
|
22
|
-
"postinstall": "npm run copy-sage-assets"
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
2. Add links in your HTML head:
|
|
27
|
-
|
|
28
|
-
```html
|
|
29
|
-
<link
|
|
30
|
-
rel="icon"
|
|
31
|
-
type="image/svg+xml"
|
|
32
|
-
href="/assets/it-data-nexus-ui-library/nexus-logo-favicon.svg"
|
|
33
|
-
/>
|
|
34
|
-
<link rel="icon" href="/assets/it-data-nexus-ui-library/favicon.ico" />
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Or, use the React helper exported by this package:
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
import { FaviconLinks } from "it-data-nexus-ui-library";
|
|
41
|
-
|
|
42
|
-
function AppHead() {
|
|
43
|
-
return <FaviconLinks />; // adds versioned SVG and ICO links
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Next.js example
|
|
48
|
-
|
|
49
|
-
If you use Next.js (Pages or App router), you can copy the built assets into your `public/` folder and render the helper component from the app head so the favicon is present on first render.
|
|
50
|
-
|
|
51
|
-
1. Copy assets during install/build (example `package.json` scripts in the consuming app):
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
"scripts": {
|
|
55
|
-
"copy-sage-assets": "cpx \"node_modules/it-data-nexus-ui-library/dist/assets/images/*\" public/assets/it-data-nexus-ui-library/",
|
|
56
|
-
"postinstall": "npm run copy-sage-assets"
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
2. Pages router (`pages/_document.tsx`) example — server-side rendered so the links are available immediately:
|
|
61
|
-
|
|
62
|
-
```tsx
|
|
63
|
-
// pages/_document.tsx
|
|
64
|
-
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
65
|
-
import { FaviconLinks } from "it-data-nexus-ui-library";
|
|
66
|
-
|
|
67
|
-
class MyDocument extends Document {
|
|
68
|
-
render() {
|
|
69
|
-
return (
|
|
70
|
-
<Html>
|
|
71
|
-
<Head>
|
|
72
|
-
<FaviconLinks />
|
|
73
|
-
</Head>
|
|
74
|
-
<body>
|
|
75
|
-
<Main />
|
|
76
|
-
<NextScript />
|
|
77
|
-
</body>
|
|
78
|
-
</Html>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export default MyDocument;
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
3. App router (`app/layout.tsx`) example:
|
|
87
|
-
|
|
88
|
-
```tsx
|
|
89
|
-
// app/layout.tsx
|
|
90
|
-
import { FaviconLinks } from "it-data-nexus-ui-library";
|
|
91
|
-
|
|
92
|
-
export default function RootLayout({
|
|
93
|
-
children,
|
|
94
|
-
}: {
|
|
95
|
-
children: React.ReactNode;
|
|
96
|
-
}) {
|
|
97
|
-
return (
|
|
98
|
-
<html>
|
|
99
|
-
<head>
|
|
100
|
-
<FaviconLinks />
|
|
101
|
-
</head>
|
|
102
|
-
<body>{children}</body>
|
|
103
|
-
</html>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Notes:
|
|
109
|
-
|
|
110
|
-
- Copying assets into `public/` ensures the files are served as static assets (no runtime JS required) and avoids a flash-of-default-favicon.
|
|
111
|
-
- The `FaviconLinks` helper uses versioned URLs by default to help cache-busting when you publish a new library version.
|
|
1
|
+
Small component library for personal use.
|
|
2
|
+
|
|
3
|
+
<!-- test change -->
|
|
4
|
+
|
|
5
|
+
## Favicon usage
|
|
6
|
+
|
|
7
|
+
This package exports the favicon assets and a small helper to make adding
|
|
8
|
+
favicon links in consuming apps trivial.
|
|
9
|
+
|
|
10
|
+
Files available in package:
|
|
11
|
+
|
|
12
|
+
- `nexus-logo-favicon.svg` — modern SVG favicon
|
|
13
|
+
- `favicon.ico` — multi-size ICO (legacy support)
|
|
14
|
+
|
|
15
|
+
Quick copy approach (recommended):
|
|
16
|
+
|
|
17
|
+
1. Add and then run these asset copy scripts in the consuming project's package.json:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
"scripts": {
|
|
21
|
+
"copy-sage-assets": "cpx \"node_modules/it-data-nexus-ui-library/dist/assets/images/*\" public/assets/it-data-nexus-ui-library/",
|
|
22
|
+
"postinstall": "npm run copy-sage-assets"
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. Add links in your HTML head:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<link
|
|
30
|
+
rel="icon"
|
|
31
|
+
type="image/svg+xml"
|
|
32
|
+
href="/assets/it-data-nexus-ui-library/nexus-logo-favicon.svg"
|
|
33
|
+
/>
|
|
34
|
+
<link rel="icon" href="/assets/it-data-nexus-ui-library/favicon.ico" />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or, use the React helper exported by this package:
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { FaviconLinks } from "it-data-nexus-ui-library";
|
|
41
|
+
|
|
42
|
+
function AppHead() {
|
|
43
|
+
return <FaviconLinks />; // adds versioned SVG and ICO links
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Next.js example
|
|
48
|
+
|
|
49
|
+
If you use Next.js (Pages or App router), you can copy the built assets into your `public/` folder and render the helper component from the app head so the favicon is present on first render.
|
|
50
|
+
|
|
51
|
+
1. Copy assets during install/build (example `package.json` scripts in the consuming app):
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
"scripts": {
|
|
55
|
+
"copy-sage-assets": "cpx \"node_modules/it-data-nexus-ui-library/dist/assets/images/*\" public/assets/it-data-nexus-ui-library/",
|
|
56
|
+
"postinstall": "npm run copy-sage-assets"
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. Pages router (`pages/_document.tsx`) example — server-side rendered so the links are available immediately:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
// pages/_document.tsx
|
|
64
|
+
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
65
|
+
import { FaviconLinks } from "it-data-nexus-ui-library";
|
|
66
|
+
|
|
67
|
+
class MyDocument extends Document {
|
|
68
|
+
render() {
|
|
69
|
+
return (
|
|
70
|
+
<Html>
|
|
71
|
+
<Head>
|
|
72
|
+
<FaviconLinks />
|
|
73
|
+
</Head>
|
|
74
|
+
<body>
|
|
75
|
+
<Main />
|
|
76
|
+
<NextScript />
|
|
77
|
+
</body>
|
|
78
|
+
</Html>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default MyDocument;
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
3. App router (`app/layout.tsx`) example:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
// app/layout.tsx
|
|
90
|
+
import { FaviconLinks } from "it-data-nexus-ui-library";
|
|
91
|
+
|
|
92
|
+
export default function RootLayout({
|
|
93
|
+
children,
|
|
94
|
+
}: {
|
|
95
|
+
children: React.ReactNode;
|
|
96
|
+
}) {
|
|
97
|
+
return (
|
|
98
|
+
<html>
|
|
99
|
+
<head>
|
|
100
|
+
<FaviconLinks />
|
|
101
|
+
</head>
|
|
102
|
+
<body>{children}</body>
|
|
103
|
+
</html>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Notes:
|
|
109
|
+
|
|
110
|
+
- Copying assets into `public/` ensures the files are served as static assets (no runtime JS required) and avoids a flash-of-default-favicon.
|
|
111
|
+
- The `FaviconLinks` helper uses versioned URLs by default to help cache-busting when you publish a new library version.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{Slider as m}from"@mui/material";const t=t=>r(m,{...t});export{t as Slider};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=new Set(["bar","rangeBar","line"]);function s({axisId:s,dataIndex:a,isXAxis:r,axes:i,processedSeries:t}){const n=i[s]?.data?.[a];if(void 0===n)return null;const d={};return Object.keys(t).filter(s=>e.has(s)).forEach(e=>{const i=t[e];i?.seriesOrder.forEach(e=>{const t=i.series[e],n=t.xAxisId,o=t.yAxisId,c=r?n:o;void 0!==c&&c!==s||(d[e]=t.data[a])})}),{dataIndex:a,axisValue:n,seriesValues:d}}export{s as getAxisClickPayload};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return"Enter"===e.key||" "===e.key}function n(e,n){return void 0!==e.type&&e.type!==n.type?null:void 0===e.seriesId||"seriesId"in n&&e.seriesId===n.seriesId?(void 0===e.type?0:1)+(void 0===e.seriesId?0:1):null}function t(e,t){let i=null,o=-1,r=-1;for(const s of e){const e=n(s.scope,t),c=s.scope.priority??0;null!==e&&(void 0===s.scope.canActivate||s.scope.canActivate(t))&&(e>o||e===o&&c>r)&&(i=s.handler,o=e,r=c)}return i}export{t as findItemActivationHandler,e as isItemActivationKey};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"react";import{useChartsContext as e}from"../context/ChartsProvider/useChartsContext.mjs";import r from"../../utils/useEventCallback/useEventCallback.mjs";function i(i,o){const{instance:s}=e(),{type:a,seriesId:n,priority:c,canActivate:m}=i,v=void 0!==o,p=r((t,e)=>o?.(t,e)),d=void 0!==m,f=r(t=>!m||m(t)),u=s.registerItemActivationHandler;t.useEffect(()=>{if(v&&u)return u({type:a,seriesId:n,priority:c,canActivate:d?f:void 0},p)},[u,v,a,n,c,d,f,p])}export{i as useRegisterItemActivation};
|