@layerfi/components 0.1.114-alpha.3 → 0.1.114-alpha.4
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 +1029 -784
- package/dist/esm/index.mjs +1031 -786
- package/dist/index.css +185 -188
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -71,12 +71,12 @@ const lucideReact = require("lucide-react");
|
|
|
71
71
|
const pluralize = require("pluralize");
|
|
72
72
|
const useResizeObserver = require("@react-hook/resize-observer");
|
|
73
73
|
const Select$1 = require("react-select");
|
|
74
|
-
const react$2 = require("motion/react");
|
|
75
74
|
const reactDropzone = require("react-dropzone");
|
|
76
75
|
const reactForm = require("@tanstack/react-form");
|
|
77
76
|
const BaseCreatableSelect = require("react-select/creatable");
|
|
78
77
|
const reactTable = require("@tanstack/react-table");
|
|
79
78
|
const reactVirtual = require("@tanstack/react-virtual");
|
|
79
|
+
const react$2 = require("motion/react");
|
|
80
80
|
const CurrencyInput = require("react-currency-input-field");
|
|
81
81
|
const uuid = require("uuid");
|
|
82
82
|
const recharts = require("recharts");
|
|
@@ -202,7 +202,7 @@ class ErrorHandlerClass {
|
|
|
202
202
|
}
|
|
203
203
|
const errorHandler = new ErrorHandlerClass();
|
|
204
204
|
const reportError = (payload) => errorHandler.onError(payload);
|
|
205
|
-
const version = "0.1.114-alpha.
|
|
205
|
+
const version = "0.1.114-alpha.4";
|
|
206
206
|
const pkg = {
|
|
207
207
|
version
|
|
208
208
|
};
|
|
@@ -6344,7 +6344,7 @@ const useAugmentedBankTransactions = (params) => {
|
|
|
6344
6344
|
}
|
|
6345
6345
|
}).finally(() => {
|
|
6346
6346
|
var _a2;
|
|
6347
|
-
(_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks
|
|
6347
|
+
(_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks);
|
|
6348
6348
|
});
|
|
6349
6349
|
});
|
|
6350
6350
|
const { trigger: matchBankTransaction2 } = useMatchBankTransaction({
|
|
@@ -6403,7 +6403,7 @@ const useAugmentedBankTransactions = (params) => {
|
|
|
6403
6403
|
}
|
|
6404
6404
|
}).finally(() => {
|
|
6405
6405
|
var _a2;
|
|
6406
|
-
(_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks
|
|
6406
|
+
(_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks);
|
|
6407
6407
|
});
|
|
6408
6408
|
});
|
|
6409
6409
|
const shouldHideAfterCategorize = () => {
|
|
@@ -8236,7 +8236,7 @@ function BulkSelectionStoreProvider({
|
|
|
8236
8236
|
const [store] = react.useState(() => buildStore());
|
|
8237
8237
|
return /* @__PURE__ */ jsxRuntime.jsx(BulkSelectionStoreContext.Provider, { value: store, children });
|
|
8238
8238
|
}
|
|
8239
|
-
const CLASS_NAME$
|
|
8239
|
+
const CLASS_NAME$c = "Layer__Stack";
|
|
8240
8240
|
const Stack = react.forwardRef(
|
|
8241
8241
|
function Stack2(_H, ref) {
|
|
8242
8242
|
var _I = _H, {
|
|
@@ -8289,7 +8289,7 @@ const Stack = react.forwardRef(
|
|
|
8289
8289
|
__spreadProps(__spreadValues(__spreadValues({
|
|
8290
8290
|
ref
|
|
8291
8291
|
}, restProps), dataProperties), {
|
|
8292
|
-
className: classNames(CLASS_NAME$
|
|
8292
|
+
className: classNames(CLASS_NAME$c, className),
|
|
8293
8293
|
children
|
|
8294
8294
|
})
|
|
8295
8295
|
);
|
|
@@ -8413,9 +8413,9 @@ function useDebounce(fn) {
|
|
|
8413
8413
|
}, []);
|
|
8414
8414
|
return debouncedCallback;
|
|
8415
8415
|
}
|
|
8416
|
-
const CLASS_NAME$
|
|
8416
|
+
const CLASS_NAME$b = "Layer__LoadingSpinner";
|
|
8417
8417
|
function LoadingSpinner({ size }) {
|
|
8418
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: CLASS_NAME$
|
|
8418
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: CLASS_NAME$b, size });
|
|
8419
8419
|
}
|
|
8420
8420
|
function withRenderProp(renderProp, callback) {
|
|
8421
8421
|
if (typeof renderProp === "function") {
|
|
@@ -8529,7 +8529,7 @@ function buildKey$T({
|
|
|
8529
8529
|
}
|
|
8530
8530
|
const useBulkCategorize = () => {
|
|
8531
8531
|
const { data } = useAuth();
|
|
8532
|
-
const { businessId } = useLayerContext();
|
|
8532
|
+
const { businessId, eventCallbacks } = useLayerContext();
|
|
8533
8533
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
8534
8534
|
const mutationResponse = useSWRMutation(
|
|
8535
8535
|
() => buildKey$T(__spreadProps(__spreadValues({}, data), {
|
|
@@ -8551,11 +8551,13 @@ const useBulkCategorize = () => {
|
|
|
8551
8551
|
const originalTrigger = mutationResponse.trigger;
|
|
8552
8552
|
const stableProxiedTrigger = react.useCallback(
|
|
8553
8553
|
(...triggerParameters) => __async(null, null, function* () {
|
|
8554
|
+
var _a;
|
|
8554
8555
|
const triggerResult = yield originalTrigger(...triggerParameters);
|
|
8555
8556
|
void forceReloadBankTransactions();
|
|
8557
|
+
(_a = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a.call(eventCallbacks);
|
|
8556
8558
|
return triggerResult;
|
|
8557
8559
|
}),
|
|
8558
|
-
[originalTrigger, forceReloadBankTransactions]
|
|
8560
|
+
[originalTrigger, forceReloadBankTransactions, eventCallbacks]
|
|
8559
8561
|
);
|
|
8560
8562
|
return new Proxy(mutationResponse, {
|
|
8561
8563
|
get(target, prop) {
|
|
@@ -9181,18 +9183,16 @@ const centsToDollars = (cents = NaN) => isNaN(cents) ? "-.--" : formatter.format
|
|
|
9181
9183
|
function centsToDollarsWithoutCommas(cents = 0) {
|
|
9182
9184
|
return centsToDollars(cents).replaceAll(",", "");
|
|
9183
9185
|
}
|
|
9184
|
-
const CLASS_NAME$
|
|
9186
|
+
const CLASS_NAME$a = "Layer__MoneySpan";
|
|
9185
9187
|
const MoneySpan = react.forwardRef(
|
|
9186
9188
|
(_V, ref) => {
|
|
9187
|
-
var _W = _V, { amount,
|
|
9189
|
+
var _W = _V, { amount, displayPlusSign, className } = _W, restProps = __objRest(_W, ["amount", "displayPlusSign", "className"]);
|
|
9188
9190
|
const dataProperties = toDataProperties({
|
|
9189
|
-
bold,
|
|
9190
9191
|
"positive": amount >= 0,
|
|
9191
9192
|
"negative": amount < 0,
|
|
9192
|
-
size,
|
|
9193
9193
|
"display-plus-sign": displayPlusSign
|
|
9194
9194
|
});
|
|
9195
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9195
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Span, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$a, className), ref, children: centsToDollars(Math.abs(amount)) }));
|
|
9196
9196
|
}
|
|
9197
9197
|
);
|
|
9198
9198
|
MoneySpan.displayName = "MoneySpan";
|
|
@@ -9613,7 +9613,7 @@ const BankTransactionCategoryComboBoxOption = ({ option, fallback }) => {
|
|
|
9613
9613
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", variant: "placeholder", children: option.label }),
|
|
9614
9614
|
inAppLink
|
|
9615
9615
|
] }),
|
|
9616
|
-
/* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { size: "sm",
|
|
9616
|
+
/* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { size: "sm", weight: "bold", amount: option.original.details.amount })
|
|
9617
9617
|
] });
|
|
9618
9618
|
}
|
|
9619
9619
|
return fallback;
|
|
@@ -9689,59 +9689,11 @@ const BankTransactionCategoryComboBox = ({
|
|
|
9689
9689
|
}
|
|
9690
9690
|
);
|
|
9691
9691
|
};
|
|
9692
|
-
const variants = {
|
|
9693
|
-
fade: {
|
|
9694
|
-
initial: { opacity: 0 },
|
|
9695
|
-
animate: { opacity: 1 },
|
|
9696
|
-
exit: { opacity: 0 },
|
|
9697
|
-
transition: { duration: 0.3, ease: [0, 0, 0.58, 1] }
|
|
9698
|
-
},
|
|
9699
|
-
slideUp: {
|
|
9700
|
-
initial: { y: "100%" },
|
|
9701
|
-
animate: { y: 0 },
|
|
9702
|
-
exit: { y: "100%" },
|
|
9703
|
-
transition: { duration: 0.35, ease: [0.4, 0, 0.2, 1] }
|
|
9704
|
-
},
|
|
9705
|
-
expand: {
|
|
9706
|
-
initial: { height: 0, opacity: 0 },
|
|
9707
|
-
animate: { height: "auto", opacity: 1 },
|
|
9708
|
-
exit: { height: 0, opacity: 0 },
|
|
9709
|
-
transition: {
|
|
9710
|
-
height: { duration: 0.25, ease: [0.4, 0, 0.2, 1] },
|
|
9711
|
-
opacity: { duration: 0.15, ease: [0, 0, 0.58, 1] }
|
|
9712
|
-
}
|
|
9713
|
-
}
|
|
9714
|
-
};
|
|
9715
|
-
const AnimatedPresenceDiv = (_$) => {
|
|
9716
|
-
var _aa = _$, {
|
|
9717
|
-
children,
|
|
9718
|
-
variant,
|
|
9719
|
-
isOpen,
|
|
9720
|
-
slotProps = { AnimatePresence: { initial: false } }
|
|
9721
|
-
} = _aa, props = __objRest(_aa, [
|
|
9722
|
-
"children",
|
|
9723
|
-
"variant",
|
|
9724
|
-
"isOpen",
|
|
9725
|
-
"slotProps"
|
|
9726
|
-
]);
|
|
9727
|
-
const config = variants[variant];
|
|
9728
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react$2.AnimatePresence, __spreadProps(__spreadValues({}, slotProps.AnimatePresence), { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9729
|
-
react$2.motion.div,
|
|
9730
|
-
__spreadProps(__spreadValues({
|
|
9731
|
-
initial: config.initial,
|
|
9732
|
-
animate: config.animate,
|
|
9733
|
-
exit: config.exit,
|
|
9734
|
-
transition: config.transition
|
|
9735
|
-
}, props), {
|
|
9736
|
-
children
|
|
9737
|
-
})
|
|
9738
|
-
) }));
|
|
9739
|
-
};
|
|
9740
9692
|
const BASE_MODAL_OVERLAY_CLASS_NAME = "Layer__ModalOverlay";
|
|
9741
9693
|
const MODAL_OVERLAY_CLASS_NAME = `Layer__Portal ${BASE_MODAL_OVERLAY_CLASS_NAME}`;
|
|
9742
9694
|
const ModalOverlay = react.forwardRef(
|
|
9743
|
-
(
|
|
9744
|
-
var
|
|
9695
|
+
(_$, ref) => {
|
|
9696
|
+
var _aa = _$, { variant } = _aa, restProps = __objRest(_aa, ["variant"]);
|
|
9745
9697
|
const dataProperties = toDataProperties({ variant });
|
|
9746
9698
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9747
9699
|
reactAriaComponents.ModalOverlay,
|
|
@@ -9768,8 +9720,8 @@ const InternalModal = react.forwardRef(({ children, flexBlock, flexInline, size,
|
|
|
9768
9720
|
InternalModal.displayName = "Modal";
|
|
9769
9721
|
const DIALOG_CLASS_NAME = "Layer__Dialog";
|
|
9770
9722
|
const Dialog = react.forwardRef(
|
|
9771
|
-
(
|
|
9772
|
-
var
|
|
9723
|
+
(_ba, ref) => {
|
|
9724
|
+
var _ca = _ba, { variant = "center" } = _ca, restProps = __objRest(_ca, ["variant"]);
|
|
9773
9725
|
const dataProperties = toDataProperties({ variant });
|
|
9774
9726
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9775
9727
|
reactAriaComponents.Dialog,
|
|
@@ -9807,25 +9759,11 @@ function Drawer({
|
|
|
9807
9759
|
isDismissable = false,
|
|
9808
9760
|
role
|
|
9809
9761
|
}) {
|
|
9810
|
-
|
|
9811
|
-
const shouldUseFadeOverlay = variant === "drawer" || isMobileDrawer;
|
|
9812
|
-
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 }) });
|
|
9813
|
-
const wrappedModalContent = isMobileDrawer ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9814
|
-
AnimatedPresenceDiv,
|
|
9815
|
-
{
|
|
9816
|
-
variant: "slideUp",
|
|
9817
|
-
isOpen,
|
|
9818
|
-
className: "Layer__ModalContentSlideUpMotionContent",
|
|
9819
|
-
slotProps: { AnimatePresence: { initial: true } },
|
|
9820
|
-
children: modalContent
|
|
9821
|
-
}
|
|
9822
|
-
) : modalContent;
|
|
9823
|
-
const overlayContent = shouldUseFadeOverlay ? /* @__PURE__ */ jsxRuntime.jsx(AnimatedPresenceDiv, { variant: "fade", isOpen, className: "Layer__ModalContentFadeMotionContent", children: wrappedModalContent }) : wrappedModalContent;
|
|
9824
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, { isOpen, onOpenChange, variant, isDismissable, children: overlayContent });
|
|
9762
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, { isOpen, onOpenChange, variant, isDismissable, children: /* @__PURE__ */ jsxRuntime.jsx(InternalModal, { flexBlock, flexInline, size, variant, children: /* @__PURE__ */ jsxRuntime.jsx(Dialog, { role: role != null ? role : "dialog", "aria-label": ariaLabel, variant, children }) }) });
|
|
9825
9763
|
}
|
|
9826
9764
|
const HEADING_CLASS_NAME = "Layer__UI__Heading";
|
|
9827
|
-
const Heading$1 = react.forwardRef((
|
|
9828
|
-
var
|
|
9765
|
+
const Heading$1 = react.forwardRef((_da, ref) => {
|
|
9766
|
+
var _ea = _da, { align, pie, pbe, size, variant, weight, ellipsis, className } = _ea, restProps = __objRest(_ea, ["align", "pie", "pbe", "size", "variant", "weight", "ellipsis", "className"]);
|
|
9829
9767
|
const dataProperties = toDataProperties({ pbe, pie, size, align, variant, weight, ellipsis });
|
|
9830
9768
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9831
9769
|
reactAriaComponents.Heading,
|
|
@@ -9896,8 +9834,8 @@ const MODAL_ACTIONS_CLASS_NAME = "Layer__ModalActions";
|
|
|
9896
9834
|
function ModalActions({ children }) {
|
|
9897
9835
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: MODAL_ACTIONS_CLASS_NAME, children });
|
|
9898
9836
|
}
|
|
9899
|
-
const AlertCircle = (
|
|
9900
|
-
var
|
|
9837
|
+
const AlertCircle = (_fa) => {
|
|
9838
|
+
var _ga = _fa, { size = 18 } = _ga, props = __objRest(_ga, ["size"]);
|
|
9901
9839
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9902
9840
|
"svg",
|
|
9903
9841
|
__spreadProps(__spreadValues({
|
|
@@ -9939,8 +9877,8 @@ const AlertCircle = (_ha) => {
|
|
|
9939
9877
|
})
|
|
9940
9878
|
);
|
|
9941
9879
|
};
|
|
9942
|
-
const Save = (
|
|
9943
|
-
var
|
|
9880
|
+
const Save = (_ha) => {
|
|
9881
|
+
var _ia = _ha, { size = 18 } = _ia, props = __objRest(_ia, ["size"]);
|
|
9944
9882
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9945
9883
|
"svg",
|
|
9946
9884
|
__spreadProps(__spreadValues({
|
|
@@ -9982,14 +9920,14 @@ const Save = (_ja) => {
|
|
|
9982
9920
|
})
|
|
9983
9921
|
);
|
|
9984
9922
|
};
|
|
9985
|
-
const RetryButton = (
|
|
9986
|
-
var
|
|
9923
|
+
const RetryButton = (_ja) => {
|
|
9924
|
+
var _ka = _ja, {
|
|
9987
9925
|
className,
|
|
9988
9926
|
processing,
|
|
9989
9927
|
disabled,
|
|
9990
9928
|
error,
|
|
9991
9929
|
children
|
|
9992
|
-
} =
|
|
9930
|
+
} = _ka, props = __objRest(_ka, [
|
|
9993
9931
|
"className",
|
|
9994
9932
|
"processing",
|
|
9995
9933
|
"disabled",
|
|
@@ -10046,8 +9984,8 @@ const buildRightIcon = ({
|
|
|
10046
9984
|
}
|
|
10047
9985
|
return /* @__PURE__ */ jsxRuntime.jsx(Save, { size: 16 });
|
|
10048
9986
|
};
|
|
10049
|
-
const SubmitButton = (
|
|
10050
|
-
var
|
|
9987
|
+
const SubmitButton = (_la) => {
|
|
9988
|
+
var _ma = _la, {
|
|
10051
9989
|
active,
|
|
10052
9990
|
className,
|
|
10053
9991
|
processing,
|
|
@@ -10059,7 +9997,7 @@ const SubmitButton = (_na) => {
|
|
|
10059
9997
|
variant = ButtonVariant.primary,
|
|
10060
9998
|
withRetry,
|
|
10061
9999
|
iconAsPrimary = true
|
|
10062
|
-
} =
|
|
10000
|
+
} = _ma, props = __objRest(_ma, [
|
|
10063
10001
|
"active",
|
|
10064
10002
|
"className",
|
|
10065
10003
|
"processing",
|
|
@@ -10164,12 +10102,323 @@ function BaseConfirmationModal({
|
|
|
10164
10102
|
] });
|
|
10165
10103
|
} });
|
|
10166
10104
|
}
|
|
10105
|
+
const ChevronDown = (_na) => {
|
|
10106
|
+
var _oa = _na, { size = 18 } = _oa, props = __objRest(_oa, ["size"]);
|
|
10107
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10108
|
+
"svg",
|
|
10109
|
+
__spreadProps(__spreadValues({
|
|
10110
|
+
viewBox: "0 0 18 18",
|
|
10111
|
+
fill: "none",
|
|
10112
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10113
|
+
}, props), {
|
|
10114
|
+
width: size,
|
|
10115
|
+
height: size,
|
|
10116
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10117
|
+
"path",
|
|
10118
|
+
{
|
|
10119
|
+
d: "M4.5 6.75L9 11.25L13.5 6.75",
|
|
10120
|
+
stroke: "currentColor",
|
|
10121
|
+
strokeLinecap: "round",
|
|
10122
|
+
strokeLinejoin: "round"
|
|
10123
|
+
}
|
|
10124
|
+
)
|
|
10125
|
+
})
|
|
10126
|
+
);
|
|
10127
|
+
};
|
|
10128
|
+
const ActionableList = ({
|
|
10129
|
+
options: options2,
|
|
10130
|
+
onClick,
|
|
10131
|
+
selectedId,
|
|
10132
|
+
showDescriptions = false,
|
|
10133
|
+
className
|
|
10134
|
+
}) => {
|
|
10135
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classNames("Layer__actionable-list", className), children: options2.map((x, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10136
|
+
"li",
|
|
10137
|
+
{
|
|
10138
|
+
role: "button",
|
|
10139
|
+
onClick: () => onClick(x),
|
|
10140
|
+
className: classNames(
|
|
10141
|
+
x.secondary && "Layer__actionable-list-item--secondary",
|
|
10142
|
+
x.asLink && "Layer__actionable-list-item--as-link",
|
|
10143
|
+
selectedId === x.id && "Layer__actionable-list__item--selected"
|
|
10144
|
+
),
|
|
10145
|
+
children: [
|
|
10146
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__actionable-list__content", children: [
|
|
10147
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, children: x.label }),
|
|
10148
|
+
/* TODO: Replace 'See all categories' with something more generic */
|
|
10149
|
+
showDescriptions && x.description && x.label !== "See all categories" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10150
|
+
Text,
|
|
10151
|
+
{
|
|
10152
|
+
className: "Layer__actionable-list__content-description",
|
|
10153
|
+
size: TextSize.sm,
|
|
10154
|
+
children: x.description
|
|
10155
|
+
}
|
|
10156
|
+
)
|
|
10157
|
+
] }),
|
|
10158
|
+
!x.asLink && selectedId && selectedId === x.id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__actionable-list__select Layer__actionable-list__select--selected", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10159
|
+
Check,
|
|
10160
|
+
{
|
|
10161
|
+
size: 14,
|
|
10162
|
+
className: "Layer__actionable-list__selected-icon"
|
|
10163
|
+
}
|
|
10164
|
+
) }) : null,
|
|
10165
|
+
!x.asLink && (!selectedId || selectedId !== x.id) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__actionable-list__select" }) : null,
|
|
10166
|
+
x.asLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10167
|
+
ChevronRight,
|
|
10168
|
+
{
|
|
10169
|
+
size: 16,
|
|
10170
|
+
className: "Layer__actionable-list__link-icon"
|
|
10171
|
+
}
|
|
10172
|
+
)
|
|
10173
|
+
]
|
|
10174
|
+
},
|
|
10175
|
+
`actionable-list-item-${idx}`
|
|
10176
|
+
)) });
|
|
10177
|
+
};
|
|
10178
|
+
function getLeafCategories(category) {
|
|
10179
|
+
if (!category.subCategories || category.subCategories.length === 0) {
|
|
10180
|
+
return [category];
|
|
10181
|
+
}
|
|
10182
|
+
return category.subCategories.flatMap((subCategory) => getLeafCategories(subCategory));
|
|
10183
|
+
}
|
|
10184
|
+
const flattenCategories = (categories) => {
|
|
10185
|
+
return categories.flatMap((category) => {
|
|
10186
|
+
const subCategories = category.subCategories;
|
|
10187
|
+
if (!subCategories || subCategories.length === 0) {
|
|
10188
|
+
return [new CategoryAsOption(category)];
|
|
10189
|
+
}
|
|
10190
|
+
const leafCategories = getLeafCategories(category);
|
|
10191
|
+
if (subCategories.every((subCategory) => !subCategory.subCategories || subCategory.subCategories.length === 0)) {
|
|
10192
|
+
return [{
|
|
10193
|
+
label: category.displayName,
|
|
10194
|
+
id: "id" in category ? category.id : category.stableName,
|
|
10195
|
+
categories: leafCategories.map((cat) => new CategoryAsOption(cat))
|
|
10196
|
+
}];
|
|
10197
|
+
}
|
|
10198
|
+
return leafCategories.map((cat) => new CategoryAsOption(cat));
|
|
10199
|
+
});
|
|
10200
|
+
};
|
|
10201
|
+
const INPUT_GROUP_CLASS_NAME = "Layer__InputGroup";
|
|
10202
|
+
const InputGroup$1 = react.forwardRef(
|
|
10203
|
+
function InputGroup2(_pa, ref) {
|
|
10204
|
+
var _qa = _pa, { actionCount, className, slots, children } = _qa, restProps = __objRest(_qa, ["actionCount", "className", "slots", "children"]);
|
|
10205
|
+
const combinedClassName = classNames(INPUT_GROUP_CLASS_NAME, className);
|
|
10206
|
+
const dataProperties = toDataProperties({
|
|
10207
|
+
"action-count": actionCount
|
|
10208
|
+
});
|
|
10209
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10210
|
+
reactAriaComponents.Group,
|
|
10211
|
+
__spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
|
|
10212
|
+
className: combinedClassName,
|
|
10213
|
+
ref,
|
|
10214
|
+
children
|
|
10215
|
+
})
|
|
10216
|
+
);
|
|
10217
|
+
}
|
|
10218
|
+
);
|
|
10219
|
+
const X = (_ra) => {
|
|
10220
|
+
var _sa = _ra, { size = 18 } = _sa, props = __objRest(_sa, ["size"]);
|
|
10221
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10222
|
+
"svg",
|
|
10223
|
+
__spreadProps(__spreadValues({
|
|
10224
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10225
|
+
viewBox: "0 0 18 18",
|
|
10226
|
+
fill: "none"
|
|
10227
|
+
}, props), {
|
|
10228
|
+
width: size,
|
|
10229
|
+
height: size,
|
|
10230
|
+
children: [
|
|
10231
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10232
|
+
"path",
|
|
10233
|
+
{
|
|
10234
|
+
d: "M13.5 4.5L4.5 13.5",
|
|
10235
|
+
stroke: "currentColor",
|
|
10236
|
+
strokeLinecap: "round",
|
|
10237
|
+
strokeLinejoin: "round"
|
|
10238
|
+
}
|
|
10239
|
+
),
|
|
10240
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10241
|
+
"path",
|
|
10242
|
+
{
|
|
10243
|
+
d: "M4.5 4.5L13.5 13.5",
|
|
10244
|
+
stroke: "currentColor",
|
|
10245
|
+
strokeLinecap: "round",
|
|
10246
|
+
strokeLinejoin: "round"
|
|
10247
|
+
}
|
|
10248
|
+
)
|
|
10249
|
+
]
|
|
10250
|
+
})
|
|
10251
|
+
);
|
|
10252
|
+
};
|
|
10253
|
+
const CLASS_NAME$9 = "Layer__MinimalSearchField";
|
|
10254
|
+
function MinimalSearchField(_ta) {
|
|
10255
|
+
var _ua = _ta, {
|
|
10256
|
+
placeholder,
|
|
10257
|
+
isDisabled
|
|
10258
|
+
} = _ua, restProps = __objRest(_ua, [
|
|
10259
|
+
"placeholder",
|
|
10260
|
+
"isDisabled"
|
|
10261
|
+
]);
|
|
10262
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.SearchField, __spreadProps(__spreadValues({}, restProps), { isDisabled, className: CLASS_NAME$9, children: [
|
|
10263
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10264
|
+
reactAriaComponents.Input,
|
|
10265
|
+
{
|
|
10266
|
+
slot: "input",
|
|
10267
|
+
placeholder
|
|
10268
|
+
}
|
|
10269
|
+
),
|
|
10270
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { slot: "clear-button", inset: true, icon: true, variant: "ghost", "aria-label": "Clear search", children: /* @__PURE__ */ jsxRuntime.jsx(X, {}) })
|
|
10271
|
+
] }));
|
|
10272
|
+
}
|
|
10273
|
+
const CLASS_NAME$8 = "Layer__SearchField";
|
|
10274
|
+
function SearchField(_va) {
|
|
10275
|
+
var _wa = _va, { slot = "search", className, label, isDisabled } = _wa, restProps = __objRest(_wa, ["slot", "className", "label", "isDisabled"]);
|
|
10276
|
+
const combinedClassName = classNames(CLASS_NAME$8, className);
|
|
10277
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { slot, className: combinedClassName, children: [
|
|
10278
|
+
/* @__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 }) }),
|
|
10279
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10280
|
+
MinimalSearchField,
|
|
10281
|
+
__spreadProps(__spreadValues({}, restProps), {
|
|
10282
|
+
placeholder: label,
|
|
10283
|
+
"aria-label": label,
|
|
10284
|
+
isDisabled
|
|
10285
|
+
})
|
|
10286
|
+
)
|
|
10287
|
+
] });
|
|
10288
|
+
}
|
|
10289
|
+
const isGroup = (item) => {
|
|
10290
|
+
return "categories" in item;
|
|
10291
|
+
};
|
|
10292
|
+
const BankTransactionsMobileListBusinessCategories = ({
|
|
10293
|
+
select,
|
|
10294
|
+
selectedId,
|
|
10295
|
+
showTooltips
|
|
10296
|
+
}) => {
|
|
10297
|
+
const { data: categories } = useCategories();
|
|
10298
|
+
const [query, setQuery] = react.useState("");
|
|
10299
|
+
const categoryOptions = react.useMemo(
|
|
10300
|
+
() => flattenCategories(
|
|
10301
|
+
(categories != null ? categories : []).filter((category) => category.type != "ExclusionNested")
|
|
10302
|
+
),
|
|
10303
|
+
[categories]
|
|
10304
|
+
);
|
|
10305
|
+
const [optionsToShow, setOptionsToShow] = react.useState(categoryOptions);
|
|
10306
|
+
const [selectedGroup, setSelectedGroup] = react.useState();
|
|
10307
|
+
const filteredOptions = react.useMemo(() => {
|
|
10308
|
+
let options2 = optionsToShow;
|
|
10309
|
+
if (query) {
|
|
10310
|
+
const lower = query.toLowerCase();
|
|
10311
|
+
options2 = options2.flatMap((opt) => {
|
|
10312
|
+
if (isGroup(opt)) {
|
|
10313
|
+
return opt.categories.filter(
|
|
10314
|
+
(cat) => cat.label.toLowerCase().includes(lower)
|
|
10315
|
+
);
|
|
10316
|
+
}
|
|
10317
|
+
return opt.label.toLowerCase().includes(lower) ? [opt] : [];
|
|
10318
|
+
});
|
|
10319
|
+
}
|
|
10320
|
+
return options2.sort((a, b) => a.label.localeCompare(b.label)).map((opt) => {
|
|
10321
|
+
var _a;
|
|
10322
|
+
return isGroup(opt) ? { label: opt.label, id: opt.id, value: opt, asLink: true } : { label: opt.label, id: opt.value, description: (_a = opt.original.description) != null ? _a : void 0, value: opt };
|
|
10323
|
+
});
|
|
10324
|
+
}, [optionsToShow, query]);
|
|
10325
|
+
const onCategorySelect = (item) => {
|
|
10326
|
+
if (isGroup(item.value)) {
|
|
10327
|
+
setOptionsToShow(item.value.categories);
|
|
10328
|
+
setSelectedGroup(item.value.label);
|
|
10329
|
+
setQuery("");
|
|
10330
|
+
return;
|
|
10331
|
+
}
|
|
10332
|
+
select(item.value);
|
|
10333
|
+
};
|
|
10334
|
+
const clearSelectedGroup = react.useCallback(() => {
|
|
10335
|
+
setOptionsToShow(categoryOptions);
|
|
10336
|
+
setSelectedGroup(void 0);
|
|
10337
|
+
setQuery("");
|
|
10338
|
+
}, [categoryOptions]);
|
|
10339
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { className: "Layer__bank-transaction-mobile-list-item__categories_list-container", pbs: "lg", gap: "md", children: [
|
|
10340
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { pis: "sm", pie: "sm", gap: "md", children: [
|
|
10341
|
+
/* @__PURE__ */ jsxRuntime.jsx(HStack, { pis: "xs", children: selectedGroup ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "text", onClick: clearSelectedGroup, children: [
|
|
10342
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { size: 18 }),
|
|
10343
|
+
/* @__PURE__ */ jsxRuntime.jsx(ModalHeading, { size: "sm", weight: "bold", align: "center", children: selectedGroup })
|
|
10344
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(ModalHeading, { size: "sm", weight: "bold", children: "Select category" }) }),
|
|
10345
|
+
/* @__PURE__ */ jsxRuntime.jsx(SearchField, { value: query, onChange: setQuery, label: "Search categories..." })
|
|
10346
|
+
] }),
|
|
10347
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10348
|
+
ActionableList,
|
|
10349
|
+
{
|
|
10350
|
+
options: filteredOptions,
|
|
10351
|
+
onClick: onCategorySelect,
|
|
10352
|
+
selectedId,
|
|
10353
|
+
showDescriptions: showTooltips,
|
|
10354
|
+
className: "Layer__bank-transaction-mobile-list-item__categories_list"
|
|
10355
|
+
}
|
|
10356
|
+
)
|
|
10357
|
+
] });
|
|
10358
|
+
};
|
|
10359
|
+
const CategorySelectDrawer = ({
|
|
10360
|
+
onSelect,
|
|
10361
|
+
selectedId,
|
|
10362
|
+
showTooltips,
|
|
10363
|
+
isOpen,
|
|
10364
|
+
onOpenChange
|
|
10365
|
+
}) => {
|
|
10366
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen, onOpenChange, variant: "mobile-drawer", isDismissable: true, children: ({ close: close2 }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10367
|
+
BankTransactionsMobileListBusinessCategories,
|
|
10368
|
+
{
|
|
10369
|
+
select: (option) => {
|
|
10370
|
+
onSelect(option);
|
|
10371
|
+
close2();
|
|
10372
|
+
},
|
|
10373
|
+
selectedId,
|
|
10374
|
+
showTooltips
|
|
10375
|
+
}
|
|
10376
|
+
) });
|
|
10377
|
+
};
|
|
10378
|
+
const CategorySelectDrawerWithTrigger = ({ value, onChange, showTooltips }) => {
|
|
10379
|
+
var _a;
|
|
10380
|
+
const [isDrawerOpen, setIsDrawerOpen] = react.useState(false);
|
|
10381
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { fluid: true, children: [
|
|
10382
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10383
|
+
Button,
|
|
10384
|
+
{
|
|
10385
|
+
flex: true,
|
|
10386
|
+
fullWidth: true,
|
|
10387
|
+
"aria-label": "Select category",
|
|
10388
|
+
onClick: () => {
|
|
10389
|
+
setIsDrawerOpen(true);
|
|
10390
|
+
},
|
|
10391
|
+
variant: "outlined",
|
|
10392
|
+
children: [
|
|
10393
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { children: (_a = value == null ? void 0 : value.label) != null ? _a : "Select..." }),
|
|
10394
|
+
/* @__PURE__ */ jsxRuntime.jsx(Spacer, {}),
|
|
10395
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 16 })
|
|
10396
|
+
]
|
|
10397
|
+
}
|
|
10398
|
+
),
|
|
10399
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10400
|
+
CategorySelectDrawer,
|
|
10401
|
+
{
|
|
10402
|
+
onSelect: onChange,
|
|
10403
|
+
selectedId: value == null ? void 0 : value.value,
|
|
10404
|
+
showTooltips,
|
|
10405
|
+
isOpen: isDrawerOpen,
|
|
10406
|
+
onOpenChange: setIsDrawerOpen
|
|
10407
|
+
}
|
|
10408
|
+
)
|
|
10409
|
+
] });
|
|
10410
|
+
};
|
|
10167
10411
|
var CategorizationMode = /* @__PURE__ */ ((CategorizationMode2) => {
|
|
10168
10412
|
CategorizationMode2["Categorize"] = "Categorize";
|
|
10169
10413
|
CategorizationMode2["Recategorize"] = "Recategorize";
|
|
10170
10414
|
return CategorizationMode2;
|
|
10171
10415
|
})(CategorizationMode || {});
|
|
10172
|
-
const BankTransactionsCategorizeAllModal = ({
|
|
10416
|
+
const BankTransactionsCategorizeAllModal = ({
|
|
10417
|
+
isOpen,
|
|
10418
|
+
onOpenChange,
|
|
10419
|
+
mode,
|
|
10420
|
+
useCategorySelectDrawer = false
|
|
10421
|
+
}) => {
|
|
10173
10422
|
const { count } = useCountSelectedIds();
|
|
10174
10423
|
const { selectedIds } = useSelectedIds();
|
|
10175
10424
|
const { clearSelection } = useBulkSelectionActions();
|
|
@@ -10211,7 +10460,15 @@ const BankTransactionsCategorizeAllModal = ({ isOpen, onOpenChange, mode }) => {
|
|
|
10211
10460
|
content: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
10212
10461
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", children: [
|
|
10213
10462
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: categorySelectId, children: "Select category" }),
|
|
10214
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10463
|
+
useCategorySelectDrawer ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10464
|
+
CategorySelectDrawerWithTrigger,
|
|
10465
|
+
{
|
|
10466
|
+
"aria-labelledby": categorySelectId,
|
|
10467
|
+
value: selectedCategory,
|
|
10468
|
+
onChange: setSelectedCategory,
|
|
10469
|
+
showTooltips: false
|
|
10470
|
+
}
|
|
10471
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
10215
10472
|
BankTransactionCategoryComboBox,
|
|
10216
10473
|
{
|
|
10217
10474
|
inputId: categorySelectId,
|
|
@@ -10282,7 +10539,7 @@ function buildKey$R({
|
|
|
10282
10539
|
}
|
|
10283
10540
|
const useBulkMatchOrCategorize = () => {
|
|
10284
10541
|
const { data } = useAuth();
|
|
10285
|
-
const { businessId } = useLayerContext();
|
|
10542
|
+
const { businessId, eventCallbacks } = useLayerContext();
|
|
10286
10543
|
const { selectedIds } = useSelectedIds();
|
|
10287
10544
|
const { transactionCategories } = useGetAllBankTransactionsCategories();
|
|
10288
10545
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
@@ -10310,14 +10567,13 @@ const useBulkMatchOrCategorize = () => {
|
|
|
10310
10567
|
const { trigger: originalTrigger } = mutationResponse;
|
|
10311
10568
|
const stableProxiedTrigger = react.useCallback(
|
|
10312
10569
|
(...triggerParameters) => __async(null, null, function* () {
|
|
10570
|
+
var _a;
|
|
10313
10571
|
const triggerResult = yield originalTrigger(...triggerParameters);
|
|
10314
10572
|
void forceReloadBankTransactions();
|
|
10573
|
+
(_a = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a.call(eventCallbacks);
|
|
10315
10574
|
return triggerResult;
|
|
10316
10575
|
}),
|
|
10317
|
-
[
|
|
10318
|
-
originalTrigger,
|
|
10319
|
-
forceReloadBankTransactions
|
|
10320
|
-
]
|
|
10576
|
+
[originalTrigger, forceReloadBankTransactions, eventCallbacks]
|
|
10321
10577
|
);
|
|
10322
10578
|
const proxiedResponse = new Proxy(mutationResponse, {
|
|
10323
10579
|
get(target, prop) {
|
|
@@ -10378,7 +10634,7 @@ function buildKey$Q({
|
|
|
10378
10634
|
}
|
|
10379
10635
|
const useBulkUncategorize = () => {
|
|
10380
10636
|
const { data } = useAuth();
|
|
10381
|
-
const { businessId } = useLayerContext();
|
|
10637
|
+
const { businessId, eventCallbacks } = useLayerContext();
|
|
10382
10638
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
10383
10639
|
const mutationResponse = useSWRMutation(
|
|
10384
10640
|
() => buildKey$Q(__spreadProps(__spreadValues({}, data), {
|
|
@@ -10400,11 +10656,13 @@ const useBulkUncategorize = () => {
|
|
|
10400
10656
|
const originalTrigger = mutationResponse.trigger;
|
|
10401
10657
|
const stableProxiedTrigger = react.useCallback(
|
|
10402
10658
|
(...triggerParameters) => __async(null, null, function* () {
|
|
10659
|
+
var _a;
|
|
10403
10660
|
const triggerResult = yield originalTrigger(...triggerParameters);
|
|
10404
10661
|
void forceReloadBankTransactions();
|
|
10662
|
+
(_a = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a.call(eventCallbacks);
|
|
10405
10663
|
return triggerResult;
|
|
10406
10664
|
}),
|
|
10407
|
-
[originalTrigger, forceReloadBankTransactions]
|
|
10665
|
+
[originalTrigger, forceReloadBankTransactions, eventCallbacks]
|
|
10408
10666
|
);
|
|
10409
10667
|
return new Proxy(mutationResponse, {
|
|
10410
10668
|
get(target, prop) {
|
|
@@ -10439,7 +10697,7 @@ const BankTransactionsUncategorizeAllModal = ({ isOpen, onOpenChange }) => {
|
|
|
10439
10697
|
}
|
|
10440
10698
|
);
|
|
10441
10699
|
};
|
|
10442
|
-
const BankTransactionsBulkActions = () => {
|
|
10700
|
+
const BankTransactionsBulkActions = ({ useCategorySelectDrawer = false }) => {
|
|
10443
10701
|
const { display } = useBankTransactionsContext();
|
|
10444
10702
|
const [categorizeModalOpen, setCategorizeModalOpen] = react.useState(false);
|
|
10445
10703
|
const [confirmModalOpen, setConfirmModalOpen] = react.useState(false);
|
|
@@ -10459,7 +10717,8 @@ const BankTransactionsBulkActions = () => {
|
|
|
10459
10717
|
{
|
|
10460
10718
|
isOpen: categorizeModalOpen,
|
|
10461
10719
|
onOpenChange: setCategorizeModalOpen,
|
|
10462
|
-
mode: CategorizationMode.Categorize
|
|
10720
|
+
mode: CategorizationMode.Categorize,
|
|
10721
|
+
useCategorySelectDrawer
|
|
10463
10722
|
}
|
|
10464
10723
|
),
|
|
10465
10724
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "solid", onClick: () => setConfirmModalOpen(true), children: "Confirm" }),
|
|
@@ -10484,7 +10743,8 @@ const BankTransactionsBulkActions = () => {
|
|
|
10484
10743
|
{
|
|
10485
10744
|
isOpen: recategorizeModalOpen,
|
|
10486
10745
|
onOpenChange: setRecategorizeModalOpen,
|
|
10487
|
-
mode: CategorizationMode.Recategorize
|
|
10746
|
+
mode: CategorizationMode.Recategorize,
|
|
10747
|
+
useCategorySelectDrawer
|
|
10488
10748
|
}
|
|
10489
10749
|
),
|
|
10490
10750
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10504,8 +10764,8 @@ const BankTransactionsBulkActions = () => {
|
|
|
10504
10764
|
)
|
|
10505
10765
|
] }) }) });
|
|
10506
10766
|
};
|
|
10507
|
-
const UploadCloud = (
|
|
10508
|
-
var
|
|
10767
|
+
const UploadCloud = (_xa) => {
|
|
10768
|
+
var _ya = _xa, { size = 18 } = _ya, props = __objRest(_ya, ["size"]);
|
|
10509
10769
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10510
10770
|
"svg",
|
|
10511
10771
|
__spreadProps(__spreadValues({
|
|
@@ -10887,8 +11147,8 @@ const CopyTemplateHeadersButtonGroup = ({ headers, className }) => {
|
|
|
10887
11147
|
key
|
|
10888
11148
|
)) });
|
|
10889
11149
|
};
|
|
10890
|
-
const CloseIcon = (
|
|
10891
|
-
var
|
|
11150
|
+
const CloseIcon = (_za) => {
|
|
11151
|
+
var _Aa = _za, { size = 12 } = _Aa, props = __objRest(_Aa, ["size"]);
|
|
10892
11152
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10893
11153
|
"svg",
|
|
10894
11154
|
__spreadProps(__spreadValues({
|
|
@@ -11159,15 +11419,15 @@ function useCreateCustomAccount() {
|
|
|
11159
11419
|
}
|
|
11160
11420
|
const FORM_CLASS_NAME = "Layer__UI__Form";
|
|
11161
11421
|
const Form = react.forwardRef(
|
|
11162
|
-
function Form2(
|
|
11163
|
-
var
|
|
11422
|
+
function Form2(_Ba, ref) {
|
|
11423
|
+
var _Ca = _Ba, { children, className } = _Ca, restProps = __objRest(_Ca, ["children", "className"]);
|
|
11164
11424
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Form, __spreadProps(__spreadValues({}, restProps), { className: classNames(FORM_CLASS_NAME, className), ref, children }));
|
|
11165
11425
|
}
|
|
11166
11426
|
);
|
|
11167
11427
|
const TEXT_FIELD_CLASS_NAME = "Layer__UI__TextField";
|
|
11168
11428
|
const TextField = react.forwardRef(
|
|
11169
|
-
function TextField2(
|
|
11170
|
-
var
|
|
11429
|
+
function TextField2(_Da, ref) {
|
|
11430
|
+
var _Ea = _Da, { children, inline, textarea, className } = _Ea, restProps = __objRest(_Ea, ["children", "inline", "textarea", "className"]);
|
|
11171
11431
|
const dataProperties = toDataProperties({ inline, textarea });
|
|
11172
11432
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.TextField, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(TEXT_FIELD_CLASS_NAME, className), ref, children: withRenderProp(children, (node) => node) }));
|
|
11173
11433
|
}
|
|
@@ -11297,8 +11557,8 @@ function formatBigDecimalToString(value, options2 = {
|
|
|
11297
11557
|
}
|
|
11298
11558
|
const INPUT_CLASS_NAME = "Layer__UI__Input";
|
|
11299
11559
|
const Input$1 = react.forwardRef(
|
|
11300
|
-
function Input2(
|
|
11301
|
-
var
|
|
11560
|
+
function Input2(_Fa, ref) {
|
|
11561
|
+
var _Ga = _Fa, { inset, placement } = _Ga, restProps = __objRest(_Ga, ["inset", "placement"]);
|
|
11302
11562
|
const dataProperties = toDataProperties({ inset, placement });
|
|
11303
11563
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11304
11564
|
reactAriaComponents.Input,
|
|
@@ -11309,24 +11569,6 @@ const Input$1 = react.forwardRef(
|
|
|
11309
11569
|
);
|
|
11310
11570
|
}
|
|
11311
11571
|
);
|
|
11312
|
-
const INPUT_GROUP_CLASS_NAME = "Layer__InputGroup";
|
|
11313
|
-
const InputGroup$1 = react.forwardRef(
|
|
11314
|
-
function InputGroup2(_za, ref) {
|
|
11315
|
-
var _Aa = _za, { actionCount, className, slots, children } = _Aa, restProps = __objRest(_Aa, ["actionCount", "className", "slots", "children"]);
|
|
11316
|
-
const combinedClassName = classNames(INPUT_GROUP_CLASS_NAME, className);
|
|
11317
|
-
const dataProperties = toDataProperties({
|
|
11318
|
-
"action-count": actionCount
|
|
11319
|
-
});
|
|
11320
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11321
|
-
reactAriaComponents.Group,
|
|
11322
|
-
__spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
|
|
11323
|
-
className: combinedClassName,
|
|
11324
|
-
ref,
|
|
11325
|
-
children
|
|
11326
|
-
})
|
|
11327
|
-
);
|
|
11328
|
-
}
|
|
11329
|
-
);
|
|
11330
11572
|
const DEFAULT_MAX_VALUE = effect.BigDecimal.fromBigInt(BigInt(1e7));
|
|
11331
11573
|
const DEFAULT_MIN_DECIMAL_PLACES = 0;
|
|
11332
11574
|
const DEFAULT_MAX_DECIMAL_PLACES = 3;
|
|
@@ -11339,21 +11581,23 @@ const withForceUpdate = (value) => {
|
|
|
11339
11581
|
writable: false
|
|
11340
11582
|
});
|
|
11341
11583
|
};
|
|
11342
|
-
function FormBigDecimalField(
|
|
11343
|
-
var
|
|
11584
|
+
function FormBigDecimalField(_Ha) {
|
|
11585
|
+
var _Ia = _Ha, {
|
|
11344
11586
|
mode = "decimal",
|
|
11345
11587
|
allowNegative = false,
|
|
11346
11588
|
maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
|
|
11347
11589
|
minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
|
|
11348
11590
|
maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
|
|
11349
|
-
slots
|
|
11350
|
-
|
|
11591
|
+
slots,
|
|
11592
|
+
placeholder
|
|
11593
|
+
} = _Ia, restProps = __objRest(_Ia, [
|
|
11351
11594
|
"mode",
|
|
11352
11595
|
"allowNegative",
|
|
11353
11596
|
"maxValue",
|
|
11354
11597
|
"minDecimalPlaces",
|
|
11355
11598
|
"maxDecimalPlaces",
|
|
11356
|
-
"slots"
|
|
11599
|
+
"slots",
|
|
11600
|
+
"placeholder"
|
|
11357
11601
|
]);
|
|
11358
11602
|
const field = useFieldContext();
|
|
11359
11603
|
const { name, state, handleChange, handleBlur } = field;
|
|
@@ -11413,20 +11657,21 @@ function FormBigDecimalField(_Ba) {
|
|
|
11413
11657
|
onChange: onInputChange,
|
|
11414
11658
|
onBlur: onInputBlur,
|
|
11415
11659
|
onBeforeInput,
|
|
11416
|
-
onPaste
|
|
11660
|
+
onPaste,
|
|
11661
|
+
placeholder
|
|
11417
11662
|
}
|
|
11418
11663
|
),
|
|
11419
11664
|
(slots == null ? void 0 : slots.badge) && /* @__PURE__ */ jsxRuntime.jsx(HStack, { children: slots.badge })
|
|
11420
11665
|
] }) }));
|
|
11421
11666
|
}
|
|
11422
|
-
const CLASS_NAME$
|
|
11667
|
+
const CLASS_NAME$7 = "Layer__Checkbox";
|
|
11423
11668
|
const CHECK_SIZE = {
|
|
11424
11669
|
sm: 12,
|
|
11425
11670
|
md: 14,
|
|
11426
11671
|
lg: 16
|
|
11427
11672
|
};
|
|
11428
|
-
function Checkbox(
|
|
11429
|
-
var
|
|
11673
|
+
function Checkbox(_Ja) {
|
|
11674
|
+
var _Ka = _Ja, { children, className, variant = "default", size = "sm", isIndeterminate } = _Ka, props = __objRest(_Ka, ["children", "className", "variant", "size", "isIndeterminate"]);
|
|
11430
11675
|
const dataProperties = react.useMemo(() => toDataProperties({
|
|
11431
11676
|
size,
|
|
11432
11677
|
variant,
|
|
@@ -11436,7 +11681,7 @@ function Checkbox(_Da) {
|
|
|
11436
11681
|
reactAriaComponents.Checkbox,
|
|
11437
11682
|
__spreadProps(__spreadValues(__spreadValues({}, dataProperties), props), {
|
|
11438
11683
|
isIndeterminate,
|
|
11439
|
-
className: classNames(CLASS_NAME$
|
|
11684
|
+
className: classNames(CLASS_NAME$7, className),
|
|
11440
11685
|
children: withRenderProp(children, (node) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11441
11686
|
/* @__PURE__ */ jsxRuntime.jsx("div", { slot: "checkbox", children: isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { size: CHECK_SIZE[size] }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: CHECK_SIZE[size] }) }),
|
|
11442
11687
|
node
|
|
@@ -11444,8 +11689,8 @@ function Checkbox(_Da) {
|
|
|
11444
11689
|
})
|
|
11445
11690
|
);
|
|
11446
11691
|
}
|
|
11447
|
-
function CheckboxWithTooltip(
|
|
11448
|
-
var
|
|
11692
|
+
function CheckboxWithTooltip(_La) {
|
|
11693
|
+
var _Ma = _La, { tooltip } = _Ma, props = __objRest(_Ma, ["tooltip"]);
|
|
11449
11694
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__checkbox-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !tooltip, children: [
|
|
11450
11695
|
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, __spreadValues({}, props)) }),
|
|
11451
11696
|
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
|
|
@@ -11491,8 +11736,8 @@ function FormCheckboxField({
|
|
|
11491
11736
|
}
|
|
11492
11737
|
const DATE_FIELD_CLASS_NAME = "Layer__UI__DateField";
|
|
11493
11738
|
const DateField = react.forwardRef(
|
|
11494
|
-
function DateField2(
|
|
11495
|
-
var
|
|
11739
|
+
function DateField2(_Na, ref) {
|
|
11740
|
+
var _Oa = _Na, { inline, className, isReadOnly } = _Oa, restProps = __objRest(_Oa, ["inline", "className", "isReadOnly"]);
|
|
11496
11741
|
const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
|
|
11497
11742
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11498
11743
|
reactAriaComponents.DateField,
|
|
@@ -11506,8 +11751,8 @@ const DateField = react.forwardRef(
|
|
|
11506
11751
|
);
|
|
11507
11752
|
const DATE_INPUT_CLASS_NAME = "Layer__UI__DateInput";
|
|
11508
11753
|
const DateInput = react.forwardRef(
|
|
11509
|
-
function DateInput2(
|
|
11510
|
-
var
|
|
11754
|
+
function DateInput2(_Pa, ref) {
|
|
11755
|
+
var _Qa = _Pa, { inset, pointerEvents } = _Qa, restProps = __objRest(_Qa, ["inset", "pointerEvents"]);
|
|
11511
11756
|
const dataProperties = toDataProperties({ inset, "pointer-events": pointerEvents });
|
|
11512
11757
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11513
11758
|
reactAriaComponents.DateInput,
|
|
@@ -11520,8 +11765,8 @@ const DateInput = react.forwardRef(
|
|
|
11520
11765
|
);
|
|
11521
11766
|
const DATE_SEGMENT_CLASS_NAME = "Layer__UI__DateSegment";
|
|
11522
11767
|
const DateSegment = react.forwardRef(
|
|
11523
|
-
function DateSegment2(
|
|
11524
|
-
var
|
|
11768
|
+
function DateSegment2(_Ra, ref) {
|
|
11769
|
+
var _Sa = _Ra, { isReadOnly } = _Sa, restProps = __objRest(_Sa, ["isReadOnly"]);
|
|
11525
11770
|
const dataProperties = toDataProperties({ interactive: !isReadOnly });
|
|
11526
11771
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11527
11772
|
reactAriaComponents.DateSegment,
|
|
@@ -11602,8 +11847,8 @@ function FormDateField({
|
|
|
11602
11847
|
}
|
|
11603
11848
|
const NUMBER_FIELD_CLASS_NAME = "Layer__UI__NumberField";
|
|
11604
11849
|
const NumberField = react.forwardRef(
|
|
11605
|
-
function NumberField2(
|
|
11606
|
-
var
|
|
11850
|
+
function NumberField2(_Ta, ref) {
|
|
11851
|
+
var _Ua = _Ta, { inline, className, isReadOnly } = _Ua, restProps = __objRest(_Ua, ["inline", "className", "isReadOnly"]);
|
|
11607
11852
|
const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
|
|
11608
11853
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11609
11854
|
reactAriaComponents.NumberField,
|
|
@@ -11625,7 +11870,8 @@ function FormNumberField({
|
|
|
11625
11870
|
showFieldError = true,
|
|
11626
11871
|
isReadOnly = false,
|
|
11627
11872
|
minValue,
|
|
11628
|
-
maxValue
|
|
11873
|
+
maxValue,
|
|
11874
|
+
placeholder
|
|
11629
11875
|
}) {
|
|
11630
11876
|
const field = useFieldContext();
|
|
11631
11877
|
const { name, state, handleChange, handleBlur } = field;
|
|
@@ -11663,7 +11909,7 @@ function FormNumberField({
|
|
|
11663
11909
|
children: label
|
|
11664
11910
|
})
|
|
11665
11911
|
),
|
|
11666
|
-
/* @__PURE__ */ jsxRuntime.jsx(InputGroup$1, { slot: "input", children: /* @__PURE__ */ jsxRuntime.jsx(Input$1, { inset: true }) }),
|
|
11912
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputGroup$1, { slot: "input", children: /* @__PURE__ */ jsxRuntime.jsx(Input$1, { inset: true, placeholder }) }),
|
|
11667
11913
|
shouldShowErrorMessage && /* @__PURE__ */ jsxRuntime.jsx(FieldError, { children: errorMessage })
|
|
11668
11914
|
]
|
|
11669
11915
|
})
|
|
@@ -11671,8 +11917,8 @@ function FormNumberField({
|
|
|
11671
11917
|
}
|
|
11672
11918
|
const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
|
|
11673
11919
|
const TextArea = react.forwardRef(
|
|
11674
|
-
function TextArea2(
|
|
11675
|
-
var
|
|
11920
|
+
function TextArea2(_Va, ref) {
|
|
11921
|
+
var _Wa = _Va, { resize = "none" } = _Wa, restProps = __objRest(_Wa, ["resize"]);
|
|
11676
11922
|
const dataProperties = toDataProperties({ resize });
|
|
11677
11923
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11678
11924
|
reactAriaComponents.TextArea,
|
|
@@ -11683,7 +11929,8 @@ const TextArea = react.forwardRef(
|
|
|
11683
11929
|
);
|
|
11684
11930
|
}
|
|
11685
11931
|
);
|
|
11686
|
-
function FormTextAreaField(
|
|
11932
|
+
function FormTextAreaField(_Xa) {
|
|
11933
|
+
var _Ya = _Xa, { placeholder } = _Ya, props = __objRest(_Ya, ["placeholder"]);
|
|
11687
11934
|
const field = useFieldContext();
|
|
11688
11935
|
const { name, state, handleChange, handleBlur } = field;
|
|
11689
11936
|
const { value } = state;
|
|
@@ -11698,11 +11945,13 @@ function FormTextAreaField(props) {
|
|
|
11698
11945
|
name,
|
|
11699
11946
|
value,
|
|
11700
11947
|
onChange,
|
|
11701
|
-
onBlur: handleBlur
|
|
11948
|
+
onBlur: handleBlur,
|
|
11949
|
+
placeholder
|
|
11702
11950
|
}
|
|
11703
11951
|
) }));
|
|
11704
11952
|
}
|
|
11705
|
-
function FormTextField(
|
|
11953
|
+
function FormTextField(_Za) {
|
|
11954
|
+
var __a = _Za, { placeholder } = __a, props = __objRest(__a, ["placeholder"]);
|
|
11706
11955
|
const field = useFieldContext();
|
|
11707
11956
|
const { name, state, handleChange, handleBlur } = field;
|
|
11708
11957
|
const { value } = state;
|
|
@@ -11717,6 +11966,7 @@ function FormTextField(props) {
|
|
|
11717
11966
|
value,
|
|
11718
11967
|
onChange,
|
|
11719
11968
|
onBlur: handleBlur,
|
|
11969
|
+
placeholder,
|
|
11720
11970
|
inset: true
|
|
11721
11971
|
}
|
|
11722
11972
|
) }) }));
|
|
@@ -11789,13 +12039,13 @@ const useCustomAccountForm = ({ onSuccess }) => {
|
|
|
11789
12039
|
const isFormValid = reactForm.useStore(form.store, (state) => state.isValid);
|
|
11790
12040
|
return { form, submitError, isFormValid };
|
|
11791
12041
|
};
|
|
11792
|
-
const Input = (
|
|
11793
|
-
var
|
|
12042
|
+
const Input = (_$a) => {
|
|
12043
|
+
var _ab = _$a, {
|
|
11794
12044
|
className,
|
|
11795
12045
|
isInvalid,
|
|
11796
12046
|
errorMessage,
|
|
11797
12047
|
leftText
|
|
11798
|
-
} =
|
|
12048
|
+
} = _ab, props = __objRest(_ab, [
|
|
11799
12049
|
"className",
|
|
11800
12050
|
"isInvalid",
|
|
11801
12051
|
"errorMessage",
|
|
@@ -11841,8 +12091,8 @@ const InputGroup = ({
|
|
|
11841
12091
|
children
|
|
11842
12092
|
] });
|
|
11843
12093
|
};
|
|
11844
|
-
const ChevronDownFill = (
|
|
11845
|
-
var
|
|
12094
|
+
const ChevronDownFill = (_bb) => {
|
|
12095
|
+
var _cb = _bb, { size = 18 } = _cb, props = __objRest(_cb, ["size"]);
|
|
11846
12096
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11847
12097
|
"svg",
|
|
11848
12098
|
__spreadProps(__spreadValues({
|
|
@@ -11911,8 +12161,8 @@ const Select = ({
|
|
|
11911
12161
|
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
11912
12162
|
] });
|
|
11913
12163
|
};
|
|
11914
|
-
const ErrorText = (
|
|
11915
|
-
var
|
|
12164
|
+
const ErrorText = (_db) => {
|
|
12165
|
+
var _eb = _db, { className } = _eb, props = __objRest(_eb, ["className"]);
|
|
11916
12166
|
return /* @__PURE__ */ jsxRuntime.jsx(Text, __spreadProps(__spreadValues({}, props), { status: "error", className }));
|
|
11917
12167
|
};
|
|
11918
12168
|
const accountTypeOptions = [
|
|
@@ -12745,44 +12995,10 @@ const BankTransactionsHeaderMenu = ({ actions, isDisabled }) => {
|
|
|
12745
12995
|
isModalOpen && /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsUploadModal, { isOpen: true, onOpenChange: setIsModalOpen })
|
|
12746
12996
|
] });
|
|
12747
12997
|
};
|
|
12748
|
-
const CLASS_NAME$
|
|
12998
|
+
const CLASS_NAME$6 = "Layer__BankTransactionsActions";
|
|
12749
12999
|
function BankTransactionsActions({ children }) {
|
|
12750
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME$
|
|
13000
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME$6, children });
|
|
12751
13001
|
}
|
|
12752
|
-
const X = (_Xa) => {
|
|
12753
|
-
var _Ya = _Xa, { size = 18 } = _Ya, props = __objRest(_Ya, ["size"]);
|
|
12754
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12755
|
-
"svg",
|
|
12756
|
-
__spreadProps(__spreadValues({
|
|
12757
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
12758
|
-
viewBox: "0 0 18 18",
|
|
12759
|
-
fill: "none"
|
|
12760
|
-
}, props), {
|
|
12761
|
-
width: size,
|
|
12762
|
-
height: size,
|
|
12763
|
-
children: [
|
|
12764
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12765
|
-
"path",
|
|
12766
|
-
{
|
|
12767
|
-
d: "M13.5 4.5L4.5 13.5",
|
|
12768
|
-
stroke: "currentColor",
|
|
12769
|
-
strokeLinecap: "round",
|
|
12770
|
-
strokeLinejoin: "round"
|
|
12771
|
-
}
|
|
12772
|
-
),
|
|
12773
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12774
|
-
"path",
|
|
12775
|
-
{
|
|
12776
|
-
d: "M4.5 4.5L13.5 13.5",
|
|
12777
|
-
stroke: "currentColor",
|
|
12778
|
-
strokeLinecap: "round",
|
|
12779
|
-
strokeLinejoin: "round"
|
|
12780
|
-
}
|
|
12781
|
-
)
|
|
12782
|
-
]
|
|
12783
|
-
})
|
|
12784
|
-
);
|
|
12785
|
-
};
|
|
12786
13002
|
const BulkActionsModule = ({ slots }) => {
|
|
12787
13003
|
const { count } = useCountSelectedIds();
|
|
12788
13004
|
const { clearSelection } = useBulkSelectionActions();
|
|
@@ -12804,8 +13020,8 @@ const BulkActionsModule = ({ slots }) => {
|
|
|
12804
13020
|
/* @__PURE__ */ jsxRuntime.jsx(slots.BulkActions, {})
|
|
12805
13021
|
] });
|
|
12806
13022
|
};
|
|
12807
|
-
const DownloadCloud = (
|
|
12808
|
-
var
|
|
13023
|
+
const DownloadCloud = (_fb) => {
|
|
13024
|
+
var _gb = _fb, { size = 18 } = _gb, props = __objRest(_gb, ["size"]);
|
|
12809
13025
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12810
13026
|
"svg",
|
|
12811
13027
|
__spreadProps(__spreadValues({
|
|
@@ -12929,29 +13145,6 @@ function useSizeClass() {
|
|
|
12929
13145
|
isDesktop: sizeClass === "desktop"
|
|
12930
13146
|
};
|
|
12931
13147
|
}
|
|
12932
|
-
const ChevronDown = (_$a) => {
|
|
12933
|
-
var _ab = _$a, { size = 18 } = _ab, props = __objRest(_ab, ["size"]);
|
|
12934
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12935
|
-
"svg",
|
|
12936
|
-
__spreadProps(__spreadValues({
|
|
12937
|
-
viewBox: "0 0 18 18",
|
|
12938
|
-
fill: "none",
|
|
12939
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
12940
|
-
}, props), {
|
|
12941
|
-
width: size,
|
|
12942
|
-
height: size,
|
|
12943
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12944
|
-
"path",
|
|
12945
|
-
{
|
|
12946
|
-
d: "M4.5 6.75L9 11.25L13.5 6.75",
|
|
12947
|
-
stroke: "currentColor",
|
|
12948
|
-
strokeLinecap: "round",
|
|
12949
|
-
strokeLinejoin: "round"
|
|
12950
|
-
}
|
|
12951
|
-
)
|
|
12952
|
-
})
|
|
12953
|
-
);
|
|
12954
|
-
};
|
|
12955
13148
|
const MONTHS = [
|
|
12956
13149
|
"January",
|
|
12957
13150
|
"February",
|
|
@@ -13080,8 +13273,8 @@ function MonthCalendar({
|
|
|
13080
13273
|
const POPOVER_CLASS_NAME = "Layer__Popover";
|
|
13081
13274
|
const POPOVER_CLASS_NAMES = `Layer__Portal ${POPOVER_CLASS_NAME}`;
|
|
13082
13275
|
const Popover = react.forwardRef(
|
|
13083
|
-
function Popover2(
|
|
13084
|
-
var
|
|
13276
|
+
function Popover2(_hb, ref) {
|
|
13277
|
+
var _ib = _hb, { flexInline = false } = _ib, restProps = __objRest(_ib, ["flexInline"]);
|
|
13085
13278
|
const dataProperties = toDataProperties({ "flex-inline": flexInline });
|
|
13086
13279
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13087
13280
|
reactAriaComponents.Popover,
|
|
@@ -13151,42 +13344,6 @@ const MonthPicker = ({
|
|
|
13151
13344
|
) }) })
|
|
13152
13345
|
] });
|
|
13153
13346
|
};
|
|
13154
|
-
const CLASS_NAME$8 = "Layer__MinimalSearchField";
|
|
13155
|
-
function MinimalSearchField(_db) {
|
|
13156
|
-
var _eb = _db, {
|
|
13157
|
-
placeholder,
|
|
13158
|
-
isDisabled
|
|
13159
|
-
} = _eb, restProps = __objRest(_eb, [
|
|
13160
|
-
"placeholder",
|
|
13161
|
-
"isDisabled"
|
|
13162
|
-
]);
|
|
13163
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.SearchField, __spreadProps(__spreadValues({}, restProps), { isDisabled, className: CLASS_NAME$8, children: [
|
|
13164
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13165
|
-
reactAriaComponents.Input,
|
|
13166
|
-
{
|
|
13167
|
-
slot: "input",
|
|
13168
|
-
placeholder
|
|
13169
|
-
}
|
|
13170
|
-
),
|
|
13171
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { slot: "clear-button", inset: true, icon: true, variant: "ghost", "aria-label": "Clear search", children: /* @__PURE__ */ jsxRuntime.jsx(X, {}) })
|
|
13172
|
-
] }));
|
|
13173
|
-
}
|
|
13174
|
-
const CLASS_NAME$7 = "Layer__SearchField";
|
|
13175
|
-
function SearchField(_fb) {
|
|
13176
|
-
var _gb = _fb, { slot = "search", className, label, isDisabled } = _gb, restProps = __objRest(_gb, ["slot", "className", "label", "isDisabled"]);
|
|
13177
|
-
const combinedClassName = classNames(CLASS_NAME$7, className);
|
|
13178
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { slot, className: combinedClassName, children: [
|
|
13179
|
-
/* @__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 }) }),
|
|
13180
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13181
|
-
MinimalSearchField,
|
|
13182
|
-
__spreadProps(__spreadValues({}, restProps), {
|
|
13183
|
-
placeholder: label,
|
|
13184
|
-
"aria-label": label,
|
|
13185
|
-
isDisabled
|
|
13186
|
-
})
|
|
13187
|
-
)
|
|
13188
|
-
] });
|
|
13189
|
-
}
|
|
13190
13347
|
const SmallLoader = ({ size = 28 }) => {
|
|
13191
13348
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13192
13349
|
"span",
|
|
@@ -13429,7 +13586,7 @@ function useInvisibleDownload() {
|
|
|
13429
13586
|
}, []);
|
|
13430
13587
|
return { invisibleDownloadRef, triggerInvisibleDownload };
|
|
13431
13588
|
}
|
|
13432
|
-
const CLASS_NAME$
|
|
13589
|
+
const CLASS_NAME$5 = "Layer__InvisibleDownload";
|
|
13433
13590
|
const InvisibleDownload = react.forwardRef((_props, ref) => {
|
|
13434
13591
|
const internalRef = react.useRef(null);
|
|
13435
13592
|
react.useImperativeHandle(ref, () => ({
|
|
@@ -13448,7 +13605,7 @@ const InvisibleDownload = react.forwardRef((_props, ref) => {
|
|
|
13448
13605
|
const handleContainClick = react.useCallback((event) => {
|
|
13449
13606
|
event.stopPropagation();
|
|
13450
13607
|
}, []);
|
|
13451
|
-
return /* @__PURE__ */ jsxRuntime.jsx("a", { download: true, className: CLASS_NAME$
|
|
13608
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { download: true, className: CLASS_NAME$5, ref: internalRef, onClick: handleContainClick });
|
|
13452
13609
|
});
|
|
13453
13610
|
InvisibleDownload.displayName = "InvisibleDownload";
|
|
13454
13611
|
function TransactionsSearch({ slot, isDisabled }) {
|
|
@@ -13595,6 +13752,9 @@ const BankTransactionsHeader = ({
|
|
|
13595
13752
|
}
|
|
13596
13753
|
return actions;
|
|
13597
13754
|
}, [withUploadMenu, showCategorizationRules]);
|
|
13755
|
+
const BulkActionsModuleSlot = react.useCallback(() => {
|
|
13756
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsBulkActions, { useCategorySelectDrawer: listView && mobileComponent === "mobileList" });
|
|
13757
|
+
}, [listView, mobileComponent]);
|
|
13598
13758
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13599
13759
|
Header$1,
|
|
13600
13760
|
{
|
|
@@ -13610,7 +13770,7 @@ const BankTransactionsHeader = ({
|
|
|
13610
13770
|
showBulkActions ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13611
13771
|
BulkActionsModule,
|
|
13612
13772
|
{
|
|
13613
|
-
slots: { BulkActions:
|
|
13773
|
+
slots: { BulkActions: BulkActionsModuleSlot }
|
|
13614
13774
|
}
|
|
13615
13775
|
) : /* @__PURE__ */ jsxRuntime.jsxs(HStack, { slot: "toggle", justify: "center", gap: "xs", children: [
|
|
13616
13776
|
collapseHeader && headerTopRow,
|
|
@@ -13645,8 +13805,8 @@ const BankTransactionsHeader = ({
|
|
|
13645
13805
|
}
|
|
13646
13806
|
);
|
|
13647
13807
|
};
|
|
13648
|
-
const Inbox = (
|
|
13649
|
-
var
|
|
13808
|
+
const Inbox = (_jb) => {
|
|
13809
|
+
var _kb = _jb, { size = 18 } = _kb, props = __objRest(_kb, ["size"]);
|
|
13650
13810
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13651
13811
|
"svg",
|
|
13652
13812
|
__spreadProps(__spreadValues({
|
|
@@ -14128,8 +14288,8 @@ function asMutable(a) {
|
|
|
14128
14288
|
const CSS_PREFIX$1 = "Layer__UI__Table";
|
|
14129
14289
|
const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
|
|
14130
14290
|
const Table$1 = react.forwardRef(
|
|
14131
|
-
(
|
|
14132
|
-
var
|
|
14291
|
+
(_lb, ref) => {
|
|
14292
|
+
var _mb = _lb, { children, className } = _mb, restProps = __objRest(_mb, ["children", "className"]);
|
|
14133
14293
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14134
14294
|
reactAriaComponents.Table,
|
|
14135
14295
|
__spreadProps(__spreadValues({
|
|
@@ -14142,8 +14302,8 @@ const Table$1 = react.forwardRef(
|
|
|
14142
14302
|
}
|
|
14143
14303
|
);
|
|
14144
14304
|
Table$1.displayName = "Table";
|
|
14145
|
-
const TableHeaderInner = (
|
|
14146
|
-
var
|
|
14305
|
+
const TableHeaderInner = (_nb, ref) => {
|
|
14306
|
+
var _ob = _nb, { children, className, hideHeader } = _ob, restProps = __objRest(_ob, ["children", "className", "hideHeader"]);
|
|
14147
14307
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14148
14308
|
reactAriaComponents.TableHeader,
|
|
14149
14309
|
__spreadProps(__spreadValues({
|
|
@@ -14156,8 +14316,8 @@ const TableHeaderInner = (_lb, ref) => {
|
|
|
14156
14316
|
};
|
|
14157
14317
|
const TableHeader = react.forwardRef(TableHeaderInner);
|
|
14158
14318
|
TableHeader.displayName = "TableHeader";
|
|
14159
|
-
const TableBodyInner = (
|
|
14160
|
-
var
|
|
14319
|
+
const TableBodyInner = (_pb, ref) => {
|
|
14320
|
+
var _qb = _pb, { children, className } = _qb, restProps = __objRest(_qb, ["children", "className"]);
|
|
14161
14321
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14162
14322
|
reactAriaComponents.TableBody,
|
|
14163
14323
|
__spreadProps(__spreadValues({
|
|
@@ -14170,8 +14330,8 @@ const TableBodyInner = (_nb, ref) => {
|
|
|
14170
14330
|
};
|
|
14171
14331
|
const TableBody$1 = react.forwardRef(TableBodyInner);
|
|
14172
14332
|
TableBody$1.displayName = "TableBody";
|
|
14173
|
-
const RowInner = (
|
|
14174
|
-
var
|
|
14333
|
+
const RowInner = (_rb, ref) => {
|
|
14334
|
+
var _sb = _rb, { children, className, depth = 0 } = _sb, restProps = __objRest(_sb, ["children", "className", "depth"]);
|
|
14175
14335
|
const dataProperties = toDataProperties({ depth });
|
|
14176
14336
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14177
14337
|
reactAriaComponents.Row,
|
|
@@ -14186,8 +14346,8 @@ const RowInner = (_pb, ref) => {
|
|
|
14186
14346
|
const Row = react.forwardRef(RowInner);
|
|
14187
14347
|
Row.displayName = "Row";
|
|
14188
14348
|
const Column = react.forwardRef(
|
|
14189
|
-
(
|
|
14190
|
-
var
|
|
14349
|
+
(_tb, ref) => {
|
|
14350
|
+
var _ub = _tb, { children, className, textAlign = "left" } = _ub, restProps = __objRest(_ub, ["children", "className", "textAlign"]);
|
|
14191
14351
|
const dataProperties = toDataProperties({ "text-align": textAlign });
|
|
14192
14352
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14193
14353
|
reactAriaComponents.Column,
|
|
@@ -14202,8 +14362,8 @@ const Column = react.forwardRef(
|
|
|
14202
14362
|
);
|
|
14203
14363
|
Column.displayName = "Column";
|
|
14204
14364
|
const Cell = react.forwardRef(
|
|
14205
|
-
(
|
|
14206
|
-
var
|
|
14365
|
+
(_vb, ref) => {
|
|
14366
|
+
var _wb = _vb, { children, className } = _wb, restProps = __objRest(_wb, ["children", "className"]);
|
|
14207
14367
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14208
14368
|
reactAriaComponents.Cell,
|
|
14209
14369
|
__spreadProps(__spreadValues({
|
|
@@ -14580,8 +14740,8 @@ function useDelayedVisibility({
|
|
|
14580
14740
|
);
|
|
14581
14741
|
return { isVisible };
|
|
14582
14742
|
}
|
|
14583
|
-
const File = (
|
|
14584
|
-
var
|
|
14743
|
+
const File = (_xb) => {
|
|
14744
|
+
var _yb = _xb, { size = 12 } = _yb, props = __objRest(_yb, ["size"]);
|
|
14585
14745
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14586
14746
|
"svg",
|
|
14587
14747
|
__spreadProps(__spreadValues({
|
|
@@ -14641,6 +14801,57 @@ const File = (_vb) => {
|
|
|
14641
14801
|
})
|
|
14642
14802
|
);
|
|
14643
14803
|
};
|
|
14804
|
+
const variants = {
|
|
14805
|
+
fade: {
|
|
14806
|
+
initial: { opacity: 0 },
|
|
14807
|
+
animate: { opacity: 1 },
|
|
14808
|
+
exit: { opacity: 0 },
|
|
14809
|
+
transition: { duration: 0.3, ease: [0, 0, 0.58, 1] }
|
|
14810
|
+
},
|
|
14811
|
+
slideUp: {
|
|
14812
|
+
initial: { y: "100%" },
|
|
14813
|
+
animate: { y: 0 },
|
|
14814
|
+
exit: { y: "100%" },
|
|
14815
|
+
transition: { duration: 0.35, ease: [0.4, 0, 0.2, 1] }
|
|
14816
|
+
},
|
|
14817
|
+
expand: {
|
|
14818
|
+
initial: { height: 0, opacity: 0 },
|
|
14819
|
+
animate: { height: "auto", opacity: 1 },
|
|
14820
|
+
exit: { height: 0, opacity: 0 },
|
|
14821
|
+
transition: {
|
|
14822
|
+
height: { duration: 0.25, ease: [0.4, 0, 0.2, 1] },
|
|
14823
|
+
opacity: { duration: 0.15, ease: [0, 0, 0.58, 1] }
|
|
14824
|
+
}
|
|
14825
|
+
}
|
|
14826
|
+
};
|
|
14827
|
+
const AnimatedPresenceDiv = (_zb) => {
|
|
14828
|
+
var _Ab = _zb, {
|
|
14829
|
+
children,
|
|
14830
|
+
variant,
|
|
14831
|
+
isOpen,
|
|
14832
|
+
slotProps = { AnimatePresence: { initial: false } },
|
|
14833
|
+
key
|
|
14834
|
+
} = _Ab, props = __objRest(_Ab, [
|
|
14835
|
+
"children",
|
|
14836
|
+
"variant",
|
|
14837
|
+
"isOpen",
|
|
14838
|
+
"slotProps",
|
|
14839
|
+
"key"
|
|
14840
|
+
]);
|
|
14841
|
+
const config = variants[variant];
|
|
14842
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$2.AnimatePresence, __spreadProps(__spreadValues({}, slotProps.AnimatePresence), { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14843
|
+
react$2.motion.div,
|
|
14844
|
+
__spreadProps(__spreadValues({
|
|
14845
|
+
initial: config.initial,
|
|
14846
|
+
animate: config.animate,
|
|
14847
|
+
exit: config.exit,
|
|
14848
|
+
transition: config.transition
|
|
14849
|
+
}, props), {
|
|
14850
|
+
children
|
|
14851
|
+
}),
|
|
14852
|
+
key
|
|
14853
|
+
) }));
|
|
14854
|
+
};
|
|
14644
14855
|
function isActiveBookkeepingStatus(status) {
|
|
14645
14856
|
return status === BookkeepingStatus$2.ACTIVE || status === BookkeepingStatus$2.ONBOARDING;
|
|
14646
14857
|
}
|
|
@@ -14740,29 +14951,8 @@ function useBookkeepingPeriods() {
|
|
|
14740
14951
|
}
|
|
14741
14952
|
});
|
|
14742
14953
|
}
|
|
14743
|
-
const
|
|
14744
|
-
"
|
|
14745
|
-
"February",
|
|
14746
|
-
"March",
|
|
14747
|
-
"April",
|
|
14748
|
-
"May",
|
|
14749
|
-
"June",
|
|
14750
|
-
"July",
|
|
14751
|
-
"August",
|
|
14752
|
-
"September",
|
|
14753
|
-
"October",
|
|
14754
|
-
"November",
|
|
14755
|
-
"December"
|
|
14756
|
-
];
|
|
14757
|
-
const getMonthNameFromNumber = (monthNumber) => {
|
|
14758
|
-
var _a;
|
|
14759
|
-
if (monthNumber < 1 || monthNumber > 12) {
|
|
14760
|
-
return "";
|
|
14761
|
-
}
|
|
14762
|
-
return (_a = monthNames.at(monthNumber - 1)) != null ? _a : "";
|
|
14763
|
-
};
|
|
14764
|
-
const Clock = (_xb) => {
|
|
14765
|
-
var _yb = _xb, { size = 18 } = _yb, props = __objRest(_yb, ["size"]);
|
|
14954
|
+
const Clock = (_Bb) => {
|
|
14955
|
+
var _Cb = _Bb, { size = 18 } = _Cb, props = __objRest(_Cb, ["size"]);
|
|
14766
14956
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14767
14957
|
"svg",
|
|
14768
14958
|
__spreadProps(__spreadValues({
|
|
@@ -14787,6 +14977,27 @@ const Clock = (_xb) => {
|
|
|
14787
14977
|
})
|
|
14788
14978
|
);
|
|
14789
14979
|
};
|
|
14980
|
+
const monthNames = [
|
|
14981
|
+
"January",
|
|
14982
|
+
"February",
|
|
14983
|
+
"March",
|
|
14984
|
+
"April",
|
|
14985
|
+
"May",
|
|
14986
|
+
"June",
|
|
14987
|
+
"July",
|
|
14988
|
+
"August",
|
|
14989
|
+
"September",
|
|
14990
|
+
"October",
|
|
14991
|
+
"November",
|
|
14992
|
+
"December"
|
|
14993
|
+
];
|
|
14994
|
+
const getMonthNameFromNumber = (monthNumber) => {
|
|
14995
|
+
var _a;
|
|
14996
|
+
if (monthNumber < 1 || monthNumber > 12) {
|
|
14997
|
+
return "";
|
|
14998
|
+
}
|
|
14999
|
+
return (_a = monthNames.at(monthNumber - 1)) != null ? _a : "";
|
|
15000
|
+
};
|
|
14790
15001
|
function getBookkeepingStatusConfig({
|
|
14791
15002
|
status,
|
|
14792
15003
|
monthNumber,
|
|
@@ -14855,10 +15066,24 @@ const BookkeepingStatus$1 = ({ status, text, monthNumber, iconOnly }) => {
|
|
|
14855
15066
|
)
|
|
14856
15067
|
] }));
|
|
14857
15068
|
};
|
|
14858
|
-
const BankTransactionsProcessingInfo = (
|
|
14859
|
-
|
|
14860
|
-
|
|
14861
|
-
|
|
15069
|
+
const BankTransactionsProcessingInfo = ({ showAsBadge = false }) => {
|
|
15070
|
+
const tooltipContent = "Our team will review and categorize this transaction. We'll reach out if we have any questions about it.";
|
|
15071
|
+
if (showAsBadge) {
|
|
15072
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", fluid: true, className: "Layer__BankTransactionsProcessingInfo", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15073
|
+
Badge,
|
|
15074
|
+
{
|
|
15075
|
+
size: BadgeSize.SMALL,
|
|
15076
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Clock, { size: 11 }),
|
|
15077
|
+
variant: BadgeVariant.INFO,
|
|
15078
|
+
children: "Processing"
|
|
15079
|
+
}
|
|
15080
|
+
) });
|
|
15081
|
+
}
|
|
15082
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
|
|
15083
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(BookkeepingStatus$1, { status: BookkeepingPeriodStatus.IN_PROGRESS_AWAITING_BOOKKEEPER, text: "Processing" }) }),
|
|
15084
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", width: "md", children: tooltipContent })
|
|
15085
|
+
] });
|
|
15086
|
+
};
|
|
14862
15087
|
const isSplitsValid = (localSplits) => {
|
|
14863
15088
|
return validateSplit(localSplits).reduce((acc, splitError) => acc && splitError === void 0, true);
|
|
14864
15089
|
};
|
|
@@ -15053,8 +15278,8 @@ const useSplitsForm = ({
|
|
|
15053
15278
|
saveLocalSplitsToCategoryStore
|
|
15054
15279
|
};
|
|
15055
15280
|
};
|
|
15056
|
-
const ScissorsFullOpen = (
|
|
15057
|
-
var
|
|
15281
|
+
const ScissorsFullOpen = (_Db) => {
|
|
15282
|
+
var _Eb = _Db, { size = 12 } = _Eb, props = __objRest(_Eb, ["size"]);
|
|
15058
15283
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15059
15284
|
"svg",
|
|
15060
15285
|
__spreadProps(__spreadValues({
|
|
@@ -15119,8 +15344,8 @@ const ScissorsFullOpen = (_zb) => {
|
|
|
15119
15344
|
})
|
|
15120
15345
|
);
|
|
15121
15346
|
};
|
|
15122
|
-
const Trash = (
|
|
15123
|
-
var
|
|
15347
|
+
const Trash = (_Fb) => {
|
|
15348
|
+
var _Gb = _Fb, { size = 18 } = _Gb, props = __objRest(_Gb, ["size"]);
|
|
15124
15349
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15125
15350
|
"svg",
|
|
15126
15351
|
__spreadProps(__spreadValues({
|
|
@@ -15315,8 +15540,8 @@ const ReceiptsProvider = ({
|
|
|
15315
15540
|
const contextData = useReceipts({ bankTransaction, isActive });
|
|
15316
15541
|
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsContext.Provider, { value: contextData, children });
|
|
15317
15542
|
};
|
|
15318
|
-
const Eye = (
|
|
15319
|
-
var
|
|
15543
|
+
const Eye = (_Hb) => {
|
|
15544
|
+
var _Ib = _Hb, { size = 18 } = _Ib, props = __objRest(_Ib, ["size"]);
|
|
15320
15545
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15321
15546
|
"svg",
|
|
15322
15547
|
__spreadProps(__spreadValues({
|
|
@@ -15452,11 +15677,11 @@ const FileThumb = ({
|
|
|
15452
15677
|
}
|
|
15453
15678
|
);
|
|
15454
15679
|
};
|
|
15455
|
-
const TextButton = (
|
|
15456
|
-
var
|
|
15680
|
+
const TextButton = (_Jb) => {
|
|
15681
|
+
var _Kb = _Jb, {
|
|
15457
15682
|
className,
|
|
15458
15683
|
children
|
|
15459
|
-
} =
|
|
15684
|
+
} = _Kb, props = __objRest(_Kb, [
|
|
15460
15685
|
"className",
|
|
15461
15686
|
"children"
|
|
15462
15687
|
]);
|
|
@@ -15540,8 +15765,8 @@ const openReceiptInNewTab = (url, index2) => (e) => {
|
|
|
15540
15765
|
`);
|
|
15541
15766
|
}
|
|
15542
15767
|
};
|
|
15543
|
-
const BankTransactionReceiptsWithProvider = react.forwardRef((
|
|
15544
|
-
var
|
|
15768
|
+
const BankTransactionReceiptsWithProvider = react.forwardRef((_Lb, ref) => {
|
|
15769
|
+
var _Mb = _Lb, { bankTransaction, isActive } = _Mb, props = __objRest(_Mb, ["bankTransaction", "isActive"]);
|
|
15545
15770
|
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive, children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })) });
|
|
15546
15771
|
});
|
|
15547
15772
|
BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
|
|
@@ -15708,8 +15933,8 @@ const transformCurrencyValue = (rawValue) => {
|
|
|
15708
15933
|
}
|
|
15709
15934
|
return cleaned;
|
|
15710
15935
|
};
|
|
15711
|
-
const AmountInput = (
|
|
15712
|
-
var
|
|
15936
|
+
const AmountInput = (_Nb) => {
|
|
15937
|
+
var _Ob = _Nb, {
|
|
15713
15938
|
onChange,
|
|
15714
15939
|
className,
|
|
15715
15940
|
leftText,
|
|
@@ -15717,7 +15942,7 @@ const AmountInput = (_Jb) => {
|
|
|
15717
15942
|
isInvalid,
|
|
15718
15943
|
badge,
|
|
15719
15944
|
placeholder = "$0.00"
|
|
15720
|
-
} =
|
|
15945
|
+
} = _Ob, props = __objRest(_Ob, [
|
|
15721
15946
|
"onChange",
|
|
15722
15947
|
"className",
|
|
15723
15948
|
"leftText",
|
|
@@ -15993,12 +16218,12 @@ const useBankTransactionMemo = ({ bankTransactionId }) => {
|
|
|
15993
16218
|
});
|
|
15994
16219
|
return form;
|
|
15995
16220
|
};
|
|
15996
|
-
const Textarea = (
|
|
15997
|
-
var
|
|
16221
|
+
const Textarea = (_Pb) => {
|
|
16222
|
+
var _Qb = _Pb, {
|
|
15998
16223
|
className,
|
|
15999
16224
|
isInvalid,
|
|
16000
16225
|
errorMessage
|
|
16001
|
-
} =
|
|
16226
|
+
} = _Qb, props = __objRest(_Qb, [
|
|
16002
16227
|
"className",
|
|
16003
16228
|
"isInvalid",
|
|
16004
16229
|
"errorMessage"
|
|
@@ -17550,7 +17775,6 @@ const extractDescriptionForSplit = (category) => {
|
|
|
17550
17775
|
}
|
|
17551
17776
|
return category.entries.map((c) => c.category.display_name).join(", ");
|
|
17552
17777
|
};
|
|
17553
|
-
let clickTimer = Date.now();
|
|
17554
17778
|
const BankTransactionRow = ({
|
|
17555
17779
|
index: index2,
|
|
17556
17780
|
editable,
|
|
@@ -17570,10 +17794,10 @@ const BankTransactionRow = ({
|
|
|
17570
17794
|
const [showRetry, setShowRetry] = react.useState(false);
|
|
17571
17795
|
const { shouldHideAfterCategorize } = useBankTransactionsContext();
|
|
17572
17796
|
const [open, setOpen] = react.useState(false);
|
|
17573
|
-
const toggleOpen = () => {
|
|
17797
|
+
const toggleOpen = react.useCallback(() => {
|
|
17574
17798
|
setShowRetry(false);
|
|
17575
17799
|
setOpen(!open);
|
|
17576
|
-
};
|
|
17800
|
+
}, [open]);
|
|
17577
17801
|
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
17578
17802
|
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
17579
17803
|
const categorized = isCategorized(bankTransaction);
|
|
@@ -17606,16 +17830,12 @@ const BankTransactionRow = ({
|
|
|
17606
17830
|
deselect(bankTransaction.id);
|
|
17607
17831
|
setOpen(false);
|
|
17608
17832
|
});
|
|
17609
|
-
const
|
|
17610
|
-
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
setShowRetry(false);
|
|
17616
|
-
setOpen(true);
|
|
17617
|
-
}
|
|
17618
|
-
}
|
|
17833
|
+
const handleRowClick = () => {
|
|
17834
|
+
setShowRetry(false);
|
|
17835
|
+
toggleOpen();
|
|
17836
|
+
};
|
|
17837
|
+
const preventRowExpansion = (e) => {
|
|
17838
|
+
e.stopPropagation();
|
|
17619
17839
|
};
|
|
17620
17840
|
const className = "Layer__bank-transaction-row";
|
|
17621
17841
|
const openClassName = open ? `${className}--expanded` : "";
|
|
@@ -17632,8 +17852,8 @@ const BankTransactionRow = ({
|
|
|
17632
17852
|
);
|
|
17633
17853
|
const colSpan = categorizationEnabled ? 7 : 6;
|
|
17634
17854
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17635
|
-
/* @__PURE__ */ jsxRuntime.jsxs("tr", { className: rowClassName, children: [
|
|
17636
|
-
categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell Layer__bank-transactions__checkbox-col", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17855
|
+
/* @__PURE__ */ jsxRuntime.jsxs("tr", { className: rowClassName, onClick: handleRowClick, children: [
|
|
17856
|
+
categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell Layer__bank-transactions__checkbox-col", onClick: preventRowExpansion, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17637
17857
|
Checkbox,
|
|
17638
17858
|
{
|
|
17639
17859
|
isSelected: isTransactionSelected,
|
|
@@ -17648,25 +17868,22 @@ const BankTransactionRow = ({
|
|
|
17648
17868
|
) }) }),
|
|
17649
17869
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17650
17870
|
"td",
|
|
17651
|
-
|
|
17652
|
-
className: "Layer__table-cell Layer__bank-transaction-table__date-col"
|
|
17653
|
-
}, openRow), {
|
|
17871
|
+
{
|
|
17872
|
+
className: "Layer__table-cell Layer__bank-transaction-table__date-col",
|
|
17654
17873
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { children: dateFns.format(dateFns.parseISO(bankTransaction.date), dateFormat) }) })
|
|
17655
|
-
}
|
|
17874
|
+
}
|
|
17656
17875
|
),
|
|
17657
17876
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17658
17877
|
"td",
|
|
17659
|
-
|
|
17660
|
-
className: "Layer__table-cell Layer__bank-transactions__tx-col"
|
|
17661
|
-
}, openRow), {
|
|
17878
|
+
{
|
|
17879
|
+
className: "Layer__table-cell Layer__bank-transactions__tx-col",
|
|
17662
17880
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { withTooltip: true, children: (_a = bankTransaction.counterparty_name) != null ? _a : bankTransaction.description }) })
|
|
17663
|
-
}
|
|
17881
|
+
}
|
|
17664
17882
|
),
|
|
17665
17883
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17666
17884
|
"td",
|
|
17667
|
-
|
|
17668
|
-
className: "Layer__table-cell Layer__bank-transactions__account-col"
|
|
17669
|
-
}, openRow), {
|
|
17885
|
+
{
|
|
17886
|
+
className: "Layer__table-cell Layer__bank-transactions__account-col",
|
|
17670
17887
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { align: "start", children: [
|
|
17671
17888
|
/* @__PURE__ */ jsxRuntime.jsxs(Span, { ellipsis: true, children: [
|
|
17672
17889
|
bankTransaction.account_name,
|
|
@@ -17674,13 +17891,13 @@ const BankTransactionRow = ({
|
|
|
17674
17891
|
] }),
|
|
17675
17892
|
((_b = bankTransaction.account_institution) == null ? void 0 : _b.name) && /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, variant: "subtle", size: "sm", children: bankTransaction.account_institution.name })
|
|
17676
17893
|
] }) })
|
|
17677
|
-
}
|
|
17894
|
+
}
|
|
17678
17895
|
),
|
|
17679
17896
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17680
17897
|
"td",
|
|
17681
|
-
__spreadProps(__spreadValues(
|
|
17898
|
+
__spreadProps(__spreadValues({
|
|
17682
17899
|
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"}`
|
|
17683
|
-
},
|
|
17900
|
+
}, showReceiptDataProperties), {
|
|
17684
17901
|
children: /* @__PURE__ */ jsxRuntime.jsx(VStack, { align: "end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17685
17902
|
MoneySpan,
|
|
17686
17903
|
{
|
|
@@ -17708,6 +17925,7 @@ const BankTransactionRow = ({
|
|
|
17708
17925
|
`${className}__actions-cell`,
|
|
17709
17926
|
`${className}__actions-cell--${open ? "open" : "close"}`
|
|
17710
17927
|
),
|
|
17928
|
+
onClick: preventRowExpansion,
|
|
17711
17929
|
children: open ? /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pie: "md", gap: "md", justify: "end", className: "Layer__bank-transaction-row__category-open", children: [
|
|
17712
17930
|
bankTransaction.error && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17713
17931
|
Text,
|
|
@@ -17971,6 +18189,9 @@ const BankTransactionsListItem = ({
|
|
|
17971
18189
|
const handleSave = () => {
|
|
17972
18190
|
void save();
|
|
17973
18191
|
};
|
|
18192
|
+
const preventRowExpansion = (e) => {
|
|
18193
|
+
e.stopPropagation();
|
|
18194
|
+
};
|
|
17974
18195
|
const openClassName = openExpandedRow ? "Layer__bank-transaction-list-item--expanded" : "";
|
|
17975
18196
|
const rowClassName = classNames(
|
|
17976
18197
|
"Layer__bank-transaction-list-item",
|
|
@@ -17978,7 +18199,7 @@ const BankTransactionsListItem = ({
|
|
|
17978
18199
|
openExpandedRow ? openClassName : "",
|
|
17979
18200
|
isVisible ? "show" : ""
|
|
17980
18201
|
);
|
|
17981
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: rowClassName, children: [
|
|
18202
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: rowClassName, onClick: toggleExpandedRow, children: [
|
|
17982
18203
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "Layer__bank-transaction-list-item__heading", children: [
|
|
17983
18204
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__bank-transaction-list-item__heading__main", children: [
|
|
17984
18205
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: "sm", children: dateFns.format(dateFns.parseISO(bankTransaction.date), dateFormat) }),
|
|
@@ -18009,7 +18230,7 @@ const BankTransactionsListItem = ({
|
|
|
18009
18230
|
] }),
|
|
18010
18231
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { className: "Layer__bank-transaction-list-item__body", children: [
|
|
18011
18232
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "Layer__bank-transaction-list-item__body__name", children: [
|
|
18012
|
-
categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transaction-list-item__checkbox", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18233
|
+
categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transaction-list-item__checkbox", onClick: preventRowExpansion, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18013
18234
|
Checkbox,
|
|
18014
18235
|
{
|
|
18015
18236
|
isSelected: isTransactionSelected,
|
|
@@ -18034,7 +18255,7 @@ const BankTransactionsListItem = ({
|
|
|
18034
18255
|
)
|
|
18035
18256
|
] }),
|
|
18036
18257
|
!categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__bank-transaction-list-item__processing-info", children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, {}) }),
|
|
18037
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", children: /* @__PURE__ */ jsxRuntime.jsx(AnimatedPresenceDiv, { variant: "expand", isOpen: openExpandedRow, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18258
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", onClick: preventRowExpansion, children: /* @__PURE__ */ jsxRuntime.jsx(AnimatedPresenceDiv, { variant: "expand", isOpen: openExpandedRow, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18038
18259
|
ExpandedBankTransactionRow,
|
|
18039
18260
|
{
|
|
18040
18261
|
ref: expandedRowRef,
|
|
@@ -18051,7 +18272,7 @@ const BankTransactionsListItem = ({
|
|
|
18051
18272
|
variant: "list"
|
|
18052
18273
|
}
|
|
18053
18274
|
) }, `expanded-${bankTransaction.id}`) }),
|
|
18054
|
-
!openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
|
|
18275
|
+
!openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: preventRowExpansion, children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
|
|
18055
18276
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18056
18277
|
BankTransactionCategoryComboBox,
|
|
18057
18278
|
{
|
|
@@ -18077,7 +18298,7 @@ const BankTransactionsListItem = ({
|
|
|
18077
18298
|
children: showRetry ? "Retry" : !categorized ? (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Approve" : (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update"
|
|
18078
18299
|
}
|
|
18079
18300
|
)
|
|
18080
|
-
] }),
|
|
18301
|
+
] }) }),
|
|
18081
18302
|
!openExpandedRow && categorized && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18082
18303
|
BankTransactionsListItemCategory,
|
|
18083
18304
|
{
|
|
@@ -18145,10 +18366,10 @@ const BankTransactionsList = ({
|
|
|
18145
18366
|
] });
|
|
18146
18367
|
};
|
|
18147
18368
|
const SWITCH_CLASS_NAME = "Layer__Switch";
|
|
18148
|
-
const Switch = react.forwardRef((
|
|
18149
|
-
var
|
|
18369
|
+
const Switch = react.forwardRef((_Rb, ref) => {
|
|
18370
|
+
var _Sb = _Rb, {
|
|
18150
18371
|
children
|
|
18151
|
-
} =
|
|
18372
|
+
} = _Sb, props = __objRest(_Sb, [
|
|
18152
18373
|
"children"
|
|
18153
18374
|
]);
|
|
18154
18375
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18287,8 +18508,8 @@ const BankTransactionsMobileListItemCheckbox = ({
|
|
|
18287
18508
|
}
|
|
18288
18509
|
) });
|
|
18289
18510
|
};
|
|
18290
|
-
const Paperclip = (
|
|
18291
|
-
var
|
|
18511
|
+
const Paperclip = (_Tb) => {
|
|
18512
|
+
var _Ub = _Tb, { size = 20 } = _Ub, props = __objRest(_Ub, ["size"]);
|
|
18292
18513
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18293
18514
|
"svg",
|
|
18294
18515
|
__spreadProps(__spreadValues({
|
|
@@ -18377,168 +18598,6 @@ const BusinessFormMobile = ({
|
|
|
18377
18598
|
)
|
|
18378
18599
|
] });
|
|
18379
18600
|
};
|
|
18380
|
-
const ActionableList = ({
|
|
18381
|
-
options: options2,
|
|
18382
|
-
onClick,
|
|
18383
|
-
selectedId,
|
|
18384
|
-
showDescriptions = false,
|
|
18385
|
-
className
|
|
18386
|
-
}) => {
|
|
18387
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classNames("Layer__actionable-list", className), children: options2.map((x, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18388
|
-
"li",
|
|
18389
|
-
{
|
|
18390
|
-
role: "button",
|
|
18391
|
-
onClick: () => onClick(x),
|
|
18392
|
-
className: classNames(
|
|
18393
|
-
x.secondary && "Layer__actionable-list-item--secondary",
|
|
18394
|
-
x.asLink && "Layer__actionable-list-item--as-link",
|
|
18395
|
-
selectedId === x.id && "Layer__actionable-list__item--selected"
|
|
18396
|
-
),
|
|
18397
|
-
children: [
|
|
18398
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__actionable-list__content", children: [
|
|
18399
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, children: x.label }),
|
|
18400
|
-
/* TODO: Replace 'See all categories' with something more generic */
|
|
18401
|
-
showDescriptions && x.description && x.label !== "See all categories" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18402
|
-
Text,
|
|
18403
|
-
{
|
|
18404
|
-
className: "Layer__actionable-list__content-description",
|
|
18405
|
-
size: TextSize.sm,
|
|
18406
|
-
children: x.description
|
|
18407
|
-
}
|
|
18408
|
-
)
|
|
18409
|
-
] }),
|
|
18410
|
-
!x.asLink && selectedId && selectedId === x.id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__actionable-list__select Layer__actionable-list__select--selected", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18411
|
-
Check,
|
|
18412
|
-
{
|
|
18413
|
-
size: 14,
|
|
18414
|
-
className: "Layer__actionable-list__selected-icon"
|
|
18415
|
-
}
|
|
18416
|
-
) }) : null,
|
|
18417
|
-
!x.asLink && (!selectedId || selectedId !== x.id) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__actionable-list__select" }) : null,
|
|
18418
|
-
x.asLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18419
|
-
ChevronRight,
|
|
18420
|
-
{
|
|
18421
|
-
size: 16,
|
|
18422
|
-
className: "Layer__actionable-list__link-icon"
|
|
18423
|
-
}
|
|
18424
|
-
)
|
|
18425
|
-
]
|
|
18426
|
-
},
|
|
18427
|
-
`actionable-list-item-${idx}`
|
|
18428
|
-
)) });
|
|
18429
|
-
};
|
|
18430
|
-
function getLeafCategories(category) {
|
|
18431
|
-
if (!category.subCategories || category.subCategories.length === 0) {
|
|
18432
|
-
return [category];
|
|
18433
|
-
}
|
|
18434
|
-
return category.subCategories.flatMap((subCategory) => getLeafCategories(subCategory));
|
|
18435
|
-
}
|
|
18436
|
-
const flattenCategories = (categories) => {
|
|
18437
|
-
return categories.flatMap((category) => {
|
|
18438
|
-
const subCategories = category.subCategories;
|
|
18439
|
-
if (!subCategories || subCategories.length === 0) {
|
|
18440
|
-
return [new CategoryAsOption(category)];
|
|
18441
|
-
}
|
|
18442
|
-
const leafCategories = getLeafCategories(category);
|
|
18443
|
-
if (subCategories.every((subCategory) => !subCategory.subCategories || subCategory.subCategories.length === 0)) {
|
|
18444
|
-
return [{
|
|
18445
|
-
label: category.displayName,
|
|
18446
|
-
id: "id" in category ? category.id : category.stableName,
|
|
18447
|
-
categories: leafCategories.map((cat) => new CategoryAsOption(cat))
|
|
18448
|
-
}];
|
|
18449
|
-
}
|
|
18450
|
-
return leafCategories.map((cat) => new CategoryAsOption(cat));
|
|
18451
|
-
});
|
|
18452
|
-
};
|
|
18453
|
-
const isGroup = (item) => {
|
|
18454
|
-
return "categories" in item;
|
|
18455
|
-
};
|
|
18456
|
-
const BankTransactionsMobileListBusinessCategories = ({
|
|
18457
|
-
select,
|
|
18458
|
-
selectedId,
|
|
18459
|
-
showTooltips
|
|
18460
|
-
}) => {
|
|
18461
|
-
const { data: categories } = useCategories();
|
|
18462
|
-
const [query, setQuery] = react.useState("");
|
|
18463
|
-
const categoryOptions = react.useMemo(
|
|
18464
|
-
() => flattenCategories(
|
|
18465
|
-
(categories != null ? categories : []).filter((category) => category.type != "ExclusionNested")
|
|
18466
|
-
),
|
|
18467
|
-
[categories]
|
|
18468
|
-
);
|
|
18469
|
-
const [optionsToShow, setOptionsToShow] = react.useState(categoryOptions);
|
|
18470
|
-
const [selectedGroup, setSelectedGroup] = react.useState();
|
|
18471
|
-
const filteredOptions = react.useMemo(() => {
|
|
18472
|
-
let options2 = optionsToShow;
|
|
18473
|
-
if (query) {
|
|
18474
|
-
const lower = query.toLowerCase();
|
|
18475
|
-
options2 = options2.flatMap((opt) => {
|
|
18476
|
-
if (isGroup(opt)) {
|
|
18477
|
-
return opt.categories.filter(
|
|
18478
|
-
(cat) => cat.label.toLowerCase().includes(lower)
|
|
18479
|
-
);
|
|
18480
|
-
}
|
|
18481
|
-
return opt.label.toLowerCase().includes(lower) ? [opt] : [];
|
|
18482
|
-
});
|
|
18483
|
-
}
|
|
18484
|
-
return options2.sort((a, b) => a.label.localeCompare(b.label)).map((opt) => {
|
|
18485
|
-
var _a;
|
|
18486
|
-
return isGroup(opt) ? { label: opt.label, id: opt.id, value: opt, asLink: true } : { label: opt.label, id: opt.value, description: (_a = opt.original.description) != null ? _a : void 0, value: opt };
|
|
18487
|
-
});
|
|
18488
|
-
}, [optionsToShow, query]);
|
|
18489
|
-
const onCategorySelect = (item) => {
|
|
18490
|
-
if (isGroup(item.value)) {
|
|
18491
|
-
setOptionsToShow(item.value.categories);
|
|
18492
|
-
setSelectedGroup(item.value.label);
|
|
18493
|
-
setQuery("");
|
|
18494
|
-
return;
|
|
18495
|
-
}
|
|
18496
|
-
select(item.value);
|
|
18497
|
-
};
|
|
18498
|
-
const clearSelectedGroup = react.useCallback(() => {
|
|
18499
|
-
setOptionsToShow(categoryOptions);
|
|
18500
|
-
setSelectedGroup(void 0);
|
|
18501
|
-
setQuery("");
|
|
18502
|
-
}, [categoryOptions]);
|
|
18503
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { className: "Layer__bank-transaction-mobile-list-item__categories_list-container", pbs: "lg", gap: "md", children: [
|
|
18504
|
-
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { pis: "sm", pie: "sm", gap: "md", children: [
|
|
18505
|
-
/* @__PURE__ */ jsxRuntime.jsx(HStack, { pis: "xs", children: selectedGroup ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "text", onClick: clearSelectedGroup, children: [
|
|
18506
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { size: 18 }),
|
|
18507
|
-
/* @__PURE__ */ jsxRuntime.jsx(ModalHeading, { size: "sm", weight: "bold", align: "center", children: selectedGroup })
|
|
18508
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(ModalHeading, { size: "sm", weight: "bold", children: "Select category" }) }),
|
|
18509
|
-
/* @__PURE__ */ jsxRuntime.jsx(SearchField, { value: query, onChange: setQuery, label: "Search categories..." })
|
|
18510
|
-
] }),
|
|
18511
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18512
|
-
ActionableList,
|
|
18513
|
-
{
|
|
18514
|
-
options: filteredOptions,
|
|
18515
|
-
onClick: onCategorySelect,
|
|
18516
|
-
selectedId,
|
|
18517
|
-
showDescriptions: showTooltips,
|
|
18518
|
-
className: "Layer__bank-transaction-mobile-list-item__categories_list"
|
|
18519
|
-
}
|
|
18520
|
-
)
|
|
18521
|
-
] });
|
|
18522
|
-
};
|
|
18523
|
-
const CategorySelectDrawer = ({
|
|
18524
|
-
onSelect,
|
|
18525
|
-
selectedId,
|
|
18526
|
-
showTooltips,
|
|
18527
|
-
isOpen,
|
|
18528
|
-
onOpenChange
|
|
18529
|
-
}) => {
|
|
18530
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen, onOpenChange, variant: "mobile-drawer", isDismissable: true, children: ({ close: close2 }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
18531
|
-
BankTransactionsMobileListBusinessCategories,
|
|
18532
|
-
{
|
|
18533
|
-
select: (option) => {
|
|
18534
|
-
onSelect(option);
|
|
18535
|
-
close2();
|
|
18536
|
-
},
|
|
18537
|
-
selectedId,
|
|
18538
|
-
showTooltips
|
|
18539
|
-
}
|
|
18540
|
-
) });
|
|
18541
|
-
};
|
|
18542
18601
|
const SELECT_CATEGORY_VALUE = "SELECT_CATEGORY";
|
|
18543
18602
|
const isSelectCategoryOption = (value) => {
|
|
18544
18603
|
return isPlaceholderAsOption(value) && value.value === SELECT_CATEGORY_VALUE;
|
|
@@ -18555,6 +18614,10 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
18555
18614
|
const [sessionCategories, setSessionCategories] = react.useState(() => {
|
|
18556
18615
|
var _a;
|
|
18557
18616
|
const initialMap = /* @__PURE__ */ new Map();
|
|
18617
|
+
if (bankTransaction.category) {
|
|
18618
|
+
const existingCategory = convertApiCategorizationToCategoryOrSplitAsOption(bankTransaction.category);
|
|
18619
|
+
initialMap.set(existingCategory.value, existingCategory);
|
|
18620
|
+
}
|
|
18558
18621
|
if (((_a = bankTransaction == null ? void 0 : bankTransaction.categorization_flow) == null ? void 0 : _a.type) === CategorizationType.ASK_FROM_SUGGESTIONS) {
|
|
18559
18622
|
bankTransaction.categorization_flow.suggestions.forEach((suggestion) => {
|
|
18560
18623
|
const opt = new ApiCategorizationAsOption(suggestion);
|
|
@@ -18823,7 +18886,7 @@ const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
|
|
|
18823
18886
|
}
|
|
18824
18887
|
}
|
|
18825
18888
|
),
|
|
18826
|
-
inAppLink
|
|
18889
|
+
inAppLink && /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", children: inAppLink }) })
|
|
18827
18890
|
] })
|
|
18828
18891
|
},
|
|
18829
18892
|
match.id
|
|
@@ -18968,39 +19031,6 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
18968
19031
|
showRetry && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
18969
19032
|
] });
|
|
18970
19033
|
};
|
|
18971
|
-
const CategorySelectDrawerWithTrigger = ({ value, onChange, showTooltips }) => {
|
|
18972
|
-
var _a;
|
|
18973
|
-
const [isDrawerOpen, setIsDrawerOpen] = react.useState(false);
|
|
18974
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { fluid: true, children: [
|
|
18975
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
18976
|
-
Button,
|
|
18977
|
-
{
|
|
18978
|
-
flex: true,
|
|
18979
|
-
fullWidth: true,
|
|
18980
|
-
"aria-label": "Select category",
|
|
18981
|
-
onClick: () => {
|
|
18982
|
-
setIsDrawerOpen(true);
|
|
18983
|
-
},
|
|
18984
|
-
variant: "outlined",
|
|
18985
|
-
children: [
|
|
18986
|
-
/* @__PURE__ */ jsxRuntime.jsx(Span, { children: (_a = value == null ? void 0 : value.label) != null ? _a : "Select..." }),
|
|
18987
|
-
/* @__PURE__ */ jsxRuntime.jsx(Spacer, {}),
|
|
18988
|
-
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 16 })
|
|
18989
|
-
]
|
|
18990
|
-
}
|
|
18991
|
-
),
|
|
18992
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18993
|
-
CategorySelectDrawer,
|
|
18994
|
-
{
|
|
18995
|
-
onSelect: onChange,
|
|
18996
|
-
selectedId: value == null ? void 0 : value.value,
|
|
18997
|
-
showTooltips,
|
|
18998
|
-
isOpen: isDrawerOpen,
|
|
18999
|
-
onOpenChange: setIsDrawerOpen
|
|
19000
|
-
}
|
|
19001
|
-
)
|
|
19002
|
-
] });
|
|
19003
|
-
};
|
|
19004
19034
|
const BankTransactionsMobileListSplitForm = ({
|
|
19005
19035
|
bankTransaction,
|
|
19006
19036
|
showTooltips,
|
|
@@ -19269,6 +19299,7 @@ const PURPOSE_TOGGLE_OPTIONS = [
|
|
|
19269
19299
|
];
|
|
19270
19300
|
const BankTransactionsMobileListItemExpandedRow = ({
|
|
19271
19301
|
bankTransaction,
|
|
19302
|
+
isOpen,
|
|
19272
19303
|
showCategorization,
|
|
19273
19304
|
showDescriptions,
|
|
19274
19305
|
showReceiptUploads,
|
|
@@ -19290,6 +19321,7 @@ const BankTransactionsMobileListItemExpandedRow = ({
|
|
|
19290
19321
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19291
19322
|
BankTransactionsMobileForms,
|
|
19292
19323
|
{
|
|
19324
|
+
isOpen,
|
|
19293
19325
|
purpose,
|
|
19294
19326
|
bankTransaction,
|
|
19295
19327
|
showCategorization,
|
|
@@ -19332,20 +19364,15 @@ var Purpose = /* @__PURE__ */ ((Purpose2) => {
|
|
|
19332
19364
|
Purpose2["more"] = "more";
|
|
19333
19365
|
return Purpose2;
|
|
19334
19366
|
})(Purpose || {});
|
|
19335
|
-
const
|
|
19336
|
-
var _a
|
|
19337
|
-
if (bankTransaction.categorization_status === CategorizationStatus.
|
|
19338
|
-
|
|
19339
|
-
|
|
19340
|
-
|
|
19341
|
-
if (renderInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
|
|
19342
|
-
const matchDetails = bankTransaction.match.details ? decodeMatchDetails(bankTransaction.match.details) : void 0;
|
|
19343
|
-
const inAppLink = matchDetails ? renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails)) : void 0;
|
|
19344
|
-
if (inAppLink) return inAppLink;
|
|
19367
|
+
const getInAppLink = (bankTransaction, renderInAppLink) => {
|
|
19368
|
+
var _a;
|
|
19369
|
+
if (bankTransaction.categorization_status === CategorizationStatus.MATCHED && renderInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
|
|
19370
|
+
const matchDetails = decodeMatchDetails(bankTransaction.match.details);
|
|
19371
|
+
if (matchDetails) {
|
|
19372
|
+
return renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails));
|
|
19345
19373
|
}
|
|
19346
|
-
return (_c = (_b = bankTransaction.match) == null ? void 0 : _b.details) == null ? void 0 : _c.description;
|
|
19347
19374
|
}
|
|
19348
|
-
return
|
|
19375
|
+
return null;
|
|
19349
19376
|
};
|
|
19350
19377
|
const BankTransactionsMobileListItem = ({
|
|
19351
19378
|
index: index2,
|
|
@@ -19453,6 +19480,12 @@ const BankTransactionsMobileListItem = ({
|
|
|
19453
19480
|
const isSelected = useIdIsSelected();
|
|
19454
19481
|
const isTransactionSelected = isSelected(bankTransaction.id);
|
|
19455
19482
|
const { renderInAppLink } = useInAppLinkContext();
|
|
19483
|
+
const inAppLink = react.useMemo(() => {
|
|
19484
|
+
if (!categorized) {
|
|
19485
|
+
return null;
|
|
19486
|
+
}
|
|
19487
|
+
return getInAppLink(bankTransaction, renderInAppLink);
|
|
19488
|
+
}, [categorized, bankTransaction, renderInAppLink]);
|
|
19456
19489
|
const { isVisible } = useDelayedVisibility({ delay: index2 * 20, initialVisibility: Boolean(initialLoad) });
|
|
19457
19490
|
const className = "Layer__bank-transaction-mobile-list-item";
|
|
19458
19491
|
const openClassName = open ? `${className}--expanded` : "";
|
|
@@ -19471,9 +19504,8 @@ const BankTransactionsMobileListItem = ({
|
|
|
19471
19504
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19472
19505
|
HStack,
|
|
19473
19506
|
{
|
|
19474
|
-
gap: "
|
|
19507
|
+
gap: "sm",
|
|
19475
19508
|
justify: "space-between",
|
|
19476
|
-
align: "center",
|
|
19477
19509
|
pie: "md",
|
|
19478
19510
|
children: [
|
|
19479
19511
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", overflow: "hidden", children: [
|
|
@@ -19490,12 +19522,12 @@ const BankTransactionsMobileListItem = ({
|
|
|
19490
19522
|
{
|
|
19491
19523
|
align: "start",
|
|
19492
19524
|
gap: "3xs",
|
|
19493
|
-
className: "
|
|
19525
|
+
className: "Layer__BankTransactionsMobileListItem__HeadingContentLeft",
|
|
19494
19526
|
pi: "md",
|
|
19495
19527
|
pb: "sm",
|
|
19496
19528
|
children: [
|
|
19497
19529
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description }),
|
|
19498
|
-
/* @__PURE__ */ jsxRuntime.jsx(Span, { className: "
|
|
19530
|
+
inAppLink && /* @__PURE__ */ jsxRuntime.jsx(Span, { className: "Layer__BankTransactionsMobileListItem__CategorizedValue", children: inAppLink }),
|
|
19499
19531
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "2xs", align: "center", children: [
|
|
19500
19532
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", ellipsis: true, children: fullAccountName }),
|
|
19501
19533
|
hasReceipts(bankTransaction) ? /* @__PURE__ */ jsxRuntime.jsx(File, { size: 12 }) : null
|
|
@@ -19520,7 +19552,7 @@ const BankTransactionsMobileListItem = ({
|
|
|
19520
19552
|
]
|
|
19521
19553
|
}
|
|
19522
19554
|
),
|
|
19523
|
-
!open && (!categorizationEnabled && !categorized ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
19555
|
+
!open && (!categorizationEnabled && !categorized ? /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, { showAsBadge: true }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
19524
19556
|
BankTransactionsListItemCategory,
|
|
19525
19557
|
{
|
|
19526
19558
|
bankTransaction,
|
|
@@ -19534,6 +19566,7 @@ const BankTransactionsMobileListItem = ({
|
|
|
19534
19566
|
BankTransactionsMobileListItemExpandedRow,
|
|
19535
19567
|
{
|
|
19536
19568
|
bankTransaction,
|
|
19569
|
+
isOpen: open,
|
|
19537
19570
|
showCategorization: categorizationEnabled,
|
|
19538
19571
|
showDescriptions,
|
|
19539
19572
|
showReceiptUploads,
|
|
@@ -19554,6 +19587,7 @@ const BankTransactionsMobileList = ({
|
|
|
19554
19587
|
const transactionToOpenContextData = useTransactionToOpen();
|
|
19555
19588
|
const [bulkActionsEnabled, setBulkActionsEnabled] = react.useState(false);
|
|
19556
19589
|
const { clearSelection } = useBulkSelectionActions();
|
|
19590
|
+
useUpsertBankTransactionsDefaultCategories(bankTransactions);
|
|
19557
19591
|
react.useEffect(() => {
|
|
19558
19592
|
if (!bulkActionsEnabled) {
|
|
19559
19593
|
clearSelection();
|
|
@@ -19732,8 +19766,8 @@ const BankTransactionsTable = ({
|
|
|
19732
19766
|
}
|
|
19733
19767
|
);
|
|
19734
19768
|
};
|
|
19735
|
-
const BackArrow = (
|
|
19736
|
-
var
|
|
19769
|
+
const BackArrow = (_Vb) => {
|
|
19770
|
+
var _Wb = _Vb, { size = 18 } = _Wb, props = __objRest(_Wb, ["size"]);
|
|
19737
19771
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19738
19772
|
"svg",
|
|
19739
19773
|
__spreadProps(__spreadValues({
|
|
@@ -19901,8 +19935,8 @@ const usePaginationRange = ({
|
|
|
19901
19935
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
19902
19936
|
return paginationRange;
|
|
19903
19937
|
};
|
|
19904
|
-
const ChevronLeft = (
|
|
19905
|
-
var props = __objRest(
|
|
19938
|
+
const ChevronLeft = (_Xb) => {
|
|
19939
|
+
var props = __objRest(_Xb, []);
|
|
19906
19940
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19907
19941
|
"svg",
|
|
19908
19942
|
__spreadProps(__spreadValues({
|
|
@@ -19924,8 +19958,8 @@ const ChevronLeft = (_Tb) => {
|
|
|
19924
19958
|
})
|
|
19925
19959
|
);
|
|
19926
19960
|
};
|
|
19927
|
-
const PaginationButton = (
|
|
19928
|
-
var
|
|
19961
|
+
const PaginationButton = (_Yb) => {
|
|
19962
|
+
var _Zb = _Yb, { children, isSelected } = _Zb, buttonProps = __objRest(_Zb, ["children", "isSelected"]);
|
|
19929
19963
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19930
19964
|
Button,
|
|
19931
19965
|
__spreadProps(__spreadValues({
|
|
@@ -20354,8 +20388,8 @@ function usePreloadTagDimensions(parameters) {
|
|
|
20354
20388
|
useTagDimensions(parameters);
|
|
20355
20389
|
}
|
|
20356
20390
|
const COMPONENT_NAME$c = "bank-transactions";
|
|
20357
|
-
const BankTransactions = (
|
|
20358
|
-
var
|
|
20391
|
+
const BankTransactions = (__b) => {
|
|
20392
|
+
var _$b = __b, {
|
|
20359
20393
|
onError,
|
|
20360
20394
|
showTags = false,
|
|
20361
20395
|
showCustomerVendor = false,
|
|
@@ -20363,7 +20397,7 @@ const BankTransactions = (_Wb) => {
|
|
|
20363
20397
|
applyGlobalDateRange = false,
|
|
20364
20398
|
mode,
|
|
20365
20399
|
renderInAppLink
|
|
20366
|
-
} =
|
|
20400
|
+
} = _$b, props = __objRest(_$b, [
|
|
20367
20401
|
"onError",
|
|
20368
20402
|
"showTags",
|
|
20369
20403
|
"showCustomerVendor",
|
|
@@ -20593,7 +20627,7 @@ const BankTransactionsTableView = ({
|
|
|
20593
20627
|
}
|
|
20594
20628
|
)
|
|
20595
20629
|
] }),
|
|
20596
|
-
!isLoadingWithoutData && listView && mobileComponent !== "mobileList"
|
|
20630
|
+
!isLoadingWithoutData && listView && mobileComponent !== "mobileList" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__bank-transactions__list-wrapper", children: [
|
|
20597
20631
|
rulesSuggestionModal,
|
|
20598
20632
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20599
20633
|
BankTransactionsList,
|
|
@@ -20608,8 +20642,8 @@ const BankTransactionsTableView = ({
|
|
|
20608
20642
|
showTooltips
|
|
20609
20643
|
}
|
|
20610
20644
|
)
|
|
20611
|
-
] })
|
|
20612
|
-
!isLoadingWithoutData && listView && mobileComponent === "mobileList"
|
|
20645
|
+
] }),
|
|
20646
|
+
!isLoadingWithoutData && listView && mobileComponent === "mobileList" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20613
20647
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20614
20648
|
BankTransactionsMobileList,
|
|
20615
20649
|
{
|
|
@@ -20622,9 +20656,9 @@ const BankTransactionsTableView = ({
|
|
|
20622
20656
|
}
|
|
20623
20657
|
),
|
|
20624
20658
|
rulesSuggestionDrawer
|
|
20625
|
-
] })
|
|
20626
|
-
listView && isLoadingWithoutData
|
|
20627
|
-
!isSyncing || listView
|
|
20659
|
+
] }),
|
|
20660
|
+
listView && isLoadingWithoutData && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transactions__list-loader", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, {}) }),
|
|
20661
|
+
(!isSyncing || listView) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20628
20662
|
BankTransactionsTableEmptyStates,
|
|
20629
20663
|
{
|
|
20630
20664
|
hasVisibleTransactions: ((_a = bankTransactions == null ? void 0 : bankTransactions.length) != null ? _a : 0) > 0,
|
|
@@ -20633,7 +20667,7 @@ const BankTransactionsTableView = ({
|
|
|
20633
20667
|
isFiltered: Boolean(filters == null ? void 0 : filters.query),
|
|
20634
20668
|
isLoadingWithoutData
|
|
20635
20669
|
}
|
|
20636
|
-
)
|
|
20670
|
+
),
|
|
20637
20671
|
!isMonthlyViewMode && /* @__PURE__ */ jsxRuntime.jsx(HStack, { justify: "end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20638
20672
|
Pagination,
|
|
20639
20673
|
{
|
|
@@ -20728,8 +20762,8 @@ function QuickbooksContextProvider({ children }) {
|
|
|
20728
20762
|
const quickbooksContextData = useQuickbooks();
|
|
20729
20763
|
return /* @__PURE__ */ jsxRuntime.jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
|
|
20730
20764
|
}
|
|
20731
|
-
const Cog = (
|
|
20732
|
-
var
|
|
20765
|
+
const Cog = (_ac) => {
|
|
20766
|
+
var _bc = _ac, { size = 12 } = _bc, props = __objRest(_bc, ["size"]);
|
|
20733
20767
|
const id = react.useId();
|
|
20734
20768
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20735
20769
|
"svg",
|
|
@@ -20750,8 +20784,8 @@ const Cog = (_Yb) => {
|
|
|
20750
20784
|
})
|
|
20751
20785
|
);
|
|
20752
20786
|
};
|
|
20753
|
-
const QuickbooksIcon = (
|
|
20754
|
-
var
|
|
20787
|
+
const QuickbooksIcon = (_cc) => {
|
|
20788
|
+
var _dc = _cc, { size = 24 } = _dc, props = __objRest(_dc, ["size"]);
|
|
20755
20789
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20756
20790
|
"svg",
|
|
20757
20791
|
__spreadProps(__spreadValues({
|
|
@@ -20910,8 +20944,8 @@ function IntegrationsQuickbooksUnlinkConfirmationModal({ isOpen, onOpenChange })
|
|
|
20910
20944
|
}
|
|
20911
20945
|
);
|
|
20912
20946
|
}
|
|
20913
|
-
const MoreVertical = (
|
|
20914
|
-
var
|
|
20947
|
+
const MoreVertical = (_ec) => {
|
|
20948
|
+
var _fc = _ec, { size = 18 } = _fc, props = __objRest(_fc, ["size"]);
|
|
20915
20949
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20916
20950
|
"svg",
|
|
20917
20951
|
__spreadProps(__spreadValues({
|
|
@@ -21140,8 +21174,8 @@ const IntegrationsComponent = ({
|
|
|
21140
21174
|
(quickbooksConnectionStatus == null ? void 0 : quickbooksConnectionStatus.is_connected) && /* @__PURE__ */ jsxRuntime.jsx(IntegrationsContent, {})
|
|
21141
21175
|
] });
|
|
21142
21176
|
};
|
|
21143
|
-
const PlusIcon = (
|
|
21144
|
-
var
|
|
21177
|
+
const PlusIcon = (_gc) => {
|
|
21178
|
+
var _hc = _gc, { size = 14 } = _hc, props = __objRest(_hc, ["size"]);
|
|
21145
21179
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21146
21180
|
"svg",
|
|
21147
21181
|
__spreadProps(__spreadValues({
|
|
@@ -21183,8 +21217,8 @@ const PlusIcon = (_cc) => {
|
|
|
21183
21217
|
})
|
|
21184
21218
|
);
|
|
21185
21219
|
};
|
|
21186
|
-
const InstitutionIcon = (
|
|
21187
|
-
var
|
|
21220
|
+
const InstitutionIcon = (_ic) => {
|
|
21221
|
+
var _jc = _ic, { size = 18 } = _jc, props = __objRest(_jc, ["size"]);
|
|
21188
21222
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21189
21223
|
"svg",
|
|
21190
21224
|
__spreadProps(__spreadValues({
|
|
@@ -21491,10 +21525,10 @@ const InstitutionIcon = (_ec) => {
|
|
|
21491
21525
|
})
|
|
21492
21526
|
);
|
|
21493
21527
|
};
|
|
21494
|
-
const CLASS_NAME$
|
|
21528
|
+
const CLASS_NAME$4 = "Layer__BasicLinkedAccountContainer";
|
|
21495
21529
|
function BasicLinkedAccountContainer({ children, isSelected }) {
|
|
21496
21530
|
const dataProperties = toDataProperties({ selected: isSelected });
|
|
21497
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$
|
|
21531
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$4, children }));
|
|
21498
21532
|
}
|
|
21499
21533
|
function BasicLinkedAccountLogo({ account }) {
|
|
21500
21534
|
var _a, _b, _c;
|
|
@@ -21802,8 +21836,8 @@ const MenuItem = react.forwardRef(
|
|
|
21802
21836
|
);
|
|
21803
21837
|
const PILL_CLASS_NAME = "Layer__Pill";
|
|
21804
21838
|
const Pill = react.forwardRef(
|
|
21805
|
-
function Pill2(
|
|
21806
|
-
var
|
|
21839
|
+
function Pill2(_kc, ref) {
|
|
21840
|
+
var _lc = _kc, { children, status } = _lc, restProps = __objRest(_lc, ["children", "status"]);
|
|
21807
21841
|
const dataProperties = toDataProperties({ status });
|
|
21808
21842
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21809
21843
|
reactAriaComponents.Button,
|
|
@@ -22166,8 +22200,8 @@ const LinkedAccountsContent = ({
|
|
|
22166
22200
|
};
|
|
22167
22201
|
const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
|
|
22168
22202
|
const Calendar = react.forwardRef(
|
|
22169
|
-
function Calendar2(
|
|
22170
|
-
var
|
|
22203
|
+
function Calendar2(_mc, ref) {
|
|
22204
|
+
var _nc = _mc, { className, isReadOnly } = _nc, restProps = __objRest(_nc, ["className", "isReadOnly"]);
|
|
22171
22205
|
const dataProperties = toDataProperties({ readonly: isReadOnly });
|
|
22172
22206
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22173
22207
|
reactAriaComponents.Calendar,
|
|
@@ -22181,8 +22215,8 @@ const Calendar = react.forwardRef(
|
|
|
22181
22215
|
);
|
|
22182
22216
|
const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
|
|
22183
22217
|
const CalendarGrid = react.forwardRef(
|
|
22184
|
-
function CalendarGrid2(
|
|
22185
|
-
var
|
|
22218
|
+
function CalendarGrid2(_oc, ref) {
|
|
22219
|
+
var _pc = _oc, { className } = _pc, restProps = __objRest(_pc, ["className"]);
|
|
22186
22220
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22187
22221
|
reactAriaComponents.CalendarGrid,
|
|
22188
22222
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -22194,8 +22228,8 @@ const CalendarGrid = react.forwardRef(
|
|
|
22194
22228
|
);
|
|
22195
22229
|
const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
|
|
22196
22230
|
const CalendarGridBody = react.forwardRef(
|
|
22197
|
-
function CalendarGridBody2(
|
|
22198
|
-
var
|
|
22231
|
+
function CalendarGridBody2(_qc, ref) {
|
|
22232
|
+
var _rc = _qc, { className } = _rc, restProps = __objRest(_rc, ["className"]);
|
|
22199
22233
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22200
22234
|
reactAriaComponents.CalendarGridBody,
|
|
22201
22235
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -22207,8 +22241,8 @@ const CalendarGridBody = react.forwardRef(
|
|
|
22207
22241
|
);
|
|
22208
22242
|
const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
|
|
22209
22243
|
const CalendarCell = react.forwardRef(
|
|
22210
|
-
function CalendarCell2(
|
|
22211
|
-
var
|
|
22244
|
+
function CalendarCell2(_sc, ref) {
|
|
22245
|
+
var _tc = _sc, { className, size = "sm" } = _tc, restProps = __objRest(_tc, ["className", "size"]);
|
|
22212
22246
|
const dataProperties = toDataProperties({ size });
|
|
22213
22247
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22214
22248
|
reactAriaComponents.CalendarCell,
|
|
@@ -22221,8 +22255,8 @@ const CalendarCell = react.forwardRef(
|
|
|
22221
22255
|
);
|
|
22222
22256
|
const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
|
|
22223
22257
|
const CalendarGridHeader = react.forwardRef(
|
|
22224
|
-
function CalendarGridHeader2(
|
|
22225
|
-
var
|
|
22258
|
+
function CalendarGridHeader2(_uc, ref) {
|
|
22259
|
+
var _vc = _uc, { className } = _vc, restProps = __objRest(_vc, ["className"]);
|
|
22226
22260
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22227
22261
|
reactAriaComponents.CalendarGridHeader,
|
|
22228
22262
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -22234,8 +22268,8 @@ const CalendarGridHeader = react.forwardRef(
|
|
|
22234
22268
|
);
|
|
22235
22269
|
const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
|
|
22236
22270
|
const CalendarHeaderCell = react.forwardRef(
|
|
22237
|
-
function CalendarHeaderCell2(
|
|
22238
|
-
var
|
|
22271
|
+
function CalendarHeaderCell2(_wc, ref) {
|
|
22272
|
+
var _xc = _wc, { className, size = "sm" } = _xc, restProps = __objRest(_xc, ["className", "size"]);
|
|
22239
22273
|
const dataProperties = toDataProperties({ size });
|
|
22240
22274
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22241
22275
|
reactAriaComponents.CalendarHeaderCell,
|
|
@@ -22368,7 +22402,7 @@ const useDatePickerState = ({ date: date2, setDate, minDate = null, maxDate = nu
|
|
|
22368
22402
|
maxDateZdt
|
|
22369
22403
|
}), [errorText, isInvalid, localDate, onBlur, onChange, maxDateZdt, minDateZdt]);
|
|
22370
22404
|
};
|
|
22371
|
-
const CLASS_NAME$
|
|
22405
|
+
const CLASS_NAME$3 = "Layer__caobfb";
|
|
22372
22406
|
const AccountFormBox = ({
|
|
22373
22407
|
account,
|
|
22374
22408
|
value,
|
|
@@ -22401,8 +22435,8 @@ const AccountFormBox = ({
|
|
|
22401
22435
|
onChange(__spreadProps(__spreadValues({}, value), { isDateInvalid }));
|
|
22402
22436
|
}
|
|
22403
22437
|
}, [isDateInvalid, onChange, value]);
|
|
22404
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$
|
|
22405
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22438
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$3, children: [
|
|
22439
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$3}__icon-col`, children: ((_a = account.institution) == null ? void 0 : _a.logo) != void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
22406
22440
|
"img",
|
|
22407
22441
|
{
|
|
22408
22442
|
width: 32,
|
|
@@ -22411,13 +22445,13 @@ const AccountFormBox = ({
|
|
|
22411
22445
|
alt: ((_b = account.institution) == null ? void 0 : _b.name) ? (_c = account.institution) == null ? void 0 : _c.name : account.external_account_name
|
|
22412
22446
|
}
|
|
22413
22447
|
) : /* @__PURE__ */ jsxRuntime.jsx(InstitutionIcon, {}) }),
|
|
22414
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22415
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22416
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22448
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col`, children: [
|
|
22449
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col__details`, children: [
|
|
22450
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col__name`, children: [
|
|
22417
22451
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22418
22452
|
Text,
|
|
22419
22453
|
{
|
|
22420
|
-
className: `${CLASS_NAME$
|
|
22454
|
+
className: `${CLASS_NAME$3}__details-col__name__institution-name`,
|
|
22421
22455
|
size: TextSize.sm,
|
|
22422
22456
|
children: (_d = account.institution) == null ? void 0 : _d.name
|
|
22423
22457
|
}
|
|
@@ -22425,7 +22459,7 @@ const AccountFormBox = ({
|
|
|
22425
22459
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22426
22460
|
Text,
|
|
22427
22461
|
{
|
|
22428
|
-
className: `${CLASS_NAME$
|
|
22462
|
+
className: `${CLASS_NAME$3}__details-col__name__account-name`,
|
|
22429
22463
|
size: TextSize.sm,
|
|
22430
22464
|
children: account.external_account_name
|
|
22431
22465
|
}
|
|
@@ -22436,7 +22470,7 @@ const AccountFormBox = ({
|
|
|
22436
22470
|
account.mask
|
|
22437
22471
|
] })
|
|
22438
22472
|
] }),
|
|
22439
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22473
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col__inputs`, children: [
|
|
22440
22474
|
/* @__PURE__ */ jsxRuntime.jsx(InputGroup, { label: "Opening date", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22441
22475
|
DatePicker,
|
|
22442
22476
|
{
|
|
@@ -22465,7 +22499,7 @@ const AccountFormBox = ({
|
|
|
22465
22499
|
] }),
|
|
22466
22500
|
errors.includes("API_ERROR") && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "An error occurred while saving data. You will have an opportunity to try again later." })
|
|
22467
22501
|
] }),
|
|
22468
|
-
!disableConfirmExclude && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22502
|
+
!disableConfirmExclude && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$3}__confirm-col`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22469
22503
|
Checkbox,
|
|
22470
22504
|
{
|
|
22471
22505
|
size: "lg",
|
|
@@ -22474,7 +22508,7 @@ const AccountFormBox = ({
|
|
|
22474
22508
|
"aria-label": "Confirm Account Inclusion"
|
|
22475
22509
|
}
|
|
22476
22510
|
) }),
|
|
22477
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22511
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$3}__success-banner`, children: /* @__PURE__ */ jsxRuntime.jsx(CheckCircle, { size: 36 }) })
|
|
22478
22512
|
] }));
|
|
22479
22513
|
};
|
|
22480
22514
|
function buildKey$z({
|
|
@@ -23350,8 +23384,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
23350
23384
|
refetch
|
|
23351
23385
|
};
|
|
23352
23386
|
};
|
|
23353
|
-
const BarChart2 = (
|
|
23354
|
-
var
|
|
23387
|
+
const BarChart2 = (_yc) => {
|
|
23388
|
+
var _zc = _yc, { size = 12 } = _zc, props = __objRest(_zc, ["size"]);
|
|
23355
23389
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23356
23390
|
"svg",
|
|
23357
23391
|
__spreadProps(__spreadValues({
|
|
@@ -24141,11 +24175,11 @@ const ProfitAndLossChart = ({
|
|
|
24141
24175
|
isSyncing && !hasNonZeroData ? /* @__PURE__ */ jsxRuntime.jsx(ChartStateCard, {}) : null
|
|
24142
24176
|
] });
|
|
24143
24177
|
};
|
|
24144
|
-
const BackButton = (
|
|
24145
|
-
var
|
|
24178
|
+
const BackButton = (_Ac) => {
|
|
24179
|
+
var _Bc = _Ac, {
|
|
24146
24180
|
className,
|
|
24147
24181
|
textOnly = false
|
|
24148
|
-
} =
|
|
24182
|
+
} = _Bc, props = __objRest(_Bc, [
|
|
24149
24183
|
"className",
|
|
24150
24184
|
"textOnly"
|
|
24151
24185
|
]);
|
|
@@ -24193,8 +24227,8 @@ const TASKS_CHARTS_COLORS = {
|
|
|
24193
24227
|
done: "#3B9C63",
|
|
24194
24228
|
pending: "#DFA000"
|
|
24195
24229
|
};
|
|
24196
|
-
const SortArrows = (
|
|
24197
|
-
var
|
|
24230
|
+
const SortArrows = (_Cc) => {
|
|
24231
|
+
var _Dc = _Cc, { size = 13 } = _Dc, props = __objRest(_Dc, ["size"]);
|
|
24198
24232
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
24199
24233
|
"svg",
|
|
24200
24234
|
__spreadProps(__spreadValues({
|
|
@@ -24859,11 +24893,11 @@ const LedgerAccountsContext = react.createContext({
|
|
|
24859
24893
|
fetchMore: () => {
|
|
24860
24894
|
}
|
|
24861
24895
|
});
|
|
24862
|
-
const CloseButton = (
|
|
24863
|
-
var
|
|
24896
|
+
const CloseButton = (_Ec) => {
|
|
24897
|
+
var _Fc = _Ec, {
|
|
24864
24898
|
className,
|
|
24865
24899
|
textOnly = false
|
|
24866
|
-
} =
|
|
24900
|
+
} = _Fc, props = __objRest(_Fc, [
|
|
24867
24901
|
"className",
|
|
24868
24902
|
"textOnly"
|
|
24869
24903
|
]);
|
|
@@ -25601,7 +25635,7 @@ const ProfitAndLossDetailReport = ({
|
|
|
25601
25635
|
),
|
|
25602
25636
|
rowsWithRunningBalance.lines.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pb: "sm", align: "center", className: "Layer__profit-and-loss-detail-report__total-row", children: [
|
|
25603
25637
|
/* @__PURE__ */ jsxRuntime.jsx(HStack, { className: "Layer__profit-and-loss-detail-report__total-label", children: /* @__PURE__ */ jsxRuntime.jsx(Label, { weight: "bold", size: "md", children: "Total" }) }),
|
|
25604
|
-
/* @__PURE__ */ jsxRuntime.jsx(HStack, { className: "Layer__profit-and-loss-detail-report__total-amount", children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, {
|
|
25638
|
+
/* @__PURE__ */ jsxRuntime.jsx(HStack, { className: "Layer__profit-and-loss-detail-report__total-amount", children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { weight: "bold", size: "md", amount: rowsWithRunningBalance.total }) })
|
|
25605
25639
|
] })
|
|
25606
25640
|
] }) });
|
|
25607
25641
|
};
|
|
@@ -26758,7 +26792,7 @@ const ProfitAndLossTableComponent = ({
|
|
|
26758
26792
|
{
|
|
26759
26793
|
variant: "text",
|
|
26760
26794
|
onPress: () => onLineItemClick(lineItem.name, currentBreadcrumbs),
|
|
26761
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, {
|
|
26795
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { amount: (_a = lineItem.value) != null ? _a : 0, weight: "bold" })
|
|
26762
26796
|
}
|
|
26763
26797
|
)
|
|
26764
26798
|
}
|
|
@@ -27040,6 +27074,19 @@ const ProfitAndLossReport = ({
|
|
|
27040
27074
|
}
|
|
27041
27075
|
) }) });
|
|
27042
27076
|
};
|
|
27077
|
+
function calculatePercentageChange(current, previous) {
|
|
27078
|
+
if (current >= 0 && previous < 0 || current < 0 && previous >= 0) {
|
|
27079
|
+
return null;
|
|
27080
|
+
}
|
|
27081
|
+
if (previous === 0) {
|
|
27082
|
+
return current === 0 ? null : 100;
|
|
27083
|
+
}
|
|
27084
|
+
return (current - previous) / Math.abs(previous) * 100;
|
|
27085
|
+
}
|
|
27086
|
+
function formatPercentageChange(value) {
|
|
27087
|
+
if (value === null) return "";
|
|
27088
|
+
return `${Math.abs(value).toFixed(0)}%`;
|
|
27089
|
+
}
|
|
27043
27090
|
const LIST_ITEM_CLASS_NAME = "Layer__ProfitAndLossSummariesListItem";
|
|
27044
27091
|
function ProfitAndLossSummariesListItem({
|
|
27045
27092
|
children,
|
|
@@ -27151,24 +27198,49 @@ function ProfitAndLossSummariesHeading({
|
|
|
27151
27198
|
const { size = "2xs" } = variants2 != null ? variants2 : {};
|
|
27152
27199
|
return /* @__PURE__ */ jsxRuntime.jsx(Heading$1, { level: 3, size, slot: "heading", children });
|
|
27153
27200
|
}
|
|
27154
|
-
const CLASS_NAME$3 = "Layer__ProfitAndLossSummariesSummary";
|
|
27155
27201
|
const CHART_AREA_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryChartArea";
|
|
27156
|
-
const CHART_AREA_EMPTY_FRAME_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryChartAreaEmptyFrame";
|
|
27157
27202
|
function ProfitAndLossSummariesSummary({
|
|
27158
27203
|
label,
|
|
27159
27204
|
amount,
|
|
27160
27205
|
isLoading,
|
|
27206
|
+
percentChange,
|
|
27207
|
+
comparisonMonth,
|
|
27208
|
+
isExpense = false,
|
|
27161
27209
|
slots,
|
|
27162
27210
|
variants: variants2
|
|
27163
27211
|
}) {
|
|
27164
27212
|
const { Chart } = slots != null ? slots : {};
|
|
27165
|
-
const
|
|
27166
|
-
const
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27170
|
-
|
|
27171
|
-
|
|
27213
|
+
const showPercentChange = percentChange !== void 0 && percentChange !== null && comparisonMonth;
|
|
27214
|
+
const isGoodChange = showPercentChange && (isExpense ? percentChange < 0 : percentChange >= 0);
|
|
27215
|
+
const arrow = showPercentChange && percentChange >= 0 ? "↑" : "↓";
|
|
27216
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
27217
|
+
Chart && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27218
|
+
HStack,
|
|
27219
|
+
{
|
|
27220
|
+
align: "center",
|
|
27221
|
+
justify: "center",
|
|
27222
|
+
className: CHART_AREA_CLASS_NAME,
|
|
27223
|
+
children: Chart
|
|
27224
|
+
}
|
|
27225
|
+
),
|
|
27226
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", fluid: true, pi: "sm", children: [
|
|
27227
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, children: [
|
|
27228
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: label }),
|
|
27229
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(SkeletonLoader, { height: "20px" }) : /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { slot: "amount", amount, size: "lg", weight: "bold" })
|
|
27230
|
+
] }),
|
|
27231
|
+
showPercentChange && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", align: "end", children: [
|
|
27232
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "3xs", align: "center", children: [
|
|
27233
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", weight: "bold", status: isGoodChange ? "success" : void 0, children: arrow }),
|
|
27234
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", weight: "normal", status: isGoodChange ? "success" : void 0, children: formatPercentageChange(percentChange != null ? percentChange : null) })
|
|
27235
|
+
] }),
|
|
27236
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Span, { size: "xs", variant: "subtle", noWrap: true, children: [
|
|
27237
|
+
"vs.",
|
|
27238
|
+
" ",
|
|
27239
|
+
comparisonMonth || ""
|
|
27240
|
+
] })
|
|
27241
|
+
] })
|
|
27242
|
+
] })
|
|
27243
|
+
] });
|
|
27172
27244
|
}
|
|
27173
27245
|
const CLASS_NAME$2 = "Layer__TransactionsToReview";
|
|
27174
27246
|
function TransactionsToReview({
|
|
@@ -27275,6 +27347,14 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27275
27347
|
setSidebarScope,
|
|
27276
27348
|
sidebarScope
|
|
27277
27349
|
} = react.useContext(ProfitAndLossContext);
|
|
27350
|
+
const { startDate, endDate: _endDate } = useGlobalDateRange({ displayMode: "month" });
|
|
27351
|
+
const previousMonthStart = dateFns.sub(startDate, { months: 1 });
|
|
27352
|
+
const { data: previousData } = useProfitAndLossSummaries({
|
|
27353
|
+
startYear: previousMonthStart.getFullYear(),
|
|
27354
|
+
startMonth: previousMonthStart.getMonth() + 1,
|
|
27355
|
+
endYear: previousMonthStart.getFullYear(),
|
|
27356
|
+
endMonth: previousMonthStart.getMonth() + 1
|
|
27357
|
+
});
|
|
27278
27358
|
const { revenueChartData, expensesChartData } = react.useMemo(
|
|
27279
27359
|
() => ({
|
|
27280
27360
|
revenueChartData: toMiniChartData({ scope: "revenue", data }),
|
|
@@ -27282,7 +27362,35 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27282
27362
|
}),
|
|
27283
27363
|
[data]
|
|
27284
27364
|
);
|
|
27285
|
-
const effectiveData =
|
|
27365
|
+
const effectiveData = react.useMemo(
|
|
27366
|
+
() => data != null ? data : { income: { value: 0 }, netProfit: 0 },
|
|
27367
|
+
[data]
|
|
27368
|
+
);
|
|
27369
|
+
const comparisonData = react.useMemo(() => {
|
|
27370
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g;
|
|
27371
|
+
const previousMonthData = (_a2 = previousData == null ? void 0 : previousData.months) == null ? void 0 : _a2[0];
|
|
27372
|
+
if (!previousMonthData) {
|
|
27373
|
+
return null;
|
|
27374
|
+
}
|
|
27375
|
+
const currentRevenue = (_b2 = effectiveData.income.value) != null ? _b2 : 0;
|
|
27376
|
+
const previousRevenue = (_c2 = previousMonthData.income) != null ? _c2 : 0;
|
|
27377
|
+
const currentExpenses = ((_d2 = effectiveData.income.value) != null ? _d2 : 0) - effectiveData.netProfit;
|
|
27378
|
+
const previousExpenses = (_e = previousMonthData.totalExpenses) != null ? _e : 0;
|
|
27379
|
+
const currentNetProfit = (_f = effectiveData.netProfit) != null ? _f : 0;
|
|
27380
|
+
const previousNetProfit = (_g = previousMonthData.netProfit) != null ? _g : 0;
|
|
27381
|
+
return {
|
|
27382
|
+
revenuePercentChange: calculatePercentageChange(currentRevenue, previousRevenue),
|
|
27383
|
+
expensesPercentChange: calculatePercentageChange(currentExpenses, previousExpenses),
|
|
27384
|
+
netProfitPercentChange: calculatePercentageChange(currentNetProfit, previousNetProfit),
|
|
27385
|
+
comparisonMonth: dateFns.format(previousMonthStart, "MMM")
|
|
27386
|
+
};
|
|
27387
|
+
}, [previousData, effectiveData, previousMonthStart]);
|
|
27388
|
+
const {
|
|
27389
|
+
revenuePercentChange = null,
|
|
27390
|
+
expensesPercentChange = null,
|
|
27391
|
+
netProfitPercentChange = null,
|
|
27392
|
+
comparisonMonth = null
|
|
27393
|
+
} = comparisonData != null ? comparisonData : {};
|
|
27286
27394
|
const { unstable_AdditionalListItems = [] } = slots != null ? slots : {};
|
|
27287
27395
|
const listItemCount = unstable_AdditionalListItems.length + 3;
|
|
27288
27396
|
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: SECTION_CLASS_NAMES, children: /* @__PURE__ */ jsxRuntime.jsxs(ProfitAndLossSummariesList, { itemCount: listItemCount, children: [
|
|
@@ -27297,6 +27405,8 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27297
27405
|
label: (stringOverrides == null ? void 0 : stringOverrides.revenueLabel) || revenueLabel || "Revenue",
|
|
27298
27406
|
amount: (_a = effectiveData.income.value) != null ? _a : 0,
|
|
27299
27407
|
isLoading,
|
|
27408
|
+
percentChange: revenuePercentChange,
|
|
27409
|
+
comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0,
|
|
27300
27410
|
slots: {
|
|
27301
27411
|
Chart: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27302
27412
|
ProfitAndLossSummariesMiniChart,
|
|
@@ -27323,6 +27433,9 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27323
27433
|
label: (stringOverrides == null ? void 0 : stringOverrides.expensesLabel) || "Expenses",
|
|
27324
27434
|
amount: ((_c = (_b = effectiveData == null ? void 0 : effectiveData.income) == null ? void 0 : _b.value) != null ? _c : 0) - effectiveData.netProfit,
|
|
27325
27435
|
isLoading,
|
|
27436
|
+
percentChange: expensesPercentChange,
|
|
27437
|
+
comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0,
|
|
27438
|
+
isExpense: true,
|
|
27326
27439
|
slots: {
|
|
27327
27440
|
Chart: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27328
27441
|
ProfitAndLossSummariesMiniChart,
|
|
@@ -27344,16 +27457,18 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27344
27457
|
label: (stringOverrides == null ? void 0 : stringOverrides.netProfitLabel) || "Net Profit",
|
|
27345
27458
|
amount: (_d = data == null ? void 0 : data.netProfit) != null ? _d : 0,
|
|
27346
27459
|
variants: variants2,
|
|
27347
|
-
isLoading
|
|
27460
|
+
isLoading,
|
|
27461
|
+
percentChange: netProfitPercentChange,
|
|
27462
|
+
comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0
|
|
27348
27463
|
}
|
|
27349
27464
|
) }),
|
|
27350
27465
|
unstable_AdditionalListItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesListItem, { children: item }, index2))
|
|
27351
27466
|
] }) });
|
|
27352
27467
|
}
|
|
27353
|
-
function ProfitAndLossSummaries(
|
|
27354
|
-
var
|
|
27468
|
+
function ProfitAndLossSummaries(_Gc) {
|
|
27469
|
+
var _Hc = _Gc, {
|
|
27355
27470
|
onTransactionsToReviewClick
|
|
27356
|
-
} =
|
|
27471
|
+
} = _Hc, restProps = __objRest(_Hc, [
|
|
27357
27472
|
"onTransactionsToReviewClick"
|
|
27358
27473
|
]);
|
|
27359
27474
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -27553,8 +27668,8 @@ function BalanceSheetDownloadButton({
|
|
|
27553
27668
|
/* @__PURE__ */ jsxRuntime.jsx(InvisibleDownload, { ref: invisibleDownloadRef })
|
|
27554
27669
|
] });
|
|
27555
27670
|
}
|
|
27556
|
-
const Collapse = (
|
|
27557
|
-
var props = __objRest(
|
|
27671
|
+
const Collapse = (_Ic) => {
|
|
27672
|
+
var props = __objRest(_Ic, []);
|
|
27558
27673
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27559
27674
|
"svg",
|
|
27560
27675
|
__spreadProps(__spreadValues({
|
|
@@ -27587,8 +27702,8 @@ const Collapse = (_Ec) => {
|
|
|
27587
27702
|
})
|
|
27588
27703
|
);
|
|
27589
27704
|
};
|
|
27590
|
-
const Expand = (
|
|
27591
|
-
var props = __objRest(
|
|
27705
|
+
const Expand = (_Jc) => {
|
|
27706
|
+
var props = __objRest(_Jc, []);
|
|
27592
27707
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27593
27708
|
"svg",
|
|
27594
27709
|
__spreadProps(__spreadValues({
|
|
@@ -29236,8 +29351,8 @@ const ChartOfAccountsContext = react.createContext(
|
|
|
29236
29351
|
}
|
|
29237
29352
|
}
|
|
29238
29353
|
);
|
|
29239
|
-
const Plus = (
|
|
29240
|
-
var
|
|
29354
|
+
const Plus = (_Kc) => {
|
|
29355
|
+
var _Lc = _Kc, { size = 14 } = _Lc, props = __objRest(_Lc, ["size"]);
|
|
29241
29356
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29242
29357
|
"svg",
|
|
29243
29358
|
__spreadProps(__spreadValues({
|
|
@@ -29604,8 +29719,8 @@ var LedgerAccountNodeType = /* @__PURE__ */ ((LedgerAccountNodeType2) => {
|
|
|
29604
29719
|
LedgerAccountNodeType2["Parent"] = "Parent";
|
|
29605
29720
|
return LedgerAccountNodeType2;
|
|
29606
29721
|
})(LedgerAccountNodeType || {});
|
|
29607
|
-
const Edit2 = (
|
|
29608
|
-
var
|
|
29722
|
+
const Edit2 = (_Mc) => {
|
|
29723
|
+
var _Nc = _Mc, { size = 18 } = _Nc, props = __objRest(_Nc, ["size"]);
|
|
29609
29724
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29610
29725
|
"svg",
|
|
29611
29726
|
__spreadProps(__spreadValues({
|
|
@@ -32286,8 +32401,8 @@ function usePaginatedList(list, pageSize) {
|
|
|
32286
32401
|
reset
|
|
32287
32402
|
};
|
|
32288
32403
|
}
|
|
32289
|
-
const SmileIcon = (
|
|
32290
|
-
var
|
|
32404
|
+
const SmileIcon = (_Oc) => {
|
|
32405
|
+
var _Pc = _Oc, { size = 12 } = _Pc, props = __objRest(_Pc, ["size"]);
|
|
32291
32406
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32292
32407
|
"svg",
|
|
32293
32408
|
__spreadProps(__spreadValues({
|
|
@@ -33132,8 +33247,8 @@ const useBookkeepingYearsStatus = () => {
|
|
|
33132
33247
|
isLoading
|
|
33133
33248
|
};
|
|
33134
33249
|
};
|
|
33135
|
-
const ArrowRightCircle = (
|
|
33136
|
-
var
|
|
33250
|
+
const ArrowRightCircle = (_Qc) => {
|
|
33251
|
+
var _Rc = _Qc, { size = 18 } = _Rc, props = __objRest(_Rc, ["size"]);
|
|
33137
33252
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33138
33253
|
"svg",
|
|
33139
33254
|
__spreadProps(__spreadValues({
|
|
@@ -35181,12 +35296,12 @@ const FormSection = ({ children, title }) => {
|
|
|
35181
35296
|
children
|
|
35182
35297
|
] });
|
|
35183
35298
|
};
|
|
35184
|
-
const PhoneInput = (
|
|
35185
|
-
var
|
|
35299
|
+
const PhoneInput = (_Sc) => {
|
|
35300
|
+
var _Tc = _Sc, {
|
|
35186
35301
|
value,
|
|
35187
35302
|
onChange,
|
|
35188
35303
|
placeholder = "Phone number"
|
|
35189
|
-
} =
|
|
35304
|
+
} = _Tc, props = __objRest(_Tc, [
|
|
35190
35305
|
"value",
|
|
35191
35306
|
"onChange",
|
|
35192
35307
|
"placeholder"
|
|
@@ -35478,8 +35593,8 @@ const SummaryStep = ({ onNext, title = defaultTitle$1, description = defaultDesc
|
|
|
35478
35593
|
/* @__PURE__ */ jsxRuntime.jsx(Button$1, { onClick: onNext, children: nextBtnText })
|
|
35479
35594
|
] });
|
|
35480
35595
|
};
|
|
35481
|
-
const Document = (
|
|
35482
|
-
var
|
|
35596
|
+
const Document = (_Uc) => {
|
|
35597
|
+
var _Vc = _Uc, { size = 20 } = _Vc, props = __objRest(_Vc, ["size"]);
|
|
35483
35598
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
35484
35599
|
"svg",
|
|
35485
35600
|
__spreadProps(__spreadValues({
|
|
@@ -35584,8 +35699,8 @@ const Document = (_Qc) => {
|
|
|
35584
35699
|
})
|
|
35585
35700
|
);
|
|
35586
35701
|
};
|
|
35587
|
-
const TrendingUp = (
|
|
35588
|
-
var
|
|
35702
|
+
const TrendingUp = (_Wc) => {
|
|
35703
|
+
var _Xc = _Wc, { size = 20 } = _Xc, props = __objRest(_Xc, ["size"]);
|
|
35589
35704
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
35590
35705
|
"svg",
|
|
35591
35706
|
__spreadProps(__spreadValues({
|
|
@@ -35842,8 +35957,8 @@ const PlatformOnboarding = ({ onComplete }) => {
|
|
|
35842
35957
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
|
|
35843
35958
|
] }) });
|
|
35844
35959
|
};
|
|
35845
|
-
const CoffeeIcon = (
|
|
35846
|
-
var
|
|
35960
|
+
const CoffeeIcon = (_Yc) => {
|
|
35961
|
+
var _Zc = _Yc, { size = 11 } = _Zc, props = __objRest(_Zc, ["size"]);
|
|
35847
35962
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
35848
35963
|
"svg",
|
|
35849
35964
|
__spreadProps(__spreadValues({
|
|
@@ -35914,8 +36029,8 @@ const CoffeeIcon = (_Uc) => {
|
|
|
35914
36029
|
})
|
|
35915
36030
|
);
|
|
35916
36031
|
};
|
|
35917
|
-
const Link$1 = (
|
|
35918
|
-
var
|
|
36032
|
+
const Link$1 = (__c) => {
|
|
36033
|
+
var _$c = __c, {
|
|
35919
36034
|
className,
|
|
35920
36035
|
children,
|
|
35921
36036
|
variant = ButtonVariant.primary,
|
|
@@ -35925,7 +36040,7 @@ const Link$1 = (_Wc) => {
|
|
|
35925
36040
|
iconAsPrimary = false,
|
|
35926
36041
|
justify = "center",
|
|
35927
36042
|
fullWidth
|
|
35928
|
-
} =
|
|
36043
|
+
} = _$c, props = __objRest(_$c, [
|
|
35929
36044
|
"className",
|
|
35930
36045
|
"children",
|
|
35931
36046
|
"variant",
|
|
@@ -36017,8 +36132,8 @@ const BookkeepingUpsellBar = ({
|
|
|
36017
36132
|
onClick ? /* @__PURE__ */ jsxRuntime.jsx(Button$1, { variant: ButtonVariant.secondary, onClick, children: "Schedule a demo" }) : href ? /* @__PURE__ */ jsxRuntime.jsx(Link$1, { href, target: "_blank", variant: ButtonVariant.secondary, children: "Schedule a demo" }) : null
|
|
36018
36133
|
] });
|
|
36019
36134
|
};
|
|
36020
|
-
const ChevronRightFill = (
|
|
36021
|
-
var
|
|
36135
|
+
const ChevronRightFill = (_ad) => {
|
|
36136
|
+
var _bd = _ad, { size = 18 } = _bd, props = __objRest(_bd, ["size"]);
|
|
36022
36137
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36023
36138
|
"svg",
|
|
36024
36139
|
__spreadProps(__spreadValues({
|
|
@@ -39300,8 +39415,8 @@ const getClassnameForSubComponent = (className, suffix) => {
|
|
|
39300
39415
|
};
|
|
39301
39416
|
const METER_CLASS_NAME = "Layer__Meter";
|
|
39302
39417
|
const Meter = react.forwardRef(
|
|
39303
|
-
function Meter2(
|
|
39304
|
-
var
|
|
39418
|
+
function Meter2(_cd, ref) {
|
|
39419
|
+
var _dd = _cd, { className, label, meterOnly } = _dd, restProps = __objRest(_dd, ["className", "label", "meterOnly"]);
|
|
39305
39420
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Meter, __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, restProps), { className: classNames(METER_CLASS_NAME, className), ref }), meterOnly && { "aria-label": label }), { children: ({ percentage, valueText }) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, children: [
|
|
39306
39421
|
!meterOnly && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", children: [
|
|
39307
39422
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", children: label }),
|
|
@@ -39416,11 +39531,11 @@ const ProfitAndLossView = (props) => {
|
|
|
39416
39531
|
const containerRef = react.useRef(null);
|
|
39417
39532
|
return /* @__PURE__ */ jsxRuntime.jsx(Container, { name: COMPONENT_NAME$3, ref: containerRef, children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLoss, { children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
|
|
39418
39533
|
};
|
|
39419
|
-
const ProfitAndLossPanel = (
|
|
39420
|
-
var
|
|
39534
|
+
const ProfitAndLossPanel = (_ed) => {
|
|
39535
|
+
var _fd = _ed, {
|
|
39421
39536
|
containerRef,
|
|
39422
39537
|
stringOverrides
|
|
39423
|
-
} =
|
|
39538
|
+
} = _fd, props = __objRest(_fd, [
|
|
39424
39539
|
"containerRef",
|
|
39425
39540
|
"stringOverrides"
|
|
39426
39541
|
]);
|
|
@@ -39683,13 +39798,13 @@ function ExpandableDataTable({
|
|
|
39683
39798
|
);
|
|
39684
39799
|
}
|
|
39685
39800
|
const UNIFIED_REPORT_TAG_KEY = "#unified-report";
|
|
39686
|
-
function buildKey$7(
|
|
39687
|
-
var
|
|
39801
|
+
function buildKey$7(_gd) {
|
|
39802
|
+
var _hd = _gd, {
|
|
39688
39803
|
access_token: accessToken,
|
|
39689
39804
|
apiUrl,
|
|
39690
39805
|
businessId,
|
|
39691
39806
|
report
|
|
39692
|
-
} =
|
|
39807
|
+
} = _hd, dateParams = __objRest(_hd, [
|
|
39693
39808
|
"access_token",
|
|
39694
39809
|
"apiUrl",
|
|
39695
39810
|
"businessId",
|
|
@@ -39705,8 +39820,8 @@ function buildKey$7(_cd) {
|
|
|
39705
39820
|
}, dateParams);
|
|
39706
39821
|
}
|
|
39707
39822
|
}
|
|
39708
|
-
const getUnifiedReport = get$1((
|
|
39709
|
-
var
|
|
39823
|
+
const getUnifiedReport = get$1((_id) => {
|
|
39824
|
+
var _jd = _id, { businessId, report } = _jd, dateParams = __objRest(_jd, ["businessId", "report"]);
|
|
39710
39825
|
const parameters = toDefinedSearchParameters(__spreadValues({}, dateParams));
|
|
39711
39826
|
return `/v1/businesses/${businessId}/reports/unified/${report}?${parameters}`;
|
|
39712
39827
|
});
|
|
@@ -39735,8 +39850,8 @@ class UnifiedReportSWRResponse {
|
|
|
39735
39850
|
return this.swrResponse.mutate;
|
|
39736
39851
|
}
|
|
39737
39852
|
}
|
|
39738
|
-
function useUnifiedReport(
|
|
39739
|
-
var
|
|
39853
|
+
function useUnifiedReport(_kd) {
|
|
39854
|
+
var _ld = _kd, { report } = _ld, dateParams = __objRest(_ld, ["report"]);
|
|
39740
39855
|
const { data: auth } = useAuth();
|
|
39741
39856
|
const { apiUrl } = useEnvironment();
|
|
39742
39857
|
const { businessId } = useLayerContext();
|
|
@@ -41266,19 +41381,19 @@ const VendorsProvider = ({ children }) => {
|
|
|
41266
41381
|
const vendors = useVendors();
|
|
41267
41382
|
return /* @__PURE__ */ jsxRuntime.jsx(VendorsContext.Provider, { value: vendors, children });
|
|
41268
41383
|
};
|
|
41269
|
-
const SelectVendor = (
|
|
41270
|
-
var
|
|
41384
|
+
const SelectVendor = (_md) => {
|
|
41385
|
+
var _nd = _md, { withContext = true } = _nd, props = __objRest(_nd, ["withContext"]);
|
|
41271
41386
|
if (withContext) {
|
|
41272
41387
|
return /* @__PURE__ */ jsxRuntime.jsx(VendorsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props)) });
|
|
41273
41388
|
}
|
|
41274
41389
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props));
|
|
41275
41390
|
};
|
|
41276
|
-
const SelectVendorContent = (
|
|
41277
|
-
var
|
|
41391
|
+
const SelectVendorContent = (_od) => {
|
|
41392
|
+
var _pd = _od, {
|
|
41278
41393
|
value,
|
|
41279
41394
|
onChange,
|
|
41280
41395
|
placeholder = "Select vendor"
|
|
41281
|
-
} =
|
|
41396
|
+
} = _pd, props = __objRest(_pd, [
|
|
41282
41397
|
"value",
|
|
41283
41398
|
"onChange",
|
|
41284
41399
|
"placeholder"
|
|
@@ -42045,8 +42160,8 @@ const BillsTableWithPanel = ({
|
|
|
42045
42160
|
}
|
|
42046
42161
|
);
|
|
42047
42162
|
};
|
|
42048
|
-
const Bills = (
|
|
42049
|
-
var
|
|
42163
|
+
const Bills = (_qd) => {
|
|
42164
|
+
var _rd = _qd, { context = true } = _rd, props = __objRest(_rd, ["context"]);
|
|
42050
42165
|
if (context) {
|
|
42051
42166
|
return /* @__PURE__ */ jsxRuntime.jsx(BillsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(BillsContent, __spreadValues({}, props)) });
|
|
42052
42167
|
}
|
|
@@ -42104,8 +42219,8 @@ const getTimezoneDisplay = (date2) => {
|
|
|
42104
42219
|
};
|
|
42105
42220
|
const LINK_CLASS_NAME = "Layer__UI__Link";
|
|
42106
42221
|
const Link = react.forwardRef(
|
|
42107
|
-
function Link2(
|
|
42108
|
-
var
|
|
42222
|
+
function Link2(_sd, ref) {
|
|
42223
|
+
var _td = _sd, {
|
|
42109
42224
|
children,
|
|
42110
42225
|
size = "md",
|
|
42111
42226
|
ellipsis,
|
|
@@ -42114,7 +42229,7 @@ const Link = react.forwardRef(
|
|
|
42114
42229
|
href,
|
|
42115
42230
|
target,
|
|
42116
42231
|
rel
|
|
42117
|
-
} =
|
|
42232
|
+
} = _td, restProps = __objRest(_td, [
|
|
42118
42233
|
"children",
|
|
42119
42234
|
"size",
|
|
42120
42235
|
"ellipsis",
|
|
@@ -42617,8 +42732,10 @@ const VehicleSchema = effect.Schema.Struct({
|
|
|
42617
42732
|
effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)),
|
|
42618
42733
|
effect.Schema.fromKey("external_id")
|
|
42619
42734
|
),
|
|
42620
|
-
|
|
42621
|
-
|
|
42735
|
+
makeAndModel: effect.pipe(
|
|
42736
|
+
effect.Schema.propertySignature(effect.Schema.String),
|
|
42737
|
+
effect.Schema.fromKey("make_and_model")
|
|
42738
|
+
),
|
|
42622
42739
|
year: effect.Schema.Number,
|
|
42623
42740
|
licensePlate: effect.pipe(
|
|
42624
42741
|
effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)),
|
|
@@ -42640,16 +42757,17 @@ const VehicleSchema = effect.Schema.Struct({
|
|
|
42640
42757
|
)
|
|
42641
42758
|
});
|
|
42642
42759
|
effect.Schema.Struct({
|
|
42643
|
-
|
|
42644
|
-
model: effect.Schema.String,
|
|
42760
|
+
makeAndModel: effect.Schema.String,
|
|
42645
42761
|
year: effect.Schema.Number,
|
|
42646
42762
|
licensePlate: effect.Schema.String,
|
|
42647
42763
|
vin: effect.Schema.String,
|
|
42648
42764
|
description: effect.Schema.String
|
|
42649
42765
|
});
|
|
42650
42766
|
const UpsertVehicleSchema = effect.Schema.Struct({
|
|
42651
|
-
|
|
42652
|
-
|
|
42767
|
+
makeAndModel: effect.pipe(
|
|
42768
|
+
effect.Schema.propertySignature(effect.Schema.String),
|
|
42769
|
+
effect.Schema.fromKey("make_and_model")
|
|
42770
|
+
),
|
|
42653
42771
|
year: effect.Schema.Number,
|
|
42654
42772
|
licensePlate: effect.pipe(
|
|
42655
42773
|
effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)),
|
|
@@ -42891,9 +43009,6 @@ const getTripFormDefaultValues = (trip) => {
|
|
|
42891
43009
|
const validateTripForm = ({ trip }) => {
|
|
42892
43010
|
const { vehicle, tripDate, distance, purpose } = trip;
|
|
42893
43011
|
const errors = [];
|
|
42894
|
-
if (vehicle === null) {
|
|
42895
|
-
errors.push({ vehicle: "Vehicle is a required field." });
|
|
42896
|
-
}
|
|
42897
43012
|
if (tripDate === null) {
|
|
42898
43013
|
errors.push({ tripDate: "Trip date is a required field." });
|
|
42899
43014
|
}
|
|
@@ -42906,6 +43021,9 @@ const validateTripForm = ({ trip }) => {
|
|
|
42906
43021
|
if (!purpose) {
|
|
42907
43022
|
errors.push({ purpose: "Purpose is a required field." });
|
|
42908
43023
|
}
|
|
43024
|
+
if (vehicle === null) {
|
|
43025
|
+
errors.push({ vehicle: "Vehicle is a required field." });
|
|
43026
|
+
}
|
|
42909
43027
|
return errors.length > 0 ? errors : null;
|
|
42910
43028
|
};
|
|
42911
43029
|
const convertTripFormToUpsertTrip = (form) => {
|
|
@@ -43204,8 +43322,7 @@ const useTripForm = (props) => {
|
|
|
43204
43322
|
);
|
|
43205
43323
|
};
|
|
43206
43324
|
const formatDistance = (distance) => {
|
|
43207
|
-
|
|
43208
|
-
return `${distanceNum.toFixed(1)} mi`;
|
|
43325
|
+
return `${effect.BigDecimal.format(distance)} mi`;
|
|
43209
43326
|
};
|
|
43210
43327
|
const getPurposeLabel = (purpose) => {
|
|
43211
43328
|
var _a;
|
|
@@ -43318,7 +43435,7 @@ function useListVehicles() {
|
|
|
43318
43435
|
);
|
|
43319
43436
|
return new ListVehiclesSWRResponse(response);
|
|
43320
43437
|
}
|
|
43321
|
-
const getVehicleDisplayName = (vehicle) =>
|
|
43438
|
+
const getVehicleDisplayName = (vehicle) => `${vehicle.year} ${vehicle.makeAndModel}`;
|
|
43322
43439
|
class VehicleAsOption {
|
|
43323
43440
|
constructor(vehicle) {
|
|
43324
43441
|
__publicField(this, "internalVehicle");
|
|
@@ -43433,33 +43550,88 @@ const TripForm = (props) => {
|
|
|
43433
43550
|
) });
|
|
43434
43551
|
}
|
|
43435
43552
|
} }),
|
|
43436
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.
|
|
43437
|
-
|
|
43553
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "tripDate", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43554
|
+
field.FormDateField,
|
|
43438
43555
|
{
|
|
43439
|
-
|
|
43440
|
-
|
|
43556
|
+
label: "Trip date",
|
|
43557
|
+
inline: true,
|
|
43441
43558
|
isReadOnly,
|
|
43559
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__TripDate`
|
|
43560
|
+
}
|
|
43561
|
+
) }),
|
|
43562
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "distance", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43563
|
+
field.FormBigDecimalField,
|
|
43564
|
+
{
|
|
43565
|
+
label: "Distance (miles)",
|
|
43442
43566
|
inline: true,
|
|
43443
|
-
|
|
43567
|
+
isReadOnly,
|
|
43568
|
+
maxDecimalPlaces: 2,
|
|
43569
|
+
placeholder: "Enter distance",
|
|
43570
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Distance`
|
|
43571
|
+
}
|
|
43572
|
+
) }),
|
|
43573
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "startAddress", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43574
|
+
field.FormTextField,
|
|
43575
|
+
{
|
|
43576
|
+
label: "Start address",
|
|
43577
|
+
inline: true,
|
|
43578
|
+
isReadOnly,
|
|
43579
|
+
placeholder: "Enter address",
|
|
43580
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__StartAddress`
|
|
43581
|
+
}
|
|
43582
|
+
) }),
|
|
43583
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "endAddress", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43584
|
+
field.FormTextField,
|
|
43585
|
+
{
|
|
43586
|
+
label: "End address",
|
|
43587
|
+
inline: true,
|
|
43588
|
+
isReadOnly,
|
|
43589
|
+
placeholder: "Enter address",
|
|
43590
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__EndAddress`
|
|
43444
43591
|
}
|
|
43445
43592
|
) }),
|
|
43446
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "tripDate", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormDateField, { label: "Trip date", inline: true, className: `${TRIP_FORM_FIELD_CSS_PREFIX}__TripDate`, isReadOnly }) }),
|
|
43447
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "distance", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormBigDecimalField, { label: "Distance (miles)", inline: true, className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Distance`, isReadOnly, maxDecimalPlaces: 1 }) }),
|
|
43448
43593
|
/* @__PURE__ */ jsxRuntime.jsx(form.Field, { name: "purpose", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43449
43594
|
TripPurposeComboBox,
|
|
43450
43595
|
{
|
|
43451
|
-
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Purpose`,
|
|
43452
43596
|
value: field.state.value,
|
|
43453
43597
|
onValueChange: (value) => field.handleChange(value != null ? value : TripPurpose.Unreviewed),
|
|
43454
|
-
isReadOnly
|
|
43598
|
+
isReadOnly,
|
|
43599
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Purpose`
|
|
43455
43600
|
}
|
|
43456
43601
|
) }),
|
|
43457
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "
|
|
43458
|
-
|
|
43459
|
-
|
|
43460
|
-
|
|
43461
|
-
|
|
43462
|
-
|
|
43602
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43603
|
+
field.FormTextAreaField,
|
|
43604
|
+
{
|
|
43605
|
+
label: "Description",
|
|
43606
|
+
inline: true,
|
|
43607
|
+
isReadOnly,
|
|
43608
|
+
placeholder: "Add description",
|
|
43609
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Description`
|
|
43610
|
+
}
|
|
43611
|
+
) }),
|
|
43612
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.Field, { name: "vehicle", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43613
|
+
VehicleSelector,
|
|
43614
|
+
{
|
|
43615
|
+
selectedVehicle: field.state.value,
|
|
43616
|
+
onSelectedVehicleChange: field.handleChange,
|
|
43617
|
+
isReadOnly,
|
|
43618
|
+
inline: true,
|
|
43619
|
+
placeholder: "Add vehicle",
|
|
43620
|
+
containerClassName: `${TRIP_FORM_FIELD_CSS_PREFIX}__Vehicle`
|
|
43621
|
+
}
|
|
43622
|
+
) }),
|
|
43623
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { justify: "end", className: `${TRIP_FORM_CSS_PREFIX}__Submit`, children: /* @__PURE__ */ jsxRuntime.jsx(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43624
|
+
Button,
|
|
43625
|
+
{
|
|
43626
|
+
type: "submit",
|
|
43627
|
+
isDisabled: !canSubmit,
|
|
43628
|
+
isPending: isSubmitting,
|
|
43629
|
+
onPress: () => {
|
|
43630
|
+
void form.handleSubmit();
|
|
43631
|
+
},
|
|
43632
|
+
children: "Save Trip"
|
|
43633
|
+
}
|
|
43634
|
+
) }) })
|
|
43463
43635
|
] });
|
|
43464
43636
|
};
|
|
43465
43637
|
const TripsTableHeaderMenu = () => {
|
|
@@ -43691,32 +43863,40 @@ const TripsTable = () => {
|
|
|
43691
43863
|
}
|
|
43692
43864
|
)
|
|
43693
43865
|
] }),
|
|
43694
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43695
|
-
|
|
43696
|
-
|
|
43697
|
-
|
|
43698
|
-
|
|
43699
|
-
|
|
43700
|
-
|
|
43701
|
-
|
|
43702
|
-
|
|
43703
|
-
|
|
43704
|
-
|
|
43705
|
-
|
|
43706
|
-
|
|
43707
|
-
|
|
43708
|
-
|
|
43709
|
-
|
|
43710
|
-
|
|
43711
|
-
|
|
43712
|
-
|
|
43866
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43867
|
+
Drawer,
|
|
43868
|
+
{
|
|
43869
|
+
isOpen: isTripDrawerOpen,
|
|
43870
|
+
onOpenChange: setIsTripDrawerOpen,
|
|
43871
|
+
isDismissable: true,
|
|
43872
|
+
"aria-label": selectedTrip ? "Trip details" : "Record trip",
|
|
43873
|
+
children: ({ close: close2 }) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pb: "lg", children: [
|
|
43874
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { pi: "md", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43875
|
+
ModalTitleWithClose,
|
|
43876
|
+
{
|
|
43877
|
+
heading: /* @__PURE__ */ jsxRuntime.jsx(ModalHeading, { size: "md", children: selectedTrip ? "Trip details" : "Record trip" }),
|
|
43878
|
+
onClose: close2
|
|
43879
|
+
}
|
|
43880
|
+
) }),
|
|
43881
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43882
|
+
TripForm,
|
|
43883
|
+
{
|
|
43884
|
+
trip: selectedTrip != null ? selectedTrip : void 0,
|
|
43885
|
+
onSuccess: () => {
|
|
43886
|
+
setSelectedTrip(null);
|
|
43887
|
+
close2();
|
|
43888
|
+
}
|
|
43889
|
+
}
|
|
43890
|
+
)
|
|
43891
|
+
] })
|
|
43892
|
+
}
|
|
43893
|
+
)
|
|
43713
43894
|
] });
|
|
43714
43895
|
};
|
|
43715
43896
|
const getVehicleFormDefaultValues = (vehicle) => {
|
|
43716
43897
|
if (vehicle) {
|
|
43717
43898
|
return {
|
|
43718
|
-
|
|
43719
|
-
model: vehicle.model,
|
|
43899
|
+
makeAndModel: vehicle.makeAndModel,
|
|
43720
43900
|
year: vehicle.year,
|
|
43721
43901
|
licensePlate: vehicle.licensePlate || "",
|
|
43722
43902
|
vin: vehicle.vin || "",
|
|
@@ -43724,33 +43904,31 @@ const getVehicleFormDefaultValues = (vehicle) => {
|
|
|
43724
43904
|
};
|
|
43725
43905
|
}
|
|
43726
43906
|
return {
|
|
43727
|
-
|
|
43728
|
-
|
|
43729
|
-
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
43907
|
+
makeAndModel: "",
|
|
43908
|
+
year: Number.NaN,
|
|
43730
43909
|
licensePlate: "",
|
|
43731
43910
|
vin: "",
|
|
43732
43911
|
description: ""
|
|
43733
43912
|
};
|
|
43734
43913
|
};
|
|
43735
43914
|
const validateVehicleForm = ({ vehicle }) => {
|
|
43736
|
-
const {
|
|
43915
|
+
const { makeAndModel, year } = vehicle;
|
|
43737
43916
|
const errors = [];
|
|
43738
|
-
if (!
|
|
43739
|
-
errors.push({
|
|
43917
|
+
if (!makeAndModel.trim()) {
|
|
43918
|
+
errors.push({ makeAndModel: "Make and model is a required field." });
|
|
43740
43919
|
}
|
|
43741
|
-
if (
|
|
43742
|
-
errors.push({
|
|
43920
|
+
if (Number.isNaN(year)) {
|
|
43921
|
+
errors.push({ year: "Year is a required field." });
|
|
43743
43922
|
}
|
|
43744
43923
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
43745
|
-
if (year < 1900 || year > currentYear + 1) {
|
|
43924
|
+
if (!Number.isNaN(year) && (year < 1900 || year > currentYear + 1)) {
|
|
43746
43925
|
errors.push({ year: `Year must be between 1900 and ${currentYear + 1}.` });
|
|
43747
43926
|
}
|
|
43748
43927
|
return errors.length > 0 ? errors : null;
|
|
43749
43928
|
};
|
|
43750
43929
|
const convertVehicleFormToUpsertVehicle = (form) => {
|
|
43751
43930
|
return {
|
|
43752
|
-
|
|
43753
|
-
model: form.model.trim(),
|
|
43931
|
+
makeAndModel: form.makeAndModel.trim(),
|
|
43754
43932
|
year: form.year,
|
|
43755
43933
|
licensePlate: form.licensePlate.trim() || null,
|
|
43756
43934
|
vin: form.vin.trim() || null,
|
|
@@ -43940,20 +44118,73 @@ const VehicleForm = (props) => {
|
|
|
43940
44118
|
) });
|
|
43941
44119
|
}
|
|
43942
44120
|
} }),
|
|
43943
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "
|
|
43944
|
-
|
|
43945
|
-
|
|
43946
|
-
|
|
43947
|
-
|
|
43948
|
-
|
|
43949
|
-
|
|
43950
|
-
|
|
43951
|
-
|
|
44121
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "makeAndModel", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44122
|
+
field.FormTextField,
|
|
44123
|
+
{
|
|
44124
|
+
label: "Make and model",
|
|
44125
|
+
inline: true,
|
|
44126
|
+
isReadOnly,
|
|
44127
|
+
placeholder: "Enter vehicle make and model",
|
|
44128
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__MakeAndModel`
|
|
44129
|
+
}
|
|
44130
|
+
) }),
|
|
44131
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "year", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44132
|
+
field.FormNumberField,
|
|
44133
|
+
{
|
|
44134
|
+
maxValue: 9999,
|
|
44135
|
+
label: "Year",
|
|
44136
|
+
inline: true,
|
|
44137
|
+
isReadOnly,
|
|
44138
|
+
placeholder: "Enter vehicle year",
|
|
44139
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Year`
|
|
44140
|
+
}
|
|
44141
|
+
) }),
|
|
44142
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "licensePlate", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44143
|
+
field.FormTextField,
|
|
44144
|
+
{
|
|
44145
|
+
label: "License plate",
|
|
44146
|
+
inline: true,
|
|
44147
|
+
isReadOnly,
|
|
44148
|
+
placeholder: "Enter license plate",
|
|
44149
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__LicensePlate`
|
|
44150
|
+
}
|
|
44151
|
+
) }),
|
|
44152
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "vin", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44153
|
+
field.FormTextField,
|
|
44154
|
+
{
|
|
44155
|
+
label: "VIN",
|
|
44156
|
+
inline: true,
|
|
44157
|
+
isReadOnly,
|
|
44158
|
+
placeholder: "Enter VIN",
|
|
44159
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Vin`
|
|
44160
|
+
}
|
|
44161
|
+
) }),
|
|
44162
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44163
|
+
field.FormTextAreaField,
|
|
44164
|
+
{
|
|
44165
|
+
label: "Description",
|
|
44166
|
+
inline: true,
|
|
44167
|
+
isReadOnly,
|
|
44168
|
+
placeholder: "Add description",
|
|
44169
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Description`
|
|
44170
|
+
}
|
|
44171
|
+
) }),
|
|
44172
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { justify: "end", className: `${VEHICLE_FORM_CSS_PREFIX}__Submit`, children: /* @__PURE__ */ jsxRuntime.jsx(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44173
|
+
Button,
|
|
44174
|
+
{
|
|
44175
|
+
type: "submit",
|
|
44176
|
+
isDisabled: !canSubmit,
|
|
44177
|
+
isPending: isSubmitting,
|
|
44178
|
+
onPress: () => {
|
|
44179
|
+
void form.handleSubmit();
|
|
44180
|
+
},
|
|
44181
|
+
children: "Save Vehicle"
|
|
44182
|
+
}
|
|
44183
|
+
) }) })
|
|
43952
44184
|
] });
|
|
43953
44185
|
};
|
|
43954
44186
|
const VEHICLE_CARD_FIELDS = [
|
|
43955
|
-
{ label: "Make", key: "
|
|
43956
|
-
{ label: "Model", key: "model" },
|
|
44187
|
+
{ label: "Make and model", key: "makeAndModel" },
|
|
43957
44188
|
{ label: "Year", key: "year" },
|
|
43958
44189
|
{ label: "License plate", key: "licensePlate" },
|
|
43959
44190
|
{ label: "VIN", key: "vin" },
|
|
@@ -44535,6 +44766,20 @@ const BusinessProvider = ({
|
|
|
44535
44766
|
}) => {
|
|
44536
44767
|
errorHandler.setOnError(onError);
|
|
44537
44768
|
const colors = buildColorsPalette(theme);
|
|
44769
|
+
const eventCallbacksRef = react.useRef(eventCallbacks);
|
|
44770
|
+
react.useEffect(() => {
|
|
44771
|
+
eventCallbacksRef.current = eventCallbacks;
|
|
44772
|
+
}, [eventCallbacks]);
|
|
44773
|
+
const stableEventCallbacks = react.useMemo(() => ({
|
|
44774
|
+
onTransactionCategorized: () => {
|
|
44775
|
+
var _a, _b;
|
|
44776
|
+
(_b = (_a = eventCallbacksRef.current) == null ? void 0 : _a.onTransactionCategorized) == null ? void 0 : _b.call(_a);
|
|
44777
|
+
},
|
|
44778
|
+
onTransactionsFetched: () => {
|
|
44779
|
+
var _a, _b;
|
|
44780
|
+
(_b = (_a = eventCallbacksRef.current) == null ? void 0 : _a.onTransactionsFetched) == null ? void 0 : _b.call(_a);
|
|
44781
|
+
}
|
|
44782
|
+
}), []);
|
|
44538
44783
|
const [state, dispatch] = react.useReducer(reducer, {
|
|
44539
44784
|
businessId,
|
|
44540
44785
|
business: void 0,
|
|
@@ -44679,7 +44924,7 @@ const BusinessProvider = ({
|
|
|
44679
44924
|
readTimestamps,
|
|
44680
44925
|
expireDataCaches: resetCaches,
|
|
44681
44926
|
hasBeenTouched,
|
|
44682
|
-
eventCallbacks,
|
|
44927
|
+
eventCallbacks: stableEventCallbacks,
|
|
44683
44928
|
accountingConfiguration,
|
|
44684
44929
|
dateRange
|
|
44685
44930
|
}),
|
|
@@ -44690,14 +44935,14 @@ const BusinessProvider = ({
|
|
|
44690
44935
|
}
|
|
44691
44936
|
);
|
|
44692
44937
|
};
|
|
44693
|
-
const LayerProvider = (
|
|
44694
|
-
var
|
|
44938
|
+
const LayerProvider = (_ud) => {
|
|
44939
|
+
var _vd = _ud, {
|
|
44695
44940
|
appId,
|
|
44696
44941
|
appSecret,
|
|
44697
44942
|
businessAccessToken,
|
|
44698
44943
|
environment,
|
|
44699
44944
|
usePlaidSandbox
|
|
44700
|
-
} =
|
|
44945
|
+
} = _vd, restProps = __objRest(_vd, [
|
|
44701
44946
|
"appId",
|
|
44702
44947
|
"appSecret",
|
|
44703
44948
|
"businessAccessToken",
|