@layerfi/components 0.1.114-alpha.3 → 0.1.114-alpha.5
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 +1067 -790
- package/dist/esm/index.mjs +1069 -792
- package/dist/index.css +242 -188
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
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.5";
|
|
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,
|
|
@@ -17733,6 +17951,7 @@ const BankTransactionRow = ({
|
|
|
17733
17951
|
processing: bankTransaction.processing,
|
|
17734
17952
|
active: open,
|
|
17735
17953
|
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
17954
|
+
disabled: selectedCategory === null,
|
|
17736
17955
|
children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
|
|
17737
17956
|
}
|
|
17738
17957
|
),
|
|
@@ -17806,6 +18025,7 @@ const BankTransactionRow = ({
|
|
|
17806
18025
|
className: "Layer__bank-transaction__submit-btn",
|
|
17807
18026
|
processing: bankTransaction.processing,
|
|
17808
18027
|
active: open,
|
|
18028
|
+
disabled: selectedCategory === null,
|
|
17809
18029
|
action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
|
|
17810
18030
|
children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
|
|
17811
18031
|
}
|
|
@@ -17971,6 +18191,9 @@ const BankTransactionsListItem = ({
|
|
|
17971
18191
|
const handleSave = () => {
|
|
17972
18192
|
void save();
|
|
17973
18193
|
};
|
|
18194
|
+
const preventRowExpansion = (e) => {
|
|
18195
|
+
e.stopPropagation();
|
|
18196
|
+
};
|
|
17974
18197
|
const openClassName = openExpandedRow ? "Layer__bank-transaction-list-item--expanded" : "";
|
|
17975
18198
|
const rowClassName = classNames(
|
|
17976
18199
|
"Layer__bank-transaction-list-item",
|
|
@@ -17978,7 +18201,7 @@ const BankTransactionsListItem = ({
|
|
|
17978
18201
|
openExpandedRow ? openClassName : "",
|
|
17979
18202
|
isVisible ? "show" : ""
|
|
17980
18203
|
);
|
|
17981
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: rowClassName, children: [
|
|
18204
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: rowClassName, onClick: toggleExpandedRow, children: [
|
|
17982
18205
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "Layer__bank-transaction-list-item__heading", children: [
|
|
17983
18206
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__bank-transaction-list-item__heading__main", children: [
|
|
17984
18207
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, size: "sm", children: dateFns.format(dateFns.parseISO(bankTransaction.date), dateFormat) }),
|
|
@@ -18009,7 +18232,7 @@ const BankTransactionsListItem = ({
|
|
|
18009
18232
|
] }),
|
|
18010
18233
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { className: "Layer__bank-transaction-list-item__body", children: [
|
|
18011
18234
|
/* @__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(
|
|
18235
|
+
categorizationEnabled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transaction-list-item__checkbox", onClick: preventRowExpansion, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18013
18236
|
Checkbox,
|
|
18014
18237
|
{
|
|
18015
18238
|
isSelected: isTransactionSelected,
|
|
@@ -18034,7 +18257,7 @@ const BankTransactionsListItem = ({
|
|
|
18034
18257
|
)
|
|
18035
18258
|
] }),
|
|
18036
18259
|
!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(
|
|
18260
|
+
/* @__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
18261
|
ExpandedBankTransactionRow,
|
|
18039
18262
|
{
|
|
18040
18263
|
ref: expandedRowRef,
|
|
@@ -18051,7 +18274,7 @@ const BankTransactionsListItem = ({
|
|
|
18051
18274
|
variant: "list"
|
|
18052
18275
|
}
|
|
18053
18276
|
) }, `expanded-${bankTransaction.id}`) }),
|
|
18054
|
-
!openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
|
|
18277
|
+
!openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: preventRowExpansion, children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
|
|
18055
18278
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18056
18279
|
BankTransactionCategoryComboBox,
|
|
18057
18280
|
{
|
|
@@ -18077,7 +18300,7 @@ const BankTransactionsListItem = ({
|
|
|
18077
18300
|
children: showRetry ? "Retry" : !categorized ? (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Approve" : (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update"
|
|
18078
18301
|
}
|
|
18079
18302
|
)
|
|
18080
|
-
] }),
|
|
18303
|
+
] }) }),
|
|
18081
18304
|
!openExpandedRow && categorized && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18082
18305
|
BankTransactionsListItemCategory,
|
|
18083
18306
|
{
|
|
@@ -18145,10 +18368,10 @@ const BankTransactionsList = ({
|
|
|
18145
18368
|
] });
|
|
18146
18369
|
};
|
|
18147
18370
|
const SWITCH_CLASS_NAME = "Layer__Switch";
|
|
18148
|
-
const Switch = react.forwardRef((
|
|
18149
|
-
var
|
|
18371
|
+
const Switch = react.forwardRef((_Rb, ref) => {
|
|
18372
|
+
var _Sb = _Rb, {
|
|
18150
18373
|
children
|
|
18151
|
-
} =
|
|
18374
|
+
} = _Sb, props = __objRest(_Sb, [
|
|
18152
18375
|
"children"
|
|
18153
18376
|
]);
|
|
18154
18377
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18287,8 +18510,8 @@ const BankTransactionsMobileListItemCheckbox = ({
|
|
|
18287
18510
|
}
|
|
18288
18511
|
) });
|
|
18289
18512
|
};
|
|
18290
|
-
const Paperclip = (
|
|
18291
|
-
var
|
|
18513
|
+
const Paperclip = (_Tb) => {
|
|
18514
|
+
var _Ub = _Tb, { size = 20 } = _Ub, props = __objRest(_Ub, ["size"]);
|
|
18292
18515
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18293
18516
|
"svg",
|
|
18294
18517
|
__spreadProps(__spreadValues({
|
|
@@ -18377,168 +18600,6 @@ const BusinessFormMobile = ({
|
|
|
18377
18600
|
)
|
|
18378
18601
|
] });
|
|
18379
18602
|
};
|
|
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
18603
|
const SELECT_CATEGORY_VALUE = "SELECT_CATEGORY";
|
|
18543
18604
|
const isSelectCategoryOption = (value) => {
|
|
18544
18605
|
return isPlaceholderAsOption(value) && value.value === SELECT_CATEGORY_VALUE;
|
|
@@ -18555,6 +18616,10 @@ const BankTransactionsMobileListBusinessForm = ({
|
|
|
18555
18616
|
const [sessionCategories, setSessionCategories] = react.useState(() => {
|
|
18556
18617
|
var _a;
|
|
18557
18618
|
const initialMap = /* @__PURE__ */ new Map();
|
|
18619
|
+
if (bankTransaction.category) {
|
|
18620
|
+
const existingCategory = convertApiCategorizationToCategoryOrSplitAsOption(bankTransaction.category);
|
|
18621
|
+
initialMap.set(existingCategory.value, existingCategory);
|
|
18622
|
+
}
|
|
18558
18623
|
if (((_a = bankTransaction == null ? void 0 : bankTransaction.categorization_flow) == null ? void 0 : _a.type) === CategorizationType.ASK_FROM_SUGGESTIONS) {
|
|
18559
18624
|
bankTransaction.categorization_flow.suggestions.forEach((suggestion) => {
|
|
18560
18625
|
const opt = new ApiCategorizationAsOption(suggestion);
|
|
@@ -18823,7 +18888,7 @@ const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
|
|
|
18823
18888
|
}
|
|
18824
18889
|
}
|
|
18825
18890
|
),
|
|
18826
|
-
inAppLink
|
|
18891
|
+
inAppLink && /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", children: inAppLink }) })
|
|
18827
18892
|
] })
|
|
18828
18893
|
},
|
|
18829
18894
|
match.id
|
|
@@ -18968,39 +19033,6 @@ const BankTransactionsMobileListMatchForm = ({
|
|
|
18968
19033
|
showRetry && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
|
|
18969
19034
|
] });
|
|
18970
19035
|
};
|
|
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
19036
|
const BankTransactionsMobileListSplitForm = ({
|
|
19005
19037
|
bankTransaction,
|
|
19006
19038
|
showTooltips,
|
|
@@ -19250,6 +19282,37 @@ const BankTransactionsMobileForms = ({
|
|
|
19250
19282
|
};
|
|
19251
19283
|
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: getContent() });
|
|
19252
19284
|
};
|
|
19285
|
+
const NewToggleOption = ({
|
|
19286
|
+
label,
|
|
19287
|
+
value
|
|
19288
|
+
}) => {
|
|
19289
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.ToggleButton, { id: value, className: "Layer__NewToggleOption", children: [
|
|
19290
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.SelectionIndicator, { className: "Layer__NewToggleOption-SelectionIndicator" }),
|
|
19291
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { className: "Layer__NewToggle-Option-Content", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { noWrap: true, children: label }) })
|
|
19292
|
+
] });
|
|
19293
|
+
};
|
|
19294
|
+
const NewToggle = ({
|
|
19295
|
+
options: options2,
|
|
19296
|
+
selectedKey,
|
|
19297
|
+
onSelectionChange
|
|
19298
|
+
}) => {
|
|
19299
|
+
const selectedKeys = selectedKey !== void 0 ? /* @__PURE__ */ new Set([selectedKey]) : /* @__PURE__ */ new Set();
|
|
19300
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19301
|
+
reactAriaComponents.ToggleButtonGroup,
|
|
19302
|
+
{
|
|
19303
|
+
className: "Layer__NewToggle",
|
|
19304
|
+
selectionMode: "single",
|
|
19305
|
+
selectedKeys,
|
|
19306
|
+
onSelectionChange: (keys2) => {
|
|
19307
|
+
const selectedKeysArray = Array.from(keys2);
|
|
19308
|
+
if (selectedKeysArray.length > 0 && onSelectionChange) {
|
|
19309
|
+
onSelectionChange(selectedKeysArray[0]);
|
|
19310
|
+
}
|
|
19311
|
+
},
|
|
19312
|
+
children: options2.map((option) => /* @__PURE__ */ jsxRuntime.jsx(NewToggleOption, __spreadValues({}, option), option.value))
|
|
19313
|
+
}
|
|
19314
|
+
);
|
|
19315
|
+
};
|
|
19253
19316
|
const PURPOSE_TOGGLE_OPTIONS = [
|
|
19254
19317
|
{
|
|
19255
19318
|
value: "business",
|
|
@@ -19269,27 +19332,27 @@ const PURPOSE_TOGGLE_OPTIONS = [
|
|
|
19269
19332
|
];
|
|
19270
19333
|
const BankTransactionsMobileListItemExpandedRow = ({
|
|
19271
19334
|
bankTransaction,
|
|
19335
|
+
isOpen,
|
|
19272
19336
|
showCategorization,
|
|
19273
19337
|
showDescriptions,
|
|
19274
19338
|
showReceiptUploads,
|
|
19275
19339
|
showTooltips
|
|
19276
19340
|
}) => {
|
|
19277
19341
|
const [purpose, setPurpose] = react.useState(getInitialPurpose(bankTransaction));
|
|
19278
|
-
const onChangePurpose = (
|
|
19342
|
+
const onChangePurpose = (key) => setPurpose(key);
|
|
19279
19343
|
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pi: "md", gap: "md", pbe: "md", children: [
|
|
19280
19344
|
showCategorization && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19281
|
-
|
|
19345
|
+
NewToggle,
|
|
19282
19346
|
{
|
|
19283
|
-
name: `purpose-${bankTransaction.id}`,
|
|
19284
|
-
size: ToggleSize.medium,
|
|
19285
19347
|
options: PURPOSE_TOGGLE_OPTIONS,
|
|
19286
|
-
|
|
19287
|
-
|
|
19348
|
+
selectedKey: purpose,
|
|
19349
|
+
onSelectionChange: onChangePurpose
|
|
19288
19350
|
}
|
|
19289
19351
|
),
|
|
19290
19352
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19291
19353
|
BankTransactionsMobileForms,
|
|
19292
19354
|
{
|
|
19355
|
+
isOpen,
|
|
19293
19356
|
purpose,
|
|
19294
19357
|
bankTransaction,
|
|
19295
19358
|
showCategorization,
|
|
@@ -19332,20 +19395,15 @@ var Purpose = /* @__PURE__ */ ((Purpose2) => {
|
|
|
19332
19395
|
Purpose2["more"] = "more";
|
|
19333
19396
|
return Purpose2;
|
|
19334
19397
|
})(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;
|
|
19398
|
+
const getInAppLink = (bankTransaction, renderInAppLink) => {
|
|
19399
|
+
var _a;
|
|
19400
|
+
if (bankTransaction.categorization_status === CategorizationStatus.MATCHED && renderInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
|
|
19401
|
+
const matchDetails = decodeMatchDetails(bankTransaction.match.details);
|
|
19402
|
+
if (matchDetails) {
|
|
19403
|
+
return renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails));
|
|
19345
19404
|
}
|
|
19346
|
-
return (_c = (_b = bankTransaction.match) == null ? void 0 : _b.details) == null ? void 0 : _c.description;
|
|
19347
19405
|
}
|
|
19348
|
-
return
|
|
19406
|
+
return null;
|
|
19349
19407
|
};
|
|
19350
19408
|
const BankTransactionsMobileListItem = ({
|
|
19351
19409
|
index: index2,
|
|
@@ -19453,6 +19511,12 @@ const BankTransactionsMobileListItem = ({
|
|
|
19453
19511
|
const isSelected = useIdIsSelected();
|
|
19454
19512
|
const isTransactionSelected = isSelected(bankTransaction.id);
|
|
19455
19513
|
const { renderInAppLink } = useInAppLinkContext();
|
|
19514
|
+
const inAppLink = react.useMemo(() => {
|
|
19515
|
+
if (!categorized) {
|
|
19516
|
+
return null;
|
|
19517
|
+
}
|
|
19518
|
+
return getInAppLink(bankTransaction, renderInAppLink);
|
|
19519
|
+
}, [categorized, bankTransaction, renderInAppLink]);
|
|
19456
19520
|
const { isVisible } = useDelayedVisibility({ delay: index2 * 20, initialVisibility: Boolean(initialLoad) });
|
|
19457
19521
|
const className = "Layer__bank-transaction-mobile-list-item";
|
|
19458
19522
|
const openClassName = open ? `${className}--expanded` : "";
|
|
@@ -19471,9 +19535,8 @@ const BankTransactionsMobileListItem = ({
|
|
|
19471
19535
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19472
19536
|
HStack,
|
|
19473
19537
|
{
|
|
19474
|
-
gap: "
|
|
19538
|
+
gap: "sm",
|
|
19475
19539
|
justify: "space-between",
|
|
19476
|
-
align: "center",
|
|
19477
19540
|
pie: "md",
|
|
19478
19541
|
children: [
|
|
19479
19542
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", overflow: "hidden", children: [
|
|
@@ -19490,12 +19553,12 @@ const BankTransactionsMobileListItem = ({
|
|
|
19490
19553
|
{
|
|
19491
19554
|
align: "start",
|
|
19492
19555
|
gap: "3xs",
|
|
19493
|
-
className: "
|
|
19556
|
+
className: "Layer__BankTransactionsMobileListItem__HeadingContentLeft",
|
|
19494
19557
|
pi: "md",
|
|
19495
19558
|
pb: "sm",
|
|
19496
19559
|
children: [
|
|
19497
19560
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description }),
|
|
19498
|
-
/* @__PURE__ */ jsxRuntime.jsx(Span, { className: "
|
|
19561
|
+
inAppLink && /* @__PURE__ */ jsxRuntime.jsx(Span, { className: "Layer__BankTransactionsMobileListItem__CategorizedValue", children: inAppLink }),
|
|
19499
19562
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "2xs", align: "center", children: [
|
|
19500
19563
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", ellipsis: true, children: fullAccountName }),
|
|
19501
19564
|
hasReceipts(bankTransaction) ? /* @__PURE__ */ jsxRuntime.jsx(File, { size: 12 }) : null
|
|
@@ -19520,7 +19583,7 @@ const BankTransactionsMobileListItem = ({
|
|
|
19520
19583
|
]
|
|
19521
19584
|
}
|
|
19522
19585
|
),
|
|
19523
|
-
!open && (!categorizationEnabled && !categorized ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
19586
|
+
!open && (!categorizationEnabled && !categorized ? /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, { showAsBadge: true }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
19524
19587
|
BankTransactionsListItemCategory,
|
|
19525
19588
|
{
|
|
19526
19589
|
bankTransaction,
|
|
@@ -19534,6 +19597,7 @@ const BankTransactionsMobileListItem = ({
|
|
|
19534
19597
|
BankTransactionsMobileListItemExpandedRow,
|
|
19535
19598
|
{
|
|
19536
19599
|
bankTransaction,
|
|
19600
|
+
isOpen: open,
|
|
19537
19601
|
showCategorization: categorizationEnabled,
|
|
19538
19602
|
showDescriptions,
|
|
19539
19603
|
showReceiptUploads,
|
|
@@ -19554,6 +19618,7 @@ const BankTransactionsMobileList = ({
|
|
|
19554
19618
|
const transactionToOpenContextData = useTransactionToOpen();
|
|
19555
19619
|
const [bulkActionsEnabled, setBulkActionsEnabled] = react.useState(false);
|
|
19556
19620
|
const { clearSelection } = useBulkSelectionActions();
|
|
19621
|
+
useUpsertBankTransactionsDefaultCategories(bankTransactions);
|
|
19557
19622
|
react.useEffect(() => {
|
|
19558
19623
|
if (!bulkActionsEnabled) {
|
|
19559
19624
|
clearSelection();
|
|
@@ -19724,6 +19789,7 @@ const BankTransactionsTable = ({
|
|
|
19724
19789
|
SyncingComponent,
|
|
19725
19790
|
{
|
|
19726
19791
|
title: "Syncing historical account data",
|
|
19792
|
+
timeSync: 5,
|
|
19727
19793
|
onRefresh: () => onRefresh && onRefresh()
|
|
19728
19794
|
}
|
|
19729
19795
|
) }) }) : null
|
|
@@ -19732,8 +19798,8 @@ const BankTransactionsTable = ({
|
|
|
19732
19798
|
}
|
|
19733
19799
|
);
|
|
19734
19800
|
};
|
|
19735
|
-
const BackArrow = (
|
|
19736
|
-
var
|
|
19801
|
+
const BackArrow = (_Vb) => {
|
|
19802
|
+
var _Wb = _Vb, { size = 18 } = _Wb, props = __objRest(_Wb, ["size"]);
|
|
19737
19803
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19738
19804
|
"svg",
|
|
19739
19805
|
__spreadProps(__spreadValues({
|
|
@@ -19901,8 +19967,8 @@ const usePaginationRange = ({
|
|
|
19901
19967
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
19902
19968
|
return paginationRange;
|
|
19903
19969
|
};
|
|
19904
|
-
const ChevronLeft = (
|
|
19905
|
-
var props = __objRest(
|
|
19970
|
+
const ChevronLeft = (_Xb) => {
|
|
19971
|
+
var props = __objRest(_Xb, []);
|
|
19906
19972
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19907
19973
|
"svg",
|
|
19908
19974
|
__spreadProps(__spreadValues({
|
|
@@ -19924,8 +19990,8 @@ const ChevronLeft = (_Tb) => {
|
|
|
19924
19990
|
})
|
|
19925
19991
|
);
|
|
19926
19992
|
};
|
|
19927
|
-
const PaginationButton = (
|
|
19928
|
-
var
|
|
19993
|
+
const PaginationButton = (_Yb) => {
|
|
19994
|
+
var _Zb = _Yb, { children, isSelected } = _Zb, buttonProps = __objRest(_Zb, ["children", "isSelected"]);
|
|
19929
19995
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19930
19996
|
Button,
|
|
19931
19997
|
__spreadProps(__spreadValues({
|
|
@@ -20354,8 +20420,8 @@ function usePreloadTagDimensions(parameters) {
|
|
|
20354
20420
|
useTagDimensions(parameters);
|
|
20355
20421
|
}
|
|
20356
20422
|
const COMPONENT_NAME$c = "bank-transactions";
|
|
20357
|
-
const BankTransactions = (
|
|
20358
|
-
var
|
|
20423
|
+
const BankTransactions = (__b) => {
|
|
20424
|
+
var _$b = __b, {
|
|
20359
20425
|
onError,
|
|
20360
20426
|
showTags = false,
|
|
20361
20427
|
showCustomerVendor = false,
|
|
@@ -20363,7 +20429,7 @@ const BankTransactions = (_Wb) => {
|
|
|
20363
20429
|
applyGlobalDateRange = false,
|
|
20364
20430
|
mode,
|
|
20365
20431
|
renderInAppLink
|
|
20366
|
-
} =
|
|
20432
|
+
} = _$b, props = __objRest(_$b, [
|
|
20367
20433
|
"onError",
|
|
20368
20434
|
"showTags",
|
|
20369
20435
|
"showCustomerVendor",
|
|
@@ -20593,7 +20659,7 @@ const BankTransactionsTableView = ({
|
|
|
20593
20659
|
}
|
|
20594
20660
|
)
|
|
20595
20661
|
] }),
|
|
20596
|
-
!isLoadingWithoutData && listView && mobileComponent !== "mobileList"
|
|
20662
|
+
!isLoadingWithoutData && listView && mobileComponent !== "mobileList" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__bank-transactions__list-wrapper", children: [
|
|
20597
20663
|
rulesSuggestionModal,
|
|
20598
20664
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20599
20665
|
BankTransactionsList,
|
|
@@ -20608,8 +20674,8 @@ const BankTransactionsTableView = ({
|
|
|
20608
20674
|
showTooltips
|
|
20609
20675
|
}
|
|
20610
20676
|
)
|
|
20611
|
-
] })
|
|
20612
|
-
!isLoadingWithoutData && listView && mobileComponent === "mobileList"
|
|
20677
|
+
] }),
|
|
20678
|
+
!isLoadingWithoutData && listView && mobileComponent === "mobileList" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20613
20679
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20614
20680
|
BankTransactionsMobileList,
|
|
20615
20681
|
{
|
|
@@ -20622,9 +20688,9 @@ const BankTransactionsTableView = ({
|
|
|
20622
20688
|
}
|
|
20623
20689
|
),
|
|
20624
20690
|
rulesSuggestionDrawer
|
|
20625
|
-
] })
|
|
20626
|
-
listView && isLoadingWithoutData
|
|
20627
|
-
!isSyncing || listView
|
|
20691
|
+
] }),
|
|
20692
|
+
listView && isLoadingWithoutData && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transactions__list-loader", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, {}) }),
|
|
20693
|
+
(!isSyncing || listView) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20628
20694
|
BankTransactionsTableEmptyStates,
|
|
20629
20695
|
{
|
|
20630
20696
|
hasVisibleTransactions: ((_a = bankTransactions == null ? void 0 : bankTransactions.length) != null ? _a : 0) > 0,
|
|
@@ -20633,7 +20699,7 @@ const BankTransactionsTableView = ({
|
|
|
20633
20699
|
isFiltered: Boolean(filters == null ? void 0 : filters.query),
|
|
20634
20700
|
isLoadingWithoutData
|
|
20635
20701
|
}
|
|
20636
|
-
)
|
|
20702
|
+
),
|
|
20637
20703
|
!isMonthlyViewMode && /* @__PURE__ */ jsxRuntime.jsx(HStack, { justify: "end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20638
20704
|
Pagination,
|
|
20639
20705
|
{
|
|
@@ -20728,8 +20794,8 @@ function QuickbooksContextProvider({ children }) {
|
|
|
20728
20794
|
const quickbooksContextData = useQuickbooks();
|
|
20729
20795
|
return /* @__PURE__ */ jsxRuntime.jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
|
|
20730
20796
|
}
|
|
20731
|
-
const Cog = (
|
|
20732
|
-
var
|
|
20797
|
+
const Cog = (_ac) => {
|
|
20798
|
+
var _bc = _ac, { size = 12 } = _bc, props = __objRest(_bc, ["size"]);
|
|
20733
20799
|
const id = react.useId();
|
|
20734
20800
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20735
20801
|
"svg",
|
|
@@ -20750,8 +20816,8 @@ const Cog = (_Yb) => {
|
|
|
20750
20816
|
})
|
|
20751
20817
|
);
|
|
20752
20818
|
};
|
|
20753
|
-
const QuickbooksIcon = (
|
|
20754
|
-
var
|
|
20819
|
+
const QuickbooksIcon = (_cc) => {
|
|
20820
|
+
var _dc = _cc, { size = 24 } = _dc, props = __objRest(_dc, ["size"]);
|
|
20755
20821
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20756
20822
|
"svg",
|
|
20757
20823
|
__spreadProps(__spreadValues({
|
|
@@ -20910,8 +20976,8 @@ function IntegrationsQuickbooksUnlinkConfirmationModal({ isOpen, onOpenChange })
|
|
|
20910
20976
|
}
|
|
20911
20977
|
);
|
|
20912
20978
|
}
|
|
20913
|
-
const MoreVertical = (
|
|
20914
|
-
var
|
|
20979
|
+
const MoreVertical = (_ec) => {
|
|
20980
|
+
var _fc = _ec, { size = 18 } = _fc, props = __objRest(_fc, ["size"]);
|
|
20915
20981
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20916
20982
|
"svg",
|
|
20917
20983
|
__spreadProps(__spreadValues({
|
|
@@ -21140,8 +21206,8 @@ const IntegrationsComponent = ({
|
|
|
21140
21206
|
(quickbooksConnectionStatus == null ? void 0 : quickbooksConnectionStatus.is_connected) && /* @__PURE__ */ jsxRuntime.jsx(IntegrationsContent, {})
|
|
21141
21207
|
] });
|
|
21142
21208
|
};
|
|
21143
|
-
const PlusIcon = (
|
|
21144
|
-
var
|
|
21209
|
+
const PlusIcon = (_gc) => {
|
|
21210
|
+
var _hc = _gc, { size = 14 } = _hc, props = __objRest(_hc, ["size"]);
|
|
21145
21211
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21146
21212
|
"svg",
|
|
21147
21213
|
__spreadProps(__spreadValues({
|
|
@@ -21183,8 +21249,8 @@ const PlusIcon = (_cc) => {
|
|
|
21183
21249
|
})
|
|
21184
21250
|
);
|
|
21185
21251
|
};
|
|
21186
|
-
const InstitutionIcon = (
|
|
21187
|
-
var
|
|
21252
|
+
const InstitutionIcon = (_ic) => {
|
|
21253
|
+
var _jc = _ic, { size = 18 } = _jc, props = __objRest(_jc, ["size"]);
|
|
21188
21254
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21189
21255
|
"svg",
|
|
21190
21256
|
__spreadProps(__spreadValues({
|
|
@@ -21491,10 +21557,10 @@ const InstitutionIcon = (_ec) => {
|
|
|
21491
21557
|
})
|
|
21492
21558
|
);
|
|
21493
21559
|
};
|
|
21494
|
-
const CLASS_NAME$
|
|
21560
|
+
const CLASS_NAME$4 = "Layer__BasicLinkedAccountContainer";
|
|
21495
21561
|
function BasicLinkedAccountContainer({ children, isSelected }) {
|
|
21496
21562
|
const dataProperties = toDataProperties({ selected: isSelected });
|
|
21497
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$
|
|
21563
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$4, children }));
|
|
21498
21564
|
}
|
|
21499
21565
|
function BasicLinkedAccountLogo({ account }) {
|
|
21500
21566
|
var _a, _b, _c;
|
|
@@ -21802,8 +21868,8 @@ const MenuItem = react.forwardRef(
|
|
|
21802
21868
|
);
|
|
21803
21869
|
const PILL_CLASS_NAME = "Layer__Pill";
|
|
21804
21870
|
const Pill = react.forwardRef(
|
|
21805
|
-
function Pill2(
|
|
21806
|
-
var
|
|
21871
|
+
function Pill2(_kc, ref) {
|
|
21872
|
+
var _lc = _kc, { children, status } = _lc, restProps = __objRest(_lc, ["children", "status"]);
|
|
21807
21873
|
const dataProperties = toDataProperties({ status });
|
|
21808
21874
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21809
21875
|
reactAriaComponents.Button,
|
|
@@ -22166,8 +22232,8 @@ const LinkedAccountsContent = ({
|
|
|
22166
22232
|
};
|
|
22167
22233
|
const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
|
|
22168
22234
|
const Calendar = react.forwardRef(
|
|
22169
|
-
function Calendar2(
|
|
22170
|
-
var
|
|
22235
|
+
function Calendar2(_mc, ref) {
|
|
22236
|
+
var _nc = _mc, { className, isReadOnly } = _nc, restProps = __objRest(_nc, ["className", "isReadOnly"]);
|
|
22171
22237
|
const dataProperties = toDataProperties({ readonly: isReadOnly });
|
|
22172
22238
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22173
22239
|
reactAriaComponents.Calendar,
|
|
@@ -22181,8 +22247,8 @@ const Calendar = react.forwardRef(
|
|
|
22181
22247
|
);
|
|
22182
22248
|
const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
|
|
22183
22249
|
const CalendarGrid = react.forwardRef(
|
|
22184
|
-
function CalendarGrid2(
|
|
22185
|
-
var
|
|
22250
|
+
function CalendarGrid2(_oc, ref) {
|
|
22251
|
+
var _pc = _oc, { className } = _pc, restProps = __objRest(_pc, ["className"]);
|
|
22186
22252
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22187
22253
|
reactAriaComponents.CalendarGrid,
|
|
22188
22254
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -22194,8 +22260,8 @@ const CalendarGrid = react.forwardRef(
|
|
|
22194
22260
|
);
|
|
22195
22261
|
const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
|
|
22196
22262
|
const CalendarGridBody = react.forwardRef(
|
|
22197
|
-
function CalendarGridBody2(
|
|
22198
|
-
var
|
|
22263
|
+
function CalendarGridBody2(_qc, ref) {
|
|
22264
|
+
var _rc = _qc, { className } = _rc, restProps = __objRest(_rc, ["className"]);
|
|
22199
22265
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22200
22266
|
reactAriaComponents.CalendarGridBody,
|
|
22201
22267
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -22207,8 +22273,8 @@ const CalendarGridBody = react.forwardRef(
|
|
|
22207
22273
|
);
|
|
22208
22274
|
const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
|
|
22209
22275
|
const CalendarCell = react.forwardRef(
|
|
22210
|
-
function CalendarCell2(
|
|
22211
|
-
var
|
|
22276
|
+
function CalendarCell2(_sc, ref) {
|
|
22277
|
+
var _tc = _sc, { className, size = "sm" } = _tc, restProps = __objRest(_tc, ["className", "size"]);
|
|
22212
22278
|
const dataProperties = toDataProperties({ size });
|
|
22213
22279
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22214
22280
|
reactAriaComponents.CalendarCell,
|
|
@@ -22221,8 +22287,8 @@ const CalendarCell = react.forwardRef(
|
|
|
22221
22287
|
);
|
|
22222
22288
|
const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
|
|
22223
22289
|
const CalendarGridHeader = react.forwardRef(
|
|
22224
|
-
function CalendarGridHeader2(
|
|
22225
|
-
var
|
|
22290
|
+
function CalendarGridHeader2(_uc, ref) {
|
|
22291
|
+
var _vc = _uc, { className } = _vc, restProps = __objRest(_vc, ["className"]);
|
|
22226
22292
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22227
22293
|
reactAriaComponents.CalendarGridHeader,
|
|
22228
22294
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -22234,8 +22300,8 @@ const CalendarGridHeader = react.forwardRef(
|
|
|
22234
22300
|
);
|
|
22235
22301
|
const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
|
|
22236
22302
|
const CalendarHeaderCell = react.forwardRef(
|
|
22237
|
-
function CalendarHeaderCell2(
|
|
22238
|
-
var
|
|
22303
|
+
function CalendarHeaderCell2(_wc, ref) {
|
|
22304
|
+
var _xc = _wc, { className, size = "sm" } = _xc, restProps = __objRest(_xc, ["className", "size"]);
|
|
22239
22305
|
const dataProperties = toDataProperties({ size });
|
|
22240
22306
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22241
22307
|
reactAriaComponents.CalendarHeaderCell,
|
|
@@ -22368,7 +22434,7 @@ const useDatePickerState = ({ date: date2, setDate, minDate = null, maxDate = nu
|
|
|
22368
22434
|
maxDateZdt
|
|
22369
22435
|
}), [errorText, isInvalid, localDate, onBlur, onChange, maxDateZdt, minDateZdt]);
|
|
22370
22436
|
};
|
|
22371
|
-
const CLASS_NAME$
|
|
22437
|
+
const CLASS_NAME$3 = "Layer__caobfb";
|
|
22372
22438
|
const AccountFormBox = ({
|
|
22373
22439
|
account,
|
|
22374
22440
|
value,
|
|
@@ -22401,8 +22467,8 @@ const AccountFormBox = ({
|
|
|
22401
22467
|
onChange(__spreadProps(__spreadValues({}, value), { isDateInvalid }));
|
|
22402
22468
|
}
|
|
22403
22469
|
}, [isDateInvalid, onChange, value]);
|
|
22404
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$
|
|
22405
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22470
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$3, children: [
|
|
22471
|
+
/* @__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
22472
|
"img",
|
|
22407
22473
|
{
|
|
22408
22474
|
width: 32,
|
|
@@ -22411,13 +22477,13 @@ const AccountFormBox = ({
|
|
|
22411
22477
|
alt: ((_b = account.institution) == null ? void 0 : _b.name) ? (_c = account.institution) == null ? void 0 : _c.name : account.external_account_name
|
|
22412
22478
|
}
|
|
22413
22479
|
) : /* @__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$
|
|
22480
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col`, children: [
|
|
22481
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col__details`, children: [
|
|
22482
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col__name`, children: [
|
|
22417
22483
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22418
22484
|
Text,
|
|
22419
22485
|
{
|
|
22420
|
-
className: `${CLASS_NAME$
|
|
22486
|
+
className: `${CLASS_NAME$3}__details-col__name__institution-name`,
|
|
22421
22487
|
size: TextSize.sm,
|
|
22422
22488
|
children: (_d = account.institution) == null ? void 0 : _d.name
|
|
22423
22489
|
}
|
|
@@ -22425,7 +22491,7 @@ const AccountFormBox = ({
|
|
|
22425
22491
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22426
22492
|
Text,
|
|
22427
22493
|
{
|
|
22428
|
-
className: `${CLASS_NAME$
|
|
22494
|
+
className: `${CLASS_NAME$3}__details-col__name__account-name`,
|
|
22429
22495
|
size: TextSize.sm,
|
|
22430
22496
|
children: account.external_account_name
|
|
22431
22497
|
}
|
|
@@ -22436,7 +22502,7 @@ const AccountFormBox = ({
|
|
|
22436
22502
|
account.mask
|
|
22437
22503
|
] })
|
|
22438
22504
|
] }),
|
|
22439
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22505
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$3}__details-col__inputs`, children: [
|
|
22440
22506
|
/* @__PURE__ */ jsxRuntime.jsx(InputGroup, { label: "Opening date", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22441
22507
|
DatePicker,
|
|
22442
22508
|
{
|
|
@@ -22465,7 +22531,7 @@ const AccountFormBox = ({
|
|
|
22465
22531
|
] }),
|
|
22466
22532
|
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
22533
|
] }),
|
|
22468
|
-
!disableConfirmExclude && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22534
|
+
!disableConfirmExclude && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$3}__confirm-col`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22469
22535
|
Checkbox,
|
|
22470
22536
|
{
|
|
22471
22537
|
size: "lg",
|
|
@@ -22474,7 +22540,7 @@ const AccountFormBox = ({
|
|
|
22474
22540
|
"aria-label": "Confirm Account Inclusion"
|
|
22475
22541
|
}
|
|
22476
22542
|
) }),
|
|
22477
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22543
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$3}__success-banner`, children: /* @__PURE__ */ jsxRuntime.jsx(CheckCircle, { size: 36 }) })
|
|
22478
22544
|
] }));
|
|
22479
22545
|
};
|
|
22480
22546
|
function buildKey$z({
|
|
@@ -23350,8 +23416,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
23350
23416
|
refetch
|
|
23351
23417
|
};
|
|
23352
23418
|
};
|
|
23353
|
-
const BarChart2 = (
|
|
23354
|
-
var
|
|
23419
|
+
const BarChart2 = (_yc) => {
|
|
23420
|
+
var _zc = _yc, { size = 12 } = _zc, props = __objRest(_zc, ["size"]);
|
|
23355
23421
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23356
23422
|
"svg",
|
|
23357
23423
|
__spreadProps(__spreadValues({
|
|
@@ -24141,11 +24207,11 @@ const ProfitAndLossChart = ({
|
|
|
24141
24207
|
isSyncing && !hasNonZeroData ? /* @__PURE__ */ jsxRuntime.jsx(ChartStateCard, {}) : null
|
|
24142
24208
|
] });
|
|
24143
24209
|
};
|
|
24144
|
-
const BackButton = (
|
|
24145
|
-
var
|
|
24210
|
+
const BackButton = (_Ac) => {
|
|
24211
|
+
var _Bc = _Ac, {
|
|
24146
24212
|
className,
|
|
24147
24213
|
textOnly = false
|
|
24148
|
-
} =
|
|
24214
|
+
} = _Bc, props = __objRest(_Bc, [
|
|
24149
24215
|
"className",
|
|
24150
24216
|
"textOnly"
|
|
24151
24217
|
]);
|
|
@@ -24193,8 +24259,8 @@ const TASKS_CHARTS_COLORS = {
|
|
|
24193
24259
|
done: "#3B9C63",
|
|
24194
24260
|
pending: "#DFA000"
|
|
24195
24261
|
};
|
|
24196
|
-
const SortArrows = (
|
|
24197
|
-
var
|
|
24262
|
+
const SortArrows = (_Cc) => {
|
|
24263
|
+
var _Dc = _Cc, { size = 13 } = _Dc, props = __objRest(_Dc, ["size"]);
|
|
24198
24264
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
24199
24265
|
"svg",
|
|
24200
24266
|
__spreadProps(__spreadValues({
|
|
@@ -24859,11 +24925,11 @@ const LedgerAccountsContext = react.createContext({
|
|
|
24859
24925
|
fetchMore: () => {
|
|
24860
24926
|
}
|
|
24861
24927
|
});
|
|
24862
|
-
const CloseButton = (
|
|
24863
|
-
var
|
|
24928
|
+
const CloseButton = (_Ec) => {
|
|
24929
|
+
var _Fc = _Ec, {
|
|
24864
24930
|
className,
|
|
24865
24931
|
textOnly = false
|
|
24866
|
-
} =
|
|
24932
|
+
} = _Fc, props = __objRest(_Fc, [
|
|
24867
24933
|
"className",
|
|
24868
24934
|
"textOnly"
|
|
24869
24935
|
]);
|
|
@@ -25601,7 +25667,7 @@ const ProfitAndLossDetailReport = ({
|
|
|
25601
25667
|
),
|
|
25602
25668
|
rowsWithRunningBalance.lines.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { pb: "sm", align: "center", className: "Layer__profit-and-loss-detail-report__total-row", children: [
|
|
25603
25669
|
/* @__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, {
|
|
25670
|
+
/* @__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
25671
|
] })
|
|
25606
25672
|
] }) });
|
|
25607
25673
|
};
|
|
@@ -26758,7 +26824,7 @@ const ProfitAndLossTableComponent = ({
|
|
|
26758
26824
|
{
|
|
26759
26825
|
variant: "text",
|
|
26760
26826
|
onPress: () => onLineItemClick(lineItem.name, currentBreadcrumbs),
|
|
26761
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, {
|
|
26827
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { amount: (_a = lineItem.value) != null ? _a : 0, weight: "bold" })
|
|
26762
26828
|
}
|
|
26763
26829
|
)
|
|
26764
26830
|
}
|
|
@@ -27040,6 +27106,19 @@ const ProfitAndLossReport = ({
|
|
|
27040
27106
|
}
|
|
27041
27107
|
) }) });
|
|
27042
27108
|
};
|
|
27109
|
+
function calculatePercentageChange(current, previous) {
|
|
27110
|
+
if (current >= 0 && previous < 0 || current < 0 && previous >= 0) {
|
|
27111
|
+
return null;
|
|
27112
|
+
}
|
|
27113
|
+
if (previous === 0) {
|
|
27114
|
+
return current === 0 ? null : 100;
|
|
27115
|
+
}
|
|
27116
|
+
return (current - previous) / Math.abs(previous) * 100;
|
|
27117
|
+
}
|
|
27118
|
+
function formatPercentageChange(value) {
|
|
27119
|
+
if (value === null) return "";
|
|
27120
|
+
return `${Math.abs(value).toFixed(0)}%`;
|
|
27121
|
+
}
|
|
27043
27122
|
const LIST_ITEM_CLASS_NAME = "Layer__ProfitAndLossSummariesListItem";
|
|
27044
27123
|
function ProfitAndLossSummariesListItem({
|
|
27045
27124
|
children,
|
|
@@ -27151,24 +27230,49 @@ function ProfitAndLossSummariesHeading({
|
|
|
27151
27230
|
const { size = "2xs" } = variants2 != null ? variants2 : {};
|
|
27152
27231
|
return /* @__PURE__ */ jsxRuntime.jsx(Heading$1, { level: 3, size, slot: "heading", children });
|
|
27153
27232
|
}
|
|
27154
|
-
const CLASS_NAME$3 = "Layer__ProfitAndLossSummariesSummary";
|
|
27155
27233
|
const CHART_AREA_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryChartArea";
|
|
27156
|
-
const CHART_AREA_EMPTY_FRAME_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryChartAreaEmptyFrame";
|
|
27157
27234
|
function ProfitAndLossSummariesSummary({
|
|
27158
27235
|
label,
|
|
27159
27236
|
amount,
|
|
27160
27237
|
isLoading,
|
|
27238
|
+
percentChange,
|
|
27239
|
+
comparisonMonth,
|
|
27240
|
+
isExpense = false,
|
|
27161
27241
|
slots,
|
|
27162
27242
|
variants: variants2
|
|
27163
27243
|
}) {
|
|
27164
27244
|
const { Chart } = slots != null ? slots : {};
|
|
27165
|
-
const
|
|
27166
|
-
const
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27170
|
-
|
|
27171
|
-
|
|
27245
|
+
const showPercentChange = percentChange !== void 0 && percentChange !== null && comparisonMonth;
|
|
27246
|
+
const isGoodChange = showPercentChange && (isExpense ? percentChange < 0 : percentChange >= 0);
|
|
27247
|
+
const arrow = showPercentChange && percentChange >= 0 ? "↑" : "↓";
|
|
27248
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
27249
|
+
Chart && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27250
|
+
HStack,
|
|
27251
|
+
{
|
|
27252
|
+
align: "center",
|
|
27253
|
+
justify: "center",
|
|
27254
|
+
className: CHART_AREA_CLASS_NAME,
|
|
27255
|
+
children: Chart
|
|
27256
|
+
}
|
|
27257
|
+
),
|
|
27258
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", fluid: true, pi: "sm", children: [
|
|
27259
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, children: [
|
|
27260
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: label }),
|
|
27261
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(SkeletonLoader, { height: "20px" }) : /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { slot: "amount", amount, size: "lg", weight: "bold" })
|
|
27262
|
+
] }),
|
|
27263
|
+
showPercentChange && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", align: "end", children: [
|
|
27264
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "3xs", align: "center", children: [
|
|
27265
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", weight: "bold", status: isGoodChange ? "success" : void 0, children: arrow }),
|
|
27266
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", weight: "normal", status: isGoodChange ? "success" : void 0, children: formatPercentageChange(percentChange != null ? percentChange : null) })
|
|
27267
|
+
] }),
|
|
27268
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Span, { size: "xs", variant: "subtle", noWrap: true, children: [
|
|
27269
|
+
"vs.",
|
|
27270
|
+
" ",
|
|
27271
|
+
comparisonMonth || ""
|
|
27272
|
+
] })
|
|
27273
|
+
] })
|
|
27274
|
+
] })
|
|
27275
|
+
] });
|
|
27172
27276
|
}
|
|
27173
27277
|
const CLASS_NAME$2 = "Layer__TransactionsToReview";
|
|
27174
27278
|
function TransactionsToReview({
|
|
@@ -27275,6 +27379,14 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27275
27379
|
setSidebarScope,
|
|
27276
27380
|
sidebarScope
|
|
27277
27381
|
} = react.useContext(ProfitAndLossContext);
|
|
27382
|
+
const { startDate, endDate: _endDate } = useGlobalDateRange({ displayMode: "month" });
|
|
27383
|
+
const previousMonthStart = dateFns.sub(startDate, { months: 1 });
|
|
27384
|
+
const { data: previousData } = useProfitAndLossSummaries({
|
|
27385
|
+
startYear: previousMonthStart.getFullYear(),
|
|
27386
|
+
startMonth: previousMonthStart.getMonth() + 1,
|
|
27387
|
+
endYear: previousMonthStart.getFullYear(),
|
|
27388
|
+
endMonth: previousMonthStart.getMonth() + 1
|
|
27389
|
+
});
|
|
27278
27390
|
const { revenueChartData, expensesChartData } = react.useMemo(
|
|
27279
27391
|
() => ({
|
|
27280
27392
|
revenueChartData: toMiniChartData({ scope: "revenue", data }),
|
|
@@ -27282,7 +27394,35 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27282
27394
|
}),
|
|
27283
27395
|
[data]
|
|
27284
27396
|
);
|
|
27285
|
-
const effectiveData =
|
|
27397
|
+
const effectiveData = react.useMemo(
|
|
27398
|
+
() => data != null ? data : { income: { value: 0 }, netProfit: 0 },
|
|
27399
|
+
[data]
|
|
27400
|
+
);
|
|
27401
|
+
const comparisonData = react.useMemo(() => {
|
|
27402
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g;
|
|
27403
|
+
const previousMonthData = (_a2 = previousData == null ? void 0 : previousData.months) == null ? void 0 : _a2[0];
|
|
27404
|
+
if (!previousMonthData) {
|
|
27405
|
+
return null;
|
|
27406
|
+
}
|
|
27407
|
+
const currentRevenue = (_b2 = effectiveData.income.value) != null ? _b2 : 0;
|
|
27408
|
+
const previousRevenue = (_c2 = previousMonthData.income) != null ? _c2 : 0;
|
|
27409
|
+
const currentExpenses = ((_d2 = effectiveData.income.value) != null ? _d2 : 0) - effectiveData.netProfit;
|
|
27410
|
+
const previousExpenses = (_e = previousMonthData.totalExpenses) != null ? _e : 0;
|
|
27411
|
+
const currentNetProfit = (_f = effectiveData.netProfit) != null ? _f : 0;
|
|
27412
|
+
const previousNetProfit = (_g = previousMonthData.netProfit) != null ? _g : 0;
|
|
27413
|
+
return {
|
|
27414
|
+
revenuePercentChange: calculatePercentageChange(currentRevenue, previousRevenue),
|
|
27415
|
+
expensesPercentChange: calculatePercentageChange(currentExpenses, previousExpenses),
|
|
27416
|
+
netProfitPercentChange: calculatePercentageChange(currentNetProfit, previousNetProfit),
|
|
27417
|
+
comparisonMonth: dateFns.format(previousMonthStart, "MMM")
|
|
27418
|
+
};
|
|
27419
|
+
}, [previousData, effectiveData, previousMonthStart]);
|
|
27420
|
+
const {
|
|
27421
|
+
revenuePercentChange = null,
|
|
27422
|
+
expensesPercentChange = null,
|
|
27423
|
+
netProfitPercentChange = null,
|
|
27424
|
+
comparisonMonth = null
|
|
27425
|
+
} = comparisonData != null ? comparisonData : {};
|
|
27286
27426
|
const { unstable_AdditionalListItems = [] } = slots != null ? slots : {};
|
|
27287
27427
|
const listItemCount = unstable_AdditionalListItems.length + 3;
|
|
27288
27428
|
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: SECTION_CLASS_NAMES, children: /* @__PURE__ */ jsxRuntime.jsxs(ProfitAndLossSummariesList, { itemCount: listItemCount, children: [
|
|
@@ -27297,6 +27437,8 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27297
27437
|
label: (stringOverrides == null ? void 0 : stringOverrides.revenueLabel) || revenueLabel || "Revenue",
|
|
27298
27438
|
amount: (_a = effectiveData.income.value) != null ? _a : 0,
|
|
27299
27439
|
isLoading,
|
|
27440
|
+
percentChange: revenuePercentChange,
|
|
27441
|
+
comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0,
|
|
27300
27442
|
slots: {
|
|
27301
27443
|
Chart: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27302
27444
|
ProfitAndLossSummariesMiniChart,
|
|
@@ -27323,6 +27465,9 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27323
27465
|
label: (stringOverrides == null ? void 0 : stringOverrides.expensesLabel) || "Expenses",
|
|
27324
27466
|
amount: ((_c = (_b = effectiveData == null ? void 0 : effectiveData.income) == null ? void 0 : _b.value) != null ? _c : 0) - effectiveData.netProfit,
|
|
27325
27467
|
isLoading,
|
|
27468
|
+
percentChange: expensesPercentChange,
|
|
27469
|
+
comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0,
|
|
27470
|
+
isExpense: true,
|
|
27326
27471
|
slots: {
|
|
27327
27472
|
Chart: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27328
27473
|
ProfitAndLossSummariesMiniChart,
|
|
@@ -27344,16 +27489,18 @@ function Internal_ProfitAndLossSummaries({
|
|
|
27344
27489
|
label: (stringOverrides == null ? void 0 : stringOverrides.netProfitLabel) || "Net Profit",
|
|
27345
27490
|
amount: (_d = data == null ? void 0 : data.netProfit) != null ? _d : 0,
|
|
27346
27491
|
variants: variants2,
|
|
27347
|
-
isLoading
|
|
27492
|
+
isLoading,
|
|
27493
|
+
percentChange: netProfitPercentChange,
|
|
27494
|
+
comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0
|
|
27348
27495
|
}
|
|
27349
27496
|
) }),
|
|
27350
27497
|
unstable_AdditionalListItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesListItem, { children: item }, index2))
|
|
27351
27498
|
] }) });
|
|
27352
27499
|
}
|
|
27353
|
-
function ProfitAndLossSummaries(
|
|
27354
|
-
var
|
|
27500
|
+
function ProfitAndLossSummaries(_Gc) {
|
|
27501
|
+
var _Hc = _Gc, {
|
|
27355
27502
|
onTransactionsToReviewClick
|
|
27356
|
-
} =
|
|
27503
|
+
} = _Hc, restProps = __objRest(_Hc, [
|
|
27357
27504
|
"onTransactionsToReviewClick"
|
|
27358
27505
|
]);
|
|
27359
27506
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -27553,8 +27700,8 @@ function BalanceSheetDownloadButton({
|
|
|
27553
27700
|
/* @__PURE__ */ jsxRuntime.jsx(InvisibleDownload, { ref: invisibleDownloadRef })
|
|
27554
27701
|
] });
|
|
27555
27702
|
}
|
|
27556
|
-
const Collapse = (
|
|
27557
|
-
var props = __objRest(
|
|
27703
|
+
const Collapse = (_Ic) => {
|
|
27704
|
+
var props = __objRest(_Ic, []);
|
|
27558
27705
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27559
27706
|
"svg",
|
|
27560
27707
|
__spreadProps(__spreadValues({
|
|
@@ -27587,8 +27734,8 @@ const Collapse = (_Ec) => {
|
|
|
27587
27734
|
})
|
|
27588
27735
|
);
|
|
27589
27736
|
};
|
|
27590
|
-
const Expand = (
|
|
27591
|
-
var props = __objRest(
|
|
27737
|
+
const Expand = (_Jc) => {
|
|
27738
|
+
var props = __objRest(_Jc, []);
|
|
27592
27739
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27593
27740
|
"svg",
|
|
27594
27741
|
__spreadProps(__spreadValues({
|
|
@@ -29236,8 +29383,8 @@ const ChartOfAccountsContext = react.createContext(
|
|
|
29236
29383
|
}
|
|
29237
29384
|
}
|
|
29238
29385
|
);
|
|
29239
|
-
const Plus = (
|
|
29240
|
-
var
|
|
29386
|
+
const Plus = (_Kc) => {
|
|
29387
|
+
var _Lc = _Kc, { size = 14 } = _Lc, props = __objRest(_Lc, ["size"]);
|
|
29241
29388
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29242
29389
|
"svg",
|
|
29243
29390
|
__spreadProps(__spreadValues({
|
|
@@ -29604,8 +29751,8 @@ var LedgerAccountNodeType = /* @__PURE__ */ ((LedgerAccountNodeType2) => {
|
|
|
29604
29751
|
LedgerAccountNodeType2["Parent"] = "Parent";
|
|
29605
29752
|
return LedgerAccountNodeType2;
|
|
29606
29753
|
})(LedgerAccountNodeType || {});
|
|
29607
|
-
const Edit2 = (
|
|
29608
|
-
var
|
|
29754
|
+
const Edit2 = (_Mc) => {
|
|
29755
|
+
var _Nc = _Mc, { size = 18 } = _Nc, props = __objRest(_Nc, ["size"]);
|
|
29609
29756
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29610
29757
|
"svg",
|
|
29611
29758
|
__spreadProps(__spreadValues({
|
|
@@ -32286,8 +32433,8 @@ function usePaginatedList(list, pageSize) {
|
|
|
32286
32433
|
reset
|
|
32287
32434
|
};
|
|
32288
32435
|
}
|
|
32289
|
-
const SmileIcon = (
|
|
32290
|
-
var
|
|
32436
|
+
const SmileIcon = (_Oc) => {
|
|
32437
|
+
var _Pc = _Oc, { size = 12 } = _Pc, props = __objRest(_Pc, ["size"]);
|
|
32291
32438
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32292
32439
|
"svg",
|
|
32293
32440
|
__spreadProps(__spreadValues({
|
|
@@ -33132,8 +33279,8 @@ const useBookkeepingYearsStatus = () => {
|
|
|
33132
33279
|
isLoading
|
|
33133
33280
|
};
|
|
33134
33281
|
};
|
|
33135
|
-
const ArrowRightCircle = (
|
|
33136
|
-
var
|
|
33282
|
+
const ArrowRightCircle = (_Qc) => {
|
|
33283
|
+
var _Rc = _Qc, { size = 18 } = _Rc, props = __objRest(_Rc, ["size"]);
|
|
33137
33284
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33138
33285
|
"svg",
|
|
33139
33286
|
__spreadProps(__spreadValues({
|
|
@@ -35181,12 +35328,12 @@ const FormSection = ({ children, title }) => {
|
|
|
35181
35328
|
children
|
|
35182
35329
|
] });
|
|
35183
35330
|
};
|
|
35184
|
-
const PhoneInput = (
|
|
35185
|
-
var
|
|
35331
|
+
const PhoneInput = (_Sc) => {
|
|
35332
|
+
var _Tc = _Sc, {
|
|
35186
35333
|
value,
|
|
35187
35334
|
onChange,
|
|
35188
35335
|
placeholder = "Phone number"
|
|
35189
|
-
} =
|
|
35336
|
+
} = _Tc, props = __objRest(_Tc, [
|
|
35190
35337
|
"value",
|
|
35191
35338
|
"onChange",
|
|
35192
35339
|
"placeholder"
|
|
@@ -35478,8 +35625,8 @@ const SummaryStep = ({ onNext, title = defaultTitle$1, description = defaultDesc
|
|
|
35478
35625
|
/* @__PURE__ */ jsxRuntime.jsx(Button$1, { onClick: onNext, children: nextBtnText })
|
|
35479
35626
|
] });
|
|
35480
35627
|
};
|
|
35481
|
-
const Document = (
|
|
35482
|
-
var
|
|
35628
|
+
const Document = (_Uc) => {
|
|
35629
|
+
var _Vc = _Uc, { size = 20 } = _Vc, props = __objRest(_Vc, ["size"]);
|
|
35483
35630
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
35484
35631
|
"svg",
|
|
35485
35632
|
__spreadProps(__spreadValues({
|
|
@@ -35584,8 +35731,8 @@ const Document = (_Qc) => {
|
|
|
35584
35731
|
})
|
|
35585
35732
|
);
|
|
35586
35733
|
};
|
|
35587
|
-
const TrendingUp = (
|
|
35588
|
-
var
|
|
35734
|
+
const TrendingUp = (_Wc) => {
|
|
35735
|
+
var _Xc = _Wc, { size = 20 } = _Xc, props = __objRest(_Xc, ["size"]);
|
|
35589
35736
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
35590
35737
|
"svg",
|
|
35591
35738
|
__spreadProps(__spreadValues({
|
|
@@ -35842,8 +35989,8 @@ const PlatformOnboarding = ({ onComplete }) => {
|
|
|
35842
35989
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
|
|
35843
35990
|
] }) });
|
|
35844
35991
|
};
|
|
35845
|
-
const CoffeeIcon = (
|
|
35846
|
-
var
|
|
35992
|
+
const CoffeeIcon = (_Yc) => {
|
|
35993
|
+
var _Zc = _Yc, { size = 11 } = _Zc, props = __objRest(_Zc, ["size"]);
|
|
35847
35994
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
35848
35995
|
"svg",
|
|
35849
35996
|
__spreadProps(__spreadValues({
|
|
@@ -35914,8 +36061,8 @@ const CoffeeIcon = (_Uc) => {
|
|
|
35914
36061
|
})
|
|
35915
36062
|
);
|
|
35916
36063
|
};
|
|
35917
|
-
const Link$1 = (
|
|
35918
|
-
var
|
|
36064
|
+
const Link$1 = (__c) => {
|
|
36065
|
+
var _$c = __c, {
|
|
35919
36066
|
className,
|
|
35920
36067
|
children,
|
|
35921
36068
|
variant = ButtonVariant.primary,
|
|
@@ -35925,7 +36072,7 @@ const Link$1 = (_Wc) => {
|
|
|
35925
36072
|
iconAsPrimary = false,
|
|
35926
36073
|
justify = "center",
|
|
35927
36074
|
fullWidth
|
|
35928
|
-
} =
|
|
36075
|
+
} = _$c, props = __objRest(_$c, [
|
|
35929
36076
|
"className",
|
|
35930
36077
|
"children",
|
|
35931
36078
|
"variant",
|
|
@@ -36017,8 +36164,8 @@ const BookkeepingUpsellBar = ({
|
|
|
36017
36164
|
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
36165
|
] });
|
|
36019
36166
|
};
|
|
36020
|
-
const ChevronRightFill = (
|
|
36021
|
-
var
|
|
36167
|
+
const ChevronRightFill = (_ad) => {
|
|
36168
|
+
var _bd = _ad, { size = 18 } = _bd, props = __objRest(_bd, ["size"]);
|
|
36022
36169
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36023
36170
|
"svg",
|
|
36024
36171
|
__spreadProps(__spreadValues({
|
|
@@ -39300,8 +39447,8 @@ const getClassnameForSubComponent = (className, suffix) => {
|
|
|
39300
39447
|
};
|
|
39301
39448
|
const METER_CLASS_NAME = "Layer__Meter";
|
|
39302
39449
|
const Meter = react.forwardRef(
|
|
39303
|
-
function Meter2(
|
|
39304
|
-
var
|
|
39450
|
+
function Meter2(_cd, ref) {
|
|
39451
|
+
var _dd = _cd, { className, label, meterOnly } = _dd, restProps = __objRest(_dd, ["className", "label", "meterOnly"]);
|
|
39305
39452
|
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
39453
|
!meterOnly && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", children: [
|
|
39307
39454
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", children: label }),
|
|
@@ -39416,11 +39563,11 @@ const ProfitAndLossView = (props) => {
|
|
|
39416
39563
|
const containerRef = react.useRef(null);
|
|
39417
39564
|
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
39565
|
};
|
|
39419
|
-
const ProfitAndLossPanel = (
|
|
39420
|
-
var
|
|
39566
|
+
const ProfitAndLossPanel = (_ed) => {
|
|
39567
|
+
var _fd = _ed, {
|
|
39421
39568
|
containerRef,
|
|
39422
39569
|
stringOverrides
|
|
39423
|
-
} =
|
|
39570
|
+
} = _fd, props = __objRest(_fd, [
|
|
39424
39571
|
"containerRef",
|
|
39425
39572
|
"stringOverrides"
|
|
39426
39573
|
]);
|
|
@@ -39683,13 +39830,13 @@ function ExpandableDataTable({
|
|
|
39683
39830
|
);
|
|
39684
39831
|
}
|
|
39685
39832
|
const UNIFIED_REPORT_TAG_KEY = "#unified-report";
|
|
39686
|
-
function buildKey$7(
|
|
39687
|
-
var
|
|
39833
|
+
function buildKey$7(_gd) {
|
|
39834
|
+
var _hd = _gd, {
|
|
39688
39835
|
access_token: accessToken,
|
|
39689
39836
|
apiUrl,
|
|
39690
39837
|
businessId,
|
|
39691
39838
|
report
|
|
39692
|
-
} =
|
|
39839
|
+
} = _hd, dateParams = __objRest(_hd, [
|
|
39693
39840
|
"access_token",
|
|
39694
39841
|
"apiUrl",
|
|
39695
39842
|
"businessId",
|
|
@@ -39705,8 +39852,8 @@ function buildKey$7(_cd) {
|
|
|
39705
39852
|
}, dateParams);
|
|
39706
39853
|
}
|
|
39707
39854
|
}
|
|
39708
|
-
const getUnifiedReport = get$1((
|
|
39709
|
-
var
|
|
39855
|
+
const getUnifiedReport = get$1((_id) => {
|
|
39856
|
+
var _jd = _id, { businessId, report } = _jd, dateParams = __objRest(_jd, ["businessId", "report"]);
|
|
39710
39857
|
const parameters = toDefinedSearchParameters(__spreadValues({}, dateParams));
|
|
39711
39858
|
return `/v1/businesses/${businessId}/reports/unified/${report}?${parameters}`;
|
|
39712
39859
|
});
|
|
@@ -39735,8 +39882,8 @@ class UnifiedReportSWRResponse {
|
|
|
39735
39882
|
return this.swrResponse.mutate;
|
|
39736
39883
|
}
|
|
39737
39884
|
}
|
|
39738
|
-
function useUnifiedReport(
|
|
39739
|
-
var
|
|
39885
|
+
function useUnifiedReport(_kd) {
|
|
39886
|
+
var _ld = _kd, { report } = _ld, dateParams = __objRest(_ld, ["report"]);
|
|
39740
39887
|
const { data: auth } = useAuth();
|
|
39741
39888
|
const { apiUrl } = useEnvironment();
|
|
39742
39889
|
const { businessId } = useLayerContext();
|
|
@@ -41266,19 +41413,19 @@ const VendorsProvider = ({ children }) => {
|
|
|
41266
41413
|
const vendors = useVendors();
|
|
41267
41414
|
return /* @__PURE__ */ jsxRuntime.jsx(VendorsContext.Provider, { value: vendors, children });
|
|
41268
41415
|
};
|
|
41269
|
-
const SelectVendor = (
|
|
41270
|
-
var
|
|
41416
|
+
const SelectVendor = (_md) => {
|
|
41417
|
+
var _nd = _md, { withContext = true } = _nd, props = __objRest(_nd, ["withContext"]);
|
|
41271
41418
|
if (withContext) {
|
|
41272
41419
|
return /* @__PURE__ */ jsxRuntime.jsx(VendorsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props)) });
|
|
41273
41420
|
}
|
|
41274
41421
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props));
|
|
41275
41422
|
};
|
|
41276
|
-
const SelectVendorContent = (
|
|
41277
|
-
var
|
|
41423
|
+
const SelectVendorContent = (_od) => {
|
|
41424
|
+
var _pd = _od, {
|
|
41278
41425
|
value,
|
|
41279
41426
|
onChange,
|
|
41280
41427
|
placeholder = "Select vendor"
|
|
41281
|
-
} =
|
|
41428
|
+
} = _pd, props = __objRest(_pd, [
|
|
41282
41429
|
"value",
|
|
41283
41430
|
"onChange",
|
|
41284
41431
|
"placeholder"
|
|
@@ -42045,8 +42192,8 @@ const BillsTableWithPanel = ({
|
|
|
42045
42192
|
}
|
|
42046
42193
|
);
|
|
42047
42194
|
};
|
|
42048
|
-
const Bills = (
|
|
42049
|
-
var
|
|
42195
|
+
const Bills = (_qd) => {
|
|
42196
|
+
var _rd = _qd, { context = true } = _rd, props = __objRest(_rd, ["context"]);
|
|
42050
42197
|
if (context) {
|
|
42051
42198
|
return /* @__PURE__ */ jsxRuntime.jsx(BillsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(BillsContent, __spreadValues({}, props)) });
|
|
42052
42199
|
}
|
|
@@ -42104,8 +42251,8 @@ const getTimezoneDisplay = (date2) => {
|
|
|
42104
42251
|
};
|
|
42105
42252
|
const LINK_CLASS_NAME = "Layer__UI__Link";
|
|
42106
42253
|
const Link = react.forwardRef(
|
|
42107
|
-
function Link2(
|
|
42108
|
-
var
|
|
42254
|
+
function Link2(_sd, ref) {
|
|
42255
|
+
var _td = _sd, {
|
|
42109
42256
|
children,
|
|
42110
42257
|
size = "md",
|
|
42111
42258
|
ellipsis,
|
|
@@ -42114,7 +42261,7 @@ const Link = react.forwardRef(
|
|
|
42114
42261
|
href,
|
|
42115
42262
|
target,
|
|
42116
42263
|
rel
|
|
42117
|
-
} =
|
|
42264
|
+
} = _td, restProps = __objRest(_td, [
|
|
42118
42265
|
"children",
|
|
42119
42266
|
"size",
|
|
42120
42267
|
"ellipsis",
|
|
@@ -42617,8 +42764,10 @@ const VehicleSchema = effect.Schema.Struct({
|
|
|
42617
42764
|
effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)),
|
|
42618
42765
|
effect.Schema.fromKey("external_id")
|
|
42619
42766
|
),
|
|
42620
|
-
|
|
42621
|
-
|
|
42767
|
+
makeAndModel: effect.pipe(
|
|
42768
|
+
effect.Schema.propertySignature(effect.Schema.String),
|
|
42769
|
+
effect.Schema.fromKey("make_and_model")
|
|
42770
|
+
),
|
|
42622
42771
|
year: effect.Schema.Number,
|
|
42623
42772
|
licensePlate: effect.pipe(
|
|
42624
42773
|
effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)),
|
|
@@ -42640,16 +42789,17 @@ const VehicleSchema = effect.Schema.Struct({
|
|
|
42640
42789
|
)
|
|
42641
42790
|
});
|
|
42642
42791
|
effect.Schema.Struct({
|
|
42643
|
-
|
|
42644
|
-
model: effect.Schema.String,
|
|
42792
|
+
makeAndModel: effect.Schema.String,
|
|
42645
42793
|
year: effect.Schema.Number,
|
|
42646
42794
|
licensePlate: effect.Schema.String,
|
|
42647
42795
|
vin: effect.Schema.String,
|
|
42648
42796
|
description: effect.Schema.String
|
|
42649
42797
|
});
|
|
42650
42798
|
const UpsertVehicleSchema = effect.Schema.Struct({
|
|
42651
|
-
|
|
42652
|
-
|
|
42799
|
+
makeAndModel: effect.pipe(
|
|
42800
|
+
effect.Schema.propertySignature(effect.Schema.String),
|
|
42801
|
+
effect.Schema.fromKey("make_and_model")
|
|
42802
|
+
),
|
|
42653
42803
|
year: effect.Schema.Number,
|
|
42654
42804
|
licensePlate: effect.pipe(
|
|
42655
42805
|
effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.String)),
|
|
@@ -42891,9 +43041,6 @@ const getTripFormDefaultValues = (trip) => {
|
|
|
42891
43041
|
const validateTripForm = ({ trip }) => {
|
|
42892
43042
|
const { vehicle, tripDate, distance, purpose } = trip;
|
|
42893
43043
|
const errors = [];
|
|
42894
|
-
if (vehicle === null) {
|
|
42895
|
-
errors.push({ vehicle: "Vehicle is a required field." });
|
|
42896
|
-
}
|
|
42897
43044
|
if (tripDate === null) {
|
|
42898
43045
|
errors.push({ tripDate: "Trip date is a required field." });
|
|
42899
43046
|
}
|
|
@@ -42906,6 +43053,9 @@ const validateTripForm = ({ trip }) => {
|
|
|
42906
43053
|
if (!purpose) {
|
|
42907
43054
|
errors.push({ purpose: "Purpose is a required field." });
|
|
42908
43055
|
}
|
|
43056
|
+
if (vehicle === null) {
|
|
43057
|
+
errors.push({ vehicle: "Vehicle is a required field." });
|
|
43058
|
+
}
|
|
42909
43059
|
return errors.length > 0 ? errors : null;
|
|
42910
43060
|
};
|
|
42911
43061
|
const convertTripFormToUpsertTrip = (form) => {
|
|
@@ -43204,8 +43354,7 @@ const useTripForm = (props) => {
|
|
|
43204
43354
|
);
|
|
43205
43355
|
};
|
|
43206
43356
|
const formatDistance = (distance) => {
|
|
43207
|
-
|
|
43208
|
-
return `${distanceNum.toFixed(1)} mi`;
|
|
43357
|
+
return `${effect.BigDecimal.format(distance)} mi`;
|
|
43209
43358
|
};
|
|
43210
43359
|
const getPurposeLabel = (purpose) => {
|
|
43211
43360
|
var _a;
|
|
@@ -43318,7 +43467,7 @@ function useListVehicles() {
|
|
|
43318
43467
|
);
|
|
43319
43468
|
return new ListVehiclesSWRResponse(response);
|
|
43320
43469
|
}
|
|
43321
|
-
const getVehicleDisplayName = (vehicle) =>
|
|
43470
|
+
const getVehicleDisplayName = (vehicle) => `${vehicle.year} ${vehicle.makeAndModel}`;
|
|
43322
43471
|
class VehicleAsOption {
|
|
43323
43472
|
constructor(vehicle) {
|
|
43324
43473
|
__publicField(this, "internalVehicle");
|
|
@@ -43433,33 +43582,88 @@ const TripForm = (props) => {
|
|
|
43433
43582
|
) });
|
|
43434
43583
|
}
|
|
43435
43584
|
} }),
|
|
43436
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.
|
|
43437
|
-
|
|
43585
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "tripDate", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43586
|
+
field.FormDateField,
|
|
43438
43587
|
{
|
|
43439
|
-
|
|
43440
|
-
|
|
43588
|
+
label: "Trip date",
|
|
43589
|
+
inline: true,
|
|
43441
43590
|
isReadOnly,
|
|
43591
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__TripDate`
|
|
43592
|
+
}
|
|
43593
|
+
) }),
|
|
43594
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "distance", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43595
|
+
field.FormBigDecimalField,
|
|
43596
|
+
{
|
|
43597
|
+
label: "Distance (miles)",
|
|
43442
43598
|
inline: true,
|
|
43443
|
-
|
|
43599
|
+
isReadOnly,
|
|
43600
|
+
maxDecimalPlaces: 2,
|
|
43601
|
+
placeholder: "Enter distance",
|
|
43602
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Distance`
|
|
43603
|
+
}
|
|
43604
|
+
) }),
|
|
43605
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "startAddress", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43606
|
+
field.FormTextField,
|
|
43607
|
+
{
|
|
43608
|
+
label: "Start address",
|
|
43609
|
+
inline: true,
|
|
43610
|
+
isReadOnly,
|
|
43611
|
+
placeholder: "Enter address",
|
|
43612
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__StartAddress`
|
|
43613
|
+
}
|
|
43614
|
+
) }),
|
|
43615
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "endAddress", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43616
|
+
field.FormTextField,
|
|
43617
|
+
{
|
|
43618
|
+
label: "End address",
|
|
43619
|
+
inline: true,
|
|
43620
|
+
isReadOnly,
|
|
43621
|
+
placeholder: "Enter address",
|
|
43622
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__EndAddress`
|
|
43444
43623
|
}
|
|
43445
43624
|
) }),
|
|
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
43625
|
/* @__PURE__ */ jsxRuntime.jsx(form.Field, { name: "purpose", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43449
43626
|
TripPurposeComboBox,
|
|
43450
43627
|
{
|
|
43451
|
-
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Purpose`,
|
|
43452
43628
|
value: field.state.value,
|
|
43453
43629
|
onValueChange: (value) => field.handleChange(value != null ? value : TripPurpose.Unreviewed),
|
|
43454
|
-
isReadOnly
|
|
43630
|
+
isReadOnly,
|
|
43631
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Purpose`
|
|
43455
43632
|
}
|
|
43456
43633
|
) }),
|
|
43457
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "
|
|
43458
|
-
|
|
43459
|
-
|
|
43460
|
-
|
|
43461
|
-
|
|
43462
|
-
|
|
43634
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43635
|
+
field.FormTextAreaField,
|
|
43636
|
+
{
|
|
43637
|
+
label: "Description",
|
|
43638
|
+
inline: true,
|
|
43639
|
+
isReadOnly,
|
|
43640
|
+
placeholder: "Add description",
|
|
43641
|
+
className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Description`
|
|
43642
|
+
}
|
|
43643
|
+
) }),
|
|
43644
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.Field, { name: "vehicle", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
43645
|
+
VehicleSelector,
|
|
43646
|
+
{
|
|
43647
|
+
selectedVehicle: field.state.value,
|
|
43648
|
+
onSelectedVehicleChange: field.handleChange,
|
|
43649
|
+
isReadOnly,
|
|
43650
|
+
inline: true,
|
|
43651
|
+
placeholder: "Add vehicle",
|
|
43652
|
+
containerClassName: `${TRIP_FORM_FIELD_CSS_PREFIX}__Vehicle`
|
|
43653
|
+
}
|
|
43654
|
+
) }),
|
|
43655
|
+
/* @__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(
|
|
43656
|
+
Button,
|
|
43657
|
+
{
|
|
43658
|
+
type: "submit",
|
|
43659
|
+
isDisabled: !canSubmit,
|
|
43660
|
+
isPending: isSubmitting,
|
|
43661
|
+
onPress: () => {
|
|
43662
|
+
void form.handleSubmit();
|
|
43663
|
+
},
|
|
43664
|
+
children: "Save Trip"
|
|
43665
|
+
}
|
|
43666
|
+
) }) })
|
|
43463
43667
|
] });
|
|
43464
43668
|
};
|
|
43465
43669
|
const TripsTableHeaderMenu = () => {
|
|
@@ -43691,32 +43895,40 @@ const TripsTable = () => {
|
|
|
43691
43895
|
}
|
|
43692
43896
|
)
|
|
43693
43897
|
] }),
|
|
43694
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43695
|
-
|
|
43696
|
-
|
|
43697
|
-
|
|
43698
|
-
|
|
43699
|
-
|
|
43700
|
-
|
|
43701
|
-
|
|
43702
|
-
|
|
43703
|
-
|
|
43704
|
-
|
|
43705
|
-
|
|
43706
|
-
|
|
43707
|
-
|
|
43708
|
-
|
|
43709
|
-
|
|
43710
|
-
|
|
43711
|
-
|
|
43712
|
-
|
|
43898
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43899
|
+
Drawer,
|
|
43900
|
+
{
|
|
43901
|
+
isOpen: isTripDrawerOpen,
|
|
43902
|
+
onOpenChange: setIsTripDrawerOpen,
|
|
43903
|
+
isDismissable: true,
|
|
43904
|
+
"aria-label": selectedTrip ? "Trip details" : "Record trip",
|
|
43905
|
+
children: ({ close: close2 }) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pb: "lg", children: [
|
|
43906
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { pi: "md", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43907
|
+
ModalTitleWithClose,
|
|
43908
|
+
{
|
|
43909
|
+
heading: /* @__PURE__ */ jsxRuntime.jsx(ModalHeading, { size: "md", children: selectedTrip ? "Trip details" : "Record trip" }),
|
|
43910
|
+
onClose: close2
|
|
43911
|
+
}
|
|
43912
|
+
) }),
|
|
43913
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43914
|
+
TripForm,
|
|
43915
|
+
{
|
|
43916
|
+
trip: selectedTrip != null ? selectedTrip : void 0,
|
|
43917
|
+
onSuccess: () => {
|
|
43918
|
+
setSelectedTrip(null);
|
|
43919
|
+
close2();
|
|
43920
|
+
}
|
|
43921
|
+
}
|
|
43922
|
+
)
|
|
43923
|
+
] })
|
|
43924
|
+
}
|
|
43925
|
+
)
|
|
43713
43926
|
] });
|
|
43714
43927
|
};
|
|
43715
43928
|
const getVehicleFormDefaultValues = (vehicle) => {
|
|
43716
43929
|
if (vehicle) {
|
|
43717
43930
|
return {
|
|
43718
|
-
|
|
43719
|
-
model: vehicle.model,
|
|
43931
|
+
makeAndModel: vehicle.makeAndModel,
|
|
43720
43932
|
year: vehicle.year,
|
|
43721
43933
|
licensePlate: vehicle.licensePlate || "",
|
|
43722
43934
|
vin: vehicle.vin || "",
|
|
@@ -43724,33 +43936,31 @@ const getVehicleFormDefaultValues = (vehicle) => {
|
|
|
43724
43936
|
};
|
|
43725
43937
|
}
|
|
43726
43938
|
return {
|
|
43727
|
-
|
|
43728
|
-
|
|
43729
|
-
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
43939
|
+
makeAndModel: "",
|
|
43940
|
+
year: Number.NaN,
|
|
43730
43941
|
licensePlate: "",
|
|
43731
43942
|
vin: "",
|
|
43732
43943
|
description: ""
|
|
43733
43944
|
};
|
|
43734
43945
|
};
|
|
43735
43946
|
const validateVehicleForm = ({ vehicle }) => {
|
|
43736
|
-
const {
|
|
43947
|
+
const { makeAndModel, year } = vehicle;
|
|
43737
43948
|
const errors = [];
|
|
43738
|
-
if (!
|
|
43739
|
-
errors.push({
|
|
43949
|
+
if (!makeAndModel.trim()) {
|
|
43950
|
+
errors.push({ makeAndModel: "Make and model is a required field." });
|
|
43740
43951
|
}
|
|
43741
|
-
if (
|
|
43742
|
-
errors.push({
|
|
43952
|
+
if (Number.isNaN(year)) {
|
|
43953
|
+
errors.push({ year: "Year is a required field." });
|
|
43743
43954
|
}
|
|
43744
43955
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
43745
|
-
if (year < 1900 || year > currentYear + 1) {
|
|
43956
|
+
if (!Number.isNaN(year) && (year < 1900 || year > currentYear + 1)) {
|
|
43746
43957
|
errors.push({ year: `Year must be between 1900 and ${currentYear + 1}.` });
|
|
43747
43958
|
}
|
|
43748
43959
|
return errors.length > 0 ? errors : null;
|
|
43749
43960
|
};
|
|
43750
43961
|
const convertVehicleFormToUpsertVehicle = (form) => {
|
|
43751
43962
|
return {
|
|
43752
|
-
|
|
43753
|
-
model: form.model.trim(),
|
|
43963
|
+
makeAndModel: form.makeAndModel.trim(),
|
|
43754
43964
|
year: form.year,
|
|
43755
43965
|
licensePlate: form.licensePlate.trim() || null,
|
|
43756
43966
|
vin: form.vin.trim() || null,
|
|
@@ -43940,20 +44150,73 @@ const VehicleForm = (props) => {
|
|
|
43940
44150
|
) });
|
|
43941
44151
|
}
|
|
43942
44152
|
} }),
|
|
43943
|
-
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "
|
|
43944
|
-
|
|
43945
|
-
|
|
43946
|
-
|
|
43947
|
-
|
|
43948
|
-
|
|
43949
|
-
|
|
43950
|
-
|
|
43951
|
-
|
|
44153
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "makeAndModel", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44154
|
+
field.FormTextField,
|
|
44155
|
+
{
|
|
44156
|
+
label: "Make and model",
|
|
44157
|
+
inline: true,
|
|
44158
|
+
isReadOnly,
|
|
44159
|
+
placeholder: "Enter vehicle make and model",
|
|
44160
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__MakeAndModel`
|
|
44161
|
+
}
|
|
44162
|
+
) }),
|
|
44163
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "year", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44164
|
+
field.FormNumberField,
|
|
44165
|
+
{
|
|
44166
|
+
maxValue: 9999,
|
|
44167
|
+
label: "Year",
|
|
44168
|
+
inline: true,
|
|
44169
|
+
isReadOnly,
|
|
44170
|
+
placeholder: "Enter vehicle year",
|
|
44171
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Year`
|
|
44172
|
+
}
|
|
44173
|
+
) }),
|
|
44174
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "licensePlate", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44175
|
+
field.FormTextField,
|
|
44176
|
+
{
|
|
44177
|
+
label: "License plate",
|
|
44178
|
+
inline: true,
|
|
44179
|
+
isReadOnly,
|
|
44180
|
+
placeholder: "Enter license plate",
|
|
44181
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__LicensePlate`
|
|
44182
|
+
}
|
|
44183
|
+
) }),
|
|
44184
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "vin", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44185
|
+
field.FormTextField,
|
|
44186
|
+
{
|
|
44187
|
+
label: "VIN",
|
|
44188
|
+
inline: true,
|
|
44189
|
+
isReadOnly,
|
|
44190
|
+
placeholder: "Enter VIN",
|
|
44191
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Vin`
|
|
44192
|
+
}
|
|
44193
|
+
) }),
|
|
44194
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
44195
|
+
field.FormTextAreaField,
|
|
44196
|
+
{
|
|
44197
|
+
label: "Description",
|
|
44198
|
+
inline: true,
|
|
44199
|
+
isReadOnly,
|
|
44200
|
+
placeholder: "Add description",
|
|
44201
|
+
className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Description`
|
|
44202
|
+
}
|
|
44203
|
+
) }),
|
|
44204
|
+
/* @__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(
|
|
44205
|
+
Button,
|
|
44206
|
+
{
|
|
44207
|
+
type: "submit",
|
|
44208
|
+
isDisabled: !canSubmit,
|
|
44209
|
+
isPending: isSubmitting,
|
|
44210
|
+
onPress: () => {
|
|
44211
|
+
void form.handleSubmit();
|
|
44212
|
+
},
|
|
44213
|
+
children: "Save Vehicle"
|
|
44214
|
+
}
|
|
44215
|
+
) }) })
|
|
43952
44216
|
] });
|
|
43953
44217
|
};
|
|
43954
44218
|
const VEHICLE_CARD_FIELDS = [
|
|
43955
|
-
{ label: "Make", key: "
|
|
43956
|
-
{ label: "Model", key: "model" },
|
|
44219
|
+
{ label: "Make and model", key: "makeAndModel" },
|
|
43957
44220
|
{ label: "Year", key: "year" },
|
|
43958
44221
|
{ label: "License plate", key: "licensePlate" },
|
|
43959
44222
|
{ label: "VIN", key: "vin" },
|
|
@@ -44535,6 +44798,20 @@ const BusinessProvider = ({
|
|
|
44535
44798
|
}) => {
|
|
44536
44799
|
errorHandler.setOnError(onError);
|
|
44537
44800
|
const colors = buildColorsPalette(theme);
|
|
44801
|
+
const eventCallbacksRef = react.useRef(eventCallbacks);
|
|
44802
|
+
react.useEffect(() => {
|
|
44803
|
+
eventCallbacksRef.current = eventCallbacks;
|
|
44804
|
+
}, [eventCallbacks]);
|
|
44805
|
+
const stableEventCallbacks = react.useMemo(() => ({
|
|
44806
|
+
onTransactionCategorized: () => {
|
|
44807
|
+
var _a, _b;
|
|
44808
|
+
(_b = (_a = eventCallbacksRef.current) == null ? void 0 : _a.onTransactionCategorized) == null ? void 0 : _b.call(_a);
|
|
44809
|
+
},
|
|
44810
|
+
onTransactionsFetched: () => {
|
|
44811
|
+
var _a, _b;
|
|
44812
|
+
(_b = (_a = eventCallbacksRef.current) == null ? void 0 : _a.onTransactionsFetched) == null ? void 0 : _b.call(_a);
|
|
44813
|
+
}
|
|
44814
|
+
}), []);
|
|
44538
44815
|
const [state, dispatch] = react.useReducer(reducer, {
|
|
44539
44816
|
businessId,
|
|
44540
44817
|
business: void 0,
|
|
@@ -44679,7 +44956,7 @@ const BusinessProvider = ({
|
|
|
44679
44956
|
readTimestamps,
|
|
44680
44957
|
expireDataCaches: resetCaches,
|
|
44681
44958
|
hasBeenTouched,
|
|
44682
|
-
eventCallbacks,
|
|
44959
|
+
eventCallbacks: stableEventCallbacks,
|
|
44683
44960
|
accountingConfiguration,
|
|
44684
44961
|
dateRange
|
|
44685
44962
|
}),
|
|
@@ -44690,14 +44967,14 @@ const BusinessProvider = ({
|
|
|
44690
44967
|
}
|
|
44691
44968
|
);
|
|
44692
44969
|
};
|
|
44693
|
-
const LayerProvider = (
|
|
44694
|
-
var
|
|
44970
|
+
const LayerProvider = (_ud) => {
|
|
44971
|
+
var _vd = _ud, {
|
|
44695
44972
|
appId,
|
|
44696
44973
|
appSecret,
|
|
44697
44974
|
businessAccessToken,
|
|
44698
44975
|
environment,
|
|
44699
44976
|
usePlaidSandbox
|
|
44700
|
-
} =
|
|
44977
|
+
} = _vd, restProps = __objRest(_vd, [
|
|
44701
44978
|
"appId",
|
|
44702
44979
|
"appSecret",
|
|
44703
44980
|
"businessAccessToken",
|