@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/cjs/index.cjs
CHANGED
|
@@ -69,6 +69,7 @@ const useSWRMutation = require("swr/mutation");
|
|
|
69
69
|
const reactAriaComponents = require("react-aria-components");
|
|
70
70
|
const useResizeObserver = require("@react-hook/resize-observer");
|
|
71
71
|
const lucideReact = require("lucide-react");
|
|
72
|
+
const react$2 = require("motion/react");
|
|
72
73
|
const CurrencyInput = require("react-currency-input-field");
|
|
73
74
|
const Select$1 = require("react-select");
|
|
74
75
|
const uuid = require("uuid");
|
|
@@ -110,7 +111,7 @@ const LinkedAccountsContext = react.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(date2, cutoff = dateFns.endOfDay(/* @__PURE__ */ n
|
|
|
1766
1767
|
return dateFns.min([date2, cutoff]);
|
|
1767
1768
|
}
|
|
1768
1769
|
const RANGE_MODE_LOOKUP = {
|
|
1769
|
-
|
|
1770
|
+
date: {
|
|
1770
1771
|
getStartDate: ({ startDate }) => dateFns.startOfMonth(startDate),
|
|
1771
1772
|
getEndDate: ({ endDate }) => clampToPresentOrPast(dateFns.endOfDay(endDate))
|
|
1772
1773
|
},
|
|
1773
|
-
|
|
1774
|
+
full: {
|
|
1774
1775
|
getStartDate: ({ startDate }) => startDate,
|
|
1775
1776
|
getEndDate: ({ endDate }) => clampToPresentOrPast(dateFns.endOfDay(endDate))
|
|
1776
1777
|
},
|
|
1777
|
-
|
|
1778
|
+
month: {
|
|
1778
1779
|
getStartDate: ({ startDate }) => dateFns.startOfMonth(startDate),
|
|
1779
1780
|
getEndDate: ({ endDate }) => clampToPresentOrPast(dateFns.endOfMonth(endDate))
|
|
1780
|
-
},
|
|
1781
|
-
monthRangePicker: {
|
|
1782
|
-
getStartDate: ({ startDate }) => dateFns.startOfMonth(startDate),
|
|
1783
|
-
getEndDate: ({ endDate }) => clampToPresentOrPast(dateFns.endOfMonth(endDate))
|
|
1784
|
-
},
|
|
1785
|
-
yearPicker: {
|
|
1786
|
-
getStartDate: ({ startDate }) => dateFns.startOfYear(startDate),
|
|
1787
|
-
getEndDate: ({ endDate }) => clampToPresentOrPast(dateFns.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: date2 }) => {
|
|
1807
|
-
const s = RANGE_MODE_LOOKUP.
|
|
1808
|
-
const e = RANGE_MODE_LOOKUP.
|
|
1800
|
+
const s = RANGE_MODE_LOOKUP.date.getStartDate({ startDate: date2 });
|
|
1801
|
+
const e = RANGE_MODE_LOOKUP.date.getEndDate({ endDate: date2 });
|
|
1809
1802
|
return apply2({ 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 apply2({ 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 apply2({ 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 apply2({ 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 apply2({ 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 = zustand.useStore(store, ({ actions: { setDateRange: setDateRange2 } }) => setDateRange2);
|
|
1908
1885
|
const setMonth = zustand.useStore(store, ({ actions: { setMonth: setMonth2 } }) => setMonth2);
|
|
1909
|
-
const setMonthRange = zustand.useStore(store, ({ actions: { setMonthRange: setMonthRange2 } }) => setMonthRange2);
|
|
1910
|
-
const setYear = zustand.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: dateFns.startOfMonth(/* @__PURE__ */ new Date()),
|
|
1935
1908
|
endDate: dateFns.endOfMonth(/* @__PURE__ */ new Date())
|
|
@@ -9015,11 +8988,59 @@ const SubmitButton = (_ba) => {
|
|
|
9015
8988
|
})
|
|
9016
8989
|
);
|
|
9017
8990
|
};
|
|
8991
|
+
const variants = {
|
|
8992
|
+
fade: {
|
|
8993
|
+
initial: { opacity: 0 },
|
|
8994
|
+
animate: { opacity: 1 },
|
|
8995
|
+
exit: { opacity: 0 },
|
|
8996
|
+
transition: { duration: 0.3, ease: [0, 0, 0.58, 1] }
|
|
8997
|
+
},
|
|
8998
|
+
slideUp: {
|
|
8999
|
+
initial: { y: "100%" },
|
|
9000
|
+
animate: { y: 0 },
|
|
9001
|
+
exit: { y: "100%" },
|
|
9002
|
+
transition: { duration: 0.35, ease: [0.4, 0, 0.2, 1] }
|
|
9003
|
+
},
|
|
9004
|
+
expand: {
|
|
9005
|
+
initial: { height: 0, opacity: 0 },
|
|
9006
|
+
animate: { height: "auto", opacity: 1 },
|
|
9007
|
+
exit: { height: 0, opacity: 0 },
|
|
9008
|
+
transition: {
|
|
9009
|
+
height: { duration: 0.25, ease: [0.4, 0, 0.2, 1] },
|
|
9010
|
+
opacity: { duration: 0.15, ease: [0, 0, 0.58, 1] }
|
|
9011
|
+
}
|
|
9012
|
+
}
|
|
9013
|
+
};
|
|
9014
|
+
const AnimatedContent = (_da) => {
|
|
9015
|
+
var _ea = _da, {
|
|
9016
|
+
children,
|
|
9017
|
+
variant,
|
|
9018
|
+
isOpen,
|
|
9019
|
+
slotProps = { AnimatePresence: { initial: false } }
|
|
9020
|
+
} = _ea, props = __objRest(_ea, [
|
|
9021
|
+
"children",
|
|
9022
|
+
"variant",
|
|
9023
|
+
"isOpen",
|
|
9024
|
+
"slotProps"
|
|
9025
|
+
]);
|
|
9026
|
+
const config = variants[variant];
|
|
9027
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$2.AnimatePresence, __spreadProps(__spreadValues({}, slotProps.AnimatePresence), { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9028
|
+
react$2.motion.div,
|
|
9029
|
+
__spreadProps(__spreadValues({
|
|
9030
|
+
initial: config.initial,
|
|
9031
|
+
animate: config.animate,
|
|
9032
|
+
exit: config.exit,
|
|
9033
|
+
transition: config.transition
|
|
9034
|
+
}, props), {
|
|
9035
|
+
children
|
|
9036
|
+
})
|
|
9037
|
+
) }));
|
|
9038
|
+
};
|
|
9018
9039
|
const BASE_MODAL_OVERLAY_CLASS_NAME = "Layer__ModalOverlay";
|
|
9019
9040
|
const MODAL_OVERLAY_CLASS_NAME = `Layer__Portal ${BASE_MODAL_OVERLAY_CLASS_NAME}`;
|
|
9020
9041
|
const ModalOverlay = react.forwardRef(
|
|
9021
|
-
(
|
|
9022
|
-
var
|
|
9042
|
+
(_fa, ref) => {
|
|
9043
|
+
var _ga = _fa, { variant } = _ga, restProps = __objRest(_ga, ["variant"]);
|
|
9023
9044
|
const dataProperties = toDataProperties({ variant });
|
|
9024
9045
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9025
9046
|
reactAriaComponents.ModalOverlay,
|
|
@@ -9046,8 +9067,8 @@ const InternalModal = react.forwardRef(({ children, flexBlock, flexInline, size,
|
|
|
9046
9067
|
InternalModal.displayName = "Modal";
|
|
9047
9068
|
const DIALOG_CLASS_NAME = "Layer__Dialog";
|
|
9048
9069
|
const Dialog = react.forwardRef(
|
|
9049
|
-
(
|
|
9050
|
-
var
|
|
9070
|
+
(_ha, ref) => {
|
|
9071
|
+
var _ia = _ha, { variant = "center" } = _ia, restProps = __objRest(_ia, ["variant"]);
|
|
9051
9072
|
const dataProperties = toDataProperties({ variant });
|
|
9052
9073
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9053
9074
|
reactAriaComponents.Dialog,
|
|
@@ -9085,11 +9106,25 @@ function Drawer({
|
|
|
9085
9106
|
isDismissable = false,
|
|
9086
9107
|
role
|
|
9087
9108
|
}) {
|
|
9088
|
-
|
|
9109
|
+
const isMobileDrawer = variant === "mobile-drawer";
|
|
9110
|
+
const shouldUseFadeOverlay = variant === "drawer" || isMobileDrawer;
|
|
9111
|
+
const modalContent = /* @__PURE__ */ jsxRuntime.jsx(InternalModal, { flexBlock, flexInline, size, variant, children: /* @__PURE__ */ jsxRuntime.jsx(Dialog, { role: role != null ? role : "dialog", "aria-label": ariaLabel, variant, children }) });
|
|
9112
|
+
const wrappedModalContent = isMobileDrawer ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9113
|
+
AnimatedContent,
|
|
9114
|
+
{
|
|
9115
|
+
variant: "slideUp",
|
|
9116
|
+
isOpen,
|
|
9117
|
+
className: "Layer__ModalContentSlideUpMotionContent",
|
|
9118
|
+
slotProps: { AnimatePresence: { initial: true } },
|
|
9119
|
+
children: modalContent
|
|
9120
|
+
}
|
|
9121
|
+
) : modalContent;
|
|
9122
|
+
const overlayContent = shouldUseFadeOverlay ? /* @__PURE__ */ jsxRuntime.jsx(AnimatedContent, { variant: "fade", isOpen, className: "Layer__ModalContentFadeMotionContent", children: wrappedModalContent }) : wrappedModalContent;
|
|
9123
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, { isOpen, onOpenChange, variant, isDismissable, children: overlayContent });
|
|
9089
9124
|
}
|
|
9090
9125
|
const HEADING_CLASS_NAME = "Layer__UI__Heading";
|
|
9091
|
-
const Heading = react.forwardRef((
|
|
9092
|
-
var
|
|
9126
|
+
const Heading = react.forwardRef((_ja, ref) => {
|
|
9127
|
+
var _ka = _ja, { align, pie, pbe, size, variant, weight, ellipsis, className } = _ka, restProps = __objRest(_ka, ["align", "pie", "pbe", "size", "variant", "weight", "ellipsis", "className"]);
|
|
9093
9128
|
const dataProperties = toDataProperties({ pbe, pie, size, align, variant, weight, ellipsis });
|
|
9094
9129
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9095
9130
|
reactAriaComponents.Heading,
|
|
@@ -9116,21 +9151,25 @@ function ButtonSpinner({ size }) {
|
|
|
9116
9151
|
function ButtonTransparentContent({ children }) {
|
|
9117
9152
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: BUTTON_CLASS_NAMES.TRANSPARENT_CONTENT, children });
|
|
9118
9153
|
}
|
|
9119
|
-
const Button = react.forwardRef((
|
|
9120
|
-
var
|
|
9154
|
+
const Button = react.forwardRef((_la, ref) => {
|
|
9155
|
+
var _ma = _la, {
|
|
9121
9156
|
children,
|
|
9122
9157
|
ellipsis,
|
|
9123
9158
|
icon,
|
|
9124
9159
|
inset,
|
|
9125
9160
|
size = "md",
|
|
9126
|
-
variant = "solid"
|
|
9127
|
-
|
|
9161
|
+
variant = "solid",
|
|
9162
|
+
fullWidth = false,
|
|
9163
|
+
flex = false
|
|
9164
|
+
} = _ma, restProps = __objRest(_ma, [
|
|
9128
9165
|
"children",
|
|
9129
9166
|
"ellipsis",
|
|
9130
9167
|
"icon",
|
|
9131
9168
|
"inset",
|
|
9132
9169
|
"size",
|
|
9133
|
-
"variant"
|
|
9170
|
+
"variant",
|
|
9171
|
+
"fullWidth",
|
|
9172
|
+
"flex"
|
|
9134
9173
|
]);
|
|
9135
9174
|
const { isPending = false } = restProps;
|
|
9136
9175
|
const dataProperties = toDataProperties({
|
|
@@ -9138,7 +9177,9 @@ const Button = react.forwardRef((_ja, ref) => {
|
|
|
9138
9177
|
icon,
|
|
9139
9178
|
inset,
|
|
9140
9179
|
size,
|
|
9141
|
-
variant
|
|
9180
|
+
variant,
|
|
9181
|
+
"full-width": fullWidth,
|
|
9182
|
+
flex
|
|
9142
9183
|
});
|
|
9143
9184
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9144
9185
|
reactAriaComponents.Button,
|
|
@@ -9495,8 +9536,8 @@ const CHECK_SIZE = {
|
|
|
9495
9536
|
md: 14,
|
|
9496
9537
|
lg: 16
|
|
9497
9538
|
};
|
|
9498
|
-
function Checkbox(
|
|
9499
|
-
var
|
|
9539
|
+
function Checkbox(_na) {
|
|
9540
|
+
var _oa = _na, { children, className, variant = "default", size = "sm", isIndeterminate } = _oa, props = __objRest(_oa, ["children", "className", "variant", "size", "isIndeterminate"]);
|
|
9500
9541
|
const dataProperties = react.useMemo(() => toDataProperties({
|
|
9501
9542
|
size,
|
|
9502
9543
|
variant,
|
|
@@ -9514,8 +9555,8 @@ function Checkbox(_la) {
|
|
|
9514
9555
|
})
|
|
9515
9556
|
);
|
|
9516
9557
|
}
|
|
9517
|
-
function CheckboxWithTooltip(
|
|
9518
|
-
var
|
|
9558
|
+
function CheckboxWithTooltip(_pa) {
|
|
9559
|
+
var _qa = _pa, { tooltip } = _qa, props = __objRest(_qa, ["tooltip"]);
|
|
9519
9560
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__checkbox-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !tooltip, children: [
|
|
9520
9561
|
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, __spreadValues({}, props)) }),
|
|
9521
9562
|
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
|
|
@@ -9860,8 +9901,8 @@ const isDateAllowedToBrowse = (date2, business) => {
|
|
|
9860
9901
|
}
|
|
9861
9902
|
return dateFns.differenceInCalendarMonths(dateFns.startOfMonth(date2), activationDate) >= 0;
|
|
9862
9903
|
};
|
|
9863
|
-
const ErrorText = (
|
|
9864
|
-
var
|
|
9904
|
+
const ErrorText = (_ra) => {
|
|
9905
|
+
var _sa = _ra, { className } = _sa, props = __objRest(_sa, ["className"]);
|
|
9865
9906
|
return /* @__PURE__ */ jsxRuntime.jsx(Text, __spreadProps(__spreadValues({}, props), { status: "error", className }));
|
|
9866
9907
|
};
|
|
9867
9908
|
const InputGroup$1 = ({
|
|
@@ -9900,8 +9941,8 @@ const transformCurrencyValue = (rawValue) => {
|
|
|
9900
9941
|
}
|
|
9901
9942
|
return cleaned;
|
|
9902
9943
|
};
|
|
9903
|
-
const AmountInput = (
|
|
9904
|
-
var
|
|
9944
|
+
const AmountInput = (_ta) => {
|
|
9945
|
+
var _ua = _ta, {
|
|
9905
9946
|
onChange,
|
|
9906
9947
|
className,
|
|
9907
9948
|
leftText,
|
|
@@ -9909,7 +9950,7 @@ const AmountInput = (_ra) => {
|
|
|
9909
9950
|
isInvalid,
|
|
9910
9951
|
badge,
|
|
9911
9952
|
placeholder = "$0.00"
|
|
9912
|
-
} =
|
|
9953
|
+
} = _ua, props = __objRest(_ua, [
|
|
9913
9954
|
"onChange",
|
|
9914
9955
|
"className",
|
|
9915
9956
|
"leftText",
|
|
@@ -9954,8 +9995,8 @@ const AmountInput = (_ra) => {
|
|
|
9954
9995
|
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
9955
9996
|
] });
|
|
9956
9997
|
};
|
|
9957
|
-
const ChevronLeft = (
|
|
9958
|
-
var props = __objRest(
|
|
9998
|
+
const ChevronLeft = (_va) => {
|
|
9999
|
+
var props = __objRest(_va, []);
|
|
9959
10000
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9960
10001
|
"svg",
|
|
9961
10002
|
__spreadProps(__spreadValues({
|
|
@@ -9979,8 +10020,8 @@ const ChevronLeft = (_ta) => {
|
|
|
9979
10020
|
};
|
|
9980
10021
|
const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
|
|
9981
10022
|
const Calendar = react.forwardRef(
|
|
9982
|
-
function Calendar2(
|
|
9983
|
-
var
|
|
10023
|
+
function Calendar2(_wa, ref) {
|
|
10024
|
+
var _xa = _wa, { className, isReadOnly } = _xa, restProps = __objRest(_xa, ["className", "isReadOnly"]);
|
|
9984
10025
|
const dataProperties = toDataProperties({ readonly: isReadOnly });
|
|
9985
10026
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9986
10027
|
reactAriaComponents.Calendar,
|
|
@@ -9994,8 +10035,8 @@ const Calendar = react.forwardRef(
|
|
|
9994
10035
|
);
|
|
9995
10036
|
const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
|
|
9996
10037
|
const CalendarGrid = react.forwardRef(
|
|
9997
|
-
function CalendarGrid2(
|
|
9998
|
-
var
|
|
10038
|
+
function CalendarGrid2(_ya, ref) {
|
|
10039
|
+
var _za = _ya, { className } = _za, restProps = __objRest(_za, ["className"]);
|
|
9999
10040
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10000
10041
|
reactAriaComponents.CalendarGrid,
|
|
10001
10042
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -10007,8 +10048,8 @@ const CalendarGrid = react.forwardRef(
|
|
|
10007
10048
|
);
|
|
10008
10049
|
const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
|
|
10009
10050
|
const CalendarGridBody = react.forwardRef(
|
|
10010
|
-
function CalendarGridBody2(
|
|
10011
|
-
var
|
|
10051
|
+
function CalendarGridBody2(_Aa, ref) {
|
|
10052
|
+
var _Ba = _Aa, { className } = _Ba, restProps = __objRest(_Ba, ["className"]);
|
|
10012
10053
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10013
10054
|
reactAriaComponents.CalendarGridBody,
|
|
10014
10055
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -10020,8 +10061,8 @@ const CalendarGridBody = react.forwardRef(
|
|
|
10020
10061
|
);
|
|
10021
10062
|
const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
|
|
10022
10063
|
const CalendarCell = react.forwardRef(
|
|
10023
|
-
function CalendarCell2(
|
|
10024
|
-
var
|
|
10064
|
+
function CalendarCell2(_Ca, ref) {
|
|
10065
|
+
var _Da = _Ca, { className, size = "sm" } = _Da, restProps = __objRest(_Da, ["className", "size"]);
|
|
10025
10066
|
const dataProperties = toDataProperties({ size });
|
|
10026
10067
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10027
10068
|
reactAriaComponents.CalendarCell,
|
|
@@ -10034,8 +10075,8 @@ const CalendarCell = react.forwardRef(
|
|
|
10034
10075
|
);
|
|
10035
10076
|
const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
|
|
10036
10077
|
const CalendarGridHeader = react.forwardRef(
|
|
10037
|
-
function CalendarGridHeader2(
|
|
10038
|
-
var
|
|
10078
|
+
function CalendarGridHeader2(_Ea, ref) {
|
|
10079
|
+
var _Fa = _Ea, { className } = _Fa, restProps = __objRest(_Fa, ["className"]);
|
|
10039
10080
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10040
10081
|
reactAriaComponents.CalendarGridHeader,
|
|
10041
10082
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -10047,8 +10088,8 @@ const CalendarGridHeader = react.forwardRef(
|
|
|
10047
10088
|
);
|
|
10048
10089
|
const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
|
|
10049
10090
|
const CalendarHeaderCell = react.forwardRef(
|
|
10050
|
-
function CalendarHeaderCell2(
|
|
10051
|
-
var
|
|
10091
|
+
function CalendarHeaderCell2(_Ga, ref) {
|
|
10092
|
+
var _Ha = _Ga, { className, size = "sm" } = _Ha, restProps = __objRest(_Ha, ["className", "size"]);
|
|
10052
10093
|
const dataProperties = toDataProperties({ size });
|
|
10053
10094
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10054
10095
|
reactAriaComponents.CalendarHeaderCell,
|
|
@@ -10074,8 +10115,8 @@ const DateCalendar = ({ minDate, maxDate, variant }) => {
|
|
|
10074
10115
|
};
|
|
10075
10116
|
const DATE_FIELD_CLASS_NAME = "Layer__UI__DateField";
|
|
10076
10117
|
const DateField = react.forwardRef(
|
|
10077
|
-
function DateField2(
|
|
10078
|
-
var
|
|
10118
|
+
function DateField2(_Ia, ref) {
|
|
10119
|
+
var _Ja = _Ia, { inline, className, isReadOnly } = _Ja, restProps = __objRest(_Ja, ["inline", "className", "isReadOnly"]);
|
|
10079
10120
|
const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
|
|
10080
10121
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10081
10122
|
reactAriaComponents.DateField,
|
|
@@ -10089,8 +10130,8 @@ const DateField = react.forwardRef(
|
|
|
10089
10130
|
);
|
|
10090
10131
|
const DATE_INPUT_CLASS_NAME = "Layer__UI__DateInput";
|
|
10091
10132
|
const DateInput = react.forwardRef(
|
|
10092
|
-
function DateInput2(
|
|
10093
|
-
var
|
|
10133
|
+
function DateInput2(_Ka, ref) {
|
|
10134
|
+
var _La = _Ka, { inset, pointerEvents } = _La, restProps = __objRest(_La, ["inset", "pointerEvents"]);
|
|
10094
10135
|
const dataProperties = toDataProperties({ inset, "pointer-events": pointerEvents });
|
|
10095
10136
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10096
10137
|
reactAriaComponents.DateInput,
|
|
@@ -10103,8 +10144,8 @@ const DateInput = react.forwardRef(
|
|
|
10103
10144
|
);
|
|
10104
10145
|
const DATE_SEGMENT_CLASS_NAME = "Layer__UI__DateSegment";
|
|
10105
10146
|
const DateSegment = react.forwardRef(
|
|
10106
|
-
function DateSegment2(
|
|
10107
|
-
var
|
|
10147
|
+
function DateSegment2(_Ma, ref) {
|
|
10148
|
+
var _Na = _Ma, { isReadOnly } = _Na, restProps = __objRest(_Na, ["isReadOnly"]);
|
|
10108
10149
|
const dataProperties = toDataProperties({ interactive: !isReadOnly });
|
|
10109
10150
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10110
10151
|
reactAriaComponents.DateSegment,
|
|
@@ -10130,8 +10171,8 @@ const DatePicker$1 = react.forwardRef(
|
|
|
10130
10171
|
const POPOVER_CLASS_NAME = "Layer__Popover";
|
|
10131
10172
|
const POPOVER_CLASS_NAMES = `Layer__Portal ${POPOVER_CLASS_NAME}`;
|
|
10132
10173
|
const Popover = react.forwardRef(
|
|
10133
|
-
function Popover2(
|
|
10134
|
-
var
|
|
10174
|
+
function Popover2(_Oa, ref) {
|
|
10175
|
+
var _Pa = _Oa, { flexInline = false } = _Pa, restProps = __objRest(_Pa, ["flexInline"]);
|
|
10135
10176
|
const dataProperties = toDataProperties({ "flex-inline": flexInline });
|
|
10136
10177
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10137
10178
|
reactAriaComponents.Popover,
|
|
@@ -10205,8 +10246,8 @@ function ResponsivePopover({ children, triggerRef }) {
|
|
|
10205
10246
|
}
|
|
10206
10247
|
);
|
|
10207
10248
|
}
|
|
10208
|
-
const ChevronDown = (
|
|
10209
|
-
var
|
|
10249
|
+
const ChevronDown = (_Qa) => {
|
|
10250
|
+
var _Ra = _Qa, { size = 18 } = _Ra, props = __objRest(_Ra, ["size"]);
|
|
10210
10251
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10211
10252
|
"svg",
|
|
10212
10253
|
__spreadProps(__spreadValues({
|
|
@@ -10230,8 +10271,8 @@ const ChevronDown = (_Oa) => {
|
|
|
10230
10271
|
};
|
|
10231
10272
|
const INPUT_GROUP_CLASS_NAME = "Layer__InputGroup";
|
|
10232
10273
|
const InputGroup = react.forwardRef(
|
|
10233
|
-
function InputGroup2(
|
|
10234
|
-
var
|
|
10274
|
+
function InputGroup2(_Sa, ref) {
|
|
10275
|
+
var _Ta = _Sa, { actionCount, className, slots, children } = _Ta, restProps = __objRest(_Ta, ["actionCount", "className", "slots", "children"]);
|
|
10235
10276
|
const combinedClassName = classNames(INPUT_GROUP_CLASS_NAME, className);
|
|
10236
10277
|
const dataProperties = toDataProperties({
|
|
10237
10278
|
"action-count": actionCount
|
|
@@ -10248,15 +10289,15 @@ const InputGroup = react.forwardRef(
|
|
|
10248
10289
|
);
|
|
10249
10290
|
const FORM_CLASS_NAME = "Layer__UI__Form";
|
|
10250
10291
|
const Form = react.forwardRef(
|
|
10251
|
-
function Form2(
|
|
10252
|
-
var
|
|
10292
|
+
function Form2(_Ua, ref) {
|
|
10293
|
+
var _Va = _Ua, { children, className } = _Va, restProps = __objRest(_Va, ["children", "className"]);
|
|
10253
10294
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Form, __spreadProps(__spreadValues({}, restProps), { className: classNames(FORM_CLASS_NAME, className), ref, children }));
|
|
10254
10295
|
}
|
|
10255
10296
|
);
|
|
10256
10297
|
const TEXT_FIELD_CLASS_NAME = "Layer__UI__TextField";
|
|
10257
10298
|
const TextField = react.forwardRef(
|
|
10258
|
-
function TextField2(
|
|
10259
|
-
var
|
|
10299
|
+
function TextField2(_Wa, ref) {
|
|
10300
|
+
var _Xa = _Wa, { children, inline, textarea, className } = _Xa, restProps = __objRest(_Xa, ["children", "inline", "textarea", "className"]);
|
|
10260
10301
|
const dataProperties = toDataProperties({ inline, textarea });
|
|
10261
10302
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.TextField, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(TEXT_FIELD_CLASS_NAME, className), ref, children: withRenderProp(children, (node) => node) }));
|
|
10262
10303
|
}
|
|
@@ -10945,8 +10986,8 @@ const useIsVisible = (ref) => {
|
|
|
10945
10986
|
}, [ref]);
|
|
10946
10987
|
return isIntersecting;
|
|
10947
10988
|
};
|
|
10948
|
-
const ChevronDownFill = (
|
|
10949
|
-
var
|
|
10989
|
+
const ChevronDownFill = (_Ya) => {
|
|
10990
|
+
var _Za = _Ya, { size = 18 } = _Za, props = __objRest(_Za, ["size"]);
|
|
10950
10991
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10951
10992
|
"svg",
|
|
10952
10993
|
__spreadProps(__spreadValues({
|
|
@@ -10971,8 +11012,8 @@ const ChevronDownFill = (_Wa) => {
|
|
|
10971
11012
|
})
|
|
10972
11013
|
);
|
|
10973
11014
|
};
|
|
10974
|
-
const File = (
|
|
10975
|
-
var
|
|
11015
|
+
const File = (__a) => {
|
|
11016
|
+
var _$a = __a, { size = 12 } = _$a, props = __objRest(_$a, ["size"]);
|
|
10976
11017
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10977
11018
|
"svg",
|
|
10978
11019
|
__spreadProps(__spreadValues({
|
|
@@ -11032,13 +11073,13 @@ const File = (_Ya) => {
|
|
|
11032
11073
|
})
|
|
11033
11074
|
);
|
|
11034
11075
|
};
|
|
11035
|
-
const Input$1 = (
|
|
11036
|
-
var
|
|
11076
|
+
const Input$1 = (_ab) => {
|
|
11077
|
+
var _bb = _ab, {
|
|
11037
11078
|
className,
|
|
11038
11079
|
isInvalid,
|
|
11039
11080
|
errorMessage,
|
|
11040
11081
|
leftText
|
|
11041
|
-
} =
|
|
11082
|
+
} = _bb, props = __objRest(_bb, [
|
|
11042
11083
|
"className",
|
|
11043
11084
|
"isInvalid",
|
|
11044
11085
|
"errorMessage",
|
|
@@ -11058,19 +11099,19 @@ const Input$1 = (__a) => {
|
|
|
11058
11099
|
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
11059
11100
|
] });
|
|
11060
11101
|
};
|
|
11061
|
-
const TextButton = (
|
|
11062
|
-
var
|
|
11102
|
+
const TextButton = (_cb) => {
|
|
11103
|
+
var _db = _cb, {
|
|
11063
11104
|
className,
|
|
11064
11105
|
children
|
|
11065
|
-
} =
|
|
11106
|
+
} = _db, props = __objRest(_db, [
|
|
11066
11107
|
"className",
|
|
11067
11108
|
"children"
|
|
11068
11109
|
]);
|
|
11069
11110
|
const baseClassName2 = classNames("Layer__text-btn", className);
|
|
11070
11111
|
return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, props), { className: baseClassName2, children }));
|
|
11071
11112
|
};
|
|
11072
|
-
const ScissorsFullOpen = (
|
|
11073
|
-
var
|
|
11113
|
+
const ScissorsFullOpen = (_eb) => {
|
|
11114
|
+
var _fb = _eb, { size = 12 } = _fb, props = __objRest(_fb, ["size"]);
|
|
11074
11115
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11075
11116
|
"svg",
|
|
11076
11117
|
__spreadProps(__spreadValues({
|
|
@@ -11135,8 +11176,8 @@ const ScissorsFullOpen = (_cb) => {
|
|
|
11135
11176
|
})
|
|
11136
11177
|
);
|
|
11137
11178
|
};
|
|
11138
|
-
const Trash = (
|
|
11139
|
-
var
|
|
11179
|
+
const Trash = (_gb) => {
|
|
11180
|
+
var _hb = _gb, { size = 18 } = _hb, props = __objRest(_hb, ["size"]);
|
|
11140
11181
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11141
11182
|
"svg",
|
|
11142
11183
|
__spreadProps(__spreadValues({
|
|
@@ -11187,8 +11228,8 @@ const Trash = (_eb) => {
|
|
|
11187
11228
|
})
|
|
11188
11229
|
);
|
|
11189
11230
|
};
|
|
11190
|
-
const UploadCloud = (
|
|
11191
|
-
var
|
|
11231
|
+
const UploadCloud = (_ib) => {
|
|
11232
|
+
var _jb = _ib, { size = 18 } = _jb, props = __objRest(_jb, ["size"]);
|
|
11192
11233
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11193
11234
|
"svg",
|
|
11194
11235
|
__spreadProps(__spreadValues({
|
|
@@ -11443,8 +11484,8 @@ const ReceiptsProvider = ({
|
|
|
11443
11484
|
const contextData = useReceipts({ bankTransaction, isActive });
|
|
11444
11485
|
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsContext.Provider, { value: contextData, children });
|
|
11445
11486
|
};
|
|
11446
|
-
const DownloadCloud = (
|
|
11447
|
-
var
|
|
11487
|
+
const DownloadCloud = (_kb) => {
|
|
11488
|
+
var _lb = _kb, { size = 18 } = _lb, props = __objRest(_lb, ["size"]);
|
|
11448
11489
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11449
11490
|
"svg",
|
|
11450
11491
|
__spreadProps(__spreadValues({
|
|
@@ -11486,8 +11527,8 @@ const DownloadCloud = (_ib) => {
|
|
|
11486
11527
|
})
|
|
11487
11528
|
);
|
|
11488
11529
|
};
|
|
11489
|
-
const Eye = (
|
|
11490
|
-
var
|
|
11530
|
+
const Eye = (_mb) => {
|
|
11531
|
+
var _nb = _mb, { size = 18 } = _nb, props = __objRest(_nb, ["size"]);
|
|
11491
11532
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11492
11533
|
"svg",
|
|
11493
11534
|
__spreadProps(__spreadValues({
|
|
@@ -11640,8 +11681,8 @@ const openReceiptInNewTab = (url, index2) => (e) => {
|
|
|
11640
11681
|
`);
|
|
11641
11682
|
}
|
|
11642
11683
|
};
|
|
11643
|
-
const BankTransactionReceiptsWithProvider = react.forwardRef((
|
|
11644
|
-
var
|
|
11684
|
+
const BankTransactionReceiptsWithProvider = react.forwardRef((_ob, ref) => {
|
|
11685
|
+
var _pb = _ob, { bankTransaction, isActive } = _pb, props = __objRest(_pb, ["bankTransaction", "isActive"]);
|
|
11645
11686
|
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive, children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })) });
|
|
11646
11687
|
});
|
|
11647
11688
|
BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
|
|
@@ -11693,8 +11734,8 @@ const BankTransactionReceipts = react.forwardRef(
|
|
|
11693
11734
|
);
|
|
11694
11735
|
BankTransactionReceipts.displayName = "BankTransactionReceipts";
|
|
11695
11736
|
const PORTAL_CLASS_NAME = "Layer__Portal";
|
|
11696
|
-
const Check = (
|
|
11697
|
-
var
|
|
11737
|
+
const Check = (_qb) => {
|
|
11738
|
+
var _rb = _qb, { size = 18 } = _rb, props = __objRest(_rb, ["size"]);
|
|
11698
11739
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11699
11740
|
"svg",
|
|
11700
11741
|
__spreadProps(__spreadValues({
|
|
@@ -11890,8 +11931,8 @@ function buildCustomMenuPortal() {
|
|
|
11890
11931
|
);
|
|
11891
11932
|
};
|
|
11892
11933
|
}
|
|
11893
|
-
function ComboBox(
|
|
11894
|
-
var
|
|
11934
|
+
function ComboBox(_sb) {
|
|
11935
|
+
var _tb = _sb, {
|
|
11895
11936
|
className,
|
|
11896
11937
|
selectedValue,
|
|
11897
11938
|
onSelectedValueChange,
|
|
@@ -11909,7 +11950,7 @@ function ComboBox(_qb) {
|
|
|
11909
11950
|
isClearable = true,
|
|
11910
11951
|
isReadOnly = false,
|
|
11911
11952
|
displayDisabledAsSelected
|
|
11912
|
-
} =
|
|
11953
|
+
} = _tb, ariaProps = __objRest(_tb, [
|
|
11913
11954
|
"className",
|
|
11914
11955
|
"selectedValue",
|
|
11915
11956
|
"onSelectedValueChange",
|
|
@@ -13106,8 +13147,8 @@ function isCategorizationEnabledForStatus(status) {
|
|
|
13106
13147
|
}
|
|
13107
13148
|
}
|
|
13108
13149
|
}
|
|
13109
|
-
const MinimizeTwo = (
|
|
13110
|
-
var
|
|
13150
|
+
const MinimizeTwo = (_ub) => {
|
|
13151
|
+
var _vb = _ub, { size = 18 } = _vb, props = __objRest(_vb, ["size"]);
|
|
13111
13152
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13112
13153
|
"svg",
|
|
13113
13154
|
__spreadProps(__spreadValues({
|
|
@@ -13538,12 +13579,12 @@ const Notification = ({
|
|
|
13538
13579
|
}
|
|
13539
13580
|
);
|
|
13540
13581
|
};
|
|
13541
|
-
const Textarea = (
|
|
13542
|
-
var
|
|
13582
|
+
const Textarea = (_wb) => {
|
|
13583
|
+
var _xb = _wb, {
|
|
13543
13584
|
className,
|
|
13544
13585
|
isInvalid,
|
|
13545
13586
|
errorMessage
|
|
13546
|
-
} =
|
|
13587
|
+
} = _xb, props = __objRest(_xb, [
|
|
13547
13588
|
"className",
|
|
13548
13589
|
"isInvalid",
|
|
13549
13590
|
"errorMessage"
|
|
@@ -13685,9 +13726,7 @@ const BankTransactionMemo = ({ bankTransactionId }) => {
|
|
|
13685
13726
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13686
13727
|
InputGroup$1,
|
|
13687
13728
|
{
|
|
13688
|
-
className: "Layer__bank-transaction-memo-input-group",
|
|
13689
13729
|
name: "memo",
|
|
13690
|
-
label: "Description",
|
|
13691
13730
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13692
13731
|
Textarea,
|
|
13693
13732
|
{
|
|
@@ -13869,9 +13908,9 @@ function BankTransactionFormFields({
|
|
|
13869
13908
|
if (!showTags && !showCustomerVendor && !showDescriptions) {
|
|
13870
13909
|
return null;
|
|
13871
13910
|
}
|
|
13872
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, {
|
|
13873
|
-
showCustomerVendor && !hideCustomerVendor
|
|
13874
|
-
showTags && !hideTags
|
|
13911
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "md", children: [
|
|
13912
|
+
showCustomerVendor && !hideCustomerVendor && /* @__PURE__ */ jsxRuntime.jsx(BankTransactionCustomerVendorSelector, { bankTransaction }),
|
|
13913
|
+
showTags && !hideTags && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13875
13914
|
TagDimensionsGroup,
|
|
13876
13915
|
{
|
|
13877
13916
|
value: selectedTags,
|
|
@@ -13879,8 +13918,11 @@ function BankTransactionFormFields({
|
|
|
13879
13918
|
showLabels: true,
|
|
13880
13919
|
isReadOnly
|
|
13881
13920
|
}
|
|
13882
|
-
)
|
|
13883
|
-
showDescriptions
|
|
13921
|
+
),
|
|
13922
|
+
showDescriptions && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
13923
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", weight: "bold", children: "Description" }),
|
|
13924
|
+
/* @__PURE__ */ jsxRuntime.jsx(BankTransactionMemo, { bankTransactionId: bankTransaction.id })
|
|
13925
|
+
] })
|
|
13884
13926
|
] });
|
|
13885
13927
|
}
|
|
13886
13928
|
var CategorizationType = /* @__PURE__ */ ((CategorizationType2) => {
|
|
@@ -14076,8 +14118,8 @@ const DateTime = ({
|
|
|
14076
14118
|
};
|
|
14077
14119
|
const CLASS_NAME$8 = "Layer__MoneyText";
|
|
14078
14120
|
const MoneySpan = react.forwardRef(
|
|
14079
|
-
(
|
|
14080
|
-
var
|
|
14121
|
+
(_yb, ref) => {
|
|
14122
|
+
var _zb = _yb, { amount, bold, size, displayPlusSign, className } = _zb, restProps = __objRest(_zb, ["amount", "bold", "size", "displayPlusSign", "className"]);
|
|
14081
14123
|
const dataProperties = toDataProperties({
|
|
14082
14124
|
bold,
|
|
14083
14125
|
"positive": amount >= 0,
|
|
@@ -14089,8 +14131,8 @@ const MoneySpan = react.forwardRef(
|
|
|
14089
14131
|
}
|
|
14090
14132
|
);
|
|
14091
14133
|
MoneySpan.displayName = "MoneySpan";
|
|
14092
|
-
const Scissors = (
|
|
14093
|
-
var
|
|
14134
|
+
const Scissors = (_Ab) => {
|
|
14135
|
+
var _Bb = _Ab, { size = 11 } = _Bb, props = __objRest(_Bb, ["size"]);
|
|
14094
14136
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14095
14137
|
"svg",
|
|
14096
14138
|
__spreadProps(__spreadValues({
|
|
@@ -14221,21 +14263,27 @@ const Scissors = (_yb) => {
|
|
|
14221
14263
|
);
|
|
14222
14264
|
};
|
|
14223
14265
|
const BankTransactionsBaseSelectedValue = (props) => {
|
|
14224
|
-
var _a, _b, _c, _d, _e, _f;
|
|
14266
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14225
14267
|
const { type, className, label, slotProps } = props;
|
|
14268
|
+
if (type === "placeholder") {
|
|
14269
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", className, children: /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: (_b = (_a = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _a.size) != null ? _b : "md", children: label }) });
|
|
14270
|
+
}
|
|
14226
14271
|
if (type === "match" || type === "transfer") {
|
|
14227
14272
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", className, children: [
|
|
14228
14273
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { size: BadgeSize.SMALL, icon: /* @__PURE__ */ jsxRuntime.jsx(MinimizeTwo, { size: 11 }), children: type === "transfer" ? "Transfer" : "Match" }),
|
|
14229
|
-
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: (
|
|
14274
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: (_d = (_c = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _c.size) != null ? _d : "md", children: label })
|
|
14230
14275
|
] });
|
|
14231
14276
|
}
|
|
14232
14277
|
if (type === "split") {
|
|
14233
14278
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", className, children: [
|
|
14234
14279
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { size: BadgeSize.SMALL, icon: /* @__PURE__ */ jsxRuntime.jsx(Scissors, { size: 11 }), children: "Split" }),
|
|
14235
|
-
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: (
|
|
14280
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: (_f = (_e = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _e.size) != null ? _f : "md", children: label })
|
|
14236
14281
|
] });
|
|
14237
14282
|
}
|
|
14238
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
14283
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", className, children: [
|
|
14284
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { size: BadgeSize.SMALL, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Layers2Icon, { size: 11 }), children: "Category" }),
|
|
14285
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: (_h = (_g = slotProps == null ? void 0 : slotProps.Label) == null ? void 0 : _g.size) != null ? _h : "md", children: label })
|
|
14286
|
+
] });
|
|
14239
14287
|
};
|
|
14240
14288
|
const BankTransactionsUncategorizedSelectedValue = (props) => {
|
|
14241
14289
|
const { selectedValue, className, slotProps } = props;
|
|
@@ -14689,7 +14737,8 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
14689
14737
|
submitBtnText = "Save",
|
|
14690
14738
|
containerWidth,
|
|
14691
14739
|
showDescriptions,
|
|
14692
|
-
showReceiptUploads
|
|
14740
|
+
showReceiptUploads,
|
|
14741
|
+
showLeftPadding = true
|
|
14693
14742
|
}, ref) => {
|
|
14694
14743
|
const {
|
|
14695
14744
|
categorize: categorizeBankTransaction2,
|
|
@@ -14770,14 +14819,14 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
14770
14819
|
});
|
|
14771
14820
|
}
|
|
14772
14821
|
};
|
|
14773
|
-
const save = () =>
|
|
14822
|
+
const save = () => {
|
|
14774
14823
|
var _a;
|
|
14775
14824
|
if (purpose === "match") {
|
|
14776
14825
|
if (!selectedMatch) {
|
|
14777
14826
|
setMatchFormError("Select an option to match the transaction");
|
|
14778
14827
|
return;
|
|
14779
14828
|
} else if (selectedMatch && selectedMatch.id !== ((_a = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a.id)) {
|
|
14780
|
-
|
|
14829
|
+
void onMatchSubmit(selectedMatch.id);
|
|
14781
14830
|
return;
|
|
14782
14831
|
}
|
|
14783
14832
|
close2();
|
|
@@ -14785,13 +14834,13 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
14785
14834
|
}
|
|
14786
14835
|
if (!isValid) return;
|
|
14787
14836
|
const categorizationRequest = buildCategorizeBankTransactionPayloadForSplit(localSplits);
|
|
14788
|
-
|
|
14837
|
+
void categorizeBankTransaction2(
|
|
14789
14838
|
bankTransaction.id,
|
|
14790
14839
|
categorizationRequest
|
|
14791
14840
|
);
|
|
14792
14841
|
deselect(bankTransaction.id);
|
|
14793
14842
|
close2();
|
|
14794
|
-
}
|
|
14843
|
+
};
|
|
14795
14844
|
react.useImperativeHandle(ref, () => ({
|
|
14796
14845
|
save
|
|
14797
14846
|
}));
|
|
@@ -14815,228 +14864,227 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
14815
14864
|
"span",
|
|
14816
14865
|
{
|
|
14817
14866
|
className: `${className} ${className}--${isOpen ? "expanded" : "collapsed"}`,
|
|
14818
|
-
children:
|
|
14819
|
-
|
|
14820
|
-
|
|
14821
|
-
{
|
|
14822
|
-
|
|
14823
|
-
|
|
14824
|
-
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
14834
|
-
|
|
14835
|
-
|
|
14836
|
-
|
|
14837
|
-
|
|
14838
|
-
|
|
14839
|
-
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
|
|
14843
|
-
|
|
14844
|
-
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
|
|
14856
|
-
|
|
14857
|
-
{
|
|
14858
|
-
|
|
14859
|
-
bankTransaction,
|
|
14860
|
-
selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
|
|
14861
|
-
readOnly: !categorizationEnabled,
|
|
14862
|
-
setSelectedMatch: (suggestedMatch) => {
|
|
14863
|
-
setMatchFormError(void 0);
|
|
14864
|
-
setSelectedMatch(suggestedMatch);
|
|
14865
|
-
},
|
|
14866
|
-
matchFormError
|
|
14867
|
-
}
|
|
14868
|
-
) })
|
|
14869
|
-
}
|
|
14870
|
-
),
|
|
14871
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14872
|
-
"div",
|
|
14873
|
-
{
|
|
14874
|
-
className: classNames(
|
|
14875
|
-
`${className}__splits`,
|
|
14876
|
-
`${className}__content-panel`,
|
|
14877
|
-
purpose === "categorize" ? `${className}__content-panel--active` : ""
|
|
14878
|
-
),
|
|
14879
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__content-panel-container`, children: [
|
|
14880
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${className}__splits-inputs`, children: effectiveSplits.map((split, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14881
|
-
"div",
|
|
14867
|
+
children: isOpen && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14868
|
+
/* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
14869
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `${className}__wrapper`, ref: bodyRef, children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pis: showLeftPadding ? "md" : void 0, pbs: "sm", children: [
|
|
14870
|
+
categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsx(HStack, { pi: "md", pbe: "md", pbs: "3xs", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14871
|
+
Toggle,
|
|
14872
|
+
{
|
|
14873
|
+
name: `purpose-${bankTransaction.id}${asListItem ? "-li" : ""}`,
|
|
14874
|
+
size: ToggleSize.small,
|
|
14875
|
+
options: [
|
|
14876
|
+
{
|
|
14877
|
+
value: "categorize",
|
|
14878
|
+
label: "Categorize"
|
|
14879
|
+
},
|
|
14880
|
+
{
|
|
14881
|
+
value: "match",
|
|
14882
|
+
label: "Match",
|
|
14883
|
+
disabled: !hasMatch(bankTransaction),
|
|
14884
|
+
disabledMessage: "We could not find matching transactions"
|
|
14885
|
+
}
|
|
14886
|
+
],
|
|
14887
|
+
selected: purpose,
|
|
14888
|
+
onChange: onChangePurpose
|
|
14889
|
+
}
|
|
14890
|
+
) }),
|
|
14891
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14892
|
+
"div",
|
|
14893
|
+
{
|
|
14894
|
+
className: `${className}__content`,
|
|
14895
|
+
id: `expanded-${bankTransaction.id}`,
|
|
14896
|
+
children: [
|
|
14897
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__content-panels`, children: [
|
|
14898
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14899
|
+
"div",
|
|
14900
|
+
{
|
|
14901
|
+
className: classNames(
|
|
14902
|
+
`${className}__match`,
|
|
14903
|
+
`${className}__content-panel`,
|
|
14904
|
+
purpose === "match" ? `${className}__content-panel--active` : ""
|
|
14905
|
+
),
|
|
14906
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${className}__content-panel-container`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14907
|
+
MatchForm,
|
|
14882
14908
|
{
|
|
14883
|
-
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
includeSuggestedMatches: false
|
|
14908
|
-
}
|
|
14909
|
-
),
|
|
14910
|
-
showTags && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14911
|
-
TagDimensionsGroup,
|
|
14912
|
-
{
|
|
14913
|
-
value: split.tags,
|
|
14914
|
-
onChange: (tags) => changeTags(index2, tags),
|
|
14915
|
-
showLabels: false,
|
|
14916
|
-
isReadOnly: !categorizationEnabled,
|
|
14917
|
-
className: `${className}__table-cell--split-entry__tags`
|
|
14918
|
-
}
|
|
14919
|
-
),
|
|
14920
|
-
showCustomerVendor && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__customer", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14921
|
-
CustomerVendorSelector,
|
|
14922
|
-
{
|
|
14923
|
-
selectedCustomerVendor: split.customerVendor,
|
|
14924
|
-
onSelectedCustomerVendorChange: (customerVendor) => changeCustomerVendor(index2, customerVendor),
|
|
14925
|
-
placeholder: "Set customer or vendor",
|
|
14926
|
-
isReadOnly: !categorizationEnabled,
|
|
14927
|
-
showLabel: false
|
|
14928
|
-
}
|
|
14929
|
-
) }),
|
|
14930
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__button", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14931
|
-
Button,
|
|
14932
|
-
{
|
|
14933
|
-
onPress: () => removeSplit(index2),
|
|
14934
|
-
variant: "outlined",
|
|
14935
|
-
icon: true,
|
|
14936
|
-
isDisabled: index2 == 0,
|
|
14937
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Trash, { size: 18 })
|
|
14938
|
-
}
|
|
14939
|
-
) })
|
|
14940
|
-
]
|
|
14941
|
-
},
|
|
14942
|
-
`split-${index2}`
|
|
14943
|
-
)) }),
|
|
14944
|
-
splitFormError && /* @__PURE__ */ jsxRuntime.jsx(HStack, { pb: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: splitFormError }) }),
|
|
14945
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__total-and-btns`, children: [
|
|
14946
|
-
effectiveSplits.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14947
|
-
Input$1,
|
|
14948
|
-
{
|
|
14949
|
-
disabled: true,
|
|
14950
|
-
leftText: "Total",
|
|
14951
|
-
inputMode: "numeric",
|
|
14952
|
-
value: `$${centsToDollars(
|
|
14953
|
-
effectiveSplits.reduce(
|
|
14954
|
-
(x, { amount }) => x + amount,
|
|
14955
|
-
0
|
|
14956
|
-
)
|
|
14957
|
-
)}`
|
|
14958
|
-
}
|
|
14959
|
-
),
|
|
14960
|
-
categorizationEnabled ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${className}__splits-buttons`, children: effectiveSplits.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
14961
|
-
TextButton,
|
|
14962
|
-
{
|
|
14963
|
-
onClick: addSplit,
|
|
14964
|
-
children: "Add new split"
|
|
14965
|
-
}
|
|
14966
|
-
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14967
|
-
Button,
|
|
14909
|
+
classNamePrefix: className,
|
|
14910
|
+
bankTransaction,
|
|
14911
|
+
selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
|
|
14912
|
+
readOnly: !categorizationEnabled,
|
|
14913
|
+
setSelectedMatch: (suggestedMatch) => {
|
|
14914
|
+
setMatchFormError(void 0);
|
|
14915
|
+
setSelectedMatch(suggestedMatch);
|
|
14916
|
+
},
|
|
14917
|
+
matchFormError
|
|
14918
|
+
}
|
|
14919
|
+
) })
|
|
14920
|
+
}
|
|
14921
|
+
),
|
|
14922
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14923
|
+
"div",
|
|
14924
|
+
{
|
|
14925
|
+
className: classNames(
|
|
14926
|
+
`${className}__splits`,
|
|
14927
|
+
`${className}__content-panel`,
|
|
14928
|
+
purpose === "categorize" ? `${className}__content-panel--active` : ""
|
|
14929
|
+
),
|
|
14930
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__content-panel-container`, children: [
|
|
14931
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${className}__splits-inputs`, children: effectiveSplits.map((split, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14932
|
+
"div",
|
|
14968
14933
|
{
|
|
14969
|
-
|
|
14970
|
-
variant: "outlined",
|
|
14934
|
+
className: `${className}__table-cell--split-entry`,
|
|
14971
14935
|
children: [
|
|
14972
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14973
|
-
|
|
14936
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14937
|
+
AmountInput,
|
|
14938
|
+
{
|
|
14939
|
+
name: `split-${index2}${asListItem ? "-li" : ""}`,
|
|
14940
|
+
disabled: index2 === 0 || !categorizationEnabled,
|
|
14941
|
+
onChange: updateSplitAmount(index2),
|
|
14942
|
+
value: getInputValueForSplitAtIndex(index2, split),
|
|
14943
|
+
onBlur: onBlurSplitAmount,
|
|
14944
|
+
className: `${className}__table-cell--split-entry__amount`,
|
|
14945
|
+
isInvalid: split.amount < 0
|
|
14946
|
+
}
|
|
14947
|
+
),
|
|
14948
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14949
|
+
BankTransactionCategoryComboBox,
|
|
14950
|
+
{
|
|
14951
|
+
bankTransaction,
|
|
14952
|
+
selectedValue: split.category,
|
|
14953
|
+
onSelectedValueChange: (value) => {
|
|
14954
|
+
changeCategoryForSplitAtIndex(index2, value);
|
|
14955
|
+
},
|
|
14956
|
+
isLoading: bankTransaction.processing,
|
|
14957
|
+
isDisabled: !categorizationEnabled,
|
|
14958
|
+
includeSuggestedMatches: false
|
|
14959
|
+
}
|
|
14960
|
+
),
|
|
14961
|
+
showTags && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14962
|
+
TagDimensionsGroup,
|
|
14963
|
+
{
|
|
14964
|
+
value: split.tags,
|
|
14965
|
+
onChange: (tags) => changeTags(index2, tags),
|
|
14966
|
+
showLabels: false,
|
|
14967
|
+
isReadOnly: !categorizationEnabled,
|
|
14968
|
+
className: `${className}__table-cell--split-entry__tags`
|
|
14969
|
+
}
|
|
14970
|
+
),
|
|
14971
|
+
showCustomerVendor && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__customer", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14972
|
+
CustomerVendorSelector,
|
|
14973
|
+
{
|
|
14974
|
+
selectedCustomerVendor: split.customerVendor,
|
|
14975
|
+
onSelectedCustomerVendorChange: (customerVendor) => changeCustomerVendor(index2, customerVendor),
|
|
14976
|
+
placeholder: "Set customer or vendor",
|
|
14977
|
+
isReadOnly: !categorizationEnabled,
|
|
14978
|
+
showLabel: false
|
|
14979
|
+
}
|
|
14980
|
+
) }),
|
|
14981
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__button", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14982
|
+
Button,
|
|
14983
|
+
{
|
|
14984
|
+
onPress: () => removeSplit(index2),
|
|
14985
|
+
variant: "outlined",
|
|
14986
|
+
icon: true,
|
|
14987
|
+
isDisabled: index2 == 0,
|
|
14988
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Trash, { size: 18 })
|
|
14989
|
+
}
|
|
14990
|
+
) })
|
|
14974
14991
|
]
|
|
14975
|
-
}
|
|
14976
|
-
|
|
14992
|
+
},
|
|
14993
|
+
`split-${index2}`
|
|
14994
|
+
)) }),
|
|
14995
|
+
splitFormError && /* @__PURE__ */ jsxRuntime.jsx(HStack, { pb: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: splitFormError }) }),
|
|
14996
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__total-and-btns`, children: [
|
|
14997
|
+
effectiveSplits.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14998
|
+
Input$1,
|
|
14999
|
+
{
|
|
15000
|
+
disabled: true,
|
|
15001
|
+
leftText: "Total",
|
|
15002
|
+
inputMode: "numeric",
|
|
15003
|
+
value: `$${centsToDollars(
|
|
15004
|
+
effectiveSplits.reduce(
|
|
15005
|
+
(x, { amount }) => x + amount,
|
|
15006
|
+
0
|
|
15007
|
+
)
|
|
15008
|
+
)}`
|
|
15009
|
+
}
|
|
15010
|
+
),
|
|
15011
|
+
categorizationEnabled ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${className}__splits-buttons`, children: effectiveSplits.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15012
|
+
TextButton,
|
|
15013
|
+
{
|
|
15014
|
+
onClick: addSplit,
|
|
15015
|
+
children: "Add new split"
|
|
15016
|
+
}
|
|
15017
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15018
|
+
Button,
|
|
15019
|
+
{
|
|
15020
|
+
onClick: addSplit,
|
|
15021
|
+
variant: "outlined",
|
|
15022
|
+
children: [
|
|
15023
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScissorsFullOpen, { size: 14 }),
|
|
15024
|
+
"Split"
|
|
15025
|
+
]
|
|
15026
|
+
}
|
|
15027
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
15028
|
+
] })
|
|
14977
15029
|
] })
|
|
14978
|
-
|
|
14979
|
-
|
|
14980
|
-
)
|
|
14981
|
-
|
|
14982
|
-
|
|
14983
|
-
BankTransactionFormFields,
|
|
14984
|
-
{
|
|
14985
|
-
bankTransaction,
|
|
14986
|
-
showDescriptions,
|
|
14987
|
-
hideTags: purpose === "categorize",
|
|
14988
|
-
hideCustomerVendor: purpose === "categorize"
|
|
14989
|
-
/* categorize */
|
|
14990
|
-
}
|
|
14991
|
-
),
|
|
14992
|
-
showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14993
|
-
BankTransactionReceiptsWithProvider,
|
|
14994
|
-
{
|
|
14995
|
-
bankTransaction,
|
|
14996
|
-
isActive: isOpen,
|
|
14997
|
-
classNamePrefix: className,
|
|
14998
|
-
floatingActions: !asListItem
|
|
14999
|
-
}
|
|
15000
|
-
),
|
|
15001
|
-
asListItem && categorizationEnabled ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__submit-btn`, children: [
|
|
15002
|
-
bankTransaction.error ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15003
|
-
Text,
|
|
15030
|
+
}
|
|
15031
|
+
)
|
|
15032
|
+
] }),
|
|
15033
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { pis: "md", className: "Layer__ExpandedBankTransactionRow__Description", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15034
|
+
BankTransactionFormFields,
|
|
15004
15035
|
{
|
|
15005
|
-
|
|
15006
|
-
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
/* @__PURE__ */ jsxRuntime.jsx(AlertCircle, { size: 12 })
|
|
15011
|
-
]
|
|
15036
|
+
bankTransaction,
|
|
15037
|
+
showDescriptions,
|
|
15038
|
+
hideTags: purpose === "categorize",
|
|
15039
|
+
hideCustomerVendor: purpose === "categorize"
|
|
15040
|
+
/* categorize */
|
|
15012
15041
|
}
|
|
15013
|
-
)
|
|
15014
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15015
|
-
|
|
15042
|
+
) }),
|
|
15043
|
+
showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15044
|
+
BankTransactionReceiptsWithProvider,
|
|
15016
15045
|
{
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
},
|
|
15022
|
-
className: "Layer__bank-transaction__submit-btn",
|
|
15023
|
-
processing: bankTransaction.processing,
|
|
15024
|
-
active: true,
|
|
15025
|
-
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
15026
|
-
children: submitBtnText
|
|
15046
|
+
bankTransaction,
|
|
15047
|
+
isActive: isOpen,
|
|
15048
|
+
classNamePrefix: className,
|
|
15049
|
+
floatingActions: !asListItem
|
|
15027
15050
|
}
|
|
15028
|
-
)
|
|
15029
|
-
|
|
15030
|
-
|
|
15031
|
-
|
|
15032
|
-
|
|
15033
|
-
|
|
15034
|
-
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
|
|
15051
|
+
),
|
|
15052
|
+
asListItem && categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__submit-btn`, children: [
|
|
15053
|
+
bankTransaction.error && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15054
|
+
Text,
|
|
15055
|
+
{
|
|
15056
|
+
as: "span",
|
|
15057
|
+
size: TextSize.md,
|
|
15058
|
+
className: "Layer__unsaved-info",
|
|
15059
|
+
children: [
|
|
15060
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Unsaved" }),
|
|
15061
|
+
/* @__PURE__ */ jsxRuntime.jsx(AlertCircle, { size: 12 })
|
|
15062
|
+
]
|
|
15063
|
+
}
|
|
15064
|
+
),
|
|
15065
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15066
|
+
SubmitButton,
|
|
15067
|
+
{
|
|
15068
|
+
onClick: save,
|
|
15069
|
+
className: "Layer__bank-transaction__submit-btn",
|
|
15070
|
+
processing: bankTransaction.processing,
|
|
15071
|
+
active: true,
|
|
15072
|
+
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
15073
|
+
children: submitBtnText
|
|
15074
|
+
}
|
|
15075
|
+
)
|
|
15076
|
+
] })
|
|
15077
|
+
]
|
|
15078
|
+
}
|
|
15079
|
+
),
|
|
15080
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15081
|
+
APIErrorNotifications,
|
|
15082
|
+
{
|
|
15083
|
+
bankTransaction,
|
|
15084
|
+
containerWidth
|
|
15085
|
+
}
|
|
15086
|
+
)
|
|
15087
|
+
] }) })
|
|
15040
15088
|
] })
|
|
15041
15089
|
}
|
|
15042
15090
|
);
|
|
@@ -15163,8 +15211,8 @@ const getMonthNameFromNumber = (monthNumber) => {
|
|
|
15163
15211
|
}
|
|
15164
15212
|
return (_a = monthNames.at(monthNumber - 1)) != null ? _a : "";
|
|
15165
15213
|
};
|
|
15166
|
-
const Clock = (
|
|
15167
|
-
var
|
|
15214
|
+
const Clock = (_Cb) => {
|
|
15215
|
+
var _Db = _Cb, { size = 18 } = _Db, props = __objRest(_Db, ["size"]);
|
|
15168
15216
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15169
15217
|
"svg",
|
|
15170
15218
|
__spreadProps(__spreadValues({
|
|
@@ -15447,14 +15495,14 @@ const BankTransactionRow = ({
|
|
|
15447
15495
|
__spreadProps(__spreadValues(__spreadValues({
|
|
15448
15496
|
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"}`
|
|
15449
15497
|
}, openRow), showReceiptDataProperties), {
|
|
15450
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15498
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(VStack, { align: "end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15451
15499
|
MoneySpan,
|
|
15452
15500
|
{
|
|
15453
15501
|
amount: bankTransaction.amount,
|
|
15454
15502
|
displayPlusSign: isCredit(bankTransaction),
|
|
15455
15503
|
className: "Layer__table-cell-content"
|
|
15456
15504
|
}
|
|
15457
|
-
)
|
|
15505
|
+
) })
|
|
15458
15506
|
})
|
|
15459
15507
|
),
|
|
15460
15508
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15475,7 +15523,7 @@ const BankTransactionRow = ({
|
|
|
15475
15523
|
`${className}__actions-cell--${open ? "open" : "close"}`
|
|
15476
15524
|
),
|
|
15477
15525
|
children: open ? /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pie: "md", gap: "md", justify: "end", className: "Layer__bank-transaction-row__category-open", children: [
|
|
15478
|
-
bankTransaction.error
|
|
15526
|
+
bankTransaction.error && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15479
15527
|
Text,
|
|
15480
15528
|
{
|
|
15481
15529
|
as: "span",
|
|
@@ -15486,8 +15534,8 @@ const BankTransactionRow = ({
|
|
|
15486
15534
|
/* @__PURE__ */ jsxRuntime.jsx(AlertCircle, { size: 12 })
|
|
15487
15535
|
]
|
|
15488
15536
|
}
|
|
15489
|
-
)
|
|
15490
|
-
categorizationEnabled
|
|
15537
|
+
),
|
|
15538
|
+
categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15491
15539
|
SubmitButton,
|
|
15492
15540
|
{
|
|
15493
15541
|
onClick: () => {
|
|
@@ -15501,8 +15549,8 @@ const BankTransactionRow = ({
|
|
|
15501
15549
|
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
15502
15550
|
children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
|
|
15503
15551
|
}
|
|
15504
|
-
)
|
|
15505
|
-
!categorizationEnabled && !categorized
|
|
15552
|
+
),
|
|
15553
|
+
!categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsx(VStack, { children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, {}) }),
|
|
15506
15554
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15507
15555
|
IconButton,
|
|
15508
15556
|
{
|
|
@@ -15518,26 +15566,36 @@ const BankTransactionRow = ({
|
|
|
15518
15566
|
}
|
|
15519
15567
|
)
|
|
15520
15568
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pi: "md", gap: "md", className: "Layer__bank-transaction-row__category-hstack", children: [
|
|
15521
|
-
|
|
15522
|
-
|
|
15569
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15570
|
+
AnimatedContent,
|
|
15523
15571
|
{
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15533
|
-
|
|
15572
|
+
variant: "fade",
|
|
15573
|
+
isOpen: categorizationEnabled && !categorized,
|
|
15574
|
+
className: "Layer__BankTransactionRow__CategoryComboBoxMotionContent",
|
|
15575
|
+
slotProps: { AnimatePresence: { mode: "wait" } },
|
|
15576
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15577
|
+
BankTransactionCategoryComboBox,
|
|
15578
|
+
{
|
|
15579
|
+
bankTransaction,
|
|
15580
|
+
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
15581
|
+
onSelectedValueChange: (selectedCategory2) => {
|
|
15582
|
+
setTransactionCategory(bankTransaction.id, selectedCategory2);
|
|
15583
|
+
setShowRetry(false);
|
|
15584
|
+
},
|
|
15585
|
+
isLoading: bankTransaction.processing
|
|
15586
|
+
}
|
|
15587
|
+
)
|
|
15588
|
+
},
|
|
15589
|
+
"category-combobox"
|
|
15590
|
+
),
|
|
15591
|
+
categorized && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15534
15592
|
BankTransactionsCategorizedSelectedValue,
|
|
15535
15593
|
{
|
|
15536
15594
|
bankTransaction,
|
|
15537
15595
|
className: "Layer__bank-transaction-row__category"
|
|
15538
15596
|
}
|
|
15539
|
-
)
|
|
15540
|
-
categorizationEnabled && !categorized && showRetry
|
|
15597
|
+
),
|
|
15598
|
+
categorizationEnabled && !categorized && showRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15541
15599
|
RetryButton,
|
|
15542
15600
|
{
|
|
15543
15601
|
onClick: () => {
|
|
@@ -15550,8 +15608,8 @@ const BankTransactionRow = ({
|
|
|
15550
15608
|
error: "Approval failed. Check connection and retry in few seconds.",
|
|
15551
15609
|
children: "Retry"
|
|
15552
15610
|
}
|
|
15553
|
-
)
|
|
15554
|
-
!categorized && categorizationEnabled && !showRetry
|
|
15611
|
+
),
|
|
15612
|
+
!categorized && categorizationEnabled && !showRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15555
15613
|
SubmitButton,
|
|
15556
15614
|
{
|
|
15557
15615
|
onClick: () => {
|
|
@@ -15565,8 +15623,8 @@ const BankTransactionRow = ({
|
|
|
15565
15623
|
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
15566
15624
|
children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
|
|
15567
15625
|
}
|
|
15568
|
-
)
|
|
15569
|
-
!categorizationEnabled && !categorized
|
|
15626
|
+
),
|
|
15627
|
+
!categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsx(VStack, { pis: "xs", fluid: true, children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, {}) }),
|
|
15570
15628
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15571
15629
|
IconButton,
|
|
15572
15630
|
{
|
|
@@ -15585,7 +15643,7 @@ const BankTransactionRow = ({
|
|
|
15585
15643
|
}
|
|
15586
15644
|
)
|
|
15587
15645
|
] }),
|
|
15588
|
-
/* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan, className: "Layer__bank-transaction-row__expanded-td", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15646
|
+
/* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan, className: "Layer__bank-transaction-row__expanded-td", children: /* @__PURE__ */ jsxRuntime.jsx(AnimatedContent, { variant: "expand", isOpen: open, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15589
15647
|
ExpandedBankTransactionRow,
|
|
15590
15648
|
{
|
|
15591
15649
|
ref: expandedRowRef,
|
|
@@ -15598,7 +15656,7 @@ const BankTransactionRow = ({
|
|
|
15598
15656
|
showReceiptUploads,
|
|
15599
15657
|
showTooltips
|
|
15600
15658
|
}
|
|
15601
|
-
) }) })
|
|
15659
|
+
) }, `expanded-${bankTransaction.id}`) }) })
|
|
15602
15660
|
] });
|
|
15603
15661
|
};
|
|
15604
15662
|
const BankTransactionsCategorizedSelectedValue = (props) => {
|
|
@@ -15625,36 +15683,37 @@ const normalizeFromBankTransaction = (bankTransaction) => {
|
|
|
15625
15683
|
label: (_e = (_d = bankTransaction.category) == null ? void 0 : _d.display_name) != null ? _e : ""
|
|
15626
15684
|
};
|
|
15627
15685
|
};
|
|
15628
|
-
const
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15686
|
+
const BankTransactionsListItemCategory = ({
|
|
15687
|
+
bankTransaction,
|
|
15688
|
+
mobile = false
|
|
15689
|
+
}) => {
|
|
15690
|
+
const className = mobile ? "Layer__bankTransactionsListItemCategory__Mobile" : "Layer__bankTransactionsListItemCategory__List";
|
|
15691
|
+
const categorized = isCategorized(bankTransaction);
|
|
15692
|
+
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
15693
|
+
if (categorized) {
|
|
15694
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15695
|
+
BankTransactionsCategorizedSelectedValue,
|
|
15696
|
+
{
|
|
15697
|
+
bankTransaction,
|
|
15698
|
+
className,
|
|
15699
|
+
slotProps: { Label: { size: "sm" } }
|
|
15700
|
+
}
|
|
15701
|
+
);
|
|
15702
|
+
}
|
|
15703
|
+
return selectedCategory ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15704
|
+
BankTransactionsUncategorizedSelectedValue,
|
|
15632
15705
|
{
|
|
15633
|
-
|
|
15634
|
-
|
|
15635
|
-
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
DateTime,
|
|
15645
|
-
{
|
|
15646
|
-
value: date2,
|
|
15647
|
-
dateFormat: DATE_FORMAT,
|
|
15648
|
-
onlyDate: true,
|
|
15649
|
-
slotProps: {
|
|
15650
|
-
Date: __spreadValues({
|
|
15651
|
-
variant: "subtle",
|
|
15652
|
-
size: "sm"
|
|
15653
|
-
}, slotProps == null ? void 0 : slotProps.DateTime)
|
|
15654
|
-
}
|
|
15655
|
-
}
|
|
15656
|
-
)
|
|
15657
|
-
]
|
|
15706
|
+
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
15707
|
+
className,
|
|
15708
|
+
slotProps: { Label: { size: "sm" } }
|
|
15709
|
+
}
|
|
15710
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
15711
|
+
BankTransactionsBaseSelectedValue,
|
|
15712
|
+
{
|
|
15713
|
+
type: "placeholder",
|
|
15714
|
+
label: "No category selected",
|
|
15715
|
+
className,
|
|
15716
|
+
slotProps: { Label: { size: "sm" } }
|
|
15658
15717
|
}
|
|
15659
15718
|
);
|
|
15660
15719
|
};
|
|
@@ -15712,6 +15771,9 @@ const BankTransactionsListItem = ({
|
|
|
15712
15771
|
deselect(bankTransaction.id);
|
|
15713
15772
|
setOpenExpandedRow(false);
|
|
15714
15773
|
});
|
|
15774
|
+
const handleSave = () => {
|
|
15775
|
+
void save();
|
|
15776
|
+
};
|
|
15715
15777
|
const openClassName = openExpandedRow ? "Layer__bank-transaction-list-item--expanded" : "";
|
|
15716
15778
|
const rowClassName = classNames(
|
|
15717
15779
|
"Layer__bank-transaction-list-item",
|
|
@@ -15766,19 +15828,16 @@ const BankTransactionsListItem = ({
|
|
|
15766
15828
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { withTooltip: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description })
|
|
15767
15829
|
] }),
|
|
15768
15830
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15769
|
-
|
|
15831
|
+
MoneySpan,
|
|
15770
15832
|
{
|
|
15771
15833
|
amount: bankTransaction.amount,
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
MoneySpan: { size: "md", displayPlusSign: isCredit(bankTransaction) },
|
|
15775
|
-
DateTime: { size: "sm" }
|
|
15776
|
-
}
|
|
15834
|
+
displayPlusSign: isCredit(bankTransaction),
|
|
15835
|
+
size: "md"
|
|
15777
15836
|
}
|
|
15778
15837
|
)
|
|
15779
15838
|
] }),
|
|
15780
|
-
!categorizationEnabled && !categorized
|
|
15781
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15839
|
+
!categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__bank-transaction-list-item__processing-info", children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, {}) }),
|
|
15840
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", children: /* @__PURE__ */ jsxRuntime.jsx(AnimatedContent, { variant: "expand", isOpen: openExpandedRow, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15782
15841
|
ExpandedBankTransactionRow,
|
|
15783
15842
|
{
|
|
15784
15843
|
ref: expandedRowRef,
|
|
@@ -15791,11 +15850,12 @@ const BankTransactionsListItem = ({
|
|
|
15791
15850
|
containerWidth,
|
|
15792
15851
|
showDescriptions,
|
|
15793
15852
|
showReceiptUploads,
|
|
15794
|
-
showTooltips
|
|
15853
|
+
showTooltips,
|
|
15854
|
+
showLeftPadding: false
|
|
15795
15855
|
}
|
|
15796
|
-
) }),
|
|
15797
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
15798
|
-
|
|
15856
|
+
) }, `expanded-${bankTransaction.id}`) }),
|
|
15857
|
+
!openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
|
|
15858
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15799
15859
|
BankTransactionCategoryComboBox,
|
|
15800
15860
|
{
|
|
15801
15861
|
bankTransaction,
|
|
@@ -15806,47 +15866,36 @@ const BankTransactionsListItem = ({
|
|
|
15806
15866
|
},
|
|
15807
15867
|
isLoading: bankTransaction.processing
|
|
15808
15868
|
}
|
|
15809
|
-
)
|
|
15810
|
-
|
|
15811
|
-
{
|
|
15812
|
-
bankTransaction
|
|
15813
|
-
}
|
|
15814
|
-
) : selectedCategory ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15815
|
-
BankTransactionsUncategorizedSelectedValue,
|
|
15816
|
-
{
|
|
15817
|
-
selectedValue: selectedCategory
|
|
15818
|
-
}
|
|
15819
|
-
) : null,
|
|
15820
|
-
categorizationEnabled && !categorized && !showRetry ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15869
|
+
),
|
|
15870
|
+
!showRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15821
15871
|
SubmitButton,
|
|
15822
15872
|
{
|
|
15823
|
-
|
|
15824
|
-
|
|
15825
|
-
void save();
|
|
15826
|
-
}
|
|
15827
|
-
},
|
|
15873
|
+
disabled: bankTransaction.processing,
|
|
15874
|
+
onClick: handleSave,
|
|
15828
15875
|
className: "Layer__bank-transaction__submit-btn",
|
|
15829
15876
|
processing: bankTransaction.processing,
|
|
15830
15877
|
action: !categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
15831
15878
|
children: !categorized ? (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Approve" : (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update"
|
|
15832
15879
|
}
|
|
15833
|
-
)
|
|
15834
|
-
|
|
15880
|
+
),
|
|
15881
|
+
showRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15835
15882
|
RetryButton,
|
|
15836
15883
|
{
|
|
15837
|
-
onClick:
|
|
15838
|
-
if (!bankTransaction.processing) {
|
|
15839
|
-
void save();
|
|
15840
|
-
}
|
|
15841
|
-
},
|
|
15884
|
+
onClick: handleSave,
|
|
15842
15885
|
className: "Layer__bank-transaction__retry-btn",
|
|
15843
15886
|
processing: bankTransaction.processing,
|
|
15844
15887
|
error: "Approval failed. Check connection and retry in few seconds.",
|
|
15845
15888
|
children: "Retry"
|
|
15846
15889
|
}
|
|
15847
|
-
)
|
|
15890
|
+
)
|
|
15848
15891
|
] }),
|
|
15849
|
-
|
|
15892
|
+
!openExpandedRow && categorizationEnabled && categorized && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15893
|
+
BankTransactionsListItemCategory,
|
|
15894
|
+
{
|
|
15895
|
+
bankTransaction
|
|
15896
|
+
}
|
|
15897
|
+
),
|
|
15898
|
+
bankTransaction.error && showRetry && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
15850
15899
|
] });
|
|
15851
15900
|
};
|
|
15852
15901
|
const useBankTransactionsTableCheckboxState = ({ bankTransactions }) => {
|
|
@@ -15995,32 +16044,8 @@ const BankTransactionsMobileListItemCheckbox = ({
|
|
|
15995
16044
|
}
|
|
15996
16045
|
) });
|
|
15997
16046
|
};
|
|
15998
|
-
const
|
|
15999
|
-
|
|
16000
|
-
}) => {
|
|
16001
|
-
const categorized = isCategorized(bankTransaction);
|
|
16002
|
-
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
16003
|
-
if (categorized) {
|
|
16004
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16005
|
-
BankTransactionsCategorizedSelectedValue,
|
|
16006
|
-
{
|
|
16007
|
-
bankTransaction,
|
|
16008
|
-
className: "Layer__bankTransactionsMobileListItemCategory",
|
|
16009
|
-
slotProps: { Label: { size: "sm" } }
|
|
16010
|
-
}
|
|
16011
|
-
);
|
|
16012
|
-
}
|
|
16013
|
-
return selectedCategory ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
16014
|
-
BankTransactionsUncategorizedSelectedValue,
|
|
16015
|
-
{
|
|
16016
|
-
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
16017
|
-
className: "Layer__bankTransactionsMobileListItemCategory",
|
|
16018
|
-
slotProps: { Label: { size: "sm" } }
|
|
16019
|
-
}
|
|
16020
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, className: "Layer__bankTransactionsMobileListItemCategory", size: "sm", children: "No category selected" });
|
|
16021
|
-
};
|
|
16022
|
-
const Paperclip = (_Cb) => {
|
|
16023
|
-
var _Db = _Cb, { size = 20 } = _Db, props = __objRest(_Db, ["size"]);
|
|
16047
|
+
const Paperclip = (_Eb) => {
|
|
16048
|
+
var _Fb = _Eb, { size = 20 } = _Fb, props = __objRest(_Fb, ["size"]);
|
|
16024
16049
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16025
16050
|
"svg",
|
|
16026
16051
|
__spreadProps(__spreadValues({
|
|
@@ -16042,6 +16067,73 @@ const Paperclip = (_Cb) => {
|
|
|
16042
16067
|
})
|
|
16043
16068
|
);
|
|
16044
16069
|
};
|
|
16070
|
+
const BusinessFormMobileItem = ({
|
|
16071
|
+
option
|
|
16072
|
+
}) => {
|
|
16073
|
+
const value = option.value.value;
|
|
16074
|
+
const label = option.value.label;
|
|
16075
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16076
|
+
reactAriaComponents.GridListItem,
|
|
16077
|
+
{
|
|
16078
|
+
id: value,
|
|
16079
|
+
textValue: label,
|
|
16080
|
+
className: "Layer__BusinessFormMobileItem",
|
|
16081
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", pi: "md", pb: "sm", children: [
|
|
16082
|
+
!option.asLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16083
|
+
Checkbox,
|
|
16084
|
+
{
|
|
16085
|
+
slot: "selection",
|
|
16086
|
+
variant: "round"
|
|
16087
|
+
}
|
|
16088
|
+
),
|
|
16089
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", children: label }),
|
|
16090
|
+
option.asLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16091
|
+
ChevronRight,
|
|
16092
|
+
{
|
|
16093
|
+
size: 16,
|
|
16094
|
+
className: "Layer__BusinessFormMobileItem__link-icon"
|
|
16095
|
+
}
|
|
16096
|
+
)
|
|
16097
|
+
] })
|
|
16098
|
+
},
|
|
16099
|
+
value
|
|
16100
|
+
);
|
|
16101
|
+
};
|
|
16102
|
+
const BusinessFormMobile = ({
|
|
16103
|
+
options: options2,
|
|
16104
|
+
selectedId,
|
|
16105
|
+
onSelect,
|
|
16106
|
+
readOnly
|
|
16107
|
+
}) => {
|
|
16108
|
+
const handleSelectionChange = react.useCallback((keys2) => {
|
|
16109
|
+
if (readOnly) return;
|
|
16110
|
+
const selectedKey = [...keys2][0];
|
|
16111
|
+
const selectedOption = options2.find((opt) => opt.value.value === selectedKey);
|
|
16112
|
+
if (selectedOption) {
|
|
16113
|
+
onSelect(selectedOption);
|
|
16114
|
+
}
|
|
16115
|
+
}, [options2, onSelect, readOnly]);
|
|
16116
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
16117
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", weight: "bold", children: "Select category" }),
|
|
16118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16119
|
+
reactAriaComponents.GridList,
|
|
16120
|
+
{
|
|
16121
|
+
"aria-label": "Select a category",
|
|
16122
|
+
selectionMode: "single",
|
|
16123
|
+
selectedKeys: selectedId ? /* @__PURE__ */ new Set([selectedId]) : /* @__PURE__ */ new Set(),
|
|
16124
|
+
onSelectionChange: handleSelectionChange,
|
|
16125
|
+
className: "Layer__BusinessFormMobile",
|
|
16126
|
+
children: options2.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
16127
|
+
BusinessFormMobileItem,
|
|
16128
|
+
{
|
|
16129
|
+
option
|
|
16130
|
+
},
|
|
16131
|
+
option.value.value
|
|
16132
|
+
))
|
|
16133
|
+
}
|
|
16134
|
+
)
|
|
16135
|
+
] });
|
|
16136
|
+
};
|
|
16045
16137
|
const ActionableList = ({
|
|
16046
16138
|
options: options2,
|
|
16047
16139
|
onClick,
|
|
@@ -16115,8 +16207,8 @@ const flattenCategories = (categories) => {
|
|
|
16115
16207
|
return leafCategories.map((cat) => new CategoryAsOption(cat));
|
|
16116
16208
|
});
|
|
16117
16209
|
};
|
|
16118
|
-
const X = (
|
|
16119
|
-
var
|
|
16210
|
+
const X = (_Gb) => {
|
|
16211
|
+
var _Hb = _Gb, { size = 18 } = _Hb, props = __objRest(_Hb, ["size"]);
|
|
16120
16212
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16121
16213
|
"svg",
|
|
16122
16214
|
__spreadProps(__spreadValues({
|
|
@@ -16150,11 +16242,11 @@ const X = (_Eb) => {
|
|
|
16150
16242
|
);
|
|
16151
16243
|
};
|
|
16152
16244
|
const CLASS_NAME$7 = "Layer__MinimalSearchField";
|
|
16153
|
-
function MinimalSearchField(
|
|
16154
|
-
var
|
|
16245
|
+
function MinimalSearchField(_Ib) {
|
|
16246
|
+
var _Jb = _Ib, {
|
|
16155
16247
|
placeholder,
|
|
16156
16248
|
isDisabled
|
|
16157
|
-
} =
|
|
16249
|
+
} = _Jb, restProps = __objRest(_Jb, [
|
|
16158
16250
|
"placeholder",
|
|
16159
16251
|
"isDisabled"
|
|
16160
16252
|
]);
|
|
@@ -16170,8 +16262,8 @@ function MinimalSearchField(_Gb) {
|
|
|
16170
16262
|
] }));
|
|
16171
16263
|
}
|
|
16172
16264
|
const CLASS_NAME$6 = "Layer__SearchField";
|
|
16173
|
-
function SearchField(
|
|
16174
|
-
var
|
|
16265
|
+
function SearchField(_Kb) {
|
|
16266
|
+
var _Lb = _Kb, { slot = "search", className, label, isDisabled } = _Lb, restProps = __objRest(_Lb, ["slot", "className", "label", "isDisabled"]);
|
|
16175
16267
|
const combinedClassName = classNames(CLASS_NAME$6, className);
|
|
16176
16268
|
return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup, { slot, className: combinedClassName, children: [
|
|
16177
16269
|
/* @__PURE__ */ jsxRuntime.jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { size: 14 }) }),
|
|
@@ -16274,6 +16366,10 @@ const CategorySelectDrawer = ({
|
|
|
16274
16366
|
}
|
|
16275
16367
|
) });
|
|
16276
16368
|
};
|
|
16369
|
+
const SELECT_CATEGORY_VALUE = "SELECT_CATEGORY";
|
|
16370
|
+
const isSelectCategoryOption = (value) => {
|
|
16371
|
+
return isPlaceholderAsOption(value) && value.value === SELECT_CATEGORY_VALUE;
|
|
16372
|
+
};
|
|
16277
16373
|
const BankTransactionsMobileListBusinessForm = ({
|
|
16278
16374
|
bankTransaction,
|
|
16279
16375
|
showCategorization,
|
|
@@ -16283,6 +16379,17 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
16283
16379
|
}) => {
|
|
16284
16380
|
const receiptsRef = react.useRef(null);
|
|
16285
16381
|
const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
16382
|
+
const [sessionCategories, setSessionCategories] = react.useState(() => {
|
|
16383
|
+
var _a;
|
|
16384
|
+
const initialMap = /* @__PURE__ */ new Map();
|
|
16385
|
+
if (((_a = bankTransaction == null ? void 0 : bankTransaction.categorization_flow) == null ? void 0 : _a.type) === CategorizationType.ASK_FROM_SUGGESTIONS) {
|
|
16386
|
+
bankTransaction.categorization_flow.suggestions.forEach((suggestion) => {
|
|
16387
|
+
const opt = new ApiCategorizationAsOption(suggestion);
|
|
16388
|
+
initialMap.set(opt.value, opt);
|
|
16389
|
+
});
|
|
16390
|
+
}
|
|
16391
|
+
return initialMap;
|
|
16392
|
+
});
|
|
16286
16393
|
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
16287
16394
|
const { setTransactionCategory } = useBankTransactionsCategoryActions();
|
|
16288
16395
|
const [showRetry, setShowRetry] = react.useState(false);
|
|
@@ -16293,42 +16400,26 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
16293
16400
|
}
|
|
16294
16401
|
}, [bankTransaction.error]);
|
|
16295
16402
|
const options2 = react.useMemo(() => {
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
label:
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
}) : [];
|
|
16307
|
-
if (selectedCategory && !options22.find((x) => x.id === selectedCategory.value)) {
|
|
16308
|
-
options22.unshift({
|
|
16309
|
-
label: selectedCategory.label,
|
|
16310
|
-
id: selectedCategory.value,
|
|
16311
|
-
value: selectedCategory
|
|
16312
|
-
});
|
|
16313
|
-
}
|
|
16314
|
-
if (options22.length) {
|
|
16315
|
-
options22.push({
|
|
16316
|
-
label: "See all categories",
|
|
16317
|
-
id: "SELECT_CATEGORY",
|
|
16318
|
-
value: {
|
|
16319
|
-
type: "SELECT_CATEGORY"
|
|
16320
|
-
},
|
|
16321
|
-
secondary: true,
|
|
16322
|
-
asLink: true
|
|
16323
|
-
});
|
|
16324
|
-
}
|
|
16403
|
+
const options22 = Array.from(sessionCategories.values()).map((category) => ({
|
|
16404
|
+
value: category
|
|
16405
|
+
}));
|
|
16406
|
+
options22.push({
|
|
16407
|
+
value: new PlaceholderAsOption({
|
|
16408
|
+
label: "Show all categories",
|
|
16409
|
+
value: "SELECT_CATEGORY"
|
|
16410
|
+
}),
|
|
16411
|
+
asLink: true
|
|
16412
|
+
});
|
|
16325
16413
|
return options22;
|
|
16326
|
-
}, [
|
|
16414
|
+
}, [sessionCategories]);
|
|
16327
16415
|
const onCategorySelect = (category) => {
|
|
16328
|
-
if (
|
|
16416
|
+
if (isSelectCategoryOption(category.value)) {
|
|
16329
16417
|
setIsDrawerOpen(true);
|
|
16330
16418
|
} else {
|
|
16331
16419
|
const option = category.value;
|
|
16420
|
+
if (!isPlaceholderAsOption(option)) {
|
|
16421
|
+
setSessionCategories((prev) => new Map(prev).set(option.value, option));
|
|
16422
|
+
}
|
|
16332
16423
|
if (selectedCategory && option.value === selectedCategory.value) {
|
|
16333
16424
|
setTransactionCategory(bankTransaction.id, null);
|
|
16334
16425
|
} else {
|
|
@@ -16351,22 +16442,28 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
16351
16442
|
true
|
|
16352
16443
|
);
|
|
16353
16444
|
};
|
|
16445
|
+
const onDrawerSelect = react.useCallback((category) => {
|
|
16446
|
+
if (!category) return;
|
|
16447
|
+
setSessionCategories((prev) => new Map(prev).set(category.value, category));
|
|
16448
|
+
setTransactionCategory(bankTransaction.id, category);
|
|
16449
|
+
}, [bankTransaction.id, setTransactionCategory]);
|
|
16354
16450
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16355
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16356
|
-
showCategorization
|
|
16357
|
-
|
|
16451
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
16452
|
+
showCategorization && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16453
|
+
BusinessFormMobile,
|
|
16358
16454
|
{
|
|
16359
16455
|
options: options2,
|
|
16360
|
-
|
|
16361
|
-
selectedId: selectedCategory == null ? void 0 : selectedCategory.value
|
|
16362
|
-
showDescriptions: showTooltips
|
|
16456
|
+
onSelect: onCategorySelect,
|
|
16457
|
+
selectedId: selectedCategory == null ? void 0 : selectedCategory.value
|
|
16363
16458
|
}
|
|
16364
|
-
)
|
|
16459
|
+
),
|
|
16365
16460
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16366
16461
|
BankTransactionFormFields,
|
|
16367
16462
|
{
|
|
16368
16463
|
bankTransaction,
|
|
16369
|
-
showDescriptions
|
|
16464
|
+
showDescriptions,
|
|
16465
|
+
hideCustomerVendor: true,
|
|
16466
|
+
hideTags: true
|
|
16370
16467
|
}
|
|
16371
16468
|
),
|
|
16372
16469
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16387,7 +16484,7 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
16387
16484
|
)
|
|
16388
16485
|
}
|
|
16389
16486
|
),
|
|
16390
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16487
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", children: [
|
|
16391
16488
|
showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16392
16489
|
FileInput,
|
|
16393
16490
|
{
|
|
@@ -16400,33 +16497,22 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
16400
16497
|
icon: /* @__PURE__ */ jsxRuntime.jsx(Paperclip, {})
|
|
16401
16498
|
}
|
|
16402
16499
|
),
|
|
16403
|
-
|
|
16404
|
-
Button
|
|
16405
|
-
{
|
|
16406
|
-
onClick: () => {
|
|
16407
|
-
setIsDrawerOpen(true);
|
|
16408
|
-
},
|
|
16409
|
-
fullWidth: true,
|
|
16410
|
-
variant: ButtonVariant.secondary,
|
|
16411
|
-
children: "Select category"
|
|
16412
|
-
}
|
|
16413
|
-
) : null,
|
|
16414
|
-
showCategorization && options2.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
16415
|
-
Button$1,
|
|
16500
|
+
showCategorization && sessionCategories.size > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16501
|
+
Button,
|
|
16416
16502
|
{
|
|
16417
16503
|
onClick: save,
|
|
16418
|
-
disabled: !selectedCategory || isLoading || bankTransaction.processing,
|
|
16419
16504
|
fullWidth: true,
|
|
16420
|
-
|
|
16505
|
+
isDisabled: !selectedCategory || isLoading || bankTransaction.processing,
|
|
16506
|
+
children: bankTransaction.processing || isLoading ? "Confirming..." : "Confirm"
|
|
16421
16507
|
}
|
|
16422
|
-
)
|
|
16508
|
+
)
|
|
16423
16509
|
] }),
|
|
16424
16510
|
bankTransaction.error && showRetry ? /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
16425
16511
|
] }),
|
|
16426
16512
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16427
16513
|
CategorySelectDrawer,
|
|
16428
16514
|
{
|
|
16429
|
-
onSelect:
|
|
16515
|
+
onSelect: onDrawerSelect,
|
|
16430
16516
|
selectedId: selectedCategory == null ? void 0 : selectedCategory.value,
|
|
16431
16517
|
showTooltips,
|
|
16432
16518
|
isOpen: isDrawerOpen,
|
|
@@ -16481,12 +16567,14 @@ const BankTransactionsMobileListPersonalForm = ({
|
|
|
16481
16567
|
);
|
|
16482
16568
|
};
|
|
16483
16569
|
const alreadyAssigned = isAlreadyAssigned(bankTransaction);
|
|
16484
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16570
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
16485
16571
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16486
16572
|
BankTransactionFormFields,
|
|
16487
16573
|
{
|
|
16488
16574
|
bankTransaction,
|
|
16489
|
-
showDescriptions
|
|
16575
|
+
showDescriptions,
|
|
16576
|
+
hideCustomerVendor: true,
|
|
16577
|
+
hideTags: true
|
|
16490
16578
|
}
|
|
16491
16579
|
),
|
|
16492
16580
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16507,7 +16595,7 @@ const BankTransactionsMobileListPersonalForm = ({
|
|
|
16507
16595
|
)
|
|
16508
16596
|
}
|
|
16509
16597
|
),
|
|
16510
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16598
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", children: [
|
|
16511
16599
|
showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16512
16600
|
FileInput,
|
|
16513
16601
|
{
|
|
@@ -16520,34 +16608,70 @@ const BankTransactionsMobileListPersonalForm = ({
|
|
|
16520
16608
|
icon: /* @__PURE__ */ jsxRuntime.jsx(Paperclip, {})
|
|
16521
16609
|
}
|
|
16522
16610
|
),
|
|
16523
|
-
showCategorization
|
|
16524
|
-
Button
|
|
16611
|
+
showCategorization && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16612
|
+
Button,
|
|
16525
16613
|
{
|
|
16526
16614
|
fullWidth: true,
|
|
16527
|
-
disabled: alreadyAssigned || isLoading || bankTransaction.processing,
|
|
16528
16615
|
onClick: save,
|
|
16529
|
-
|
|
16616
|
+
isDisabled: alreadyAssigned || isLoading || bankTransaction.processing,
|
|
16617
|
+
children: bankTransaction.processing || isLoading ? "Confirming..." : alreadyAssigned ? "Confirmed" : "Mark as Personal"
|
|
16530
16618
|
}
|
|
16531
|
-
)
|
|
16619
|
+
)
|
|
16532
16620
|
] }),
|
|
16533
16621
|
bankTransaction.error && showRetry ? /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
16534
16622
|
] });
|
|
16535
16623
|
};
|
|
16624
|
+
const DATE_FORMAT = "LLL d";
|
|
16625
|
+
const BankTransactionsAmountDate = ({ amount, date: date2, slotProps }) => {
|
|
16626
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16627
|
+
VStack,
|
|
16628
|
+
{
|
|
16629
|
+
align: "end",
|
|
16630
|
+
gap: "3xs",
|
|
16631
|
+
pb: "sm",
|
|
16632
|
+
children: [
|
|
16633
|
+
/* @__PURE__ */ jsxRuntime.jsx(HStack, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16634
|
+
MoneySpan,
|
|
16635
|
+
__spreadValues({
|
|
16636
|
+
amount
|
|
16637
|
+
}, slotProps == null ? void 0 : slotProps.MoneySpan)
|
|
16638
|
+
) }),
|
|
16639
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16640
|
+
DateTime,
|
|
16641
|
+
{
|
|
16642
|
+
value: date2,
|
|
16643
|
+
dateFormat: DATE_FORMAT,
|
|
16644
|
+
onlyDate: true,
|
|
16645
|
+
slotProps: {
|
|
16646
|
+
Date: __spreadValues({
|
|
16647
|
+
variant: "subtle",
|
|
16648
|
+
size: "sm"
|
|
16649
|
+
}, slotProps == null ? void 0 : slotProps.DateTime)
|
|
16650
|
+
}
|
|
16651
|
+
}
|
|
16652
|
+
)
|
|
16653
|
+
]
|
|
16654
|
+
}
|
|
16655
|
+
);
|
|
16656
|
+
};
|
|
16536
16657
|
const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
|
|
16537
16658
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16538
16659
|
reactAriaComponents.GridListItem,
|
|
16539
16660
|
{
|
|
16540
16661
|
id: match.id,
|
|
16541
16662
|
textValue: match.details.description,
|
|
16542
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, {
|
|
16543
|
-
/* @__PURE__ */ jsxRuntime.
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16663
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pi: "md", gap: "md", justify: "space-between", children: [
|
|
16664
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", children: [
|
|
16665
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16666
|
+
Checkbox,
|
|
16667
|
+
{
|
|
16668
|
+
slot: "selection",
|
|
16669
|
+
variant: "round",
|
|
16670
|
+
className: "Layer__MatchFormMobileItem__Checkbox"
|
|
16671
|
+
}
|
|
16672
|
+
),
|
|
16673
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", children: match.details.description })
|
|
16674
|
+
] }),
|
|
16551
16675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16552
16676
|
BankTransactionsAmountDate,
|
|
16553
16677
|
{
|
|
@@ -16559,7 +16683,7 @@ const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
|
|
|
16559
16683
|
}
|
|
16560
16684
|
}
|
|
16561
16685
|
),
|
|
16562
|
-
|
|
16686
|
+
inAppLink
|
|
16563
16687
|
] })
|
|
16564
16688
|
},
|
|
16565
16689
|
match.id
|
|
@@ -16632,19 +16756,20 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
16632
16756
|
}
|
|
16633
16757
|
yield matchBankTransaction2(bankTransaction.id, foundMatch.id, true);
|
|
16634
16758
|
});
|
|
16635
|
-
const save = () =>
|
|
16759
|
+
const save = () => {
|
|
16636
16760
|
var _a2;
|
|
16637
16761
|
if (!showCategorization) {
|
|
16638
16762
|
return;
|
|
16639
16763
|
}
|
|
16640
16764
|
if (!selectedMatch) {
|
|
16641
16765
|
setFormError("Select an option to match the transaction");
|
|
16642
|
-
}
|
|
16643
|
-
|
|
16766
|
+
}
|
|
16767
|
+
if (selectedMatch && selectedMatch.id !== ((_a2 = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a2.id)) {
|
|
16768
|
+
void onMatchSubmit(selectedMatch.id);
|
|
16644
16769
|
}
|
|
16645
16770
|
return;
|
|
16646
|
-
}
|
|
16647
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, {
|
|
16771
|
+
};
|
|
16772
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
16648
16773
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", weight: "bold", children: "Find Match" }),
|
|
16649
16774
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16650
16775
|
MatchFormMobile,
|
|
@@ -16662,28 +16787,21 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
16662
16787
|
BankTransactionFormFields,
|
|
16663
16788
|
{
|
|
16664
16789
|
bankTransaction,
|
|
16665
|
-
showDescriptions
|
|
16790
|
+
showDescriptions,
|
|
16791
|
+
hideCustomerVendor: true,
|
|
16792
|
+
hideTags: true
|
|
16666
16793
|
}
|
|
16667
16794
|
),
|
|
16668
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16669
|
-
|
|
16795
|
+
showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16796
|
+
BankTransactionReceipts,
|
|
16670
16797
|
{
|
|
16671
|
-
|
|
16672
|
-
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
children: showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16676
|
-
BankTransactionReceipts,
|
|
16677
|
-
{
|
|
16678
|
-
ref: receiptsRef,
|
|
16679
|
-
floatingActions: false,
|
|
16680
|
-
hideUploadButtons: true,
|
|
16681
|
-
label: "Receipts"
|
|
16682
|
-
}
|
|
16683
|
-
)
|
|
16798
|
+
ref: receiptsRef,
|
|
16799
|
+
floatingActions: false,
|
|
16800
|
+
hideUploadButtons: true,
|
|
16801
|
+
label: "Receipts"
|
|
16684
16802
|
}
|
|
16685
16803
|
),
|
|
16686
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16804
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", children: [
|
|
16687
16805
|
showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16688
16806
|
FileInput,
|
|
16689
16807
|
{
|
|
@@ -16697,49 +16815,37 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
16697
16815
|
}
|
|
16698
16816
|
),
|
|
16699
16817
|
showCategorization && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16700
|
-
Button
|
|
16818
|
+
Button,
|
|
16701
16819
|
{
|
|
16702
16820
|
fullWidth: true,
|
|
16703
|
-
|
|
16704
|
-
onClick:
|
|
16705
|
-
void save();
|
|
16706
|
-
},
|
|
16821
|
+
isDisabled: !selectedMatch || isLoading || bankTransaction.processing || selectedMatch.id === ((_a = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a.id),
|
|
16822
|
+
onClick: save,
|
|
16707
16823
|
children: isLoading || bankTransaction.processing ? "Saving..." : "Approve match"
|
|
16708
16824
|
}
|
|
16709
16825
|
)
|
|
16710
16826
|
] }),
|
|
16711
16827
|
formError && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: formError }),
|
|
16712
|
-
showRetry
|
|
16828
|
+
showRetry && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
16713
16829
|
] });
|
|
16714
16830
|
};
|
|
16715
|
-
const CategorySelectDrawerWithTrigger = ({
|
|
16716
|
-
value,
|
|
16717
|
-
onChange,
|
|
16718
|
-
showTooltips
|
|
16719
|
-
}) => {
|
|
16831
|
+
const CategorySelectDrawerWithTrigger = ({ value, onChange, showTooltips }) => {
|
|
16720
16832
|
var _a;
|
|
16721
16833
|
const [isDrawerOpen, setIsDrawerOpen] = react.useState(false);
|
|
16722
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16834
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { fluid: true, children: [
|
|
16723
16835
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16724
|
-
|
|
16836
|
+
Button,
|
|
16725
16837
|
{
|
|
16838
|
+
flex: true,
|
|
16839
|
+
fullWidth: true,
|
|
16726
16840
|
"aria-label": "Select category",
|
|
16727
|
-
className: classNames(
|
|
16728
|
-
"Layer__category-menu__drawer-btn",
|
|
16729
|
-
value && "Layer__category-menu__drawer-btn--selected"
|
|
16730
|
-
),
|
|
16731
16841
|
onClick: () => {
|
|
16732
16842
|
setIsDrawerOpen(true);
|
|
16733
16843
|
},
|
|
16844
|
+
variant: "outlined",
|
|
16734
16845
|
children: [
|
|
16735
|
-
(_a = value == null ? void 0 : value.label) != null ? _a : "Select...",
|
|
16736
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16737
|
-
|
|
16738
|
-
{
|
|
16739
|
-
size: 16,
|
|
16740
|
-
className: "Layer__category-menu__drawer-btn__arrow"
|
|
16741
|
-
}
|
|
16742
|
-
)
|
|
16846
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { children: (_a = value == null ? void 0 : value.label) != null ? _a : "Select..." }),
|
|
16847
|
+
/* @__PURE__ */ jsxRuntime.jsx(Spacer, {}),
|
|
16848
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 16 })
|
|
16743
16849
|
]
|
|
16744
16850
|
}
|
|
16745
16851
|
),
|
|
@@ -16784,84 +16890,90 @@ const BankTransactionsMobileListSplitForm = ({
|
|
|
16784
16890
|
bankTransaction,
|
|
16785
16891
|
selectedCategory
|
|
16786
16892
|
});
|
|
16893
|
+
const effectiveSplits = showCategorization ? localSplits : [];
|
|
16894
|
+
const addSplitButtonText = effectiveSplits.length > 1 ? "Add new split" : "Split";
|
|
16787
16895
|
react.useEffect(() => {
|
|
16788
16896
|
if (bankTransaction.error) {
|
|
16789
16897
|
setShowRetry(true);
|
|
16790
16898
|
}
|
|
16791
16899
|
}, [bankTransaction.error]);
|
|
16792
|
-
const save = () =>
|
|
16900
|
+
const save = () => {
|
|
16793
16901
|
if (!isValid) return;
|
|
16794
16902
|
const categorizationRequest = buildCategorizeBankTransactionPayloadForSplit(localSplits);
|
|
16795
|
-
|
|
16903
|
+
void categorizeBankTransaction2(
|
|
16796
16904
|
bankTransaction.id,
|
|
16797
16905
|
categorizationRequest
|
|
16798
16906
|
);
|
|
16799
16907
|
deselect(bankTransaction.id);
|
|
16800
16908
|
close();
|
|
16801
|
-
}
|
|
16802
|
-
|
|
16803
|
-
|
|
16909
|
+
};
|
|
16910
|
+
const handleCategoryChange = react.useCallback((index2) => (value) => {
|
|
16911
|
+
changeCategoryForSplitAtIndex(index2, value);
|
|
16912
|
+
}, [changeCategoryForSplitAtIndex]);
|
|
16913
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
16914
|
+
showCategorization && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
16804
16915
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { weight: TextWeight.bold, size: TextSize.sm, children: "Split transaction" }),
|
|
16805
|
-
/* @__PURE__ */ jsxRuntime.
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
|
|
16853
|
-
|
|
16854
|
-
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
] }),
|
|
16916
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "sm", children: localSplits.map((split, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16917
|
+
HStack,
|
|
16918
|
+
{
|
|
16919
|
+
gap: "xs",
|
|
16920
|
+
align: "center",
|
|
16921
|
+
justify: "space-between",
|
|
16922
|
+
children: [
|
|
16923
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16924
|
+
CategorySelectDrawerWithTrigger,
|
|
16925
|
+
{
|
|
16926
|
+
value: split.category,
|
|
16927
|
+
onChange: handleCategoryChange(index2),
|
|
16928
|
+
showTooltips
|
|
16929
|
+
}
|
|
16930
|
+
),
|
|
16931
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16932
|
+
AmountInput,
|
|
16933
|
+
{
|
|
16934
|
+
name: `split-${index2}`,
|
|
16935
|
+
disabled: index2 === 0 || !showCategorization,
|
|
16936
|
+
onChange: updateSplitAmount(index2),
|
|
16937
|
+
value: getInputValueForSplitAtIndex(index2, split),
|
|
16938
|
+
onBlur: onBlurSplitAmount,
|
|
16939
|
+
isInvalid: split.amount < 0,
|
|
16940
|
+
className: "Layer__BankTransactionsMobileSplitForm__AmountInput"
|
|
16941
|
+
}
|
|
16942
|
+
),
|
|
16943
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16944
|
+
Button,
|
|
16945
|
+
{
|
|
16946
|
+
onClick: () => removeSplit(index2),
|
|
16947
|
+
variant: "outlined",
|
|
16948
|
+
icon: true,
|
|
16949
|
+
isDisabled: index2 == 0,
|
|
16950
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Trash, { size: 16 })
|
|
16951
|
+
}
|
|
16952
|
+
)
|
|
16953
|
+
]
|
|
16954
|
+
},
|
|
16955
|
+
`split-${index2}`
|
|
16956
|
+
)) }),
|
|
16957
|
+
/* @__PURE__ */ jsxRuntime.jsx(HStack, { justify: "end", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16958
|
+
Button,
|
|
16959
|
+
{
|
|
16960
|
+
onClick: addSplit,
|
|
16961
|
+
variant: "outlined",
|
|
16962
|
+
children: [
|
|
16963
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scissors, { size: 14 }),
|
|
16964
|
+
addSplitButtonText
|
|
16965
|
+
]
|
|
16966
|
+
}
|
|
16967
|
+
) }),
|
|
16858
16968
|
splitFormError && /* @__PURE__ */ jsxRuntime.jsx(HStack, { pbe: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: splitFormError }) })
|
|
16859
|
-
] })
|
|
16969
|
+
] }),
|
|
16860
16970
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16861
16971
|
BankTransactionFormFields,
|
|
16862
16972
|
{
|
|
16863
16973
|
bankTransaction,
|
|
16864
|
-
showDescriptions
|
|
16974
|
+
showDescriptions,
|
|
16975
|
+
hideCustomerVendor: true,
|
|
16976
|
+
hideTags: true
|
|
16865
16977
|
}
|
|
16866
16978
|
),
|
|
16867
16979
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16882,7 +16994,7 @@ const BankTransactionsMobileListSplitForm = ({
|
|
|
16882
16994
|
)
|
|
16883
16995
|
}
|
|
16884
16996
|
),
|
|
16885
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16997
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", children: [
|
|
16886
16998
|
showReceiptUploads && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16887
16999
|
FileInput,
|
|
16888
17000
|
{
|
|
@@ -16896,16 +17008,16 @@ const BankTransactionsMobileListSplitForm = ({
|
|
|
16896
17008
|
}
|
|
16897
17009
|
),
|
|
16898
17010
|
showCategorization && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16899
|
-
Button
|
|
17011
|
+
Button,
|
|
16900
17012
|
{
|
|
16901
17013
|
fullWidth: true,
|
|
16902
|
-
onClick:
|
|
16903
|
-
|
|
16904
|
-
children:
|
|
17014
|
+
onClick: save,
|
|
17015
|
+
isDisabled: isLoading || bankTransaction.processing || !isValid,
|
|
17016
|
+
children: bankTransaction.processing || isLoading ? "Confirming..." : "Confirm"
|
|
16905
17017
|
}
|
|
16906
17018
|
)
|
|
16907
17019
|
] }),
|
|
16908
|
-
bankTransaction.error && showRetry
|
|
17020
|
+
bankTransaction.error && showRetry && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
16909
17021
|
] });
|
|
16910
17022
|
};
|
|
16911
17023
|
const BankTransactionsMobileListSplitAndMatchForm = ({
|
|
@@ -16920,7 +17032,7 @@ const BankTransactionsMobileListSplitAndMatchForm = ({
|
|
|
16920
17032
|
bankTransaction.category ? "categorize" : anyMatch ? "match" : "categorize"
|
|
16921
17033
|
/* categorize */
|
|
16922
17034
|
);
|
|
16923
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17035
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16924
17036
|
formType === "categorize" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16925
17037
|
BankTransactionsMobileListSplitForm,
|
|
16926
17038
|
{
|
|
@@ -16940,14 +17052,13 @@ const BankTransactionsMobileListSplitAndMatchForm = ({
|
|
|
16940
17052
|
showCategorization
|
|
16941
17053
|
}
|
|
16942
17054
|
),
|
|
16943
|
-
showCategorization && anyMatch && formType === "match" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17055
|
+
showCategorization && anyMatch && (formType === "match" ? /* @__PURE__ */ jsxRuntime.jsx(TextButton, { onClick: () => setFormType(
|
|
16944
17056
|
"categorize"
|
|
16945
17057
|
/* categorize */
|
|
16946
|
-
), children: "or split transaction" })
|
|
16947
|
-
showCategorization && anyMatch && formType === "categorize" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns", children: /* @__PURE__ */ jsxRuntime.jsx(TextButton, { onClick: () => setFormType(
|
|
17058
|
+
), children: "or split transaction" }) : /* @__PURE__ */ jsxRuntime.jsx(TextButton, { onClick: () => setFormType(
|
|
16948
17059
|
"match"
|
|
16949
17060
|
/* match */
|
|
16950
|
-
), children: "or find match" })
|
|
17061
|
+
), children: "or find match" }))
|
|
16951
17062
|
] });
|
|
16952
17063
|
};
|
|
16953
17064
|
const BankTransactionsMobileForms = ({
|
|
@@ -16997,7 +17108,7 @@ const BankTransactionsMobileForms = ({
|
|
|
16997
17108
|
return null;
|
|
16998
17109
|
}
|
|
16999
17110
|
};
|
|
17000
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children:
|
|
17111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: getContent() });
|
|
17001
17112
|
};
|
|
17002
17113
|
const PURPOSE_TOGGLE_OPTIONS = [
|
|
17003
17114
|
{
|
|
@@ -17025,8 +17136,8 @@ const BankTransactionsMobileListItemExpandedRow = ({
|
|
|
17025
17136
|
}) => {
|
|
17026
17137
|
const [purpose, setPurpose] = react.useState(getInitialPurpose(bankTransaction));
|
|
17027
17138
|
const onChangePurpose = (event) => setPurpose(event.target.value);
|
|
17028
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
17029
|
-
showCategorization
|
|
17139
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pi: "md", gap: "md", pbe: "md", children: [
|
|
17140
|
+
showCategorization && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17030
17141
|
Toggle,
|
|
17031
17142
|
{
|
|
17032
17143
|
name: `purpose-${bankTransaction.id}`,
|
|
@@ -17035,7 +17146,7 @@ const BankTransactionsMobileListItemExpandedRow = ({
|
|
|
17035
17146
|
selected: purpose,
|
|
17036
17147
|
onChange: onChangePurpose
|
|
17037
17148
|
}
|
|
17038
|
-
)
|
|
17149
|
+
),
|
|
17039
17150
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17040
17151
|
BankTransactionsMobileForms,
|
|
17041
17152
|
{
|
|
@@ -17047,7 +17158,7 @@ const BankTransactionsMobileListItemExpandedRow = ({
|
|
|
17047
17158
|
showTooltips
|
|
17048
17159
|
}
|
|
17049
17160
|
)
|
|
17050
|
-
] })
|
|
17161
|
+
] });
|
|
17051
17162
|
};
|
|
17052
17163
|
const getInitialPurpose = (bankTransaction) => {
|
|
17053
17164
|
if (bankTransaction.category) {
|
|
@@ -17177,6 +17288,11 @@ const BankTransactionsMobileListItem = ({
|
|
|
17177
17288
|
}, 300);
|
|
17178
17289
|
}
|
|
17179
17290
|
}, [bankTransaction.recently_categorized]);
|
|
17291
|
+
react.useEffect(() => {
|
|
17292
|
+
if (bulkActionsEnabled) {
|
|
17293
|
+
close2();
|
|
17294
|
+
}
|
|
17295
|
+
}, [bulkActionsEnabled]);
|
|
17180
17296
|
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
17181
17297
|
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
17182
17298
|
const { select, deselect } = useBulkSelectionActions();
|
|
@@ -17252,15 +17368,16 @@ const BankTransactionsMobileListItem = ({
|
|
|
17252
17368
|
}
|
|
17253
17369
|
),
|
|
17254
17370
|
!open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17255
|
-
|
|
17371
|
+
BankTransactionsListItemCategory,
|
|
17256
17372
|
{
|
|
17257
|
-
bankTransaction
|
|
17373
|
+
bankTransaction,
|
|
17374
|
+
mobile: true
|
|
17258
17375
|
}
|
|
17259
17376
|
)
|
|
17260
17377
|
]
|
|
17261
17378
|
}
|
|
17262
17379
|
),
|
|
17263
|
-
open
|
|
17380
|
+
/* @__PURE__ */ jsxRuntime.jsx(AnimatedContent, { variant: "expand", isOpen: open, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17264
17381
|
BankTransactionsMobileListItemExpandedRow,
|
|
17265
17382
|
{
|
|
17266
17383
|
bankTransaction,
|
|
@@ -17269,14 +17386,14 @@ const BankTransactionsMobileListItem = ({
|
|
|
17269
17386
|
showReceiptUploads,
|
|
17270
17387
|
showTooltips
|
|
17271
17388
|
}
|
|
17272
|
-
)
|
|
17389
|
+
) }, `expanded-${bankTransaction.id}`)
|
|
17273
17390
|
] }) });
|
|
17274
17391
|
};
|
|
17275
17392
|
const SWITCH_CLASS_NAME = "Layer__Switch";
|
|
17276
|
-
const Switch = react.forwardRef((
|
|
17277
|
-
var
|
|
17393
|
+
const Switch = react.forwardRef((_Mb, ref) => {
|
|
17394
|
+
var _Nb = _Mb, {
|
|
17278
17395
|
children
|
|
17279
|
-
} =
|
|
17396
|
+
} = _Nb, props = __objRest(_Nb, [
|
|
17280
17397
|
"children"
|
|
17281
17398
|
]);
|
|
17282
17399
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -17652,8 +17769,8 @@ const usePaginationRange = ({
|
|
|
17652
17769
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
17653
17770
|
return paginationRange;
|
|
17654
17771
|
};
|
|
17655
|
-
const PaginationButton = (
|
|
17656
|
-
var
|
|
17772
|
+
const PaginationButton = (_Ob) => {
|
|
17773
|
+
var _Pb = _Ob, { children, isSelected } = _Pb, buttonProps = __objRest(_Pb, ["children", "isSelected"]);
|
|
17657
17774
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17658
17775
|
Button,
|
|
17659
17776
|
__spreadProps(__spreadValues({
|
|
@@ -18200,8 +18317,8 @@ function BaseFormTextField({
|
|
|
18200
18317
|
}
|
|
18201
18318
|
const INPUT_CLASS_NAME = "Layer__UI__Input";
|
|
18202
18319
|
const Input = react.forwardRef(
|
|
18203
|
-
function Input2(
|
|
18204
|
-
var
|
|
18320
|
+
function Input2(_Qb, ref) {
|
|
18321
|
+
var _Rb = _Qb, { inset, placement } = _Rb, restProps = __objRest(_Rb, ["inset", "placement"]);
|
|
18205
18322
|
const dataProperties = toDataProperties({ inset, placement });
|
|
18206
18323
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18207
18324
|
reactAriaComponents.Input,
|
|
@@ -18297,15 +18414,15 @@ const withForceUpdate = (value) => {
|
|
|
18297
18414
|
writable: false
|
|
18298
18415
|
});
|
|
18299
18416
|
};
|
|
18300
|
-
function FormBigDecimalField(
|
|
18301
|
-
var
|
|
18417
|
+
function FormBigDecimalField(_Sb) {
|
|
18418
|
+
var _Tb = _Sb, {
|
|
18302
18419
|
mode = "decimal",
|
|
18303
18420
|
allowNegative = false,
|
|
18304
18421
|
maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
|
|
18305
18422
|
minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
|
|
18306
18423
|
maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
|
|
18307
18424
|
slots
|
|
18308
|
-
} =
|
|
18425
|
+
} = _Tb, restProps = __objRest(_Tb, [
|
|
18309
18426
|
"mode",
|
|
18310
18427
|
"allowNegative",
|
|
18311
18428
|
"maxValue",
|
|
@@ -18470,8 +18587,8 @@ function FormDateField({
|
|
|
18470
18587
|
}
|
|
18471
18588
|
const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
|
|
18472
18589
|
const TextArea = react.forwardRef(
|
|
18473
|
-
function TextArea2(
|
|
18474
|
-
var
|
|
18590
|
+
function TextArea2(_Ub, ref) {
|
|
18591
|
+
var _Vb = _Ub, { resize = "none" } = _Vb, restProps = __objRest(_Vb, ["resize"]);
|
|
18475
18592
|
const dataProperties = toDataProperties({ resize });
|
|
18476
18593
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18477
18594
|
reactAriaComponents.TextArea,
|
|
@@ -18753,8 +18870,8 @@ const CustomAccountForm = ({ initialAccountName, onCancel, onSuccess }) => {
|
|
|
18753
18870
|
}
|
|
18754
18871
|
);
|
|
18755
18872
|
};
|
|
18756
|
-
const CloseIcon = (
|
|
18757
|
-
var
|
|
18873
|
+
const CloseIcon = (_Wb) => {
|
|
18874
|
+
var _Xb = _Wb, { size = 12 } = _Xb, props = __objRest(_Xb, ["size"]);
|
|
18758
18875
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18759
18876
|
"svg",
|
|
18760
18877
|
__spreadProps(__spreadValues({
|
|
@@ -20576,8 +20693,8 @@ const BankTransactionsHeader = ({
|
|
|
20576
20693
|
}
|
|
20577
20694
|
);
|
|
20578
20695
|
};
|
|
20579
|
-
const Inbox = (
|
|
20580
|
-
var
|
|
20696
|
+
const Inbox = (_Yb) => {
|
|
20697
|
+
var _Zb = _Yb, { size = 18 } = _Zb, props = __objRest(_Zb, ["size"]);
|
|
20581
20698
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20582
20699
|
"svg",
|
|
20583
20700
|
__spreadProps(__spreadValues({
|
|
@@ -21066,6 +21183,7 @@ function useRejectCategorizationRulesUpdateSuggestion() {
|
|
|
21066
21183
|
function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
21067
21184
|
const { next } = useWizard();
|
|
21068
21185
|
const { addToast } = useLayerContext();
|
|
21186
|
+
const { isMobile } = useSizeClass();
|
|
21069
21187
|
const [dontAskAgain, setDontAskAgain] = react.useState(false);
|
|
21070
21188
|
const { trigger: rejectRuleSuggestion, isMutating } = useRejectCategorizationRulesUpdateSuggestion();
|
|
21071
21189
|
const handleRejectRuleSuggestion = react.useCallback(() => {
|
|
@@ -21083,7 +21201,7 @@ function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
|
21083
21201
|
}
|
|
21084
21202
|
}))();
|
|
21085
21203
|
}, [addToast, close2, dontAskAgain, rejectRuleSuggestion, ruleSuggestion.newRule.createdBySuggestionId]);
|
|
21086
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xl", children: [
|
|
21204
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: isMobile ? "md" : "3xl", children: [
|
|
21087
21205
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", children: ruleSuggestion.suggestionPrompt }),
|
|
21088
21206
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", align: "end", children: [
|
|
21089
21207
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", justify: "end", align: "end", children: [
|
|
@@ -21124,8 +21242,8 @@ function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
|
21124
21242
|
const CSS_PREFIX$1 = "Layer__UI__Table";
|
|
21125
21243
|
const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
|
|
21126
21244
|
const Table$1 = react.forwardRef(
|
|
21127
|
-
(
|
|
21128
|
-
var
|
|
21245
|
+
(__b, ref) => {
|
|
21246
|
+
var _$b = __b, { children, className } = _$b, restProps = __objRest(_$b, ["children", "className"]);
|
|
21129
21247
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21130
21248
|
reactAriaComponents.Table,
|
|
21131
21249
|
__spreadProps(__spreadValues({
|
|
@@ -21138,8 +21256,8 @@ const Table$1 = react.forwardRef(
|
|
|
21138
21256
|
}
|
|
21139
21257
|
);
|
|
21140
21258
|
Table$1.displayName = "Table";
|
|
21141
|
-
const TableHeaderInner = (
|
|
21142
|
-
var
|
|
21259
|
+
const TableHeaderInner = (_ac, ref) => {
|
|
21260
|
+
var _bc = _ac, { children, className, hideHeader } = _bc, restProps = __objRest(_bc, ["children", "className", "hideHeader"]);
|
|
21143
21261
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21144
21262
|
reactAriaComponents.TableHeader,
|
|
21145
21263
|
__spreadProps(__spreadValues({
|
|
@@ -21152,8 +21270,8 @@ const TableHeaderInner = (__b, ref) => {
|
|
|
21152
21270
|
};
|
|
21153
21271
|
const TableHeader = react.forwardRef(TableHeaderInner);
|
|
21154
21272
|
TableHeader.displayName = "TableHeader";
|
|
21155
|
-
const TableBodyInner = (
|
|
21156
|
-
var
|
|
21273
|
+
const TableBodyInner = (_cc, ref) => {
|
|
21274
|
+
var _dc = _cc, { children, className } = _dc, restProps = __objRest(_dc, ["children", "className"]);
|
|
21157
21275
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21158
21276
|
reactAriaComponents.TableBody,
|
|
21159
21277
|
__spreadProps(__spreadValues({
|
|
@@ -21166,8 +21284,8 @@ const TableBodyInner = (_ac, ref) => {
|
|
|
21166
21284
|
};
|
|
21167
21285
|
const TableBody$1 = react.forwardRef(TableBodyInner);
|
|
21168
21286
|
TableBody$1.displayName = "TableBody";
|
|
21169
|
-
const RowInner = (
|
|
21170
|
-
var
|
|
21287
|
+
const RowInner = (_ec, ref) => {
|
|
21288
|
+
var _fc = _ec, { children, className, depth = 0 } = _fc, restProps = __objRest(_fc, ["children", "className", "depth"]);
|
|
21171
21289
|
const dataProperties = toDataProperties({ depth });
|
|
21172
21290
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21173
21291
|
reactAriaComponents.Row,
|
|
@@ -21182,8 +21300,8 @@ const RowInner = (_cc, ref) => {
|
|
|
21182
21300
|
const Row = react.forwardRef(RowInner);
|
|
21183
21301
|
Row.displayName = "Row";
|
|
21184
21302
|
const Column = react.forwardRef(
|
|
21185
|
-
(
|
|
21186
|
-
var
|
|
21303
|
+
(_gc, ref) => {
|
|
21304
|
+
var _hc = _gc, { children, className, textAlign = "left" } = _hc, restProps = __objRest(_hc, ["children", "className", "textAlign"]);
|
|
21187
21305
|
const dataProperties = toDataProperties({ "text-align": textAlign });
|
|
21188
21306
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21189
21307
|
reactAriaComponents.Column,
|
|
@@ -21198,8 +21316,8 @@ const Column = react.forwardRef(
|
|
|
21198
21316
|
);
|
|
21199
21317
|
Column.displayName = "Column";
|
|
21200
21318
|
const Cell = react.forwardRef(
|
|
21201
|
-
(
|
|
21202
|
-
var
|
|
21319
|
+
(_ic, ref) => {
|
|
21320
|
+
var _jc = _ic, { children, className } = _jc, restProps = __objRest(_jc, ["children", "className"]);
|
|
21203
21321
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21204
21322
|
reactAriaComponents.Cell,
|
|
21205
21323
|
__spreadProps(__spreadValues({
|
|
@@ -21492,8 +21610,8 @@ const SuggestedCategorizationRuleUpdatesDrawer = ({
|
|
|
21492
21610
|
/* @__PURE__ */ jsxRuntime.jsx(SuggestedCategorizationRuleUpdates, { ruleSuggestion, close: close2 })
|
|
21493
21611
|
] }) });
|
|
21494
21612
|
};
|
|
21495
|
-
const BackArrow = (
|
|
21496
|
-
var
|
|
21613
|
+
const BackArrow = (_kc) => {
|
|
21614
|
+
var _lc = _kc, { size = 18 } = _lc, props = __objRest(_lc, ["size"]);
|
|
21497
21615
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21498
21616
|
"svg",
|
|
21499
21617
|
__spreadProps(__spreadValues({
|
|
@@ -21864,8 +21982,8 @@ const CategorizationRulesDrawer = () => {
|
|
|
21864
21982
|
) });
|
|
21865
21983
|
};
|
|
21866
21984
|
const COMPONENT_NAME$a = "bank-transactions";
|
|
21867
|
-
const BankTransactions = (
|
|
21868
|
-
var
|
|
21985
|
+
const BankTransactions = (_mc) => {
|
|
21986
|
+
var _nc = _mc, {
|
|
21869
21987
|
onError,
|
|
21870
21988
|
showTags = false,
|
|
21871
21989
|
showCustomerVendor = false,
|
|
@@ -21873,7 +21991,7 @@ const BankTransactions = (_kc) => {
|
|
|
21873
21991
|
applyGlobalDateRange = false,
|
|
21874
21992
|
mode,
|
|
21875
21993
|
renderInAppLink
|
|
21876
|
-
} =
|
|
21994
|
+
} = _nc, props = __objRest(_nc, [
|
|
21877
21995
|
"onError",
|
|
21878
21996
|
"showTags",
|
|
21879
21997
|
"showCustomerVendor",
|
|
@@ -22160,8 +22278,8 @@ const BankTransactionsTableView = ({
|
|
|
22160
22278
|
}
|
|
22161
22279
|
);
|
|
22162
22280
|
};
|
|
22163
|
-
const QuickbooksIcon = (
|
|
22164
|
-
var
|
|
22281
|
+
const QuickbooksIcon = (_oc) => {
|
|
22282
|
+
var _pc = _oc, { size = 24 } = _pc, props = __objRest(_pc, ["size"]);
|
|
22165
22283
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22166
22284
|
"svg",
|
|
22167
22285
|
__spreadProps(__spreadValues({
|
|
@@ -22442,8 +22560,8 @@ function QuickbooksContextProvider({ children }) {
|
|
|
22442
22560
|
const quickbooksContextData = useQuickbooks();
|
|
22443
22561
|
return /* @__PURE__ */ jsxRuntime.jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
|
|
22444
22562
|
}
|
|
22445
|
-
const Cog = (
|
|
22446
|
-
var
|
|
22563
|
+
const Cog = (_qc) => {
|
|
22564
|
+
var _rc = _qc, { size = 12 } = _rc, props = __objRest(_rc, ["size"]);
|
|
22447
22565
|
const id = react.useId();
|
|
22448
22566
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22449
22567
|
"svg",
|
|
@@ -22583,69 +22701,10 @@ const applyShare = (items, total) => {
|
|
|
22583
22701
|
});
|
|
22584
22702
|
});
|
|
22585
22703
|
};
|
|
22586
|
-
var ReportKey = /* @__PURE__ */ ((ReportKey2) => {
|
|
22587
|
-
ReportKey2["ProfitAndLoss"] = "ProfitAndLoss";
|
|
22588
|
-
ReportKey2["BalanceSheet"] = "BalanceSheet";
|
|
22589
|
-
ReportKey2["StatementOfCashFlows"] = "StatementOfCashFlows";
|
|
22590
|
-
return ReportKey2;
|
|
22591
|
-
})(ReportKey || {});
|
|
22592
|
-
const defaultModeByReport = {
|
|
22593
|
-
[
|
|
22594
|
-
"ProfitAndLoss"
|
|
22595
|
-
/* ProfitAndLoss */
|
|
22596
|
-
]: "monthPicker",
|
|
22597
|
-
// This one should never change, but is included for completeness
|
|
22598
|
-
[
|
|
22599
|
-
"BalanceSheet"
|
|
22600
|
-
/* BalanceSheet */
|
|
22601
|
-
]: "dayPicker",
|
|
22602
|
-
[
|
|
22603
|
-
"StatementOfCashFlows"
|
|
22604
|
-
/* StatementOfCashFlows */
|
|
22605
|
-
]: "monthPicker"
|
|
22606
|
-
};
|
|
22607
|
-
const ReportsModeStoreContext = react.createContext(
|
|
22608
|
-
zustand.createStore(() => ({
|
|
22609
|
-
resetPnLModeToDefaultOnMount: true,
|
|
22610
|
-
modeByReport: {},
|
|
22611
|
-
actions: {
|
|
22612
|
-
setModeForReport: () => {
|
|
22613
|
-
}
|
|
22614
|
-
}
|
|
22615
|
-
}))
|
|
22616
|
-
);
|
|
22617
|
-
function useReportMode(report) {
|
|
22618
|
-
const store = react.useContext(ReportsModeStoreContext);
|
|
22619
|
-
return zustand.useStore(store, (state) => state.modeByReport[report]);
|
|
22620
|
-
}
|
|
22621
|
-
function useReportModeWithFallback(report, fallback) {
|
|
22622
|
-
const mode = useReportMode(report);
|
|
22623
|
-
return mode != null ? mode : fallback;
|
|
22624
|
-
}
|
|
22625
|
-
function ReportsModeStoreProvider({
|
|
22626
|
-
children,
|
|
22627
|
-
initialModes,
|
|
22628
|
-
resetPnLModeToDefaultOnMount = true
|
|
22629
|
-
}) {
|
|
22630
|
-
const [store] = react.useState(
|
|
22631
|
-
() => zustand.createStore((set) => ({
|
|
22632
|
-
modeByReport: __spreadValues(__spreadValues({}, defaultModeByReport), initialModes),
|
|
22633
|
-
resetPnLModeToDefaultOnMount,
|
|
22634
|
-
actions: {
|
|
22635
|
-
setModeForReport: (report, mode) => set((state) => ({
|
|
22636
|
-
modeByReport: __spreadProps(__spreadValues({}, state.modeByReport), {
|
|
22637
|
-
[report]: mode
|
|
22638
|
-
})
|
|
22639
|
-
}))
|
|
22640
|
-
}
|
|
22641
|
-
}))
|
|
22642
|
-
);
|
|
22643
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReportsModeStoreContext.Provider, { value: store, children });
|
|
22644
|
-
}
|
|
22645
22704
|
const useProfitAndLoss = ({ tagFilter, reportingBasis }) => {
|
|
22646
22705
|
var _a;
|
|
22647
|
-
const
|
|
22648
|
-
const dateRange = useGlobalDateRange({ displayMode
|
|
22706
|
+
const [displayMode, setDisplayMode] = react.useState("month");
|
|
22707
|
+
const dateRange = useGlobalDateRange({ displayMode });
|
|
22649
22708
|
const [filters, setFilters] = react.useState({
|
|
22650
22709
|
expenses: void 0,
|
|
22651
22710
|
revenue: void 0
|
|
@@ -22769,7 +22828,9 @@ const useProfitAndLoss = ({ tagFilter, reportingBasis }) => {
|
|
|
22769
22828
|
tagFilter,
|
|
22770
22829
|
dateRange,
|
|
22771
22830
|
selectedLineItem,
|
|
22772
|
-
setSelectedLineItem
|
|
22831
|
+
setSelectedLineItem,
|
|
22832
|
+
setDisplayMode,
|
|
22833
|
+
displayMode
|
|
22773
22834
|
};
|
|
22774
22835
|
};
|
|
22775
22836
|
function range(start, end) {
|
|
@@ -22778,12 +22839,56 @@ function range(start, end) {
|
|
|
22778
22839
|
function isArrayWithAtLeastOne(list) {
|
|
22779
22840
|
return list.length > 0;
|
|
22780
22841
|
}
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
22842
|
+
var DateGroupBy = /* @__PURE__ */ ((DateGroupBy2) => {
|
|
22843
|
+
DateGroupBy2["AllTime"] = "AllTime";
|
|
22844
|
+
DateGroupBy2["Month"] = "Month";
|
|
22845
|
+
DateGroupBy2["Year"] = "Year";
|
|
22846
|
+
return DateGroupBy2;
|
|
22847
|
+
})(DateGroupBy || {});
|
|
22848
|
+
const DateGroupByOptionConfig = {
|
|
22849
|
+
[
|
|
22850
|
+
"AllTime"
|
|
22851
|
+
/* AllTime */
|
|
22852
|
+
]: {
|
|
22853
|
+
label: "All time",
|
|
22854
|
+
value: "AllTime"
|
|
22855
|
+
/* AllTime */
|
|
22856
|
+
},
|
|
22857
|
+
[
|
|
22858
|
+
"Month"
|
|
22859
|
+
/* Month */
|
|
22860
|
+
]: {
|
|
22861
|
+
label: "Compare by month",
|
|
22862
|
+
value: "Month"
|
|
22863
|
+
/* Month */
|
|
22864
|
+
},
|
|
22865
|
+
[
|
|
22866
|
+
"Year"
|
|
22867
|
+
/* Year */
|
|
22868
|
+
]: {
|
|
22869
|
+
label: "Compare by year",
|
|
22870
|
+
value: "Year"
|
|
22871
|
+
/* Year */
|
|
22784
22872
|
}
|
|
22785
|
-
|
|
22786
|
-
|
|
22873
|
+
};
|
|
22874
|
+
const options$3 = Object.values(DateGroupByOptionConfig);
|
|
22875
|
+
const DateGroupByComboBox = ({ value, onValueChange }) => {
|
|
22876
|
+
const selectedOption = value ? DateGroupByOptionConfig[value] : null;
|
|
22877
|
+
const onSelectedValueChange = react.useCallback((option) => {
|
|
22878
|
+
onValueChange((option == null ? void 0 : option.value) || null);
|
|
22879
|
+
}, [onValueChange]);
|
|
22880
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22881
|
+
ComboBox,
|
|
22882
|
+
{
|
|
22883
|
+
className: "Layer__DateGroupByComboBox",
|
|
22884
|
+
options: options$3,
|
|
22885
|
+
onSelectedValueChange,
|
|
22886
|
+
selectedValue: selectedOption,
|
|
22887
|
+
isSearchable: false,
|
|
22888
|
+
isClearable: false
|
|
22889
|
+
}
|
|
22890
|
+
);
|
|
22891
|
+
};
|
|
22787
22892
|
function prepareFiltersBody(compareOptions) {
|
|
22788
22893
|
const noneFilters = compareOptions.filter(
|
|
22789
22894
|
({ tagFilterConfig: { tagFilters: tagFilters2 } }) => tagFilters2 === "None"
|
|
@@ -22823,9 +22928,9 @@ function prepareFiltersBody(compareOptions) {
|
|
|
22823
22928
|
return isArrayWithAtLeastOne(allFilters) ? allFilters : void 0;
|
|
22824
22929
|
}
|
|
22825
22930
|
function preparePeriodsBodyForMonths(dateRange, comparePeriods) {
|
|
22826
|
-
const
|
|
22931
|
+
const adjustedEndDate = dateFns.startOfMonth(dateRange.endDate);
|
|
22827
22932
|
const rawPeriods = range(0, comparePeriods).map((index2) => {
|
|
22828
|
-
const currentPeriod = dateFns.subMonths(
|
|
22933
|
+
const currentPeriod = dateFns.subMonths(adjustedEndDate, index2);
|
|
22829
22934
|
return {
|
|
22830
22935
|
year: dateFns.getYear(currentPeriod),
|
|
22831
22936
|
month: dateFns.getMonth(currentPeriod) + 1
|
|
@@ -22846,9 +22951,9 @@ function preparePeriodsBodyForMonths(dateRange, comparePeriods) {
|
|
|
22846
22951
|
};
|
|
22847
22952
|
}
|
|
22848
22953
|
function preparePeriodsBodyForYears(dateRange, comparePeriods) {
|
|
22849
|
-
const
|
|
22954
|
+
const adjustedEndDate = dateFns.startOfYear(dateRange.endDate);
|
|
22850
22955
|
const rawPeriods = range(0, comparePeriods).map((index2) => {
|
|
22851
|
-
const currentPeriod = dateFns.subYears(
|
|
22956
|
+
const currentPeriod = dateFns.subYears(adjustedEndDate, index2);
|
|
22852
22957
|
return {
|
|
22853
22958
|
year: dateFns.getYear(currentPeriod)
|
|
22854
22959
|
};
|
|
@@ -22873,17 +22978,51 @@ function preparePeriodsBodyForDateRange(dateRange) {
|
|
|
22873
22978
|
}]
|
|
22874
22979
|
};
|
|
22875
22980
|
}
|
|
22876
|
-
function preparePeriodsBody(dateRange, comparePeriods,
|
|
22877
|
-
switch (
|
|
22878
|
-
case
|
|
22981
|
+
function preparePeriodsBody(dateRange, comparePeriods, comparisonPeriodMode) {
|
|
22982
|
+
switch (comparisonPeriodMode) {
|
|
22983
|
+
case DateGroupBy.Year:
|
|
22879
22984
|
return preparePeriodsBodyForYears(dateRange, comparePeriods);
|
|
22880
|
-
case
|
|
22985
|
+
case DateGroupBy.Month:
|
|
22881
22986
|
return preparePeriodsBodyForMonths(dateRange, comparePeriods);
|
|
22987
|
+
case DateGroupBy.AllTime:
|
|
22882
22988
|
default:
|
|
22883
22989
|
return preparePeriodsBodyForDateRange(dateRange);
|
|
22884
22990
|
}
|
|
22885
22991
|
}
|
|
22886
|
-
const
|
|
22992
|
+
const ProfitAndLossContext = react.createContext({
|
|
22993
|
+
data: void 0,
|
|
22994
|
+
filteredDataRevenue: [],
|
|
22995
|
+
filteredTotalRevenue: void 0,
|
|
22996
|
+
filteredDataExpenses: [],
|
|
22997
|
+
filteredTotalExpenses: void 0,
|
|
22998
|
+
isLoading: true,
|
|
22999
|
+
isValidating: false,
|
|
23000
|
+
isError: false,
|
|
23001
|
+
dateRange: {
|
|
23002
|
+
startDate: dateFns.startOfMonth(/* @__PURE__ */ new Date()),
|
|
23003
|
+
endDate: dateFns.endOfMonth(/* @__PURE__ */ new Date())
|
|
23004
|
+
},
|
|
23005
|
+
refetch: () => {
|
|
23006
|
+
},
|
|
23007
|
+
sidebarScope: void 0,
|
|
23008
|
+
setSidebarScope: () => {
|
|
23009
|
+
},
|
|
23010
|
+
sortBy: () => {
|
|
23011
|
+
},
|
|
23012
|
+
setFilterTypes: () => {
|
|
23013
|
+
},
|
|
23014
|
+
filters: {
|
|
23015
|
+
expenses: void 0,
|
|
23016
|
+
revenue: void 0
|
|
23017
|
+
},
|
|
23018
|
+
tagFilter: void 0,
|
|
23019
|
+
selectedLineItem: null,
|
|
23020
|
+
setSelectedLineItem: () => {
|
|
23021
|
+
},
|
|
23022
|
+
setDisplayMode: () => {
|
|
23023
|
+
},
|
|
23024
|
+
displayMode: "month"
|
|
23025
|
+
});
|
|
22887
23026
|
const isNotOnlyNoneTag = (compareOptions) => {
|
|
22888
23027
|
return Boolean(
|
|
22889
23028
|
compareOptions == null ? void 0 : compareOptions.some((option) => option.tagFilterConfig.tagFilters !== "None")
|
|
@@ -22912,16 +23051,24 @@ function useProfitAndLossComparison({
|
|
|
22912
23051
|
reportingBasis,
|
|
22913
23052
|
comparisonConfig
|
|
22914
23053
|
}) {
|
|
22915
|
-
var _a
|
|
22916
|
-
const [
|
|
23054
|
+
var _a;
|
|
23055
|
+
const [comparisonPeriodMode, setComparisonPeriodMode] = react.useState(DateGroupBy.AllTime);
|
|
23056
|
+
const { displayMode } = react.useContext(ProfitAndLossContext);
|
|
23057
|
+
const { startDate, endDate } = useGlobalDateRange({ displayMode: "month" });
|
|
23058
|
+
const comparePeriods = react.useMemo(() => {
|
|
23059
|
+
if (!comparisonPeriodMode || comparisonPeriodMode === DateGroupBy.AllTime) {
|
|
23060
|
+
return 1;
|
|
23061
|
+
}
|
|
23062
|
+
if (comparisonPeriodMode === DateGroupBy.Year) {
|
|
23063
|
+
return Math.abs(dateFns.differenceInCalendarYears(endDate, startDate)) + 1;
|
|
23064
|
+
}
|
|
23065
|
+
return Math.abs(dateFns.differenceInCalendarMonths(endDate, startDate)) + 1;
|
|
23066
|
+
}, [comparisonPeriodMode, endDate, startDate]);
|
|
22917
23067
|
const [selectedCompareOptions, setSelectedCompareOptionsState] = react.useState(
|
|
22918
23068
|
(comparisonConfig == null ? void 0 : comparisonConfig.defaultTagFilter) ? [comparisonConfig == null ? void 0 : comparisonConfig.defaultTagFilter] : []
|
|
22919
23069
|
);
|
|
22920
|
-
const
|
|
22921
|
-
const
|
|
22922
|
-
const isPeriodsSelectEnabled = COMPARE_MODES_SUPPORTING_MULTI_PERIOD.includes(rangeDisplayMode);
|
|
22923
|
-
const effectiveComparePeriods = isPeriodsSelectEnabled ? comparePeriods : 1;
|
|
22924
|
-
const compareModeActive = react.useMemo(() => effectiveComparePeriods > 1 || selectedCompareOptions.length > 1 || selectedCompareOptions.length === 1 && isNotOnlyNoneTag(selectedCompareOptions), [effectiveComparePeriods, selectedCompareOptions]);
|
|
23070
|
+
const dateRange = useGlobalDateRange({ displayMode });
|
|
23071
|
+
const compareModeActive = react.useMemo(() => comparePeriods > 1 || selectedCompareOptions.length > 1 || selectedCompareOptions.length === 1 && isNotOnlyNoneTag(selectedCompareOptions), [comparePeriods, selectedCompareOptions]);
|
|
22925
23072
|
const setSelectedCompareOptions = (values) => {
|
|
22926
23073
|
const options2 = values.map(
|
|
22927
23074
|
(option) => comparisonConfig == null ? void 0 : comparisonConfig.tagComparisonOptions.find(
|
|
@@ -22937,7 +23084,7 @@ function useProfitAndLossComparison({
|
|
|
22937
23084
|
const { businessId } = useLayerContext();
|
|
22938
23085
|
const { apiUrl } = useEnvironment();
|
|
22939
23086
|
const { data: auth } = useAuth();
|
|
22940
|
-
const periods = preparePeriodsBody(dateRange,
|
|
23087
|
+
const periods = preparePeriodsBody(dateRange, comparePeriods, comparisonPeriodMode);
|
|
22941
23088
|
const tagFilters = prepareFiltersBody(selectedCompareOptions);
|
|
22942
23089
|
const queryKey = buildKey$v(__spreadProps(__spreadValues({}, auth), {
|
|
22943
23090
|
businessId,
|
|
@@ -22963,7 +23110,7 @@ function useProfitAndLossComparison({
|
|
|
22963
23110
|
})
|
|
22964
23111
|
);
|
|
22965
23112
|
const getProfitAndLossComparisonCsv = (dateRange2, moneyFormat) => {
|
|
22966
|
-
const periods2 = preparePeriodsBody(dateRange2,
|
|
23113
|
+
const periods2 = preparePeriodsBody(dateRange2, comparePeriods, comparisonPeriodMode);
|
|
22967
23114
|
const tagFilters2 = prepareFiltersBody(selectedCompareOptions);
|
|
22968
23115
|
return Layer.profitAndLossComparisonCsv(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
22969
23116
|
params: {
|
|
@@ -22981,15 +23128,15 @@ function useProfitAndLossComparison({
|
|
|
22981
23128
|
data: data == null ? void 0 : data.pnls,
|
|
22982
23129
|
isLoading,
|
|
22983
23130
|
isValidating,
|
|
22984
|
-
isPeriodsSelectEnabled,
|
|
22985
23131
|
compareModeActive,
|
|
22986
|
-
comparePeriods
|
|
22987
|
-
|
|
22988
|
-
compareOptions: (_b = comparisonConfig == null ? void 0 : comparisonConfig.tagComparisonOptions) != null ? _b : [],
|
|
23132
|
+
comparePeriods,
|
|
23133
|
+
compareOptions: (_a = comparisonConfig == null ? void 0 : comparisonConfig.tagComparisonOptions) != null ? _a : [],
|
|
22989
23134
|
selectedCompareOptions,
|
|
22990
23135
|
setSelectedCompareOptions,
|
|
22991
23136
|
getProfitAndLossComparisonCsv,
|
|
22992
|
-
comparisonConfig
|
|
23137
|
+
comparisonConfig,
|
|
23138
|
+
comparisonPeriodMode,
|
|
23139
|
+
setComparisonPeriodMode
|
|
22993
23140
|
};
|
|
22994
23141
|
}
|
|
22995
23142
|
const getYearMonthKey = (y, m) => {
|
|
@@ -23080,8 +23227,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
23080
23227
|
refetch
|
|
23081
23228
|
};
|
|
23082
23229
|
};
|
|
23083
|
-
const BarChart2 = (
|
|
23084
|
-
var
|
|
23230
|
+
const BarChart2 = (_sc) => {
|
|
23231
|
+
var _tc = _sc, { size = 12 } = _tc, props = __objRest(_tc, ["size"]);
|
|
23085
23232
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23086
23233
|
"svg",
|
|
23087
23234
|
__spreadProps(__spreadValues({
|
|
@@ -23249,10 +23396,8 @@ const ProfitAndLossChart = ({
|
|
|
23249
23396
|
const [compactView, setCompactView] = react.useState(false);
|
|
23250
23397
|
const barSize = compactView ? 10 : 20;
|
|
23251
23398
|
const { getColor, business } = useLayerContext();
|
|
23252
|
-
const
|
|
23253
|
-
const dateRange = useGlobalDateRange({ displayMode: rangeDisplayMode });
|
|
23399
|
+
const dateRange = useGlobalDateRange({ displayMode: "month" });
|
|
23254
23400
|
const { setMonth } = useGlobalDateRangeActions();
|
|
23255
|
-
const showIndicator = rangeDisplayMode === "monthPicker";
|
|
23256
23401
|
const [customCursorSize, setCustomCursorSize] = react.useState({
|
|
23257
23402
|
width: 0,
|
|
23258
23403
|
height: 0,
|
|
@@ -23748,7 +23893,7 @@ const ProfitAndLossChart = ({
|
|
|
23748
23893
|
xAxisId: "revenue",
|
|
23749
23894
|
stackId: "revenue",
|
|
23750
23895
|
children: [
|
|
23751
|
-
|
|
23896
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
23752
23897
|
recharts.LabelList,
|
|
23753
23898
|
{
|
|
23754
23899
|
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -23759,7 +23904,7 @@ const ProfitAndLossChart = ({
|
|
|
23759
23904
|
}
|
|
23760
23905
|
)
|
|
23761
23906
|
}
|
|
23762
|
-
)
|
|
23907
|
+
),
|
|
23763
23908
|
dataOrPlaceholderData.map((entry) => {
|
|
23764
23909
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23765
23910
|
recharts.Cell,
|
|
@@ -23873,11 +24018,11 @@ const ProfitAndLossChart = ({
|
|
|
23873
24018
|
isSyncing && !hasNonZeroData ? /* @__PURE__ */ jsxRuntime.jsx(ChartStateCard, {}) : null
|
|
23874
24019
|
] });
|
|
23875
24020
|
};
|
|
23876
|
-
const BackButton = (
|
|
23877
|
-
var
|
|
24021
|
+
const BackButton = (_uc) => {
|
|
24022
|
+
var _vc = _uc, {
|
|
23878
24023
|
className,
|
|
23879
24024
|
textOnly = false
|
|
23880
|
-
} =
|
|
24025
|
+
} = _vc, props = __objRest(_vc, [
|
|
23881
24026
|
"className",
|
|
23882
24027
|
"textOnly"
|
|
23883
24028
|
]);
|
|
@@ -23902,8 +24047,8 @@ const TASKS_CHARTS_COLORS = {
|
|
|
23902
24047
|
done: "#3B9C63",
|
|
23903
24048
|
pending: "#DFA000"
|
|
23904
24049
|
};
|
|
23905
|
-
const SortArrows = (
|
|
23906
|
-
var
|
|
24050
|
+
const SortArrows = (_wc) => {
|
|
24051
|
+
var _xc = _wc, { size = 13 } = _xc, props = __objRest(_xc, ["size"]);
|
|
23907
24052
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23908
24053
|
"svg",
|
|
23909
24054
|
__spreadProps(__spreadValues({
|
|
@@ -24674,11 +24819,11 @@ const Header = react.forwardRef(
|
|
|
24674
24819
|
}
|
|
24675
24820
|
);
|
|
24676
24821
|
Header.displayName = "Header";
|
|
24677
|
-
const CloseButton = (
|
|
24678
|
-
var
|
|
24822
|
+
const CloseButton = (_yc) => {
|
|
24823
|
+
var _zc = _yc, {
|
|
24679
24824
|
className,
|
|
24680
24825
|
textOnly = false
|
|
24681
|
-
} =
|
|
24826
|
+
} = _zc, props = __objRest(_zc, [
|
|
24682
24827
|
"className",
|
|
24683
24828
|
"textOnly"
|
|
24684
24829
|
]);
|
|
@@ -25163,37 +25308,6 @@ const DetailReportBreadcrumb = ({
|
|
|
25163
25308
|
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", variant: "subtle", children: subtitle })
|
|
25164
25309
|
] }) }) });
|
|
25165
25310
|
};
|
|
25166
|
-
const ProfitAndLossContext = react.createContext({
|
|
25167
|
-
data: void 0,
|
|
25168
|
-
filteredDataRevenue: [],
|
|
25169
|
-
filteredTotalRevenue: void 0,
|
|
25170
|
-
filteredDataExpenses: [],
|
|
25171
|
-
filteredTotalExpenses: void 0,
|
|
25172
|
-
isLoading: true,
|
|
25173
|
-
isValidating: false,
|
|
25174
|
-
isError: false,
|
|
25175
|
-
dateRange: {
|
|
25176
|
-
startDate: dateFns.startOfMonth(/* @__PURE__ */ new Date()),
|
|
25177
|
-
endDate: dateFns.endOfMonth(/* @__PURE__ */ new Date())
|
|
25178
|
-
},
|
|
25179
|
-
refetch: () => {
|
|
25180
|
-
},
|
|
25181
|
-
sidebarScope: void 0,
|
|
25182
|
-
setSidebarScope: () => {
|
|
25183
|
-
},
|
|
25184
|
-
sortBy: () => {
|
|
25185
|
-
},
|
|
25186
|
-
setFilterTypes: () => {
|
|
25187
|
-
},
|
|
25188
|
-
filters: {
|
|
25189
|
-
expenses: void 0,
|
|
25190
|
-
revenue: void 0
|
|
25191
|
-
},
|
|
25192
|
-
tagFilter: void 0,
|
|
25193
|
-
selectedLineItem: null,
|
|
25194
|
-
setSelectedLineItem: () => {
|
|
25195
|
-
}
|
|
25196
|
-
});
|
|
25197
25311
|
const COMPONENT_NAME$8 = "ProfitAndLossDetailReport";
|
|
25198
25312
|
const ErrorState = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
25199
25313
|
DataState,
|
|
@@ -25574,11 +25688,8 @@ const ProfitAndLossComparisonContext = react.createContext({
|
|
|
25574
25688
|
data: void 0,
|
|
25575
25689
|
isLoading: true,
|
|
25576
25690
|
isValidating: false,
|
|
25577
|
-
isPeriodsSelectEnabled: true,
|
|
25578
25691
|
compareModeActive: false,
|
|
25579
25692
|
comparePeriods: 0,
|
|
25580
|
-
setComparePeriods: () => {
|
|
25581
|
-
},
|
|
25582
25693
|
compareOptions: [],
|
|
25583
25694
|
selectedCompareOptions: [],
|
|
25584
25695
|
setSelectedCompareOptions: function() {
|
|
@@ -25587,7 +25698,10 @@ const ProfitAndLossComparisonContext = react.createContext({
|
|
|
25587
25698
|
getProfitAndLossComparisonCsv: function() {
|
|
25588
25699
|
throw new Error("Function not implemented.");
|
|
25589
25700
|
},
|
|
25590
|
-
comparisonConfig: void 0
|
|
25701
|
+
comparisonConfig: void 0,
|
|
25702
|
+
comparisonPeriodMode: null,
|
|
25703
|
+
setComparisonPeriodMode: () => {
|
|
25704
|
+
}
|
|
25591
25705
|
});
|
|
25592
25706
|
const ProfitAndLossFullReportDownloadButton = ({
|
|
25593
25707
|
stringOverrides,
|
|
@@ -25919,7 +26033,7 @@ const options$2 = Object.values(dateSelectionOptionConfig).filter((opt) => opt.v
|
|
|
25919
26033
|
const DateSelectionComboBox = () => {
|
|
25920
26034
|
const [lastPreset, setLastPreset] = react.useState(null);
|
|
25921
26035
|
const { business } = useLayerContext();
|
|
25922
|
-
const dateRange = useGlobalDateRange({ displayMode: "
|
|
26036
|
+
const dateRange = useGlobalDateRange({ displayMode: "full" });
|
|
25923
26037
|
const { setDateRange } = useGlobalDateRangeActions();
|
|
25924
26038
|
const selectedPreset = presetForDateRange(dateRange, lastPreset, getActivationDate(business));
|
|
25925
26039
|
const selectedOption = dateSelectionOptionConfig[selectedPreset != null ? selectedPreset : DatePreset.Custom];
|
|
@@ -25943,7 +26057,7 @@ const DateSelectionComboBox = () => {
|
|
|
25943
26057
|
);
|
|
25944
26058
|
};
|
|
25945
26059
|
const DateRangeSelection = ({ minDate, maxDate }) => {
|
|
25946
|
-
const { startDate: globalStartDate, endDate: globalEndDate } = useGlobalDateRange({ displayMode: "
|
|
26060
|
+
const { startDate: globalStartDate, endDate: globalEndDate } = useGlobalDateRange({ displayMode: "full" });
|
|
25947
26061
|
const { setDateRange: setGlobalDateRange } = useGlobalDateRangeActions();
|
|
25948
26062
|
const { value } = useSizeClass();
|
|
25949
26063
|
const {
|
|
@@ -26215,26 +26329,32 @@ const useTableExpandRow = () => {
|
|
|
26215
26329
|
toggleAllRows
|
|
26216
26330
|
};
|
|
26217
26331
|
};
|
|
26218
|
-
const generateComparisonPeriods = (
|
|
26219
|
-
switch (
|
|
26220
|
-
case
|
|
26221
|
-
return generateComparisonYears(
|
|
26332
|
+
const generateComparisonPeriods = (params) => {
|
|
26333
|
+
switch (params.mode) {
|
|
26334
|
+
case DateGroupBy.Year:
|
|
26335
|
+
return generateComparisonYears(params.endDate, params.numberOfPeriods);
|
|
26336
|
+
case DateGroupBy.Month:
|
|
26337
|
+
return generateComparisonMonths(params.endDate, params.numberOfPeriods);
|
|
26222
26338
|
default:
|
|
26223
|
-
return
|
|
26339
|
+
return generateComparisonDateRange(params.startDate, params.endDate);
|
|
26224
26340
|
}
|
|
26225
26341
|
};
|
|
26226
|
-
const generateComparisonMonths = (
|
|
26342
|
+
const generateComparisonMonths = (endDate, numberOfMonths) => {
|
|
26227
26343
|
return Array.from({ length: numberOfMonths }, (_, index2) => {
|
|
26228
|
-
const currentMonth = dateFns.subMonths(
|
|
26229
|
-
return { date: currentMonth, label: dateFns.format(currentMonth, "MMM") };
|
|
26344
|
+
const currentMonth = dateFns.subMonths(endDate, numberOfMonths - index2 - 1);
|
|
26345
|
+
return { date: currentMonth, label: dateFns.format(currentMonth, "MMM yyyy") };
|
|
26230
26346
|
});
|
|
26231
26347
|
};
|
|
26232
|
-
const generateComparisonYears = (
|
|
26348
|
+
const generateComparisonYears = (endDate, numberOfYears) => {
|
|
26233
26349
|
return Array.from({ length: numberOfYears }, (_, index2) => {
|
|
26234
|
-
const currentMonth = dateFns.subYears(
|
|
26350
|
+
const currentMonth = dateFns.subYears(endDate, numberOfYears - index2 - 1);
|
|
26235
26351
|
return { date: currentMonth, label: dateFns.format(currentMonth, "yyyy") };
|
|
26236
26352
|
});
|
|
26237
26353
|
};
|
|
26354
|
+
const generateComparisonDateRange = (startDate, endDate) => {
|
|
26355
|
+
const label = `${dateFns.format(startDate, DATE_FORMAT$1)} - ${dateFns.format(endDate, DATE_FORMAT$1)}`;
|
|
26356
|
+
return [{ date: startDate, endDate, label }];
|
|
26357
|
+
};
|
|
26238
26358
|
const getComparisonValue = (name, depth, cellData) => {
|
|
26239
26359
|
if (depth === 0) {
|
|
26240
26360
|
if (typeof cellData === "string" || typeof cellData === "number") {
|
|
@@ -26291,30 +26411,24 @@ const mergeComparisonLineItemsAtDepth = (lineItems) => {
|
|
|
26291
26411
|
const ProfitAndLossCompareTable = ({
|
|
26292
26412
|
stringOverrides
|
|
26293
26413
|
}) => {
|
|
26414
|
+
const { dateRange, displayMode } = react.useContext(ProfitAndLossContext);
|
|
26294
26415
|
const {
|
|
26295
26416
|
data: comparisonData,
|
|
26296
26417
|
isLoading,
|
|
26297
26418
|
comparePeriods,
|
|
26298
|
-
selectedCompareOptions
|
|
26419
|
+
selectedCompareOptions,
|
|
26420
|
+
comparisonPeriodMode
|
|
26299
26421
|
} = react.useContext(ProfitAndLossComparisonContext);
|
|
26300
26422
|
const { isOpen, setIsOpen } = useTableExpandRow();
|
|
26301
26423
|
const { data: bookkeepingPeriods } = useBookkeepingPeriods();
|
|
26302
|
-
const rangeDisplayMode = useReportModeWithFallback(ReportKey.ProfitAndLoss, "monthPicker");
|
|
26303
|
-
const dateRange = useGlobalDateRange({ displayMode: rangeDisplayMode });
|
|
26304
26424
|
react.useEffect(() => {
|
|
26305
26425
|
setIsOpen(["income", "cost_of_goods_sold", "expenses"]);
|
|
26306
26426
|
}, []);
|
|
26307
26427
|
if (isLoading || comparisonData === void 0) {
|
|
26308
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26309
|
-
"div",
|
|
26310
|
-
{
|
|
26311
|
-
className: classNames("Layer__profit-and-loss-table__loader-container"),
|
|
26312
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Loader, {})
|
|
26313
|
-
}
|
|
26314
|
-
);
|
|
26428
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__profit-and-loss-table__loader-container", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, {}) });
|
|
26315
26429
|
}
|
|
26316
26430
|
const getBookkeepingPeriodStatus = (date2) => {
|
|
26317
|
-
if (!bookkeepingPeriods ||
|
|
26431
|
+
if (!bookkeepingPeriods || displayMode !== "month") {
|
|
26318
26432
|
return;
|
|
26319
26433
|
}
|
|
26320
26434
|
const currentMonth = date2.getMonth() + 1;
|
|
@@ -26356,7 +26470,16 @@ const ProfitAndLossCompareTable = ({
|
|
|
26356
26470
|
variant: expandable ? "expandable" : "default",
|
|
26357
26471
|
handleExpand: () => setIsOpen(rowKey),
|
|
26358
26472
|
children: [
|
|
26359
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26473
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26474
|
+
TableCell,
|
|
26475
|
+
{
|
|
26476
|
+
primary: true,
|
|
26477
|
+
withExpandIcon: expandable,
|
|
26478
|
+
nowrap: true,
|
|
26479
|
+
className: "Layer__profit-and-loss-compare-table__sticky-cell",
|
|
26480
|
+
children: lineItem ? lineItem.display_name : rowDisplayName
|
|
26481
|
+
}
|
|
26482
|
+
),
|
|
26360
26483
|
rowData.map((cell, i) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { isCurrency: true, children: getComparisonValue(
|
|
26361
26484
|
lineItem ? lineItem.display_name : rowDisplayName,
|
|
26362
26485
|
depth,
|
|
@@ -26378,7 +26501,13 @@ const ProfitAndLossCompareTable = ({
|
|
|
26378
26501
|
};
|
|
26379
26502
|
return /* @__PURE__ */ jsxRuntime.jsxs(Table, { borderCollapse: "collapse", bottomSpacing: false, children: [
|
|
26380
26503
|
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: selectedCompareOptions && selectedCompareOptions.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { rowKey: "", children: [
|
|
26381
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26504
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26505
|
+
TableCell,
|
|
26506
|
+
{
|
|
26507
|
+
isHeaderCell: true,
|
|
26508
|
+
className: "Layer__profit-and-loss-compare-table__sticky-cell"
|
|
26509
|
+
}
|
|
26510
|
+
),
|
|
26382
26511
|
selectedCompareOptions.map((option, i) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
26383
26512
|
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { primary: true, isHeaderCell: true, children: option.displayName }, option.displayName + "-" + i),
|
|
26384
26513
|
comparePeriods && Array.from({ length: comparePeriods - 1 }, (_, index2) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { isHeaderCell: true }, option.displayName + "-" + index2))
|
|
@@ -26386,20 +26515,24 @@ const ProfitAndLossCompareTable = ({
|
|
|
26386
26515
|
] }) }),
|
|
26387
26516
|
/* @__PURE__ */ jsxRuntime.jsxs(TableBody, { children: [
|
|
26388
26517
|
comparePeriods && /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { rowKey: "", children: [
|
|
26389
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26390
|
-
|
|
26391
|
-
|
|
26392
|
-
|
|
26393
|
-
|
|
26394
|
-
|
|
26518
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26519
|
+
TableCell,
|
|
26520
|
+
{
|
|
26521
|
+
isHeaderCell: true,
|
|
26522
|
+
className: "Layer__profit-and-loss-compare-table__sticky-cell"
|
|
26523
|
+
}
|
|
26524
|
+
),
|
|
26525
|
+
selectedCompareOptions && selectedCompareOptions.length > 0 ? selectedCompareOptions.map((option, i) => /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: generateComparisonPeriods(__spreadValues({
|
|
26526
|
+
numberOfPeriods: comparePeriods,
|
|
26527
|
+
mode: comparisonPeriodMode
|
|
26528
|
+
}, dateRange)).map((month, index2) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { isHeaderCell: true, children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "2xs", children: [
|
|
26395
26529
|
month.label,
|
|
26396
26530
|
" ",
|
|
26397
26531
|
getBookkeepingPeriodStatus(month.date)
|
|
26398
|
-
] }) }, option.displayName + "-" + index2)) }, option.displayName + "-" + i)) : /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: generateComparisonPeriods(
|
|
26399
|
-
|
|
26400
|
-
|
|
26401
|
-
|
|
26402
|
-
).map((month, index2) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { isHeaderCell: true, children: month.label }, "total-" + index2 + "-cell")) }, "total-1")
|
|
26532
|
+
] }) }, option.displayName + "-" + index2)) }, option.displayName + "-" + i)) : /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: generateComparisonPeriods(__spreadValues({
|
|
26533
|
+
numberOfPeriods: comparePeriods,
|
|
26534
|
+
mode: comparisonPeriodMode
|
|
26535
|
+
}, dateRange)).map((month, index2) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { isHeaderCell: true, children: month.label }, "total-" + index2 + "-cell")) }, "total-1")
|
|
26403
26536
|
] }),
|
|
26404
26537
|
renderRow("income", 0, "Income"),
|
|
26405
26538
|
renderRow("cost_of_goods_sold", 0, "Cost of Goods Sold"),
|
|
@@ -26677,44 +26810,16 @@ const selectStyles = {
|
|
|
26677
26810
|
});
|
|
26678
26811
|
}
|
|
26679
26812
|
};
|
|
26680
|
-
function buildCompareOptions(rangeDisplayMode) {
|
|
26681
|
-
switch (rangeDisplayMode) {
|
|
26682
|
-
case "monthPicker":
|
|
26683
|
-
return [
|
|
26684
|
-
{ value: 1, label: "This month" },
|
|
26685
|
-
{ value: 2, label: "Last 2 months" },
|
|
26686
|
-
{ value: 3, label: "Last 3 months" }
|
|
26687
|
-
];
|
|
26688
|
-
case "yearPicker":
|
|
26689
|
-
return [
|
|
26690
|
-
{ value: 1, label: "This year" },
|
|
26691
|
-
{ value: 2, label: "Last 2 years" },
|
|
26692
|
-
{ value: 3, label: "Last 3 years" }
|
|
26693
|
-
];
|
|
26694
|
-
default:
|
|
26695
|
-
return [
|
|
26696
|
-
{ value: 1, label: "This period" },
|
|
26697
|
-
{ value: 2, label: "Last 2 periods" },
|
|
26698
|
-
{ value: 3, label: "Last 3 periods" }
|
|
26699
|
-
];
|
|
26700
|
-
}
|
|
26701
|
-
}
|
|
26702
26813
|
const ProfitAndLossCompareOptions = () => {
|
|
26703
26814
|
const {
|
|
26704
|
-
setComparePeriods,
|
|
26705
26815
|
setSelectedCompareOptions,
|
|
26706
|
-
isPeriodsSelectEnabled,
|
|
26707
|
-
comparePeriods,
|
|
26708
26816
|
compareOptions,
|
|
26709
26817
|
selectedCompareOptions,
|
|
26710
|
-
comparisonConfig
|
|
26818
|
+
comparisonConfig,
|
|
26819
|
+
comparisonPeriodMode,
|
|
26820
|
+
setComparisonPeriodMode
|
|
26711
26821
|
} = react.useContext(ProfitAndLossComparisonContext);
|
|
26712
|
-
const
|
|
26713
|
-
const periods = react.useMemo(
|
|
26714
|
-
() => comparePeriods !== 0 ? comparePeriods : 1,
|
|
26715
|
-
[comparePeriods]
|
|
26716
|
-
);
|
|
26717
|
-
const timeComparisonOptions = buildCompareOptions(rangeDisplayMode);
|
|
26822
|
+
const { displayMode } = react.useContext(ProfitAndLossContext);
|
|
26718
26823
|
const tagComparisonSelectOptions = compareOptions.map(
|
|
26719
26824
|
(tagComparisonOption) => {
|
|
26720
26825
|
return {
|
|
@@ -26726,19 +26831,8 @@ const ProfitAndLossCompareOptions = () => {
|
|
|
26726
26831
|
if (!comparisonConfig) {
|
|
26727
26832
|
return null;
|
|
26728
26833
|
}
|
|
26729
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
26730
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26731
|
-
Select,
|
|
26732
|
-
{
|
|
26733
|
-
options: timeComparisonOptions,
|
|
26734
|
-
onChange: (e) => setComparePeriods(e && e.value ? e.value : 1),
|
|
26735
|
-
value: timeComparisonOptions.find(
|
|
26736
|
-
(option) => option.value === periods
|
|
26737
|
-
),
|
|
26738
|
-
placeholder: rangeDisplayMode === "yearPicker" ? "Compare years" : "Compare months",
|
|
26739
|
-
disabled: !isPeriodsSelectEnabled
|
|
26740
|
-
}
|
|
26741
|
-
),
|
|
26834
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", gap: "xs", children: [
|
|
26835
|
+
displayMode === "full" && /* @__PURE__ */ jsxRuntime.jsx(DateGroupByComboBox, { value: comparisonPeriodMode, onValueChange: setComparisonPeriodMode }),
|
|
26742
26836
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26743
26837
|
MultiSelect,
|
|
26744
26838
|
{
|
|
@@ -26755,7 +26849,8 @@ const ProfitAndLossCompareOptions = () => {
|
|
|
26755
26849
|
};
|
|
26756
26850
|
}),
|
|
26757
26851
|
placeholder: "Select views",
|
|
26758
|
-
styles: selectStyles
|
|
26852
|
+
styles: selectStyles,
|
|
26853
|
+
className: "Layer__ProfitAndLoss__TagMultiSelect"
|
|
26759
26854
|
}
|
|
26760
26855
|
)
|
|
26761
26856
|
] });
|
|
@@ -26769,8 +26864,11 @@ const ProfitAndLossReport = ({
|
|
|
26769
26864
|
hideHeader
|
|
26770
26865
|
}) => {
|
|
26771
26866
|
var _a;
|
|
26772
|
-
const { selectedLineItem, setSelectedLineItem } = react.useContext(ProfitAndLossContext);
|
|
26867
|
+
const { selectedLineItem, setSelectedLineItem, setDisplayMode } = react.useContext(ProfitAndLossContext);
|
|
26773
26868
|
const { comparisonConfig } = react.useContext(ProfitAndLossComparisonContext);
|
|
26869
|
+
react.useEffect(() => {
|
|
26870
|
+
setDisplayMode(dateSelectionMode);
|
|
26871
|
+
}, [dateSelectionMode, setDisplayMode]);
|
|
26774
26872
|
const breadcrumbIndexMap = react.useMemo(() => {
|
|
26775
26873
|
if (!selectedLineItem) return {};
|
|
26776
26874
|
return selectedLineItem.breadcrumbPath.reduce((acc, item, index2) => {
|
|
@@ -26893,13 +26991,13 @@ function toMiniChartData({
|
|
|
26893
26991
|
function ProfitAndLossSummariesMiniChart({
|
|
26894
26992
|
data,
|
|
26895
26993
|
chartColorsList,
|
|
26896
|
-
variants
|
|
26994
|
+
variants: variants2
|
|
26897
26995
|
}) {
|
|
26898
26996
|
const typeColorMapping = mapTypesToColors(data, chartColorsList);
|
|
26899
26997
|
let chartDimension = 52;
|
|
26900
26998
|
let innerRadius = 10;
|
|
26901
26999
|
let outerRadius = 16;
|
|
26902
|
-
switch (
|
|
27000
|
+
switch (variants2 == null ? void 0 : variants2.size) {
|
|
26903
27001
|
case "sm":
|
|
26904
27002
|
chartDimension = 52;
|
|
26905
27003
|
innerRadius = 10;
|
|
@@ -26943,10 +27041,10 @@ function ProfitAndLossSummariesMiniChart({
|
|
|
26943
27041
|
) });
|
|
26944
27042
|
}
|
|
26945
27043
|
function ProfitAndLossSummariesHeading({
|
|
26946
|
-
variants,
|
|
27044
|
+
variants: variants2,
|
|
26947
27045
|
children
|
|
26948
27046
|
}) {
|
|
26949
|
-
const { size = "2xs" } =
|
|
27047
|
+
const { size = "2xs" } = variants2 != null ? variants2 : {};
|
|
26950
27048
|
return /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size, slot: "heading", children });
|
|
26951
27049
|
}
|
|
26952
27050
|
const CLASS_NAME$3 = "Layer__ProfitAndLossSummariesSummary";
|
|
@@ -26957,14 +27055,14 @@ function ProfitAndLossSummariesSummary({
|
|
|
26957
27055
|
amount,
|
|
26958
27056
|
isLoading,
|
|
26959
27057
|
slots,
|
|
26960
|
-
variants
|
|
27058
|
+
variants: variants2
|
|
26961
27059
|
}) {
|
|
26962
27060
|
const { Chart } = slots != null ? slots : {};
|
|
26963
|
-
const { size = "2xs" } =
|
|
27061
|
+
const { size = "2xs" } = variants2 != null ? variants2 : {};
|
|
26964
27062
|
const dataProperties = toDataProperties({ size });
|
|
26965
27063
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({ className: CLASS_NAME$3 }, dataProperties), { children: [
|
|
26966
27064
|
Chart ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: CHART_AREA_CLASS_NAME, children: Chart }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: CHART_AREA_EMPTY_FRAME_CLASS_NAME }),
|
|
26967
|
-
/* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesHeading, { variants, children: label }),
|
|
27065
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: label }),
|
|
26968
27066
|
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(SkeletonLoader, { height: "20px" }) : /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { slot: "amount", amount, size: "lg", bold: true })
|
|
26969
27067
|
] }));
|
|
26970
27068
|
}
|
|
@@ -26973,10 +27071,10 @@ function TransactionsToReview({
|
|
|
26973
27071
|
onClick,
|
|
26974
27072
|
usePnlDateRange,
|
|
26975
27073
|
tagFilter = void 0,
|
|
26976
|
-
variants
|
|
27074
|
+
variants: variants2
|
|
26977
27075
|
}) {
|
|
26978
27076
|
var _a;
|
|
26979
|
-
const { size = "sm" } =
|
|
27077
|
+
const { size = "sm" } = variants2 != null ? variants2 : {};
|
|
26980
27078
|
const { dateRange: contextDateRange } = react.useContext(ProfitAndLossContext);
|
|
26981
27079
|
const dateRange = usePnlDateRange ? contextDateRange : void 0;
|
|
26982
27080
|
const currentDate = react.useMemo(() => dateRange ? dateRange.startDate : dateFns.startOfMonth(/* @__PURE__ */ new Date()), [dateRange]);
|
|
@@ -27050,7 +27148,7 @@ function TransactionsToReview({
|
|
|
27050
27148
|
}
|
|
27051
27149
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { onClick, className: CLASS_NAME$2, children: [
|
|
27052
27150
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: verticalGap, align: "start", children: [
|
|
27053
|
-
/* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesHeading, { variants, children: "Transactions to review" }),
|
|
27151
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: "Transactions to review" }),
|
|
27054
27152
|
transactionsToReviewBadge
|
|
27055
27153
|
] }),
|
|
27056
27154
|
/* @__PURE__ */ jsxRuntime.jsx(IconButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, {}), withBorder: true, onClick })
|
|
@@ -27064,7 +27162,7 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27064
27162
|
stringOverrides,
|
|
27065
27163
|
chartColorsList,
|
|
27066
27164
|
slots,
|
|
27067
|
-
variants
|
|
27165
|
+
variants: variants2
|
|
27068
27166
|
}) {
|
|
27069
27167
|
var _a, _b, _c, _d;
|
|
27070
27168
|
const {
|
|
@@ -27101,11 +27199,11 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27101
27199
|
{
|
|
27102
27200
|
data: revenueChartData,
|
|
27103
27201
|
chartColorsList,
|
|
27104
|
-
variants
|
|
27202
|
+
variants: variants2
|
|
27105
27203
|
}
|
|
27106
27204
|
)
|
|
27107
27205
|
},
|
|
27108
|
-
variants
|
|
27206
|
+
variants: variants2
|
|
27109
27207
|
}
|
|
27110
27208
|
)
|
|
27111
27209
|
}
|
|
@@ -27127,11 +27225,11 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27127
27225
|
{
|
|
27128
27226
|
data: expensesChartData,
|
|
27129
27227
|
chartColorsList,
|
|
27130
|
-
variants
|
|
27228
|
+
variants: variants2
|
|
27131
27229
|
}
|
|
27132
27230
|
)
|
|
27133
27231
|
},
|
|
27134
|
-
variants
|
|
27232
|
+
variants: variants2
|
|
27135
27233
|
}
|
|
27136
27234
|
)
|
|
27137
27235
|
}
|
|
@@ -27141,17 +27239,17 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27141
27239
|
{
|
|
27142
27240
|
label: (stringOverrides == null ? void 0 : stringOverrides.netProfitLabel) || "Net Profit",
|
|
27143
27241
|
amount: (_d = data == null ? void 0 : data.netProfit) != null ? _d : 0,
|
|
27144
|
-
variants,
|
|
27242
|
+
variants: variants2,
|
|
27145
27243
|
isLoading
|
|
27146
27244
|
}
|
|
27147
27245
|
) }),
|
|
27148
27246
|
unstable_AdditionalListItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesListItem, { children: item }, index2))
|
|
27149
27247
|
] }) });
|
|
27150
27248
|
}
|
|
27151
|
-
function ProfitAndLossSummaries(
|
|
27152
|
-
var
|
|
27249
|
+
function ProfitAndLossSummaries(_Ac) {
|
|
27250
|
+
var _Bc = _Ac, {
|
|
27153
27251
|
onTransactionsToReviewClick
|
|
27154
|
-
} =
|
|
27252
|
+
} = _Bc, restProps = __objRest(_Bc, [
|
|
27155
27253
|
"onTransactionsToReviewClick"
|
|
27156
27254
|
]);
|
|
27157
27255
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -27173,7 +27271,7 @@ function ProfitAndLossSummaries(_yc) {
|
|
|
27173
27271
|
})
|
|
27174
27272
|
);
|
|
27175
27273
|
}
|
|
27176
|
-
const
|
|
27274
|
+
const ProfitAndLoss = ({
|
|
27177
27275
|
children,
|
|
27178
27276
|
tagFilter,
|
|
27179
27277
|
comparisonConfig,
|
|
@@ -27184,14 +27282,6 @@ const ProfitAndLossWithoutReportsModeProvider = ({
|
|
|
27184
27282
|
const comparisonContextData = useProfitAndLossComparison({ comparisonConfig, reportingBasis });
|
|
27185
27283
|
return /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossContext.Provider, { value: contextData, children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossComparisonContext.Provider, { value: comparisonContextData, children: asContainer ? /* @__PURE__ */ jsxRuntime.jsx(Container, { name: "profit-and-loss", children }) : children }) });
|
|
27186
27284
|
};
|
|
27187
|
-
const ProfitAndLossWithReportsModeProvider = (props) => {
|
|
27188
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReportsModeStoreProvider, { initialModes: { ProfitAndLoss: "monthPicker" }, children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossWithoutReportsModeProvider, __spreadValues({}, props)) });
|
|
27189
|
-
};
|
|
27190
|
-
const ProfitAndLoss = (_Ac) => {
|
|
27191
|
-
var _Bc = _Ac, { withReportsModeProvider = true } = _Bc, restProps = __objRest(_Bc, ["withReportsModeProvider"]);
|
|
27192
|
-
if (withReportsModeProvider) return /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossWithReportsModeProvider, __spreadValues({}, restProps));
|
|
27193
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossWithoutReportsModeProvider, __spreadValues({}, restProps));
|
|
27194
|
-
};
|
|
27195
27285
|
ProfitAndLoss.Chart = ProfitAndLossChart;
|
|
27196
27286
|
ProfitAndLoss.Summaries = ProfitAndLossSummaries;
|
|
27197
27287
|
ProfitAndLoss.DetailedCharts = ProfitAndLossDetailedCharts;
|
|
@@ -27596,9 +27686,6 @@ const CombinedDateSelection = ({ mode }) => {
|
|
|
27596
27686
|
return /* @__PURE__ */ jsxRuntime.jsx(DateSelection, {});
|
|
27597
27687
|
};
|
|
27598
27688
|
const COMPONENT_NAME$7 = "balance-sheet";
|
|
27599
|
-
const StandaloneBalanceSheet = (props) => {
|
|
27600
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReportsModeStoreProvider, { initialModes: { BalanceSheet: "dayPicker" }, children: /* @__PURE__ */ jsxRuntime.jsx(BalanceSheet, __spreadValues({}, props)) });
|
|
27601
|
-
};
|
|
27602
27689
|
const BalanceSheet = (props) => {
|
|
27603
27690
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27604
27691
|
BalanceSheetView,
|
|
@@ -27921,27 +28008,7 @@ function useStatementOfCashFlow({
|
|
|
27921
28008
|
)().then(({ data }) => data)
|
|
27922
28009
|
);
|
|
27923
28010
|
}
|
|
27924
|
-
const DEFAULT_ALLOWED_PICKER_MODES = ["monthPicker"];
|
|
27925
|
-
const getAllowedDateRangePickerModes = ({
|
|
27926
|
-
allowedDatePickerModes,
|
|
27927
|
-
defaultDatePickerMode
|
|
27928
|
-
}) => getArrayWithAtLeastOneOrFallback(
|
|
27929
|
-
allowedDatePickerModes != null ? allowedDatePickerModes : defaultDatePickerMode ? [defaultDatePickerMode] : [],
|
|
27930
|
-
DEFAULT_ALLOWED_PICKER_MODES
|
|
27931
|
-
);
|
|
27932
|
-
const getInitialDateRangePickerMode = ({
|
|
27933
|
-
allowedDatePickerModes,
|
|
27934
|
-
defaultDatePickerMode
|
|
27935
|
-
}) => {
|
|
27936
|
-
const allowedDateRangePickerModes = getAllowedDateRangePickerModes({ allowedDatePickerModes, defaultDatePickerMode });
|
|
27937
|
-
const initialRangeDisplayMode = defaultDatePickerMode && allowedDateRangePickerModes.includes(defaultDatePickerMode) ? defaultDatePickerMode : allowedDateRangePickerModes[0];
|
|
27938
|
-
return initialRangeDisplayMode;
|
|
27939
|
-
};
|
|
27940
28011
|
const COMPONENT_NAME$6 = "statement-of-cash-flow";
|
|
27941
|
-
const StandaloneStatementOfCashFlow = (props) => {
|
|
27942
|
-
const initialModeForStatementOfCashFlows = getInitialDateRangePickerMode(props);
|
|
27943
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReportsModeStoreProvider, { initialModes: { StatementOfCashFlows: initialModeForStatementOfCashFlows }, children: /* @__PURE__ */ jsxRuntime.jsx(StatementOfCashFlow, __spreadValues({}, props)) });
|
|
27944
|
-
};
|
|
27945
28012
|
const StatementOfCashFlow = (props) => {
|
|
27946
28013
|
return /* @__PURE__ */ jsxRuntime.jsx(StatementOfCashFlowView, __spreadValues({}, props));
|
|
27947
28014
|
};
|
|
@@ -27949,8 +28016,7 @@ const StatementOfCashFlowView = ({
|
|
|
27949
28016
|
stringOverrides,
|
|
27950
28017
|
dateSelectionMode = "full"
|
|
27951
28018
|
}) => {
|
|
27952
|
-
const
|
|
27953
|
-
const dateRange = useGlobalDateRange({ displayMode });
|
|
28019
|
+
const dateRange = useGlobalDateRange({ displayMode: dateSelectionMode });
|
|
27954
28020
|
const { data, isLoading } = useStatementOfCashFlow(dateRange);
|
|
27955
28021
|
const { view, containerRef } = useElementViewSize();
|
|
27956
28022
|
return /* @__PURE__ */ jsxRuntime.jsx(TableProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -28640,7 +28706,7 @@ const useChartOfAccounts = ({ withDates = false } = {}) => {
|
|
|
28640
28706
|
const { businessId } = useLayerContext();
|
|
28641
28707
|
const { apiUrl } = useEnvironment();
|
|
28642
28708
|
const { data: auth } = useAuth();
|
|
28643
|
-
const { startDate, endDate } = useGlobalDateRange({ displayMode: "
|
|
28709
|
+
const { startDate, endDate } = useGlobalDateRange({ displayMode: "month" });
|
|
28644
28710
|
const [form, setForm] = react.useState();
|
|
28645
28711
|
const [sendingForm, setSendingForm] = react.useState(false);
|
|
28646
28712
|
const [apiError, setApiError] = react.useState(void 0);
|
|
@@ -36553,7 +36619,7 @@ const ProjectProfitabilityView = ({
|
|
|
36553
36619
|
valueOptions,
|
|
36554
36620
|
showTitle,
|
|
36555
36621
|
stringOverrides,
|
|
36556
|
-
|
|
36622
|
+
dateSelectionMode = "month",
|
|
36557
36623
|
csvMoneyFormat = "DOLLAR_STRING"
|
|
36558
36624
|
}) => {
|
|
36559
36625
|
const [activeTab, setActiveTab] = react.useState("overview");
|
|
@@ -36646,7 +36712,7 @@ const ProjectProfitabilityView = ({
|
|
|
36646
36712
|
ProfitAndLoss.Report,
|
|
36647
36713
|
{
|
|
36648
36714
|
stringOverrides,
|
|
36649
|
-
|
|
36715
|
+
dateSelectionMode,
|
|
36650
36716
|
csvMoneyFormat
|
|
36651
36717
|
}
|
|
36652
36718
|
) })
|
|
@@ -38820,7 +38886,7 @@ function useUnifiedReportDateVariant() {
|
|
|
38820
38886
|
function useUnifiedReportWithDateParams() {
|
|
38821
38887
|
const store = react.useContext(UnifiedReportStoreContext);
|
|
38822
38888
|
const { date: effectiveDate } = useGlobalDate();
|
|
38823
|
-
const { startDate, endDate } = useGlobalDateRange({ displayMode: "
|
|
38889
|
+
const { startDate, endDate } = useGlobalDateRange({ displayMode: "full" });
|
|
38824
38890
|
const report = zustand.useStore(store, (state) => state.report);
|
|
38825
38891
|
const dateVariant = reportToDateVariantMap[report];
|
|
38826
38892
|
switch (dateVariant) {
|
|
@@ -39089,13 +39155,6 @@ const Reports = ({
|
|
|
39089
39155
|
const { view, containerRef } = useElementViewSize();
|
|
39090
39156
|
const options2 = getOptions(enabledReports);
|
|
39091
39157
|
const defaultTitle2 = enabledReports.length > 1 ? "Reports" : (_a = options2.find((option) => option.value === enabledReports[0])) == null ? void 0 : _a.label;
|
|
39092
|
-
const initialModeForProfitAndLoss = profitAndLossConfig ? getInitialDateRangePickerMode(profitAndLossConfig) : "monthPicker";
|
|
39093
|
-
const initialModeForStatementOfCashFlows = statementOfCashFlowConfig ? getInitialDateRangePickerMode(statementOfCashFlowConfig) : "monthPicker";
|
|
39094
|
-
const initialModes = {
|
|
39095
|
-
[ReportKey.ProfitAndLoss]: initialModeForProfitAndLoss,
|
|
39096
|
-
[ReportKey.BalanceSheet]: "dayPicker",
|
|
39097
|
-
[ReportKey.StatementOfCashFlows]: initialModeForStatementOfCashFlows
|
|
39098
|
-
};
|
|
39099
39158
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
39100
39159
|
View,
|
|
39101
39160
|
{
|
|
@@ -39111,7 +39170,7 @@ const Reports = ({
|
|
|
39111
39170
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
39112
39171
|
}
|
|
39113
39172
|
) }),
|
|
39114
|
-
/* @__PURE__ */ jsxRuntime.jsx(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
39173
|
+
/* @__PURE__ */ jsxRuntime.jsx(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLoss, { asContainer: false, comparisonConfig, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
39115
39174
|
ReportsPanel,
|
|
39116
39175
|
{
|
|
39117
39176
|
openReport: activeTab,
|
|
@@ -39121,7 +39180,7 @@ const Reports = ({
|
|
|
39121
39180
|
view,
|
|
39122
39181
|
renderInAppLink
|
|
39123
39182
|
}
|
|
39124
|
-
) }) })
|
|
39183
|
+
) }) })
|
|
39125
39184
|
]
|
|
39126
39185
|
}
|
|
39127
39186
|
);
|
|
@@ -42933,7 +42992,7 @@ const BusinessProvider = ({
|
|
|
42933
42992
|
hasBeenTouched,
|
|
42934
42993
|
resetCaches
|
|
42935
42994
|
} = useDataSync();
|
|
42936
|
-
const globalDateRange = useGlobalDateRange({ displayMode: "
|
|
42995
|
+
const globalDateRange = useGlobalDateRange({ displayMode: "full" });
|
|
42937
42996
|
const { setDateRange } = useGlobalDateRangeActions();
|
|
42938
42997
|
const dateRange = react.useMemo(() => ({
|
|
42939
42998
|
range: globalDateRange,
|
|
@@ -43097,7 +43156,7 @@ const LayerProvider = (_od) => {
|
|
|
43097
43156
|
) }) });
|
|
43098
43157
|
};
|
|
43099
43158
|
exports.AccountingOverview = AccountingOverview;
|
|
43100
|
-
exports.BalanceSheet =
|
|
43159
|
+
exports.BalanceSheet = BalanceSheet;
|
|
43101
43160
|
exports.BankTransactions = BankTransactions;
|
|
43102
43161
|
exports.BankTransactionsWithLinkedAccounts = BankTransactionsWithLinkedAccounts;
|
|
43103
43162
|
exports.BookkeepingOverview = BookkeepingOverview;
|
|
@@ -43120,7 +43179,7 @@ exports.ProfitAndLoss = ProfitAndLoss;
|
|
|
43120
43179
|
exports.ProfitAndLossView = ProfitAndLossView;
|
|
43121
43180
|
exports.ProjectProfitabilityView = ProjectProfitabilityView;
|
|
43122
43181
|
exports.Reports = Reports;
|
|
43123
|
-
exports.StatementOfCashFlow =
|
|
43182
|
+
exports.StatementOfCashFlow = StatementOfCashFlow;
|
|
43124
43183
|
exports.Tasks = Tasks;
|
|
43125
43184
|
exports.unstable_BillsView = unstable_BillsView;
|
|
43126
43185
|
exports.unstable_UnifiedReports = UnifiedReport;
|