@layerfi/components 0.1.114-alpha.1 → 0.1.114-alpha.2
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/cjs/index.cjs +1080 -1021
- package/dist/esm/index.mjs +1083 -1024
- package/dist/index.css +67 -137
- package/dist/index.d.ts +18 -13
- package/package.json +3 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -53,7 +53,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
53
53
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
54
54
|
import { createContext, useContext, useMemo, useState, useEffect, forwardRef, isValidElement, cloneElement, useRef, useCallback, useLayoutEffect, useImperativeHandle, useId, createElement, Component, Children, Fragment as Fragment$1, useReducer } from "react";
|
|
55
55
|
import { usePlaidLink } from "react-plaid-link";
|
|
56
|
-
import { formatISO, differenceInDays, endOfDay, startOfMonth, endOfMonth,
|
|
56
|
+
import { formatISO, differenceInDays, endOfDay, startOfMonth, endOfMonth, min, max, isWithinInterval, parseISO, differenceInCalendarMonths, format, startOfYear, isValid, subMonths, getYear, getMonth, subYears, differenceInCalendarYears, sub, differenceInMonths, add, startOfDay, endOfToday, isEqual, addYears, endOfYear, subQuarters, addQuarters, endOfQuarter, startOfQuarter, addMonths, set, startOfToday, endOfYesterday, formatDate as formatDate$1 } from "date-fns";
|
|
57
57
|
import { fromDate, getLocalTimeZone, CalendarDate, ZonedDateTime, toCalendarDate, today } from "@internationalized/date";
|
|
58
58
|
import useSWR, { useSWRConfig, SWRConfig } from "swr";
|
|
59
59
|
import { createStore, useStore } from "zustand";
|
|
@@ -65,10 +65,11 @@ import { Schema, pipe, BigDecimal, Option, Effect } from "effect";
|
|
|
65
65
|
import useSWRInfinite from "swr/infinite";
|
|
66
66
|
import { debounce, uniqBy, merge, uniqueId } from "lodash-es";
|
|
67
67
|
import useSWRMutation from "swr/mutation";
|
|
68
|
-
import { Button as Button$2, Menu as Menu$1, MenuItem as MenuItem$2, Header as Header$3, Label as Label$1, Text as Text$1, MenuTrigger, Popover as Popover$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Checkbox as Checkbox$1, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, Group, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, SearchField as SearchField$1, Input as Input$2,
|
|
68
|
+
import { Button as Button$2, Menu as Menu$1, MenuItem as MenuItem$2, Header as Header$3, Label as Label$1, Text as Text$1, MenuTrigger, Popover as Popover$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Checkbox as Checkbox$1, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, Group, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, GridListItem, GridList, SearchField as SearchField$1, Input as Input$2, Switch as Switch$1, TextArea as TextArea$1, DialogTrigger, Table as Table$2, Column as Column$1, Cell as Cell$1, TableHeader as TableHeader$1, TableBody as TableBody$2, Row as Row$1, Link as Link$3, Meter as Meter$1 } from "react-aria-components";
|
|
69
69
|
import useResizeObserver from "@react-hook/resize-observer";
|
|
70
70
|
import { mergeRefs } from "react-merge-refs";
|
|
71
|
-
import { UploadCloud as UploadCloud$1, LoaderCircle, X as X$1, Minus, Check as Check$1, TriangleAlert, ChevronDown as ChevronDown$1, Search, ChevronLeft as ChevronLeft$1, FileSpreadsheet, FileDownIcon, CopyIcon, RefreshCcw as RefreshCcw$1, ChevronRight as ChevronRight$1, MenuIcon, PencilRuler, SearchX, Trash2, CheckIcon, AlertCircle as AlertCircle$1, List, AlertTriangle, Save as Save$1, Calendar as Calendar$2, Download, Users, Milestone, Video, Clock as Clock$1, Link as Link$4, Plus as Plus$1, HandCoins, Trash as Trash$1, Menu as Menu$2, Send } from "lucide-react";
|
|
71
|
+
import { UploadCloud as UploadCloud$1, LoaderCircle, X as X$1, Minus, Check as Check$1, TriangleAlert, ChevronDown as ChevronDown$1, Layers2Icon, Search, ChevronLeft as ChevronLeft$1, FileSpreadsheet, FileDownIcon, CopyIcon, RefreshCcw as RefreshCcw$1, ChevronRight as ChevronRight$1, MenuIcon, PencilRuler, SearchX, Trash2, CheckIcon, AlertCircle as AlertCircle$1, List, AlertTriangle, Save as Save$1, Calendar as Calendar$2, Download, Users, Milestone, Video, Clock as Clock$1, Link as Link$4, Plus as Plus$1, HandCoins, Trash as Trash$1, Menu as Menu$2, Send } from "lucide-react";
|
|
72
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
72
73
|
import CurrencyInput from "react-currency-input-field";
|
|
73
74
|
import Select$1, { components } from "react-select";
|
|
74
75
|
import { v4 } from "uuid";
|
|
@@ -110,7 +111,7 @@ const LinkedAccountsContext = createContext({
|
|
|
110
111
|
setAccountsToAddOpeningBalanceInModal: () => {
|
|
111
112
|
}
|
|
112
113
|
});
|
|
113
|
-
const version = "0.1.114-alpha.
|
|
114
|
+
const version = "0.1.114-alpha.2";
|
|
114
115
|
const pkg = {
|
|
115
116
|
version
|
|
116
117
|
};
|
|
@@ -1766,25 +1767,17 @@ function clampToPresentOrPast(date, cutoff = endOfDay(/* @__PURE__ */ new Date()
|
|
|
1766
1767
|
return min([date, cutoff]);
|
|
1767
1768
|
}
|
|
1768
1769
|
const RANGE_MODE_LOOKUP = {
|
|
1769
|
-
|
|
1770
|
+
date: {
|
|
1770
1771
|
getStartDate: ({ startDate }) => startOfMonth(startDate),
|
|
1771
1772
|
getEndDate: ({ endDate }) => clampToPresentOrPast(endOfDay(endDate))
|
|
1772
1773
|
},
|
|
1773
|
-
|
|
1774
|
+
full: {
|
|
1774
1775
|
getStartDate: ({ startDate }) => startDate,
|
|
1775
1776
|
getEndDate: ({ endDate }) => clampToPresentOrPast(endOfDay(endDate))
|
|
1776
1777
|
},
|
|
1777
|
-
|
|
1778
|
+
month: {
|
|
1778
1779
|
getStartDate: ({ startDate }) => startOfMonth(startDate),
|
|
1779
1780
|
getEndDate: ({ endDate }) => clampToPresentOrPast(endOfMonth(endDate))
|
|
1780
|
-
},
|
|
1781
|
-
monthRangePicker: {
|
|
1782
|
-
getStartDate: ({ startDate }) => startOfMonth(startDate),
|
|
1783
|
-
getEndDate: ({ endDate }) => clampToPresentOrPast(endOfMonth(endDate))
|
|
1784
|
-
},
|
|
1785
|
-
yearPicker: {
|
|
1786
|
-
getStartDate: ({ startDate }) => startOfYear(startDate),
|
|
1787
|
-
getEndDate: ({ endDate }) => clampToPresentOrPast(endOfYear(endDate))
|
|
1788
1781
|
}
|
|
1789
1782
|
};
|
|
1790
1783
|
function withCorrectedRange(fn) {
|
|
@@ -1804,28 +1797,18 @@ function buildStore$2() {
|
|
|
1804
1797
|
return next;
|
|
1805
1798
|
};
|
|
1806
1799
|
const setDate = ({ date }) => {
|
|
1807
|
-
const s = RANGE_MODE_LOOKUP.
|
|
1808
|
-
const e = RANGE_MODE_LOOKUP.
|
|
1800
|
+
const s = RANGE_MODE_LOOKUP.date.getStartDate({ startDate: date });
|
|
1801
|
+
const e = RANGE_MODE_LOOKUP.date.getEndDate({ endDate: date });
|
|
1809
1802
|
return apply({ startDate: s, endDate: e });
|
|
1810
1803
|
};
|
|
1811
1804
|
const setDateRange = withCorrectedRange(({ startDate, endDate }) => {
|
|
1812
|
-
const s = RANGE_MODE_LOOKUP.
|
|
1813
|
-
const e = RANGE_MODE_LOOKUP.
|
|
1805
|
+
const s = RANGE_MODE_LOOKUP.full.getStartDate({ startDate });
|
|
1806
|
+
const e = RANGE_MODE_LOOKUP.full.getEndDate({ endDate });
|
|
1814
1807
|
return apply({ startDate: s, endDate: e });
|
|
1815
1808
|
});
|
|
1816
1809
|
const setMonth = ({ startDate }) => {
|
|
1817
|
-
const s = RANGE_MODE_LOOKUP.
|
|
1818
|
-
const e = RANGE_MODE_LOOKUP.
|
|
1819
|
-
return apply({ startDate: s, endDate: e });
|
|
1820
|
-
};
|
|
1821
|
-
const setMonthRange = withCorrectedRange(({ startDate, endDate }) => {
|
|
1822
|
-
const s = RANGE_MODE_LOOKUP.monthRangePicker.getStartDate({ startDate });
|
|
1823
|
-
const e = RANGE_MODE_LOOKUP.monthRangePicker.getEndDate({ endDate });
|
|
1824
|
-
return apply({ startDate: s, endDate: e });
|
|
1825
|
-
});
|
|
1826
|
-
const setYear = ({ startDate }) => {
|
|
1827
|
-
const s = RANGE_MODE_LOOKUP.yearPicker.getStartDate({ startDate });
|
|
1828
|
-
const e = RANGE_MODE_LOOKUP.yearPicker.getEndDate({ endDate: startDate });
|
|
1810
|
+
const s = RANGE_MODE_LOOKUP.month.getStartDate({ startDate });
|
|
1811
|
+
const e = RANGE_MODE_LOOKUP.month.getEndDate({ endDate: startDate });
|
|
1829
1812
|
return apply({ startDate: s, endDate: e });
|
|
1830
1813
|
};
|
|
1831
1814
|
const setRangeWithExplicitDisplayMode = ({
|
|
@@ -1834,16 +1817,12 @@ function buildStore$2() {
|
|
|
1834
1817
|
displayMode
|
|
1835
1818
|
}) => {
|
|
1836
1819
|
switch (displayMode) {
|
|
1837
|
-
case "
|
|
1820
|
+
case "date":
|
|
1838
1821
|
return setDate({ date: endDate });
|
|
1839
|
-
case "
|
|
1822
|
+
case "full":
|
|
1840
1823
|
return setDateRange({ startDate, endDate });
|
|
1841
|
-
case "
|
|
1824
|
+
case "month":
|
|
1842
1825
|
return setMonth({ startDate });
|
|
1843
|
-
case "monthRangePicker":
|
|
1844
|
-
return setMonthRange({ startDate, endDate });
|
|
1845
|
-
case "yearPicker":
|
|
1846
|
-
return setYear({ startDate });
|
|
1847
1826
|
default:
|
|
1848
1827
|
unsafeAssertUnreachable({
|
|
1849
1828
|
message: "Invalid `displayMode`"
|
|
@@ -1858,8 +1837,6 @@ function buildStore$2() {
|
|
|
1858
1837
|
setRangeWithExplicitDisplayMode,
|
|
1859
1838
|
setDateRange,
|
|
1860
1839
|
setMonth,
|
|
1861
|
-
setMonthRange,
|
|
1862
|
-
setYear,
|
|
1863
1840
|
setMonthByPeriod: ({ monthNumber, yearNumber }) => {
|
|
1864
1841
|
const effectiveMonthNumber = Math.min(Math.max(monthNumber, 1), 12);
|
|
1865
1842
|
return setMonth({ startDate: new Date(yearNumber, effectiveMonthNumber - 1, 1) });
|
|
@@ -1906,14 +1883,10 @@ function useGlobalDateRangeActions() {
|
|
|
1906
1883
|
);
|
|
1907
1884
|
const setDateRange = useStore(store, ({ actions: { setDateRange: setDateRange2 } }) => setDateRange2);
|
|
1908
1885
|
const setMonth = useStore(store, ({ actions: { setMonth: setMonth2 } }) => setMonth2);
|
|
1909
|
-
const setMonthRange = useStore(store, ({ actions: { setMonthRange: setMonthRange2 } }) => setMonthRange2);
|
|
1910
|
-
const setYear = useStore(store, ({ actions: { setYear: setYear2 } }) => setYear2);
|
|
1911
1886
|
return {
|
|
1912
1887
|
setRangeWithExplicitDisplayMode,
|
|
1913
1888
|
setDateRange,
|
|
1914
|
-
setMonth
|
|
1915
|
-
setMonthRange,
|
|
1916
|
-
setYear
|
|
1889
|
+
setMonth
|
|
1917
1890
|
};
|
|
1918
1891
|
}
|
|
1919
1892
|
function useGlobalDatePeriodAlignedActions() {
|
|
@@ -1929,7 +1902,7 @@ function GlobalDateStoreProvider({
|
|
|
1929
1902
|
}
|
|
1930
1903
|
const useBankTransactionsFilters = (params) => {
|
|
1931
1904
|
const dateFilterMode = (params == null ? void 0 : params.applyGlobalDateRange) ? BankTransactionsDateFilterMode.GlobalDateRange : (params == null ? void 0 : params.monthlyView) ? BankTransactionsDateFilterMode.MonthlyView : void 0;
|
|
1932
|
-
const globalDateRange = useGlobalDateRange({ displayMode: "
|
|
1905
|
+
const globalDateRange = useGlobalDateRange({ displayMode: "full" });
|
|
1933
1906
|
const defaultDateRange = {
|
|
1934
1907
|
startDate: startOfMonth(/* @__PURE__ */ new Date()),
|
|
1935
1908
|
endDate: endOfMonth(/* @__PURE__ */ new Date())
|
|
@@ -7539,11 +7512,59 @@ const SubmitButton = (_ba) => {
|
|
|
7539
7512
|
})
|
|
7540
7513
|
);
|
|
7541
7514
|
};
|
|
7515
|
+
const variants = {
|
|
7516
|
+
fade: {
|
|
7517
|
+
initial: { opacity: 0 },
|
|
7518
|
+
animate: { opacity: 1 },
|
|
7519
|
+
exit: { opacity: 0 },
|
|
7520
|
+
transition: { duration: 0.3, ease: [0, 0, 0.58, 1] }
|
|
7521
|
+
},
|
|
7522
|
+
slideUp: {
|
|
7523
|
+
initial: { y: "100%" },
|
|
7524
|
+
animate: { y: 0 },
|
|
7525
|
+
exit: { y: "100%" },
|
|
7526
|
+
transition: { duration: 0.35, ease: [0.4, 0, 0.2, 1] }
|
|
7527
|
+
},
|
|
7528
|
+
expand: {
|
|
7529
|
+
initial: { height: 0, opacity: 0 },
|
|
7530
|
+
animate: { height: "auto", opacity: 1 },
|
|
7531
|
+
exit: { height: 0, opacity: 0 },
|
|
7532
|
+
transition: {
|
|
7533
|
+
height: { duration: 0.25, ease: [0.4, 0, 0.2, 1] },
|
|
7534
|
+
opacity: { duration: 0.15, ease: [0, 0, 0.58, 1] }
|
|
7535
|
+
}
|
|
7536
|
+
}
|
|
7537
|
+
};
|
|
7538
|
+
const AnimatedContent = (_da) => {
|
|
7539
|
+
var _ea = _da, {
|
|
7540
|
+
children,
|
|
7541
|
+
variant,
|
|
7542
|
+
isOpen,
|
|
7543
|
+
slotProps = { AnimatePresence: { initial: false } }
|
|
7544
|
+
} = _ea, props = __objRest(_ea, [
|
|
7545
|
+
"children",
|
|
7546
|
+
"variant",
|
|
7547
|
+
"isOpen",
|
|
7548
|
+
"slotProps"
|
|
7549
|
+
]);
|
|
7550
|
+
const config = variants[variant];
|
|
7551
|
+
return /* @__PURE__ */ jsx(AnimatePresence, __spreadProps(__spreadValues({}, slotProps.AnimatePresence), { children: isOpen && /* @__PURE__ */ jsx(
|
|
7552
|
+
motion.div,
|
|
7553
|
+
__spreadProps(__spreadValues({
|
|
7554
|
+
initial: config.initial,
|
|
7555
|
+
animate: config.animate,
|
|
7556
|
+
exit: config.exit,
|
|
7557
|
+
transition: config.transition
|
|
7558
|
+
}, props), {
|
|
7559
|
+
children
|
|
7560
|
+
})
|
|
7561
|
+
) }));
|
|
7562
|
+
};
|
|
7542
7563
|
const BASE_MODAL_OVERLAY_CLASS_NAME = "Layer__ModalOverlay";
|
|
7543
7564
|
const MODAL_OVERLAY_CLASS_NAME = `Layer__Portal ${BASE_MODAL_OVERLAY_CLASS_NAME}`;
|
|
7544
7565
|
const ModalOverlay = forwardRef(
|
|
7545
|
-
(
|
|
7546
|
-
var
|
|
7566
|
+
(_fa, ref) => {
|
|
7567
|
+
var _ga = _fa, { variant } = _ga, restProps = __objRest(_ga, ["variant"]);
|
|
7547
7568
|
const dataProperties = toDataProperties({ variant });
|
|
7548
7569
|
return /* @__PURE__ */ jsx(
|
|
7549
7570
|
ModalOverlay$1,
|
|
@@ -7570,8 +7591,8 @@ const InternalModal = forwardRef(({ children, flexBlock, flexInline, size, varia
|
|
|
7570
7591
|
InternalModal.displayName = "Modal";
|
|
7571
7592
|
const DIALOG_CLASS_NAME = "Layer__Dialog";
|
|
7572
7593
|
const Dialog = forwardRef(
|
|
7573
|
-
(
|
|
7574
|
-
var
|
|
7594
|
+
(_ha, ref) => {
|
|
7595
|
+
var _ia = _ha, { variant = "center" } = _ia, restProps = __objRest(_ia, ["variant"]);
|
|
7575
7596
|
const dataProperties = toDataProperties({ variant });
|
|
7576
7597
|
return /* @__PURE__ */ jsx(
|
|
7577
7598
|
Dialog$1,
|
|
@@ -7609,11 +7630,25 @@ function Drawer({
|
|
|
7609
7630
|
isDismissable = false,
|
|
7610
7631
|
role
|
|
7611
7632
|
}) {
|
|
7612
|
-
|
|
7633
|
+
const isMobileDrawer = variant === "mobile-drawer";
|
|
7634
|
+
const shouldUseFadeOverlay = variant === "drawer" || isMobileDrawer;
|
|
7635
|
+
const modalContent = /* @__PURE__ */ jsx(InternalModal, { flexBlock, flexInline, size, variant, children: /* @__PURE__ */ jsx(Dialog, { role: role != null ? role : "dialog", "aria-label": ariaLabel, variant, children }) });
|
|
7636
|
+
const wrappedModalContent = isMobileDrawer ? /* @__PURE__ */ jsx(
|
|
7637
|
+
AnimatedContent,
|
|
7638
|
+
{
|
|
7639
|
+
variant: "slideUp",
|
|
7640
|
+
isOpen,
|
|
7641
|
+
className: "Layer__ModalContentSlideUpMotionContent",
|
|
7642
|
+
slotProps: { AnimatePresence: { initial: true } },
|
|
7643
|
+
children: modalContent
|
|
7644
|
+
}
|
|
7645
|
+
) : modalContent;
|
|
7646
|
+
const overlayContent = shouldUseFadeOverlay ? /* @__PURE__ */ jsx(AnimatedContent, { variant: "fade", isOpen, className: "Layer__ModalContentFadeMotionContent", children: wrappedModalContent }) : wrappedModalContent;
|
|
7647
|
+
return /* @__PURE__ */ jsx(ModalOverlay, { isOpen, onOpenChange, variant, isDismissable, children: overlayContent });
|
|
7613
7648
|
}
|
|
7614
7649
|
const HEADING_CLASS_NAME = "Layer__UI__Heading";
|
|
7615
|
-
const Heading = forwardRef((
|
|
7616
|
-
var
|
|
7650
|
+
const Heading = forwardRef((_ja, ref) => {
|
|
7651
|
+
var _ka = _ja, { align, pie, pbe, size, variant, weight, ellipsis, className } = _ka, restProps = __objRest(_ka, ["align", "pie", "pbe", "size", "variant", "weight", "ellipsis", "className"]);
|
|
7617
7652
|
const dataProperties = toDataProperties({ pbe, pie, size, align, variant, weight, ellipsis });
|
|
7618
7653
|
return /* @__PURE__ */ jsx(
|
|
7619
7654
|
Heading$2,
|
|
@@ -7640,21 +7675,25 @@ function ButtonSpinner({ size }) {
|
|
|
7640
7675
|
function ButtonTransparentContent({ children }) {
|
|
7641
7676
|
return /* @__PURE__ */ jsx("span", { className: BUTTON_CLASS_NAMES.TRANSPARENT_CONTENT, children });
|
|
7642
7677
|
}
|
|
7643
|
-
const Button = forwardRef((
|
|
7644
|
-
var
|
|
7678
|
+
const Button = forwardRef((_la, ref) => {
|
|
7679
|
+
var _ma = _la, {
|
|
7645
7680
|
children,
|
|
7646
7681
|
ellipsis,
|
|
7647
7682
|
icon,
|
|
7648
7683
|
inset,
|
|
7649
7684
|
size = "md",
|
|
7650
|
-
variant = "solid"
|
|
7651
|
-
|
|
7685
|
+
variant = "solid",
|
|
7686
|
+
fullWidth = false,
|
|
7687
|
+
flex = false
|
|
7688
|
+
} = _ma, restProps = __objRest(_ma, [
|
|
7652
7689
|
"children",
|
|
7653
7690
|
"ellipsis",
|
|
7654
7691
|
"icon",
|
|
7655
7692
|
"inset",
|
|
7656
7693
|
"size",
|
|
7657
|
-
"variant"
|
|
7694
|
+
"variant",
|
|
7695
|
+
"fullWidth",
|
|
7696
|
+
"flex"
|
|
7658
7697
|
]);
|
|
7659
7698
|
const { isPending = false } = restProps;
|
|
7660
7699
|
const dataProperties = toDataProperties({
|
|
@@ -7662,7 +7701,9 @@ const Button = forwardRef((_ja, ref) => {
|
|
|
7662
7701
|
icon,
|
|
7663
7702
|
inset,
|
|
7664
7703
|
size,
|
|
7665
|
-
variant
|
|
7704
|
+
variant,
|
|
7705
|
+
"full-width": fullWidth,
|
|
7706
|
+
flex
|
|
7666
7707
|
});
|
|
7667
7708
|
return /* @__PURE__ */ jsx(
|
|
7668
7709
|
Button$2,
|
|
@@ -8019,8 +8060,8 @@ const CHECK_SIZE = {
|
|
|
8019
8060
|
md: 14,
|
|
8020
8061
|
lg: 16
|
|
8021
8062
|
};
|
|
8022
|
-
function Checkbox(
|
|
8023
|
-
var
|
|
8063
|
+
function Checkbox(_na) {
|
|
8064
|
+
var _oa = _na, { children, className, variant = "default", size = "sm", isIndeterminate } = _oa, props = __objRest(_oa, ["children", "className", "variant", "size", "isIndeterminate"]);
|
|
8024
8065
|
const dataProperties = useMemo(() => toDataProperties({
|
|
8025
8066
|
size,
|
|
8026
8067
|
variant,
|
|
@@ -8038,8 +8079,8 @@ function Checkbox(_la) {
|
|
|
8038
8079
|
})
|
|
8039
8080
|
);
|
|
8040
8081
|
}
|
|
8041
|
-
function CheckboxWithTooltip(
|
|
8042
|
-
var
|
|
8082
|
+
function CheckboxWithTooltip(_pa) {
|
|
8083
|
+
var _qa = _pa, { tooltip } = _qa, props = __objRest(_qa, ["tooltip"]);
|
|
8043
8084
|
return /* @__PURE__ */ jsx("div", { className: "Layer__checkbox-wrapper", children: /* @__PURE__ */ jsxs(DeprecatedTooltip, { disabled: !tooltip, children: [
|
|
8044
8085
|
/* @__PURE__ */ jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsx(Checkbox, __spreadValues({}, props)) }),
|
|
8045
8086
|
/* @__PURE__ */ jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
|
|
@@ -8384,8 +8425,8 @@ const isDateAllowedToBrowse = (date, business) => {
|
|
|
8384
8425
|
}
|
|
8385
8426
|
return differenceInCalendarMonths(startOfMonth(date), activationDate) >= 0;
|
|
8386
8427
|
};
|
|
8387
|
-
const ErrorText = (
|
|
8388
|
-
var
|
|
8428
|
+
const ErrorText = (_ra) => {
|
|
8429
|
+
var _sa = _ra, { className } = _sa, props = __objRest(_sa, ["className"]);
|
|
8389
8430
|
return /* @__PURE__ */ jsx(Text, __spreadProps(__spreadValues({}, props), { status: "error", className }));
|
|
8390
8431
|
};
|
|
8391
8432
|
const InputGroup$1 = ({
|
|
@@ -8424,8 +8465,8 @@ const transformCurrencyValue = (rawValue) => {
|
|
|
8424
8465
|
}
|
|
8425
8466
|
return cleaned;
|
|
8426
8467
|
};
|
|
8427
|
-
const AmountInput = (
|
|
8428
|
-
var
|
|
8468
|
+
const AmountInput = (_ta) => {
|
|
8469
|
+
var _ua = _ta, {
|
|
8429
8470
|
onChange,
|
|
8430
8471
|
className,
|
|
8431
8472
|
leftText,
|
|
@@ -8433,7 +8474,7 @@ const AmountInput = (_ra) => {
|
|
|
8433
8474
|
isInvalid,
|
|
8434
8475
|
badge,
|
|
8435
8476
|
placeholder = "$0.00"
|
|
8436
|
-
} =
|
|
8477
|
+
} = _ua, props = __objRest(_ua, [
|
|
8437
8478
|
"onChange",
|
|
8438
8479
|
"className",
|
|
8439
8480
|
"leftText",
|
|
@@ -8478,8 +8519,8 @@ const AmountInput = (_ra) => {
|
|
|
8478
8519
|
/* @__PURE__ */ jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
8479
8520
|
] });
|
|
8480
8521
|
};
|
|
8481
|
-
const ChevronLeft = (
|
|
8482
|
-
var props = __objRest(
|
|
8522
|
+
const ChevronLeft = (_va) => {
|
|
8523
|
+
var props = __objRest(_va, []);
|
|
8483
8524
|
return /* @__PURE__ */ jsx(
|
|
8484
8525
|
"svg",
|
|
8485
8526
|
__spreadProps(__spreadValues({
|
|
@@ -8503,8 +8544,8 @@ const ChevronLeft = (_ta) => {
|
|
|
8503
8544
|
};
|
|
8504
8545
|
const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
|
|
8505
8546
|
const Calendar = forwardRef(
|
|
8506
|
-
function Calendar2(
|
|
8507
|
-
var
|
|
8547
|
+
function Calendar2(_wa, ref) {
|
|
8548
|
+
var _xa = _wa, { className, isReadOnly } = _xa, restProps = __objRest(_xa, ["className", "isReadOnly"]);
|
|
8508
8549
|
const dataProperties = toDataProperties({ readonly: isReadOnly });
|
|
8509
8550
|
return /* @__PURE__ */ jsx(
|
|
8510
8551
|
Calendar$1,
|
|
@@ -8518,8 +8559,8 @@ const Calendar = forwardRef(
|
|
|
8518
8559
|
);
|
|
8519
8560
|
const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
|
|
8520
8561
|
const CalendarGrid = forwardRef(
|
|
8521
|
-
function CalendarGrid2(
|
|
8522
|
-
var
|
|
8562
|
+
function CalendarGrid2(_ya, ref) {
|
|
8563
|
+
var _za = _ya, { className } = _za, restProps = __objRest(_za, ["className"]);
|
|
8523
8564
|
return /* @__PURE__ */ jsx(
|
|
8524
8565
|
CalendarGrid$1,
|
|
8525
8566
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -8531,8 +8572,8 @@ const CalendarGrid = forwardRef(
|
|
|
8531
8572
|
);
|
|
8532
8573
|
const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
|
|
8533
8574
|
const CalendarGridBody = forwardRef(
|
|
8534
|
-
function CalendarGridBody2(
|
|
8535
|
-
var
|
|
8575
|
+
function CalendarGridBody2(_Aa, ref) {
|
|
8576
|
+
var _Ba = _Aa, { className } = _Ba, restProps = __objRest(_Ba, ["className"]);
|
|
8536
8577
|
return /* @__PURE__ */ jsx(
|
|
8537
8578
|
CalendarGridBody$1,
|
|
8538
8579
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -8544,8 +8585,8 @@ const CalendarGridBody = forwardRef(
|
|
|
8544
8585
|
);
|
|
8545
8586
|
const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
|
|
8546
8587
|
const CalendarCell = forwardRef(
|
|
8547
|
-
function CalendarCell2(
|
|
8548
|
-
var
|
|
8588
|
+
function CalendarCell2(_Ca, ref) {
|
|
8589
|
+
var _Da = _Ca, { className, size = "sm" } = _Da, restProps = __objRest(_Da, ["className", "size"]);
|
|
8549
8590
|
const dataProperties = toDataProperties({ size });
|
|
8550
8591
|
return /* @__PURE__ */ jsx(
|
|
8551
8592
|
CalendarCell$1,
|
|
@@ -8558,8 +8599,8 @@ const CalendarCell = forwardRef(
|
|
|
8558
8599
|
);
|
|
8559
8600
|
const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
|
|
8560
8601
|
const CalendarGridHeader = forwardRef(
|
|
8561
|
-
function CalendarGridHeader2(
|
|
8562
|
-
var
|
|
8602
|
+
function CalendarGridHeader2(_Ea, ref) {
|
|
8603
|
+
var _Fa = _Ea, { className } = _Fa, restProps = __objRest(_Fa, ["className"]);
|
|
8563
8604
|
return /* @__PURE__ */ jsx(
|
|
8564
8605
|
CalendarGridHeader$1,
|
|
8565
8606
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -8571,8 +8612,8 @@ const CalendarGridHeader = forwardRef(
|
|
|
8571
8612
|
);
|
|
8572
8613
|
const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
|
|
8573
8614
|
const CalendarHeaderCell = forwardRef(
|
|
8574
|
-
function CalendarHeaderCell2(
|
|
8575
|
-
var
|
|
8615
|
+
function CalendarHeaderCell2(_Ga, ref) {
|
|
8616
|
+
var _Ha = _Ga, { className, size = "sm" } = _Ha, restProps = __objRest(_Ha, ["className", "size"]);
|
|
8576
8617
|
const dataProperties = toDataProperties({ size });
|
|
8577
8618
|
return /* @__PURE__ */ jsx(
|
|
8578
8619
|
CalendarHeaderCell$1,
|
|
@@ -8598,8 +8639,8 @@ const DateCalendar = ({ minDate, maxDate, variant }) => {
|
|
|
8598
8639
|
};
|
|
8599
8640
|
const DATE_FIELD_CLASS_NAME = "Layer__UI__DateField";
|
|
8600
8641
|
const DateField = forwardRef(
|
|
8601
|
-
function DateField2(
|
|
8602
|
-
var
|
|
8642
|
+
function DateField2(_Ia, ref) {
|
|
8643
|
+
var _Ja = _Ia, { inline, className, isReadOnly } = _Ja, restProps = __objRest(_Ja, ["inline", "className", "isReadOnly"]);
|
|
8603
8644
|
const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
|
|
8604
8645
|
return /* @__PURE__ */ jsx(
|
|
8605
8646
|
DateField$1,
|
|
@@ -8613,8 +8654,8 @@ const DateField = forwardRef(
|
|
|
8613
8654
|
);
|
|
8614
8655
|
const DATE_INPUT_CLASS_NAME = "Layer__UI__DateInput";
|
|
8615
8656
|
const DateInput = forwardRef(
|
|
8616
|
-
function DateInput2(
|
|
8617
|
-
var
|
|
8657
|
+
function DateInput2(_Ka, ref) {
|
|
8658
|
+
var _La = _Ka, { inset, pointerEvents } = _La, restProps = __objRest(_La, ["inset", "pointerEvents"]);
|
|
8618
8659
|
const dataProperties = toDataProperties({ inset, "pointer-events": pointerEvents });
|
|
8619
8660
|
return /* @__PURE__ */ jsx(
|
|
8620
8661
|
DateInput$1,
|
|
@@ -8627,8 +8668,8 @@ const DateInput = forwardRef(
|
|
|
8627
8668
|
);
|
|
8628
8669
|
const DATE_SEGMENT_CLASS_NAME = "Layer__UI__DateSegment";
|
|
8629
8670
|
const DateSegment = forwardRef(
|
|
8630
|
-
function DateSegment2(
|
|
8631
|
-
var
|
|
8671
|
+
function DateSegment2(_Ma, ref) {
|
|
8672
|
+
var _Na = _Ma, { isReadOnly } = _Na, restProps = __objRest(_Na, ["isReadOnly"]);
|
|
8632
8673
|
const dataProperties = toDataProperties({ interactive: !isReadOnly });
|
|
8633
8674
|
return /* @__PURE__ */ jsx(
|
|
8634
8675
|
DateSegment$1,
|
|
@@ -8654,8 +8695,8 @@ const DatePicker$1 = forwardRef(
|
|
|
8654
8695
|
const POPOVER_CLASS_NAME = "Layer__Popover";
|
|
8655
8696
|
const POPOVER_CLASS_NAMES = `Layer__Portal ${POPOVER_CLASS_NAME}`;
|
|
8656
8697
|
const Popover = forwardRef(
|
|
8657
|
-
function Popover2(
|
|
8658
|
-
var
|
|
8698
|
+
function Popover2(_Oa, ref) {
|
|
8699
|
+
var _Pa = _Oa, { flexInline = false } = _Pa, restProps = __objRest(_Pa, ["flexInline"]);
|
|
8659
8700
|
const dataProperties = toDataProperties({ "flex-inline": flexInline });
|
|
8660
8701
|
return /* @__PURE__ */ jsx(
|
|
8661
8702
|
Popover$1,
|
|
@@ -8729,8 +8770,8 @@ function ResponsivePopover({ children, triggerRef }) {
|
|
|
8729
8770
|
}
|
|
8730
8771
|
);
|
|
8731
8772
|
}
|
|
8732
|
-
const ChevronDown = (
|
|
8733
|
-
var
|
|
8773
|
+
const ChevronDown = (_Qa) => {
|
|
8774
|
+
var _Ra = _Qa, { size = 18 } = _Ra, props = __objRest(_Ra, ["size"]);
|
|
8734
8775
|
return /* @__PURE__ */ jsx(
|
|
8735
8776
|
"svg",
|
|
8736
8777
|
__spreadProps(__spreadValues({
|
|
@@ -8754,8 +8795,8 @@ const ChevronDown = (_Oa) => {
|
|
|
8754
8795
|
};
|
|
8755
8796
|
const INPUT_GROUP_CLASS_NAME = "Layer__InputGroup";
|
|
8756
8797
|
const InputGroup = forwardRef(
|
|
8757
|
-
function InputGroup2(
|
|
8758
|
-
var
|
|
8798
|
+
function InputGroup2(_Sa, ref) {
|
|
8799
|
+
var _Ta = _Sa, { actionCount, className, slots, children } = _Ta, restProps = __objRest(_Ta, ["actionCount", "className", "slots", "children"]);
|
|
8759
8800
|
const combinedClassName = classNames(INPUT_GROUP_CLASS_NAME, className);
|
|
8760
8801
|
const dataProperties = toDataProperties({
|
|
8761
8802
|
"action-count": actionCount
|
|
@@ -8772,15 +8813,15 @@ const InputGroup = forwardRef(
|
|
|
8772
8813
|
);
|
|
8773
8814
|
const FORM_CLASS_NAME = "Layer__UI__Form";
|
|
8774
8815
|
const Form = forwardRef(
|
|
8775
|
-
function Form2(
|
|
8776
|
-
var
|
|
8816
|
+
function Form2(_Ua, ref) {
|
|
8817
|
+
var _Va = _Ua, { children, className } = _Va, restProps = __objRest(_Va, ["children", "className"]);
|
|
8777
8818
|
return /* @__PURE__ */ jsx(Form$1, __spreadProps(__spreadValues({}, restProps), { className: classNames(FORM_CLASS_NAME, className), ref, children }));
|
|
8778
8819
|
}
|
|
8779
8820
|
);
|
|
8780
8821
|
const TEXT_FIELD_CLASS_NAME = "Layer__UI__TextField";
|
|
8781
8822
|
const TextField = forwardRef(
|
|
8782
|
-
function TextField2(
|
|
8783
|
-
var
|
|
8823
|
+
function TextField2(_Wa, ref) {
|
|
8824
|
+
var _Xa = _Wa, { children, inline, textarea, className } = _Xa, restProps = __objRest(_Xa, ["children", "inline", "textarea", "className"]);
|
|
8784
8825
|
const dataProperties = toDataProperties({ inline, textarea });
|
|
8785
8826
|
return /* @__PURE__ */ jsx(TextField$1, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(TEXT_FIELD_CLASS_NAME, className), ref, children: withRenderProp(children, (node) => node) }));
|
|
8786
8827
|
}
|
|
@@ -9469,8 +9510,8 @@ const useIsVisible = (ref) => {
|
|
|
9469
9510
|
}, [ref]);
|
|
9470
9511
|
return isIntersecting;
|
|
9471
9512
|
};
|
|
9472
|
-
const ChevronDownFill = (
|
|
9473
|
-
var
|
|
9513
|
+
const ChevronDownFill = (_Ya) => {
|
|
9514
|
+
var _Za = _Ya, { size = 18 } = _Za, props = __objRest(_Za, ["size"]);
|
|
9474
9515
|
return /* @__PURE__ */ jsxs(
|
|
9475
9516
|
"svg",
|
|
9476
9517
|
__spreadProps(__spreadValues({
|
|
@@ -9495,8 +9536,8 @@ const ChevronDownFill = (_Wa) => {
|
|
|
9495
9536
|
})
|
|
9496
9537
|
);
|
|
9497
9538
|
};
|
|
9498
|
-
const File = (
|
|
9499
|
-
var
|
|
9539
|
+
const File = (__a) => {
|
|
9540
|
+
var _$a = __a, { size = 12 } = _$a, props = __objRest(_$a, ["size"]);
|
|
9500
9541
|
return /* @__PURE__ */ jsxs(
|
|
9501
9542
|
"svg",
|
|
9502
9543
|
__spreadProps(__spreadValues({
|
|
@@ -9556,13 +9597,13 @@ const File = (_Ya) => {
|
|
|
9556
9597
|
})
|
|
9557
9598
|
);
|
|
9558
9599
|
};
|
|
9559
|
-
const Input$1 = (
|
|
9560
|
-
var
|
|
9600
|
+
const Input$1 = (_ab) => {
|
|
9601
|
+
var _bb = _ab, {
|
|
9561
9602
|
className,
|
|
9562
9603
|
isInvalid,
|
|
9563
9604
|
errorMessage,
|
|
9564
9605
|
leftText
|
|
9565
|
-
} =
|
|
9606
|
+
} = _bb, props = __objRest(_bb, [
|
|
9566
9607
|
"className",
|
|
9567
9608
|
"isInvalid",
|
|
9568
9609
|
"errorMessage",
|
|
@@ -9582,19 +9623,19 @@ const Input$1 = (__a) => {
|
|
|
9582
9623
|
/* @__PURE__ */ jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
9583
9624
|
] });
|
|
9584
9625
|
};
|
|
9585
|
-
const TextButton = (
|
|
9586
|
-
var
|
|
9626
|
+
const TextButton = (_cb) => {
|
|
9627
|
+
var _db = _cb, {
|
|
9587
9628
|
className,
|
|
9588
9629
|
children
|
|
9589
|
-
} =
|
|
9630
|
+
} = _db, props = __objRest(_db, [
|
|
9590
9631
|
"className",
|
|
9591
9632
|
"children"
|
|
9592
9633
|
]);
|
|
9593
9634
|
const baseClassName2 = classNames("Layer__text-btn", className);
|
|
9594
9635
|
return /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues({}, props), { className: baseClassName2, children }));
|
|
9595
9636
|
};
|
|
9596
|
-
const ScissorsFullOpen = (
|
|
9597
|
-
var
|
|
9637
|
+
const ScissorsFullOpen = (_eb) => {
|
|
9638
|
+
var _fb = _eb, { size = 12 } = _fb, props = __objRest(_fb, ["size"]);
|
|
9598
9639
|
return /* @__PURE__ */ jsx(
|
|
9599
9640
|
"svg",
|
|
9600
9641
|
__spreadProps(__spreadValues({
|
|
@@ -9659,8 +9700,8 @@ const ScissorsFullOpen = (_cb) => {
|
|
|
9659
9700
|
})
|
|
9660
9701
|
);
|
|
9661
9702
|
};
|
|
9662
|
-
const Trash = (
|
|
9663
|
-
var
|
|
9703
|
+
const Trash = (_gb) => {
|
|
9704
|
+
var _hb = _gb, { size = 18 } = _hb, props = __objRest(_hb, ["size"]);
|
|
9664
9705
|
return /* @__PURE__ */ jsxs(
|
|
9665
9706
|
"svg",
|
|
9666
9707
|
__spreadProps(__spreadValues({
|
|
@@ -9711,8 +9752,8 @@ const Trash = (_eb) => {
|
|
|
9711
9752
|
})
|
|
9712
9753
|
);
|
|
9713
9754
|
};
|
|
9714
|
-
const UploadCloud = (
|
|
9715
|
-
var
|
|
9755
|
+
const UploadCloud = (_ib) => {
|
|
9756
|
+
var _jb = _ib, { size = 18 } = _jb, props = __objRest(_jb, ["size"]);
|
|
9716
9757
|
return /* @__PURE__ */ jsxs(
|
|
9717
9758
|
"svg",
|
|
9718
9759
|
__spreadProps(__spreadValues({
|
|
@@ -9967,8 +10008,8 @@ const ReceiptsProvider = ({
|
|
|
9967
10008
|
const contextData = useReceipts({ bankTransaction, isActive });
|
|
9968
10009
|
return /* @__PURE__ */ jsx(ReceiptsContext.Provider, { value: contextData, children });
|
|
9969
10010
|
};
|
|
9970
|
-
const DownloadCloud = (
|
|
9971
|
-
var
|
|
10011
|
+
const DownloadCloud = (_kb) => {
|
|
10012
|
+
var _lb = _kb, { size = 18 } = _lb, props = __objRest(_lb, ["size"]);
|
|
9972
10013
|
return /* @__PURE__ */ jsxs(
|
|
9973
10014
|
"svg",
|
|
9974
10015
|
__spreadProps(__spreadValues({
|
|
@@ -10010,8 +10051,8 @@ const DownloadCloud = (_ib) => {
|
|
|
10010
10051
|
})
|
|
10011
10052
|
);
|
|
10012
10053
|
};
|
|
10013
|
-
const Eye = (
|
|
10014
|
-
var
|
|
10054
|
+
const Eye = (_mb) => {
|
|
10055
|
+
var _nb = _mb, { size = 18 } = _nb, props = __objRest(_nb, ["size"]);
|
|
10015
10056
|
return /* @__PURE__ */ jsx(
|
|
10016
10057
|
"svg",
|
|
10017
10058
|
__spreadProps(__spreadValues({
|
|
@@ -10164,8 +10205,8 @@ const openReceiptInNewTab = (url, index) => (e) => {
|
|
|
10164
10205
|
`);
|
|
10165
10206
|
}
|
|
10166
10207
|
};
|
|
10167
|
-
const BankTransactionReceiptsWithProvider = forwardRef((
|
|
10168
|
-
var
|
|
10208
|
+
const BankTransactionReceiptsWithProvider = forwardRef((_ob, ref) => {
|
|
10209
|
+
var _pb = _ob, { bankTransaction, isActive } = _pb, props = __objRest(_pb, ["bankTransaction", "isActive"]);
|
|
10169
10210
|
return /* @__PURE__ */ jsx(ReceiptsProvider, { bankTransaction, isActive, children: /* @__PURE__ */ jsx(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })) });
|
|
10170
10211
|
});
|
|
10171
10212
|
BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
|
|
@@ -10217,8 +10258,8 @@ const BankTransactionReceipts = forwardRef(
|
|
|
10217
10258
|
);
|
|
10218
10259
|
BankTransactionReceipts.displayName = "BankTransactionReceipts";
|
|
10219
10260
|
const PORTAL_CLASS_NAME = "Layer__Portal";
|
|
10220
|
-
const Check = (
|
|
10221
|
-
var
|
|
10261
|
+
const Check = (_qb) => {
|
|
10262
|
+
var _rb = _qb, { size = 18 } = _rb, props = __objRest(_rb, ["size"]);
|
|
10222
10263
|
return /* @__PURE__ */ jsx(
|
|
10223
10264
|
"svg",
|
|
10224
10265
|
__spreadProps(__spreadValues({
|
|
@@ -10414,8 +10455,8 @@ function buildCustomMenuPortal() {
|
|
|
10414
10455
|
);
|
|
10415
10456
|
};
|
|
10416
10457
|
}
|
|
10417
|
-
function ComboBox(
|
|
10418
|
-
var
|
|
10458
|
+
function ComboBox(_sb) {
|
|
10459
|
+
var _tb = _sb, {
|
|
10419
10460
|
className,
|
|
10420
10461
|
selectedValue,
|
|
10421
10462
|
onSelectedValueChange,
|
|
@@ -10433,7 +10474,7 @@ function ComboBox(_qb) {
|
|
|
10433
10474
|
isClearable = true,
|
|
10434
10475
|
isReadOnly = false,
|
|
10435
10476
|
displayDisabledAsSelected
|
|
10436
|
-
} =
|
|
10477
|
+
} = _tb, ariaProps = __objRest(_tb, [
|
|
10437
10478
|
"className",
|
|
10438
10479
|
"selectedValue",
|
|
10439
10480
|
"onSelectedValueChange",
|
|
@@ -11630,8 +11671,8 @@ function isCategorizationEnabledForStatus(status) {
|
|
|
11630
11671
|
}
|
|
11631
11672
|
}
|
|
11632
11673
|
}
|
|
11633
|
-
const MinimizeTwo = (
|
|
11634
|
-
var
|
|
11674
|
+
const MinimizeTwo = (_ub) => {
|
|
11675
|
+
var _vb = _ub, { size = 18 } = _vb, props = __objRest(_vb, ["size"]);
|
|
11635
11676
|
return /* @__PURE__ */ jsxs(
|
|
11636
11677
|
"svg",
|
|
11637
11678
|
__spreadProps(__spreadValues({
|
|
@@ -12062,12 +12103,12 @@ const Notification = ({
|
|
|
12062
12103
|
}
|
|
12063
12104
|
);
|
|
12064
12105
|
};
|
|
12065
|
-
const Textarea = (
|
|
12066
|
-
var
|
|
12106
|
+
const Textarea = (_wb) => {
|
|
12107
|
+
var _xb = _wb, {
|
|
12067
12108
|
className,
|
|
12068
12109
|
isInvalid,
|
|
12069
12110
|
errorMessage
|
|
12070
|
-
} =
|
|
12111
|
+
} = _xb, props = __objRest(_xb, [
|
|
12071
12112
|
"className",
|
|
12072
12113
|
"isInvalid",
|
|
12073
12114
|
"errorMessage"
|
|
@@ -12209,9 +12250,7 @@ const BankTransactionMemo = ({ bankTransactionId }) => {
|
|
|
12209
12250
|
return /* @__PURE__ */ jsx(
|
|
12210
12251
|
InputGroup$1,
|
|
12211
12252
|
{
|
|
12212
|
-
className: "Layer__bank-transaction-memo-input-group",
|
|
12213
12253
|
name: "memo",
|
|
12214
|
-
label: "Description",
|
|
12215
12254
|
children: /* @__PURE__ */ jsx(
|
|
12216
12255
|
Textarea,
|
|
12217
12256
|
{
|
|
@@ -12393,9 +12432,9 @@ function BankTransactionFormFields({
|
|
|
12393
12432
|
if (!showTags && !showCustomerVendor && !showDescriptions) {
|
|
12394
12433
|
return null;
|
|
12395
12434
|
}
|
|
12396
|
-
return /* @__PURE__ */ jsxs(VStack, {
|
|
12397
|
-
showCustomerVendor && !hideCustomerVendor
|
|
12398
|
-
showTags && !hideTags
|
|
12435
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
|
|
12436
|
+
showCustomerVendor && !hideCustomerVendor && /* @__PURE__ */ jsx(BankTransactionCustomerVendorSelector, { bankTransaction }),
|
|
12437
|
+
showTags && !hideTags && /* @__PURE__ */ jsx(
|
|
12399
12438
|
TagDimensionsGroup,
|
|
12400
12439
|
{
|
|
12401
12440
|
value: selectedTags,
|
|
@@ -12403,8 +12442,11 @@ function BankTransactionFormFields({
|
|
|
12403
12442
|
showLabels: true,
|
|
12404
12443
|
isReadOnly
|
|
12405
12444
|
}
|
|
12406
|
-
)
|
|
12407
|
-
showDescriptions
|
|
12445
|
+
),
|
|
12446
|
+
showDescriptions && /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
12447
|
+
/* @__PURE__ */ jsx(Span, { size: "sm", weight: "bold", children: "Description" }),
|
|
12448
|
+
/* @__PURE__ */ jsx(BankTransactionMemo, { bankTransactionId: bankTransaction.id })
|
|
12449
|
+
] })
|
|
12408
12450
|
] });
|
|
12409
12451
|
}
|
|
12410
12452
|
var CategorizationType = /* @__PURE__ */ ((CategorizationType2) => {
|
|
@@ -12600,8 +12642,8 @@ const DateTime = ({
|
|
|
12600
12642
|
};
|
|
12601
12643
|
const CLASS_NAME$8 = "Layer__MoneyText";
|
|
12602
12644
|
const MoneySpan = forwardRef(
|
|
12603
|
-
(
|
|
12604
|
-
var
|
|
12645
|
+
(_yb, ref) => {
|
|
12646
|
+
var _zb = _yb, { amount, bold, size, displayPlusSign, className } = _zb, restProps = __objRest(_zb, ["amount", "bold", "size", "displayPlusSign", "className"]);
|
|
12605
12647
|
const dataProperties = toDataProperties({
|
|
12606
12648
|
bold,
|
|
12607
12649
|
"positive": amount >= 0,
|
|
@@ -12613,8 +12655,8 @@ const MoneySpan = forwardRef(
|
|
|
12613
12655
|
}
|
|
12614
12656
|
);
|
|
12615
12657
|
MoneySpan.displayName = "MoneySpan";
|
|
12616
|
-
const Scissors = (
|
|
12617
|
-
var
|
|
12658
|
+
const Scissors = (_Ab) => {
|
|
12659
|
+
var _Bb = _Ab, { size = 11 } = _Bb, props = __objRest(_Bb, ["size"]);
|
|
12618
12660
|
return /* @__PURE__ */ jsxs(
|
|
12619
12661
|
"svg",
|
|
12620
12662
|
__spreadProps(__spreadValues({
|
|
@@ -12745,21 +12787,27 @@ const Scissors = (_yb) => {
|
|
|
12745
12787
|
);
|
|
12746
12788
|
};
|
|
12747
12789
|
const BankTransactionsBaseSelectedValue = (props) => {
|
|
12748
|
-
var _a, _b, _c, _d, _e, _f;
|
|
12790
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
12749
12791
|
const { type, className, label, slotProps } = props;
|
|
12792
|
+
if (type === "placeholder") {
|
|
12793
|
+
return /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", className, children: /* @__PURE__ */ jsx(Span, { ellipsis: true, size: (_b = (_a = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _a.size) != null ? _b : "md", children: label }) });
|
|
12794
|
+
}
|
|
12750
12795
|
if (type === "match" || type === "transfer") {
|
|
12751
12796
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className, children: [
|
|
12752
12797
|
/* @__PURE__ */ jsx(Badge, { size: BadgeSize.SMALL, icon: /* @__PURE__ */ jsx(MinimizeTwo, { size: 11 }), children: type === "transfer" ? "Transfer" : "Match" }),
|
|
12753
|
-
/* @__PURE__ */ jsx(Span, { ellipsis: true, size: (
|
|
12798
|
+
/* @__PURE__ */ jsx(Span, { ellipsis: true, size: (_d = (_c = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _c.size) != null ? _d : "md", children: label })
|
|
12754
12799
|
] });
|
|
12755
12800
|
}
|
|
12756
12801
|
if (type === "split") {
|
|
12757
12802
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className, children: [
|
|
12758
12803
|
/* @__PURE__ */ jsx(Badge, { size: BadgeSize.SMALL, icon: /* @__PURE__ */ jsx(Scissors, { size: 11 }), children: "Split" }),
|
|
12759
|
-
/* @__PURE__ */ jsx(Span, { ellipsis: true, size: (
|
|
12804
|
+
/* @__PURE__ */ jsx(Span, { ellipsis: true, size: (_f = (_e = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _e.size) != null ? _f : "md", children: label })
|
|
12760
12805
|
] });
|
|
12761
12806
|
}
|
|
12762
|
-
return /* @__PURE__ */
|
|
12807
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className, children: [
|
|
12808
|
+
/* @__PURE__ */ jsx(Badge, { size: BadgeSize.SMALL, icon: /* @__PURE__ */ jsx(Layers2Icon, { size: 11 }), children: "Category" }),
|
|
12809
|
+
/* @__PURE__ */ jsx(Span, { ellipsis: true, size: (_h = (_g = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _g.size) != null ? _h : "md", children: label })
|
|
12810
|
+
] });
|
|
12763
12811
|
};
|
|
12764
12812
|
const BankTransactionsUncategorizedSelectedValue = (props) => {
|
|
12765
12813
|
const { selectedValue, className, slotProps } = props;
|
|
@@ -13213,7 +13261,8 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13213
13261
|
submitBtnText = "Save",
|
|
13214
13262
|
containerWidth,
|
|
13215
13263
|
showDescriptions,
|
|
13216
|
-
showReceiptUploads
|
|
13264
|
+
showReceiptUploads,
|
|
13265
|
+
showLeftPadding = true
|
|
13217
13266
|
}, ref) => {
|
|
13218
13267
|
const {
|
|
13219
13268
|
categorize: categorizeBankTransaction2,
|
|
@@ -13294,14 +13343,14 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13294
13343
|
});
|
|
13295
13344
|
}
|
|
13296
13345
|
};
|
|
13297
|
-
const save = () =>
|
|
13346
|
+
const save = () => {
|
|
13298
13347
|
var _a;
|
|
13299
13348
|
if (purpose === "match") {
|
|
13300
13349
|
if (!selectedMatch) {
|
|
13301
13350
|
setMatchFormError("Select an option to match the transaction");
|
|
13302
13351
|
return;
|
|
13303
13352
|
} else if (selectedMatch && selectedMatch.id !== ((_a = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a.id)) {
|
|
13304
|
-
|
|
13353
|
+
void onMatchSubmit(selectedMatch.id);
|
|
13305
13354
|
return;
|
|
13306
13355
|
}
|
|
13307
13356
|
close2();
|
|
@@ -13309,13 +13358,13 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13309
13358
|
}
|
|
13310
13359
|
if (!isValid2) return;
|
|
13311
13360
|
const categorizationRequest = buildCategorizeBankTransactionPayloadForSplit(localSplits);
|
|
13312
|
-
|
|
13361
|
+
void categorizeBankTransaction2(
|
|
13313
13362
|
bankTransaction.id,
|
|
13314
13363
|
categorizationRequest
|
|
13315
13364
|
);
|
|
13316
13365
|
deselect(bankTransaction.id);
|
|
13317
13366
|
close2();
|
|
13318
|
-
}
|
|
13367
|
+
};
|
|
13319
13368
|
useImperativeHandle(ref, () => ({
|
|
13320
13369
|
save
|
|
13321
13370
|
}));
|
|
@@ -13339,228 +13388,227 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13339
13388
|
"span",
|
|
13340
13389
|
{
|
|
13341
13390
|
className: `${className} ${className}--${isOpen ? "expanded" : "collapsed"}`,
|
|
13342
|
-
children:
|
|
13343
|
-
|
|
13344
|
-
|
|
13345
|
-
{
|
|
13346
|
-
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
{
|
|
13382
|
-
|
|
13383
|
-
bankTransaction,
|
|
13384
|
-
selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
|
|
13385
|
-
readOnly: !categorizationEnabled,
|
|
13386
|
-
setSelectedMatch: (suggestedMatch) => {
|
|
13387
|
-
setMatchFormError(void 0);
|
|
13388
|
-
setSelectedMatch(suggestedMatch);
|
|
13389
|
-
},
|
|
13390
|
-
matchFormError
|
|
13391
|
-
}
|
|
13392
|
-
) })
|
|
13393
|
-
}
|
|
13394
|
-
),
|
|
13395
|
-
/* @__PURE__ */ jsx(
|
|
13396
|
-
"div",
|
|
13397
|
-
{
|
|
13398
|
-
className: classNames(
|
|
13399
|
-
`${className}__splits`,
|
|
13400
|
-
`${className}__content-panel`,
|
|
13401
|
-
purpose === "categorize" ? `${className}__content-panel--active` : ""
|
|
13402
|
-
),
|
|
13403
|
-
children: /* @__PURE__ */ jsxs("div", { className: `${className}__content-panel-container`, children: [
|
|
13404
|
-
/* @__PURE__ */ jsx("div", { className: `${className}__splits-inputs`, children: effectiveSplits.map((split, index) => /* @__PURE__ */ jsxs(
|
|
13405
|
-
"div",
|
|
13391
|
+
children: isOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13392
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
13393
|
+
/* @__PURE__ */ jsx("span", { className: `${className}__wrapper`, ref: bodyRef, children: /* @__PURE__ */ jsxs(VStack, { pis: showLeftPadding ? "md" : void 0, pbs: "sm", children: [
|
|
13394
|
+
categorizationEnabled && /* @__PURE__ */ jsx(HStack, { pi: "md", pbe: "md", pbs: "3xs", children: /* @__PURE__ */ jsx(
|
|
13395
|
+
Toggle,
|
|
13396
|
+
{
|
|
13397
|
+
name: `purpose-${bankTransaction.id}${asListItem ? "-li" : ""}`,
|
|
13398
|
+
size: ToggleSize.small,
|
|
13399
|
+
options: [
|
|
13400
|
+
{
|
|
13401
|
+
value: "categorize",
|
|
13402
|
+
label: "Categorize"
|
|
13403
|
+
},
|
|
13404
|
+
{
|
|
13405
|
+
value: "match",
|
|
13406
|
+
label: "Match",
|
|
13407
|
+
disabled: !hasMatch(bankTransaction),
|
|
13408
|
+
disabledMessage: "We could not find matching transactions"
|
|
13409
|
+
}
|
|
13410
|
+
],
|
|
13411
|
+
selected: purpose,
|
|
13412
|
+
onChange: onChangePurpose
|
|
13413
|
+
}
|
|
13414
|
+
) }),
|
|
13415
|
+
/* @__PURE__ */ jsxs(
|
|
13416
|
+
"div",
|
|
13417
|
+
{
|
|
13418
|
+
className: `${className}__content`,
|
|
13419
|
+
id: `expanded-${bankTransaction.id}`,
|
|
13420
|
+
children: [
|
|
13421
|
+
/* @__PURE__ */ jsxs("div", { className: `${className}__content-panels`, children: [
|
|
13422
|
+
/* @__PURE__ */ jsx(
|
|
13423
|
+
"div",
|
|
13424
|
+
{
|
|
13425
|
+
className: classNames(
|
|
13426
|
+
`${className}__match`,
|
|
13427
|
+
`${className}__content-panel`,
|
|
13428
|
+
purpose === "match" ? `${className}__content-panel--active` : ""
|
|
13429
|
+
),
|
|
13430
|
+
children: /* @__PURE__ */ jsx("div", { className: `${className}__content-panel-container`, children: /* @__PURE__ */ jsx(
|
|
13431
|
+
MatchForm,
|
|
13406
13432
|
{
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
includeSuggestedMatches: false
|
|
13432
|
-
}
|
|
13433
|
-
),
|
|
13434
|
-
showTags && /* @__PURE__ */ jsx(
|
|
13435
|
-
TagDimensionsGroup,
|
|
13436
|
-
{
|
|
13437
|
-
value: split.tags,
|
|
13438
|
-
onChange: (tags) => changeTags(index, tags),
|
|
13439
|
-
showLabels: false,
|
|
13440
|
-
isReadOnly: !categorizationEnabled,
|
|
13441
|
-
className: `${className}__table-cell--split-entry__tags`
|
|
13442
|
-
}
|
|
13443
|
-
),
|
|
13444
|
-
showCustomerVendor && /* @__PURE__ */ jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__customer", children: /* @__PURE__ */ jsx(
|
|
13445
|
-
CustomerVendorSelector,
|
|
13446
|
-
{
|
|
13447
|
-
selectedCustomerVendor: split.customerVendor,
|
|
13448
|
-
onSelectedCustomerVendorChange: (customerVendor) => changeCustomerVendor(index, customerVendor),
|
|
13449
|
-
placeholder: "Set customer or vendor",
|
|
13450
|
-
isReadOnly: !categorizationEnabled,
|
|
13451
|
-
showLabel: false
|
|
13452
|
-
}
|
|
13453
|
-
) }),
|
|
13454
|
-
/* @__PURE__ */ jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__button", children: /* @__PURE__ */ jsx(
|
|
13455
|
-
Button,
|
|
13456
|
-
{
|
|
13457
|
-
onPress: () => removeSplit(index),
|
|
13458
|
-
variant: "outlined",
|
|
13459
|
-
icon: true,
|
|
13460
|
-
isDisabled: index == 0,
|
|
13461
|
-
children: /* @__PURE__ */ jsx(Trash, { size: 18 })
|
|
13462
|
-
}
|
|
13463
|
-
) })
|
|
13464
|
-
]
|
|
13465
|
-
},
|
|
13466
|
-
`split-${index}`
|
|
13467
|
-
)) }),
|
|
13468
|
-
splitFormError && /* @__PURE__ */ jsx(HStack, { pb: "sm", children: /* @__PURE__ */ jsx(ErrorText, { children: splitFormError }) }),
|
|
13469
|
-
/* @__PURE__ */ jsxs("div", { className: `${className}__total-and-btns`, children: [
|
|
13470
|
-
effectiveSplits.length > 1 && /* @__PURE__ */ jsx(
|
|
13471
|
-
Input$1,
|
|
13472
|
-
{
|
|
13473
|
-
disabled: true,
|
|
13474
|
-
leftText: "Total",
|
|
13475
|
-
inputMode: "numeric",
|
|
13476
|
-
value: `$${centsToDollars(
|
|
13477
|
-
effectiveSplits.reduce(
|
|
13478
|
-
(x, { amount }) => x + amount,
|
|
13479
|
-
0
|
|
13480
|
-
)
|
|
13481
|
-
)}`
|
|
13482
|
-
}
|
|
13483
|
-
),
|
|
13484
|
-
categorizationEnabled ? /* @__PURE__ */ jsx("div", { className: `${className}__splits-buttons`, children: effectiveSplits.length > 1 ? /* @__PURE__ */ jsx(
|
|
13485
|
-
TextButton,
|
|
13486
|
-
{
|
|
13487
|
-
onClick: addSplit,
|
|
13488
|
-
children: "Add new split"
|
|
13489
|
-
}
|
|
13490
|
-
) : /* @__PURE__ */ jsxs(
|
|
13491
|
-
Button,
|
|
13433
|
+
classNamePrefix: className,
|
|
13434
|
+
bankTransaction,
|
|
13435
|
+
selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
|
|
13436
|
+
readOnly: !categorizationEnabled,
|
|
13437
|
+
setSelectedMatch: (suggestedMatch) => {
|
|
13438
|
+
setMatchFormError(void 0);
|
|
13439
|
+
setSelectedMatch(suggestedMatch);
|
|
13440
|
+
},
|
|
13441
|
+
matchFormError
|
|
13442
|
+
}
|
|
13443
|
+
) })
|
|
13444
|
+
}
|
|
13445
|
+
),
|
|
13446
|
+
/* @__PURE__ */ jsx(
|
|
13447
|
+
"div",
|
|
13448
|
+
{
|
|
13449
|
+
className: classNames(
|
|
13450
|
+
`${className}__splits`,
|
|
13451
|
+
`${className}__content-panel`,
|
|
13452
|
+
purpose === "categorize" ? `${className}__content-panel--active` : ""
|
|
13453
|
+
),
|
|
13454
|
+
children: /* @__PURE__ */ jsxs("div", { className: `${className}__content-panel-container`, children: [
|
|
13455
|
+
/* @__PURE__ */ jsx("div", { className: `${className}__splits-inputs`, children: effectiveSplits.map((split, index) => /* @__PURE__ */ jsxs(
|
|
13456
|
+
"div",
|
|
13492
13457
|
{
|
|
13493
|
-
|
|
13494
|
-
variant: "outlined",
|
|
13458
|
+
className: `${className}__table-cell--split-entry`,
|
|
13495
13459
|
children: [
|
|
13496
|
-
/* @__PURE__ */ jsx(
|
|
13497
|
-
|
|
13460
|
+
/* @__PURE__ */ jsx(
|
|
13461
|
+
AmountInput,
|
|
13462
|
+
{
|
|
13463
|
+
name: `split-${index}${asListItem ? "-li" : ""}`,
|
|
13464
|
+
disabled: index === 0 || !categorizationEnabled,
|
|
13465
|
+
onChange: updateSplitAmount(index),
|
|
13466
|
+
value: getInputValueForSplitAtIndex(index, split),
|
|
13467
|
+
onBlur: onBlurSplitAmount,
|
|
13468
|
+
className: `${className}__table-cell--split-entry__amount`,
|
|
13469
|
+
isInvalid: split.amount < 0
|
|
13470
|
+
}
|
|
13471
|
+
),
|
|
13472
|
+
/* @__PURE__ */ jsx(
|
|
13473
|
+
BankTransactionCategoryComboBox,
|
|
13474
|
+
{
|
|
13475
|
+
bankTransaction,
|
|
13476
|
+
selectedValue: split.category,
|
|
13477
|
+
onSelectedValueChange: (value) => {
|
|
13478
|
+
changeCategoryForSplitAtIndex(index, value);
|
|
13479
|
+
},
|
|
13480
|
+
isLoading: bankTransaction.processing,
|
|
13481
|
+
isDisabled: !categorizationEnabled,
|
|
13482
|
+
includeSuggestedMatches: false
|
|
13483
|
+
}
|
|
13484
|
+
),
|
|
13485
|
+
showTags && /* @__PURE__ */ jsx(
|
|
13486
|
+
TagDimensionsGroup,
|
|
13487
|
+
{
|
|
13488
|
+
value: split.tags,
|
|
13489
|
+
onChange: (tags) => changeTags(index, tags),
|
|
13490
|
+
showLabels: false,
|
|
13491
|
+
isReadOnly: !categorizationEnabled,
|
|
13492
|
+
className: `${className}__table-cell--split-entry__tags`
|
|
13493
|
+
}
|
|
13494
|
+
),
|
|
13495
|
+
showCustomerVendor && /* @__PURE__ */ jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__customer", children: /* @__PURE__ */ jsx(
|
|
13496
|
+
CustomerVendorSelector,
|
|
13497
|
+
{
|
|
13498
|
+
selectedCustomerVendor: split.customerVendor,
|
|
13499
|
+
onSelectedCustomerVendorChange: (customerVendor) => changeCustomerVendor(index, customerVendor),
|
|
13500
|
+
placeholder: "Set customer or vendor",
|
|
13501
|
+
isReadOnly: !categorizationEnabled,
|
|
13502
|
+
showLabel: false
|
|
13503
|
+
}
|
|
13504
|
+
) }),
|
|
13505
|
+
/* @__PURE__ */ jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__button", children: /* @__PURE__ */ jsx(
|
|
13506
|
+
Button,
|
|
13507
|
+
{
|
|
13508
|
+
onPress: () => removeSplit(index),
|
|
13509
|
+
variant: "outlined",
|
|
13510
|
+
icon: true,
|
|
13511
|
+
isDisabled: index == 0,
|
|
13512
|
+
children: /* @__PURE__ */ jsx(Trash, { size: 18 })
|
|
13513
|
+
}
|
|
13514
|
+
) })
|
|
13498
13515
|
]
|
|
13499
|
-
}
|
|
13500
|
-
|
|
13516
|
+
},
|
|
13517
|
+
`split-${index}`
|
|
13518
|
+
)) }),
|
|
13519
|
+
splitFormError && /* @__PURE__ */ jsx(HStack, { pb: "sm", children: /* @__PURE__ */ jsx(ErrorText, { children: splitFormError }) }),
|
|
13520
|
+
/* @__PURE__ */ jsxs("div", { className: `${className}__total-and-btns`, children: [
|
|
13521
|
+
effectiveSplits.length > 1 && /* @__PURE__ */ jsx(
|
|
13522
|
+
Input$1,
|
|
13523
|
+
{
|
|
13524
|
+
disabled: true,
|
|
13525
|
+
leftText: "Total",
|
|
13526
|
+
inputMode: "numeric",
|
|
13527
|
+
value: `$${centsToDollars(
|
|
13528
|
+
effectiveSplits.reduce(
|
|
13529
|
+
(x, { amount }) => x + amount,
|
|
13530
|
+
0
|
|
13531
|
+
)
|
|
13532
|
+
)}`
|
|
13533
|
+
}
|
|
13534
|
+
),
|
|
13535
|
+
categorizationEnabled ? /* @__PURE__ */ jsx("div", { className: `${className}__splits-buttons`, children: effectiveSplits.length > 1 ? /* @__PURE__ */ jsx(
|
|
13536
|
+
TextButton,
|
|
13537
|
+
{
|
|
13538
|
+
onClick: addSplit,
|
|
13539
|
+
children: "Add new split"
|
|
13540
|
+
}
|
|
13541
|
+
) : /* @__PURE__ */ jsxs(
|
|
13542
|
+
Button,
|
|
13543
|
+
{
|
|
13544
|
+
onClick: addSplit,
|
|
13545
|
+
variant: "outlined",
|
|
13546
|
+
children: [
|
|
13547
|
+
/* @__PURE__ */ jsx(ScissorsFullOpen, { size: 14 }),
|
|
13548
|
+
"Split"
|
|
13549
|
+
]
|
|
13550
|
+
}
|
|
13551
|
+
) }) : /* @__PURE__ */ jsx(Fragment, {})
|
|
13552
|
+
] })
|
|
13501
13553
|
] })
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
)
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
BankTransactionFormFields,
|
|
13508
|
-
{
|
|
13509
|
-
bankTransaction,
|
|
13510
|
-
showDescriptions,
|
|
13511
|
-
hideTags: purpose === "categorize",
|
|
13512
|
-
hideCustomerVendor: purpose === "categorize"
|
|
13513
|
-
/* categorize */
|
|
13514
|
-
}
|
|
13515
|
-
),
|
|
13516
|
-
showReceiptUploads && /* @__PURE__ */ jsx(
|
|
13517
|
-
BankTransactionReceiptsWithProvider,
|
|
13518
|
-
{
|
|
13519
|
-
bankTransaction,
|
|
13520
|
-
isActive: isOpen,
|
|
13521
|
-
classNamePrefix: className,
|
|
13522
|
-
floatingActions: !asListItem
|
|
13523
|
-
}
|
|
13524
|
-
),
|
|
13525
|
-
asListItem && categorizationEnabled ? /* @__PURE__ */ jsxs("div", { className: `${className}__submit-btn`, children: [
|
|
13526
|
-
bankTransaction.error ? /* @__PURE__ */ jsxs(
|
|
13527
|
-
Text,
|
|
13554
|
+
}
|
|
13555
|
+
)
|
|
13556
|
+
] }),
|
|
13557
|
+
/* @__PURE__ */ jsx(VStack, { pis: "md", className: "Layer__ExpandedBankTransactionRow__Description", children: /* @__PURE__ */ jsx(
|
|
13558
|
+
BankTransactionFormFields,
|
|
13528
13559
|
{
|
|
13529
|
-
|
|
13530
|
-
|
|
13531
|
-
|
|
13532
|
-
|
|
13533
|
-
|
|
13534
|
-
/* @__PURE__ */ jsx(AlertCircle, { size: 12 })
|
|
13535
|
-
]
|
|
13560
|
+
bankTransaction,
|
|
13561
|
+
showDescriptions,
|
|
13562
|
+
hideTags: purpose === "categorize",
|
|
13563
|
+
hideCustomerVendor: purpose === "categorize"
|
|
13564
|
+
/* categorize */
|
|
13536
13565
|
}
|
|
13537
|
-
)
|
|
13538
|
-
/* @__PURE__ */ jsx(
|
|
13539
|
-
|
|
13566
|
+
) }),
|
|
13567
|
+
showReceiptUploads && /* @__PURE__ */ jsx(
|
|
13568
|
+
BankTransactionReceiptsWithProvider,
|
|
13540
13569
|
{
|
|
13541
|
-
|
|
13542
|
-
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
},
|
|
13546
|
-
className: "Layer__bank-transaction__submit-btn",
|
|
13547
|
-
processing: bankTransaction.processing,
|
|
13548
|
-
active: true,
|
|
13549
|
-
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
13550
|
-
children: submitBtnText
|
|
13570
|
+
bankTransaction,
|
|
13571
|
+
isActive: isOpen,
|
|
13572
|
+
classNamePrefix: className,
|
|
13573
|
+
floatingActions: !asListItem
|
|
13551
13574
|
}
|
|
13552
|
-
)
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13575
|
+
),
|
|
13576
|
+
asListItem && categorizationEnabled && /* @__PURE__ */ jsxs("div", { className: `${className}__submit-btn`, children: [
|
|
13577
|
+
bankTransaction.error && /* @__PURE__ */ jsxs(
|
|
13578
|
+
Text,
|
|
13579
|
+
{
|
|
13580
|
+
as: "span",
|
|
13581
|
+
size: TextSize.md,
|
|
13582
|
+
className: "Layer__unsaved-info",
|
|
13583
|
+
children: [
|
|
13584
|
+
/* @__PURE__ */ jsx("span", { children: "Unsaved" }),
|
|
13585
|
+
/* @__PURE__ */ jsx(AlertCircle, { size: 12 })
|
|
13586
|
+
]
|
|
13587
|
+
}
|
|
13588
|
+
),
|
|
13589
|
+
/* @__PURE__ */ jsx(
|
|
13590
|
+
SubmitButton,
|
|
13591
|
+
{
|
|
13592
|
+
onClick: save,
|
|
13593
|
+
className: "Layer__bank-transaction__submit-btn",
|
|
13594
|
+
processing: bankTransaction.processing,
|
|
13595
|
+
active: true,
|
|
13596
|
+
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
13597
|
+
children: submitBtnText
|
|
13598
|
+
}
|
|
13599
|
+
)
|
|
13600
|
+
] })
|
|
13601
|
+
]
|
|
13602
|
+
}
|
|
13603
|
+
),
|
|
13604
|
+
/* @__PURE__ */ jsx(
|
|
13605
|
+
APIErrorNotifications,
|
|
13606
|
+
{
|
|
13607
|
+
bankTransaction,
|
|
13608
|
+
containerWidth
|
|
13609
|
+
}
|
|
13610
|
+
)
|
|
13611
|
+
] }) })
|
|
13564
13612
|
] })
|
|
13565
13613
|
}
|
|
13566
13614
|
);
|
|
@@ -13687,8 +13735,8 @@ const getMonthNameFromNumber = (monthNumber) => {
|
|
|
13687
13735
|
}
|
|
13688
13736
|
return (_a = monthNames.at(monthNumber - 1)) != null ? _a : "";
|
|
13689
13737
|
};
|
|
13690
|
-
const Clock = (
|
|
13691
|
-
var
|
|
13738
|
+
const Clock = (_Cb) => {
|
|
13739
|
+
var _Db = _Cb, { size = 18 } = _Db, props = __objRest(_Db, ["size"]);
|
|
13692
13740
|
return /* @__PURE__ */ jsxs(
|
|
13693
13741
|
"svg",
|
|
13694
13742
|
__spreadProps(__spreadValues({
|
|
@@ -13971,14 +14019,14 @@ const BankTransactionRow = ({
|
|
|
13971
14019
|
__spreadProps(__spreadValues(__spreadValues({
|
|
13972
14020
|
className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
|
|
13973
14021
|
}, openRow), showReceiptDataProperties), {
|
|
13974
|
-
children: /* @__PURE__ */ jsx(
|
|
14022
|
+
children: /* @__PURE__ */ jsx(VStack, { align: "end", children: /* @__PURE__ */ jsx(
|
|
13975
14023
|
MoneySpan,
|
|
13976
14024
|
{
|
|
13977
14025
|
amount: bankTransaction.amount,
|
|
13978
14026
|
displayPlusSign: isCredit(bankTransaction),
|
|
13979
14027
|
className: "Layer__table-cell-content"
|
|
13980
14028
|
}
|
|
13981
|
-
)
|
|
14029
|
+
) })
|
|
13982
14030
|
})
|
|
13983
14031
|
),
|
|
13984
14032
|
/* @__PURE__ */ jsx(
|
|
@@ -13999,7 +14047,7 @@ const BankTransactionRow = ({
|
|
|
13999
14047
|
`${className}__actions-cell--${open ? "open" : "close"}`
|
|
14000
14048
|
),
|
|
14001
14049
|
children: open ? /* @__PURE__ */ jsxs(HStack, { pie: "md", gap: "md", justify: "end", className: "Layer__bank-transaction-row__category-open", children: [
|
|
14002
|
-
bankTransaction.error
|
|
14050
|
+
bankTransaction.error && /* @__PURE__ */ jsxs(
|
|
14003
14051
|
Text,
|
|
14004
14052
|
{
|
|
14005
14053
|
as: "span",
|
|
@@ -14010,8 +14058,8 @@ const BankTransactionRow = ({
|
|
|
14010
14058
|
/* @__PURE__ */ jsx(AlertCircle, { size: 12 })
|
|
14011
14059
|
]
|
|
14012
14060
|
}
|
|
14013
|
-
)
|
|
14014
|
-
categorizationEnabled
|
|
14061
|
+
),
|
|
14062
|
+
categorizationEnabled && /* @__PURE__ */ jsx(
|
|
14015
14063
|
SubmitButton,
|
|
14016
14064
|
{
|
|
14017
14065
|
onClick: () => {
|
|
@@ -14025,8 +14073,8 @@ const BankTransactionRow = ({
|
|
|
14025
14073
|
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
14026
14074
|
children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
|
|
14027
14075
|
}
|
|
14028
|
-
)
|
|
14029
|
-
!categorizationEnabled && !categorized
|
|
14076
|
+
),
|
|
14077
|
+
!categorizationEnabled && !categorized && /* @__PURE__ */ jsx(VStack, { children: /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, {}) }),
|
|
14030
14078
|
/* @__PURE__ */ jsx(
|
|
14031
14079
|
IconButton,
|
|
14032
14080
|
{
|
|
@@ -14042,26 +14090,36 @@ const BankTransactionRow = ({
|
|
|
14042
14090
|
}
|
|
14043
14091
|
)
|
|
14044
14092
|
] }) : /* @__PURE__ */ jsxs(HStack, { pi: "md", gap: "md", className: "Layer__bank-transaction-row__category-hstack", children: [
|
|
14045
|
-
|
|
14046
|
-
|
|
14093
|
+
/* @__PURE__ */ jsx(
|
|
14094
|
+
AnimatedContent,
|
|
14047
14095
|
{
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14096
|
+
variant: "fade",
|
|
14097
|
+
isOpen: categorizationEnabled && !categorized,
|
|
14098
|
+
className: "Layer__BankTransactionRow__CategoryComboBoxMotionContent",
|
|
14099
|
+
slotProps: { AnimatePresence: { mode: "wait" } },
|
|
14100
|
+
children: /* @__PURE__ */ jsx(
|
|
14101
|
+
BankTransactionCategoryComboBox,
|
|
14102
|
+
{
|
|
14103
|
+
bankTransaction,
|
|
14104
|
+
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
14105
|
+
onSelectedValueChange: (selectedCategory2) => {
|
|
14106
|
+
setTransactionCategory(bankTransaction.id, selectedCategory2);
|
|
14107
|
+
setShowRetry(false);
|
|
14108
|
+
},
|
|
14109
|
+
isLoading: bankTransaction.processing
|
|
14110
|
+
}
|
|
14111
|
+
)
|
|
14112
|
+
},
|
|
14113
|
+
"category-combobox"
|
|
14114
|
+
),
|
|
14115
|
+
categorized && /* @__PURE__ */ jsx(
|
|
14058
14116
|
BankTransactionsCategorizedSelectedValue,
|
|
14059
14117
|
{
|
|
14060
14118
|
bankTransaction,
|
|
14061
14119
|
className: "Layer__bank-transaction-row__category"
|
|
14062
14120
|
}
|
|
14063
|
-
)
|
|
14064
|
-
categorizationEnabled && !categorized && showRetry
|
|
14121
|
+
),
|
|
14122
|
+
categorizationEnabled && !categorized && showRetry && /* @__PURE__ */ jsx(
|
|
14065
14123
|
RetryButton,
|
|
14066
14124
|
{
|
|
14067
14125
|
onClick: () => {
|
|
@@ -14074,8 +14132,8 @@ const BankTransactionRow = ({
|
|
|
14074
14132
|
error: "Approval failed. Check connection and retry in few seconds.",
|
|
14075
14133
|
children: "Retry"
|
|
14076
14134
|
}
|
|
14077
|
-
)
|
|
14078
|
-
!categorized && categorizationEnabled && !showRetry
|
|
14135
|
+
),
|
|
14136
|
+
!categorized && categorizationEnabled && !showRetry && /* @__PURE__ */ jsx(
|
|
14079
14137
|
SubmitButton,
|
|
14080
14138
|
{
|
|
14081
14139
|
onClick: () => {
|
|
@@ -14089,8 +14147,8 @@ const BankTransactionRow = ({
|
|
|
14089
14147
|
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
14090
14148
|
children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
|
|
14091
14149
|
}
|
|
14092
|
-
)
|
|
14093
|
-
!categorizationEnabled && !categorized
|
|
14150
|
+
),
|
|
14151
|
+
!categorizationEnabled && !categorized && /* @__PURE__ */ jsx(VStack, { pis: "xs", fluid: true, children: /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, {}) }),
|
|
14094
14152
|
/* @__PURE__ */ jsx(
|
|
14095
14153
|
IconButton,
|
|
14096
14154
|
{
|
|
@@ -14109,7 +14167,7 @@ const BankTransactionRow = ({
|
|
|
14109
14167
|
}
|
|
14110
14168
|
)
|
|
14111
14169
|
] }),
|
|
14112
|
-
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, className: "Layer__bank-transaction-row__expanded-td", children: /* @__PURE__ */ jsx(
|
|
14170
|
+
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, className: "Layer__bank-transaction-row__expanded-td", children: /* @__PURE__ */ jsx(AnimatedContent, { variant: "expand", isOpen: open, children: /* @__PURE__ */ jsx(
|
|
14113
14171
|
ExpandedBankTransactionRow,
|
|
14114
14172
|
{
|
|
14115
14173
|
ref: expandedRowRef,
|
|
@@ -14122,7 +14180,7 @@ const BankTransactionRow = ({
|
|
|
14122
14180
|
showReceiptUploads,
|
|
14123
14181
|
showTooltips
|
|
14124
14182
|
}
|
|
14125
|
-
) }) })
|
|
14183
|
+
) }, `expanded-${bankTransaction.id}`) }) })
|
|
14126
14184
|
] });
|
|
14127
14185
|
};
|
|
14128
14186
|
const BankTransactionsCategorizedSelectedValue = (props) => {
|
|
@@ -14149,36 +14207,37 @@ const normalizeFromBankTransaction = (bankTransaction) => {
|
|
|
14149
14207
|
label: (_e = (_d = bankTransaction.category) == null ? void 0 : _d.display_name) != null ? _e : ""
|
|
14150
14208
|
};
|
|
14151
14209
|
};
|
|
14152
|
-
const
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14210
|
+
const BankTransactionsListItemCategory = ({
|
|
14211
|
+
bankTransaction,
|
|
14212
|
+
mobile = false
|
|
14213
|
+
}) => {
|
|
14214
|
+
const className = mobile ? "Layer__bankTransactionsListItemCategory__Mobile" : "Layer__bankTransactionsListItemCategory__List";
|
|
14215
|
+
const categorized = isCategorized(bankTransaction);
|
|
14216
|
+
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
14217
|
+
if (categorized) {
|
|
14218
|
+
return /* @__PURE__ */ jsx(
|
|
14219
|
+
BankTransactionsCategorizedSelectedValue,
|
|
14220
|
+
{
|
|
14221
|
+
bankTransaction,
|
|
14222
|
+
className,
|
|
14223
|
+
slotProps: { Label: { size: "sm" } }
|
|
14224
|
+
}
|
|
14225
|
+
);
|
|
14226
|
+
}
|
|
14227
|
+
return selectedCategory ? /* @__PURE__ */ jsx(
|
|
14228
|
+
BankTransactionsUncategorizedSelectedValue,
|
|
14156
14229
|
{
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
DateTime,
|
|
14169
|
-
{
|
|
14170
|
-
value: date,
|
|
14171
|
-
dateFormat: DATE_FORMAT,
|
|
14172
|
-
onlyDate: true,
|
|
14173
|
-
slotProps: {
|
|
14174
|
-
Date: __spreadValues({
|
|
14175
|
-
variant: "subtle",
|
|
14176
|
-
size: "sm"
|
|
14177
|
-
}, slotProps == null ? void 0 : slotProps.DateTime)
|
|
14178
|
-
}
|
|
14179
|
-
}
|
|
14180
|
-
)
|
|
14181
|
-
]
|
|
14230
|
+
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
14231
|
+
className,
|
|
14232
|
+
slotProps: { Label: { size: "sm" } }
|
|
14233
|
+
}
|
|
14234
|
+
) : /* @__PURE__ */ jsx(
|
|
14235
|
+
BankTransactionsBaseSelectedValue,
|
|
14236
|
+
{
|
|
14237
|
+
type: "placeholder",
|
|
14238
|
+
label: "No category selected",
|
|
14239
|
+
className,
|
|
14240
|
+
slotProps: { Label: { size: "sm" } }
|
|
14182
14241
|
}
|
|
14183
14242
|
);
|
|
14184
14243
|
};
|
|
@@ -14236,6 +14295,9 @@ const BankTransactionsListItem = ({
|
|
|
14236
14295
|
deselect(bankTransaction.id);
|
|
14237
14296
|
setOpenExpandedRow(false);
|
|
14238
14297
|
});
|
|
14298
|
+
const handleSave = () => {
|
|
14299
|
+
void save();
|
|
14300
|
+
};
|
|
14239
14301
|
const openClassName = openExpandedRow ? "Layer__bank-transaction-list-item--expanded" : "";
|
|
14240
14302
|
const rowClassName = classNames(
|
|
14241
14303
|
"Layer__bank-transaction-list-item",
|
|
@@ -14290,19 +14352,16 @@ const BankTransactionsListItem = ({
|
|
|
14290
14352
|
/* @__PURE__ */ jsx(Span, { withTooltip: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description })
|
|
14291
14353
|
] }),
|
|
14292
14354
|
/* @__PURE__ */ jsx(
|
|
14293
|
-
|
|
14355
|
+
MoneySpan,
|
|
14294
14356
|
{
|
|
14295
14357
|
amount: bankTransaction.amount,
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
MoneySpan: { size: "md", displayPlusSign: isCredit(bankTransaction) },
|
|
14299
|
-
DateTime: { size: "sm" }
|
|
14300
|
-
}
|
|
14358
|
+
displayPlusSign: isCredit(bankTransaction),
|
|
14359
|
+
size: "md"
|
|
14301
14360
|
}
|
|
14302
14361
|
)
|
|
14303
14362
|
] }),
|
|
14304
|
-
!categorizationEnabled && !categorized
|
|
14305
|
-
/* @__PURE__ */ jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", children: /* @__PURE__ */ jsx(
|
|
14363
|
+
!categorizationEnabled && !categorized && /* @__PURE__ */ jsx("span", { className: "Layer__bank-transaction-list-item__processing-info", children: /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, {}) }),
|
|
14364
|
+
/* @__PURE__ */ jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", children: /* @__PURE__ */ jsx(AnimatedContent, { variant: "expand", isOpen: openExpandedRow, children: /* @__PURE__ */ jsx(
|
|
14306
14365
|
ExpandedBankTransactionRow,
|
|
14307
14366
|
{
|
|
14308
14367
|
ref: expandedRowRef,
|
|
@@ -14315,11 +14374,12 @@ const BankTransactionsListItem = ({
|
|
|
14315
14374
|
containerWidth,
|
|
14316
14375
|
showDescriptions,
|
|
14317
14376
|
showReceiptUploads,
|
|
14318
|
-
showTooltips
|
|
14377
|
+
showTooltips,
|
|
14378
|
+
showLeftPadding: false
|
|
14319
14379
|
}
|
|
14320
|
-
) }),
|
|
14321
|
-
/* @__PURE__ */ jsxs("
|
|
14322
|
-
|
|
14380
|
+
) }, `expanded-${bankTransaction.id}`) }),
|
|
14381
|
+
!openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
|
|
14382
|
+
/* @__PURE__ */ jsx(
|
|
14323
14383
|
BankTransactionCategoryComboBox,
|
|
14324
14384
|
{
|
|
14325
14385
|
bankTransaction,
|
|
@@ -14330,47 +14390,36 @@ const BankTransactionsListItem = ({
|
|
|
14330
14390
|
},
|
|
14331
14391
|
isLoading: bankTransaction.processing
|
|
14332
14392
|
}
|
|
14333
|
-
)
|
|
14334
|
-
|
|
14335
|
-
{
|
|
14336
|
-
bankTransaction
|
|
14337
|
-
}
|
|
14338
|
-
) : selectedCategory ? /* @__PURE__ */ jsx(
|
|
14339
|
-
BankTransactionsUncategorizedSelectedValue,
|
|
14340
|
-
{
|
|
14341
|
-
selectedValue: selectedCategory
|
|
14342
|
-
}
|
|
14343
|
-
) : null,
|
|
14344
|
-
categorizationEnabled && !categorized && !showRetry ? /* @__PURE__ */ jsx(
|
|
14393
|
+
),
|
|
14394
|
+
!showRetry && /* @__PURE__ */ jsx(
|
|
14345
14395
|
SubmitButton,
|
|
14346
14396
|
{
|
|
14347
|
-
|
|
14348
|
-
|
|
14349
|
-
void save();
|
|
14350
|
-
}
|
|
14351
|
-
},
|
|
14397
|
+
disabled: bankTransaction.processing,
|
|
14398
|
+
onClick: handleSave,
|
|
14352
14399
|
className: "Layer__bank-transaction__submit-btn",
|
|
14353
14400
|
processing: bankTransaction.processing,
|
|
14354
14401
|
action: !categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
14355
14402
|
children: !categorized ? (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Approve" : (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update"
|
|
14356
14403
|
}
|
|
14357
|
-
)
|
|
14358
|
-
|
|
14404
|
+
),
|
|
14405
|
+
showRetry && /* @__PURE__ */ jsx(
|
|
14359
14406
|
RetryButton,
|
|
14360
14407
|
{
|
|
14361
|
-
onClick:
|
|
14362
|
-
if (!bankTransaction.processing) {
|
|
14363
|
-
void save();
|
|
14364
|
-
}
|
|
14365
|
-
},
|
|
14408
|
+
onClick: handleSave,
|
|
14366
14409
|
className: "Layer__bank-transaction__retry-btn",
|
|
14367
14410
|
processing: bankTransaction.processing,
|
|
14368
14411
|
error: "Approval failed. Check connection and retry in few seconds.",
|
|
14369
14412
|
children: "Retry"
|
|
14370
14413
|
}
|
|
14371
|
-
)
|
|
14414
|
+
)
|
|
14372
14415
|
] }),
|
|
14373
|
-
|
|
14416
|
+
!openExpandedRow && categorizationEnabled && categorized && /* @__PURE__ */ jsx(
|
|
14417
|
+
BankTransactionsListItemCategory,
|
|
14418
|
+
{
|
|
14419
|
+
bankTransaction
|
|
14420
|
+
}
|
|
14421
|
+
),
|
|
14422
|
+
bankTransaction.error && showRetry && /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
14374
14423
|
] });
|
|
14375
14424
|
};
|
|
14376
14425
|
const useBankTransactionsTableCheckboxState = ({ bankTransactions }) => {
|
|
@@ -14519,32 +14568,8 @@ const BankTransactionsMobileListItemCheckbox = ({
|
|
|
14519
14568
|
}
|
|
14520
14569
|
) });
|
|
14521
14570
|
};
|
|
14522
|
-
const
|
|
14523
|
-
|
|
14524
|
-
}) => {
|
|
14525
|
-
const categorized = isCategorized(bankTransaction);
|
|
14526
|
-
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
14527
|
-
if (categorized) {
|
|
14528
|
-
return /* @__PURE__ */ jsx(
|
|
14529
|
-
BankTransactionsCategorizedSelectedValue,
|
|
14530
|
-
{
|
|
14531
|
-
bankTransaction,
|
|
14532
|
-
className: "Layer__bankTransactionsMobileListItemCategory",
|
|
14533
|
-
slotProps: { Label: { size: "sm" } }
|
|
14534
|
-
}
|
|
14535
|
-
);
|
|
14536
|
-
}
|
|
14537
|
-
return selectedCategory ? /* @__PURE__ */ jsx(
|
|
14538
|
-
BankTransactionsUncategorizedSelectedValue,
|
|
14539
|
-
{
|
|
14540
|
-
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
14541
|
-
className: "Layer__bankTransactionsMobileListItemCategory",
|
|
14542
|
-
slotProps: { Label: { size: "sm" } }
|
|
14543
|
-
}
|
|
14544
|
-
) : /* @__PURE__ */ jsx(Span, { ellipsis: true, className: "Layer__bankTransactionsMobileListItemCategory", size: "sm", children: "No category selected" });
|
|
14545
|
-
};
|
|
14546
|
-
const Paperclip = (_Cb) => {
|
|
14547
|
-
var _Db = _Cb, { size = 20 } = _Db, props = __objRest(_Db, ["size"]);
|
|
14571
|
+
const Paperclip = (_Eb) => {
|
|
14572
|
+
var _Fb = _Eb, { size = 20 } = _Fb, props = __objRest(_Fb, ["size"]);
|
|
14548
14573
|
return /* @__PURE__ */ jsx(
|
|
14549
14574
|
"svg",
|
|
14550
14575
|
__spreadProps(__spreadValues({
|
|
@@ -14566,6 +14591,73 @@ const Paperclip = (_Cb) => {
|
|
|
14566
14591
|
})
|
|
14567
14592
|
);
|
|
14568
14593
|
};
|
|
14594
|
+
const BusinessFormMobileItem = ({
|
|
14595
|
+
option
|
|
14596
|
+
}) => {
|
|
14597
|
+
const value = option.value.value;
|
|
14598
|
+
const label = option.value.label;
|
|
14599
|
+
return /* @__PURE__ */ jsx(
|
|
14600
|
+
GridListItem,
|
|
14601
|
+
{
|
|
14602
|
+
id: value,
|
|
14603
|
+
textValue: label,
|
|
14604
|
+
className: "Layer__BusinessFormMobileItem",
|
|
14605
|
+
children: /* @__PURE__ */ jsxs(HStack, { gap: "md", pi: "md", pb: "sm", children: [
|
|
14606
|
+
!option.asLink && /* @__PURE__ */ jsx(
|
|
14607
|
+
Checkbox,
|
|
14608
|
+
{
|
|
14609
|
+
slot: "selection",
|
|
14610
|
+
variant: "round"
|
|
14611
|
+
}
|
|
14612
|
+
),
|
|
14613
|
+
/* @__PURE__ */ jsx(Span, { size: "sm", children: label }),
|
|
14614
|
+
option.asLink && /* @__PURE__ */ jsx(
|
|
14615
|
+
ChevronRight,
|
|
14616
|
+
{
|
|
14617
|
+
size: 16,
|
|
14618
|
+
className: "Layer__BusinessFormMobileItem__link-icon"
|
|
14619
|
+
}
|
|
14620
|
+
)
|
|
14621
|
+
] })
|
|
14622
|
+
},
|
|
14623
|
+
value
|
|
14624
|
+
);
|
|
14625
|
+
};
|
|
14626
|
+
const BusinessFormMobile = ({
|
|
14627
|
+
options: options2,
|
|
14628
|
+
selectedId,
|
|
14629
|
+
onSelect,
|
|
14630
|
+
readOnly
|
|
14631
|
+
}) => {
|
|
14632
|
+
const handleSelectionChange = useCallback((keys) => {
|
|
14633
|
+
if (readOnly) return;
|
|
14634
|
+
const selectedKey = [...keys][0];
|
|
14635
|
+
const selectedOption = options2.find((opt) => opt.value.value === selectedKey);
|
|
14636
|
+
if (selectedOption) {
|
|
14637
|
+
onSelect(selectedOption);
|
|
14638
|
+
}
|
|
14639
|
+
}, [options2, onSelect, readOnly]);
|
|
14640
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
14641
|
+
/* @__PURE__ */ jsx(Span, { size: "sm", weight: "bold", children: "Select category" }),
|
|
14642
|
+
/* @__PURE__ */ jsx(
|
|
14643
|
+
GridList,
|
|
14644
|
+
{
|
|
14645
|
+
"aria-label": "Select a category",
|
|
14646
|
+
selectionMode: "single",
|
|
14647
|
+
selectedKeys: selectedId ? /* @__PURE__ */ new Set([selectedId]) : /* @__PURE__ */ new Set(),
|
|
14648
|
+
onSelectionChange: handleSelectionChange,
|
|
14649
|
+
className: "Layer__BusinessFormMobile",
|
|
14650
|
+
children: options2.map((option) => /* @__PURE__ */ jsx(
|
|
14651
|
+
BusinessFormMobileItem,
|
|
14652
|
+
{
|
|
14653
|
+
option
|
|
14654
|
+
},
|
|
14655
|
+
option.value.value
|
|
14656
|
+
))
|
|
14657
|
+
}
|
|
14658
|
+
)
|
|
14659
|
+
] });
|
|
14660
|
+
};
|
|
14569
14661
|
const ActionableList = ({
|
|
14570
14662
|
options: options2,
|
|
14571
14663
|
onClick,
|
|
@@ -14639,8 +14731,8 @@ const flattenCategories = (categories) => {
|
|
|
14639
14731
|
return leafCategories.map((cat) => new CategoryAsOption(cat));
|
|
14640
14732
|
});
|
|
14641
14733
|
};
|
|
14642
|
-
const X = (
|
|
14643
|
-
var
|
|
14734
|
+
const X = (_Gb) => {
|
|
14735
|
+
var _Hb = _Gb, { size = 18 } = _Hb, props = __objRest(_Hb, ["size"]);
|
|
14644
14736
|
return /* @__PURE__ */ jsxs(
|
|
14645
14737
|
"svg",
|
|
14646
14738
|
__spreadProps(__spreadValues({
|
|
@@ -14674,11 +14766,11 @@ const X = (_Eb) => {
|
|
|
14674
14766
|
);
|
|
14675
14767
|
};
|
|
14676
14768
|
const CLASS_NAME$7 = "Layer__MinimalSearchField";
|
|
14677
|
-
function MinimalSearchField(
|
|
14678
|
-
var
|
|
14769
|
+
function MinimalSearchField(_Ib) {
|
|
14770
|
+
var _Jb = _Ib, {
|
|
14679
14771
|
placeholder,
|
|
14680
14772
|
isDisabled
|
|
14681
|
-
} =
|
|
14773
|
+
} = _Jb, restProps = __objRest(_Jb, [
|
|
14682
14774
|
"placeholder",
|
|
14683
14775
|
"isDisabled"
|
|
14684
14776
|
]);
|
|
@@ -14694,8 +14786,8 @@ function MinimalSearchField(_Gb) {
|
|
|
14694
14786
|
] }));
|
|
14695
14787
|
}
|
|
14696
14788
|
const CLASS_NAME$6 = "Layer__SearchField";
|
|
14697
|
-
function SearchField(
|
|
14698
|
-
var
|
|
14789
|
+
function SearchField(_Kb) {
|
|
14790
|
+
var _Lb = _Kb, { slot = "search", className, label, isDisabled } = _Lb, restProps = __objRest(_Lb, ["slot", "className", "label", "isDisabled"]);
|
|
14699
14791
|
const combinedClassName = classNames(CLASS_NAME$6, className);
|
|
14700
14792
|
return /* @__PURE__ */ jsxs(InputGroup, { slot, className: combinedClassName, children: [
|
|
14701
14793
|
/* @__PURE__ */ jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsx(Search, { size: 14 }) }),
|
|
@@ -14798,6 +14890,10 @@ const CategorySelectDrawer = ({
|
|
|
14798
14890
|
}
|
|
14799
14891
|
) });
|
|
14800
14892
|
};
|
|
14893
|
+
const SELECT_CATEGORY_VALUE = "SELECT_CATEGORY";
|
|
14894
|
+
const isSelectCategoryOption = (value) => {
|
|
14895
|
+
return isPlaceholderAsOption(value) && value.value === SELECT_CATEGORY_VALUE;
|
|
14896
|
+
};
|
|
14801
14897
|
const BankTransactionsMobileListBusinessForm = ({
|
|
14802
14898
|
bankTransaction,
|
|
14803
14899
|
showCategorization,
|
|
@@ -14807,6 +14903,17 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
14807
14903
|
}) => {
|
|
14808
14904
|
const receiptsRef = useRef(null);
|
|
14809
14905
|
const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
14906
|
+
const [sessionCategories, setSessionCategories] = useState(() => {
|
|
14907
|
+
var _a;
|
|
14908
|
+
const initialMap = /* @__PURE__ */ new Map();
|
|
14909
|
+
if (((_a = bankTransaction == null ? void 0 : bankTransaction.categorization_flow) == null ? void 0 : _a.type) === CategorizationType.ASK_FROM_SUGGESTIONS) {
|
|
14910
|
+
bankTransaction.categorization_flow.suggestions.forEach((suggestion) => {
|
|
14911
|
+
const opt = new ApiCategorizationAsOption(suggestion);
|
|
14912
|
+
initialMap.set(opt.value, opt);
|
|
14913
|
+
});
|
|
14914
|
+
}
|
|
14915
|
+
return initialMap;
|
|
14916
|
+
});
|
|
14810
14917
|
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
14811
14918
|
const { setTransactionCategory } = useBankTransactionsCategoryActions();
|
|
14812
14919
|
const [showRetry, setShowRetry] = useState(false);
|
|
@@ -14817,42 +14924,26 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
14817
14924
|
}
|
|
14818
14925
|
}, [bankTransaction.error]);
|
|
14819
14926
|
const options2 = useMemo(() => {
|
|
14820
|
-
|
|
14821
|
-
|
|
14822
|
-
|
|
14823
|
-
|
|
14824
|
-
|
|
14825
|
-
label:
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
}) : [];
|
|
14831
|
-
if (selectedCategory && !options22.find((x) => x.id === selectedCategory.value)) {
|
|
14832
|
-
options22.unshift({
|
|
14833
|
-
label: selectedCategory.label,
|
|
14834
|
-
id: selectedCategory.value,
|
|
14835
|
-
value: selectedCategory
|
|
14836
|
-
});
|
|
14837
|
-
}
|
|
14838
|
-
if (options22.length) {
|
|
14839
|
-
options22.push({
|
|
14840
|
-
label: "See all categories",
|
|
14841
|
-
id: "SELECT_CATEGORY",
|
|
14842
|
-
value: {
|
|
14843
|
-
type: "SELECT_CATEGORY"
|
|
14844
|
-
},
|
|
14845
|
-
secondary: true,
|
|
14846
|
-
asLink: true
|
|
14847
|
-
});
|
|
14848
|
-
}
|
|
14927
|
+
const options22 = Array.from(sessionCategories.values()).map((category) => ({
|
|
14928
|
+
value: category
|
|
14929
|
+
}));
|
|
14930
|
+
options22.push({
|
|
14931
|
+
value: new PlaceholderAsOption({
|
|
14932
|
+
label: "Show all categories",
|
|
14933
|
+
value: "SELECT_CATEGORY"
|
|
14934
|
+
}),
|
|
14935
|
+
asLink: true
|
|
14936
|
+
});
|
|
14849
14937
|
return options22;
|
|
14850
|
-
}, [
|
|
14938
|
+
}, [sessionCategories]);
|
|
14851
14939
|
const onCategorySelect = (category) => {
|
|
14852
|
-
if (
|
|
14940
|
+
if (isSelectCategoryOption(category.value)) {
|
|
14853
14941
|
setIsDrawerOpen(true);
|
|
14854
14942
|
} else {
|
|
14855
14943
|
const option = category.value;
|
|
14944
|
+
if (!isPlaceholderAsOption(option)) {
|
|
14945
|
+
setSessionCategories((prev) => new Map(prev).set(option.value, option));
|
|
14946
|
+
}
|
|
14856
14947
|
if (selectedCategory && option.value === selectedCategory.value) {
|
|
14857
14948
|
setTransactionCategory(bankTransaction.id, null);
|
|
14858
14949
|
} else {
|
|
@@ -14875,22 +14966,28 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
14875
14966
|
true
|
|
14876
14967
|
);
|
|
14877
14968
|
};
|
|
14969
|
+
const onDrawerSelect = useCallback((category) => {
|
|
14970
|
+
if (!category) return;
|
|
14971
|
+
setSessionCategories((prev) => new Map(prev).set(category.value, category));
|
|
14972
|
+
setTransactionCategory(bankTransaction.id, category);
|
|
14973
|
+
}, [bankTransaction.id, setTransactionCategory]);
|
|
14878
14974
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14879
|
-
/* @__PURE__ */ jsxs(
|
|
14880
|
-
showCategorization
|
|
14881
|
-
|
|
14975
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
14976
|
+
showCategorization && /* @__PURE__ */ jsx(
|
|
14977
|
+
BusinessFormMobile,
|
|
14882
14978
|
{
|
|
14883
14979
|
options: options2,
|
|
14884
|
-
|
|
14885
|
-
selectedId: selectedCategory == null ? void 0 : selectedCategory.value
|
|
14886
|
-
showDescriptions: showTooltips
|
|
14980
|
+
onSelect: onCategorySelect,
|
|
14981
|
+
selectedId: selectedCategory == null ? void 0 : selectedCategory.value
|
|
14887
14982
|
}
|
|
14888
|
-
)
|
|
14983
|
+
),
|
|
14889
14984
|
/* @__PURE__ */ jsx(
|
|
14890
14985
|
BankTransactionFormFields,
|
|
14891
14986
|
{
|
|
14892
14987
|
bankTransaction,
|
|
14893
|
-
showDescriptions
|
|
14988
|
+
showDescriptions,
|
|
14989
|
+
hideCustomerVendor: true,
|
|
14990
|
+
hideTags: true
|
|
14894
14991
|
}
|
|
14895
14992
|
),
|
|
14896
14993
|
/* @__PURE__ */ jsx(
|
|
@@ -14911,7 +15008,7 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
14911
15008
|
)
|
|
14912
15009
|
}
|
|
14913
15010
|
),
|
|
14914
|
-
/* @__PURE__ */ jsxs(
|
|
15011
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
|
|
14915
15012
|
showReceiptUploads && /* @__PURE__ */ jsx(
|
|
14916
15013
|
FileInput,
|
|
14917
15014
|
{
|
|
@@ -14924,33 +15021,22 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
14924
15021
|
icon: /* @__PURE__ */ jsx(Paperclip, {})
|
|
14925
15022
|
}
|
|
14926
15023
|
),
|
|
14927
|
-
|
|
14928
|
-
Button
|
|
14929
|
-
{
|
|
14930
|
-
onClick: () => {
|
|
14931
|
-
setIsDrawerOpen(true);
|
|
14932
|
-
},
|
|
14933
|
-
fullWidth: true,
|
|
14934
|
-
variant: ButtonVariant.secondary,
|
|
14935
|
-
children: "Select category"
|
|
14936
|
-
}
|
|
14937
|
-
) : null,
|
|
14938
|
-
showCategorization && options2.length > 0 ? /* @__PURE__ */ jsx(
|
|
14939
|
-
Button$1,
|
|
15024
|
+
showCategorization && sessionCategories.size > 0 && /* @__PURE__ */ jsx(
|
|
15025
|
+
Button,
|
|
14940
15026
|
{
|
|
14941
15027
|
onClick: save,
|
|
14942
|
-
disabled: !selectedCategory || isLoading || bankTransaction.processing,
|
|
14943
15028
|
fullWidth: true,
|
|
14944
|
-
|
|
15029
|
+
isDisabled: !selectedCategory || isLoading || bankTransaction.processing,
|
|
15030
|
+
children: bankTransaction.processing || isLoading ? "Confirming..." : "Confirm"
|
|
14945
15031
|
}
|
|
14946
|
-
)
|
|
15032
|
+
)
|
|
14947
15033
|
] }),
|
|
14948
15034
|
bankTransaction.error && showRetry ? /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
14949
15035
|
] }),
|
|
14950
15036
|
/* @__PURE__ */ jsx(
|
|
14951
15037
|
CategorySelectDrawer,
|
|
14952
15038
|
{
|
|
14953
|
-
onSelect:
|
|
15039
|
+
onSelect: onDrawerSelect,
|
|
14954
15040
|
selectedId: selectedCategory == null ? void 0 : selectedCategory.value,
|
|
14955
15041
|
showTooltips,
|
|
14956
15042
|
isOpen: isDrawerOpen,
|
|
@@ -15005,12 +15091,14 @@ const BankTransactionsMobileListPersonalForm = ({
|
|
|
15005
15091
|
);
|
|
15006
15092
|
};
|
|
15007
15093
|
const alreadyAssigned = isAlreadyAssigned(bankTransaction);
|
|
15008
|
-
return /* @__PURE__ */ jsxs(
|
|
15094
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
15009
15095
|
/* @__PURE__ */ jsx(
|
|
15010
15096
|
BankTransactionFormFields,
|
|
15011
15097
|
{
|
|
15012
15098
|
bankTransaction,
|
|
15013
|
-
showDescriptions
|
|
15099
|
+
showDescriptions,
|
|
15100
|
+
hideCustomerVendor: true,
|
|
15101
|
+
hideTags: true
|
|
15014
15102
|
}
|
|
15015
15103
|
),
|
|
15016
15104
|
/* @__PURE__ */ jsx(
|
|
@@ -15031,7 +15119,7 @@ const BankTransactionsMobileListPersonalForm = ({
|
|
|
15031
15119
|
)
|
|
15032
15120
|
}
|
|
15033
15121
|
),
|
|
15034
|
-
/* @__PURE__ */ jsxs(
|
|
15122
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
|
|
15035
15123
|
showReceiptUploads && /* @__PURE__ */ jsx(
|
|
15036
15124
|
FileInput,
|
|
15037
15125
|
{
|
|
@@ -15044,34 +15132,70 @@ const BankTransactionsMobileListPersonalForm = ({
|
|
|
15044
15132
|
icon: /* @__PURE__ */ jsx(Paperclip, {})
|
|
15045
15133
|
}
|
|
15046
15134
|
),
|
|
15047
|
-
showCategorization
|
|
15048
|
-
Button
|
|
15135
|
+
showCategorization && /* @__PURE__ */ jsx(
|
|
15136
|
+
Button,
|
|
15049
15137
|
{
|
|
15050
15138
|
fullWidth: true,
|
|
15051
|
-
disabled: alreadyAssigned || isLoading || bankTransaction.processing,
|
|
15052
15139
|
onClick: save,
|
|
15053
|
-
|
|
15140
|
+
isDisabled: alreadyAssigned || isLoading || bankTransaction.processing,
|
|
15141
|
+
children: bankTransaction.processing || isLoading ? "Confirming..." : alreadyAssigned ? "Confirmed" : "Mark as Personal"
|
|
15054
15142
|
}
|
|
15055
|
-
)
|
|
15143
|
+
)
|
|
15056
15144
|
] }),
|
|
15057
15145
|
bankTransaction.error && showRetry ? /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
15058
15146
|
] });
|
|
15059
15147
|
};
|
|
15148
|
+
const DATE_FORMAT = "LLL d";
|
|
15149
|
+
const BankTransactionsAmountDate = ({ amount, date, slotProps }) => {
|
|
15150
|
+
return /* @__PURE__ */ jsxs(
|
|
15151
|
+
VStack,
|
|
15152
|
+
{
|
|
15153
|
+
align: "end",
|
|
15154
|
+
gap: "3xs",
|
|
15155
|
+
pb: "sm",
|
|
15156
|
+
children: [
|
|
15157
|
+
/* @__PURE__ */ jsx(HStack, { children: /* @__PURE__ */ jsx(
|
|
15158
|
+
MoneySpan,
|
|
15159
|
+
__spreadValues({
|
|
15160
|
+
amount
|
|
15161
|
+
}, slotProps == null ? void 0 : slotProps.MoneySpan)
|
|
15162
|
+
) }),
|
|
15163
|
+
/* @__PURE__ */ jsx(
|
|
15164
|
+
DateTime,
|
|
15165
|
+
{
|
|
15166
|
+
value: date,
|
|
15167
|
+
dateFormat: DATE_FORMAT,
|
|
15168
|
+
onlyDate: true,
|
|
15169
|
+
slotProps: {
|
|
15170
|
+
Date: __spreadValues({
|
|
15171
|
+
variant: "subtle",
|
|
15172
|
+
size: "sm"
|
|
15173
|
+
}, slotProps == null ? void 0 : slotProps.DateTime)
|
|
15174
|
+
}
|
|
15175
|
+
}
|
|
15176
|
+
)
|
|
15177
|
+
]
|
|
15178
|
+
}
|
|
15179
|
+
);
|
|
15180
|
+
};
|
|
15060
15181
|
const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
|
|
15061
15182
|
return /* @__PURE__ */ jsx(
|
|
15062
15183
|
GridListItem,
|
|
15063
15184
|
{
|
|
15064
15185
|
id: match.id,
|
|
15065
15186
|
textValue: match.details.description,
|
|
15066
|
-
children: /* @__PURE__ */ jsxs(HStack, {
|
|
15067
|
-
/* @__PURE__ */
|
|
15068
|
-
|
|
15069
|
-
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
15074
|
-
|
|
15187
|
+
children: /* @__PURE__ */ jsxs(HStack, { pi: "md", gap: "md", justify: "space-between", children: [
|
|
15188
|
+
/* @__PURE__ */ jsxs(HStack, { align: "center", children: [
|
|
15189
|
+
/* @__PURE__ */ jsx(
|
|
15190
|
+
Checkbox,
|
|
15191
|
+
{
|
|
15192
|
+
slot: "selection",
|
|
15193
|
+
variant: "round",
|
|
15194
|
+
className: "Layer__MatchFormMobileItem__Checkbox"
|
|
15195
|
+
}
|
|
15196
|
+
),
|
|
15197
|
+
/* @__PURE__ */ jsx(Span, { size: "sm", children: match.details.description })
|
|
15198
|
+
] }),
|
|
15075
15199
|
/* @__PURE__ */ jsx(
|
|
15076
15200
|
BankTransactionsAmountDate,
|
|
15077
15201
|
{
|
|
@@ -15083,7 +15207,7 @@ const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
|
|
|
15083
15207
|
}
|
|
15084
15208
|
}
|
|
15085
15209
|
),
|
|
15086
|
-
|
|
15210
|
+
inAppLink
|
|
15087
15211
|
] })
|
|
15088
15212
|
},
|
|
15089
15213
|
match.id
|
|
@@ -15156,19 +15280,20 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
15156
15280
|
}
|
|
15157
15281
|
yield matchBankTransaction2(bankTransaction.id, foundMatch.id, true);
|
|
15158
15282
|
});
|
|
15159
|
-
const save = () =>
|
|
15283
|
+
const save = () => {
|
|
15160
15284
|
var _a2;
|
|
15161
15285
|
if (!showCategorization) {
|
|
15162
15286
|
return;
|
|
15163
15287
|
}
|
|
15164
15288
|
if (!selectedMatch) {
|
|
15165
15289
|
setFormError("Select an option to match the transaction");
|
|
15166
|
-
}
|
|
15167
|
-
|
|
15290
|
+
}
|
|
15291
|
+
if (selectedMatch && selectedMatch.id !== ((_a2 = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a2.id)) {
|
|
15292
|
+
void onMatchSubmit(selectedMatch.id);
|
|
15168
15293
|
}
|
|
15169
15294
|
return;
|
|
15170
|
-
}
|
|
15171
|
-
return /* @__PURE__ */ jsxs(VStack, {
|
|
15295
|
+
};
|
|
15296
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
15172
15297
|
/* @__PURE__ */ jsx(Span, { size: "sm", weight: "bold", children: "Find Match" }),
|
|
15173
15298
|
/* @__PURE__ */ jsx(
|
|
15174
15299
|
MatchFormMobile,
|
|
@@ -15186,28 +15311,21 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
15186
15311
|
BankTransactionFormFields,
|
|
15187
15312
|
{
|
|
15188
15313
|
bankTransaction,
|
|
15189
|
-
showDescriptions
|
|
15314
|
+
showDescriptions,
|
|
15315
|
+
hideCustomerVendor: true,
|
|
15316
|
+
hideTags: true
|
|
15190
15317
|
}
|
|
15191
15318
|
),
|
|
15192
|
-
/* @__PURE__ */ jsx(
|
|
15193
|
-
|
|
15319
|
+
showReceiptUploads && /* @__PURE__ */ jsx(
|
|
15320
|
+
BankTransactionReceipts,
|
|
15194
15321
|
{
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
children: showReceiptUploads && /* @__PURE__ */ jsx(
|
|
15200
|
-
BankTransactionReceipts,
|
|
15201
|
-
{
|
|
15202
|
-
ref: receiptsRef,
|
|
15203
|
-
floatingActions: false,
|
|
15204
|
-
hideUploadButtons: true,
|
|
15205
|
-
label: "Receipts"
|
|
15206
|
-
}
|
|
15207
|
-
)
|
|
15322
|
+
ref: receiptsRef,
|
|
15323
|
+
floatingActions: false,
|
|
15324
|
+
hideUploadButtons: true,
|
|
15325
|
+
label: "Receipts"
|
|
15208
15326
|
}
|
|
15209
15327
|
),
|
|
15210
|
-
/* @__PURE__ */ jsxs(
|
|
15328
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
|
|
15211
15329
|
showReceiptUploads && /* @__PURE__ */ jsx(
|
|
15212
15330
|
FileInput,
|
|
15213
15331
|
{
|
|
@@ -15221,49 +15339,37 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
15221
15339
|
}
|
|
15222
15340
|
),
|
|
15223
15341
|
showCategorization && /* @__PURE__ */ jsx(
|
|
15224
|
-
Button
|
|
15342
|
+
Button,
|
|
15225
15343
|
{
|
|
15226
15344
|
fullWidth: true,
|
|
15227
|
-
|
|
15228
|
-
onClick:
|
|
15229
|
-
void save();
|
|
15230
|
-
},
|
|
15345
|
+
isDisabled: !selectedMatch || isLoading || bankTransaction.processing || selectedMatch.id === ((_a = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a.id),
|
|
15346
|
+
onClick: save,
|
|
15231
15347
|
children: isLoading || bankTransaction.processing ? "Saving..." : "Approve match"
|
|
15232
15348
|
}
|
|
15233
15349
|
)
|
|
15234
15350
|
] }),
|
|
15235
15351
|
formError && /* @__PURE__ */ jsx(ErrorText, { children: formError }),
|
|
15236
|
-
showRetry
|
|
15352
|
+
showRetry && /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
15237
15353
|
] });
|
|
15238
15354
|
};
|
|
15239
|
-
const CategorySelectDrawerWithTrigger = ({
|
|
15240
|
-
value,
|
|
15241
|
-
onChange,
|
|
15242
|
-
showTooltips
|
|
15243
|
-
}) => {
|
|
15355
|
+
const CategorySelectDrawerWithTrigger = ({ value, onChange, showTooltips }) => {
|
|
15244
15356
|
var _a;
|
|
15245
15357
|
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
|
15246
|
-
return /* @__PURE__ */ jsxs(
|
|
15358
|
+
return /* @__PURE__ */ jsxs(HStack, { fluid: true, children: [
|
|
15247
15359
|
/* @__PURE__ */ jsxs(
|
|
15248
|
-
|
|
15360
|
+
Button,
|
|
15249
15361
|
{
|
|
15362
|
+
flex: true,
|
|
15363
|
+
fullWidth: true,
|
|
15250
15364
|
"aria-label": "Select category",
|
|
15251
|
-
className: classNames(
|
|
15252
|
-
"Layer__category-menu__drawer-btn",
|
|
15253
|
-
value && "Layer__category-menu__drawer-btn--selected"
|
|
15254
|
-
),
|
|
15255
15365
|
onClick: () => {
|
|
15256
15366
|
setIsDrawerOpen(true);
|
|
15257
15367
|
},
|
|
15368
|
+
variant: "outlined",
|
|
15258
15369
|
children: [
|
|
15259
|
-
(_a = value == null ? void 0 : value.label) != null ? _a : "Select...",
|
|
15260
|
-
/* @__PURE__ */ jsx(
|
|
15261
|
-
|
|
15262
|
-
{
|
|
15263
|
-
size: 16,
|
|
15264
|
-
className: "Layer__category-menu__drawer-btn__arrow"
|
|
15265
|
-
}
|
|
15266
|
-
)
|
|
15370
|
+
/* @__PURE__ */ jsx(Span, { children: (_a = value == null ? void 0 : value.label) != null ? _a : "Select..." }),
|
|
15371
|
+
/* @__PURE__ */ jsx(Spacer, {}),
|
|
15372
|
+
/* @__PURE__ */ jsx(ChevronDown, { size: 16 })
|
|
15267
15373
|
]
|
|
15268
15374
|
}
|
|
15269
15375
|
),
|
|
@@ -15308,84 +15414,90 @@ const BankTransactionsMobileListSplitForm = ({
|
|
|
15308
15414
|
bankTransaction,
|
|
15309
15415
|
selectedCategory
|
|
15310
15416
|
});
|
|
15417
|
+
const effectiveSplits = showCategorization ? localSplits : [];
|
|
15418
|
+
const addSplitButtonText = effectiveSplits.length > 1 ? "Add new split" : "Split";
|
|
15311
15419
|
useEffect(() => {
|
|
15312
15420
|
if (bankTransaction.error) {
|
|
15313
15421
|
setShowRetry(true);
|
|
15314
15422
|
}
|
|
15315
15423
|
}, [bankTransaction.error]);
|
|
15316
|
-
const save = () =>
|
|
15424
|
+
const save = () => {
|
|
15317
15425
|
if (!isValid2) return;
|
|
15318
15426
|
const categorizationRequest = buildCategorizeBankTransactionPayloadForSplit(localSplits);
|
|
15319
|
-
|
|
15427
|
+
void categorizeBankTransaction2(
|
|
15320
15428
|
bankTransaction.id,
|
|
15321
15429
|
categorizationRequest
|
|
15322
15430
|
);
|
|
15323
15431
|
deselect(bankTransaction.id);
|
|
15324
15432
|
close();
|
|
15325
|
-
}
|
|
15326
|
-
|
|
15327
|
-
|
|
15433
|
+
};
|
|
15434
|
+
const handleCategoryChange = useCallback((index) => (value) => {
|
|
15435
|
+
changeCategoryForSplitAtIndex(index, value);
|
|
15436
|
+
}, [changeCategoryForSplitAtIndex]);
|
|
15437
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
15438
|
+
showCategorization && /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
15328
15439
|
/* @__PURE__ */ jsx(Text, { weight: TextWeight.bold, size: TextSize.sm, children: "Split transaction" }),
|
|
15329
|
-
/* @__PURE__ */
|
|
15330
|
-
|
|
15331
|
-
|
|
15332
|
-
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
-
|
|
15338
|
-
|
|
15339
|
-
|
|
15340
|
-
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15344
|
-
|
|
15345
|
-
|
|
15346
|
-
|
|
15347
|
-
|
|
15348
|
-
|
|
15349
|
-
|
|
15350
|
-
|
|
15351
|
-
|
|
15352
|
-
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
|
|
15356
|
-
|
|
15357
|
-
|
|
15358
|
-
|
|
15359
|
-
|
|
15360
|
-
|
|
15361
|
-
|
|
15362
|
-
|
|
15363
|
-
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15372
|
-
|
|
15373
|
-
|
|
15374
|
-
|
|
15375
|
-
|
|
15376
|
-
|
|
15377
|
-
|
|
15378
|
-
|
|
15379
|
-
|
|
15380
|
-
|
|
15381
|
-
] }),
|
|
15440
|
+
/* @__PURE__ */ jsx(VStack, { gap: "sm", children: localSplits.map((split, index) => /* @__PURE__ */ jsxs(
|
|
15441
|
+
HStack,
|
|
15442
|
+
{
|
|
15443
|
+
gap: "xs",
|
|
15444
|
+
align: "center",
|
|
15445
|
+
justify: "space-between",
|
|
15446
|
+
children: [
|
|
15447
|
+
/* @__PURE__ */ jsx(
|
|
15448
|
+
CategorySelectDrawerWithTrigger,
|
|
15449
|
+
{
|
|
15450
|
+
value: split.category,
|
|
15451
|
+
onChange: handleCategoryChange(index),
|
|
15452
|
+
showTooltips
|
|
15453
|
+
}
|
|
15454
|
+
),
|
|
15455
|
+
/* @__PURE__ */ jsx(
|
|
15456
|
+
AmountInput,
|
|
15457
|
+
{
|
|
15458
|
+
name: `split-${index}`,
|
|
15459
|
+
disabled: index === 0 || !showCategorization,
|
|
15460
|
+
onChange: updateSplitAmount(index),
|
|
15461
|
+
value: getInputValueForSplitAtIndex(index, split),
|
|
15462
|
+
onBlur: onBlurSplitAmount,
|
|
15463
|
+
isInvalid: split.amount < 0,
|
|
15464
|
+
className: "Layer__BankTransactionsMobileSplitForm__AmountInput"
|
|
15465
|
+
}
|
|
15466
|
+
),
|
|
15467
|
+
/* @__PURE__ */ jsx(
|
|
15468
|
+
Button,
|
|
15469
|
+
{
|
|
15470
|
+
onClick: () => removeSplit(index),
|
|
15471
|
+
variant: "outlined",
|
|
15472
|
+
icon: true,
|
|
15473
|
+
isDisabled: index == 0,
|
|
15474
|
+
children: /* @__PURE__ */ jsx(Trash, { size: 16 })
|
|
15475
|
+
}
|
|
15476
|
+
)
|
|
15477
|
+
]
|
|
15478
|
+
},
|
|
15479
|
+
`split-${index}`
|
|
15480
|
+
)) }),
|
|
15481
|
+
/* @__PURE__ */ jsx(HStack, { justify: "end", children: /* @__PURE__ */ jsxs(
|
|
15482
|
+
Button,
|
|
15483
|
+
{
|
|
15484
|
+
onClick: addSplit,
|
|
15485
|
+
variant: "outlined",
|
|
15486
|
+
children: [
|
|
15487
|
+
/* @__PURE__ */ jsx(Scissors, { size: 14 }),
|
|
15488
|
+
addSplitButtonText
|
|
15489
|
+
]
|
|
15490
|
+
}
|
|
15491
|
+
) }),
|
|
15382
15492
|
splitFormError && /* @__PURE__ */ jsx(HStack, { pbe: "sm", children: /* @__PURE__ */ jsx(ErrorText, { children: splitFormError }) })
|
|
15383
|
-
] })
|
|
15493
|
+
] }),
|
|
15384
15494
|
/* @__PURE__ */ jsx(
|
|
15385
15495
|
BankTransactionFormFields,
|
|
15386
15496
|
{
|
|
15387
15497
|
bankTransaction,
|
|
15388
|
-
showDescriptions
|
|
15498
|
+
showDescriptions,
|
|
15499
|
+
hideCustomerVendor: true,
|
|
15500
|
+
hideTags: true
|
|
15389
15501
|
}
|
|
15390
15502
|
),
|
|
15391
15503
|
/* @__PURE__ */ jsx(
|
|
@@ -15406,7 +15518,7 @@ const BankTransactionsMobileListSplitForm = ({
|
|
|
15406
15518
|
)
|
|
15407
15519
|
}
|
|
15408
15520
|
),
|
|
15409
|
-
/* @__PURE__ */ jsxs(
|
|
15521
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
|
|
15410
15522
|
showReceiptUploads && /* @__PURE__ */ jsx(
|
|
15411
15523
|
FileInput,
|
|
15412
15524
|
{
|
|
@@ -15420,16 +15532,16 @@ const BankTransactionsMobileListSplitForm = ({
|
|
|
15420
15532
|
}
|
|
15421
15533
|
),
|
|
15422
15534
|
showCategorization && /* @__PURE__ */ jsx(
|
|
15423
|
-
Button
|
|
15535
|
+
Button,
|
|
15424
15536
|
{
|
|
15425
15537
|
fullWidth: true,
|
|
15426
|
-
onClick:
|
|
15427
|
-
|
|
15428
|
-
children:
|
|
15538
|
+
onClick: save,
|
|
15539
|
+
isDisabled: isLoading || bankTransaction.processing || !isValid2,
|
|
15540
|
+
children: bankTransaction.processing || isLoading ? "Confirming..." : "Confirm"
|
|
15429
15541
|
}
|
|
15430
15542
|
)
|
|
15431
15543
|
] }),
|
|
15432
|
-
bankTransaction.error && showRetry
|
|
15544
|
+
bankTransaction.error && showRetry && /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
15433
15545
|
] });
|
|
15434
15546
|
};
|
|
15435
15547
|
const BankTransactionsMobileListSplitAndMatchForm = ({
|
|
@@ -15444,7 +15556,7 @@ const BankTransactionsMobileListSplitAndMatchForm = ({
|
|
|
15444
15556
|
bankTransaction.category ? "categorize" : anyMatch ? "match" : "categorize"
|
|
15445
15557
|
/* categorize */
|
|
15446
15558
|
);
|
|
15447
|
-
return /* @__PURE__ */ jsxs(
|
|
15559
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15448
15560
|
formType === "categorize" && /* @__PURE__ */ jsx(
|
|
15449
15561
|
BankTransactionsMobileListSplitForm,
|
|
15450
15562
|
{
|
|
@@ -15464,14 +15576,13 @@ const BankTransactionsMobileListSplitAndMatchForm = ({
|
|
|
15464
15576
|
showCategorization
|
|
15465
15577
|
}
|
|
15466
15578
|
),
|
|
15467
|
-
showCategorization && anyMatch && formType === "match" ? /* @__PURE__ */ jsx(
|
|
15579
|
+
showCategorization && anyMatch && (formType === "match" ? /* @__PURE__ */ jsx(TextButton, { onClick: () => setFormType(
|
|
15468
15580
|
"categorize"
|
|
15469
15581
|
/* categorize */
|
|
15470
|
-
), children: "or split transaction" })
|
|
15471
|
-
showCategorization && anyMatch && formType === "categorize" ? /* @__PURE__ */ jsx("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns", children: /* @__PURE__ */ jsx(TextButton, { onClick: () => setFormType(
|
|
15582
|
+
), children: "or split transaction" }) : /* @__PURE__ */ jsx(TextButton, { onClick: () => setFormType(
|
|
15472
15583
|
"match"
|
|
15473
15584
|
/* match */
|
|
15474
|
-
), children: "or find match" })
|
|
15585
|
+
), children: "or find match" }))
|
|
15475
15586
|
] });
|
|
15476
15587
|
};
|
|
15477
15588
|
const BankTransactionsMobileForms = ({
|
|
@@ -15521,7 +15632,7 @@ const BankTransactionsMobileForms = ({
|
|
|
15521
15632
|
return null;
|
|
15522
15633
|
}
|
|
15523
15634
|
};
|
|
15524
|
-
return /* @__PURE__ */ jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children:
|
|
15635
|
+
return /* @__PURE__ */ jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: getContent() });
|
|
15525
15636
|
};
|
|
15526
15637
|
const PURPOSE_TOGGLE_OPTIONS = [
|
|
15527
15638
|
{
|
|
@@ -15549,8 +15660,8 @@ const BankTransactionsMobileListItemExpandedRow = ({
|
|
|
15549
15660
|
}) => {
|
|
15550
15661
|
const [purpose, setPurpose] = useState(getInitialPurpose(bankTransaction));
|
|
15551
15662
|
const onChangePurpose = (event) => setPurpose(event.target.value);
|
|
15552
|
-
return /* @__PURE__ */
|
|
15553
|
-
showCategorization
|
|
15663
|
+
return /* @__PURE__ */ jsxs(VStack, { pi: "md", gap: "md", pbe: "md", children: [
|
|
15664
|
+
showCategorization && /* @__PURE__ */ jsx(
|
|
15554
15665
|
Toggle,
|
|
15555
15666
|
{
|
|
15556
15667
|
name: `purpose-${bankTransaction.id}`,
|
|
@@ -15559,7 +15670,7 @@ const BankTransactionsMobileListItemExpandedRow = ({
|
|
|
15559
15670
|
selected: purpose,
|
|
15560
15671
|
onChange: onChangePurpose
|
|
15561
15672
|
}
|
|
15562
|
-
)
|
|
15673
|
+
),
|
|
15563
15674
|
/* @__PURE__ */ jsx(
|
|
15564
15675
|
BankTransactionsMobileForms,
|
|
15565
15676
|
{
|
|
@@ -15571,7 +15682,7 @@ const BankTransactionsMobileListItemExpandedRow = ({
|
|
|
15571
15682
|
showTooltips
|
|
15572
15683
|
}
|
|
15573
15684
|
)
|
|
15574
|
-
] })
|
|
15685
|
+
] });
|
|
15575
15686
|
};
|
|
15576
15687
|
const getInitialPurpose = (bankTransaction) => {
|
|
15577
15688
|
if (bankTransaction.category) {
|
|
@@ -15701,6 +15812,11 @@ const BankTransactionsMobileListItem = ({
|
|
|
15701
15812
|
}, 300);
|
|
15702
15813
|
}
|
|
15703
15814
|
}, [bankTransaction.recently_categorized]);
|
|
15815
|
+
useEffect(() => {
|
|
15816
|
+
if (bulkActionsEnabled) {
|
|
15817
|
+
close2();
|
|
15818
|
+
}
|
|
15819
|
+
}, [bulkActionsEnabled]);
|
|
15704
15820
|
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
15705
15821
|
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
15706
15822
|
const { select, deselect } = useBulkSelectionActions();
|
|
@@ -15776,15 +15892,16 @@ const BankTransactionsMobileListItem = ({
|
|
|
15776
15892
|
}
|
|
15777
15893
|
),
|
|
15778
15894
|
!open && /* @__PURE__ */ jsx(
|
|
15779
|
-
|
|
15895
|
+
BankTransactionsListItemCategory,
|
|
15780
15896
|
{
|
|
15781
|
-
bankTransaction
|
|
15897
|
+
bankTransaction,
|
|
15898
|
+
mobile: true
|
|
15782
15899
|
}
|
|
15783
15900
|
)
|
|
15784
15901
|
]
|
|
15785
15902
|
}
|
|
15786
15903
|
),
|
|
15787
|
-
open
|
|
15904
|
+
/* @__PURE__ */ jsx(AnimatedContent, { variant: "expand", isOpen: open, children: /* @__PURE__ */ jsx(
|
|
15788
15905
|
BankTransactionsMobileListItemExpandedRow,
|
|
15789
15906
|
{
|
|
15790
15907
|
bankTransaction,
|
|
@@ -15793,14 +15910,14 @@ const BankTransactionsMobileListItem = ({
|
|
|
15793
15910
|
showReceiptUploads,
|
|
15794
15911
|
showTooltips
|
|
15795
15912
|
}
|
|
15796
|
-
)
|
|
15913
|
+
) }, `expanded-${bankTransaction.id}`)
|
|
15797
15914
|
] }) });
|
|
15798
15915
|
};
|
|
15799
15916
|
const SWITCH_CLASS_NAME = "Layer__Switch";
|
|
15800
|
-
const Switch = forwardRef((
|
|
15801
|
-
var
|
|
15917
|
+
const Switch = forwardRef((_Mb, ref) => {
|
|
15918
|
+
var _Nb = _Mb, {
|
|
15802
15919
|
children
|
|
15803
|
-
} =
|
|
15920
|
+
} = _Nb, props = __objRest(_Nb, [
|
|
15804
15921
|
"children"
|
|
15805
15922
|
]);
|
|
15806
15923
|
return /* @__PURE__ */ jsx(
|
|
@@ -16176,8 +16293,8 @@ const usePaginationRange = ({
|
|
|
16176
16293
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
16177
16294
|
return paginationRange;
|
|
16178
16295
|
};
|
|
16179
|
-
const PaginationButton = (
|
|
16180
|
-
var
|
|
16296
|
+
const PaginationButton = (_Ob) => {
|
|
16297
|
+
var _Pb = _Ob, { children, isSelected } = _Pb, buttonProps = __objRest(_Pb, ["children", "isSelected"]);
|
|
16181
16298
|
return /* @__PURE__ */ jsx(
|
|
16182
16299
|
Button,
|
|
16183
16300
|
__spreadProps(__spreadValues({
|
|
@@ -16724,8 +16841,8 @@ function BaseFormTextField({
|
|
|
16724
16841
|
}
|
|
16725
16842
|
const INPUT_CLASS_NAME = "Layer__UI__Input";
|
|
16726
16843
|
const Input = forwardRef(
|
|
16727
|
-
function Input2(
|
|
16728
|
-
var
|
|
16844
|
+
function Input2(_Qb, ref) {
|
|
16845
|
+
var _Rb = _Qb, { inset, placement } = _Rb, restProps = __objRest(_Rb, ["inset", "placement"]);
|
|
16729
16846
|
const dataProperties = toDataProperties({ inset, placement });
|
|
16730
16847
|
return /* @__PURE__ */ jsx(
|
|
16731
16848
|
Input$2,
|
|
@@ -16821,15 +16938,15 @@ const withForceUpdate = (value) => {
|
|
|
16821
16938
|
writable: false
|
|
16822
16939
|
});
|
|
16823
16940
|
};
|
|
16824
|
-
function FormBigDecimalField(
|
|
16825
|
-
var
|
|
16941
|
+
function FormBigDecimalField(_Sb) {
|
|
16942
|
+
var _Tb = _Sb, {
|
|
16826
16943
|
mode = "decimal",
|
|
16827
16944
|
allowNegative = false,
|
|
16828
16945
|
maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
|
|
16829
16946
|
minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
|
|
16830
16947
|
maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
|
|
16831
16948
|
slots
|
|
16832
|
-
} =
|
|
16949
|
+
} = _Tb, restProps = __objRest(_Tb, [
|
|
16833
16950
|
"mode",
|
|
16834
16951
|
"allowNegative",
|
|
16835
16952
|
"maxValue",
|
|
@@ -16994,8 +17111,8 @@ function FormDateField({
|
|
|
16994
17111
|
}
|
|
16995
17112
|
const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
|
|
16996
17113
|
const TextArea = forwardRef(
|
|
16997
|
-
function TextArea2(
|
|
16998
|
-
var
|
|
17114
|
+
function TextArea2(_Ub, ref) {
|
|
17115
|
+
var _Vb = _Ub, { resize = "none" } = _Vb, restProps = __objRest(_Vb, ["resize"]);
|
|
16999
17116
|
const dataProperties = toDataProperties({ resize });
|
|
17000
17117
|
return /* @__PURE__ */ jsx(
|
|
17001
17118
|
TextArea$1,
|
|
@@ -17277,8 +17394,8 @@ const CustomAccountForm = ({ initialAccountName, onCancel, onSuccess }) => {
|
|
|
17277
17394
|
}
|
|
17278
17395
|
);
|
|
17279
17396
|
};
|
|
17280
|
-
const CloseIcon = (
|
|
17281
|
-
var
|
|
17397
|
+
const CloseIcon = (_Wb) => {
|
|
17398
|
+
var _Xb = _Wb, { size = 12 } = _Xb, props = __objRest(_Xb, ["size"]);
|
|
17282
17399
|
return /* @__PURE__ */ jsxs(
|
|
17283
17400
|
"svg",
|
|
17284
17401
|
__spreadProps(__spreadValues({
|
|
@@ -19100,8 +19217,8 @@ const BankTransactionsHeader = ({
|
|
|
19100
19217
|
}
|
|
19101
19218
|
);
|
|
19102
19219
|
};
|
|
19103
|
-
const Inbox = (
|
|
19104
|
-
var
|
|
19220
|
+
const Inbox = (_Yb) => {
|
|
19221
|
+
var _Zb = _Yb, { size = 18 } = _Zb, props = __objRest(_Zb, ["size"]);
|
|
19105
19222
|
return /* @__PURE__ */ jsxs(
|
|
19106
19223
|
"svg",
|
|
19107
19224
|
__spreadProps(__spreadValues({
|
|
@@ -19590,6 +19707,7 @@ function useRejectCategorizationRulesUpdateSuggestion() {
|
|
|
19590
19707
|
function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
19591
19708
|
const { next } = useWizard();
|
|
19592
19709
|
const { addToast } = useLayerContext();
|
|
19710
|
+
const { isMobile } = useSizeClass();
|
|
19593
19711
|
const [dontAskAgain, setDontAskAgain] = useState(false);
|
|
19594
19712
|
const { trigger: rejectRuleSuggestion, isMutating } = useRejectCategorizationRulesUpdateSuggestion();
|
|
19595
19713
|
const handleRejectRuleSuggestion = useCallback(() => {
|
|
@@ -19607,7 +19725,7 @@ function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
|
19607
19725
|
}
|
|
19608
19726
|
}))();
|
|
19609
19727
|
}, [addToast, close2, dontAskAgain, rejectRuleSuggestion, ruleSuggestion.newRule.createdBySuggestionId]);
|
|
19610
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "3xl", children: [
|
|
19728
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: isMobile ? "md" : "3xl", children: [
|
|
19611
19729
|
/* @__PURE__ */ jsx(Span, { size: "md", children: ruleSuggestion.suggestionPrompt }),
|
|
19612
19730
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "end", children: [
|
|
19613
19731
|
/* @__PURE__ */ jsxs(HStack, { gap: "sm", justify: "end", align: "end", children: [
|
|
@@ -19648,8 +19766,8 @@ function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
|
19648
19766
|
const CSS_PREFIX$1 = "Layer__UI__Table";
|
|
19649
19767
|
const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
|
|
19650
19768
|
const Table$1 = forwardRef(
|
|
19651
|
-
(
|
|
19652
|
-
var
|
|
19769
|
+
(__b, ref) => {
|
|
19770
|
+
var _$b = __b, { children, className } = _$b, restProps = __objRest(_$b, ["children", "className"]);
|
|
19653
19771
|
return /* @__PURE__ */ jsx(
|
|
19654
19772
|
Table$2,
|
|
19655
19773
|
__spreadProps(__spreadValues({
|
|
@@ -19662,8 +19780,8 @@ const Table$1 = forwardRef(
|
|
|
19662
19780
|
}
|
|
19663
19781
|
);
|
|
19664
19782
|
Table$1.displayName = "Table";
|
|
19665
|
-
const TableHeaderInner = (
|
|
19666
|
-
var
|
|
19783
|
+
const TableHeaderInner = (_ac, ref) => {
|
|
19784
|
+
var _bc = _ac, { children, className, hideHeader } = _bc, restProps = __objRest(_bc, ["children", "className", "hideHeader"]);
|
|
19667
19785
|
return /* @__PURE__ */ jsx(
|
|
19668
19786
|
TableHeader$1,
|
|
19669
19787
|
__spreadProps(__spreadValues({
|
|
@@ -19676,8 +19794,8 @@ const TableHeaderInner = (__b, ref) => {
|
|
|
19676
19794
|
};
|
|
19677
19795
|
const TableHeader = forwardRef(TableHeaderInner);
|
|
19678
19796
|
TableHeader.displayName = "TableHeader";
|
|
19679
|
-
const TableBodyInner = (
|
|
19680
|
-
var
|
|
19797
|
+
const TableBodyInner = (_cc, ref) => {
|
|
19798
|
+
var _dc = _cc, { children, className } = _dc, restProps = __objRest(_dc, ["children", "className"]);
|
|
19681
19799
|
return /* @__PURE__ */ jsx(
|
|
19682
19800
|
TableBody$2,
|
|
19683
19801
|
__spreadProps(__spreadValues({
|
|
@@ -19690,8 +19808,8 @@ const TableBodyInner = (_ac, ref) => {
|
|
|
19690
19808
|
};
|
|
19691
19809
|
const TableBody$1 = forwardRef(TableBodyInner);
|
|
19692
19810
|
TableBody$1.displayName = "TableBody";
|
|
19693
|
-
const RowInner = (
|
|
19694
|
-
var
|
|
19811
|
+
const RowInner = (_ec, ref) => {
|
|
19812
|
+
var _fc = _ec, { children, className, depth = 0 } = _fc, restProps = __objRest(_fc, ["children", "className", "depth"]);
|
|
19695
19813
|
const dataProperties = toDataProperties({ depth });
|
|
19696
19814
|
return /* @__PURE__ */ jsx(
|
|
19697
19815
|
Row$1,
|
|
@@ -19706,8 +19824,8 @@ const RowInner = (_cc, ref) => {
|
|
|
19706
19824
|
const Row = forwardRef(RowInner);
|
|
19707
19825
|
Row.displayName = "Row";
|
|
19708
19826
|
const Column = forwardRef(
|
|
19709
|
-
(
|
|
19710
|
-
var
|
|
19827
|
+
(_gc, ref) => {
|
|
19828
|
+
var _hc = _gc, { children, className, textAlign = "left" } = _hc, restProps = __objRest(_hc, ["children", "className", "textAlign"]);
|
|
19711
19829
|
const dataProperties = toDataProperties({ "text-align": textAlign });
|
|
19712
19830
|
return /* @__PURE__ */ jsx(
|
|
19713
19831
|
Column$1,
|
|
@@ -19722,8 +19840,8 @@ const Column = forwardRef(
|
|
|
19722
19840
|
);
|
|
19723
19841
|
Column.displayName = "Column";
|
|
19724
19842
|
const Cell = forwardRef(
|
|
19725
|
-
(
|
|
19726
|
-
var
|
|
19843
|
+
(_ic, ref) => {
|
|
19844
|
+
var _jc = _ic, { children, className } = _jc, restProps = __objRest(_jc, ["children", "className"]);
|
|
19727
19845
|
return /* @__PURE__ */ jsx(
|
|
19728
19846
|
Cell$1,
|
|
19729
19847
|
__spreadProps(__spreadValues({
|
|
@@ -20016,8 +20134,8 @@ const SuggestedCategorizationRuleUpdatesDrawer = ({
|
|
|
20016
20134
|
/* @__PURE__ */ jsx(SuggestedCategorizationRuleUpdates, { ruleSuggestion, close: close2 })
|
|
20017
20135
|
] }) });
|
|
20018
20136
|
};
|
|
20019
|
-
const BackArrow = (
|
|
20020
|
-
var
|
|
20137
|
+
const BackArrow = (_kc) => {
|
|
20138
|
+
var _lc = _kc, { size = 18 } = _lc, props = __objRest(_lc, ["size"]);
|
|
20021
20139
|
return /* @__PURE__ */ jsx(
|
|
20022
20140
|
"svg",
|
|
20023
20141
|
__spreadProps(__spreadValues({
|
|
@@ -20388,8 +20506,8 @@ const CategorizationRulesDrawer = () => {
|
|
|
20388
20506
|
) });
|
|
20389
20507
|
};
|
|
20390
20508
|
const COMPONENT_NAME$a = "bank-transactions";
|
|
20391
|
-
const BankTransactions = (
|
|
20392
|
-
var
|
|
20509
|
+
const BankTransactions = (_mc) => {
|
|
20510
|
+
var _nc = _mc, {
|
|
20393
20511
|
onError,
|
|
20394
20512
|
showTags = false,
|
|
20395
20513
|
showCustomerVendor = false,
|
|
@@ -20397,7 +20515,7 @@ const BankTransactions = (_kc) => {
|
|
|
20397
20515
|
applyGlobalDateRange = false,
|
|
20398
20516
|
mode,
|
|
20399
20517
|
renderInAppLink
|
|
20400
|
-
} =
|
|
20518
|
+
} = _nc, props = __objRest(_nc, [
|
|
20401
20519
|
"onError",
|
|
20402
20520
|
"showTags",
|
|
20403
20521
|
"showCustomerVendor",
|
|
@@ -20684,8 +20802,8 @@ const BankTransactionsTableView = ({
|
|
|
20684
20802
|
}
|
|
20685
20803
|
);
|
|
20686
20804
|
};
|
|
20687
|
-
const QuickbooksIcon = (
|
|
20688
|
-
var
|
|
20805
|
+
const QuickbooksIcon = (_oc) => {
|
|
20806
|
+
var _pc = _oc, { size = 24 } = _pc, props = __objRest(_pc, ["size"]);
|
|
20689
20807
|
return /* @__PURE__ */ jsxs(
|
|
20690
20808
|
"svg",
|
|
20691
20809
|
__spreadProps(__spreadValues({
|
|
@@ -20966,8 +21084,8 @@ function QuickbooksContextProvider({ children }) {
|
|
|
20966
21084
|
const quickbooksContextData = useQuickbooks();
|
|
20967
21085
|
return /* @__PURE__ */ jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
|
|
20968
21086
|
}
|
|
20969
|
-
const Cog = (
|
|
20970
|
-
var
|
|
21087
|
+
const Cog = (_qc) => {
|
|
21088
|
+
var _rc = _qc, { size = 12 } = _rc, props = __objRest(_rc, ["size"]);
|
|
20971
21089
|
const id = useId();
|
|
20972
21090
|
return /* @__PURE__ */ jsxs(
|
|
20973
21091
|
"svg",
|
|
@@ -21107,69 +21225,10 @@ const applyShare = (items, total) => {
|
|
|
21107
21225
|
});
|
|
21108
21226
|
});
|
|
21109
21227
|
};
|
|
21110
|
-
var ReportKey = /* @__PURE__ */ ((ReportKey2) => {
|
|
21111
|
-
ReportKey2["ProfitAndLoss"] = "ProfitAndLoss";
|
|
21112
|
-
ReportKey2["BalanceSheet"] = "BalanceSheet";
|
|
21113
|
-
ReportKey2["StatementOfCashFlows"] = "StatementOfCashFlows";
|
|
21114
|
-
return ReportKey2;
|
|
21115
|
-
})(ReportKey || {});
|
|
21116
|
-
const defaultModeByReport = {
|
|
21117
|
-
[
|
|
21118
|
-
"ProfitAndLoss"
|
|
21119
|
-
/* ProfitAndLoss */
|
|
21120
|
-
]: "monthPicker",
|
|
21121
|
-
// This one should never change, but is included for completeness
|
|
21122
|
-
[
|
|
21123
|
-
"BalanceSheet"
|
|
21124
|
-
/* BalanceSheet */
|
|
21125
|
-
]: "dayPicker",
|
|
21126
|
-
[
|
|
21127
|
-
"StatementOfCashFlows"
|
|
21128
|
-
/* StatementOfCashFlows */
|
|
21129
|
-
]: "monthPicker"
|
|
21130
|
-
};
|
|
21131
|
-
const ReportsModeStoreContext = createContext(
|
|
21132
|
-
createStore(() => ({
|
|
21133
|
-
resetPnLModeToDefaultOnMount: true,
|
|
21134
|
-
modeByReport: {},
|
|
21135
|
-
actions: {
|
|
21136
|
-
setModeForReport: () => {
|
|
21137
|
-
}
|
|
21138
|
-
}
|
|
21139
|
-
}))
|
|
21140
|
-
);
|
|
21141
|
-
function useReportMode(report) {
|
|
21142
|
-
const store = useContext(ReportsModeStoreContext);
|
|
21143
|
-
return useStore(store, (state) => state.modeByReport[report]);
|
|
21144
|
-
}
|
|
21145
|
-
function useReportModeWithFallback(report, fallback) {
|
|
21146
|
-
const mode = useReportMode(report);
|
|
21147
|
-
return mode != null ? mode : fallback;
|
|
21148
|
-
}
|
|
21149
|
-
function ReportsModeStoreProvider({
|
|
21150
|
-
children,
|
|
21151
|
-
initialModes,
|
|
21152
|
-
resetPnLModeToDefaultOnMount = true
|
|
21153
|
-
}) {
|
|
21154
|
-
const [store] = useState(
|
|
21155
|
-
() => createStore((set2) => ({
|
|
21156
|
-
modeByReport: __spreadValues(__spreadValues({}, defaultModeByReport), initialModes),
|
|
21157
|
-
resetPnLModeToDefaultOnMount,
|
|
21158
|
-
actions: {
|
|
21159
|
-
setModeForReport: (report, mode) => set2((state) => ({
|
|
21160
|
-
modeByReport: __spreadProps(__spreadValues({}, state.modeByReport), {
|
|
21161
|
-
[report]: mode
|
|
21162
|
-
})
|
|
21163
|
-
}))
|
|
21164
|
-
}
|
|
21165
|
-
}))
|
|
21166
|
-
);
|
|
21167
|
-
return /* @__PURE__ */ jsx(ReportsModeStoreContext.Provider, { value: store, children });
|
|
21168
|
-
}
|
|
21169
21228
|
const useProfitAndLoss = ({ tagFilter, reportingBasis }) => {
|
|
21170
21229
|
var _a;
|
|
21171
|
-
const
|
|
21172
|
-
const dateRange = useGlobalDateRange({ displayMode
|
|
21230
|
+
const [displayMode, setDisplayMode] = useState("month");
|
|
21231
|
+
const dateRange = useGlobalDateRange({ displayMode });
|
|
21173
21232
|
const [filters, setFilters] = useState({
|
|
21174
21233
|
expenses: void 0,
|
|
21175
21234
|
revenue: void 0
|
|
@@ -21293,7 +21352,9 @@ const useProfitAndLoss = ({ tagFilter, reportingBasis }) => {
|
|
|
21293
21352
|
tagFilter,
|
|
21294
21353
|
dateRange,
|
|
21295
21354
|
selectedLineItem,
|
|
21296
|
-
setSelectedLineItem
|
|
21355
|
+
setSelectedLineItem,
|
|
21356
|
+
setDisplayMode,
|
|
21357
|
+
displayMode
|
|
21297
21358
|
};
|
|
21298
21359
|
};
|
|
21299
21360
|
function range(start, end) {
|
|
@@ -21302,12 +21363,56 @@ function range(start, end) {
|
|
|
21302
21363
|
function isArrayWithAtLeastOne(list) {
|
|
21303
21364
|
return list.length > 0;
|
|
21304
21365
|
}
|
|
21305
|
-
|
|
21306
|
-
|
|
21307
|
-
|
|
21366
|
+
var DateGroupBy = /* @__PURE__ */ ((DateGroupBy2) => {
|
|
21367
|
+
DateGroupBy2["AllTime"] = "AllTime";
|
|
21368
|
+
DateGroupBy2["Month"] = "Month";
|
|
21369
|
+
DateGroupBy2["Year"] = "Year";
|
|
21370
|
+
return DateGroupBy2;
|
|
21371
|
+
})(DateGroupBy || {});
|
|
21372
|
+
const DateGroupByOptionConfig = {
|
|
21373
|
+
[
|
|
21374
|
+
"AllTime"
|
|
21375
|
+
/* AllTime */
|
|
21376
|
+
]: {
|
|
21377
|
+
label: "All time",
|
|
21378
|
+
value: "AllTime"
|
|
21379
|
+
/* AllTime */
|
|
21380
|
+
},
|
|
21381
|
+
[
|
|
21382
|
+
"Month"
|
|
21383
|
+
/* Month */
|
|
21384
|
+
]: {
|
|
21385
|
+
label: "Compare by month",
|
|
21386
|
+
value: "Month"
|
|
21387
|
+
/* Month */
|
|
21388
|
+
},
|
|
21389
|
+
[
|
|
21390
|
+
"Year"
|
|
21391
|
+
/* Year */
|
|
21392
|
+
]: {
|
|
21393
|
+
label: "Compare by year",
|
|
21394
|
+
value: "Year"
|
|
21395
|
+
/* Year */
|
|
21308
21396
|
}
|
|
21309
|
-
|
|
21310
|
-
|
|
21397
|
+
};
|
|
21398
|
+
const options$3 = Object.values(DateGroupByOptionConfig);
|
|
21399
|
+
const DateGroupByComboBox = ({ value, onValueChange }) => {
|
|
21400
|
+
const selectedOption = value ? DateGroupByOptionConfig[value] : null;
|
|
21401
|
+
const onSelectedValueChange = useCallback((option) => {
|
|
21402
|
+
onValueChange((option == null ? void 0 : option.value) || null);
|
|
21403
|
+
}, [onValueChange]);
|
|
21404
|
+
return /* @__PURE__ */ jsx(
|
|
21405
|
+
ComboBox,
|
|
21406
|
+
{
|
|
21407
|
+
className: "Layer__DateGroupByComboBox",
|
|
21408
|
+
options: options$3,
|
|
21409
|
+
onSelectedValueChange,
|
|
21410
|
+
selectedValue: selectedOption,
|
|
21411
|
+
isSearchable: false,
|
|
21412
|
+
isClearable: false
|
|
21413
|
+
}
|
|
21414
|
+
);
|
|
21415
|
+
};
|
|
21311
21416
|
function prepareFiltersBody(compareOptions) {
|
|
21312
21417
|
const noneFilters = compareOptions.filter(
|
|
21313
21418
|
({ tagFilterConfig: { tagFilters: tagFilters2 } }) => tagFilters2 === "None"
|
|
@@ -21347,9 +21452,9 @@ function prepareFiltersBody(compareOptions) {
|
|
|
21347
21452
|
return isArrayWithAtLeastOne(allFilters) ? allFilters : void 0;
|
|
21348
21453
|
}
|
|
21349
21454
|
function preparePeriodsBodyForMonths(dateRange, comparePeriods) {
|
|
21350
|
-
const
|
|
21455
|
+
const adjustedEndDate = startOfMonth(dateRange.endDate);
|
|
21351
21456
|
const rawPeriods = range(0, comparePeriods).map((index) => {
|
|
21352
|
-
const currentPeriod = subMonths(
|
|
21457
|
+
const currentPeriod = subMonths(adjustedEndDate, index);
|
|
21353
21458
|
return {
|
|
21354
21459
|
year: getYear(currentPeriod),
|
|
21355
21460
|
month: getMonth(currentPeriod) + 1
|
|
@@ -21370,9 +21475,9 @@ function preparePeriodsBodyForMonths(dateRange, comparePeriods) {
|
|
|
21370
21475
|
};
|
|
21371
21476
|
}
|
|
21372
21477
|
function preparePeriodsBodyForYears(dateRange, comparePeriods) {
|
|
21373
|
-
const
|
|
21478
|
+
const adjustedEndDate = startOfYear(dateRange.endDate);
|
|
21374
21479
|
const rawPeriods = range(0, comparePeriods).map((index) => {
|
|
21375
|
-
const currentPeriod = subYears(
|
|
21480
|
+
const currentPeriod = subYears(adjustedEndDate, index);
|
|
21376
21481
|
return {
|
|
21377
21482
|
year: getYear(currentPeriod)
|
|
21378
21483
|
};
|
|
@@ -21397,17 +21502,51 @@ function preparePeriodsBodyForDateRange(dateRange) {
|
|
|
21397
21502
|
}]
|
|
21398
21503
|
};
|
|
21399
21504
|
}
|
|
21400
|
-
function preparePeriodsBody(dateRange, comparePeriods,
|
|
21401
|
-
switch (
|
|
21402
|
-
case
|
|
21505
|
+
function preparePeriodsBody(dateRange, comparePeriods, comparisonPeriodMode) {
|
|
21506
|
+
switch (comparisonPeriodMode) {
|
|
21507
|
+
case DateGroupBy.Year:
|
|
21403
21508
|
return preparePeriodsBodyForYears(dateRange, comparePeriods);
|
|
21404
|
-
case
|
|
21509
|
+
case DateGroupBy.Month:
|
|
21405
21510
|
return preparePeriodsBodyForMonths(dateRange, comparePeriods);
|
|
21511
|
+
case DateGroupBy.AllTime:
|
|
21406
21512
|
default:
|
|
21407
21513
|
return preparePeriodsBodyForDateRange(dateRange);
|
|
21408
21514
|
}
|
|
21409
21515
|
}
|
|
21410
|
-
const
|
|
21516
|
+
const ProfitAndLossContext = createContext({
|
|
21517
|
+
data: void 0,
|
|
21518
|
+
filteredDataRevenue: [],
|
|
21519
|
+
filteredTotalRevenue: void 0,
|
|
21520
|
+
filteredDataExpenses: [],
|
|
21521
|
+
filteredTotalExpenses: void 0,
|
|
21522
|
+
isLoading: true,
|
|
21523
|
+
isValidating: false,
|
|
21524
|
+
isError: false,
|
|
21525
|
+
dateRange: {
|
|
21526
|
+
startDate: startOfMonth(/* @__PURE__ */ new Date()),
|
|
21527
|
+
endDate: endOfMonth(/* @__PURE__ */ new Date())
|
|
21528
|
+
},
|
|
21529
|
+
refetch: () => {
|
|
21530
|
+
},
|
|
21531
|
+
sidebarScope: void 0,
|
|
21532
|
+
setSidebarScope: () => {
|
|
21533
|
+
},
|
|
21534
|
+
sortBy: () => {
|
|
21535
|
+
},
|
|
21536
|
+
setFilterTypes: () => {
|
|
21537
|
+
},
|
|
21538
|
+
filters: {
|
|
21539
|
+
expenses: void 0,
|
|
21540
|
+
revenue: void 0
|
|
21541
|
+
},
|
|
21542
|
+
tagFilter: void 0,
|
|
21543
|
+
selectedLineItem: null,
|
|
21544
|
+
setSelectedLineItem: () => {
|
|
21545
|
+
},
|
|
21546
|
+
setDisplayMode: () => {
|
|
21547
|
+
},
|
|
21548
|
+
displayMode: "month"
|
|
21549
|
+
});
|
|
21411
21550
|
const isNotOnlyNoneTag = (compareOptions) => {
|
|
21412
21551
|
return Boolean(
|
|
21413
21552
|
compareOptions == null ? void 0 : compareOptions.some((option) => option.tagFilterConfig.tagFilters !== "None")
|
|
@@ -21436,16 +21575,24 @@ function useProfitAndLossComparison({
|
|
|
21436
21575
|
reportingBasis,
|
|
21437
21576
|
comparisonConfig
|
|
21438
21577
|
}) {
|
|
21439
|
-
var _a
|
|
21440
|
-
const [
|
|
21578
|
+
var _a;
|
|
21579
|
+
const [comparisonPeriodMode, setComparisonPeriodMode] = useState(DateGroupBy.AllTime);
|
|
21580
|
+
const { displayMode } = useContext(ProfitAndLossContext);
|
|
21581
|
+
const { startDate, endDate } = useGlobalDateRange({ displayMode: "month" });
|
|
21582
|
+
const comparePeriods = useMemo(() => {
|
|
21583
|
+
if (!comparisonPeriodMode || comparisonPeriodMode === DateGroupBy.AllTime) {
|
|
21584
|
+
return 1;
|
|
21585
|
+
}
|
|
21586
|
+
if (comparisonPeriodMode === DateGroupBy.Year) {
|
|
21587
|
+
return Math.abs(differenceInCalendarYears(endDate, startDate)) + 1;
|
|
21588
|
+
}
|
|
21589
|
+
return Math.abs(differenceInCalendarMonths(endDate, startDate)) + 1;
|
|
21590
|
+
}, [comparisonPeriodMode, endDate, startDate]);
|
|
21441
21591
|
const [selectedCompareOptions, setSelectedCompareOptionsState] = useState(
|
|
21442
21592
|
(comparisonConfig == null ? void 0 : comparisonConfig.defaultTagFilter) ? [comparisonConfig == null ? void 0 : comparisonConfig.defaultTagFilter] : []
|
|
21443
21593
|
);
|
|
21444
|
-
const
|
|
21445
|
-
const
|
|
21446
|
-
const isPeriodsSelectEnabled = COMPARE_MODES_SUPPORTING_MULTI_PERIOD.includes(rangeDisplayMode);
|
|
21447
|
-
const effectiveComparePeriods = isPeriodsSelectEnabled ? comparePeriods : 1;
|
|
21448
|
-
const compareModeActive = useMemo(() => effectiveComparePeriods > 1 || selectedCompareOptions.length > 1 || selectedCompareOptions.length === 1 && isNotOnlyNoneTag(selectedCompareOptions), [effectiveComparePeriods, selectedCompareOptions]);
|
|
21594
|
+
const dateRange = useGlobalDateRange({ displayMode });
|
|
21595
|
+
const compareModeActive = useMemo(() => comparePeriods > 1 || selectedCompareOptions.length > 1 || selectedCompareOptions.length === 1 && isNotOnlyNoneTag(selectedCompareOptions), [comparePeriods, selectedCompareOptions]);
|
|
21449
21596
|
const setSelectedCompareOptions = (values) => {
|
|
21450
21597
|
const options2 = values.map(
|
|
21451
21598
|
(option) => comparisonConfig == null ? void 0 : comparisonConfig.tagComparisonOptions.find(
|
|
@@ -21461,7 +21608,7 @@ function useProfitAndLossComparison({
|
|
|
21461
21608
|
const { businessId } = useLayerContext();
|
|
21462
21609
|
const { apiUrl } = useEnvironment();
|
|
21463
21610
|
const { data: auth } = useAuth();
|
|
21464
|
-
const periods = preparePeriodsBody(dateRange,
|
|
21611
|
+
const periods = preparePeriodsBody(dateRange, comparePeriods, comparisonPeriodMode);
|
|
21465
21612
|
const tagFilters = prepareFiltersBody(selectedCompareOptions);
|
|
21466
21613
|
const queryKey = buildKey$v(__spreadProps(__spreadValues({}, auth), {
|
|
21467
21614
|
businessId,
|
|
@@ -21487,7 +21634,7 @@ function useProfitAndLossComparison({
|
|
|
21487
21634
|
})
|
|
21488
21635
|
);
|
|
21489
21636
|
const getProfitAndLossComparisonCsv = (dateRange2, moneyFormat) => {
|
|
21490
|
-
const periods2 = preparePeriodsBody(dateRange2,
|
|
21637
|
+
const periods2 = preparePeriodsBody(dateRange2, comparePeriods, comparisonPeriodMode);
|
|
21491
21638
|
const tagFilters2 = prepareFiltersBody(selectedCompareOptions);
|
|
21492
21639
|
return Layer.profitAndLossComparisonCsv(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
21493
21640
|
params: {
|
|
@@ -21505,15 +21652,15 @@ function useProfitAndLossComparison({
|
|
|
21505
21652
|
data: data == null ? void 0 : data.pnls,
|
|
21506
21653
|
isLoading,
|
|
21507
21654
|
isValidating,
|
|
21508
|
-
isPeriodsSelectEnabled,
|
|
21509
21655
|
compareModeActive,
|
|
21510
|
-
comparePeriods
|
|
21511
|
-
|
|
21512
|
-
compareOptions: (_b = comparisonConfig == null ? void 0 : comparisonConfig.tagComparisonOptions) != null ? _b : [],
|
|
21656
|
+
comparePeriods,
|
|
21657
|
+
compareOptions: (_a = comparisonConfig == null ? void 0 : comparisonConfig.tagComparisonOptions) != null ? _a : [],
|
|
21513
21658
|
selectedCompareOptions,
|
|
21514
21659
|
setSelectedCompareOptions,
|
|
21515
21660
|
getProfitAndLossComparisonCsv,
|
|
21516
|
-
comparisonConfig
|
|
21661
|
+
comparisonConfig,
|
|
21662
|
+
comparisonPeriodMode,
|
|
21663
|
+
setComparisonPeriodMode
|
|
21517
21664
|
};
|
|
21518
21665
|
}
|
|
21519
21666
|
const getYearMonthKey = (y, m) => {
|
|
@@ -21604,8 +21751,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
21604
21751
|
refetch
|
|
21605
21752
|
};
|
|
21606
21753
|
};
|
|
21607
|
-
const BarChart2 = (
|
|
21608
|
-
var
|
|
21754
|
+
const BarChart2 = (_sc) => {
|
|
21755
|
+
var _tc = _sc, { size = 12 } = _tc, props = __objRest(_tc, ["size"]);
|
|
21609
21756
|
return /* @__PURE__ */ jsxs(
|
|
21610
21757
|
"svg",
|
|
21611
21758
|
__spreadProps(__spreadValues({
|
|
@@ -21773,10 +21920,8 @@ const ProfitAndLossChart = ({
|
|
|
21773
21920
|
const [compactView, setCompactView] = useState(false);
|
|
21774
21921
|
const barSize = compactView ? 10 : 20;
|
|
21775
21922
|
const { getColor, business } = useLayerContext();
|
|
21776
|
-
const
|
|
21777
|
-
const dateRange = useGlobalDateRange({ displayMode: rangeDisplayMode });
|
|
21923
|
+
const dateRange = useGlobalDateRange({ displayMode: "month" });
|
|
21778
21924
|
const { setMonth } = useGlobalDateRangeActions();
|
|
21779
|
-
const showIndicator = rangeDisplayMode === "monthPicker";
|
|
21780
21925
|
const [customCursorSize, setCustomCursorSize] = useState({
|
|
21781
21926
|
width: 0,
|
|
21782
21927
|
height: 0,
|
|
@@ -22272,7 +22417,7 @@ const ProfitAndLossChart = ({
|
|
|
22272
22417
|
xAxisId: "revenue",
|
|
22273
22418
|
stackId: "revenue",
|
|
22274
22419
|
children: [
|
|
22275
|
-
|
|
22420
|
+
/* @__PURE__ */ jsx(
|
|
22276
22421
|
LabelList,
|
|
22277
22422
|
{
|
|
22278
22423
|
content: /* @__PURE__ */ jsx(
|
|
@@ -22283,7 +22428,7 @@ const ProfitAndLossChart = ({
|
|
|
22283
22428
|
}
|
|
22284
22429
|
)
|
|
22285
22430
|
}
|
|
22286
|
-
)
|
|
22431
|
+
),
|
|
22287
22432
|
dataOrPlaceholderData.map((entry) => {
|
|
22288
22433
|
return /* @__PURE__ */ jsx(
|
|
22289
22434
|
Cell$2,
|
|
@@ -22397,11 +22542,11 @@ const ProfitAndLossChart = ({
|
|
|
22397
22542
|
isSyncing && !hasNonZeroData ? /* @__PURE__ */ jsx(ChartStateCard, {}) : null
|
|
22398
22543
|
] });
|
|
22399
22544
|
};
|
|
22400
|
-
const BackButton = (
|
|
22401
|
-
var
|
|
22545
|
+
const BackButton = (_uc) => {
|
|
22546
|
+
var _vc = _uc, {
|
|
22402
22547
|
className,
|
|
22403
22548
|
textOnly = false
|
|
22404
|
-
} =
|
|
22549
|
+
} = _vc, props = __objRest(_vc, [
|
|
22405
22550
|
"className",
|
|
22406
22551
|
"textOnly"
|
|
22407
22552
|
]);
|
|
@@ -22426,8 +22571,8 @@ const TASKS_CHARTS_COLORS = {
|
|
|
22426
22571
|
done: "#3B9C63",
|
|
22427
22572
|
pending: "#DFA000"
|
|
22428
22573
|
};
|
|
22429
|
-
const SortArrows = (
|
|
22430
|
-
var
|
|
22574
|
+
const SortArrows = (_wc) => {
|
|
22575
|
+
var _xc = _wc, { size = 13 } = _xc, props = __objRest(_xc, ["size"]);
|
|
22431
22576
|
return /* @__PURE__ */ jsxs(
|
|
22432
22577
|
"svg",
|
|
22433
22578
|
__spreadProps(__spreadValues({
|
|
@@ -23198,11 +23343,11 @@ const Header = forwardRef(
|
|
|
23198
23343
|
}
|
|
23199
23344
|
);
|
|
23200
23345
|
Header.displayName = "Header";
|
|
23201
|
-
const CloseButton = (
|
|
23202
|
-
var
|
|
23346
|
+
const CloseButton = (_yc) => {
|
|
23347
|
+
var _zc = _yc, {
|
|
23203
23348
|
className,
|
|
23204
23349
|
textOnly = false
|
|
23205
|
-
} =
|
|
23350
|
+
} = _zc, props = __objRest(_zc, [
|
|
23206
23351
|
"className",
|
|
23207
23352
|
"textOnly"
|
|
23208
23353
|
]);
|
|
@@ -23687,37 +23832,6 @@ const DetailReportBreadcrumb = ({
|
|
|
23687
23832
|
subtitle && /* @__PURE__ */ jsx(Span, { size: "sm", variant: "subtle", children: subtitle })
|
|
23688
23833
|
] }) }) });
|
|
23689
23834
|
};
|
|
23690
|
-
const ProfitAndLossContext = createContext({
|
|
23691
|
-
data: void 0,
|
|
23692
|
-
filteredDataRevenue: [],
|
|
23693
|
-
filteredTotalRevenue: void 0,
|
|
23694
|
-
filteredDataExpenses: [],
|
|
23695
|
-
filteredTotalExpenses: void 0,
|
|
23696
|
-
isLoading: true,
|
|
23697
|
-
isValidating: false,
|
|
23698
|
-
isError: false,
|
|
23699
|
-
dateRange: {
|
|
23700
|
-
startDate: startOfMonth(/* @__PURE__ */ new Date()),
|
|
23701
|
-
endDate: endOfMonth(/* @__PURE__ */ new Date())
|
|
23702
|
-
},
|
|
23703
|
-
refetch: () => {
|
|
23704
|
-
},
|
|
23705
|
-
sidebarScope: void 0,
|
|
23706
|
-
setSidebarScope: () => {
|
|
23707
|
-
},
|
|
23708
|
-
sortBy: () => {
|
|
23709
|
-
},
|
|
23710
|
-
setFilterTypes: () => {
|
|
23711
|
-
},
|
|
23712
|
-
filters: {
|
|
23713
|
-
expenses: void 0,
|
|
23714
|
-
revenue: void 0
|
|
23715
|
-
},
|
|
23716
|
-
tagFilter: void 0,
|
|
23717
|
-
selectedLineItem: null,
|
|
23718
|
-
setSelectedLineItem: () => {
|
|
23719
|
-
}
|
|
23720
|
-
});
|
|
23721
23835
|
const COMPONENT_NAME$8 = "ProfitAndLossDetailReport";
|
|
23722
23836
|
const ErrorState = () => /* @__PURE__ */ jsx(
|
|
23723
23837
|
DataState,
|
|
@@ -24098,11 +24212,8 @@ const ProfitAndLossComparisonContext = createContext({
|
|
|
24098
24212
|
data: void 0,
|
|
24099
24213
|
isLoading: true,
|
|
24100
24214
|
isValidating: false,
|
|
24101
|
-
isPeriodsSelectEnabled: true,
|
|
24102
24215
|
compareModeActive: false,
|
|
24103
24216
|
comparePeriods: 0,
|
|
24104
|
-
setComparePeriods: () => {
|
|
24105
|
-
},
|
|
24106
24217
|
compareOptions: [],
|
|
24107
24218
|
selectedCompareOptions: [],
|
|
24108
24219
|
setSelectedCompareOptions: function() {
|
|
@@ -24111,7 +24222,10 @@ const ProfitAndLossComparisonContext = createContext({
|
|
|
24111
24222
|
getProfitAndLossComparisonCsv: function() {
|
|
24112
24223
|
throw new Error("Function not implemented.");
|
|
24113
24224
|
},
|
|
24114
|
-
comparisonConfig: void 0
|
|
24225
|
+
comparisonConfig: void 0,
|
|
24226
|
+
comparisonPeriodMode: null,
|
|
24227
|
+
setComparisonPeriodMode: () => {
|
|
24228
|
+
}
|
|
24115
24229
|
});
|
|
24116
24230
|
const ProfitAndLossFullReportDownloadButton = ({
|
|
24117
24231
|
stringOverrides,
|
|
@@ -24443,7 +24557,7 @@ const options$2 = Object.values(dateSelectionOptionConfig).filter((opt) => opt.v
|
|
|
24443
24557
|
const DateSelectionComboBox = () => {
|
|
24444
24558
|
const [lastPreset, setLastPreset] = useState(null);
|
|
24445
24559
|
const { business } = useLayerContext();
|
|
24446
|
-
const dateRange = useGlobalDateRange({ displayMode: "
|
|
24560
|
+
const dateRange = useGlobalDateRange({ displayMode: "full" });
|
|
24447
24561
|
const { setDateRange } = useGlobalDateRangeActions();
|
|
24448
24562
|
const selectedPreset = presetForDateRange(dateRange, lastPreset, getActivationDate(business));
|
|
24449
24563
|
const selectedOption = dateSelectionOptionConfig[selectedPreset != null ? selectedPreset : DatePreset.Custom];
|
|
@@ -24467,7 +24581,7 @@ const DateSelectionComboBox = () => {
|
|
|
24467
24581
|
);
|
|
24468
24582
|
};
|
|
24469
24583
|
const DateRangeSelection = ({ minDate, maxDate }) => {
|
|
24470
|
-
const { startDate: globalStartDate, endDate: globalEndDate } = useGlobalDateRange({ displayMode: "
|
|
24584
|
+
const { startDate: globalStartDate, endDate: globalEndDate } = useGlobalDateRange({ displayMode: "full" });
|
|
24471
24585
|
const { setDateRange: setGlobalDateRange } = useGlobalDateRangeActions();
|
|
24472
24586
|
const { value } = useSizeClass();
|
|
24473
24587
|
const {
|
|
@@ -24739,26 +24853,32 @@ const useTableExpandRow = () => {
|
|
|
24739
24853
|
toggleAllRows
|
|
24740
24854
|
};
|
|
24741
24855
|
};
|
|
24742
|
-
const generateComparisonPeriods = (
|
|
24743
|
-
switch (
|
|
24744
|
-
case
|
|
24745
|
-
return generateComparisonYears(
|
|
24856
|
+
const generateComparisonPeriods = (params) => {
|
|
24857
|
+
switch (params.mode) {
|
|
24858
|
+
case DateGroupBy.Year:
|
|
24859
|
+
return generateComparisonYears(params.endDate, params.numberOfPeriods);
|
|
24860
|
+
case DateGroupBy.Month:
|
|
24861
|
+
return generateComparisonMonths(params.endDate, params.numberOfPeriods);
|
|
24746
24862
|
default:
|
|
24747
|
-
return
|
|
24863
|
+
return generateComparisonDateRange(params.startDate, params.endDate);
|
|
24748
24864
|
}
|
|
24749
24865
|
};
|
|
24750
|
-
const generateComparisonMonths = (
|
|
24866
|
+
const generateComparisonMonths = (endDate, numberOfMonths) => {
|
|
24751
24867
|
return Array.from({ length: numberOfMonths }, (_, index) => {
|
|
24752
|
-
const currentMonth = subMonths(
|
|
24753
|
-
return { date: currentMonth, label: format(currentMonth, "MMM") };
|
|
24868
|
+
const currentMonth = subMonths(endDate, numberOfMonths - index - 1);
|
|
24869
|
+
return { date: currentMonth, label: format(currentMonth, "MMM yyyy") };
|
|
24754
24870
|
});
|
|
24755
24871
|
};
|
|
24756
|
-
const generateComparisonYears = (
|
|
24872
|
+
const generateComparisonYears = (endDate, numberOfYears) => {
|
|
24757
24873
|
return Array.from({ length: numberOfYears }, (_, index) => {
|
|
24758
|
-
const currentMonth = subYears(
|
|
24874
|
+
const currentMonth = subYears(endDate, numberOfYears - index - 1);
|
|
24759
24875
|
return { date: currentMonth, label: format(currentMonth, "yyyy") };
|
|
24760
24876
|
});
|
|
24761
24877
|
};
|
|
24878
|
+
const generateComparisonDateRange = (startDate, endDate) => {
|
|
24879
|
+
const label = `${format(startDate, DATE_FORMAT$1)} - ${format(endDate, DATE_FORMAT$1)}`;
|
|
24880
|
+
return [{ date: startDate, endDate, label }];
|
|
24881
|
+
};
|
|
24762
24882
|
const getComparisonValue = (name, depth, cellData) => {
|
|
24763
24883
|
if (depth === 0) {
|
|
24764
24884
|
if (typeof cellData === "string" || typeof cellData === "number") {
|
|
@@ -24815,30 +24935,24 @@ const mergeComparisonLineItemsAtDepth = (lineItems) => {
|
|
|
24815
24935
|
const ProfitAndLossCompareTable = ({
|
|
24816
24936
|
stringOverrides
|
|
24817
24937
|
}) => {
|
|
24938
|
+
const { dateRange, displayMode } = useContext(ProfitAndLossContext);
|
|
24818
24939
|
const {
|
|
24819
24940
|
data: comparisonData,
|
|
24820
24941
|
isLoading,
|
|
24821
24942
|
comparePeriods,
|
|
24822
|
-
selectedCompareOptions
|
|
24943
|
+
selectedCompareOptions,
|
|
24944
|
+
comparisonPeriodMode
|
|
24823
24945
|
} = useContext(ProfitAndLossComparisonContext);
|
|
24824
24946
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
24825
24947
|
const { data: bookkeepingPeriods } = useBookkeepingPeriods();
|
|
24826
|
-
const rangeDisplayMode = useReportModeWithFallback(ReportKey.ProfitAndLoss, "monthPicker");
|
|
24827
|
-
const dateRange = useGlobalDateRange({ displayMode: rangeDisplayMode });
|
|
24828
24948
|
useEffect(() => {
|
|
24829
24949
|
setIsOpen(["income", "cost_of_goods_sold", "expenses"]);
|
|
24830
24950
|
}, []);
|
|
24831
24951
|
if (isLoading || comparisonData === void 0) {
|
|
24832
|
-
return /* @__PURE__ */ jsx(
|
|
24833
|
-
"div",
|
|
24834
|
-
{
|
|
24835
|
-
className: classNames("Layer__profit-and-loss-table__loader-container"),
|
|
24836
|
-
children: /* @__PURE__ */ jsx(Loader, {})
|
|
24837
|
-
}
|
|
24838
|
-
);
|
|
24952
|
+
return /* @__PURE__ */ jsx("div", { className: "Layer__profit-and-loss-table__loader-container", children: /* @__PURE__ */ jsx(Loader, {}) });
|
|
24839
24953
|
}
|
|
24840
24954
|
const getBookkeepingPeriodStatus = (date) => {
|
|
24841
|
-
if (!bookkeepingPeriods ||
|
|
24955
|
+
if (!bookkeepingPeriods || displayMode !== "month") {
|
|
24842
24956
|
return;
|
|
24843
24957
|
}
|
|
24844
24958
|
const currentMonth = date.getMonth() + 1;
|
|
@@ -24880,7 +24994,16 @@ const ProfitAndLossCompareTable = ({
|
|
|
24880
24994
|
variant: expandable ? "expandable" : "default",
|
|
24881
24995
|
handleExpand: () => setIsOpen(rowKey),
|
|
24882
24996
|
children: [
|
|
24883
|
-
/* @__PURE__ */ jsx(
|
|
24997
|
+
/* @__PURE__ */ jsx(
|
|
24998
|
+
TableCell,
|
|
24999
|
+
{
|
|
25000
|
+
primary: true,
|
|
25001
|
+
withExpandIcon: expandable,
|
|
25002
|
+
nowrap: true,
|
|
25003
|
+
className: "Layer__profit-and-loss-compare-table__sticky-cell",
|
|
25004
|
+
children: lineItem ? lineItem.display_name : rowDisplayName
|
|
25005
|
+
}
|
|
25006
|
+
),
|
|
24884
25007
|
rowData.map((cell, i) => /* @__PURE__ */ jsx(TableCell, { isCurrency: true, children: getComparisonValue(
|
|
24885
25008
|
lineItem ? lineItem.display_name : rowDisplayName,
|
|
24886
25009
|
depth,
|
|
@@ -24902,7 +25025,13 @@ const ProfitAndLossCompareTable = ({
|
|
|
24902
25025
|
};
|
|
24903
25026
|
return /* @__PURE__ */ jsxs(Table, { borderCollapse: "collapse", bottomSpacing: false, children: [
|
|
24904
25027
|
/* @__PURE__ */ jsx(TableHead, { children: selectedCompareOptions && selectedCompareOptions.length > 1 && /* @__PURE__ */ jsxs(TableRow, { rowKey: "", children: [
|
|
24905
|
-
/* @__PURE__ */ jsx(
|
|
25028
|
+
/* @__PURE__ */ jsx(
|
|
25029
|
+
TableCell,
|
|
25030
|
+
{
|
|
25031
|
+
isHeaderCell: true,
|
|
25032
|
+
className: "Layer__profit-and-loss-compare-table__sticky-cell"
|
|
25033
|
+
}
|
|
25034
|
+
),
|
|
24906
25035
|
selectedCompareOptions.map((option, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
24907
25036
|
/* @__PURE__ */ jsx(TableCell, { primary: true, isHeaderCell: true, children: option.displayName }, option.displayName + "-" + i),
|
|
24908
25037
|
comparePeriods && Array.from({ length: comparePeriods - 1 }, (_, index) => /* @__PURE__ */ jsx(TableCell, { isHeaderCell: true }, option.displayName + "-" + index))
|
|
@@ -24910,20 +25039,24 @@ const ProfitAndLossCompareTable = ({
|
|
|
24910
25039
|
] }) }),
|
|
24911
25040
|
/* @__PURE__ */ jsxs(TableBody, { children: [
|
|
24912
25041
|
comparePeriods && /* @__PURE__ */ jsxs(TableRow, { rowKey: "", children: [
|
|
24913
|
-
/* @__PURE__ */ jsx(
|
|
24914
|
-
|
|
24915
|
-
|
|
24916
|
-
|
|
24917
|
-
|
|
24918
|
-
|
|
25042
|
+
/* @__PURE__ */ jsx(
|
|
25043
|
+
TableCell,
|
|
25044
|
+
{
|
|
25045
|
+
isHeaderCell: true,
|
|
25046
|
+
className: "Layer__profit-and-loss-compare-table__sticky-cell"
|
|
25047
|
+
}
|
|
25048
|
+
),
|
|
25049
|
+
selectedCompareOptions && selectedCompareOptions.length > 0 ? selectedCompareOptions.map((option, i) => /* @__PURE__ */ jsx(Fragment$1, { children: generateComparisonPeriods(__spreadValues({
|
|
25050
|
+
numberOfPeriods: comparePeriods,
|
|
25051
|
+
mode: comparisonPeriodMode
|
|
25052
|
+
}, dateRange)).map((month, index) => /* @__PURE__ */ jsx(TableCell, { isHeaderCell: true, children: /* @__PURE__ */ jsxs(HStack, { gap: "2xs", children: [
|
|
24919
25053
|
month.label,
|
|
24920
25054
|
" ",
|
|
24921
25055
|
getBookkeepingPeriodStatus(month.date)
|
|
24922
|
-
] }) }, option.displayName + "-" + index)) }, option.displayName + "-" + i)) : /* @__PURE__ */ jsx(Fragment$1, { children: generateComparisonPeriods(
|
|
24923
|
-
|
|
24924
|
-
|
|
24925
|
-
|
|
24926
|
-
).map((month, index) => /* @__PURE__ */ jsx(TableCell, { isHeaderCell: true, children: month.label }, "total-" + index + "-cell")) }, "total-1")
|
|
25056
|
+
] }) }, option.displayName + "-" + index)) }, option.displayName + "-" + i)) : /* @__PURE__ */ jsx(Fragment$1, { children: generateComparisonPeriods(__spreadValues({
|
|
25057
|
+
numberOfPeriods: comparePeriods,
|
|
25058
|
+
mode: comparisonPeriodMode
|
|
25059
|
+
}, dateRange)).map((month, index) => /* @__PURE__ */ jsx(TableCell, { isHeaderCell: true, children: month.label }, "total-" + index + "-cell")) }, "total-1")
|
|
24927
25060
|
] }),
|
|
24928
25061
|
renderRow("income", 0, "Income"),
|
|
24929
25062
|
renderRow("cost_of_goods_sold", 0, "Cost of Goods Sold"),
|
|
@@ -25201,44 +25334,16 @@ const selectStyles = {
|
|
|
25201
25334
|
});
|
|
25202
25335
|
}
|
|
25203
25336
|
};
|
|
25204
|
-
function buildCompareOptions(rangeDisplayMode) {
|
|
25205
|
-
switch (rangeDisplayMode) {
|
|
25206
|
-
case "monthPicker":
|
|
25207
|
-
return [
|
|
25208
|
-
{ value: 1, label: "This month" },
|
|
25209
|
-
{ value: 2, label: "Last 2 months" },
|
|
25210
|
-
{ value: 3, label: "Last 3 months" }
|
|
25211
|
-
];
|
|
25212
|
-
case "yearPicker":
|
|
25213
|
-
return [
|
|
25214
|
-
{ value: 1, label: "This year" },
|
|
25215
|
-
{ value: 2, label: "Last 2 years" },
|
|
25216
|
-
{ value: 3, label: "Last 3 years" }
|
|
25217
|
-
];
|
|
25218
|
-
default:
|
|
25219
|
-
return [
|
|
25220
|
-
{ value: 1, label: "This period" },
|
|
25221
|
-
{ value: 2, label: "Last 2 periods" },
|
|
25222
|
-
{ value: 3, label: "Last 3 periods" }
|
|
25223
|
-
];
|
|
25224
|
-
}
|
|
25225
|
-
}
|
|
25226
25337
|
const ProfitAndLossCompareOptions = () => {
|
|
25227
25338
|
const {
|
|
25228
|
-
setComparePeriods,
|
|
25229
25339
|
setSelectedCompareOptions,
|
|
25230
|
-
isPeriodsSelectEnabled,
|
|
25231
|
-
comparePeriods,
|
|
25232
25340
|
compareOptions,
|
|
25233
25341
|
selectedCompareOptions,
|
|
25234
|
-
comparisonConfig
|
|
25342
|
+
comparisonConfig,
|
|
25343
|
+
comparisonPeriodMode,
|
|
25344
|
+
setComparisonPeriodMode
|
|
25235
25345
|
} = useContext(ProfitAndLossComparisonContext);
|
|
25236
|
-
const
|
|
25237
|
-
const periods = useMemo(
|
|
25238
|
-
() => comparePeriods !== 0 ? comparePeriods : 1,
|
|
25239
|
-
[comparePeriods]
|
|
25240
|
-
);
|
|
25241
|
-
const timeComparisonOptions = buildCompareOptions(rangeDisplayMode);
|
|
25346
|
+
const { displayMode } = useContext(ProfitAndLossContext);
|
|
25242
25347
|
const tagComparisonSelectOptions = compareOptions.map(
|
|
25243
25348
|
(tagComparisonOption) => {
|
|
25244
25349
|
return {
|
|
@@ -25250,19 +25355,8 @@ const ProfitAndLossCompareOptions = () => {
|
|
|
25250
25355
|
if (!comparisonConfig) {
|
|
25251
25356
|
return null;
|
|
25252
25357
|
}
|
|
25253
|
-
return /* @__PURE__ */ jsxs(
|
|
25254
|
-
/* @__PURE__ */ jsx(
|
|
25255
|
-
Select,
|
|
25256
|
-
{
|
|
25257
|
-
options: timeComparisonOptions,
|
|
25258
|
-
onChange: (e) => setComparePeriods(e && e.value ? e.value : 1),
|
|
25259
|
-
value: timeComparisonOptions.find(
|
|
25260
|
-
(option) => option.value === periods
|
|
25261
|
-
),
|
|
25262
|
-
placeholder: rangeDisplayMode === "yearPicker" ? "Compare years" : "Compare months",
|
|
25263
|
-
disabled: !isPeriodsSelectEnabled
|
|
25264
|
-
}
|
|
25265
|
-
),
|
|
25358
|
+
return /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
|
|
25359
|
+
displayMode === "full" && /* @__PURE__ */ jsx(DateGroupByComboBox, { value: comparisonPeriodMode, onValueChange: setComparisonPeriodMode }),
|
|
25266
25360
|
/* @__PURE__ */ jsx(
|
|
25267
25361
|
MultiSelect,
|
|
25268
25362
|
{
|
|
@@ -25279,7 +25373,8 @@ const ProfitAndLossCompareOptions = () => {
|
|
|
25279
25373
|
};
|
|
25280
25374
|
}),
|
|
25281
25375
|
placeholder: "Select views",
|
|
25282
|
-
styles: selectStyles
|
|
25376
|
+
styles: selectStyles,
|
|
25377
|
+
className: "Layer__ProfitAndLoss__TagMultiSelect"
|
|
25283
25378
|
}
|
|
25284
25379
|
)
|
|
25285
25380
|
] });
|
|
@@ -25293,8 +25388,11 @@ const ProfitAndLossReport = ({
|
|
|
25293
25388
|
hideHeader
|
|
25294
25389
|
}) => {
|
|
25295
25390
|
var _a;
|
|
25296
|
-
const { selectedLineItem, setSelectedLineItem } = useContext(ProfitAndLossContext);
|
|
25391
|
+
const { selectedLineItem, setSelectedLineItem, setDisplayMode } = useContext(ProfitAndLossContext);
|
|
25297
25392
|
const { comparisonConfig } = useContext(ProfitAndLossComparisonContext);
|
|
25393
|
+
useEffect(() => {
|
|
25394
|
+
setDisplayMode(dateSelectionMode);
|
|
25395
|
+
}, [dateSelectionMode, setDisplayMode]);
|
|
25298
25396
|
const breadcrumbIndexMap = useMemo(() => {
|
|
25299
25397
|
if (!selectedLineItem) return {};
|
|
25300
25398
|
return selectedLineItem.breadcrumbPath.reduce((acc, item, index) => {
|
|
@@ -25417,13 +25515,13 @@ function toMiniChartData({
|
|
|
25417
25515
|
function ProfitAndLossSummariesMiniChart({
|
|
25418
25516
|
data,
|
|
25419
25517
|
chartColorsList,
|
|
25420
|
-
variants
|
|
25518
|
+
variants: variants2
|
|
25421
25519
|
}) {
|
|
25422
25520
|
const typeColorMapping = mapTypesToColors(data, chartColorsList);
|
|
25423
25521
|
let chartDimension = 52;
|
|
25424
25522
|
let innerRadius = 10;
|
|
25425
25523
|
let outerRadius = 16;
|
|
25426
|
-
switch (
|
|
25524
|
+
switch (variants2 == null ? void 0 : variants2.size) {
|
|
25427
25525
|
case "sm":
|
|
25428
25526
|
chartDimension = 52;
|
|
25429
25527
|
innerRadius = 10;
|
|
@@ -25467,10 +25565,10 @@ function ProfitAndLossSummariesMiniChart({
|
|
|
25467
25565
|
) });
|
|
25468
25566
|
}
|
|
25469
25567
|
function ProfitAndLossSummariesHeading({
|
|
25470
|
-
variants,
|
|
25568
|
+
variants: variants2,
|
|
25471
25569
|
children
|
|
25472
25570
|
}) {
|
|
25473
|
-
const { size = "2xs" } =
|
|
25571
|
+
const { size = "2xs" } = variants2 != null ? variants2 : {};
|
|
25474
25572
|
return /* @__PURE__ */ jsx(Heading, { level: 3, size, slot: "heading", children });
|
|
25475
25573
|
}
|
|
25476
25574
|
const CLASS_NAME$3 = "Layer__ProfitAndLossSummariesSummary";
|
|
@@ -25481,14 +25579,14 @@ function ProfitAndLossSummariesSummary({
|
|
|
25481
25579
|
amount,
|
|
25482
25580
|
isLoading,
|
|
25483
25581
|
slots,
|
|
25484
|
-
variants
|
|
25582
|
+
variants: variants2
|
|
25485
25583
|
}) {
|
|
25486
25584
|
const { Chart } = slots != null ? slots : {};
|
|
25487
|
-
const { size = "2xs" } =
|
|
25585
|
+
const { size = "2xs" } = variants2 != null ? variants2 : {};
|
|
25488
25586
|
const dataProperties = toDataProperties({ size });
|
|
25489
25587
|
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ className: CLASS_NAME$3 }, dataProperties), { children: [
|
|
25490
25588
|
Chart ? /* @__PURE__ */ jsx("div", { className: CHART_AREA_CLASS_NAME, children: Chart }) : /* @__PURE__ */ jsx("div", { className: CHART_AREA_EMPTY_FRAME_CLASS_NAME }),
|
|
25491
|
-
/* @__PURE__ */ jsx(ProfitAndLossSummariesHeading, { variants, children: label }),
|
|
25589
|
+
/* @__PURE__ */ jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: label }),
|
|
25492
25590
|
isLoading ? /* @__PURE__ */ jsx(SkeletonLoader, { height: "20px" }) : /* @__PURE__ */ jsx(MoneySpan, { slot: "amount", amount, size: "lg", bold: true })
|
|
25493
25591
|
] }));
|
|
25494
25592
|
}
|
|
@@ -25497,10 +25595,10 @@ function TransactionsToReview({
|
|
|
25497
25595
|
onClick,
|
|
25498
25596
|
usePnlDateRange,
|
|
25499
25597
|
tagFilter = void 0,
|
|
25500
|
-
variants
|
|
25598
|
+
variants: variants2
|
|
25501
25599
|
}) {
|
|
25502
25600
|
var _a;
|
|
25503
|
-
const { size = "sm" } =
|
|
25601
|
+
const { size = "sm" } = variants2 != null ? variants2 : {};
|
|
25504
25602
|
const { dateRange: contextDateRange } = useContext(ProfitAndLossContext);
|
|
25505
25603
|
const dateRange = usePnlDateRange ? contextDateRange : void 0;
|
|
25506
25604
|
const currentDate = useMemo(() => dateRange ? dateRange.startDate : startOfMonth(/* @__PURE__ */ new Date()), [dateRange]);
|
|
@@ -25574,7 +25672,7 @@ function TransactionsToReview({
|
|
|
25574
25672
|
}
|
|
25575
25673
|
return /* @__PURE__ */ jsxs("div", { onClick, className: CLASS_NAME$2, children: [
|
|
25576
25674
|
/* @__PURE__ */ jsxs(VStack, { gap: verticalGap, align: "start", children: [
|
|
25577
|
-
/* @__PURE__ */ jsx(ProfitAndLossSummariesHeading, { variants, children: "Transactions to review" }),
|
|
25675
|
+
/* @__PURE__ */ jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: "Transactions to review" }),
|
|
25578
25676
|
transactionsToReviewBadge
|
|
25579
25677
|
] }),
|
|
25580
25678
|
/* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(ChevronRight, {}), withBorder: true, onClick })
|
|
@@ -25588,7 +25686,7 @@ function Internal_ProfitAndLossSummaries({
|
|
|
25588
25686
|
stringOverrides,
|
|
25589
25687
|
chartColorsList,
|
|
25590
25688
|
slots,
|
|
25591
|
-
variants
|
|
25689
|
+
variants: variants2
|
|
25592
25690
|
}) {
|
|
25593
25691
|
var _a, _b, _c, _d;
|
|
25594
25692
|
const {
|
|
@@ -25625,11 +25723,11 @@ function Internal_ProfitAndLossSummaries({
|
|
|
25625
25723
|
{
|
|
25626
25724
|
data: revenueChartData,
|
|
25627
25725
|
chartColorsList,
|
|
25628
|
-
variants
|
|
25726
|
+
variants: variants2
|
|
25629
25727
|
}
|
|
25630
25728
|
)
|
|
25631
25729
|
},
|
|
25632
|
-
variants
|
|
25730
|
+
variants: variants2
|
|
25633
25731
|
}
|
|
25634
25732
|
)
|
|
25635
25733
|
}
|
|
@@ -25651,11 +25749,11 @@ function Internal_ProfitAndLossSummaries({
|
|
|
25651
25749
|
{
|
|
25652
25750
|
data: expensesChartData,
|
|
25653
25751
|
chartColorsList,
|
|
25654
|
-
variants
|
|
25752
|
+
variants: variants2
|
|
25655
25753
|
}
|
|
25656
25754
|
)
|
|
25657
25755
|
},
|
|
25658
|
-
variants
|
|
25756
|
+
variants: variants2
|
|
25659
25757
|
}
|
|
25660
25758
|
)
|
|
25661
25759
|
}
|
|
@@ -25665,17 +25763,17 @@ function Internal_ProfitAndLossSummaries({
|
|
|
25665
25763
|
{
|
|
25666
25764
|
label: (stringOverrides == null ? void 0 : stringOverrides.netProfitLabel) || "Net Profit",
|
|
25667
25765
|
amount: (_d = data == null ? void 0 : data.netProfit) != null ? _d : 0,
|
|
25668
|
-
variants,
|
|
25766
|
+
variants: variants2,
|
|
25669
25767
|
isLoading
|
|
25670
25768
|
}
|
|
25671
25769
|
) }),
|
|
25672
25770
|
unstable_AdditionalListItems.map((item, index) => /* @__PURE__ */ jsx(ProfitAndLossSummariesListItem, { children: item }, index))
|
|
25673
25771
|
] }) });
|
|
25674
25772
|
}
|
|
25675
|
-
function ProfitAndLossSummaries(
|
|
25676
|
-
var
|
|
25773
|
+
function ProfitAndLossSummaries(_Ac) {
|
|
25774
|
+
var _Bc = _Ac, {
|
|
25677
25775
|
onTransactionsToReviewClick
|
|
25678
|
-
} =
|
|
25776
|
+
} = _Bc, restProps = __objRest(_Bc, [
|
|
25679
25777
|
"onTransactionsToReviewClick"
|
|
25680
25778
|
]);
|
|
25681
25779
|
return /* @__PURE__ */ jsx(
|
|
@@ -25697,7 +25795,7 @@ function ProfitAndLossSummaries(_yc) {
|
|
|
25697
25795
|
})
|
|
25698
25796
|
);
|
|
25699
25797
|
}
|
|
25700
|
-
const
|
|
25798
|
+
const ProfitAndLoss = ({
|
|
25701
25799
|
children,
|
|
25702
25800
|
tagFilter,
|
|
25703
25801
|
comparisonConfig,
|
|
@@ -25708,14 +25806,6 @@ const ProfitAndLossWithoutReportsModeProvider = ({
|
|
|
25708
25806
|
const comparisonContextData = useProfitAndLossComparison({ comparisonConfig, reportingBasis });
|
|
25709
25807
|
return /* @__PURE__ */ jsx(ProfitAndLossContext.Provider, { value: contextData, children: /* @__PURE__ */ jsx(ProfitAndLossComparisonContext.Provider, { value: comparisonContextData, children: asContainer ? /* @__PURE__ */ jsx(Container, { name: "profit-and-loss", children }) : children }) });
|
|
25710
25808
|
};
|
|
25711
|
-
const ProfitAndLossWithReportsModeProvider = (props) => {
|
|
25712
|
-
return /* @__PURE__ */ jsx(ReportsModeStoreProvider, { initialModes: { ProfitAndLoss: "monthPicker" }, children: /* @__PURE__ */ jsx(ProfitAndLossWithoutReportsModeProvider, __spreadValues({}, props)) });
|
|
25713
|
-
};
|
|
25714
|
-
const ProfitAndLoss = (_Ac) => {
|
|
25715
|
-
var _Bc = _Ac, { withReportsModeProvider = true } = _Bc, restProps = __objRest(_Bc, ["withReportsModeProvider"]);
|
|
25716
|
-
if (withReportsModeProvider) return /* @__PURE__ */ jsx(ProfitAndLossWithReportsModeProvider, __spreadValues({}, restProps));
|
|
25717
|
-
return /* @__PURE__ */ jsx(ProfitAndLossWithoutReportsModeProvider, __spreadValues({}, restProps));
|
|
25718
|
-
};
|
|
25719
25809
|
ProfitAndLoss.Chart = ProfitAndLossChart;
|
|
25720
25810
|
ProfitAndLoss.Summaries = ProfitAndLossSummaries;
|
|
25721
25811
|
ProfitAndLoss.DetailedCharts = ProfitAndLossDetailedCharts;
|
|
@@ -26120,9 +26210,6 @@ const CombinedDateSelection = ({ mode }) => {
|
|
|
26120
26210
|
return /* @__PURE__ */ jsx(DateSelection, {});
|
|
26121
26211
|
};
|
|
26122
26212
|
const COMPONENT_NAME$7 = "balance-sheet";
|
|
26123
|
-
const StandaloneBalanceSheet = (props) => {
|
|
26124
|
-
return /* @__PURE__ */ jsx(ReportsModeStoreProvider, { initialModes: { BalanceSheet: "dayPicker" }, children: /* @__PURE__ */ jsx(BalanceSheet, __spreadValues({}, props)) });
|
|
26125
|
-
};
|
|
26126
26213
|
const BalanceSheet = (props) => {
|
|
26127
26214
|
return /* @__PURE__ */ jsx(
|
|
26128
26215
|
BalanceSheetView,
|
|
@@ -26445,27 +26532,7 @@ function useStatementOfCashFlow({
|
|
|
26445
26532
|
)().then(({ data }) => data)
|
|
26446
26533
|
);
|
|
26447
26534
|
}
|
|
26448
|
-
const DEFAULT_ALLOWED_PICKER_MODES = ["monthPicker"];
|
|
26449
|
-
const getAllowedDateRangePickerModes = ({
|
|
26450
|
-
allowedDatePickerModes,
|
|
26451
|
-
defaultDatePickerMode
|
|
26452
|
-
}) => getArrayWithAtLeastOneOrFallback(
|
|
26453
|
-
allowedDatePickerModes != null ? allowedDatePickerModes : defaultDatePickerMode ? [defaultDatePickerMode] : [],
|
|
26454
|
-
DEFAULT_ALLOWED_PICKER_MODES
|
|
26455
|
-
);
|
|
26456
|
-
const getInitialDateRangePickerMode = ({
|
|
26457
|
-
allowedDatePickerModes,
|
|
26458
|
-
defaultDatePickerMode
|
|
26459
|
-
}) => {
|
|
26460
|
-
const allowedDateRangePickerModes = getAllowedDateRangePickerModes({ allowedDatePickerModes, defaultDatePickerMode });
|
|
26461
|
-
const initialRangeDisplayMode = defaultDatePickerMode && allowedDateRangePickerModes.includes(defaultDatePickerMode) ? defaultDatePickerMode : allowedDateRangePickerModes[0];
|
|
26462
|
-
return initialRangeDisplayMode;
|
|
26463
|
-
};
|
|
26464
26535
|
const COMPONENT_NAME$6 = "statement-of-cash-flow";
|
|
26465
|
-
const StandaloneStatementOfCashFlow = (props) => {
|
|
26466
|
-
const initialModeForStatementOfCashFlows = getInitialDateRangePickerMode(props);
|
|
26467
|
-
return /* @__PURE__ */ jsx(ReportsModeStoreProvider, { initialModes: { StatementOfCashFlows: initialModeForStatementOfCashFlows }, children: /* @__PURE__ */ jsx(StatementOfCashFlow, __spreadValues({}, props)) });
|
|
26468
|
-
};
|
|
26469
26536
|
const StatementOfCashFlow = (props) => {
|
|
26470
26537
|
return /* @__PURE__ */ jsx(StatementOfCashFlowView, __spreadValues({}, props));
|
|
26471
26538
|
};
|
|
@@ -26473,8 +26540,7 @@ const StatementOfCashFlowView = ({
|
|
|
26473
26540
|
stringOverrides,
|
|
26474
26541
|
dateSelectionMode = "full"
|
|
26475
26542
|
}) => {
|
|
26476
|
-
const
|
|
26477
|
-
const dateRange = useGlobalDateRange({ displayMode });
|
|
26543
|
+
const dateRange = useGlobalDateRange({ displayMode: dateSelectionMode });
|
|
26478
26544
|
const { data, isLoading } = useStatementOfCashFlow(dateRange);
|
|
26479
26545
|
const { view, containerRef } = useElementViewSize();
|
|
26480
26546
|
return /* @__PURE__ */ jsx(TableProvider, { children: /* @__PURE__ */ jsx(
|
|
@@ -27164,7 +27230,7 @@ const useChartOfAccounts = ({ withDates = false } = {}) => {
|
|
|
27164
27230
|
const { businessId } = useLayerContext();
|
|
27165
27231
|
const { apiUrl } = useEnvironment();
|
|
27166
27232
|
const { data: auth } = useAuth();
|
|
27167
|
-
const { startDate, endDate } = useGlobalDateRange({ displayMode: "
|
|
27233
|
+
const { startDate, endDate } = useGlobalDateRange({ displayMode: "month" });
|
|
27168
27234
|
const [form, setForm] = useState();
|
|
27169
27235
|
const [sendingForm, setSendingForm] = useState(false);
|
|
27170
27236
|
const [apiError, setApiError] = useState(void 0);
|
|
@@ -35077,7 +35143,7 @@ const ProjectProfitabilityView = ({
|
|
|
35077
35143
|
valueOptions,
|
|
35078
35144
|
showTitle,
|
|
35079
35145
|
stringOverrides,
|
|
35080
|
-
|
|
35146
|
+
dateSelectionMode = "month",
|
|
35081
35147
|
csvMoneyFormat = "DOLLAR_STRING"
|
|
35082
35148
|
}) => {
|
|
35083
35149
|
const [activeTab, setActiveTab] = useState("overview");
|
|
@@ -35170,7 +35236,7 @@ const ProjectProfitabilityView = ({
|
|
|
35170
35236
|
ProfitAndLoss.Report,
|
|
35171
35237
|
{
|
|
35172
35238
|
stringOverrides,
|
|
35173
|
-
|
|
35239
|
+
dateSelectionMode,
|
|
35174
35240
|
csvMoneyFormat
|
|
35175
35241
|
}
|
|
35176
35242
|
) })
|
|
@@ -37344,7 +37410,7 @@ function useUnifiedReportDateVariant() {
|
|
|
37344
37410
|
function useUnifiedReportWithDateParams() {
|
|
37345
37411
|
const store = useContext(UnifiedReportStoreContext);
|
|
37346
37412
|
const { date: effectiveDate } = useGlobalDate();
|
|
37347
|
-
const { startDate, endDate } = useGlobalDateRange({ displayMode: "
|
|
37413
|
+
const { startDate, endDate } = useGlobalDateRange({ displayMode: "full" });
|
|
37348
37414
|
const report = useStore(store, (state) => state.report);
|
|
37349
37415
|
const dateVariant = reportToDateVariantMap[report];
|
|
37350
37416
|
switch (dateVariant) {
|
|
@@ -37613,13 +37679,6 @@ const Reports = ({
|
|
|
37613
37679
|
const { view, containerRef } = useElementViewSize();
|
|
37614
37680
|
const options2 = getOptions(enabledReports);
|
|
37615
37681
|
const defaultTitle2 = enabledReports.length > 1 ? "Reports" : (_a = options2.find((option) => option.value === enabledReports[0])) == null ? void 0 : _a.label;
|
|
37616
|
-
const initialModeForProfitAndLoss = profitAndLossConfig ? getInitialDateRangePickerMode(profitAndLossConfig) : "monthPicker";
|
|
37617
|
-
const initialModeForStatementOfCashFlows = statementOfCashFlowConfig ? getInitialDateRangePickerMode(statementOfCashFlowConfig) : "monthPicker";
|
|
37618
|
-
const initialModes = {
|
|
37619
|
-
[ReportKey.ProfitAndLoss]: initialModeForProfitAndLoss,
|
|
37620
|
-
[ReportKey.BalanceSheet]: "dayPicker",
|
|
37621
|
-
[ReportKey.StatementOfCashFlows]: initialModeForStatementOfCashFlows
|
|
37622
|
-
};
|
|
37623
37682
|
return /* @__PURE__ */ jsxs(
|
|
37624
37683
|
View,
|
|
37625
37684
|
{
|
|
@@ -37635,7 +37694,7 @@ const Reports = ({
|
|
|
37635
37694
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
37636
37695
|
}
|
|
37637
37696
|
) }),
|
|
37638
|
-
/* @__PURE__ */ jsx(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ jsx(
|
|
37697
|
+
/* @__PURE__ */ jsx(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ jsx(ProfitAndLoss, { asContainer: false, comparisonConfig, children: /* @__PURE__ */ jsx(
|
|
37639
37698
|
ReportsPanel,
|
|
37640
37699
|
{
|
|
37641
37700
|
openReport: activeTab,
|
|
@@ -37645,7 +37704,7 @@ const Reports = ({
|
|
|
37645
37704
|
view,
|
|
37646
37705
|
renderInAppLink
|
|
37647
37706
|
}
|
|
37648
|
-
) }) })
|
|
37707
|
+
) }) })
|
|
37649
37708
|
]
|
|
37650
37709
|
}
|
|
37651
37710
|
);
|
|
@@ -41457,7 +41516,7 @@ const BusinessProvider = ({
|
|
|
41457
41516
|
hasBeenTouched,
|
|
41458
41517
|
resetCaches
|
|
41459
41518
|
} = useDataSync();
|
|
41460
|
-
const globalDateRange = useGlobalDateRange({ displayMode: "
|
|
41519
|
+
const globalDateRange = useGlobalDateRange({ displayMode: "full" });
|
|
41461
41520
|
const { setDateRange } = useGlobalDateRangeActions();
|
|
41462
41521
|
const dateRange = useMemo(() => ({
|
|
41463
41522
|
range: globalDateRange,
|
|
@@ -41622,7 +41681,7 @@ const LayerProvider = (_od) => {
|
|
|
41622
41681
|
};
|
|
41623
41682
|
export {
|
|
41624
41683
|
AccountingOverview,
|
|
41625
|
-
|
|
41684
|
+
BalanceSheet,
|
|
41626
41685
|
BankTransactions,
|
|
41627
41686
|
BankTransactionsWithLinkedAccounts,
|
|
41628
41687
|
BookkeepingOverview,
|
|
@@ -41645,7 +41704,7 @@ export {
|
|
|
41645
41704
|
ProfitAndLossView,
|
|
41646
41705
|
ProjectProfitabilityView,
|
|
41647
41706
|
Reports,
|
|
41648
|
-
|
|
41707
|
+
StatementOfCashFlow,
|
|
41649
41708
|
Tasks,
|
|
41650
41709
|
unstable_BillsView,
|
|
41651
41710
|
UnifiedReport as unstable_UnifiedReports,
|