@mx-cartographer/experiences 9.4.20 → 9.4.22
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/CHANGELOG.md +11 -1
- package/dist/common/components/dialog/Dialog.es.js +31 -31
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/core/utils/InvestmentUtil.d.ts +9 -0
- package/dist/core/utils/InvestmentUtil.es.js +68 -50
- package/dist/core/utils/InvestmentUtil.es.js.map +1 -1
- package/dist/investments/components/HoldingDrawer.d.ts +3 -0
- package/dist/investments/components/HoldingDrawer.es.js +33 -29
- package/dist/investments/components/HoldingDrawer.es.js.map +1 -1
- package/dist/investments/components/HoldingTable.d.ts +3 -0
- package/dist/investments/components/HoldingTable.es.js +37 -33
- package/dist/investments/components/HoldingTable.es.js.map +1 -1
- package/dist/investments/components/Overview.es.js +163 -134
- package/dist/investments/components/Overview.es.js.map +1 -1
- package/dist/investments/components/allocation/InvestmentsAllocationChart.d.ts +1 -0
- package/dist/investments/components/allocation/InvestmentsAllocationChart.es.js +16 -16
- package/dist/investments/components/allocation/InvestmentsAllocationChart.es.js.map +1 -1
- package/dist/investments/components/allocation/util/createInvestementsAllocationData.d.ts +1 -0
- package/dist/investments/components/allocation/util/createInvestementsAllocationData.es.js +58 -54
- package/dist/investments/components/allocation/util/createInvestementsAllocationData.es.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overview.es.js","names":[],"sources":["../../../src/investments/components/Overview.tsx"],"sourcesContent":["import React, { useState } from 'react'\n\nimport { observer } from 'mobx-react-lite'\nimport Accordion from '@mui/material/Accordion'\nimport AccordionDetails from '@mui/material/AccordionDetails'\nimport AccordionSummary from '@mui/material/AccordionSummary'\nimport Paper from '@mui/material/Paper'\nimport Stack from '@mui/system/Stack'\nimport { useTheme } from '@mui/material/styles'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, P, Text } from '@mxenabled/mxui'\n\nimport ConnectionsDrawer from '../../accounts/components/ConnectionsDrawer'\nimport {\n Loader,\n useAccountStore,\n useGlobalCopyStore,\n useGlobalUiStore,\n useHoldingStore,\n useScreenSize,\n} from '../../common'\nimport { EmptyStateFooterComponent } from './EmptyStateFooterComponent'\nimport InvestmentDetailsDrawer from './HoldingDrawer'\nimport HoldingsTable from './HoldingTable'\n\ninterface HoldingDetail {\n id: string\n description: string\n qty: number\n holding: string\n costBasis: number\n totalGainLoss: number\n marketValue: number\n}\n\nconst Overview = () => {\n const { isMobile } = useScreenSize()\n const [expandedStates, setExpandedStates] = useState<Record<string, boolean>>({})\n const [openDrawer, setOpenDrawer] = useState(false)\n const { selectedAccountGuids } = useGlobalUiStore()\n const { visibleHoldings: holdings, updateHoldings } = useHoldingStore()\n const [showConnectionsWidget, setShowConnectionsWidget] = React.useState(false)\n\n const [accountHoldingsData, setAccountHoldingsData] = useState<{\n accounts: any\n holdings: HoldingDetail[]\n }>({\n accounts: [],\n holdings: [],\n })\n const { accounts: accountsCopy, investments: copy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const [editingHoldingId, setEditingHoldingId] = useState<string | null>(null)\n const [currentEditedCostBasis, setCurrentEditedCostBasis] = useState<string>('')\n\n const theme = useTheme()\n\n const isDarkMode = theme.palette.mode === 'dark'\n\n const gainDisplayColor = isDarkMode ? '#0AC295' : '#09A57F'\n\n const lossDisplayColor = isDarkMode ? 'grey.300' : 'grey.700'\n\n const gainLossDisplayColor = (value: number, type: string = 'lesserThan') => {\n if (type === 'greaterThan') {\n return value >= 0 ? gainDisplayColor : lossDisplayColor\n }\n return value <= 0 ? lossDisplayColor : gainDisplayColor\n }\n\n const handleCostBasisClick = (holdingId: string, currentCostBasis: number) => {\n setEditingHoldingId(holdingId)\n setCurrentEditedCostBasis(currentCostBasis.toFixed(2))\n }\n\n const handleCostBasisChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n // Allow only numbers and a single decimal point\n const value = event.target.value\n if (/^\\d*\\.?\\d*$/.test(value)) {\n setCurrentEditedCostBasis(value)\n }\n }\n\n const handleCostBasisKeyDown = (event: React.KeyboardEvent<HTMLInputElement>, id: string) => {\n if (event.key === 'Enter') {\n handleCostBasisBlur(id)\n } else if (event.key === 'Escape') {\n setEditingHoldingId(null)\n }\n }\n\n const handleCostBasisBlur = (id: string) => {\n const holding = holdings.find(({ guid }) => guid === id)\n if (!holding) return\n\n const updatedCostBasis = Number(currentEditedCostBasis)\n updateHoldings({ ...holding, cost_basis: updatedCostBasis })\n\n if (isMobile) {\n const updatedHoldings = accountHoldingsData.holdings.map((h) =>\n h.id === id ? { ...h, costBasis: updatedCostBasis } : h,\n )\n\n setAccountHoldingsData((prev) => ({\n ...prev,\n holdings: updatedHoldings,\n }))\n }\n\n setEditingHoldingId(null)\n }\n\n const handleAccordionChange =\n (accountId: string) => (_event: React.SyntheticEvent, isExpanded: boolean) => {\n setExpandedStates((prevStates) => ({\n ...prevStates,\n [accountId]: isExpanded,\n }))\n }\n\n const { visibleHoldings: allHoldings } = useHoldingStore()\n const { visibleInvestmentAccounts } = useAccountStore()\n\n const accounts = visibleInvestmentAccounts.filter(({ guid }) =>\n selectedAccountGuids.includes(guid),\n )\n\n const totalPortfolioValue = accounts.reduce((sum, account) => sum + (account.balance || 0), 0)\n\n const accountGuids = accounts.map(({ guid }) => guid)\n\n const updatedHoldings = allHoldings.filter(({ account_guid }) =>\n accountGuids.includes(account_guid),\n )\n\n const gainLoss = updatedHoldings.reduce((sum, holding) => {\n const hl = holding.market_value ? holding.market_value - (holding.cost_basis || 0) : 0\n return sum + hl\n }, 0)\n\n const closeDrawer = () => {\n setOpenDrawer(false)\n }\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n return (\n <Stack sx={{ alignItems: 'center', gap: 48, pt: 48, width: '100%' }}>\n {/* header content */}\n {!!accounts.length && (\n <Stack sx={{ alignItems: 'center' }}>\n <Text sx={{ color: 'text.secondary' }}>{copy.overview.total_portfolio}</Text>\n <P variant=\"h1\">\n {totalPortfolioValue.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </P>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n <Icon\n name={gainLoss >= 0 ? 'trending_up' : 'trending_down'}\n size={20}\n sx={{ color: gainLossDisplayColor(gainLoss, 'greaterThan') }}\n />\n <Text\n sx={{ color: gainLossDisplayColor(gainLoss, 'greaterThan'), fontWeight: 700 }}\n variant=\"body2\"\n >\n {gainLoss.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </Stack>\n </Stack>\n )}\n\n {accounts.map((account) => {\n const accountHoldings: HoldingDetail[] = allHoldings\n .filter((holding) => holding.account_guid === account.guid)\n .map((holding) => ({\n id: holding.guid,\n qty: holding.shares || 0,\n holding: holding.symbol || holding.description || 'Unknown',\n costBasis: holding.cost_basis || 0,\n totalGainLoss: holding.market_value\n ? holding.market_value - (holding.cost_basis || 0)\n : 0,\n marketValue: holding.market_value || 0,\n description: holding.description || '',\n }))\n\n const hasHoldingsData = accountHoldings.length > 0\n\n const accountTotalValue = account.balance\n const accountGainLoss = accountHoldings.reduce(\n (sum, holding) => holding.totalGainLoss + sum,\n 0,\n )\n\n const accountGainLossPercentage = accountTotalValue\n ? (accountGainLoss / accountTotalValue) * 100\n : 0\n\n // Mobile View: Use a simplified presentation\n if (isMobile) {\n return (\n <Paper\n key={account.guid}\n onClick={\n accountHoldings.length\n ? () => {\n setOpenDrawer(true)\n setAccountHoldingsData({\n holdings: accountHoldings,\n accounts: account,\n })\n }\n : undefined\n }\n sx={{\n width: '100%',\n overflow: 'hidden',\n }}\n >\n <Stack\n sx={{\n border: 1,\n borderColor: 'divider',\n borderRadius: '8px',\n ml: 16,\n mr: 16,\n overflow: 'hidden',\n pt: 14,\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n borderBottom: 1,\n borderColor: 'divider',\n flexDirection: 'row',\n pb: 14,\n pl: 14,\n pr: 14,\n }}\n >\n <InstitutionLogo\n alt={account.institutionName || ''}\n institutionGuid={account.institution_guid || ''}\n size={32}\n />\n <Stack sx={{ overflow: 'hidden', pl: 13, pr: 13 }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {account.memberName}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {account.user_name || account.name}\n </Text>\n </Stack>\n </Stack>\n\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 8,\n pt: 8,\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n borderRight: 1,\n borderColor: 'divider',\n flex: 1,\n justifyContent: 'center',\n pb: 14,\n pl: 7,\n pr: 7,\n pt: 14,\n }}\n >\n <Text sx={{ color: 'text.secondary', fontSize: 11 }} variant=\"body2\">\n {copy.overview.total_gain_Loss}\n </Text>\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 2,\n justifyContent: 'flex-end',\n }}\n >\n {accountGainLoss !== 0 && (\n <Icon\n name={accountGainLoss > 0 ? 'trending_up' : 'trending_down'}\n size={20}\n sx={{ color: gainLossDisplayColor(accountGainLoss) }}\n />\n )}\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {accountGainLossPercentage.toFixed(2)}%\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n |\n </Text>\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {Math.abs(accountGainLoss).toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </Stack>\n </Stack>\n\n <Stack\n sx={{\n alignItems: 'center',\n flex: 1,\n justifyContent: 'center',\n pb: 14,\n pl: 7,\n pr: 7,\n pt: 14,\n }}\n >\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.overview.total_value}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {accountTotalValue?.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n </Paper>\n )\n }\n\n const disabledColor = isDarkMode ? 'grey.700' : 'grey.400'\n const logoColor = accountHoldings.length ? 'text.primary' : disabledColor\n\n return (\n <Accordion\n expanded={expandedStates[account.guid] === true}\n key={account.guid}\n onChange={hasHoldingsData ? handleAccordionChange(account.guid) : () => {}}\n sx={{\n border: 1,\n borderColor: 'divider',\n borderRadius: '4px',\n width: '100%',\n }}\n >\n <AccordionSummary\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n sx={[\n expandedStates[account.guid] && {\n borderBottom: 1,\n borderColor: 'divider',\n maxHeight: 88,\n },\n ]}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 13,\n p: 14,\n width: '100%',\n }}\n >\n <Icon name={'expand_more'} size={20} sx={{ color: logoColor }} />\n <InstitutionLogo\n alt={account.institutionName || ''}\n institutionGuid={account.institution_guid || ''}\n size={32}\n />\n\n <Stack sx={{ alignItems: 'flex-start' }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {account.memberName}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {account.user_name || account.name}\n </Text>\n </Stack>\n </Stack>\n\n <Stack sx={{ flexDirection: 'row' }}>\n <Stack sx={{ alignItems: 'flex-end', pb: 14, pl: 24, pr: 24, pt: 14 }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.overview.total_gain_Loss}\n </Text>\n\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 2,\n justifyContent: 'flex-end',\n }}\n >\n {accountGainLoss !== 0 && (\n <Icon\n name={accountGainLoss >= 0 ? 'trending_up' : 'trending_down'}\n size={20}\n sx={{ color: gainLossDisplayColor(accountGainLoss) }}\n />\n )}\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {accountGainLossPercentage.toFixed(2)}%\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n |\n </Text>\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {Math.abs(accountGainLoss).toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </Stack>\n </Stack>\n\n <Stack sx={{ alignItems: 'flex-end', gap: 12, pb: 14, pl: 16, pr: 16, pt: 14 }}>\n <Stack sx={{ alignItems: 'flex-end' }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.overview.total_value}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {accountTotalValue?.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n </AccordionSummary>\n <AccordionDetails sx={{ bgcolor: 'background.default', p: 12 }}>\n <Paper sx={{ border: 1, borderColor: 'neutral.light' }}>\n <HoldingsTable\n currentEditedCostBasis={currentEditedCostBasis}\n data={accountHoldings}\n editingHoldingId={editingHoldingId}\n handleCostBasisBlur={handleCostBasisBlur}\n handleCostBasisChange={handleCostBasisChange}\n handleCostBasisClick={handleCostBasisClick}\n handleCostBasisKeyDown={handleCostBasisKeyDown}\n />\n </Paper>\n </AccordionDetails>\n </Accordion>\n )\n })}\n\n {/* footer content */}\n <EmptyStateFooterComponent />\n\n {/* Drawer Component */}\n <InvestmentDetailsDrawer\n accountHoldingsData={accountHoldingsData}\n currentEditedCostBasis={currentEditedCostBasis}\n editingHoldingId={editingHoldingId}\n handleCostBasisBlur={handleCostBasisBlur}\n handleCostBasisChange={handleCostBasisChange}\n handleCostBasisClick={handleCostBasisClick}\n handleCostBasisKeyDown={handleCostBasisKeyDown}\n isOpen={openDrawer}\n onClose={closeDrawer}\n />\n\n <ConnectionsDrawer\n onClose={() => setShowConnectionsWidget(false)}\n showConnectionsWidget={showConnectionsWidget}\n title={accountsCopy.manage_connections}\n />\n </Stack>\n )\n}\n\nexport default observer(Overview)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,IAAM,KAAA,MAAiB;AACrB,QAAM,EAAE,UAAA,EAAA,IAAa,GAAc,GAC7B,CAAC,GAAgB,CAAA,IAAqB,EAAkC,CAAC,CAAC,GAC1E,CAAC,GAAY,CAAA,IAAiB,EAAS,EAAK,GAC5C,EAAE,sBAAA,EAAA,IAAyB,EAAiB,GAC5C,EAAE,iBAAiB,GAAU,gBAAA,EAAA,IAAmB,EAAgB,GAChE,CAAC,GAAuB,CAAA,IAA4B,GAAM,SAAS,EAAK,GAExE,CAAC,GAAqB,CAAA,IAA0B,EAGnD;AAAA,IACD,UAAU,CAAC;AAAA,IACX,UAAU,CAAC;AAAA,EACb,CAAC,GACK,EAAE,UAAU,GAAc,aAAa,EAAA,IAAS,GAAmB,GACnE,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,CAAC,GAAkB,CAAA,IAAuB,EAAwB,IAAI,GACtE,CAAC,GAAwB,CAAA,IAA6B,EAAiB,EAAE,GAIzE,IAFQ,GAEK,EAAM,QAAQ,SAAS,QAEpC,IAAmB,IAAa,YAAY,WAE5C,IAAmB,IAAa,aAAa,YAE7C,IAAA,CAAwB,GAAe,IAAe,iBACtD,MAAS,gBACJ,KAAS,IAAI,IAAmB,IAElC,KAAS,IAAI,IAAmB,GAGnC,IAAA,CAAwB,GAAmB,MAA6B;AAC5E,IAAA,EA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MAED,gBAAA,EAAC,IAAD;AAAA,QACE,SAAA,MAAe,EAAyB,EAAK;AAAA,QACtB,uBAAA;AAAA,QACvB,OAAO,EAAa;AAAA,MACrB,CAAA;AAAA,IACI;AAAA,OA1XA,gBAAA,EAAC,IAAD,CAAS,CAAA;AA4XpB,GAEA,KAAe,GAAS,EAAQ"}
|
|
1
|
+
{"version":3,"file":"Overview.es.js","names":[],"sources":["../../../src/investments/components/Overview.tsx"],"sourcesContent":["import React, { useState } from 'react'\n\nimport { observer } from 'mobx-react-lite'\nimport Accordion from '@mui/material/Accordion'\nimport AccordionDetails from '@mui/material/AccordionDetails'\nimport AccordionSummary from '@mui/material/AccordionSummary'\nimport Paper from '@mui/material/Paper'\nimport Stack from '@mui/system/Stack'\nimport { useTheme } from '@mui/material/styles'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, P, Text } from '@mxenabled/mxui'\n\nimport { getHoldingGainLoss, getHoldingMarketValue } from '../../core/utils/InvestmentUtil'\nimport ConnectionsDrawer from '../../accounts/components/ConnectionsDrawer'\nimport {\n Loader,\n useAccountStore,\n useGlobalCopyStore,\n useGlobalUiStore,\n useHoldingStore,\n useScreenSize,\n} from '../../common'\nimport { EmptyStateFooterComponent } from './EmptyStateFooterComponent'\nimport InvestmentDetailsDrawer from './HoldingDrawer'\nimport HoldingsTable from './HoldingTable'\n\ninterface HoldingDetail {\n id: string\n description: string\n qty: number\n holding: string\n costBasis: number\n rawCostBasis: number\n totalGainLoss: number\n gainLossAvailable: boolean\n gainLossBasis: number\n marketValue: number\n}\n\nconst Overview = () => {\n const { isMobile } = useScreenSize()\n const [expandedStates, setExpandedStates] = useState<Record<string, boolean>>({})\n const [openDrawer, setOpenDrawer] = useState(false)\n const { selectedAccountGuids } = useGlobalUiStore()\n const { visibleHoldings: holdings, updateHoldings } = useHoldingStore()\n const [showConnectionsWidget, setShowConnectionsWidget] = React.useState(false)\n\n const [accountHoldingsData, setAccountHoldingsData] = useState<{\n accounts: any\n holdings: HoldingDetail[]\n }>({\n accounts: [],\n holdings: [],\n })\n const { accounts: accountsCopy, investments: copy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const [editingHoldingId, setEditingHoldingId] = useState<string | null>(null)\n const [currentEditedCostBasis, setCurrentEditedCostBasis] = useState<string>('')\n\n const theme = useTheme()\n\n const isDarkMode = theme.palette.mode === 'dark'\n\n const gainDisplayColor = isDarkMode ? '#0AC295' : '#09A57F'\n\n const lossDisplayColor = isDarkMode ? 'grey.300' : 'grey.700'\n\n const gainLossDisplayColor = (value: number, type: string = 'lesserThan') => {\n if (type === 'greaterThan') {\n return value >= 0 ? gainDisplayColor : lossDisplayColor\n }\n return value <= 0 ? lossDisplayColor : gainDisplayColor\n }\n\n const handleCostBasisClick = (holdingId: string, currentCostBasis: number) => {\n setEditingHoldingId(holdingId)\n setCurrentEditedCostBasis(currentCostBasis.toFixed(2))\n }\n\n const handleCostBasisChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n // Allow only numbers and a single decimal point\n const value = event.target.value\n if (/^\\d*\\.?\\d*$/.test(value)) {\n setCurrentEditedCostBasis(value)\n }\n }\n\n const handleCostBasisKeyDown = (event: React.KeyboardEvent<HTMLInputElement>, id: string) => {\n if (event.key === 'Enter') {\n handleCostBasisBlur(id)\n } else if (event.key === 'Escape') {\n setEditingHoldingId(null)\n }\n }\n\n const handleCostBasisBlur = (id: string) => {\n const holding = holdings.find(({ guid }) => guid === id)\n if (!holding) return\n\n const updatedCostBasis = Number(currentEditedCostBasis)\n updateHoldings({ ...holding, cost_basis: updatedCostBasis })\n\n if (isMobile) {\n const updatedHoldings = accountHoldingsData.holdings.map((h) =>\n h.id === id\n ? {\n ...h,\n costBasis: updatedCostBasis,\n rawCostBasis: updatedCostBasis,\n // Recompute gain/loss against the new basis so the drawer's %/$\n // stay consistent with the edited Cost Basis instead of going stale.\n gainLossBasis: updatedCostBasis,\n totalGainLoss: h.marketValue - updatedCostBasis,\n gainLossAvailable: true,\n }\n : h,\n )\n\n setAccountHoldingsData((prev) => ({\n ...prev,\n holdings: updatedHoldings,\n }))\n }\n\n setEditingHoldingId(null)\n }\n\n const handleAccordionChange =\n (accountId: string) => (_event: React.SyntheticEvent, isExpanded: boolean) => {\n setExpandedStates((prevStates) => ({\n ...prevStates,\n [accountId]: isExpanded,\n }))\n }\n\n const { visibleHoldings: allHoldings } = useHoldingStore()\n const { visibleInvestmentAccounts } = useAccountStore()\n\n const accounts = visibleInvestmentAccounts.filter(({ guid }) =>\n selectedAccountGuids.includes(guid),\n )\n\n const totalPortfolioValue = accounts.reduce((sum, account) => sum + (account.balance || 0), 0)\n\n const accountGuids = new Set(accounts.map(({ guid }) => guid))\n\n const updatedHoldings = allHoldings.filter(({ account_guid }) => accountGuids.has(account_guid))\n\n // Only holdings with a known cost basis contribute to the aggregate; holdings\n // whose basis is unknown are excluded rather than counted as 100% gain.\n const gainLoss = updatedHoldings.reduce((sum, holding) => {\n const { available, gainLoss: hl } = getHoldingGainLoss(holding)\n return available ? sum + hl : sum\n }, 0)\n\n // When no holding in the portfolio has a known basis, render \"—\" instead of a\n // fabricated $0.00 gain.\n const gainLossAvailable = updatedHoldings.some((holding) => getHoldingGainLoss(holding).available)\n\n const closeDrawer = () => {\n setOpenDrawer(false)\n }\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n return (\n <Stack sx={{ alignItems: 'center', gap: 48, pt: 48, width: '100%' }}>\n {/* header content */}\n {!!accounts.length && (\n <Stack sx={{ alignItems: 'center' }}>\n <Text sx={{ color: 'text.secondary' }}>{copy.overview.total_portfolio}</Text>\n <P variant=\"h1\">\n {totalPortfolioValue.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </P>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {!gainLossAvailable ? (\n <Text sx={{ color: 'text.secondary', fontWeight: 700 }} variant=\"body2\">\n —\n </Text>\n ) : (\n <>\n <Icon\n name={gainLoss >= 0 ? 'trending_up' : 'trending_down'}\n size={20}\n sx={{ color: gainLossDisplayColor(gainLoss, 'greaterThan') }}\n />\n <Text\n sx={{ color: gainLossDisplayColor(gainLoss, 'greaterThan'), fontWeight: 700 }}\n variant=\"body2\"\n >\n {gainLoss.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </>\n )}\n </Stack>\n </Stack>\n )}\n\n {accounts.map((account) => {\n const accountHoldings: HoldingDetail[] = allHoldings\n .filter((holding) => holding.account_guid === account.guid)\n .map((holding) => {\n // Option A: the effective basis (cost_basis, else purchase_price)\n // drives both the Cost Basis column and gain/loss, so the row\n // reconciles. `available` is false only when neither is known.\n const { available, basis, gainLoss } = getHoldingGainLoss(holding)\n return {\n id: holding.guid,\n qty: holding.shares || 0,\n holding: holding.symbol || holding.description || 'Unknown',\n costBasis: basis,\n // The true persisted cost_basis (0 when unset) seeds the editor, so\n // an unmodified edit never writes the purchase_price fallback back\n // to Abacus as a user-set cost_basis.\n rawCostBasis: holding.cost_basis || 0,\n totalGainLoss: gainLoss,\n gainLossAvailable: available,\n gainLossBasis: basis,\n marketValue: getHoldingMarketValue(holding),\n description: holding.description || '',\n }\n })\n\n const hasHoldingsData = accountHoldings.length > 0\n\n const accountTotalValue = account.balance\n const accountGainLoss = accountHoldings.reduce(\n (sum, holding) => holding.totalGainLoss + sum,\n 0,\n )\n\n // Mirror the per-holding rule at the account level: if no holding in the\n // account has a known cost basis, show \"—\" rather than a fabricated\n // $0.00 / 0.00% rollup.\n const accountGainLossAvailable = accountHoldings.some((h) => h.gainLossAvailable)\n\n const accountGainLossPercentage = accountTotalValue\n ? (accountGainLoss / accountTotalValue) * 100\n : 0\n\n // Mobile View: Use a simplified presentation\n if (isMobile) {\n return (\n <Paper\n key={account.guid}\n onClick={\n accountHoldings.length\n ? () => {\n setOpenDrawer(true)\n setAccountHoldingsData({\n holdings: accountHoldings,\n accounts: account,\n })\n }\n : undefined\n }\n sx={{\n width: '100%',\n overflow: 'hidden',\n }}\n >\n <Stack\n sx={{\n border: 1,\n borderColor: 'divider',\n borderRadius: '8px',\n ml: 16,\n mr: 16,\n overflow: 'hidden',\n pt: 14,\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n borderBottom: 1,\n borderColor: 'divider',\n flexDirection: 'row',\n pb: 14,\n pl: 14,\n pr: 14,\n }}\n >\n <InstitutionLogo\n alt={account.institutionName || ''}\n institutionGuid={account.institution_guid || ''}\n size={32}\n />\n <Stack sx={{ overflow: 'hidden', pl: 13, pr: 13 }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {account.memberName}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {account.user_name || account.name}\n </Text>\n </Stack>\n </Stack>\n\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 8,\n pt: 8,\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n borderRight: 1,\n borderColor: 'divider',\n flex: 1,\n justifyContent: 'center',\n pb: 14,\n pl: 7,\n pr: 7,\n pt: 14,\n }}\n >\n <Text sx={{ color: 'text.secondary', fontSize: 11 }} variant=\"body2\">\n {copy.overview.total_gain_Loss}\n </Text>\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 2,\n justifyContent: 'flex-end',\n }}\n >\n {!accountGainLossAvailable ? (\n <Text sx={{ color: 'text.secondary' }} variant=\"body1\">\n —\n </Text>\n ) : (\n <>\n {accountGainLoss !== 0 && (\n <Icon\n name={accountGainLoss > 0 ? 'trending_up' : 'trending_down'}\n size={20}\n sx={{ color: gainLossDisplayColor(accountGainLoss) }}\n />\n )}\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {accountGainLossPercentage.toFixed(2)}%\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n |\n </Text>\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {Math.abs(accountGainLoss).toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </>\n )}\n </Stack>\n </Stack>\n\n <Stack\n sx={{\n alignItems: 'center',\n flex: 1,\n justifyContent: 'center',\n pb: 14,\n pl: 7,\n pr: 7,\n pt: 14,\n }}\n >\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.overview.total_value}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {accountTotalValue?.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n </Paper>\n )\n }\n\n const disabledColor = isDarkMode ? 'grey.700' : 'grey.400'\n const logoColor = accountHoldings.length ? 'text.primary' : disabledColor\n\n return (\n <Accordion\n expanded={expandedStates[account.guid] === true}\n key={account.guid}\n onChange={hasHoldingsData ? handleAccordionChange(account.guid) : () => {}}\n sx={{\n border: 1,\n borderColor: 'divider',\n borderRadius: '4px',\n width: '100%',\n }}\n >\n <AccordionSummary\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n sx={[\n expandedStates[account.guid] && {\n borderBottom: 1,\n borderColor: 'divider',\n maxHeight: 88,\n },\n ]}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 13,\n p: 14,\n width: '100%',\n }}\n >\n <Icon name={'expand_more'} size={20} sx={{ color: logoColor }} />\n <InstitutionLogo\n alt={account.institutionName || ''}\n institutionGuid={account.institution_guid || ''}\n size={32}\n />\n\n <Stack sx={{ alignItems: 'flex-start' }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {account.memberName}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {account.user_name || account.name}\n </Text>\n </Stack>\n </Stack>\n\n <Stack sx={{ flexDirection: 'row' }}>\n <Stack sx={{ alignItems: 'flex-end', pb: 14, pl: 24, pr: 24, pt: 14 }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.overview.total_gain_Loss}\n </Text>\n\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n gap: 2,\n justifyContent: 'flex-end',\n }}\n >\n {!accountGainLossAvailable ? (\n <Text sx={{ color: 'text.secondary' }} variant=\"body1\">\n —\n </Text>\n ) : (\n <>\n {accountGainLoss !== 0 && (\n <Icon\n name={accountGainLoss >= 0 ? 'trending_up' : 'trending_down'}\n size={20}\n sx={{ color: gainLossDisplayColor(accountGainLoss) }}\n />\n )}\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {accountGainLossPercentage.toFixed(2)}%\n </Text>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n |\n </Text>\n <Text\n sx={{\n color: gainLossDisplayColor(accountGainLoss),\n fontWeight: 600,\n }}\n variant=\"body1\"\n >\n {Math.abs(accountGainLoss).toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </>\n )}\n </Stack>\n </Stack>\n\n <Stack sx={{ alignItems: 'flex-end', gap: 12, pb: 14, pl: 16, pr: 16, pt: 14 }}>\n <Stack sx={{ alignItems: 'flex-end' }}>\n <Text sx={{ color: 'text.secondary' }} variant=\"caption\">\n {copy.overview.total_value}\n </Text>\n <Text sx={{ color: 'text.primary', fontWeight: 600 }} variant=\"body1\">\n {accountTotalValue?.toLocaleString('en-US', {\n currency: 'USD',\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n style: 'currency',\n })}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n </AccordionSummary>\n <AccordionDetails sx={{ bgcolor: 'background.default', p: 12 }}>\n <Paper sx={{ border: 1, borderColor: 'neutral.light' }}>\n <HoldingsTable\n currentEditedCostBasis={currentEditedCostBasis}\n data={accountHoldings}\n editingHoldingId={editingHoldingId}\n handleCostBasisBlur={handleCostBasisBlur}\n handleCostBasisChange={handleCostBasisChange}\n handleCostBasisClick={handleCostBasisClick}\n handleCostBasisKeyDown={handleCostBasisKeyDown}\n />\n </Paper>\n </AccordionDetails>\n </Accordion>\n )\n })}\n\n {/* footer content */}\n <EmptyStateFooterComponent />\n\n {/* Drawer Component */}\n <InvestmentDetailsDrawer\n accountHoldingsData={accountHoldingsData}\n currentEditedCostBasis={currentEditedCostBasis}\n editingHoldingId={editingHoldingId}\n handleCostBasisBlur={handleCostBasisBlur}\n handleCostBasisChange={handleCostBasisChange}\n handleCostBasisClick={handleCostBasisClick}\n handleCostBasisKeyDown={handleCostBasisKeyDown}\n isOpen={openDrawer}\n onClose={closeDrawer}\n />\n\n <ConnectionsDrawer\n onClose={() => setShowConnectionsWidget(false)}\n showConnectionsWidget={showConnectionsWidget}\n title={accountsCopy.manage_connections}\n />\n </Stack>\n )\n}\n\nexport default observer(Overview)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,IAAM,KAAA,MAAiB;AACrB,QAAM,EAAE,UAAA,EAAA,IAAa,GAAc,GAC7B,CAAC,GAAgB,CAAA,IAAqB,EAAkC,CAAC,CAAC,GAC1E,CAAC,GAAY,CAAA,IAAiB,EAAS,EAAK,GAC5C,EAAE,sBAAA,EAAA,IAAyB,EAAiB,GAC5C,EAAE,iBAAiB,GAAU,gBAAA,EAAA,IAAmB,EAAgB,GAChE,CAAC,GAAuB,CAAA,IAA4B,GAAM,SAAS,EAAK,GAExE,CAAC,GAAqB,CAAA,IAA0B,EAGnD;AAAA,IACD,UAAU,CAAC;AAAA,IACX,UAAU,CAAC;AAAA,EACb,CAAC,GACK,EAAE,UAAU,GAAc,aAAa,EAAA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AA,QACE,uBAAA;AAAA,QACD,sBAAA;AAAA,QACE,wBAAA;AAAA,QACxB,QAAQ;AAAA,QACR,SAAS;AAAA,MACV,CAAA;AAAA,MAED,gBAAA,EAAC,IAAD;AAAA,QACE,SAAA,MAAe,EAAyB,EAAK;AAAA,QACtB,uBAAA;AAAA,QACvB,OAAO,EAAa;AAAA,MACrB,CAAA;AAAA,IACI;AAAA,OAjaA,gBAAA,EAAC,IAAD,CAAS,CAAA;AAmapB,GAEA,KAAe,GAAS,EAAQ"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useGlobalCopyStore as
|
|
3
|
-
import { currencyDisplay as c, percentageDisplay as
|
|
1
|
+
import b from "../../../common/components/charts/Donut.es.js";
|
|
2
|
+
import { useGlobalCopyStore as k } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import { currencyDisplay as c, percentageDisplay as A } from "./util/createInvestementsAllocationData.es.js";
|
|
4
4
|
import m from "react";
|
|
5
5
|
import r from "@mui/material/Stack";
|
|
6
|
-
import { P as
|
|
7
|
-
import { Icon as
|
|
6
|
+
import { P as I, Text as p } from "@mxenabled/mxui";
|
|
7
|
+
import { Icon as j } from "@mxenabled/mx-icons";
|
|
8
8
|
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
9
|
-
import { useTheme as
|
|
10
|
-
var V = ({ data: t, hoveredId: h, isPercentage: g, onMouseEnter: f, onMouseLeave: y, onSelected:
|
|
11
|
-
const s =
|
|
9
|
+
import { useTheme as M } from "@mui/material/styles";
|
|
10
|
+
var V = ({ data: t, hoveredId: h, isPercentage: g, onMouseEnter: f, onMouseLeave: y, onSelected: x, selectedId: o, size: i = 150, totalLabel: d }) => {
|
|
11
|
+
const s = M(), l = s.palette.mode === "dark", n = m.useMemo(() => o ? t.investmentsData.find(({ guid: _ }) => _ === o) : void 0, [o]), { investments: { allocation: v } } = k(), D = m.useMemo(() => t.donutData.length > 0 ? t.donutData : [{
|
|
12
12
|
id: "0",
|
|
13
13
|
color: s.palette.neutral.light,
|
|
14
14
|
value: 100
|
|
15
|
-
}], [t, s]), C = l ? "#0AC295" : "#09A57F",
|
|
16
|
-
return /* @__PURE__ */ e(
|
|
17
|
-
data:
|
|
15
|
+
}], [t, s]), C = l ? "#0AC295" : "#09A57F", G = l ? "grey.300" : "grey.700", L = () => n ? v.pie_chart_centered_click_for_details : t.totalGainLossAvailable ? g ? A(t.totalGainLossPercentage) : c(t.totalGainLoss) : "—", a = t.totalGainLossAvailable ? t.totalGainLoss >= 0 ? C : G : "text.secondary";
|
|
16
|
+
return /* @__PURE__ */ e(b, {
|
|
17
|
+
data: D,
|
|
18
18
|
hoveredId: h,
|
|
19
|
-
onClick:
|
|
19
|
+
onClick: x,
|
|
20
20
|
onMouseEnter: f,
|
|
21
21
|
onMouseLeave: y,
|
|
22
22
|
selectedId: o,
|
|
@@ -47,9 +47,9 @@ var V = ({ data: t, hoveredId: h, isPercentage: g, onMouseEnter: f, onMouseLeave
|
|
|
47
47
|
/* @__PURE__ */ e(p, {
|
|
48
48
|
color: "text.secondary",
|
|
49
49
|
noWrap: !0,
|
|
50
|
-
children: n?.displayName ??
|
|
50
|
+
children: n?.displayName ?? d
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */ e(
|
|
52
|
+
/* @__PURE__ */ e(I, {
|
|
53
53
|
color: "text.primary",
|
|
54
54
|
variant: "h1",
|
|
55
55
|
children: c(n?.value ?? t.totalMarketValue)
|
|
@@ -60,7 +60,7 @@ var V = ({ data: t, hoveredId: h, isPercentage: g, onMouseEnter: f, onMouseLeave
|
|
|
60
60
|
flexDirection: "row",
|
|
61
61
|
gap: 4
|
|
62
62
|
},
|
|
63
|
-
children: [!n && /* @__PURE__ */ e(
|
|
63
|
+
children: [!n && t.totalGainLossAvailable && /* @__PURE__ */ e(j, {
|
|
64
64
|
name: t.totalGainLoss >= 0 ? "trending_up" : "trending_down",
|
|
65
65
|
size: 20,
|
|
66
66
|
sx: { color: a }
|
|
@@ -70,7 +70,7 @@ var V = ({ data: t, hoveredId: h, isPercentage: g, onMouseEnter: f, onMouseLeave
|
|
|
70
70
|
fontWeight: 700
|
|
71
71
|
},
|
|
72
72
|
variant: "body2",
|
|
73
|
-
children:
|
|
73
|
+
children: L()
|
|
74
74
|
})]
|
|
75
75
|
})
|
|
76
76
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvestmentsAllocationChart.es.js","names":[],"sources":["../../../../src/investments/components/allocation/InvestmentsAllocationChart.tsx"],"sourcesContent":["import React from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore } from '../../../common'\nimport Donut from '../../../common/components/charts/Donut'\n\nimport {\n currencyDisplay,\n InvestmentsAllocationData,\n percentageDisplay,\n} from './util/createInvestementsAllocationData'\n\nexport interface DonutData {\n id: string\n label?: string\n color: string\n value: number\n}\nexport interface InvestmentsData {\n investmentsData: InvestmentsAllocationData[]\n donutData: DonutData[]\n totalAmount: number\n totalGainLoss: number\n totalMarketValue: number\n totalGainLossPercentage: number\n}\ninterface InvestementAllocationProps {\n data: InvestmentsData\n hoveredId?: string\n isPercentage?: boolean\n onSelected: (id: string) => void\n onMouseEnter: (id: string) => void\n onMouseLeave: (id: string) => void\n selectedId?: string\n size?: number\n totalLabel: string\n}\n\nexport const InvestementsAllocationChart: React.FC<InvestementAllocationProps> = ({\n data,\n hoveredId,\n isPercentage,\n onMouseEnter,\n onMouseLeave,\n onSelected,\n selectedId,\n size = 150,\n totalLabel,\n}) => {\n const theme = useTheme()\n const isDarkMode = theme.palette.mode === 'dark'\n\n const selectedInvestments = React.useMemo(\n () =>\n selectedId\n ? data.investmentsData.find(({ guid }: InvestmentsAllocationData) => guid === selectedId)\n : undefined,\n [selectedId],\n )\n const {\n investments: { allocation: copy },\n } = useGlobalCopyStore()\n const donutData = React.useMemo(() => {\n if (data.donutData.length > 0) return data.donutData\n\n // Empty Donut zero state\n return [{ id: '0', color: theme.palette.neutral.light, value: 100 }]\n }, [data, theme])\n\n const gainDisplayColor = isDarkMode ? '#0AC295' : '#09A57F'\n const lossDisplayColor = isDarkMode ? 'grey.300' : 'grey.700'\n\n const getGainLossDisplay = () => {\n if (selectedInvestments) return copy.pie_chart_centered_click_for_details\n if (isPercentage) return percentageDisplay(data.totalGainLossPercentage)\n return currencyDisplay(data.totalGainLoss)\n }\n\n const gainLossDisplayColor = data.totalGainLoss >= 0
|
|
1
|
+
{"version":3,"file":"InvestmentsAllocationChart.es.js","names":[],"sources":["../../../../src/investments/components/allocation/InvestmentsAllocationChart.tsx"],"sourcesContent":["import React from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore } from '../../../common'\nimport Donut from '../../../common/components/charts/Donut'\n\nimport {\n currencyDisplay,\n InvestmentsAllocationData,\n percentageDisplay,\n} from './util/createInvestementsAllocationData'\n\nexport interface DonutData {\n id: string\n label?: string\n color: string\n value: number\n}\nexport interface InvestmentsData {\n investmentsData: InvestmentsAllocationData[]\n donutData: DonutData[]\n totalAmount: number\n totalGainLoss: number\n totalGainLossAvailable: boolean\n totalMarketValue: number\n totalGainLossPercentage: number\n}\ninterface InvestementAllocationProps {\n data: InvestmentsData\n hoveredId?: string\n isPercentage?: boolean\n onSelected: (id: string) => void\n onMouseEnter: (id: string) => void\n onMouseLeave: (id: string) => void\n selectedId?: string\n size?: number\n totalLabel: string\n}\n\nexport const InvestementsAllocationChart: React.FC<InvestementAllocationProps> = ({\n data,\n hoveredId,\n isPercentage,\n onMouseEnter,\n onMouseLeave,\n onSelected,\n selectedId,\n size = 150,\n totalLabel,\n}) => {\n const theme = useTheme()\n const isDarkMode = theme.palette.mode === 'dark'\n\n const selectedInvestments = React.useMemo(\n () =>\n selectedId\n ? data.investmentsData.find(({ guid }: InvestmentsAllocationData) => guid === selectedId)\n : undefined,\n [selectedId],\n )\n const {\n investments: { allocation: copy },\n } = useGlobalCopyStore()\n const donutData = React.useMemo(() => {\n if (data.donutData.length > 0) return data.donutData\n\n // Empty Donut zero state\n return [{ id: '0', color: theme.palette.neutral.light, value: 100 }]\n }, [data, theme])\n\n const gainDisplayColor = isDarkMode ? '#0AC295' : '#09A57F'\n const lossDisplayColor = isDarkMode ? 'grey.300' : 'grey.700'\n\n const getGainLossDisplay = () => {\n if (selectedInvestments) return copy.pie_chart_centered_click_for_details\n if (!data.totalGainLossAvailable) return '—'\n if (isPercentage) return percentageDisplay(data.totalGainLossPercentage)\n return currencyDisplay(data.totalGainLoss)\n }\n\n const gainLossDisplayColor = !data.totalGainLossAvailable\n ? 'text.secondary'\n : data.totalGainLoss >= 0\n ? gainDisplayColor\n : lossDisplayColor\n\n return (\n <Donut\n data={donutData}\n hoveredId={hoveredId}\n onClick={onSelected}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n selectedId={selectedId}\n size={size}\n >\n <Stack alignItems=\"center\" height=\"100%\" justifyContent=\"center\" width=\"100%\">\n <Stack alignItems=\"center\" justifyContent=\"center\" minHeight={size} minWidth={size}>\n <Stack alignItems=\"center\" sx={{ gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } }}>\n <Text color=\"text.secondary\" noWrap={true}>\n {selectedInvestments?.displayName ?? totalLabel}\n </Text>\n <P color=\"text.primary\" variant=\"h1\">\n {currencyDisplay(selectedInvestments?.value ?? data.totalMarketValue)}\n </P>\n\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 4 }}>\n {!selectedInvestments && data.totalGainLossAvailable && (\n <Icon\n name={data.totalGainLoss >= 0 ? 'trending_up' : 'trending_down'}\n size={20}\n sx={{ color: gainLossDisplayColor }}\n />\n )}\n <Text\n sx={{\n color: gainLossDisplayColor,\n fontWeight: 700,\n }}\n vari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AAS,gBAAe;AAAA,QAAS,WAAW;AAAA,QAAM,UAAU;AAAA,QAC5E,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAO,YAAW;AAAA,UAAS,IAAI;AAAA,YAAE,KAAK;AAAA,cAAE,IAAI;AAAA,cAAG,IAAI;AAAA,YAAE;AAAA,YAAG,IAAI;AAAA,cAAE,IAAI;AAAA,cAAG,IAAI;AAAA,YAAE;AAAA,UAAE;AAAA,UAA7E,UAAA;AAAA,YACE,gBAAA,EAAC,GAAD;AAAA,cAAM,OAAM;AAAA,cAAiB,QAAQ;AAAA,cAClC,UAAA,GAAqB,eAAe;AAAA,YACjC,CAAA;AAAA,YACN,gBAAA,EAAC,GAAD;AAAA,cAAG,OAAM;AAAA,cAAe,SAAQ;AAAA,cAC7B,UAAA,EAAgB,GAAqB,SAAS,EAAK,gBAAgB;AAAA,YACnE,CAAA;AAAA,YAEH,gBAAA,EAAC,GAAD;AAAA,cAAO,IAAI;AAAA,gBAAE,YAAY;AAAA,gBAAU,eAAe;AAAA,gBAAO,KAAK;AAAA,cAAE;AAAA,cAAhE,UAAA,CACG,CAAC,KAAuB,EAAK,0BAC5B,gBAAA,EAAC,GAAD;AAAA,gBACE,MAAM,EAAK,iBAAiB,IAAI,gBAAgB;AAAA,gBAChD,MAAM;AAAA,gBACN,IAAI,EAAE,OAAO,EAAqB;AAAA,cACnC,CAAA,GAEH,gBAAA,EAAC,GAAD;AAAA,gBACE,IAAI;AAAA,kBACF,OAAO;AAAA,kBACP,YAAY;AAAA,gBACd;AAAA,gBACA,SAAQ;AAAA,gBAEP,UAAA,EAAmB;AAAA,cAChB,CAAA,CACD;AAAA;UACF;AAAA;MACF,CAAA;AAAA,IACF,CAAA;AAAA,EACF,CAAA;AAEX"}
|
|
@@ -21,6 +21,7 @@ export declare const createInvestmentsAllocationData: (accounts: Account[], copy
|
|
|
21
21
|
donutData: DonutData[];
|
|
22
22
|
totalAmount: number;
|
|
23
23
|
totalGainLoss: number;
|
|
24
|
+
totalGainLossAvailable: boolean;
|
|
24
25
|
totalMarketValue: number;
|
|
25
26
|
totalGainLossPercentage: number;
|
|
26
27
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { formatCurrency as
|
|
2
|
-
import { ALLOCATION_KEYS as
|
|
3
|
-
|
|
1
|
+
import { formatCurrency as D, formatPercentage as k } from "../../../../core/utils/NumberFormatting.es.js";
|
|
2
|
+
import { ALLOCATION_KEYS as y } from "../../../../core/constants/Investments.es.js";
|
|
3
|
+
import { getHoldingGainLoss as b, getHoldingMarketValue as v } from "../../../../core/utils/InvestmentUtil.es.js";
|
|
4
|
+
var G = {
|
|
4
5
|
allocations_cash: "#AEDCCC",
|
|
5
6
|
allocations_convertible: "#80CAD0",
|
|
6
7
|
allocations_foreign_bond: "#51B9D4",
|
|
@@ -10,85 +11,88 @@ var C = {
|
|
|
10
11
|
allocations_unknown: "#161D6A",
|
|
11
12
|
allocations_us_bond: "#254995",
|
|
12
13
|
allocations_us_stock: "#1E2D84"
|
|
13
|
-
},
|
|
14
|
-
const i = r === void 0 ? 0 : l,
|
|
15
|
-
return
|
|
16
|
-
},
|
|
17
|
-
const i = [...new Set(
|
|
18
|
-
let
|
|
14
|
+
}, V = y.map((e) => ({ name: e })), w = (e, l, r) => {
|
|
15
|
+
const i = r === void 0 ? 0 : l, t = r === void 0 ? l : r;
|
|
16
|
+
return e >= Math.min(i, t) && e < Math.max(i, t);
|
|
17
|
+
}, E = (e, l, r) => {
|
|
18
|
+
const i = [...new Set(e.map((c) => c.name.toLowerCase()))];
|
|
19
|
+
let t;
|
|
19
20
|
return i.map((c) => {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
return
|
|
21
|
+
const p = e.reduce((m, o) => {
|
|
22
|
+
const d = o.name;
|
|
23
|
+
return d.toLowerCase() === c ? (t = d, v(o) * o[l] / 100 + m) : m;
|
|
23
24
|
}, 0);
|
|
24
25
|
return {
|
|
25
|
-
displayName:
|
|
26
|
-
name:
|
|
27
|
-
value:
|
|
28
|
-
percentage:
|
|
26
|
+
displayName: t,
|
|
27
|
+
name: t,
|
|
28
|
+
value: p,
|
|
29
|
+
percentage: p / r
|
|
29
30
|
};
|
|
30
31
|
});
|
|
31
|
-
},
|
|
32
|
-
const i = Object.values(l.allocations_list),
|
|
32
|
+
}, S = (e, l, r) => {
|
|
33
|
+
const i = Object.values(l.allocations_list), t = [];
|
|
33
34
|
let c = 0;
|
|
34
|
-
const
|
|
35
|
+
const p = new Set(e.map(({ guid: a }) => a)), m = r.filter(({ account_guid: a }) => p.has(a)).map((a) => ({
|
|
35
36
|
...a,
|
|
36
37
|
name: a.symbol || a.description,
|
|
37
|
-
gainLoss:
|
|
38
|
-
})), { cashBalance:
|
|
38
|
+
gainLoss: b(a).gainLoss
|
|
39
|
+
})), { cashBalance: o, totalAccountBalance: d } = e.reduce((a, n) => ({
|
|
39
40
|
cashBalance: a.cashBalance + (n.cash_balance || 0),
|
|
40
41
|
totalAccountBalance: a.totalAccountBalance + (n.balance || 0)
|
|
41
42
|
}), {
|
|
42
43
|
cashBalance: 0,
|
|
43
44
|
totalAccountBalance: 0
|
|
44
|
-
}), { marketValue:
|
|
45
|
-
marketValue: a.marketValue +
|
|
45
|
+
}), { marketValue: h, totalGainLoss: f } = m.reduce((a, n) => ({
|
|
46
|
+
marketValue: a.marketValue + v(n),
|
|
46
47
|
totalGainLoss: a.totalGainLoss + n.gainLoss
|
|
47
48
|
}), {
|
|
48
49
|
marketValue: 0,
|
|
49
50
|
totalGainLoss: 0
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
const
|
|
55
|
-
if (a.name === "allocations_cash" &&
|
|
56
|
-
|
|
51
|
+
}), _ = h + o;
|
|
52
|
+
V.forEach((a, n) => {
|
|
53
|
+
const g = m.filter((u) => !!u[a.name]);
|
|
54
|
+
let s = g.reduce((u, L) => u + v(L) * L[a.name] / 100, 0);
|
|
55
|
+
const A = E(g, a.name, s);
|
|
56
|
+
if (a.name === "allocations_cash" && o > 0) {
|
|
57
|
+
s += o;
|
|
57
58
|
const u = {
|
|
58
59
|
displayName: l.cash_balance_display_name,
|
|
59
60
|
name: "allocations_name",
|
|
60
|
-
value:
|
|
61
|
-
percentage:
|
|
61
|
+
value: o,
|
|
62
|
+
percentage: o / _
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
+
A.push(u);
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
s > 0 && (t.push({
|
|
66
67
|
name: a.name,
|
|
67
68
|
displayName: i[n],
|
|
68
69
|
guid: `${a.name}-${n}`,
|
|
69
|
-
holdings:
|
|
70
|
-
percentage:
|
|
71
|
-
value:
|
|
72
|
-
color:
|
|
73
|
-
}), c +=
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
holdings: A,
|
|
71
|
+
percentage: s / _,
|
|
72
|
+
value: s,
|
|
73
|
+
color: G[a.name]
|
|
74
|
+
}), c += s);
|
|
75
|
+
});
|
|
76
|
+
const B = t.map(({ displayName: a, guid: n, color: g, value: s }) => ({
|
|
77
|
+
id: n,
|
|
78
|
+
color: g,
|
|
79
|
+
label: a,
|
|
80
|
+
value: s / c * 100
|
|
81
|
+
})), C = m.some((a) => b(a).available);
|
|
82
|
+
return {
|
|
83
|
+
investmentsData: t,
|
|
84
|
+
donutData: B,
|
|
82
85
|
totalAmount: c,
|
|
83
|
-
totalGainLoss:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
totalGainLoss: f,
|
|
87
|
+
totalGainLossAvailable: C,
|
|
88
|
+
totalMarketValue: _,
|
|
89
|
+
totalGainLossPercentage: f / d
|
|
86
90
|
};
|
|
87
|
-
},
|
|
91
|
+
}, T = (e) => e < 1e-3 ? "< 0.1%" : k(e), O = (e) => e === 0 ? D(e, "0,0.00") : w(e, -0.01, 0.01) ? "< $0.01" : D(e, "0,0.00");
|
|
88
92
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
S as createInvestmentsAllocationData,
|
|
94
|
+
O as currencyDisplay,
|
|
95
|
+
T as percentageDisplay
|
|
92
96
|
};
|
|
93
97
|
|
|
94
98
|
//# sourceMappingURL=createInvestementsAllocationData.es.js.map
|
package/dist/investments/components/allocation/util/createInvestementsAllocationData.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createInvestementsAllocationData.es.js","names":[],"sources":["../../../../../src/investments/components/allocation/util/createInvestementsAllocationData.tsx"],"sourcesContent":["import { Account, Holding } from '../../../../core'\nimport { ALLOCATION_KEYS, type AllocationKey } from '../../../../core/constants/Investments'\nimport { InvestmentAllocationCopy } from '../../../../core/types/localization/InvestmentsCopy'\nimport type { DonutData } from '../InvestmentsAllocationChart'\nimport { formatCurrency, formatPercentage } from '../../../../core/utils/NumberFormatting'\n\nexport interface InvestmentsAllocationData {\n name: string\n displayName: string\n guid: string\n holdings: InvestmentAllocationTotals[]\n percentage: number\n value: number\n color: string\n}\nexport interface InvestmentAllocationTotals {\n displayName: string\n name: string\n value: number\n percentage: number\n}\n\nconst allocationColors: Record<AllocationKey, string> = {\n allocations_cash: '#AEDCCC',\n allocations_convertible: '#80CAD0',\n allocations_foreign_bond: '#51B9D4',\n allocations_foreign_stock: '#3DA0C9',\n allocations_other: '#3583B8',\n allocations_preferred: '#2D66A7',\n allocations_unknown: '#161D6A',\n allocations_us_bond: '#254995',\n allocations_us_stock: '#1E2D84',\n}\nconst allocationsList = ALLOCATION_KEYS.map((name) => ({ name }))\n\nconst inRange = (n: number, start: number, end?: number) => {\n const rangeStart = end === undefined ? 0 : start\n const rangeEnd = end === undefined ? start : end\n return n >= Math.min(rangeStart, rangeEnd) && n < Math.max(rangeStart, rangeEnd)\n}\n\nconst createHoldingsData = (\n holdings: Holding[],\n allocationName: string,\n allocationValue: number,\n) => {\n const uniqueHoldings = [\n ...new Set(holdings.map((holding: Holding) => holding.name.toLowerCase())),\n ]\n let displayName: string\n const investmentAllocationTotals = uniqueHoldings.map((holdingName) => {\n // sum all the holdings with the same \"name\"\n const holdingsTotalValue = holdings.reduce((acc, hold: Holding) => {\n const name = hold.name\n\n if (name.toLowerCase() === holdingName) {\n // Since we lose the capitalization with the unique names, we take it from the last match.\n displayName = name\n return (\n (
|
|
1
|
+
{"version":3,"file":"createInvestementsAllocationData.es.js","names":[],"sources":["../../../../../src/investments/components/allocation/util/createInvestementsAllocationData.tsx"],"sourcesContent":["import { Account, Holding } from '../../../../core'\nimport { ALLOCATION_KEYS, type AllocationKey } from '../../../../core/constants/Investments'\nimport { InvestmentAllocationCopy } from '../../../../core/types/localization/InvestmentsCopy'\nimport type { DonutData } from '../InvestmentsAllocationChart'\nimport { formatCurrency, formatPercentage } from '../../../../core/utils/NumberFormatting'\nimport { getHoldingGainLoss, getHoldingMarketValue } from '../../../../core/utils/InvestmentUtil'\n\nexport interface InvestmentsAllocationData {\n name: string\n displayName: string\n guid: string\n holdings: InvestmentAllocationTotals[]\n percentage: number\n value: number\n color: string\n}\nexport interface InvestmentAllocationTotals {\n displayName: string\n name: string\n value: number\n percentage: number\n}\n\nconst allocationColors: Record<AllocationKey, string> = {\n allocations_cash: '#AEDCCC',\n allocations_convertible: '#80CAD0',\n allocations_foreign_bond: '#51B9D4',\n allocations_foreign_stock: '#3DA0C9',\n allocations_other: '#3583B8',\n allocations_preferred: '#2D66A7',\n allocations_unknown: '#161D6A',\n allocations_us_bond: '#254995',\n allocations_us_stock: '#1E2D84',\n}\nconst allocationsList = ALLOCATION_KEYS.map((name) => ({ name }))\n\nconst inRange = (n: number, start: number, end?: number) => {\n const rangeStart = end === undefined ? 0 : start\n const rangeEnd = end === undefined ? start : end\n return n >= Math.min(rangeStart, rangeEnd) && n < Math.max(rangeStart, rangeEnd)\n}\n\nconst createHoldingsData = (\n holdings: Holding[],\n allocationName: string,\n allocationValue: number,\n) => {\n const uniqueHoldings = [\n ...new Set(holdings.map((holding: Holding) => holding.name.toLowerCase())),\n ]\n let displayName: string\n const investmentAllocationTotals = uniqueHoldings.map((holdingName) => {\n // sum all the holdings with the same \"name\"\n const holdingsTotalValue = holdings.reduce((acc, hold: Holding) => {\n const name = hold.name\n\n if (name.toLowerCase() === holdingName) {\n // Since we lose the capitalization with the unique names, we take it from the last match.\n displayName = name\n return (\n (getHoldingMarketValue(hold) * hold[allocationName as keyof typeof allocationColors]) /\n 100 +\n acc\n )\n }\n\n return acc\n }, 0)\n\n return {\n displayName,\n name: displayName,\n value: holdingsTotalValue,\n percentage: holdingsTotalValue / allocationValue,\n }\n })\n return investmentAllocationTotals\n}\n\nexport const createInvestmentsAllocationData = (\n accounts: Account[],\n copy: InvestmentAllocationCopy,\n holdings: Holding[],\n) => {\n const allocationListDisplayNames = Object.values(copy.allocations_list)\n const investementAllocationData: InvestmentsAllocationData[] = []\n\n let totalAmount = 0\n\n const accountGuids = new Set(accounts.map(({ guid }) => guid))\n const updatedHoldings: Holding[] = holdings\n .filter(({ account_guid }) => accountGuids.has(account_guid))\n .map((eachHolding) => {\n return {\n ...eachHolding,\n name: eachHolding.symbol || eachHolding.description,\n // Falls back to purchase_price when cost_basis is unset, and contributes\n // 0 (not a fabricated gain) only when no basis is known at all.\n gainLoss: getHoldingGainLoss(eachHolding).gainLoss,\n }\n })\n\n const { cashBalance, totalAccountBalance } = accounts.reduce(\n (sum, account) => {\n return {\n cashBalance: sum.cashBalance + (account.cash_balance || 0),\n totalAccountBalance: sum.totalAccountBalance + (account.balance || 0),\n }\n },\n { cashBalance: 0, totalAccountBalance: 0 },\n )\n const { marketValue, totalGainLoss } = updatedHoldings.reduce(\n (acc, holding) => {\n return {\n marketValue: acc.marketValue + getHoldingMarketValue(holding),\n totalGainLoss: acc.totalGainLoss + holding.gainLoss,\n }\n },\n { marketValue: 0, totalGainLoss: 0 },\n )\n const totalMarketValue = marketValue + cashBalance\n\n allocationsList.forEach((allocation, index) => {\n const filteredHoldings = updatedHoldings.filter(\n (eachHolding) => !!eachHolding[allocation.name as keyof typeof allocationColors],\n )\n let holdingsTotal = filteredHoldings.reduce(\n (sum, holding) =>\n sum +\n (getHoldingMarketValue(holding) *\n holding[allocation.name as keyof typeof allocationColors]) /\n 100,\n 0,\n )\n const investmentAllocationTotals = createHoldingsData(\n filteredHoldings,\n allocation.name,\n holdingsTotal,\n )\n if (allocation.name === 'allocations_cash' && cashBalance > 0) {\n // Updating holdingsTotal to include cash balance\n // This affects the holdingsTotal and percentage for this allocation\n holdingsTotal += cashBalance\n\n // Creating a holding item for cash balance\n const cashBalanceHolding = {\n displayName: copy.cash_balance_display_name,\n name: 'allocations_name',\n value: cashBalance,\n percentage: cashBalance / totalMarketValue,\n }\n\n investmentAllocationTotals.push(cashBalanceHolding)\n }\n\n // Shows allocation if holdingsTotal is greater than zero\n if (holdingsTotal > 0) {\n investementAllocationData.push({\n name: allocation.name,\n displayName: allocationListDisplayNames[index],\n guid: `${allocation.name}-${index}`,\n holdings: investmentAllocationTotals,\n percentage: holdingsTotal / totalMarketValue,\n value: holdingsTotal,\n color: allocationColors[allocation.name as keyof typeof allocationColors],\n })\n totalAmount += holdingsTotal\n }\n })\n const donutData: DonutData[] = investementAllocationData.map(\n ({ displayName, guid, color, value }) => ({\n id: guid,\n color: color,\n label: displayName,\n value: (value / totalAmount) * 100,\n }),\n )\n\n // When no holding in the filtered set has a known basis, the donut center\n // renders \"—\" rather than a fabricated $0.00 / 0% gain.\n const totalGainLossAvailable = updatedHoldings.some(\n (holding) => getHoldingGainLoss(holding).available,\n )\n\n return {\n investmentsData: investementAllocationData,\n donutData,\n totalAmount,\n totalGainLoss,\n totalGainLossAvailable,\n totalMarketValue,\n totalGainLossPercentage: totalGainLoss / totalAccountBalance,\n }\n}\n\nexport const percentageDisplay = (value: number) =>\n value < 0.001 ? '< 0.1%' : formatPercentage(value)\n\nexport const currencyDisplay = (value: number) => {\n if (value === 0) return formatCurrency(value, '0,0.00')\n return inRange(value, -0.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,MAClB,EAA0B,KAAK;AAAA,MAC7B,MAAM,EAAW;AAAA,MACjB,aAAa,EAA2B,CAAA;AAAA,MACxC,MAAM,GAAG,EAAW,IAAA,IAAQ,CAAA;AAAA,MAC5B,UAAU;AAAA,MACV,YAAY,IAAgB;AAAA,MAC5B,OAAO;AAAA,MACP,OAAO,EAAiB,EAAW,IAAA;AAAA,IACrC,CAAC,GACD,KAAe;AAAA,EAEnB,CAAC;AACD,QAAM,IAAyB,EAA0B,IAAA,CACtD,EAAE,aAAA,GAAa,MAAA,GAAM,OAAA,GAAO,OAAA,EAAA,OAAa;AAAA,IACxC,IAAI;AAAA,IACG,OAAA;AAAA,IACP,OAAO;AAAA,IACP,OAAQ,IAAQ,IAAe;AAAA,EACjC,EACF,GAIM,IAAyB,EAAgB,KAAA,CAC5C,MAAY,EAAmB,CAAO,EAAE,SAC3C;AAEA,SAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,WAAA;AAAA,IACA,aAAA;AAAA,IACA,eAAA;AAAA,IACA,wBAAA;AAAA,IACA,kBAAA;AAAA,IACA,yBAAyB,IAAgB;AAAA,EAC3C;AACF,GAEa,IAAA,CAAqB,MAChC,IAAQ,OAAQ,WAAW,EAAiB,CAAK,GAEtC,IAAA,CAAmB,MAC1B,MAAU,IAAU,EAAe,GAAO,QAAQ,IAC/C,EAAQ,GAAO,OAAO,IAAI,IAAI,YAAY,EAAe,GAAO,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-cartographer/experiences",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.22",
|
|
4
4
|
"description": "Library containing experience widgets",
|
|
5
5
|
"author": "MX",
|
|
6
6
|
"license": "MIT",
|
|
@@ -219,8 +219,8 @@
|
|
|
219
219
|
"@mui/x-date-pickers": "^7.29.4",
|
|
220
220
|
"@mui/x-date-pickers-pro": "^7.29.4",
|
|
221
221
|
"@mxenabled/cssinjs": "^0.6.0",
|
|
222
|
-
"@mxenabled/mx-icons": "^2.
|
|
223
|
-
"@mxenabled/mxui": "2.
|
|
222
|
+
"@mxenabled/mx-icons": "^2.3.0",
|
|
223
|
+
"@mxenabled/mxui": "^2.9.2",
|
|
224
224
|
"@mxenabled/web-widget-sdk": "^0.0.15",
|
|
225
225
|
"@tanstack/react-virtual": "^3.14.9",
|
|
226
226
|
"bowser": "^2.14.1",
|