@layerfi/components 0.1.44 → 0.1.46
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/esm/index.js +572 -562
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +26 -36
- package/dist/index.js +779 -769
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +7 -0
- package/dist/styles/index.css.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -608,6 +608,7 @@ var DEPENDENCIES = {
|
|
|
608
608
|
["PROFIT_AND_LOSS" /* PROFIT_AND_LOSS */]: ALL_TOUCHABLE,
|
|
609
609
|
["STATEMENT_OF_CASH_FLOWS" /* STATEMENT_OF_CASH_FLOWS */]: ALL_TOUCHABLE
|
|
610
610
|
};
|
|
611
|
+
var readTimestampsG = {};
|
|
611
612
|
var useDataSync = () => {
|
|
612
613
|
const initialTimestamp = Date.now();
|
|
613
614
|
const [syncTimestamps, setSyncTimestamps] = (0, import_react7.useState)({
|
|
@@ -619,38 +620,31 @@ var useDataSync = () => {
|
|
|
619
620
|
["PROFIT_AND_LOSS" /* PROFIT_AND_LOSS */]: initialTimestamp,
|
|
620
621
|
["STATEMENT_OF_CASH_FLOWS" /* STATEMENT_OF_CASH_FLOWS */]: initialTimestamp
|
|
621
622
|
});
|
|
622
|
-
const [readTimestamps, setReadTimestamps] = (0, import_react7.useState)({
|
|
623
|
-
["BALANCE_SHEET" /* BALANCE_SHEET */]: initialTimestamp,
|
|
624
|
-
["CHART_OF_ACCOUNTS" /* CHART_OF_ACCOUNTS */]: initialTimestamp,
|
|
625
|
-
["JOURNAL" /* JOURNAL */]: initialTimestamp,
|
|
626
|
-
["LEDGER_ACCOUNTS" /* LEDGER_ACCOUNTS */]: initialTimestamp,
|
|
627
|
-
["LINKED_ACCOUNTS" /* LINKED_ACCOUNTS */]: initialTimestamp,
|
|
628
|
-
["PROFIT_AND_LOSS" /* PROFIT_AND_LOSS */]: initialTimestamp,
|
|
629
|
-
["STATEMENT_OF_CASH_FLOWS" /* STATEMENT_OF_CASH_FLOWS */]: initialTimestamp
|
|
630
|
-
});
|
|
623
|
+
const [readTimestamps, setReadTimestamps] = (0, import_react7.useState)({});
|
|
631
624
|
const touch = (model) => {
|
|
632
625
|
setSyncTimestamps({
|
|
633
626
|
...syncTimestamps,
|
|
634
627
|
[model]: Date.now()
|
|
635
628
|
});
|
|
636
629
|
};
|
|
637
|
-
const read = (model) => {
|
|
638
|
-
|
|
639
|
-
...
|
|
640
|
-
[
|
|
641
|
-
|
|
630
|
+
const read = (model, cacheKey) => {
|
|
631
|
+
readTimestampsG = {
|
|
632
|
+
...readTimestampsG,
|
|
633
|
+
[cacheKey]: {
|
|
634
|
+
t: Date.now(),
|
|
635
|
+
m: model
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
setReadTimestamps({ ...readTimestampsG });
|
|
642
639
|
};
|
|
643
|
-
const hasBeenTouched = (
|
|
644
|
-
|
|
640
|
+
const hasBeenTouched = (cacheKey) => {
|
|
641
|
+
const lastRead = cacheKey in readTimestamps ? readTimestamps[cacheKey] : void 0;
|
|
642
|
+
if (!lastRead || !lastRead?.m || !lastRead?.t) {
|
|
645
643
|
return false;
|
|
646
644
|
}
|
|
647
|
-
const lastRead = model in readTimestamps ? readTimestamps[model] : void 0;
|
|
648
|
-
if (!lastRead) {
|
|
649
|
-
false;
|
|
650
|
-
}
|
|
651
645
|
return Boolean(
|
|
652
|
-
DEPENDENCIES[
|
|
653
|
-
return dep in syncTimestamps && Boolean(syncTimestamps[dep]) && syncTimestamps[dep] > lastRead;
|
|
646
|
+
DEPENDENCIES[lastRead.m]?.find((dep) => {
|
|
647
|
+
return dep in syncTimestamps && Boolean(syncTimestamps[dep]) && syncTimestamps[dep] > lastRead.t;
|
|
654
648
|
})
|
|
655
649
|
);
|
|
656
650
|
};
|
|
@@ -704,7 +698,7 @@ var DisplayState = /* @__PURE__ */ ((DisplayState2) => {
|
|
|
704
698
|
|
|
705
699
|
// src/types/categories.ts
|
|
706
700
|
function hasSuggestions(categorization) {
|
|
707
|
-
return categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
701
|
+
return categorization != null && categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
708
702
|
}
|
|
709
703
|
|
|
710
704
|
// src/contexts/BankTransactionsContext/BankTransactionsContext.tsx
|
|
@@ -1068,11 +1062,11 @@ var useBankTransactions = (params) => {
|
|
|
1068
1062
|
};
|
|
1069
1063
|
(0, import_react10.useEffect)(() => {
|
|
1070
1064
|
if (isLoading || isValidating) {
|
|
1071
|
-
read("BANK_TRANSACTIONS" /* BANK_TRANSACTIONS
|
|
1065
|
+
read("BANK_TRANSACTIONS" /* BANK_TRANSACTIONS */, "bank-transactions");
|
|
1072
1066
|
}
|
|
1073
1067
|
}, [isLoading, isValidating]);
|
|
1074
1068
|
(0, import_react10.useEffect)(() => {
|
|
1075
|
-
if (hasBeenTouched("
|
|
1069
|
+
if (hasBeenTouched("bank-transactions")) {
|
|
1076
1070
|
refetch();
|
|
1077
1071
|
}
|
|
1078
1072
|
}, [syncTimestamps]);
|
|
@@ -1479,7 +1473,7 @@ var LayerProvider = ({
|
|
|
1479
1473
|
});
|
|
1480
1474
|
}
|
|
1481
1475
|
}, [businessAccessToken, auth?.access_token]);
|
|
1482
|
-
(0, import_swr.default)(
|
|
1476
|
+
const { data: categoriesData } = (0, import_swr.default)(
|
|
1483
1477
|
businessId && state.auth?.access_token && `categories-${businessId}`,
|
|
1484
1478
|
Layer.getCategories(apiUrl, state.auth?.access_token, {
|
|
1485
1479
|
params: { businessId }
|
|
@@ -1496,7 +1490,15 @@ var LayerProvider = ({
|
|
|
1496
1490
|
}
|
|
1497
1491
|
}
|
|
1498
1492
|
);
|
|
1499
|
-
(0,
|
|
1493
|
+
(0, import_react12.useEffect)(() => {
|
|
1494
|
+
if (categoriesData?.data?.categories?.length) {
|
|
1495
|
+
dispatch({
|
|
1496
|
+
type: "LayerContext.setCategories" /* setCategories */,
|
|
1497
|
+
payload: { categories: categoriesData.data.categories || [] }
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
}, [categoriesData]);
|
|
1501
|
+
const { data: businessData } = (0, import_swr.default)(
|
|
1500
1502
|
businessId && state?.auth?.access_token && `business-${businessId}`,
|
|
1501
1503
|
Layer.getBusiness(apiUrl, state?.auth?.access_token, {
|
|
1502
1504
|
params: { businessId }
|
|
@@ -1513,6 +1515,14 @@ var LayerProvider = ({
|
|
|
1513
1515
|
}
|
|
1514
1516
|
}
|
|
1515
1517
|
);
|
|
1518
|
+
(0, import_react12.useEffect)(() => {
|
|
1519
|
+
if (businessData?.data) {
|
|
1520
|
+
dispatch({
|
|
1521
|
+
type: "LayerContext.setBusiness" /* setBusiness */,
|
|
1522
|
+
payload: { business: businessData.data || [] }
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
}, [businessData]);
|
|
1516
1526
|
const setTheme = (theme2) => {
|
|
1517
1527
|
dispatch({
|
|
1518
1528
|
type: "LayerContext.setTheme" /* setTheme */,
|
|
@@ -1771,6 +1781,7 @@ var useLinkedAccounts = () => {
|
|
|
1771
1781
|
const [loadingStatus, setLoadingStatus] = (0, import_react14.useState)("initial");
|
|
1772
1782
|
const USE_PLAID_SANDBOX = usePlaidSandbox ?? true;
|
|
1773
1783
|
const [linkMode, setLinkMode] = (0, import_react14.useState)("add");
|
|
1784
|
+
const queryKey = businessId && auth?.access_token && `linked-accounts-${businessId}`;
|
|
1774
1785
|
const {
|
|
1775
1786
|
data: responseData,
|
|
1776
1787
|
isLoading,
|
|
@@ -1778,7 +1789,7 @@ var useLinkedAccounts = () => {
|
|
|
1778
1789
|
error: responseError,
|
|
1779
1790
|
mutate
|
|
1780
1791
|
} = (0, import_swr2.default)(
|
|
1781
|
-
|
|
1792
|
+
queryKey,
|
|
1782
1793
|
Layer.getLinkedAccounts(apiUrl, auth?.access_token, {
|
|
1783
1794
|
params: { businessId }
|
|
1784
1795
|
})
|
|
@@ -1967,12 +1978,12 @@ var useLinkedAccounts = () => {
|
|
|
1967
1978
|
touch("LINKED_ACCOUNTS" /* LINKED_ACCOUNTS */);
|
|
1968
1979
|
};
|
|
1969
1980
|
(0, import_react14.useEffect)(() => {
|
|
1970
|
-
if (isLoading || isValidating) {
|
|
1971
|
-
read("LINKED_ACCOUNTS" /* LINKED_ACCOUNTS
|
|
1981
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
1982
|
+
read("LINKED_ACCOUNTS" /* LINKED_ACCOUNTS */, queryKey);
|
|
1972
1983
|
}
|
|
1973
1984
|
}, [isLoading, isValidating]);
|
|
1974
1985
|
(0, import_react14.useEffect)(() => {
|
|
1975
|
-
if (hasBeenTouched(
|
|
1986
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
1976
1987
|
refetchAccounts();
|
|
1977
1988
|
}
|
|
1978
1989
|
}, [syncTimestamps]);
|
|
@@ -4018,14 +4029,14 @@ var LinkedAccountThumb = ({
|
|
|
4018
4029
|
className: "account-institution",
|
|
4019
4030
|
size: "sm"
|
|
4020
4031
|
},
|
|
4021
|
-
account.institution?.name
|
|
4032
|
+
account.institution?.name ? account.institution?.name : account.external_account_name
|
|
4022
4033
|
)), /* @__PURE__ */ import_react47.default.createElement("div", { className: "topbar-logo" }, account.institution?.logo != void 0 ? /* @__PURE__ */ import_react47.default.createElement(
|
|
4023
4034
|
"img",
|
|
4024
4035
|
{
|
|
4025
4036
|
width: 28,
|
|
4026
4037
|
height: 28,
|
|
4027
4038
|
src: `data:image/png;base64,${account.institution.logo}`,
|
|
4028
|
-
alt: account.institution?.name
|
|
4039
|
+
alt: account.institution?.name ? account.institution?.name : account.external_account_name
|
|
4029
4040
|
}
|
|
4030
4041
|
) : /* @__PURE__ */ import_react47.default.createElement(InstitutionIcon_default, null))), account.is_syncing ? /* @__PURE__ */ import_react47.default.createElement("div", { className: "loadingbar" }, /* @__PURE__ */ import_react47.default.createElement("div", { className: "loading-text Layer__text--sm" }, /* @__PURE__ */ import_react47.default.createElement("div", null, "Syncing account data"), /* @__PURE__ */ import_react47.default.createElement("div", { className: "syncing-data-description" }, "This may take up to 5 minutes")), /* @__PURE__ */ import_react47.default.createElement("div", { className: "loading-wrapper" }, /* @__PURE__ */ import_react47.default.createElement(Loader_default, { size: 11, className: "Layer__anim--rotating" }))) : /* @__PURE__ */ import_react47.default.createElement(import_react47.default.Fragment, null, !asWidget && /* @__PURE__ */ import_react47.default.createElement("div", { className: "middlebar" }, /* @__PURE__ */ import_react47.default.createElement(
|
|
4031
4042
|
Text,
|
|
@@ -4237,7 +4248,7 @@ var LinkedAccountsComponent = ({
|
|
|
4237
4248
|
};
|
|
4238
4249
|
|
|
4239
4250
|
// src/components/BankTransactions/BankTransactions.tsx
|
|
4240
|
-
var
|
|
4251
|
+
var import_react96 = __toESM(require("react"));
|
|
4241
4252
|
|
|
4242
4253
|
// src/hooks/useElementSize/useElementSize.ts
|
|
4243
4254
|
var import_react50 = require("react");
|
|
@@ -4280,151 +4291,10 @@ var debounce = (fnc, timeout = 300) => {
|
|
|
4280
4291
|
};
|
|
4281
4292
|
|
|
4282
4293
|
// src/components/BankTransactionList/BankTransactionList.tsx
|
|
4283
|
-
var import_react72 = __toESM(require("react"));
|
|
4284
|
-
|
|
4285
|
-
// src/components/BankTransactionList/BankTransactionListItem.tsx
|
|
4286
4294
|
var import_react71 = __toESM(require("react"));
|
|
4287
4295
|
|
|
4288
|
-
// src/
|
|
4289
|
-
var
|
|
4290
|
-
var import_date_fns4 = require("date-fns");
|
|
4291
|
-
var import_swr3 = __toESM(require("swr"));
|
|
4292
|
-
var buildDates = ({ currentDate }) => {
|
|
4293
|
-
return {
|
|
4294
|
-
startYear: (0, import_date_fns4.startOfMonth)(currentDate).getFullYear() - 1,
|
|
4295
|
-
startMonth: (0, import_date_fns4.startOfMonth)(currentDate).getMonth() + 1,
|
|
4296
|
-
endYear: (0, import_date_fns4.startOfMonth)(currentDate).getFullYear(),
|
|
4297
|
-
endMonth: (0, import_date_fns4.startOfMonth)(currentDate).getMonth() + 1
|
|
4298
|
-
};
|
|
4299
|
-
};
|
|
4300
|
-
var buildMonthsArray = (startDate, endDate) => {
|
|
4301
|
-
if (startDate >= endDate) {
|
|
4302
|
-
return [];
|
|
4303
|
-
}
|
|
4304
|
-
var dates = [];
|
|
4305
|
-
for (var d = startDate; d <= endDate; d.setMonth(d.getMonth() + 1)) {
|
|
4306
|
-
dates.push(new Date(d));
|
|
4307
|
-
}
|
|
4308
|
-
return dates;
|
|
4309
|
-
};
|
|
4310
|
-
var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
4311
|
-
currentDate: /* @__PURE__ */ new Date()
|
|
4312
|
-
}) => {
|
|
4313
|
-
const { businessId, auth, apiUrl, syncTimestamps, read, hasBeenTouched } = useLayerContext();
|
|
4314
|
-
const [date, setDate] = (0, import_react51.useState)(currentDate);
|
|
4315
|
-
const [loaded, setLoaded] = (0, import_react51.useState)("initial");
|
|
4316
|
-
const [data, setData] = (0, import_react51.useState)([]);
|
|
4317
|
-
const { startYear, startMonth, endYear, endMonth } = (0, import_react51.useMemo)(() => {
|
|
4318
|
-
return buildDates({ currentDate: date });
|
|
4319
|
-
}, [date, businessId, tagFilter, reportingBasis]);
|
|
4320
|
-
const {
|
|
4321
|
-
data: rawData,
|
|
4322
|
-
isLoading,
|
|
4323
|
-
isValidating,
|
|
4324
|
-
error,
|
|
4325
|
-
mutate
|
|
4326
|
-
} = (0, import_swr3.default)(
|
|
4327
|
-
businessId && Boolean(startYear) && Boolean(startMonth) && Boolean(endYear) && Boolean(endMonth) && auth?.access_token && `profit-and-loss-summaries-${businessId}-${startYear.toString()}-${startMonth.toString()}-${tagFilter?.key}-${tagFilter?.values?.join(
|
|
4328
|
-
","
|
|
4329
|
-
)}-${reportingBasis}`,
|
|
4330
|
-
Layer.getProfitAndLossSummaries(apiUrl, auth?.access_token, {
|
|
4331
|
-
params: {
|
|
4332
|
-
businessId,
|
|
4333
|
-
startYear: startYear.toString(),
|
|
4334
|
-
startMonth: startMonth.toString(),
|
|
4335
|
-
endYear: endYear.toString(),
|
|
4336
|
-
endMonth: endMonth.toString(),
|
|
4337
|
-
tagKey: tagFilter?.key,
|
|
4338
|
-
tagValues: tagFilter?.values?.join(","),
|
|
4339
|
-
reportingBasis
|
|
4340
|
-
}
|
|
4341
|
-
})
|
|
4342
|
-
);
|
|
4343
|
-
(0, import_react51.useEffect)(() => {
|
|
4344
|
-
const newData = data.slice();
|
|
4345
|
-
const newPeriod = buildMonthsArray((0, import_date_fns4.sub)(date, { years: 1 }), date);
|
|
4346
|
-
if (newData && newPeriod) {
|
|
4347
|
-
newPeriod.forEach((x) => {
|
|
4348
|
-
if (!newData?.find(
|
|
4349
|
-
(n) => x.getMonth() + 1 === n.month && x.getFullYear() === n.year
|
|
4350
|
-
)) {
|
|
4351
|
-
newData.push({
|
|
4352
|
-
year: x.getFullYear(),
|
|
4353
|
-
month: x.getMonth() + 1,
|
|
4354
|
-
income: 0,
|
|
4355
|
-
costOfGoodsSold: 0,
|
|
4356
|
-
grossProfit: 0,
|
|
4357
|
-
operatingExpenses: 0,
|
|
4358
|
-
profitBeforeTaxes: 0,
|
|
4359
|
-
taxes: 0,
|
|
4360
|
-
netProfit: 0,
|
|
4361
|
-
fullyCategorized: false,
|
|
4362
|
-
totalExpenses: 0,
|
|
4363
|
-
uncategorizedInflows: 0,
|
|
4364
|
-
uncategorizedOutflows: 0,
|
|
4365
|
-
uncategorized_transactions: 0,
|
|
4366
|
-
isLoading: true
|
|
4367
|
-
});
|
|
4368
|
-
}
|
|
4369
|
-
});
|
|
4370
|
-
}
|
|
4371
|
-
if (newData) {
|
|
4372
|
-
setData(
|
|
4373
|
-
newData.sort(
|
|
4374
|
-
(a, b) => Number(new Date(a.year, a.month, 1)) - Number(new Date(b.year, b.month, 1))
|
|
4375
|
-
)
|
|
4376
|
-
);
|
|
4377
|
-
}
|
|
4378
|
-
}, [startYear, startMonth]);
|
|
4379
|
-
(0, import_react51.useEffect)(() => {
|
|
4380
|
-
const newData = rawData?.data?.months?.slice();
|
|
4381
|
-
if (data && newData) {
|
|
4382
|
-
data.forEach((x) => {
|
|
4383
|
-
if (!newData?.find((n) => x.month === n.month && x.year === n.year)) {
|
|
4384
|
-
newData.push({ ...x });
|
|
4385
|
-
}
|
|
4386
|
-
});
|
|
4387
|
-
}
|
|
4388
|
-
if (newData) {
|
|
4389
|
-
setData(
|
|
4390
|
-
newData.sort(
|
|
4391
|
-
(a, b) => Number(new Date(a.year, a.month, 1)) - Number(new Date(b.year, b.month, 1))
|
|
4392
|
-
)
|
|
4393
|
-
);
|
|
4394
|
-
}
|
|
4395
|
-
}, [rawData]);
|
|
4396
|
-
(0, import_react51.useEffect)(() => {
|
|
4397
|
-
if (isLoading && loaded === "initial") {
|
|
4398
|
-
setLoaded("loading");
|
|
4399
|
-
return;
|
|
4400
|
-
}
|
|
4401
|
-
if (!isLoading && rawData) {
|
|
4402
|
-
setLoaded("complete");
|
|
4403
|
-
}
|
|
4404
|
-
}, [data, isLoading]);
|
|
4405
|
-
const pullData = (date2) => setDate(date2);
|
|
4406
|
-
(0, import_react51.useEffect)(() => {
|
|
4407
|
-
if (isLoading || isValidating) {
|
|
4408
|
-
read("PROFIT_AND_LOSS" /* PROFIT_AND_LOSS */);
|
|
4409
|
-
}
|
|
4410
|
-
}, [isLoading, isValidating]);
|
|
4411
|
-
(0, import_react51.useEffect)(() => {
|
|
4412
|
-
if (hasBeenTouched("PROFIT_AND_LOSS" /* PROFIT_AND_LOSS */)) {
|
|
4413
|
-
mutate();
|
|
4414
|
-
}
|
|
4415
|
-
}, [syncTimestamps]);
|
|
4416
|
-
const refetch = () => {
|
|
4417
|
-
mutate();
|
|
4418
|
-
};
|
|
4419
|
-
return {
|
|
4420
|
-
data,
|
|
4421
|
-
isLoading,
|
|
4422
|
-
loaded,
|
|
4423
|
-
error,
|
|
4424
|
-
pullData,
|
|
4425
|
-
refetch
|
|
4426
|
-
};
|
|
4427
|
-
};
|
|
4296
|
+
// src/components/BankTransactionList/BankTransactionListItem.tsx
|
|
4297
|
+
var import_react70 = __toESM(require("react"));
|
|
4428
4298
|
|
|
4429
4299
|
// src/icons/ChevronDownFill.tsx
|
|
4430
4300
|
var React57 = __toESM(require("react"));
|
|
@@ -4452,7 +4322,7 @@ var ChevronDownFill = ({ size = 18, ...props }) => /* @__PURE__ */ React57.creat
|
|
|
4452
4322
|
var ChevronDownFill_default = ChevronDownFill;
|
|
4453
4323
|
|
|
4454
4324
|
// src/components/BankTransactionRow/BankTransactionRow.tsx
|
|
4455
|
-
var
|
|
4325
|
+
var import_react68 = __toESM(require("react"));
|
|
4456
4326
|
|
|
4457
4327
|
// src/icons/Scissors.tsx
|
|
4458
4328
|
var React58 = __toESM(require("react"));
|
|
@@ -4585,7 +4455,7 @@ var Scissors = ({ size = 11, ...props }) => /* @__PURE__ */ React58.createElemen
|
|
|
4585
4455
|
var Scissors_default = Scissors;
|
|
4586
4456
|
|
|
4587
4457
|
// src/components/CategorySelect/CategorySelect.tsx
|
|
4588
|
-
var
|
|
4458
|
+
var import_react54 = __toESM(require("react"));
|
|
4589
4459
|
var import_react_select = __toESM(require("react-select"));
|
|
4590
4460
|
|
|
4591
4461
|
// src/icons/Check.tsx
|
|
@@ -4688,20 +4558,20 @@ var MinimizeTwo = ({ size = 18, ...props }) => /* @__PURE__ */ React61.createEle
|
|
|
4688
4558
|
var MinimizeTwo_default = MinimizeTwo;
|
|
4689
4559
|
|
|
4690
4560
|
// src/components/CategorySelect/CategorySelectDrawer.tsx
|
|
4691
|
-
var
|
|
4561
|
+
var import_react53 = __toESM(require("react"));
|
|
4692
4562
|
|
|
4693
4563
|
// src/components/BankTransactionMobileList/BusinessCategories.tsx
|
|
4694
|
-
var
|
|
4564
|
+
var import_react52 = __toESM(require("react"));
|
|
4695
4565
|
|
|
4696
4566
|
// src/components/ActionableList/ActionableList.tsx
|
|
4697
|
-
var
|
|
4567
|
+
var import_react51 = __toESM(require("react"));
|
|
4698
4568
|
var import_classnames21 = __toESM(require("classnames"));
|
|
4699
4569
|
var ActionableList = ({
|
|
4700
4570
|
options,
|
|
4701
4571
|
onClick,
|
|
4702
4572
|
selected
|
|
4703
4573
|
}) => {
|
|
4704
|
-
return /* @__PURE__ */
|
|
4574
|
+
return /* @__PURE__ */ import_react51.default.createElement("ul", { className: "Layer__actionable-list" }, options.map((x, idx) => /* @__PURE__ */ import_react51.default.createElement(
|
|
4705
4575
|
"li",
|
|
4706
4576
|
{
|
|
4707
4577
|
role: "button",
|
|
@@ -4712,15 +4582,15 @@ var ActionableList = ({
|
|
|
4712
4582
|
x.asLink && "Layer__actionable-list-item--as-link"
|
|
4713
4583
|
)
|
|
4714
4584
|
},
|
|
4715
|
-
/* @__PURE__ */
|
|
4716
|
-
!x.asLink && selected && selected.id === x.id ? /* @__PURE__ */
|
|
4585
|
+
/* @__PURE__ */ import_react51.default.createElement(Text, null, x.label),
|
|
4586
|
+
!x.asLink && selected && selected.id === x.id ? /* @__PURE__ */ import_react51.default.createElement(
|
|
4717
4587
|
Check_default,
|
|
4718
4588
|
{
|
|
4719
4589
|
size: 16,
|
|
4720
4590
|
className: "Layer__actionable-list__selected-icon"
|
|
4721
4591
|
}
|
|
4722
4592
|
) : null,
|
|
4723
|
-
x.asLink && /* @__PURE__ */
|
|
4593
|
+
x.asLink && /* @__PURE__ */ import_react51.default.createElement(
|
|
4724
4594
|
ChevronRight_default,
|
|
4725
4595
|
{
|
|
4726
4596
|
size: 16,
|
|
@@ -4787,8 +4657,8 @@ var getAssignedValue = (bankTransaction) => {
|
|
|
4787
4657
|
var BusinessCategories = ({ select }) => {
|
|
4788
4658
|
const { categories } = useLayerContext();
|
|
4789
4659
|
const categoryOptions = flattenCategories(categories);
|
|
4790
|
-
const [optionsToShow, setOptionsToShow] = (0,
|
|
4791
|
-
const [selectedGroup, setSelectedGroup] = (0,
|
|
4660
|
+
const [optionsToShow, setOptionsToShow] = (0, import_react52.useState)(categoryOptions);
|
|
4661
|
+
const [selectedGroup, setSelectedGroup] = (0, import_react52.useState)();
|
|
4792
4662
|
const onCategorySelect = (v) => {
|
|
4793
4663
|
if (v.value.type === "GROUP" && v.value.items) {
|
|
4794
4664
|
setOptionsToShow(v.value.items);
|
|
@@ -4797,14 +4667,14 @@ var BusinessCategories = ({ select }) => {
|
|
|
4797
4667
|
}
|
|
4798
4668
|
select(v);
|
|
4799
4669
|
};
|
|
4800
|
-
return /* @__PURE__ */
|
|
4670
|
+
return /* @__PURE__ */ import_react52.default.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__categories_list-container" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
4801
4671
|
Text,
|
|
4802
4672
|
{
|
|
4803
4673
|
weight: "bold" /* bold */,
|
|
4804
4674
|
className: "Layer__bank-transaction-mobile-list-item__categories_list-title"
|
|
4805
4675
|
},
|
|
4806
4676
|
selectedGroup ?? "Select category"
|
|
4807
|
-
), /* @__PURE__ */
|
|
4677
|
+
), /* @__PURE__ */ import_react52.default.createElement(
|
|
4808
4678
|
ActionableList,
|
|
4809
4679
|
{
|
|
4810
4680
|
options: optionsToShow,
|
|
@@ -4819,12 +4689,12 @@ var CategorySelectDrawer = ({
|
|
|
4819
4689
|
onSelect,
|
|
4820
4690
|
selected
|
|
4821
4691
|
}) => {
|
|
4822
|
-
const { setContent, close } = (0,
|
|
4692
|
+
const { setContent, close } = (0, import_react53.useContext)(DrawerContext);
|
|
4823
4693
|
const onDrawerCategorySelect = (value) => {
|
|
4824
4694
|
close();
|
|
4825
4695
|
onSelect(value);
|
|
4826
4696
|
};
|
|
4827
|
-
return /* @__PURE__ */
|
|
4697
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
4828
4698
|
"button",
|
|
4829
4699
|
{
|
|
4830
4700
|
"aria-label": "Select category",
|
|
@@ -4833,11 +4703,11 @@ var CategorySelectDrawer = ({
|
|
|
4833
4703
|
selected && "Layer__category-menu__drawer-btn--selected"
|
|
4834
4704
|
),
|
|
4835
4705
|
onClick: () => setContent(
|
|
4836
|
-
/* @__PURE__ */
|
|
4706
|
+
/* @__PURE__ */ import_react53.default.createElement(CategorySelectDrawerContent, { onSelect: onDrawerCategorySelect })
|
|
4837
4707
|
)
|
|
4838
4708
|
},
|
|
4839
4709
|
selected?.payload?.display_name ?? "Select...",
|
|
4840
|
-
/* @__PURE__ */
|
|
4710
|
+
/* @__PURE__ */ import_react53.default.createElement(
|
|
4841
4711
|
ChevronDown_default,
|
|
4842
4712
|
{
|
|
4843
4713
|
size: 16,
|
|
@@ -4848,7 +4718,7 @@ var CategorySelectDrawer = ({
|
|
|
4848
4718
|
};
|
|
4849
4719
|
var CategorySelectDrawerContent = ({
|
|
4850
4720
|
onSelect
|
|
4851
|
-
}) => /* @__PURE__ */
|
|
4721
|
+
}) => /* @__PURE__ */ import_react53.default.createElement(
|
|
4852
4722
|
BusinessCategories,
|
|
4853
4723
|
{
|
|
4854
4724
|
select: (option) => {
|
|
@@ -4864,7 +4734,7 @@ var CategorySelectDrawerContent = ({
|
|
|
4864
4734
|
|
|
4865
4735
|
// src/components/CategorySelect/CategorySelect.tsx
|
|
4866
4736
|
var import_classnames23 = __toESM(require("classnames"));
|
|
4867
|
-
var
|
|
4737
|
+
var import_date_fns4 = require("date-fns");
|
|
4868
4738
|
var mapCategoryToOption2 = (category) => {
|
|
4869
4739
|
return {
|
|
4870
4740
|
type: "category" /* CATEGORY */,
|
|
@@ -4891,10 +4761,10 @@ var mapSuggestedMatchToOption = (record) => {
|
|
|
4891
4761
|
};
|
|
4892
4762
|
};
|
|
4893
4763
|
var DropdownIndicator = (props) => {
|
|
4894
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ import_react54.default.createElement(import_react_select.components.DropdownIndicator, { ...props }, /* @__PURE__ */ import_react54.default.createElement(ChevronDown_default, null));
|
|
4895
4765
|
};
|
|
4896
4766
|
var GroupHeading = (props) => {
|
|
4897
|
-
return /* @__PURE__ */
|
|
4767
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
4898
4768
|
import_react_select.components.GroupHeading,
|
|
4899
4769
|
{
|
|
4900
4770
|
className: (0, import_classnames23.default)(
|
|
@@ -4910,24 +4780,24 @@ var Option2 = (props) => {
|
|
|
4910
4780
|
return;
|
|
4911
4781
|
}
|
|
4912
4782
|
if (props.data.type === "match") {
|
|
4913
|
-
return /* @__PURE__ */
|
|
4783
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
4914
4784
|
import_react_select.components.Option,
|
|
4915
4785
|
{
|
|
4916
4786
|
...props,
|
|
4917
4787
|
className: `${props.className} Layer__select__option-content__match`
|
|
4918
4788
|
},
|
|
4919
|
-
/* @__PURE__ */
|
|
4920
|
-
/* @__PURE__ */
|
|
4789
|
+
/* @__PURE__ */ import_react54.default.createElement("div", { className: "Layer__select__option-content__match__main-row" }, /* @__PURE__ */ import_react54.default.createElement("span", { className: "Layer__select__option-content__match__date" }, props.data.payload.date && (0, import_date_fns4.format)((0, import_date_fns4.parseISO)(props.data.payload.date), DATE_FORMAT)), /* @__PURE__ */ import_react54.default.createElement("span", { className: "Layer__select__option-content__match__description" }, props.data.payload.display_name)),
|
|
4790
|
+
/* @__PURE__ */ import_react54.default.createElement("div", { className: "Layer__select__option-content__match__amount-row" }, /* @__PURE__ */ import_react54.default.createElement("span", { className: "Layer__select__option-content__match__amount" }, "$", centsToDollars(props.data.payload.amount)))
|
|
4921
4791
|
);
|
|
4922
4792
|
}
|
|
4923
|
-
return /* @__PURE__ */
|
|
4793
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
4924
4794
|
import_react_select.components.Option,
|
|
4925
4795
|
{
|
|
4926
4796
|
...props,
|
|
4927
4797
|
className: `Layer__select__option-menu-content ${props.className}`
|
|
4928
4798
|
},
|
|
4929
|
-
/* @__PURE__ */
|
|
4930
|
-
props.isSelected ? /* @__PURE__ */
|
|
4799
|
+
/* @__PURE__ */ import_react54.default.createElement("div", null, props.data.payload.display_name),
|
|
4800
|
+
props.isSelected ? /* @__PURE__ */ import_react54.default.createElement("span", { className: "Layer__select__option-menu-content-check" }, /* @__PURE__ */ import_react54.default.createElement(Check_default, { size: 16 })) : null
|
|
4931
4801
|
);
|
|
4932
4802
|
};
|
|
4933
4803
|
var allCategoriesDivider = [
|
|
@@ -5013,9 +4883,9 @@ var CategorySelect = ({
|
|
|
5013
4883
|
const selected = value ? value : !excludeMatches && matchOptions?.length === 1 && matchOptions[0].options.length === 1 ? matchOptions[0].options[0] : void 0;
|
|
5014
4884
|
const placeholder = matchOptions?.length === 1 && matchOptions[0].options.length > 1 ? `${matchOptions[0].options.length} possible matches...` : "Categorize or match...";
|
|
5015
4885
|
if (asDrawer) {
|
|
5016
|
-
return /* @__PURE__ */
|
|
4886
|
+
return /* @__PURE__ */ import_react54.default.createElement(CategorySelectDrawer, { onSelect: onChange, selected: value });
|
|
5017
4887
|
}
|
|
5018
|
-
return /* @__PURE__ */
|
|
4888
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
5019
4889
|
import_react_select.default,
|
|
5020
4890
|
{
|
|
5021
4891
|
name,
|
|
@@ -5028,7 +4898,7 @@ var CategorySelect = ({
|
|
|
5028
4898
|
isSearchable: true,
|
|
5029
4899
|
placeholder,
|
|
5030
4900
|
defaultValue: selected,
|
|
5031
|
-
formatOptionLabel: (props) => /* @__PURE__ */
|
|
4901
|
+
formatOptionLabel: (props) => /* @__PURE__ */ import_react54.default.createElement("div", { className: "Layer__select__option-label" }, props.type === "match" && /* @__PURE__ */ import_react54.default.createElement(Badge, { size: "small" /* SMALL */, icon: /* @__PURE__ */ import_react54.default.createElement(MinimizeTwo_default, { size: 11 }) }, "Match"), /* @__PURE__ */ import_react54.default.createElement("span", null, props.payload.display_name)),
|
|
5032
4902
|
value,
|
|
5033
4903
|
onChange: (newValue) => newValue && onChange(newValue),
|
|
5034
4904
|
getOptionLabel: (category) => category.payload.display_name,
|
|
@@ -5045,7 +4915,7 @@ var CategorySelect = ({
|
|
|
5045
4915
|
};
|
|
5046
4916
|
|
|
5047
4917
|
// src/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow.tsx
|
|
5048
|
-
var
|
|
4918
|
+
var import_react66 = __toESM(require("react"));
|
|
5049
4919
|
|
|
5050
4920
|
// src/icons/ScissorsFullOpen.tsx
|
|
5051
4921
|
var React66 = __toESM(require("react"));
|
|
@@ -5160,7 +5030,7 @@ var Trash = ({ size = 18, ...props }) => /* @__PURE__ */ React67.createElement(
|
|
|
5160
5030
|
var Trash_default = Trash;
|
|
5161
5031
|
|
|
5162
5032
|
// src/components/Input/Input.tsx
|
|
5163
|
-
var
|
|
5033
|
+
var import_react55 = __toESM(require("react"));
|
|
5164
5034
|
var import_classnames24 = __toESM(require("classnames"));
|
|
5165
5035
|
var Input = ({
|
|
5166
5036
|
className,
|
|
@@ -5175,11 +5045,11 @@ var Input = ({
|
|
|
5175
5045
|
leftText ? "Layer__input--with-left-text" : "",
|
|
5176
5046
|
className
|
|
5177
5047
|
);
|
|
5178
|
-
return /* @__PURE__ */
|
|
5048
|
+
return /* @__PURE__ */ import_react55.default.createElement(Tooltip, { disabled: !isInvalid || !errorMessage }, /* @__PURE__ */ import_react55.default.createElement(TooltipTrigger, { className: "Layer__input-tooltip" }, /* @__PURE__ */ import_react55.default.createElement("input", { ...props, className: baseClassName }), leftText && /* @__PURE__ */ import_react55.default.createElement("span", { className: "Layer__input-left-text" }, leftText)), /* @__PURE__ */ import_react55.default.createElement(TooltipContent, { className: "Layer__tooltip" }, errorMessage));
|
|
5179
5049
|
};
|
|
5180
5050
|
|
|
5181
5051
|
// src/components/Input/InputGroup.tsx
|
|
5182
|
-
var
|
|
5052
|
+
var import_react56 = __toESM(require("react"));
|
|
5183
5053
|
var import_classnames25 = __toESM(require("classnames"));
|
|
5184
5054
|
var InputGroup = ({
|
|
5185
5055
|
label,
|
|
@@ -5193,7 +5063,7 @@ var InputGroup = ({
|
|
|
5193
5063
|
className,
|
|
5194
5064
|
inline && "Layer__input-group--inline"
|
|
5195
5065
|
);
|
|
5196
|
-
return /* @__PURE__ */
|
|
5066
|
+
return /* @__PURE__ */ import_react56.default.createElement("div", { className: baseClassName }, label && /* @__PURE__ */ import_react56.default.createElement(
|
|
5197
5067
|
Text,
|
|
5198
5068
|
{
|
|
5199
5069
|
as: "label",
|
|
@@ -5206,7 +5076,7 @@ var InputGroup = ({
|
|
|
5206
5076
|
};
|
|
5207
5077
|
|
|
5208
5078
|
// src/components/Input/FileInput.tsx
|
|
5209
|
-
var
|
|
5079
|
+
var import_react57 = __toESM(require("react"));
|
|
5210
5080
|
|
|
5211
5081
|
// src/icons/UploadCloud.tsx
|
|
5212
5082
|
var React70 = __toESM(require("react"));
|
|
@@ -5261,7 +5131,7 @@ var UploadCloud_default = UploadCloud;
|
|
|
5261
5131
|
|
|
5262
5132
|
// src/components/Input/FileInput.tsx
|
|
5263
5133
|
var FileInput = ({ text = "Upload", onUpload }) => {
|
|
5264
|
-
const hiddenFileInput = (0,
|
|
5134
|
+
const hiddenFileInput = (0, import_react57.useRef)(null);
|
|
5265
5135
|
const onClick = () => {
|
|
5266
5136
|
if (hiddenFileInput.current) {
|
|
5267
5137
|
hiddenFileInput.current.click();
|
|
@@ -5273,15 +5143,15 @@ var FileInput = ({ text = "Upload", onUpload }) => {
|
|
|
5273
5143
|
onUpload(fileUploaded);
|
|
5274
5144
|
}
|
|
5275
5145
|
};
|
|
5276
|
-
return /* @__PURE__ */
|
|
5146
|
+
return /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null, /* @__PURE__ */ import_react57.default.createElement(
|
|
5277
5147
|
Button,
|
|
5278
5148
|
{
|
|
5279
5149
|
onClick,
|
|
5280
5150
|
variant: "secondary" /* secondary */,
|
|
5281
|
-
rightIcon: /* @__PURE__ */
|
|
5151
|
+
rightIcon: /* @__PURE__ */ import_react57.default.createElement(UploadCloud_default, null)
|
|
5282
5152
|
},
|
|
5283
5153
|
text
|
|
5284
|
-
), /* @__PURE__ */
|
|
5154
|
+
), /* @__PURE__ */ import_react57.default.createElement(
|
|
5285
5155
|
"input",
|
|
5286
5156
|
{
|
|
5287
5157
|
type: "file",
|
|
@@ -5293,11 +5163,11 @@ var FileInput = ({ text = "Upload", onUpload }) => {
|
|
|
5293
5163
|
};
|
|
5294
5164
|
|
|
5295
5165
|
// src/components/Input/Select.tsx
|
|
5296
|
-
var
|
|
5166
|
+
var import_react58 = __toESM(require("react"));
|
|
5297
5167
|
var import_react_select2 = __toESM(require("react-select"));
|
|
5298
5168
|
var import_classnames26 = __toESM(require("classnames"));
|
|
5299
5169
|
var DropdownIndicator2 = (props) => {
|
|
5300
|
-
return /* @__PURE__ */
|
|
5170
|
+
return /* @__PURE__ */ import_react58.default.createElement(import_react_select2.components.DropdownIndicator, { ...props }, /* @__PURE__ */ import_react58.default.createElement(ChevronDownFill_default, null));
|
|
5301
5171
|
};
|
|
5302
5172
|
var Select2 = ({
|
|
5303
5173
|
name,
|
|
@@ -5316,7 +5186,7 @@ var Select2 = ({
|
|
|
5316
5186
|
isInvalid ? "Layer__select--error" : "",
|
|
5317
5187
|
className
|
|
5318
5188
|
);
|
|
5319
|
-
return /* @__PURE__ */
|
|
5189
|
+
return /* @__PURE__ */ import_react58.default.createElement(Tooltip, { disabled: !isInvalid || !errorMessage }, /* @__PURE__ */ import_react58.default.createElement(TooltipTrigger, { className: "Layer__input-tooltip" }, /* @__PURE__ */ import_react58.default.createElement(
|
|
5320
5190
|
import_react_select2.default,
|
|
5321
5191
|
{
|
|
5322
5192
|
name,
|
|
@@ -5331,11 +5201,11 @@ var Select2 = ({
|
|
|
5331
5201
|
components: { DropdownIndicator: DropdownIndicator2 },
|
|
5332
5202
|
isDisabled: disabled
|
|
5333
5203
|
}
|
|
5334
|
-
)), /* @__PURE__ */
|
|
5204
|
+
)), /* @__PURE__ */ import_react58.default.createElement(TooltipContent, { className: "Layer__tooltip" }, errorMessage));
|
|
5335
5205
|
};
|
|
5336
5206
|
|
|
5337
5207
|
// src/components/Input/InputWithBadge.tsx
|
|
5338
|
-
var
|
|
5208
|
+
var import_react59 = __toESM(require("react"));
|
|
5339
5209
|
var import_classnames27 = __toESM(require("classnames"));
|
|
5340
5210
|
var InputWithBadge = ({
|
|
5341
5211
|
className,
|
|
@@ -5352,15 +5222,15 @@ var InputWithBadge = ({
|
|
|
5352
5222
|
leftText ? "Layer__input--with-left-text" : "",
|
|
5353
5223
|
className
|
|
5354
5224
|
);
|
|
5355
|
-
return /* @__PURE__ */
|
|
5225
|
+
return /* @__PURE__ */ import_react59.default.createElement(Tooltip, { disabled: !isInvalid || !errorMessage }, /* @__PURE__ */ import_react59.default.createElement(TooltipTrigger, { className: "Layer__input-tooltip" }, /* @__PURE__ */ import_react59.default.createElement("div", { className: "Layer__input-with-badge" }, /* @__PURE__ */ import_react59.default.createElement("input", { ...props, className: baseClassName }), badge && /* @__PURE__ */ import_react59.default.createElement(Badge, { variant }, badge)), leftText && /* @__PURE__ */ import_react59.default.createElement("span", { className: "Layer__input-left-text" }, leftText)), /* @__PURE__ */ import_react59.default.createElement(TooltipContent, { className: "Layer__tooltip" }, errorMessage));
|
|
5356
5226
|
};
|
|
5357
5227
|
|
|
5358
5228
|
// src/components/MatchForm/MatchForm.tsx
|
|
5359
|
-
var
|
|
5229
|
+
var import_react61 = __toESM(require("react"));
|
|
5360
5230
|
|
|
5361
5231
|
// src/components/BankTransactionRow/MatchBadge.tsx
|
|
5362
|
-
var
|
|
5363
|
-
var
|
|
5232
|
+
var import_react60 = __toESM(require("react"));
|
|
5233
|
+
var import_date_fns5 = require("date-fns");
|
|
5364
5234
|
var MatchBadge = ({
|
|
5365
5235
|
bankTransaction,
|
|
5366
5236
|
classNamePrefix,
|
|
@@ -5369,11 +5239,11 @@ var MatchBadge = ({
|
|
|
5369
5239
|
}) => {
|
|
5370
5240
|
if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ && bankTransaction.match) {
|
|
5371
5241
|
const { date, amount } = bankTransaction.match.bank_transaction;
|
|
5372
|
-
return /* @__PURE__ */
|
|
5242
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
5373
5243
|
Badge,
|
|
5374
5244
|
{
|
|
5375
|
-
icon: /* @__PURE__ */
|
|
5376
|
-
tooltip: /* @__PURE__ */
|
|
5245
|
+
icon: /* @__PURE__ */ import_react60.default.createElement(MinimizeTwo_default, { size: 11 }),
|
|
5246
|
+
tooltip: /* @__PURE__ */ import_react60.default.createElement("span", { className: `${classNamePrefix}__match-tooltip` }, /* @__PURE__ */ import_react60.default.createElement("div", { className: `${classNamePrefix}__match-tooltip__date` }, (0, import_date_fns5.format)((0, import_date_fns5.parseISO)(date), dateFormat)), /* @__PURE__ */ import_react60.default.createElement("div", { className: `${classNamePrefix}__match-tooltip__description` }, bankTransaction.match?.details?.description ?? ""), /* @__PURE__ */ import_react60.default.createElement("div", { className: `${classNamePrefix}__match-tooltip__amount` }, "$", centsToDollars(amount)))
|
|
5377
5247
|
},
|
|
5378
5248
|
text
|
|
5379
5249
|
);
|
|
@@ -5383,7 +5253,7 @@ var MatchBadge = ({
|
|
|
5383
5253
|
|
|
5384
5254
|
// src/components/MatchForm/MatchForm.tsx
|
|
5385
5255
|
var import_classnames28 = __toESM(require("classnames"));
|
|
5386
|
-
var
|
|
5256
|
+
var import_date_fns6 = require("date-fns");
|
|
5387
5257
|
var MatchForm = ({
|
|
5388
5258
|
classNamePrefix,
|
|
5389
5259
|
bankTransaction,
|
|
@@ -5392,13 +5262,13 @@ var MatchForm = ({
|
|
|
5392
5262
|
matchFormError,
|
|
5393
5263
|
readOnly = false
|
|
5394
5264
|
}) => {
|
|
5395
|
-
return /* @__PURE__ */
|
|
5265
|
+
return /* @__PURE__ */ import_react61.default.createElement("div", { className: `${classNamePrefix}__match-table` }, /* @__PURE__ */ import_react61.default.createElement("div", { className: `${classNamePrefix}__match-table__header` }, /* @__PURE__ */ import_react61.default.createElement("div", { className: `${classNamePrefix}__match-table__date` }, "Date"), /* @__PURE__ */ import_react61.default.createElement("div", { className: `${classNamePrefix}__match-table__desc` }, "Description"), /* @__PURE__ */ import_react61.default.createElement("div", { className: `${classNamePrefix}__match-table__amount` }, "Amount"), /* @__PURE__ */ import_react61.default.createElement(
|
|
5396
5266
|
"div",
|
|
5397
5267
|
{
|
|
5398
5268
|
className: `${classNamePrefix}__match-table__status ${bankTransaction.match ? "" : "no-match"}`
|
|
5399
5269
|
}
|
|
5400
5270
|
)), bankTransaction.suggested_matches?.map((match, idx) => {
|
|
5401
|
-
return /* @__PURE__ */
|
|
5271
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5402
5272
|
"div",
|
|
5403
5273
|
{
|
|
5404
5274
|
key: idx,
|
|
@@ -5417,15 +5287,15 @@ var MatchForm = ({
|
|
|
5417
5287
|
setSelectedMatchId(match.id);
|
|
5418
5288
|
}
|
|
5419
5289
|
},
|
|
5420
|
-
/* @__PURE__ */
|
|
5290
|
+
/* @__PURE__ */ import_react61.default.createElement(
|
|
5421
5291
|
"div",
|
|
5422
5292
|
{
|
|
5423
5293
|
className: `Layer__nowrap ${classNamePrefix}__match-table__date`
|
|
5424
5294
|
},
|
|
5425
|
-
/* @__PURE__ */
|
|
5426
|
-
/* @__PURE__ */
|
|
5295
|
+
/* @__PURE__ */ import_react61.default.createElement("span", null, (0, import_date_fns6.format)((0, import_date_fns6.parseISO)(match.details.date), DATE_FORMAT)),
|
|
5296
|
+
/* @__PURE__ */ import_react61.default.createElement("span", { className: "amount-next-to-date" }, "$", centsToDollars(match.details.amount))
|
|
5427
5297
|
),
|
|
5428
|
-
/* @__PURE__ */
|
|
5298
|
+
/* @__PURE__ */ import_react61.default.createElement("div", { className: `${classNamePrefix}__match-table__desc` }, /* @__PURE__ */ import_react61.default.createElement(
|
|
5429
5299
|
Text,
|
|
5430
5300
|
{
|
|
5431
5301
|
className: `${classNamePrefix}__match-table__desc-tooltip`,
|
|
@@ -5433,7 +5303,7 @@ var MatchForm = ({
|
|
|
5433
5303
|
as: "span"
|
|
5434
5304
|
},
|
|
5435
5305
|
match.details.description
|
|
5436
|
-
), match.details.id === bankTransaction.match?.details.id && /* @__PURE__ */
|
|
5306
|
+
), match.details.id === bankTransaction.match?.details.id && /* @__PURE__ */ import_react61.default.createElement("span", { className: "match-badge" }, /* @__PURE__ */ import_react61.default.createElement(
|
|
5437
5307
|
MatchBadge,
|
|
5438
5308
|
{
|
|
5439
5309
|
classNamePrefix,
|
|
@@ -5442,13 +5312,13 @@ var MatchForm = ({
|
|
|
5442
5312
|
text: "Matched"
|
|
5443
5313
|
}
|
|
5444
5314
|
))),
|
|
5445
|
-
/* @__PURE__ */
|
|
5446
|
-
/* @__PURE__ */
|
|
5315
|
+
/* @__PURE__ */ import_react61.default.createElement("div", { className: `${classNamePrefix}__match-table__amount` }, "$", centsToDollars(match.details.amount)),
|
|
5316
|
+
/* @__PURE__ */ import_react61.default.createElement(
|
|
5447
5317
|
"div",
|
|
5448
5318
|
{
|
|
5449
5319
|
className: `${classNamePrefix}__match-table__status ${bankTransaction.match ? "" : "no-match"}`
|
|
5450
5320
|
},
|
|
5451
|
-
match.details.id === bankTransaction.match?.details.id && /* @__PURE__ */
|
|
5321
|
+
match.details.id === bankTransaction.match?.details.id && /* @__PURE__ */ import_react61.default.createElement(
|
|
5452
5322
|
MatchBadge,
|
|
5453
5323
|
{
|
|
5454
5324
|
classNamePrefix,
|
|
@@ -5459,13 +5329,13 @@ var MatchForm = ({
|
|
|
5459
5329
|
)
|
|
5460
5330
|
)
|
|
5461
5331
|
);
|
|
5462
|
-
}), matchFormError && /* @__PURE__ */
|
|
5332
|
+
}), matchFormError && /* @__PURE__ */ import_react61.default.createElement(ErrorText, null, matchFormError));
|
|
5463
5333
|
};
|
|
5464
5334
|
|
|
5465
5335
|
// src/components/MatchForm/MatchFormMobile.tsx
|
|
5466
|
-
var
|
|
5336
|
+
var import_react62 = __toESM(require("react"));
|
|
5467
5337
|
var import_classnames29 = __toESM(require("classnames"));
|
|
5468
|
-
var
|
|
5338
|
+
var import_date_fns7 = require("date-fns");
|
|
5469
5339
|
var MatchFormMobile = ({
|
|
5470
5340
|
classNamePrefix,
|
|
5471
5341
|
bankTransaction,
|
|
@@ -5473,8 +5343,8 @@ var MatchFormMobile = ({
|
|
|
5473
5343
|
setSelectedMatchId,
|
|
5474
5344
|
matchFormError
|
|
5475
5345
|
}) => {
|
|
5476
|
-
return /* @__PURE__ */
|
|
5477
|
-
return /* @__PURE__ */
|
|
5346
|
+
return /* @__PURE__ */ import_react62.default.createElement("div", { className: `${classNamePrefix}__match-list` }, bankTransaction.suggested_matches?.map((match, idx) => {
|
|
5347
|
+
return /* @__PURE__ */ import_react62.default.createElement(
|
|
5478
5348
|
"div",
|
|
5479
5349
|
{
|
|
5480
5350
|
key: idx,
|
|
@@ -5490,14 +5360,14 @@ var MatchFormMobile = ({
|
|
|
5490
5360
|
setSelectedMatchId(match.id);
|
|
5491
5361
|
}
|
|
5492
5362
|
},
|
|
5493
|
-
/* @__PURE__ */
|
|
5363
|
+
/* @__PURE__ */ import_react62.default.createElement("div", { className: `${classNamePrefix}__match-item__col-details` }, /* @__PURE__ */ import_react62.default.createElement("div", { className: `${classNamePrefix}__match-item__heading` }, /* @__PURE__ */ import_react62.default.createElement(
|
|
5494
5364
|
Text,
|
|
5495
5365
|
{
|
|
5496
5366
|
className: `${classNamePrefix}__match-item__name`,
|
|
5497
5367
|
as: "span"
|
|
5498
5368
|
},
|
|
5499
5369
|
match.details.description
|
|
5500
|
-
), /* @__PURE__ */
|
|
5370
|
+
), /* @__PURE__ */ import_react62.default.createElement(
|
|
5501
5371
|
Text,
|
|
5502
5372
|
{
|
|
5503
5373
|
className: `${classNamePrefix}__match-item__amount`,
|
|
@@ -5505,16 +5375,16 @@ var MatchFormMobile = ({
|
|
|
5505
5375
|
},
|
|
5506
5376
|
"$",
|
|
5507
5377
|
centsToDollars(match.details.amount)
|
|
5508
|
-
)), /* @__PURE__ */
|
|
5378
|
+
)), /* @__PURE__ */ import_react62.default.createElement("div", { className: `${classNamePrefix}__match-item__details` }, /* @__PURE__ */ import_react62.default.createElement(
|
|
5509
5379
|
Text,
|
|
5510
5380
|
{
|
|
5511
5381
|
className: `${classNamePrefix}__match-item__date`,
|
|
5512
5382
|
size: "sm" /* sm */,
|
|
5513
5383
|
as: "span"
|
|
5514
5384
|
},
|
|
5515
|
-
(0,
|
|
5385
|
+
(0, import_date_fns7.format)((0, import_date_fns7.parseISO)(match.details.date), MONTH_DAY_FORMAT)
|
|
5516
5386
|
))),
|
|
5517
|
-
/* @__PURE__ */
|
|
5387
|
+
/* @__PURE__ */ import_react62.default.createElement("div", { className: `${classNamePrefix}__match-item__col-status` }, selectedMatchId && selectedMatchId === match.id ? /* @__PURE__ */ import_react62.default.createElement(
|
|
5518
5388
|
Check_default,
|
|
5519
5389
|
{
|
|
5520
5390
|
size: 16,
|
|
@@ -5522,11 +5392,11 @@ var MatchFormMobile = ({
|
|
|
5522
5392
|
}
|
|
5523
5393
|
) : null)
|
|
5524
5394
|
);
|
|
5525
|
-
}), matchFormError && /* @__PURE__ */
|
|
5395
|
+
}), matchFormError && /* @__PURE__ */ import_react62.default.createElement(ErrorText, null, matchFormError));
|
|
5526
5396
|
};
|
|
5527
5397
|
|
|
5528
5398
|
// src/components/Textarea/Textarea.tsx
|
|
5529
|
-
var
|
|
5399
|
+
var import_react63 = __toESM(require("react"));
|
|
5530
5400
|
var import_classnames30 = __toESM(require("classnames"));
|
|
5531
5401
|
var Textarea = ({
|
|
5532
5402
|
className,
|
|
@@ -5539,11 +5409,11 @@ var Textarea = ({
|
|
|
5539
5409
|
isInvalid ? "Layer__textarea--error" : "",
|
|
5540
5410
|
className
|
|
5541
5411
|
);
|
|
5542
|
-
return /* @__PURE__ */
|
|
5412
|
+
return /* @__PURE__ */ import_react63.default.createElement(Tooltip, { disabled: !isInvalid || !errorMessage }, /* @__PURE__ */ import_react63.default.createElement(TooltipTrigger, { className: "Layer__input-tooltip" }, /* @__PURE__ */ import_react63.default.createElement("textarea", { ...props, className: baseClassName })), /* @__PURE__ */ import_react63.default.createElement(TooltipContent, { className: "Layer__tooltip" }, errorMessage));
|
|
5543
5413
|
};
|
|
5544
5414
|
|
|
5545
5415
|
// src/components/Toggle/Toggle.tsx
|
|
5546
|
-
var
|
|
5416
|
+
var import_react64 = __toESM(require("react"));
|
|
5547
5417
|
var import_classnames31 = __toESM(require("classnames"));
|
|
5548
5418
|
var Toggle = ({
|
|
5549
5419
|
name,
|
|
@@ -5552,9 +5422,9 @@ var Toggle = ({
|
|
|
5552
5422
|
onChange,
|
|
5553
5423
|
size = "medium" /* medium */
|
|
5554
5424
|
}) => {
|
|
5555
|
-
const [currentWidth, setCurrentWidth] = (0,
|
|
5556
|
-
const [thumbPos, setThumbPos] = (0,
|
|
5557
|
-
const [initialized, setInitialized] = (0,
|
|
5425
|
+
const [currentWidth, setCurrentWidth] = (0, import_react64.useState)(0);
|
|
5426
|
+
const [thumbPos, setThumbPos] = (0, import_react64.useState)({ left: 0, width: 0 });
|
|
5427
|
+
const [initialized, setInitialized] = (0, import_react64.useState)(false);
|
|
5558
5428
|
const toggleRef = useElementSize((a, b, c) => {
|
|
5559
5429
|
if (c.width && c?.width !== currentWidth) {
|
|
5560
5430
|
setCurrentWidth(c.width);
|
|
@@ -5574,9 +5444,12 @@ var Toggle = ({
|
|
|
5574
5444
|
if (!toggleRef?.current) {
|
|
5575
5445
|
return;
|
|
5576
5446
|
}
|
|
5577
|
-
const optionsNodes = [...toggleRef.current.children].
|
|
5578
|
-
(
|
|
5579
|
-
|
|
5447
|
+
const optionsNodes = [...toggleRef.current.children].map((x) => {
|
|
5448
|
+
if (x.className.includes("Layer__tooltip-trigger") && x.children && x.children.length > 0) {
|
|
5449
|
+
return x.children[0];
|
|
5450
|
+
}
|
|
5451
|
+
return x;
|
|
5452
|
+
}).filter((c) => c.className.includes("Layer__toggle-option"));
|
|
5580
5453
|
let shift2 = 0;
|
|
5581
5454
|
let width = thumbPos.width;
|
|
5582
5455
|
optionsNodes.forEach((c, i) => {
|
|
@@ -5589,14 +5462,14 @@ var Toggle = ({
|
|
|
5589
5462
|
shift2 = shift2 + (size === "medium" /* medium */ ? 2 : 1.5);
|
|
5590
5463
|
setThumbPos({ left: shift2, width });
|
|
5591
5464
|
};
|
|
5592
|
-
(0,
|
|
5465
|
+
(0, import_react64.useEffect)(() => {
|
|
5593
5466
|
const selectedIndex = getSelectedIndex();
|
|
5594
5467
|
updateThumbPosition(selectedIndex);
|
|
5595
5468
|
setTimeout(() => {
|
|
5596
5469
|
setInitialized(true);
|
|
5597
5470
|
}, 400);
|
|
5598
5471
|
}, []);
|
|
5599
|
-
(0,
|
|
5472
|
+
(0, import_react64.useEffect)(() => {
|
|
5600
5473
|
const selectedIndex = getSelectedIndex();
|
|
5601
5474
|
updateThumbPosition(selectedIndex);
|
|
5602
5475
|
}, [currentWidth]);
|
|
@@ -5609,7 +5482,7 @@ var Toggle = ({
|
|
|
5609
5482
|
}
|
|
5610
5483
|
return selectedIndex;
|
|
5611
5484
|
};
|
|
5612
|
-
return /* @__PURE__ */
|
|
5485
|
+
return /* @__PURE__ */ import_react64.default.createElement("div", { className: baseClassName, ref: toggleRef }, options.map((option, index) => /* @__PURE__ */ import_react64.default.createElement(
|
|
5613
5486
|
ToggleOption,
|
|
5614
5487
|
{
|
|
5615
5488
|
...option,
|
|
@@ -5622,7 +5495,7 @@ var Toggle = ({
|
|
|
5622
5495
|
disabledMessage: option.disabledMessage,
|
|
5623
5496
|
index
|
|
5624
5497
|
}
|
|
5625
|
-
)), /* @__PURE__ */
|
|
5498
|
+
)), /* @__PURE__ */ import_react64.default.createElement("span", { className: "Layer__toggle__thumb", style: { ...thumbPos } }));
|
|
5626
5499
|
};
|
|
5627
5500
|
var ToggleOption = ({
|
|
5628
5501
|
checked,
|
|
@@ -5638,14 +5511,14 @@ var ToggleOption = ({
|
|
|
5638
5511
|
index
|
|
5639
5512
|
}) => {
|
|
5640
5513
|
if (disabled) {
|
|
5641
|
-
return /* @__PURE__ */
|
|
5514
|
+
return /* @__PURE__ */ import_react64.default.createElement(Tooltip, null, /* @__PURE__ */ import_react64.default.createElement(TooltipTrigger, null, /* @__PURE__ */ import_react64.default.createElement(
|
|
5642
5515
|
"label",
|
|
5643
5516
|
{
|
|
5644
5517
|
className: `Layer__toggle-option`,
|
|
5645
5518
|
"data-checked": checked,
|
|
5646
5519
|
style
|
|
5647
5520
|
},
|
|
5648
|
-
/* @__PURE__ */
|
|
5521
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
5649
5522
|
"input",
|
|
5650
5523
|
{
|
|
5651
5524
|
type: "radio",
|
|
@@ -5657,17 +5530,17 @@ var ToggleOption = ({
|
|
|
5657
5530
|
"data-idx": index
|
|
5658
5531
|
}
|
|
5659
5532
|
),
|
|
5660
|
-
/* @__PURE__ */
|
|
5661
|
-
)), /* @__PURE__ */
|
|
5533
|
+
/* @__PURE__ */ import_react64.default.createElement("span", { className: "Layer__toggle-option-content" }, leftIcon && /* @__PURE__ */ import_react64.default.createElement("span", { className: "Layer__toggle-option__icon" }, leftIcon), /* @__PURE__ */ import_react64.default.createElement("span", null, label))
|
|
5534
|
+
)), /* @__PURE__ */ import_react64.default.createElement(TooltipContent, { className: "Layer__tooltip" }, disabledMessage));
|
|
5662
5535
|
}
|
|
5663
|
-
return /* @__PURE__ */
|
|
5536
|
+
return /* @__PURE__ */ import_react64.default.createElement(
|
|
5664
5537
|
"label",
|
|
5665
5538
|
{
|
|
5666
5539
|
className: `Layer__toggle-option`,
|
|
5667
5540
|
"data-checked": checked,
|
|
5668
5541
|
style
|
|
5669
5542
|
},
|
|
5670
|
-
/* @__PURE__ */
|
|
5543
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
5671
5544
|
"input",
|
|
5672
5545
|
{
|
|
5673
5546
|
type: "radio",
|
|
@@ -5679,12 +5552,12 @@ var ToggleOption = ({
|
|
|
5679
5552
|
"data-idx": index
|
|
5680
5553
|
}
|
|
5681
5554
|
),
|
|
5682
|
-
/* @__PURE__ */
|
|
5555
|
+
/* @__PURE__ */ import_react64.default.createElement("span", { className: "Layer__toggle-option-content" }, leftIcon && /* @__PURE__ */ import_react64.default.createElement("span", { className: "Layer__toggle-option__icon" }, leftIcon), /* @__PURE__ */ import_react64.default.createElement("span", null, label))
|
|
5683
5556
|
);
|
|
5684
5557
|
};
|
|
5685
5558
|
|
|
5686
5559
|
// src/components/ExpandedBankTransactionRow/APIErrorNotifications.tsx
|
|
5687
|
-
var
|
|
5560
|
+
var import_react65 = __toESM(require("react"));
|
|
5688
5561
|
var ERROR_TITLE = "Approval Failed";
|
|
5689
5562
|
var ERROR_MESSAGE = "Something went wrong, try again later";
|
|
5690
5563
|
var NOTIFICATION_TIME = 4e3;
|
|
@@ -5694,7 +5567,7 @@ var APIErrorNotifications = ({
|
|
|
5694
5567
|
bankTransaction,
|
|
5695
5568
|
containerWidth
|
|
5696
5569
|
}) => {
|
|
5697
|
-
const [notifications, setNotifications] = (0,
|
|
5570
|
+
const [notifications, setNotifications] = (0, import_react65.useState)([]);
|
|
5698
5571
|
const pushNotification = (title, message) => {
|
|
5699
5572
|
const timestamp = (/* @__PURE__ */ new Date()).valueOf();
|
|
5700
5573
|
if (notificationsCache.find(
|
|
@@ -5723,18 +5596,18 @@ var APIErrorNotifications = ({
|
|
|
5723
5596
|
);
|
|
5724
5597
|
setNotifications(notificationsCache.concat());
|
|
5725
5598
|
};
|
|
5726
|
-
(0,
|
|
5599
|
+
(0, import_react65.useEffect)(() => {
|
|
5727
5600
|
if (bankTransaction.error) {
|
|
5728
5601
|
pushNotification(ERROR_TITLE, ERROR_MESSAGE);
|
|
5729
5602
|
}
|
|
5730
5603
|
}, [bankTransaction.error]);
|
|
5731
|
-
return /* @__PURE__ */
|
|
5604
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
5732
5605
|
"div",
|
|
5733
5606
|
{
|
|
5734
5607
|
className: "Layer__bank-transactions__notifications",
|
|
5735
5608
|
style: containerWidth ? { left: containerWidth - 324 } : {}
|
|
5736
5609
|
},
|
|
5737
|
-
notifications.filter((n) => n.bankTransactionId === bankTransaction.id).map((notification) => /* @__PURE__ */
|
|
5610
|
+
notifications.filter((n) => n.bankTransactionId === bankTransaction.id).map((notification) => /* @__PURE__ */ import_react65.default.createElement(
|
|
5738
5611
|
Notification,
|
|
5739
5612
|
{
|
|
5740
5613
|
key: notification.timestamp,
|
|
@@ -5748,8 +5621,8 @@ var Notification = ({
|
|
|
5748
5621
|
notification,
|
|
5749
5622
|
deleteNotification
|
|
5750
5623
|
}) => {
|
|
5751
|
-
const [visible, setVisible] = (0,
|
|
5752
|
-
(0,
|
|
5624
|
+
const [visible, setVisible] = (0, import_react65.useState)(false);
|
|
5625
|
+
(0, import_react65.useEffect)(() => {
|
|
5753
5626
|
setVisible(true);
|
|
5754
5627
|
const timer = setTimeout(() => {
|
|
5755
5628
|
hideNotification();
|
|
@@ -5762,20 +5635,20 @@ var Notification = ({
|
|
|
5762
5635
|
deleteNotification(notification.timestamp);
|
|
5763
5636
|
}, FADE_OUT_TIME_WAIT);
|
|
5764
5637
|
};
|
|
5765
|
-
return /* @__PURE__ */
|
|
5638
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
5766
5639
|
"div",
|
|
5767
5640
|
{
|
|
5768
5641
|
className: `Layer__bank-transactions__notification ${visible ? "notification-enter" : "notification-exit"}`,
|
|
5769
5642
|
onClick: hideNotification
|
|
5770
5643
|
},
|
|
5771
|
-
/* @__PURE__ */
|
|
5644
|
+
/* @__PURE__ */ import_react65.default.createElement("div", { className: "Layer__bank-transactions__notification-content" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "Layer__bank-transactions__notification-icon" }, /* @__PURE__ */ import_react65.default.createElement(AlertOctagon_default, { size: 14 })), /* @__PURE__ */ import_react65.default.createElement("div", { className: "Layer__bank-transactions__notification-text" }, /* @__PURE__ */ import_react65.default.createElement(
|
|
5772
5645
|
Text,
|
|
5773
5646
|
{
|
|
5774
5647
|
as: "span",
|
|
5775
5648
|
className: "Layer__bank-transactions__notification-title"
|
|
5776
5649
|
},
|
|
5777
5650
|
notification.title
|
|
5778
|
-
), /* @__PURE__ */
|
|
5651
|
+
), /* @__PURE__ */ import_react65.default.createElement(
|
|
5779
5652
|
Text,
|
|
5780
5653
|
{
|
|
5781
5654
|
as: "span",
|
|
@@ -5808,7 +5681,7 @@ var validateSplit = (splitData) => {
|
|
|
5808
5681
|
});
|
|
5809
5682
|
return valid;
|
|
5810
5683
|
};
|
|
5811
|
-
var ExpandedBankTransactionRow = (0,
|
|
5684
|
+
var ExpandedBankTransactionRow = (0, import_react66.forwardRef)(
|
|
5812
5685
|
({
|
|
5813
5686
|
bankTransaction,
|
|
5814
5687
|
isOpen = false,
|
|
@@ -5819,31 +5692,29 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
5819
5692
|
containerWidth,
|
|
5820
5693
|
showDescriptions,
|
|
5821
5694
|
mode,
|
|
5822
|
-
showReceiptUploads
|
|
5823
|
-
hardRefreshPnlOnCategorize
|
|
5695
|
+
showReceiptUploads
|
|
5824
5696
|
}, ref) => {
|
|
5825
5697
|
const {
|
|
5826
5698
|
categorize: categorizeBankTransaction2,
|
|
5827
5699
|
match: matchBankTransaction2
|
|
5828
5700
|
} = useBankTransactionsContext();
|
|
5829
|
-
const
|
|
5830
|
-
const [purpose, setPurpose] = (0, import_react67.useState)(
|
|
5701
|
+
const [purpose, setPurpose] = (0, import_react66.useState)(
|
|
5831
5702
|
bankTransaction.category ? "categorize" /* categorize */ : hasMatch(bankTransaction) ? "match" /* match */ : "categorize" /* categorize */
|
|
5832
5703
|
);
|
|
5833
|
-
const [selectedMatchId, setSelectedMatchId] = (0,
|
|
5704
|
+
const [selectedMatchId, setSelectedMatchId] = (0, import_react66.useState)(
|
|
5834
5705
|
isAlreadyMatched2(bankTransaction)
|
|
5835
5706
|
);
|
|
5836
|
-
const [matchFormError, setMatchFormError] = (0,
|
|
5837
|
-
const [splitFormError, setSplitFormError] = (0,
|
|
5838
|
-
const [height, setHeight] = (0,
|
|
5839
|
-
const [isOver, setOver] = (0,
|
|
5840
|
-
const bodyRef = (0,
|
|
5841
|
-
const [memoText, setMemoText] = (0,
|
|
5842
|
-
const [receiptUrls, setReceiptUrls] = (0,
|
|
5843
|
-
const [isLoaded, setIsLoaded] = (0,
|
|
5707
|
+
const [matchFormError, setMatchFormError] = (0, import_react66.useState)();
|
|
5708
|
+
const [splitFormError, setSplitFormError] = (0, import_react66.useState)();
|
|
5709
|
+
const [height, setHeight] = (0, import_react66.useState)(0);
|
|
5710
|
+
const [isOver, setOver] = (0, import_react66.useState)(false);
|
|
5711
|
+
const bodyRef = (0, import_react66.useRef)(null);
|
|
5712
|
+
const [memoText, setMemoText] = (0, import_react66.useState)();
|
|
5713
|
+
const [receiptUrls, setReceiptUrls] = (0, import_react66.useState)([]);
|
|
5714
|
+
const [isLoaded, setIsLoaded] = (0, import_react66.useState)(false);
|
|
5844
5715
|
const { auth, businessId, apiUrl } = useLayerContext();
|
|
5845
5716
|
const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && bankTransaction.categorization_flow?.suggestions?.[0];
|
|
5846
|
-
const [rowState, updateRowState] = (0,
|
|
5717
|
+
const [rowState, updateRowState] = (0, import_react66.useState)({
|
|
5847
5718
|
splits: bankTransaction.category?.entries ? bankTransaction.category?.entries.map((c) => {
|
|
5848
5719
|
return {
|
|
5849
5720
|
amount: c.amount || 0,
|
|
@@ -5958,8 +5829,6 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
5958
5829
|
} else if (selectedMatchId && selectedMatchId !== isAlreadyMatched2(bankTransaction)) {
|
|
5959
5830
|
onMatchSubmit(selectedMatchId);
|
|
5960
5831
|
}
|
|
5961
|
-
if (hardRefreshPnlOnCategorize)
|
|
5962
|
-
refetch();
|
|
5963
5832
|
return;
|
|
5964
5833
|
}
|
|
5965
5834
|
if (!validateSplit(rowState)) {
|
|
@@ -5985,8 +5854,6 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
5985
5854
|
}))
|
|
5986
5855
|
}
|
|
5987
5856
|
);
|
|
5988
|
-
if (hardRefreshPnlOnCategorize)
|
|
5989
|
-
refetch();
|
|
5990
5857
|
close();
|
|
5991
5858
|
};
|
|
5992
5859
|
const fetchMetadata = async () => {
|
|
@@ -6021,7 +5888,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6021
5888
|
);
|
|
6022
5889
|
setReceiptUrls(retrievedDocs);
|
|
6023
5890
|
};
|
|
6024
|
-
(0,
|
|
5891
|
+
(0, import_react66.useImperativeHandle)(ref, () => ({
|
|
6025
5892
|
save
|
|
6026
5893
|
}));
|
|
6027
5894
|
const onMatchSubmit = async (matchId) => {
|
|
@@ -6034,11 +5901,11 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6034
5901
|
await matchBankTransaction2(bankTransaction.id, foundMatch.id);
|
|
6035
5902
|
close();
|
|
6036
5903
|
};
|
|
6037
|
-
const getDivHeight = (0,
|
|
5904
|
+
const getDivHeight = (0, import_react66.useCallback)(() => {
|
|
6038
5905
|
const { height: height2 } = bodyRef.current ? bodyRef.current.getBoundingClientRect() : { height: void 0 };
|
|
6039
5906
|
return height2 || 0;
|
|
6040
5907
|
}, []);
|
|
6041
|
-
const handleTransitionEnd = (0,
|
|
5908
|
+
const handleTransitionEnd = (0, import_react66.useCallback)(
|
|
6042
5909
|
(e) => {
|
|
6043
5910
|
if (e.propertyName === "height") {
|
|
6044
5911
|
setHeight(isOpen ? "auto" : 0);
|
|
@@ -6049,7 +5916,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6049
5916
|
},
|
|
6050
5917
|
[isOpen]
|
|
6051
5918
|
);
|
|
6052
|
-
(0,
|
|
5919
|
+
(0, import_react66.useEffect)(() => {
|
|
6053
5920
|
if (!isLoaded) {
|
|
6054
5921
|
return;
|
|
6055
5922
|
}
|
|
@@ -6061,7 +5928,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6061
5928
|
});
|
|
6062
5929
|
}
|
|
6063
5930
|
}, [getDivHeight, isOpen]);
|
|
6064
|
-
(0,
|
|
5931
|
+
(0, import_react66.useEffect)(() => {
|
|
6065
5932
|
const loadDocumentsAndMetadata = async () => {
|
|
6066
5933
|
if (showDescriptions)
|
|
6067
5934
|
await fetchMetadata();
|
|
@@ -6074,14 +5941,14 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6074
5941
|
}, []);
|
|
6075
5942
|
const className = "Layer__expanded-bank-transaction-row";
|
|
6076
5943
|
const shouldHide = !isOpen && isOver;
|
|
6077
|
-
return /* @__PURE__ */
|
|
5944
|
+
return /* @__PURE__ */ import_react66.default.createElement(
|
|
6078
5945
|
"span",
|
|
6079
5946
|
{
|
|
6080
5947
|
className: `${className} ${className}--${isOpen ? "expanded" : "collapsed"}`,
|
|
6081
5948
|
style: { height },
|
|
6082
5949
|
onTransitionEnd: handleTransitionEnd
|
|
6083
5950
|
},
|
|
6084
|
-
shouldHide ? null : /* @__PURE__ */
|
|
5951
|
+
shouldHide ? null : /* @__PURE__ */ import_react66.default.createElement("span", { className: `${className}__wrapper`, ref: bodyRef }, categorizationEnabled(mode) ? /* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__content-toggle` }, /* @__PURE__ */ import_react66.default.createElement(
|
|
6085
5952
|
Toggle,
|
|
6086
5953
|
{
|
|
6087
5954
|
name: `purpose-${bankTransaction.id}${asListItem ? "-li" : ""}`,
|
|
@@ -6101,13 +5968,13 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6101
5968
|
selected: purpose,
|
|
6102
5969
|
onChange: onChangePurpose
|
|
6103
5970
|
}
|
|
6104
|
-
)) : /* @__PURE__ */
|
|
5971
|
+
)) : /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null), /* @__PURE__ */ import_react66.default.createElement(
|
|
6105
5972
|
"div",
|
|
6106
5973
|
{
|
|
6107
5974
|
className: `${className}__content`,
|
|
6108
5975
|
id: `expanded-${bankTransaction.id}`
|
|
6109
5976
|
},
|
|
6110
|
-
/* @__PURE__ */
|
|
5977
|
+
/* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__content-panels` }, /* @__PURE__ */ import_react66.default.createElement(
|
|
6111
5978
|
"div",
|
|
6112
5979
|
{
|
|
6113
5980
|
className: (0, import_classnames32.default)(
|
|
@@ -6116,7 +5983,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6116
5983
|
purpose === "match" /* match */ ? `${className}__content-panel--active` : ""
|
|
6117
5984
|
)
|
|
6118
5985
|
},
|
|
6119
|
-
/* @__PURE__ */
|
|
5986
|
+
/* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__content-panel-container` }, /* @__PURE__ */ import_react66.default.createElement(
|
|
6120
5987
|
MatchForm,
|
|
6121
5988
|
{
|
|
6122
5989
|
classNamePrefix: className,
|
|
@@ -6130,7 +5997,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6130
5997
|
matchFormError
|
|
6131
5998
|
}
|
|
6132
5999
|
))
|
|
6133
|
-
), /* @__PURE__ */
|
|
6000
|
+
), /* @__PURE__ */ import_react66.default.createElement(
|
|
6134
6001
|
"div",
|
|
6135
6002
|
{
|
|
6136
6003
|
className: (0, import_classnames32.default)(
|
|
@@ -6139,13 +6006,13 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6139
6006
|
purpose === "categorize" /* categorize */ ? `${className}__content-panel--active` : ""
|
|
6140
6007
|
)
|
|
6141
6008
|
},
|
|
6142
|
-
/* @__PURE__ */
|
|
6009
|
+
/* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__content-panel-container` }, /* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__splits-inputs` }, rowState.splits.map((split, index) => /* @__PURE__ */ import_react66.default.createElement(
|
|
6143
6010
|
"div",
|
|
6144
6011
|
{
|
|
6145
6012
|
className: `${className}__table-cell--split-entry`,
|
|
6146
6013
|
key: `split-${index}`
|
|
6147
6014
|
},
|
|
6148
|
-
/* @__PURE__ */
|
|
6015
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
6149
6016
|
Input,
|
|
6150
6017
|
{
|
|
6151
6018
|
type: "text",
|
|
@@ -6159,12 +6026,12 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6159
6026
|
errorMessage: "Negative values are not allowed"
|
|
6160
6027
|
}
|
|
6161
6028
|
),
|
|
6162
|
-
/* @__PURE__ */
|
|
6029
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
6163
6030
|
"div",
|
|
6164
6031
|
{
|
|
6165
6032
|
className: `${className}__table-cell--split-entry__right-col`
|
|
6166
6033
|
},
|
|
6167
|
-
/* @__PURE__ */
|
|
6034
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
6168
6035
|
CategorySelect,
|
|
6169
6036
|
{
|
|
6170
6037
|
bankTransaction,
|
|
@@ -6176,18 +6043,18 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6176
6043
|
excludeMatches: true
|
|
6177
6044
|
}
|
|
6178
6045
|
),
|
|
6179
|
-
index > 0 && /* @__PURE__ */
|
|
6046
|
+
index > 0 && /* @__PURE__ */ import_react66.default.createElement(
|
|
6180
6047
|
Button,
|
|
6181
6048
|
{
|
|
6182
6049
|
className: `${className}__table-cell--split-entry__merge-btn`,
|
|
6183
6050
|
onClick: () => removeSplit(index),
|
|
6184
|
-
rightIcon: /* @__PURE__ */
|
|
6051
|
+
rightIcon: /* @__PURE__ */ import_react66.default.createElement(Trash_default, { size: 18 }),
|
|
6185
6052
|
variant: "secondary" /* secondary */,
|
|
6186
6053
|
iconOnly: true
|
|
6187
6054
|
}
|
|
6188
6055
|
)
|
|
6189
6056
|
)
|
|
6190
|
-
))), splitFormError && /* @__PURE__ */
|
|
6057
|
+
))), splitFormError && /* @__PURE__ */ import_react66.default.createElement(ErrorText, null, splitFormError), /* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__total-and-btns` }, rowState.splits.length > 1 && /* @__PURE__ */ import_react66.default.createElement(
|
|
6191
6058
|
Input,
|
|
6192
6059
|
{
|
|
6193
6060
|
disabled: true,
|
|
@@ -6200,31 +6067,31 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6200
6067
|
)
|
|
6201
6068
|
)}`
|
|
6202
6069
|
}
|
|
6203
|
-
), categorizationEnabled(mode) ? /* @__PURE__ */
|
|
6070
|
+
), categorizationEnabled(mode) ? /* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__splits-buttons` }, rowState.splits.length > 1 ? /* @__PURE__ */ import_react66.default.createElement(
|
|
6204
6071
|
TextButton,
|
|
6205
6072
|
{
|
|
6206
6073
|
onClick: addSplit,
|
|
6207
6074
|
disabled: rowState.splits.length > 5
|
|
6208
6075
|
},
|
|
6209
6076
|
"Add new split"
|
|
6210
|
-
) : /* @__PURE__ */
|
|
6077
|
+
) : /* @__PURE__ */ import_react66.default.createElement(
|
|
6211
6078
|
Button,
|
|
6212
6079
|
{
|
|
6213
6080
|
onClick: addSplit,
|
|
6214
|
-
rightIcon: /* @__PURE__ */
|
|
6081
|
+
rightIcon: /* @__PURE__ */ import_react66.default.createElement(ScissorsFullOpen_default, { size: 14 }),
|
|
6215
6082
|
variant: "secondary" /* secondary */,
|
|
6216
6083
|
disabled: rowState.splits.length > 5
|
|
6217
6084
|
},
|
|
6218
6085
|
"Split"
|
|
6219
|
-
)) : /* @__PURE__ */
|
|
6086
|
+
)) : /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null)))
|
|
6220
6087
|
)),
|
|
6221
|
-
showDescriptions && /* @__PURE__ */
|
|
6088
|
+
showDescriptions && /* @__PURE__ */ import_react66.default.createElement(
|
|
6222
6089
|
InputGroup,
|
|
6223
6090
|
{
|
|
6224
6091
|
className: `${className}__description`,
|
|
6225
6092
|
name: "description"
|
|
6226
6093
|
},
|
|
6227
|
-
/* @__PURE__ */
|
|
6094
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
6228
6095
|
Textarea,
|
|
6229
6096
|
{
|
|
6230
6097
|
name: "description",
|
|
@@ -6234,7 +6101,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6234
6101
|
}
|
|
6235
6102
|
)
|
|
6236
6103
|
),
|
|
6237
|
-
showReceiptUploads && /* @__PURE__ */
|
|
6104
|
+
showReceiptUploads && /* @__PURE__ */ import_react66.default.createElement("div", null, /* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__file-upload` }, /* @__PURE__ */ import_react66.default.createElement(
|
|
6238
6105
|
FileInput,
|
|
6239
6106
|
{
|
|
6240
6107
|
onUpload: async (file) => {
|
|
@@ -6252,7 +6119,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6252
6119
|
},
|
|
6253
6120
|
text: "Upload receipt"
|
|
6254
6121
|
}
|
|
6255
|
-
), receiptUrls.length > 0 && "Attached receipts:", receiptUrls.map((url, index) => /* @__PURE__ */
|
|
6122
|
+
), receiptUrls.length > 0 && "Attached receipts:", receiptUrls.map((url, index) => /* @__PURE__ */ import_react66.default.createElement(
|
|
6256
6123
|
"a",
|
|
6257
6124
|
{
|
|
6258
6125
|
key: url,
|
|
@@ -6263,16 +6130,16 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6263
6130
|
"Receipt ",
|
|
6264
6131
|
index + 1
|
|
6265
6132
|
)))),
|
|
6266
|
-
asListItem ? /* @__PURE__ */
|
|
6133
|
+
asListItem && categorizationEnabled(mode) ? /* @__PURE__ */ import_react66.default.createElement("div", { className: `${className}__submit-btn` }, bankTransaction.error ? /* @__PURE__ */ import_react66.default.createElement(
|
|
6267
6134
|
Text,
|
|
6268
6135
|
{
|
|
6269
6136
|
as: "span",
|
|
6270
6137
|
size: "md" /* md */,
|
|
6271
6138
|
className: "Layer__unsaved-info"
|
|
6272
6139
|
},
|
|
6273
|
-
/* @__PURE__ */
|
|
6274
|
-
/* @__PURE__ */
|
|
6275
|
-
) : null, /* @__PURE__ */
|
|
6140
|
+
/* @__PURE__ */ import_react66.default.createElement("span", null, "Unsaved"),
|
|
6141
|
+
/* @__PURE__ */ import_react66.default.createElement(AlertCircle_default, { size: 12 })
|
|
6142
|
+
) : null, /* @__PURE__ */ import_react66.default.createElement(
|
|
6276
6143
|
SubmitButton,
|
|
6277
6144
|
{
|
|
6278
6145
|
onClick: () => {
|
|
@@ -6287,7 +6154,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6287
6154
|
},
|
|
6288
6155
|
submitBtnText
|
|
6289
6156
|
)) : null
|
|
6290
|
-
), /* @__PURE__ */
|
|
6157
|
+
), /* @__PURE__ */ import_react66.default.createElement(
|
|
6291
6158
|
APIErrorNotifications,
|
|
6292
6159
|
{
|
|
6293
6160
|
bankTransaction,
|
|
@@ -6299,7 +6166,7 @@ var ExpandedBankTransactionRow = (0, import_react67.forwardRef)(
|
|
|
6299
6166
|
);
|
|
6300
6167
|
|
|
6301
6168
|
// src/components/BankTransactionRow/SplitTooltipDetails.tsx
|
|
6302
|
-
var
|
|
6169
|
+
var import_react67 = __toESM(require("react"));
|
|
6303
6170
|
var SplitTooltipDetails = ({
|
|
6304
6171
|
classNamePrefix,
|
|
6305
6172
|
category
|
|
@@ -6307,12 +6174,12 @@ var SplitTooltipDetails = ({
|
|
|
6307
6174
|
if (!category.entries) {
|
|
6308
6175
|
return;
|
|
6309
6176
|
}
|
|
6310
|
-
return /* @__PURE__ */
|
|
6177
|
+
return /* @__PURE__ */ import_react67.default.createElement("span", { className: `${classNamePrefix}__split-tooltip` }, /* @__PURE__ */ import_react67.default.createElement("ul", null, category.entries.map((entry, idx) => /* @__PURE__ */ import_react67.default.createElement("li", { key: idx }, /* @__PURE__ */ import_react67.default.createElement("span", { className: `${classNamePrefix}__split-tooltip__label` }, entry.category.display_name), /* @__PURE__ */ import_react67.default.createElement("span", { className: `${classNamePrefix}__split-tooltip__value` }, "$", centsToDollars(entry.amount))))));
|
|
6311
6178
|
};
|
|
6312
6179
|
|
|
6313
6180
|
// src/components/BankTransactionRow/BankTransactionRow.tsx
|
|
6314
6181
|
var import_classnames33 = __toESM(require("classnames"));
|
|
6315
|
-
var
|
|
6182
|
+
var import_date_fns8 = require("date-fns");
|
|
6316
6183
|
var extractDescriptionForSplit = (category) => {
|
|
6317
6184
|
if (!category.entries) {
|
|
6318
6185
|
return "";
|
|
@@ -6342,21 +6209,19 @@ var BankTransactionRow = ({
|
|
|
6342
6209
|
initialLoad,
|
|
6343
6210
|
showDescriptions,
|
|
6344
6211
|
showReceiptUploads,
|
|
6345
|
-
hardRefreshPnlOnCategorize,
|
|
6346
6212
|
stringOverrides
|
|
6347
6213
|
}) => {
|
|
6348
|
-
const expandedRowRef = (0,
|
|
6349
|
-
const [showRetry, setShowRetry] = (0,
|
|
6214
|
+
const expandedRowRef = (0, import_react68.useRef)(null);
|
|
6215
|
+
const [showRetry, setShowRetry] = (0, import_react68.useState)(false);
|
|
6350
6216
|
const {
|
|
6351
6217
|
filters,
|
|
6352
6218
|
categorize: categorizeBankTransaction2,
|
|
6353
6219
|
match: matchBankTransaction2
|
|
6354
6220
|
} = useBankTransactionsContext();
|
|
6355
|
-
const
|
|
6356
|
-
const [selectedCategory, setSelectedCategory] = (0, import_react69.useState)(
|
|
6221
|
+
const [selectedCategory, setSelectedCategory] = (0, import_react68.useState)(
|
|
6357
6222
|
getDefaultSelectedCategory(bankTransaction)
|
|
6358
6223
|
);
|
|
6359
|
-
const [open, setOpen] = (0,
|
|
6224
|
+
const [open, setOpen] = (0, import_react68.useState)(false);
|
|
6360
6225
|
const toggleOpen = () => {
|
|
6361
6226
|
setShowRetry(false);
|
|
6362
6227
|
setOpen(!open);
|
|
@@ -6372,8 +6237,8 @@ var BankTransactionRow = ({
|
|
|
6372
6237
|
}
|
|
6373
6238
|
}
|
|
6374
6239
|
};
|
|
6375
|
-
const [showComponent, setShowComponent] = (0,
|
|
6376
|
-
(0,
|
|
6240
|
+
const [showComponent, setShowComponent] = (0, import_react68.useState)(false);
|
|
6241
|
+
(0, import_react68.useEffect)(() => {
|
|
6377
6242
|
if (initialLoad) {
|
|
6378
6243
|
const timeoutId = setTimeout(() => {
|
|
6379
6244
|
setShowComponent(true);
|
|
@@ -6383,12 +6248,12 @@ var BankTransactionRow = ({
|
|
|
6383
6248
|
setShowComponent(true);
|
|
6384
6249
|
}
|
|
6385
6250
|
}, []);
|
|
6386
|
-
(0,
|
|
6251
|
+
(0, import_react68.useEffect)(() => {
|
|
6387
6252
|
if (bankTransaction.error) {
|
|
6388
6253
|
setShowRetry(true);
|
|
6389
6254
|
}
|
|
6390
6255
|
}, [bankTransaction.error]);
|
|
6391
|
-
(0,
|
|
6256
|
+
(0, import_react68.useEffect)(() => {
|
|
6392
6257
|
if (editable && bankTransaction.recently_categorized) {
|
|
6393
6258
|
setTimeout(() => {
|
|
6394
6259
|
removeTransaction(bankTransaction);
|
|
@@ -6398,8 +6263,6 @@ var BankTransactionRow = ({
|
|
|
6398
6263
|
const save = async () => {
|
|
6399
6264
|
if (open && expandedRowRef?.current) {
|
|
6400
6265
|
expandedRowRef?.current?.save();
|
|
6401
|
-
if (hardRefreshPnlOnCategorize)
|
|
6402
|
-
refetch();
|
|
6403
6266
|
return;
|
|
6404
6267
|
}
|
|
6405
6268
|
if (!selectedCategory) {
|
|
@@ -6411,16 +6274,12 @@ var BankTransactionRow = ({
|
|
|
6411
6274
|
selectedCategory.payload.id
|
|
6412
6275
|
);
|
|
6413
6276
|
setOpen(false);
|
|
6414
|
-
if (hardRefreshPnlOnCategorize)
|
|
6415
|
-
refetch();
|
|
6416
6277
|
return;
|
|
6417
6278
|
}
|
|
6418
6279
|
await categorizeBankTransaction2(bankTransaction.id, {
|
|
6419
6280
|
type: "Category",
|
|
6420
6281
|
category: getCategorizePayload(selectedCategory)
|
|
6421
6282
|
});
|
|
6422
|
-
if (hardRefreshPnlOnCategorize)
|
|
6423
|
-
refetch();
|
|
6424
6283
|
setOpen(false);
|
|
6425
6284
|
};
|
|
6426
6285
|
const categorized = isCategorized(bankTransaction);
|
|
@@ -6433,20 +6292,20 @@ var BankTransactionRow = ({
|
|
|
6433
6292
|
initialLoad ? "initial-load" : "",
|
|
6434
6293
|
showComponent ? "show" : ""
|
|
6435
6294
|
);
|
|
6436
|
-
return /* @__PURE__ */
|
|
6295
|
+
return /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement("tr", { className: rowClassName }, /* @__PURE__ */ import_react68.default.createElement(
|
|
6437
6296
|
"td",
|
|
6438
6297
|
{
|
|
6439
6298
|
className: "Layer__table-cell Layer__bank-transaction-table__date-col",
|
|
6440
6299
|
...openRow
|
|
6441
6300
|
},
|
|
6442
|
-
/* @__PURE__ */
|
|
6443
|
-
), /* @__PURE__ */
|
|
6301
|
+
/* @__PURE__ */ import_react68.default.createElement("span", { className: "Layer__table-cell-content" }, (0, import_date_fns8.format)((0, import_date_fns8.parseISO)(bankTransaction.date), dateFormat))
|
|
6302
|
+
), /* @__PURE__ */ import_react68.default.createElement(
|
|
6444
6303
|
"td",
|
|
6445
6304
|
{
|
|
6446
6305
|
className: "Layer__table-cell Layer__bank-transactions__tx-col",
|
|
6447
6306
|
...openRow
|
|
6448
6307
|
},
|
|
6449
|
-
/* @__PURE__ */
|
|
6308
|
+
/* @__PURE__ */ import_react68.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react68.default.createElement(
|
|
6450
6309
|
Text,
|
|
6451
6310
|
{
|
|
6452
6311
|
as: "span",
|
|
@@ -6458,13 +6317,13 @@ var BankTransactionRow = ({
|
|
|
6458
6317
|
},
|
|
6459
6318
|
bankTransaction.counterparty_name ?? bankTransaction.description
|
|
6460
6319
|
))
|
|
6461
|
-
), /* @__PURE__ */
|
|
6320
|
+
), /* @__PURE__ */ import_react68.default.createElement(
|
|
6462
6321
|
"td",
|
|
6463
6322
|
{
|
|
6464
6323
|
className: "Layer__table-cell Layer__bank-transactions__account-col",
|
|
6465
6324
|
...openRow
|
|
6466
6325
|
},
|
|
6467
|
-
/* @__PURE__ */
|
|
6326
|
+
/* @__PURE__ */ import_react68.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react68.default.createElement(
|
|
6468
6327
|
Text,
|
|
6469
6328
|
{
|
|
6470
6329
|
as: "span",
|
|
@@ -6473,14 +6332,14 @@ var BankTransactionRow = ({
|
|
|
6473
6332
|
},
|
|
6474
6333
|
bankTransaction.account_name ?? ""
|
|
6475
6334
|
))
|
|
6476
|
-
), /* @__PURE__ */
|
|
6335
|
+
), /* @__PURE__ */ import_react68.default.createElement(
|
|
6477
6336
|
"td",
|
|
6478
6337
|
{
|
|
6479
6338
|
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"}`,
|
|
6480
6339
|
...openRow
|
|
6481
6340
|
},
|
|
6482
|
-
/* @__PURE__ */
|
|
6483
|
-
), /* @__PURE__ */
|
|
6341
|
+
/* @__PURE__ */ import_react68.default.createElement("span", { className: "Layer__table-cell-content" }, isCredit(bankTransaction) ? "+$" : " $", centsToDollars(bankTransaction.amount))
|
|
6342
|
+
), /* @__PURE__ */ import_react68.default.createElement(
|
|
6484
6343
|
"td",
|
|
6485
6344
|
{
|
|
6486
6345
|
className: (0, import_classnames33.default)(
|
|
@@ -6490,12 +6349,12 @@ var BankTransactionRow = ({
|
|
|
6490
6349
|
`${className}__actions-cell--${open ? "open" : "close"}`
|
|
6491
6350
|
)
|
|
6492
6351
|
},
|
|
6493
|
-
/* @__PURE__ */
|
|
6352
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
6494
6353
|
"span",
|
|
6495
6354
|
{
|
|
6496
6355
|
className: `${className}__actions-container Layer__table-cell-content`
|
|
6497
6356
|
},
|
|
6498
|
-
!categorized && !open ? /* @__PURE__ */
|
|
6357
|
+
!categorized && !open ? /* @__PURE__ */ import_react68.default.createElement(
|
|
6499
6358
|
CategorySelect,
|
|
6500
6359
|
{
|
|
6501
6360
|
bankTransaction,
|
|
@@ -6508,11 +6367,11 @@ var BankTransactionRow = ({
|
|
|
6508
6367
|
disabled: bankTransaction.processing
|
|
6509
6368
|
}
|
|
6510
6369
|
) : null,
|
|
6511
|
-
categorized && !open ? /* @__PURE__ */
|
|
6370
|
+
categorized && !open ? /* @__PURE__ */ import_react68.default.createElement(Text, { as: "span", className: `${className}__category-text` }, bankTransaction.categorization_status === "SPLIT" /* SPLIT */ && /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement(
|
|
6512
6371
|
Badge,
|
|
6513
6372
|
{
|
|
6514
|
-
icon: /* @__PURE__ */
|
|
6515
|
-
tooltip: /* @__PURE__ */
|
|
6373
|
+
icon: /* @__PURE__ */ import_react68.default.createElement(Scissors_default, { size: 11 }),
|
|
6374
|
+
tooltip: /* @__PURE__ */ import_react68.default.createElement(
|
|
6516
6375
|
SplitTooltipDetails,
|
|
6517
6376
|
{
|
|
6518
6377
|
classNamePrefix: className,
|
|
@@ -6521,18 +6380,18 @@ var BankTransactionRow = ({
|
|
|
6521
6380
|
)
|
|
6522
6381
|
},
|
|
6523
6382
|
"Split"
|
|
6524
|
-
), /* @__PURE__ */
|
|
6383
|
+
), /* @__PURE__ */ import_react68.default.createElement("span", { className: `${className}__category-text__text` }, extractDescriptionForSplit(bankTransaction.category))), bankTransaction?.categorization_status === "MATCHED" /* MATCHED */ && bankTransaction?.match && /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement(
|
|
6525
6384
|
MatchBadge,
|
|
6526
6385
|
{
|
|
6527
6386
|
classNamePrefix: className,
|
|
6528
6387
|
bankTransaction,
|
|
6529
6388
|
dateFormat
|
|
6530
6389
|
}
|
|
6531
|
-
), /* @__PURE__ */
|
|
6532
|
-
(0,
|
|
6390
|
+
), /* @__PURE__ */ import_react68.default.createElement("span", { className: `${className}__category-text__text` }, `${(0, import_date_fns8.format)(
|
|
6391
|
+
(0, import_date_fns8.parseISO)(bankTransaction.match.bank_transaction.date),
|
|
6533
6392
|
dateFormat
|
|
6534
|
-
)}, ${bankTransaction.match?.details?.description}`)), bankTransaction?.categorization_status !== "MATCHED" /* MATCHED */ && bankTransaction?.categorization_status !== "SPLIT" /* SPLIT */ && /* @__PURE__ */
|
|
6535
|
-
!categorized && !open && showRetry ? /* @__PURE__ */
|
|
6393
|
+
)}, ${bankTransaction.match?.details?.description}`)), bankTransaction?.categorization_status !== "MATCHED" /* MATCHED */ && bankTransaction?.categorization_status !== "SPLIT" /* SPLIT */ && /* @__PURE__ */ import_react68.default.createElement("span", { className: `${className}__category-text__text` }, bankTransaction?.category?.display_name)) : null,
|
|
6394
|
+
!categorized && !open && showRetry ? /* @__PURE__ */ import_react68.default.createElement(
|
|
6536
6395
|
RetryButton,
|
|
6537
6396
|
{
|
|
6538
6397
|
onClick: () => {
|
|
@@ -6546,17 +6405,17 @@ var BankTransactionRow = ({
|
|
|
6546
6405
|
},
|
|
6547
6406
|
"Retry"
|
|
6548
6407
|
) : null,
|
|
6549
|
-
open && bankTransaction.error ? /* @__PURE__ */
|
|
6408
|
+
open && bankTransaction.error ? /* @__PURE__ */ import_react68.default.createElement(
|
|
6550
6409
|
Text,
|
|
6551
6410
|
{
|
|
6552
6411
|
as: "span",
|
|
6553
6412
|
size: "md" /* md */,
|
|
6554
6413
|
className: "Layer__unsaved-info"
|
|
6555
6414
|
},
|
|
6556
|
-
/* @__PURE__ */
|
|
6557
|
-
/* @__PURE__ */
|
|
6415
|
+
/* @__PURE__ */ import_react68.default.createElement("span", null, "Unsaved"),
|
|
6416
|
+
/* @__PURE__ */ import_react68.default.createElement(AlertCircle_default, { size: 12 })
|
|
6558
6417
|
) : null,
|
|
6559
|
-
!categorized && (open || !open && !showRetry) || categorizationEnabled(mode) && categorized && open ? /* @__PURE__ */
|
|
6418
|
+
!categorized && (open || !open && !showRetry) || categorizationEnabled(mode) && categorized && open ? /* @__PURE__ */ import_react68.default.createElement(
|
|
6560
6419
|
SubmitButton,
|
|
6561
6420
|
{
|
|
6562
6421
|
onClick: () => {
|
|
@@ -6571,13 +6430,13 @@ var BankTransactionRow = ({
|
|
|
6571
6430
|
},
|
|
6572
6431
|
categorized ? stringOverrides?.updateButtonText || "Update" : stringOverrides?.approveButtonText || "Approve"
|
|
6573
6432
|
) : null,
|
|
6574
|
-
/* @__PURE__ */
|
|
6433
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
6575
6434
|
IconButton,
|
|
6576
6435
|
{
|
|
6577
6436
|
onClick: toggleOpen,
|
|
6578
6437
|
className: "Layer__bank-transaction-row__expand-button",
|
|
6579
6438
|
active: open,
|
|
6580
|
-
icon: /* @__PURE__ */
|
|
6439
|
+
icon: /* @__PURE__ */ import_react68.default.createElement(
|
|
6581
6440
|
ChevronDownFill_default,
|
|
6582
6441
|
{
|
|
6583
6442
|
className: `Layer__chevron ${open ? "Layer__chevron__up" : "Layer__chevron__down"}`
|
|
@@ -6586,7 +6445,7 @@ var BankTransactionRow = ({
|
|
|
6586
6445
|
}
|
|
6587
6446
|
)
|
|
6588
6447
|
)
|
|
6589
|
-
)), /* @__PURE__ */
|
|
6448
|
+
)), /* @__PURE__ */ import_react68.default.createElement("tr", null, /* @__PURE__ */ import_react68.default.createElement("td", { colSpan: 5, className: "Layer__bank-transaction-row__expanded-td" }, /* @__PURE__ */ import_react68.default.createElement(
|
|
6590
6449
|
ExpandedBankTransactionRow,
|
|
6591
6450
|
{
|
|
6592
6451
|
ref: expandedRowRef,
|
|
@@ -6597,18 +6456,17 @@ var BankTransactionRow = ({
|
|
|
6597
6456
|
close: () => setOpen(false),
|
|
6598
6457
|
containerWidth,
|
|
6599
6458
|
showDescriptions,
|
|
6600
|
-
showReceiptUploads
|
|
6601
|
-
hardRefreshPnlOnCategorize
|
|
6459
|
+
showReceiptUploads
|
|
6602
6460
|
}
|
|
6603
6461
|
))));
|
|
6604
6462
|
};
|
|
6605
6463
|
|
|
6606
6464
|
// src/components/BankTransactionList/Assignment.tsx
|
|
6607
|
-
var
|
|
6608
|
-
var
|
|
6465
|
+
var import_react69 = __toESM(require("react"));
|
|
6466
|
+
var import_date_fns9 = require("date-fns");
|
|
6609
6467
|
var Assignment = ({ bankTransaction }) => {
|
|
6610
6468
|
if (bankTransaction.match && bankTransaction.categorization_status === "MATCHED" /* MATCHED */) {
|
|
6611
|
-
return /* @__PURE__ */
|
|
6469
|
+
return /* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null, /* @__PURE__ */ import_react69.default.createElement(
|
|
6612
6470
|
MatchBadge,
|
|
6613
6471
|
{
|
|
6614
6472
|
classNamePrefix: "Layer__bank-transaction-list-item",
|
|
@@ -6616,17 +6474,17 @@ var Assignment = ({ bankTransaction }) => {
|
|
|
6616
6474
|
dateFormat: DATE_FORMAT,
|
|
6617
6475
|
text: "Matched"
|
|
6618
6476
|
}
|
|
6619
|
-
), /* @__PURE__ */
|
|
6620
|
-
(0,
|
|
6477
|
+
), /* @__PURE__ */ import_react69.default.createElement(Text, { className: "Layer__bank-transaction-list-item__category-text__text" }, `${(0, import_date_fns9.format)(
|
|
6478
|
+
(0, import_date_fns9.parseISO)(bankTransaction.match.bank_transaction.date),
|
|
6621
6479
|
DATE_FORMAT
|
|
6622
6480
|
)}, ${bankTransaction.match.bank_transaction.description ?? bankTransaction.match?.details?.description}`));
|
|
6623
6481
|
}
|
|
6624
6482
|
if (bankTransaction.categorization_status === "SPLIT" /* SPLIT */) {
|
|
6625
|
-
return /* @__PURE__ */
|
|
6483
|
+
return /* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null, /* @__PURE__ */ import_react69.default.createElement(
|
|
6626
6484
|
Badge,
|
|
6627
6485
|
{
|
|
6628
|
-
icon: /* @__PURE__ */
|
|
6629
|
-
tooltip: /* @__PURE__ */
|
|
6486
|
+
icon: /* @__PURE__ */ import_react69.default.createElement(Scissors_default, { size: 11 }),
|
|
6487
|
+
tooltip: /* @__PURE__ */ import_react69.default.createElement(
|
|
6630
6488
|
SplitTooltipDetails,
|
|
6631
6489
|
{
|
|
6632
6490
|
classNamePrefix: "Layer__bank-transaction-list-item",
|
|
@@ -6635,14 +6493,14 @@ var Assignment = ({ bankTransaction }) => {
|
|
|
6635
6493
|
)
|
|
6636
6494
|
},
|
|
6637
6495
|
"Split"
|
|
6638
|
-
), /* @__PURE__ */
|
|
6496
|
+
), /* @__PURE__ */ import_react69.default.createElement(Text, { className: "Layer__bank-transaction-list-item__category-text__text" }, extractDescriptionForSplit(bankTransaction.category)));
|
|
6639
6497
|
}
|
|
6640
|
-
return /* @__PURE__ */
|
|
6498
|
+
return /* @__PURE__ */ import_react69.default.createElement(Text, null, bankTransaction?.category?.display_name);
|
|
6641
6499
|
};
|
|
6642
6500
|
|
|
6643
6501
|
// src/components/BankTransactionList/BankTransactionListItem.tsx
|
|
6644
6502
|
var import_classnames34 = __toESM(require("classnames"));
|
|
6645
|
-
var
|
|
6503
|
+
var import_date_fns10 = require("date-fns");
|
|
6646
6504
|
var BankTransactionListItem = ({
|
|
6647
6505
|
index = 0,
|
|
6648
6506
|
dateFormat,
|
|
@@ -6651,36 +6509,34 @@ var BankTransactionListItem = ({
|
|
|
6651
6509
|
mode,
|
|
6652
6510
|
showDescriptions,
|
|
6653
6511
|
showReceiptUploads,
|
|
6654
|
-
hardRefreshPnlOnCategorize,
|
|
6655
6512
|
containerWidth,
|
|
6656
6513
|
removeTransaction,
|
|
6657
6514
|
stringOverrides
|
|
6658
6515
|
}) => {
|
|
6659
|
-
const expandedRowRef = (0,
|
|
6660
|
-
const [showRetry, setShowRetry] = (0,
|
|
6516
|
+
const expandedRowRef = (0, import_react70.useRef)(null);
|
|
6517
|
+
const [showRetry, setShowRetry] = (0, import_react70.useState)(false);
|
|
6661
6518
|
const { categorize: categorizeBankTransaction2, match: matchBankTransaction2 } = useBankTransactionsContext();
|
|
6662
|
-
const
|
|
6663
|
-
const [selectedCategory, setSelectedCategory] = (0, import_react71.useState)(
|
|
6519
|
+
const [selectedCategory, setSelectedCategory] = (0, import_react70.useState)(
|
|
6664
6520
|
getDefaultSelectedCategory(bankTransaction)
|
|
6665
6521
|
);
|
|
6666
|
-
const [open, setOpen] = (0,
|
|
6522
|
+
const [open, setOpen] = (0, import_react70.useState)(false);
|
|
6667
6523
|
const toggleOpen = () => {
|
|
6668
6524
|
setShowRetry(false);
|
|
6669
6525
|
setOpen(!open);
|
|
6670
6526
|
};
|
|
6671
|
-
const [showComponent, setShowComponent] = (0,
|
|
6672
|
-
(0,
|
|
6527
|
+
const [showComponent, setShowComponent] = (0, import_react70.useState)(false);
|
|
6528
|
+
(0, import_react70.useEffect)(() => {
|
|
6673
6529
|
const timeoutId = setTimeout(() => {
|
|
6674
6530
|
setShowComponent(true);
|
|
6675
6531
|
}, index * 80);
|
|
6676
6532
|
return () => clearTimeout(timeoutId);
|
|
6677
6533
|
}, []);
|
|
6678
|
-
(0,
|
|
6534
|
+
(0, import_react70.useEffect)(() => {
|
|
6679
6535
|
if (bankTransaction.error) {
|
|
6680
6536
|
setShowRetry(true);
|
|
6681
6537
|
}
|
|
6682
6538
|
}, [bankTransaction.error]);
|
|
6683
|
-
(0,
|
|
6539
|
+
(0, import_react70.useEffect)(() => {
|
|
6684
6540
|
if (editable && bankTransaction.recently_categorized) {
|
|
6685
6541
|
setTimeout(() => {
|
|
6686
6542
|
removeTransaction(bankTransaction);
|
|
@@ -6690,8 +6546,6 @@ var BankTransactionListItem = ({
|
|
|
6690
6546
|
const save = () => {
|
|
6691
6547
|
if (open && expandedRowRef?.current) {
|
|
6692
6548
|
expandedRowRef?.current?.save();
|
|
6693
|
-
if (hardRefreshPnlOnCategorize)
|
|
6694
|
-
refetch();
|
|
6695
6549
|
return;
|
|
6696
6550
|
}
|
|
6697
6551
|
if (!selectedCategory) {
|
|
@@ -6699,16 +6553,12 @@ var BankTransactionListItem = ({
|
|
|
6699
6553
|
}
|
|
6700
6554
|
if (selectedCategory.type === "match") {
|
|
6701
6555
|
matchBankTransaction2(bankTransaction.id, selectedCategory.payload.id);
|
|
6702
|
-
if (hardRefreshPnlOnCategorize)
|
|
6703
|
-
refetch();
|
|
6704
6556
|
return;
|
|
6705
6557
|
}
|
|
6706
6558
|
categorizeBankTransaction2(bankTransaction.id, {
|
|
6707
6559
|
type: "Category",
|
|
6708
6560
|
category: getCategorizePayload(selectedCategory)
|
|
6709
6561
|
});
|
|
6710
|
-
if (hardRefreshPnlOnCategorize)
|
|
6711
|
-
refetch();
|
|
6712
6562
|
};
|
|
6713
6563
|
const categorized = isCategorized(bankTransaction);
|
|
6714
6564
|
const className = "Layer__bank-transaction-list-item";
|
|
@@ -6719,26 +6569,26 @@ var BankTransactionListItem = ({
|
|
|
6719
6569
|
open ? openClassName : "",
|
|
6720
6570
|
showComponent ? "show" : ""
|
|
6721
6571
|
);
|
|
6722
|
-
return /* @__PURE__ */
|
|
6572
|
+
return /* @__PURE__ */ import_react70.default.createElement("li", { className: rowClassName }, /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__heading` }, /* @__PURE__ */ import_react70.default.createElement("div", { className: `${className}__heading__main` }, /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__heading-date` }, (0, import_date_fns10.format)((0, import_date_fns10.parseISO)(bankTransaction.date), dateFormat)), /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__heading-separator` }), /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__heading-account-name` }, bankTransaction.account_name ?? "")), /* @__PURE__ */ import_react70.default.createElement(
|
|
6723
6573
|
"div",
|
|
6724
6574
|
{
|
|
6725
6575
|
onClick: toggleOpen,
|
|
6726
6576
|
className: "Layer__bank-transaction-row__expand-button"
|
|
6727
6577
|
},
|
|
6728
|
-
/* @__PURE__ */
|
|
6578
|
+
/* @__PURE__ */ import_react70.default.createElement(
|
|
6729
6579
|
ChevronDownFill_default,
|
|
6730
6580
|
{
|
|
6731
6581
|
className: `Layer__chevron ${open ? "Layer__chevron__up" : "Layer__chevron__down"}`
|
|
6732
6582
|
}
|
|
6733
6583
|
)
|
|
6734
|
-
)), /* @__PURE__ */
|
|
6584
|
+
)), /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__body` }, /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__body__name` }, /* @__PURE__ */ import_react70.default.createElement(Text, { as: "span", withTooltip: "whenTruncated" /* whenTruncated */ }, bankTransaction.counterparty_name ?? bankTransaction.description)), /* @__PURE__ */ import_react70.default.createElement(
|
|
6735
6585
|
"span",
|
|
6736
6586
|
{
|
|
6737
6587
|
className: `${className}__amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
|
|
6738
6588
|
},
|
|
6739
6589
|
isCredit(bankTransaction) ? "+$" : " $",
|
|
6740
6590
|
centsToDollars(bankTransaction.amount)
|
|
6741
|
-
)), /* @__PURE__ */
|
|
6591
|
+
)), /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__expanded-row` }, /* @__PURE__ */ import_react70.default.createElement(
|
|
6742
6592
|
ExpandedBankTransactionRow,
|
|
6743
6593
|
{
|
|
6744
6594
|
ref: expandedRowRef,
|
|
@@ -6751,10 +6601,9 @@ var BankTransactionListItem = ({
|
|
|
6751
6601
|
submitBtnText: categorized ? stringOverrides?.updateButtonText || "Update" : stringOverrides?.approveButtonText || "Approve",
|
|
6752
6602
|
containerWidth,
|
|
6753
6603
|
showDescriptions,
|
|
6754
|
-
showReceiptUploads
|
|
6755
|
-
hardRefreshPnlOnCategorize
|
|
6604
|
+
showReceiptUploads
|
|
6756
6605
|
}
|
|
6757
|
-
)), /* @__PURE__ */
|
|
6606
|
+
)), /* @__PURE__ */ import_react70.default.createElement("span", { className: `${className}__base-row` }, !categorized ? /* @__PURE__ */ import_react70.default.createElement(
|
|
6758
6607
|
CategorySelect,
|
|
6759
6608
|
{
|
|
6760
6609
|
bankTransaction,
|
|
@@ -6766,7 +6615,7 @@ var BankTransactionListItem = ({
|
|
|
6766
6615
|
},
|
|
6767
6616
|
disabled: bankTransaction.processing
|
|
6768
6617
|
}
|
|
6769
|
-
) : null, categorized ? /* @__PURE__ */
|
|
6618
|
+
) : null, categorized ? /* @__PURE__ */ import_react70.default.createElement(Assignment, { bankTransaction }) : null, !categorized && !showRetry ? /* @__PURE__ */ import_react70.default.createElement(
|
|
6770
6619
|
SubmitButton,
|
|
6771
6620
|
{
|
|
6772
6621
|
onClick: () => {
|
|
@@ -6779,7 +6628,7 @@ var BankTransactionListItem = ({
|
|
|
6779
6628
|
action: !categorized ? "save" /* SAVE */ : "update" /* UPDATE */
|
|
6780
6629
|
},
|
|
6781
6630
|
!categorized ? stringOverrides?.approveButtonText || "Approve" : stringOverrides?.updateButtonText || "Update"
|
|
6782
|
-
) : null, !categorized && showRetry ? /* @__PURE__ */
|
|
6631
|
+
) : null, !categorized && showRetry ? /* @__PURE__ */ import_react70.default.createElement(
|
|
6783
6632
|
RetryButton,
|
|
6784
6633
|
{
|
|
6785
6634
|
onClick: () => {
|
|
@@ -6792,7 +6641,7 @@ var BankTransactionListItem = ({
|
|
|
6792
6641
|
error: "Approval failed. Check connection and retry in few seconds."
|
|
6793
6642
|
},
|
|
6794
6643
|
"Retry"
|
|
6795
|
-
) : null), bankTransaction.error && showRetry ? /* @__PURE__ */
|
|
6644
|
+
) : null), bankTransaction.error && showRetry ? /* @__PURE__ */ import_react70.default.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : null);
|
|
6796
6645
|
};
|
|
6797
6646
|
|
|
6798
6647
|
// src/components/BankTransactionList/BankTransactionList.tsx
|
|
@@ -6804,11 +6653,10 @@ var BankTransactionList = ({
|
|
|
6804
6653
|
containerWidth,
|
|
6805
6654
|
showDescriptions = false,
|
|
6806
6655
|
showReceiptUploads = false,
|
|
6807
|
-
hardRefreshPnlOnCategorize = false,
|
|
6808
6656
|
stringOverrides
|
|
6809
6657
|
}) => {
|
|
6810
|
-
return /* @__PURE__ */
|
|
6811
|
-
(bankTransaction, index) => /* @__PURE__ */
|
|
6658
|
+
return /* @__PURE__ */ import_react71.default.createElement("ul", { className: "Layer__bank-transactions__list" }, bankTransactions?.map(
|
|
6659
|
+
(bankTransaction, index) => /* @__PURE__ */ import_react71.default.createElement(
|
|
6812
6660
|
BankTransactionListItem,
|
|
6813
6661
|
{
|
|
6814
6662
|
index,
|
|
@@ -6821,7 +6669,6 @@ var BankTransactionList = ({
|
|
|
6821
6669
|
containerWidth,
|
|
6822
6670
|
showDescriptions,
|
|
6823
6671
|
showReceiptUploads,
|
|
6824
|
-
hardRefreshPnlOnCategorize,
|
|
6825
6672
|
stringOverrides
|
|
6826
6673
|
}
|
|
6827
6674
|
)
|
|
@@ -6829,33 +6676,29 @@ var BankTransactionList = ({
|
|
|
6829
6676
|
};
|
|
6830
6677
|
|
|
6831
6678
|
// src/components/BankTransactionMobileList/BankTransactionMobileList.tsx
|
|
6832
|
-
var
|
|
6679
|
+
var import_react80 = __toESM(require("react"));
|
|
6833
6680
|
|
|
6834
6681
|
// src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
|
|
6835
|
-
var
|
|
6682
|
+
var import_react79 = __toESM(require("react"));
|
|
6836
6683
|
|
|
6837
6684
|
// src/components/BankTransactionMobileList/BankTransactionMobileForms.tsx
|
|
6838
|
-
var
|
|
6685
|
+
var import_react77 = __toESM(require("react"));
|
|
6839
6686
|
|
|
6840
6687
|
// src/components/BankTransactionMobileList/BusinessForm.tsx
|
|
6841
|
-
var
|
|
6842
|
-
var BusinessForm = ({
|
|
6843
|
-
|
|
6844
|
-
hardRefreshPnlOnCategorize = false
|
|
6845
|
-
}) => {
|
|
6846
|
-
const { setContent, close } = (0, import_react73.useContext)(DrawerContext);
|
|
6688
|
+
var import_react72 = __toESM(require("react"));
|
|
6689
|
+
var BusinessForm = ({ bankTransaction }) => {
|
|
6690
|
+
const { setContent, close } = (0, import_react72.useContext)(DrawerContext);
|
|
6847
6691
|
const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
6848
|
-
const
|
|
6849
|
-
const [selectedCategory, setSelectedCategory] = (0, import_react73.useState)(
|
|
6692
|
+
const [selectedCategory, setSelectedCategory] = (0, import_react72.useState)(
|
|
6850
6693
|
getAssignedValue(bankTransaction)
|
|
6851
6694
|
);
|
|
6852
|
-
const [showRetry, setShowRetry] = (0,
|
|
6853
|
-
(0,
|
|
6695
|
+
const [showRetry, setShowRetry] = (0, import_react72.useState)(false);
|
|
6696
|
+
(0, import_react72.useEffect)(() => {
|
|
6854
6697
|
if (bankTransaction.error) {
|
|
6855
6698
|
setShowRetry(true);
|
|
6856
6699
|
}
|
|
6857
6700
|
}, [bankTransaction.error]);
|
|
6858
|
-
const options = (0,
|
|
6701
|
+
const options = (0, import_react72.useMemo)(() => {
|
|
6859
6702
|
const options2 = bankTransaction?.categorization_flow?.type === "ASK_FROM_SUGGESTIONS" /* ASK_FROM_SUGGESTIONS */ ? bankTransaction.categorization_flow.suggestions.map(
|
|
6860
6703
|
(x) => mapCategoryToOption(x)
|
|
6861
6704
|
) : [];
|
|
@@ -6880,7 +6723,7 @@ var BusinessForm = ({
|
|
|
6880
6723
|
setSelectedCategory(value);
|
|
6881
6724
|
};
|
|
6882
6725
|
const openDrawer = () => {
|
|
6883
|
-
setContent(/* @__PURE__ */
|
|
6726
|
+
setContent(/* @__PURE__ */ import_react72.default.createElement(BusinessCategories, { select: onDrawerCategorySelect }));
|
|
6884
6727
|
};
|
|
6885
6728
|
const onCategorySelect = (category) => {
|
|
6886
6729
|
if (category.value.type === "SELECT_CATEGORY") {
|
|
@@ -6912,17 +6755,15 @@ var BusinessForm = ({
|
|
|
6912
6755
|
},
|
|
6913
6756
|
true
|
|
6914
6757
|
);
|
|
6915
|
-
if (hardRefreshPnlOnCategorize)
|
|
6916
|
-
refetch();
|
|
6917
6758
|
};
|
|
6918
|
-
return /* @__PURE__ */
|
|
6759
|
+
return /* @__PURE__ */ import_react72.default.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__business-form" }, /* @__PURE__ */ import_react72.default.createElement(
|
|
6919
6760
|
ActionableList,
|
|
6920
6761
|
{
|
|
6921
6762
|
options,
|
|
6922
6763
|
onClick: onCategorySelect,
|
|
6923
6764
|
selected: selectedCategory
|
|
6924
6765
|
}
|
|
6925
|
-
), options.length === 0 ? /* @__PURE__ */
|
|
6766
|
+
), options.length === 0 ? /* @__PURE__ */ import_react72.default.createElement(
|
|
6926
6767
|
Button,
|
|
6927
6768
|
{
|
|
6928
6769
|
onClick: openDrawer,
|
|
@@ -6930,7 +6771,7 @@ var BusinessForm = ({
|
|
|
6930
6771
|
variant: "secondary" /* secondary */
|
|
6931
6772
|
},
|
|
6932
6773
|
"Select category"
|
|
6933
|
-
) : null, options.length > 0 ? /* @__PURE__ */
|
|
6774
|
+
) : null, options.length > 0 ? /* @__PURE__ */ import_react72.default.createElement(
|
|
6934
6775
|
Button,
|
|
6935
6776
|
{
|
|
6936
6777
|
onClick: save,
|
|
@@ -6938,11 +6779,11 @@ var BusinessForm = ({
|
|
|
6938
6779
|
fullWidth: true
|
|
6939
6780
|
},
|
|
6940
6781
|
isLoading || bankTransaction.processing ? "Saving..." : "Save"
|
|
6941
|
-
) : null, bankTransaction.error && showRetry ? /* @__PURE__ */
|
|
6782
|
+
) : null, bankTransaction.error && showRetry ? /* @__PURE__ */ import_react72.default.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : null);
|
|
6942
6783
|
};
|
|
6943
6784
|
|
|
6944
6785
|
// src/components/BankTransactionMobileList/PersonalForm.tsx
|
|
6945
|
-
var
|
|
6786
|
+
var import_react73 = __toESM(require("react"));
|
|
6946
6787
|
var isAlreadyAssigned = (bankTransaction) => {
|
|
6947
6788
|
if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || bankTransaction?.categorization_status === "SPLIT" /* SPLIT */) {
|
|
6948
6789
|
return false;
|
|
@@ -6951,11 +6792,10 @@ var isAlreadyAssigned = (bankTransaction) => {
|
|
|
6951
6792
|
bankTransaction.category && PersonalCategories.includes(bankTransaction.category.display_name)
|
|
6952
6793
|
);
|
|
6953
6794
|
};
|
|
6954
|
-
var PersonalForm = ({ bankTransaction
|
|
6795
|
+
var PersonalForm = ({ bankTransaction }) => {
|
|
6955
6796
|
const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
6956
|
-
const
|
|
6957
|
-
|
|
6958
|
-
(0, import_react74.useEffect)(() => {
|
|
6797
|
+
const [showRetry, setShowRetry] = (0, import_react73.useState)(false);
|
|
6798
|
+
(0, import_react73.useEffect)(() => {
|
|
6959
6799
|
if (bankTransaction.error) {
|
|
6960
6800
|
setShowRetry(true);
|
|
6961
6801
|
}
|
|
@@ -6972,11 +6812,9 @@ var PersonalForm = ({ bankTransaction, hardRefreshPnlOnCategorize }) => {
|
|
|
6972
6812
|
},
|
|
6973
6813
|
true
|
|
6974
6814
|
);
|
|
6975
|
-
if (hardRefreshPnlOnCategorize)
|
|
6976
|
-
refetch();
|
|
6977
6815
|
};
|
|
6978
6816
|
const alreadyAssigned = isAlreadyAssigned(bankTransaction);
|
|
6979
|
-
return /* @__PURE__ */
|
|
6817
|
+
return /* @__PURE__ */ import_react73.default.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__personal-form" }, /* @__PURE__ */ import_react73.default.createElement(
|
|
6980
6818
|
Button,
|
|
6981
6819
|
{
|
|
6982
6820
|
fullWidth: true,
|
|
@@ -6984,26 +6822,24 @@ var PersonalForm = ({ bankTransaction, hardRefreshPnlOnCategorize }) => {
|
|
|
6984
6822
|
onClick: save
|
|
6985
6823
|
},
|
|
6986
6824
|
isLoading || bankTransaction.processing ? "Saving..." : alreadyAssigned ? "Saved as Personal" : "Categorize as Personal"
|
|
6987
|
-
), bankTransaction.error && showRetry ? /* @__PURE__ */
|
|
6825
|
+
), bankTransaction.error && showRetry ? /* @__PURE__ */ import_react73.default.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : null);
|
|
6988
6826
|
};
|
|
6989
6827
|
|
|
6990
6828
|
// src/components/BankTransactionMobileList/SplitAndMatchForm.tsx
|
|
6991
|
-
var
|
|
6829
|
+
var import_react76 = __toESM(require("react"));
|
|
6992
6830
|
|
|
6993
6831
|
// src/components/BankTransactionMobileList/MatchForm.tsx
|
|
6994
|
-
var
|
|
6832
|
+
var import_react74 = __toESM(require("react"));
|
|
6995
6833
|
var MatchForm2 = ({
|
|
6996
|
-
bankTransaction
|
|
6997
|
-
hardRefreshPnlOnCategorize
|
|
6834
|
+
bankTransaction
|
|
6998
6835
|
}) => {
|
|
6999
6836
|
const { match: matchBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
7000
|
-
const
|
|
7001
|
-
const [selectedMatchId, setSelectedMatchId] = (0, import_react75.useState)(
|
|
6837
|
+
const [selectedMatchId, setSelectedMatchId] = (0, import_react74.useState)(
|
|
7002
6838
|
isAlreadyMatched(bankTransaction)
|
|
7003
6839
|
);
|
|
7004
|
-
const [formError, setFormError] = (0,
|
|
7005
|
-
const [showRetry, setShowRetry] = (0,
|
|
7006
|
-
(0,
|
|
6840
|
+
const [formError, setFormError] = (0, import_react74.useState)();
|
|
6841
|
+
const [showRetry, setShowRetry] = (0, import_react74.useState)(false);
|
|
6842
|
+
(0, import_react74.useEffect)(() => {
|
|
7007
6843
|
if (bankTransaction.error) {
|
|
7008
6844
|
setShowRetry(true);
|
|
7009
6845
|
} else if (showRetry) {
|
|
@@ -7024,12 +6860,10 @@ var MatchForm2 = ({
|
|
|
7024
6860
|
setFormError("Select an option to match the transaction");
|
|
7025
6861
|
} else if (selectedMatchId && selectedMatchId !== isAlreadyMatched(bankTransaction)) {
|
|
7026
6862
|
onMatchSubmit(selectedMatchId);
|
|
7027
|
-
if (hardRefreshPnlOnCategorize)
|
|
7028
|
-
refetch();
|
|
7029
6863
|
}
|
|
7030
6864
|
return;
|
|
7031
6865
|
};
|
|
7032
|
-
return /* @__PURE__ */
|
|
6866
|
+
return /* @__PURE__ */ import_react74.default.createElement("div", null, /* @__PURE__ */ import_react74.default.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, "Find match"), /* @__PURE__ */ import_react74.default.createElement(
|
|
7033
6867
|
MatchFormMobile,
|
|
7034
6868
|
{
|
|
7035
6869
|
classNamePrefix: "Layer__bank-transaction-mobile-list-item",
|
|
@@ -7040,7 +6874,7 @@ var MatchForm2 = ({
|
|
|
7040
6874
|
setSelectedMatchId(id);
|
|
7041
6875
|
}
|
|
7042
6876
|
}
|
|
7043
|
-
), /* @__PURE__ */
|
|
6877
|
+
), /* @__PURE__ */ import_react74.default.createElement(
|
|
7044
6878
|
Button,
|
|
7045
6879
|
{
|
|
7046
6880
|
fullWidth: true,
|
|
@@ -7048,24 +6882,22 @@ var MatchForm2 = ({
|
|
|
7048
6882
|
onClick: save
|
|
7049
6883
|
},
|
|
7050
6884
|
isLoading || bankTransaction.processing ? "Saving..." : "Approve match"
|
|
7051
|
-
), formError && /* @__PURE__ */
|
|
6885
|
+
), formError && /* @__PURE__ */ import_react74.default.createElement(ErrorText, null, formError), bankTransaction.error && showRetry ? /* @__PURE__ */ import_react74.default.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : null);
|
|
7052
6886
|
};
|
|
7053
6887
|
|
|
7054
6888
|
// src/components/BankTransactionMobileList/SplitForm.tsx
|
|
7055
|
-
var
|
|
6889
|
+
var import_react75 = __toESM(require("react"));
|
|
7056
6890
|
var import_classnames35 = __toESM(require("classnames"));
|
|
7057
6891
|
var SplitForm = ({
|
|
7058
|
-
bankTransaction
|
|
7059
|
-
hardRefreshPnlOnCategorize
|
|
6892
|
+
bankTransaction
|
|
7060
6893
|
}) => {
|
|
7061
6894
|
const {
|
|
7062
6895
|
categorize: categorizeBankTransaction2,
|
|
7063
6896
|
isLoading,
|
|
7064
6897
|
error
|
|
7065
6898
|
} = useBankTransactionsContext();
|
|
7066
|
-
const { refetch } = useProfitAndLossLTM();
|
|
7067
6899
|
const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && bankTransaction.categorization_flow?.suggestions?.[0];
|
|
7068
|
-
const [rowState, updateRowState] = (0,
|
|
6900
|
+
const [rowState, updateRowState] = (0, import_react75.useState)({
|
|
7069
6901
|
splits: bankTransaction.category?.entries ? bankTransaction.category?.entries.map((c) => {
|
|
7070
6902
|
return {
|
|
7071
6903
|
amount: c.amount || 0,
|
|
@@ -7087,9 +6919,9 @@ var SplitForm = ({
|
|
|
7087
6919
|
description: "",
|
|
7088
6920
|
file: void 0
|
|
7089
6921
|
});
|
|
7090
|
-
const [formError, setFormError] = (0,
|
|
7091
|
-
const [showRetry, setShowRetry] = (0,
|
|
7092
|
-
(0,
|
|
6922
|
+
const [formError, setFormError] = (0, import_react75.useState)();
|
|
6923
|
+
const [showRetry, setShowRetry] = (0, import_react75.useState)(false);
|
|
6924
|
+
(0, import_react75.useEffect)(() => {
|
|
7093
6925
|
if (bankTransaction.error) {
|
|
7094
6926
|
setShowRetry(true);
|
|
7095
6927
|
}
|
|
@@ -7187,16 +7019,14 @@ var SplitForm = ({
|
|
|
7187
7019
|
},
|
|
7188
7020
|
true
|
|
7189
7021
|
);
|
|
7190
|
-
if (hardRefreshPnlOnCategorize)
|
|
7191
|
-
refetch();
|
|
7192
7022
|
};
|
|
7193
|
-
return /* @__PURE__ */
|
|
7023
|
+
return /* @__PURE__ */ import_react75.default.createElement("div", null, /* @__PURE__ */ import_react75.default.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, "Split transaction"), /* @__PURE__ */ import_react75.default.createElement("div", { className: "Layer__bank-transactions__table-cell__header" }, /* @__PURE__ */ import_react75.default.createElement(Text, { size: "sm" /* sm */ }, "Category"), /* @__PURE__ */ import_react75.default.createElement(Text, { size: "sm" /* sm */ }, "Amount")), /* @__PURE__ */ import_react75.default.createElement("div", { className: "Layer__bank-transactions__splits-inputs" }, rowState.splits.map((split, index) => /* @__PURE__ */ import_react75.default.createElement(
|
|
7194
7024
|
"div",
|
|
7195
7025
|
{
|
|
7196
7026
|
className: "Layer__bank-transactions__table-cell--split-entry",
|
|
7197
7027
|
key: `split-${index}`
|
|
7198
7028
|
},
|
|
7199
|
-
/* @__PURE__ */
|
|
7029
|
+
/* @__PURE__ */ import_react75.default.createElement("div", { className: "Layer__bank-transactions__table-cell--split-entry__right-col" }, /* @__PURE__ */ import_react75.default.createElement(
|
|
7200
7030
|
CategorySelect,
|
|
7201
7031
|
{
|
|
7202
7032
|
bankTransaction,
|
|
@@ -7209,7 +7039,7 @@ var SplitForm = ({
|
|
|
7209
7039
|
asDrawer: true
|
|
7210
7040
|
}
|
|
7211
7041
|
)),
|
|
7212
|
-
/* @__PURE__ */
|
|
7042
|
+
/* @__PURE__ */ import_react75.default.createElement(
|
|
7213
7043
|
Input,
|
|
7214
7044
|
{
|
|
7215
7045
|
type: "text",
|
|
@@ -7227,17 +7057,17 @@ var SplitForm = ({
|
|
|
7227
7057
|
inputMode: "numeric"
|
|
7228
7058
|
}
|
|
7229
7059
|
),
|
|
7230
|
-
index > 0 && /* @__PURE__ */
|
|
7060
|
+
index > 0 && /* @__PURE__ */ import_react75.default.createElement(
|
|
7231
7061
|
Button,
|
|
7232
7062
|
{
|
|
7233
7063
|
className: "Layer__bank-transactions__table-cell--split-entry__merge-btn",
|
|
7234
7064
|
onClick: () => removeSplit(index),
|
|
7235
|
-
rightIcon: /* @__PURE__ */
|
|
7065
|
+
rightIcon: /* @__PURE__ */ import_react75.default.createElement(Trash_default, { size: 16 }),
|
|
7236
7066
|
variant: "secondary" /* secondary */,
|
|
7237
7067
|
iconOnly: true
|
|
7238
7068
|
}
|
|
7239
7069
|
)
|
|
7240
|
-
)), /* @__PURE__ */
|
|
7070
|
+
)), /* @__PURE__ */ import_react75.default.createElement(
|
|
7241
7071
|
TextButton,
|
|
7242
7072
|
{
|
|
7243
7073
|
onClick: addSplit,
|
|
@@ -7245,7 +7075,7 @@ var SplitForm = ({
|
|
|
7245
7075
|
className: "Layer__add-new-split"
|
|
7246
7076
|
},
|
|
7247
7077
|
"Add new split"
|
|
7248
|
-
)), /* @__PURE__ */
|
|
7078
|
+
)), /* @__PURE__ */ import_react75.default.createElement(
|
|
7249
7079
|
Button,
|
|
7250
7080
|
{
|
|
7251
7081
|
fullWidth: true,
|
|
@@ -7253,46 +7083,44 @@ var SplitForm = ({
|
|
|
7253
7083
|
disabled: isLoading || bankTransaction.processing
|
|
7254
7084
|
},
|
|
7255
7085
|
isLoading || bankTransaction.processing ? "Saving..." : "Save"
|
|
7256
|
-
), formError && /* @__PURE__ */
|
|
7086
|
+
), formError && /* @__PURE__ */ import_react75.default.createElement(ErrorText, null, formError), bankTransaction.error && showRetry ? /* @__PURE__ */ import_react75.default.createElement(ErrorText, null, "Approval failed. Check connection and retry in few seconds.") : null);
|
|
7257
7087
|
};
|
|
7258
7088
|
|
|
7259
7089
|
// src/components/BankTransactionMobileList/SplitAndMatchForm.tsx
|
|
7260
7090
|
var SplitAndMatchForm = ({
|
|
7261
|
-
bankTransaction
|
|
7262
|
-
hardRefreshPnlOnCategorize
|
|
7091
|
+
bankTransaction
|
|
7263
7092
|
}) => {
|
|
7264
7093
|
const anyMatch = hasMatch(bankTransaction);
|
|
7265
|
-
const [formType, setFormType] = (0,
|
|
7094
|
+
const [formType, setFormType] = (0, import_react76.useState)(
|
|
7266
7095
|
bankTransaction.category ? "categorize" /* categorize */ : anyMatch ? "match" /* match */ : "categorize" /* categorize */
|
|
7267
7096
|
);
|
|
7268
|
-
return /* @__PURE__ */
|
|
7097
|
+
return /* @__PURE__ */ import_react76.default.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__split-and-match-form" }, formType === "categorize" /* categorize */ && /* @__PURE__ */ import_react76.default.createElement(SplitForm, { bankTransaction }), formType === "match" /* match */ && /* @__PURE__ */ import_react76.default.createElement(MatchForm2, { bankTransaction }), anyMatch && formType === "match" /* match */ ? /* @__PURE__ */ import_react76.default.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns" }, /* @__PURE__ */ import_react76.default.createElement(TextButton, { onClick: () => setFormType("categorize" /* categorize */) }, "or split transaction")) : null, anyMatch && formType === "categorize" /* categorize */ ? /* @__PURE__ */ import_react76.default.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns" }, /* @__PURE__ */ import_react76.default.createElement(TextButton, { onClick: () => setFormType("match" /* match */) }, "or find match")) : null);
|
|
7269
7098
|
};
|
|
7270
7099
|
|
|
7271
7100
|
// src/components/BankTransactionMobileList/BankTransactionMobileForms.tsx
|
|
7272
7101
|
var BankTransactionMobileForms = ({
|
|
7273
7102
|
purpose,
|
|
7274
|
-
bankTransaction
|
|
7275
|
-
hardRefreshPnlOnCategorize
|
|
7103
|
+
bankTransaction
|
|
7276
7104
|
}) => {
|
|
7277
7105
|
const getContent = () => {
|
|
7278
7106
|
switch (purpose) {
|
|
7279
7107
|
case "business":
|
|
7280
|
-
return /* @__PURE__ */
|
|
7108
|
+
return /* @__PURE__ */ import_react77.default.createElement(BusinessForm, { bankTransaction });
|
|
7281
7109
|
case "personal":
|
|
7282
|
-
return /* @__PURE__ */
|
|
7110
|
+
return /* @__PURE__ */ import_react77.default.createElement(PersonalForm, { bankTransaction });
|
|
7283
7111
|
case "more":
|
|
7284
|
-
return /* @__PURE__ */
|
|
7112
|
+
return /* @__PURE__ */ import_react77.default.createElement(SplitAndMatchForm, { bankTransaction });
|
|
7285
7113
|
default:
|
|
7286
7114
|
return null;
|
|
7287
7115
|
}
|
|
7288
7116
|
};
|
|
7289
|
-
return /* @__PURE__ */
|
|
7117
|
+
return /* @__PURE__ */ import_react77.default.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__form-container" }, getContent());
|
|
7290
7118
|
};
|
|
7291
7119
|
|
|
7292
7120
|
// src/components/BankTransactionMobileList/TransactionToOpenContext.ts
|
|
7293
|
-
var
|
|
7121
|
+
var import_react78 = require("react");
|
|
7294
7122
|
var useTransactionToOpen = () => {
|
|
7295
|
-
const [transactionIdToOpen, setTransactionIdToOpen] = (0,
|
|
7123
|
+
const [transactionIdToOpen, setTransactionIdToOpen] = (0, import_react78.useState)(void 0);
|
|
7296
7124
|
const clearTransactionIdToOpen = () => setTransactionIdToOpen(void 0);
|
|
7297
7125
|
return {
|
|
7298
7126
|
transactionIdToOpen,
|
|
@@ -7300,7 +7128,7 @@ var useTransactionToOpen = () => {
|
|
|
7300
7128
|
clearTransactionIdToOpen
|
|
7301
7129
|
};
|
|
7302
7130
|
};
|
|
7303
|
-
var TransactionToOpenContext = (0,
|
|
7131
|
+
var TransactionToOpenContext = (0, import_react78.createContext)({
|
|
7304
7132
|
transactionIdToOpen: void 0,
|
|
7305
7133
|
setTransactionIdToOpen: () => void 0,
|
|
7306
7134
|
clearTransactionIdToOpen: () => void 0
|
|
@@ -7308,7 +7136,7 @@ var TransactionToOpenContext = (0, import_react79.createContext)({
|
|
|
7308
7136
|
|
|
7309
7137
|
// src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
|
|
7310
7138
|
var import_classnames36 = __toESM(require("classnames"));
|
|
7311
|
-
var
|
|
7139
|
+
var import_date_fns11 = require("date-fns");
|
|
7312
7140
|
var DATE_FORMAT2 = "LLL d";
|
|
7313
7141
|
var getAssignedValue2 = (bankTransaction) => {
|
|
7314
7142
|
if (bankTransaction.categorization_status === "SPLIT" /* SPLIT */) {
|
|
@@ -7325,29 +7153,28 @@ var BankTransactionMobileListItem = ({
|
|
|
7325
7153
|
removeTransaction,
|
|
7326
7154
|
editable,
|
|
7327
7155
|
mode,
|
|
7328
|
-
initialLoad
|
|
7329
|
-
hardRefreshPnlOnCategorize = false
|
|
7156
|
+
initialLoad
|
|
7330
7157
|
}) => {
|
|
7331
7158
|
const {
|
|
7332
7159
|
transactionIdToOpen,
|
|
7333
7160
|
setTransactionIdToOpen,
|
|
7334
7161
|
clearTransactionIdToOpen
|
|
7335
|
-
} = (0,
|
|
7162
|
+
} = (0, import_react79.useContext)(TransactionToOpenContext);
|
|
7336
7163
|
const formRowRef = useElementSize(
|
|
7337
7164
|
(_a, _b, { height: height2 }) => setHeight(height2)
|
|
7338
7165
|
);
|
|
7339
7166
|
const headingRowRef = useElementSize((_a, _b, { height: height2 }) => {
|
|
7340
7167
|
setHeadingHeight(height2);
|
|
7341
7168
|
});
|
|
7342
|
-
const itemRef = (0,
|
|
7343
|
-
const [removeAnim, setRemoveAnim] = (0,
|
|
7344
|
-
const [purpose, setPurpose] = (0,
|
|
7169
|
+
const itemRef = (0, import_react79.useRef)(null);
|
|
7170
|
+
const [removeAnim, setRemoveAnim] = (0, import_react79.useState)(false);
|
|
7171
|
+
const [purpose, setPurpose] = (0, import_react79.useState)(
|
|
7345
7172
|
bankTransaction.category ? bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
|
|
7346
7173
|
);
|
|
7347
|
-
const [open, setOpen] = (0,
|
|
7348
|
-
const [showComponent, setShowComponent] = (0,
|
|
7349
|
-
const [height, setHeight] = (0,
|
|
7350
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
7174
|
+
const [open, setOpen] = (0, import_react79.useState)(false);
|
|
7175
|
+
const [showComponent, setShowComponent] = (0, import_react79.useState)(!initialLoad);
|
|
7176
|
+
const [height, setHeight] = (0, import_react79.useState)(0);
|
|
7177
|
+
const [headingHeight, setHeadingHeight] = (0, import_react79.useState)(63);
|
|
7351
7178
|
const openNext = () => {
|
|
7352
7179
|
if (editable && itemRef.current && itemRef.current.nextSibling) {
|
|
7353
7180
|
const txId = itemRef.current.nextSibling.getAttribute(
|
|
@@ -7358,13 +7185,13 @@ var BankTransactionMobileListItem = ({
|
|
|
7358
7185
|
}
|
|
7359
7186
|
}
|
|
7360
7187
|
};
|
|
7361
|
-
(0,
|
|
7188
|
+
(0, import_react79.useEffect)(() => {
|
|
7362
7189
|
if (transactionIdToOpen && transactionIdToOpen === bankTransaction.id) {
|
|
7363
7190
|
setOpen(true);
|
|
7364
7191
|
clearTransactionIdToOpen();
|
|
7365
7192
|
}
|
|
7366
7193
|
}, [transactionIdToOpen]);
|
|
7367
|
-
(0,
|
|
7194
|
+
(0, import_react79.useEffect)(() => {
|
|
7368
7195
|
if (!removeAnim && bankTransaction.recently_categorized) {
|
|
7369
7196
|
if (editable) {
|
|
7370
7197
|
setRemoveAnim(true);
|
|
@@ -7388,7 +7215,7 @@ var BankTransactionMobileListItem = ({
|
|
|
7388
7215
|
setOpen(false);
|
|
7389
7216
|
setHeight(0);
|
|
7390
7217
|
};
|
|
7391
|
-
(0,
|
|
7218
|
+
(0, import_react79.useEffect)(() => {
|
|
7392
7219
|
if (initialLoad) {
|
|
7393
7220
|
const timeoutId = setTimeout(() => {
|
|
7394
7221
|
setShowComponent(true);
|
|
@@ -7398,7 +7225,7 @@ var BankTransactionMobileListItem = ({
|
|
|
7398
7225
|
setShowComponent(true);
|
|
7399
7226
|
}
|
|
7400
7227
|
}, []);
|
|
7401
|
-
(0,
|
|
7228
|
+
(0, import_react79.useEffect)(() => {
|
|
7402
7229
|
if (editable && bankTransaction.recently_categorized) {
|
|
7403
7230
|
setTimeout(() => {
|
|
7404
7231
|
removeTransaction(bankTransaction);
|
|
@@ -7415,7 +7242,7 @@ var BankTransactionMobileListItem = ({
|
|
|
7415
7242
|
open ? openClassName : "",
|
|
7416
7243
|
showComponent ? "show" : ""
|
|
7417
7244
|
);
|
|
7418
|
-
return /* @__PURE__ */
|
|
7245
|
+
return /* @__PURE__ */ import_react79.default.createElement("li", { ref: itemRef, className: rowClassName, "data-item": bankTransaction.id }, /* @__PURE__ */ import_react79.default.createElement(
|
|
7419
7246
|
"span",
|
|
7420
7247
|
{
|
|
7421
7248
|
className: `${className}__heading`,
|
|
@@ -7423,27 +7250,27 @@ var BankTransactionMobileListItem = ({
|
|
|
7423
7250
|
role: "button",
|
|
7424
7251
|
style: { height: headingHeight }
|
|
7425
7252
|
},
|
|
7426
|
-
/* @__PURE__ */
|
|
7253
|
+
/* @__PURE__ */ import_react79.default.createElement("div", { className: `${className}__heading__content`, ref: headingRowRef }, /* @__PURE__ */ import_react79.default.createElement("div", { className: `${className}__heading__main` }, /* @__PURE__ */ import_react79.default.createElement(Text, { as: "span", className: `${className}__heading__tx-name` }, bankTransaction.counterparty_name ?? bankTransaction.description), /* @__PURE__ */ import_react79.default.createElement(Text, { as: "span", className: `${className}__heading__account-name` }, categorized && bankTransaction.categorization_status ? getAssignedValue2(bankTransaction) : null, !categorized && bankTransaction.account_name), categorized && open && /* @__PURE__ */ import_react79.default.createElement(Text, { as: "span", className: `${className}__categorized-name` }, bankTransaction.account_name)), /* @__PURE__ */ import_react79.default.createElement("div", { className: `${className}__heading__amount` }, /* @__PURE__ */ import_react79.default.createElement(
|
|
7427
7254
|
"span",
|
|
7428
7255
|
{
|
|
7429
7256
|
className: `${className}__amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
|
|
7430
7257
|
},
|
|
7431
7258
|
isCredit(bankTransaction) ? "+$" : " $",
|
|
7432
7259
|
centsToDollars(bankTransaction.amount)
|
|
7433
|
-
), /* @__PURE__ */
|
|
7434
|
-
), categorizationEnabled(mode) ? /* @__PURE__ */
|
|
7260
|
+
), /* @__PURE__ */ import_react79.default.createElement("span", { className: `${className}__heading__date` }, (0, import_date_fns11.format)((0, import_date_fns11.parseISO)(bankTransaction.date), DATE_FORMAT2))))
|
|
7261
|
+
), categorizationEnabled(mode) ? /* @__PURE__ */ import_react79.default.createElement(
|
|
7435
7262
|
"div",
|
|
7436
7263
|
{
|
|
7437
7264
|
className: `${className}__expanded-row`,
|
|
7438
7265
|
style: { height: !open || removeAnim ? 0 : height }
|
|
7439
7266
|
},
|
|
7440
|
-
open && /* @__PURE__ */
|
|
7267
|
+
open && /* @__PURE__ */ import_react79.default.createElement(
|
|
7441
7268
|
"div",
|
|
7442
7269
|
{
|
|
7443
7270
|
className: `${className}__expanded-row__content`,
|
|
7444
7271
|
ref: formRowRef
|
|
7445
7272
|
},
|
|
7446
|
-
/* @__PURE__ */
|
|
7273
|
+
/* @__PURE__ */ import_react79.default.createElement("div", { className: `${className}__toggle-row` }, /* @__PURE__ */ import_react79.default.createElement(
|
|
7447
7274
|
Toggle,
|
|
7448
7275
|
{
|
|
7449
7276
|
name: `purpose-${bankTransaction.id}`,
|
|
@@ -7471,17 +7298,16 @@ var BankTransactionMobileListItem = ({
|
|
|
7471
7298
|
selected: purpose,
|
|
7472
7299
|
onChange: onChangePurpose
|
|
7473
7300
|
}
|
|
7474
|
-
), /* @__PURE__ */
|
|
7475
|
-
/* @__PURE__ */
|
|
7301
|
+
), /* @__PURE__ */ import_react79.default.createElement(CloseButton, { onClick: () => close() })),
|
|
7302
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
7476
7303
|
BankTransactionMobileForms,
|
|
7477
7304
|
{
|
|
7478
7305
|
purpose,
|
|
7479
|
-
bankTransaction
|
|
7480
|
-
hardRefreshPnlOnCategorize
|
|
7306
|
+
bankTransaction
|
|
7481
7307
|
}
|
|
7482
7308
|
)
|
|
7483
7309
|
)
|
|
7484
|
-
) : /* @__PURE__ */
|
|
7310
|
+
) : /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null));
|
|
7485
7311
|
};
|
|
7486
7312
|
|
|
7487
7313
|
// src/components/BankTransactionMobileList/BankTransactionMobileList.tsx
|
|
@@ -7490,12 +7316,11 @@ var BankTransactionMobileList = ({
|
|
|
7490
7316
|
removeTransaction,
|
|
7491
7317
|
editable,
|
|
7492
7318
|
initialLoad,
|
|
7493
|
-
mode
|
|
7494
|
-
hardRefreshPnlOnCategorize
|
|
7319
|
+
mode
|
|
7495
7320
|
}) => {
|
|
7496
7321
|
const transactionToOpenContextData = useTransactionToOpen();
|
|
7497
|
-
return /* @__PURE__ */
|
|
7498
|
-
(bankTransaction, index) => /* @__PURE__ */
|
|
7322
|
+
return /* @__PURE__ */ import_react80.default.createElement(TransactionToOpenContext.Provider, { value: transactionToOpenContextData }, /* @__PURE__ */ import_react80.default.createElement("ul", { className: "Layer__bank-transactions__mobile-list" }, bankTransactions?.map(
|
|
7323
|
+
(bankTransaction, index) => /* @__PURE__ */ import_react80.default.createElement(
|
|
7499
7324
|
BankTransactionMobileListItem,
|
|
7500
7325
|
{
|
|
7501
7326
|
index,
|
|
@@ -7504,24 +7329,23 @@ var BankTransactionMobileList = ({
|
|
|
7504
7329
|
bankTransaction,
|
|
7505
7330
|
editable,
|
|
7506
7331
|
removeTransaction,
|
|
7507
|
-
initialLoad
|
|
7508
|
-
hardRefreshPnlOnCategorize
|
|
7332
|
+
initialLoad
|
|
7509
7333
|
}
|
|
7510
7334
|
)
|
|
7511
7335
|
)));
|
|
7512
7336
|
};
|
|
7513
7337
|
|
|
7514
7338
|
// src/components/BankTransactionsTable/BankTransactionsTable.tsx
|
|
7515
|
-
var
|
|
7339
|
+
var import_react85 = __toESM(require("react"));
|
|
7516
7340
|
|
|
7517
7341
|
// src/components/BankTransactionsLoader/BankTransactionsLoader.tsx
|
|
7518
|
-
var
|
|
7342
|
+
var import_react83 = __toESM(require("react"));
|
|
7519
7343
|
|
|
7520
7344
|
// src/components/SkeletonTableLoader/SkeletonTableLoader.tsx
|
|
7521
|
-
var
|
|
7345
|
+
var import_react82 = __toESM(require("react"));
|
|
7522
7346
|
|
|
7523
7347
|
// src/components/SkeletonLoader/SkeletonLoader.tsx
|
|
7524
|
-
var
|
|
7348
|
+
var import_react81 = __toESM(require("react"));
|
|
7525
7349
|
var import_classnames37 = __toESM(require("classnames"));
|
|
7526
7350
|
var SkeletonLoader = ({
|
|
7527
7351
|
height,
|
|
@@ -7532,7 +7356,7 @@ var SkeletonLoader = ({
|
|
|
7532
7356
|
"Layer__skeleton-loader Layer__anim--skeleton-loading",
|
|
7533
7357
|
className
|
|
7534
7358
|
);
|
|
7535
|
-
return /* @__PURE__ */
|
|
7359
|
+
return /* @__PURE__ */ import_react81.default.createElement("div", { className: baseClassName, style: { width, height } });
|
|
7536
7360
|
};
|
|
7537
7361
|
|
|
7538
7362
|
// src/components/SkeletonTableLoader/SkeletonTableLoader.tsx
|
|
@@ -7542,22 +7366,38 @@ var SkeletonTableLoader = ({
|
|
|
7542
7366
|
height = 20,
|
|
7543
7367
|
width = 100
|
|
7544
7368
|
}) => {
|
|
7545
|
-
return /* @__PURE__ */
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7369
|
+
return /* @__PURE__ */ import_react82.default.createElement("tbody", { className: "Layer__skeleton-table-body__loader" }, Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ import_react82.default.createElement("tr", { key: rowIndex }, cols.map((col, colIndex) => {
|
|
7370
|
+
const trim = col.trimLastXRows && rowIndex >= col.trimLastXRows - 1 ? (rowIndex - col.trimLastXRows + 1) * 10 : 0;
|
|
7371
|
+
return /* @__PURE__ */ import_react82.default.createElement(
|
|
7372
|
+
"td",
|
|
7373
|
+
{
|
|
7374
|
+
key: colIndex,
|
|
7375
|
+
colSpan: col.colSpan,
|
|
7376
|
+
className: "Layer__skeleton-loader__row"
|
|
7377
|
+
},
|
|
7378
|
+
col.colComponent ? col.colComponent : col.parts && col.parts > 1 ? /* @__PURE__ */ import_react82.default.createElement("span", { className: "Layer__skeleton-loader__row__group" }, [...Array(col.parts)].map((_part, partIndex) => /* @__PURE__ */ import_react82.default.createElement(
|
|
7379
|
+
SkeletonLoader,
|
|
7380
|
+
{
|
|
7381
|
+
key: `part-${partIndex}`,
|
|
7382
|
+
width: "100%",
|
|
7383
|
+
height: `${height}px`
|
|
7384
|
+
}
|
|
7385
|
+
))) : /* @__PURE__ */ import_react82.default.createElement(
|
|
7386
|
+
SkeletonLoader,
|
|
7387
|
+
{
|
|
7388
|
+
width: `${width - trim}%`,
|
|
7389
|
+
height: `${height}px`
|
|
7390
|
+
}
|
|
7391
|
+
)
|
|
7392
|
+
);
|
|
7393
|
+
}))));
|
|
7554
7394
|
};
|
|
7555
7395
|
|
|
7556
7396
|
// src/components/BankTransactionsLoader/BankTransactionsLoader.tsx
|
|
7557
7397
|
var BankTransactionsLoader = ({
|
|
7558
7398
|
isLoading = true
|
|
7559
7399
|
}) => {
|
|
7560
|
-
const inactiveBankTransactionsActions = /* @__PURE__ */
|
|
7400
|
+
const inactiveBankTransactionsActions = /* @__PURE__ */ import_react83.default.createElement("div", { className: "Layer__bank-transaction-row__actions-container Layer__bank-transaction-row__actions-disabled" }, /* @__PURE__ */ import_react83.default.createElement(
|
|
7561
7401
|
CategorySelect,
|
|
7562
7402
|
{
|
|
7563
7403
|
name: "category-bakn-transaction",
|
|
@@ -7567,7 +7407,7 @@ var BankTransactionsLoader = ({
|
|
|
7567
7407
|
},
|
|
7568
7408
|
disabled: true
|
|
7569
7409
|
}
|
|
7570
|
-
), /* @__PURE__ */
|
|
7410
|
+
), /* @__PURE__ */ import_react83.default.createElement(
|
|
7571
7411
|
SubmitButton,
|
|
7572
7412
|
{
|
|
7573
7413
|
onClick: () => {
|
|
@@ -7577,21 +7417,24 @@ var BankTransactionsLoader = ({
|
|
|
7577
7417
|
disabled: true
|
|
7578
7418
|
},
|
|
7579
7419
|
"Approve"
|
|
7580
|
-
), /* @__PURE__ */
|
|
7420
|
+
), /* @__PURE__ */ import_react83.default.createElement(
|
|
7581
7421
|
IconButton,
|
|
7582
7422
|
{
|
|
7583
7423
|
disabled: true,
|
|
7584
7424
|
onClick: () => {
|
|
7585
7425
|
},
|
|
7586
7426
|
className: "Layer__bank-transaction-row__expand-button",
|
|
7587
|
-
icon: /* @__PURE__ */
|
|
7427
|
+
icon: /* @__PURE__ */ import_react83.default.createElement(ChevronDownFill_default, { className: "Layer__chevron Layer__chevron__down" })
|
|
7588
7428
|
}
|
|
7589
7429
|
));
|
|
7590
|
-
return /* @__PURE__ */
|
|
7430
|
+
return /* @__PURE__ */ import_react83.default.createElement(
|
|
7591
7431
|
SkeletonTableLoader,
|
|
7592
7432
|
{
|
|
7593
|
-
rows:
|
|
7594
|
-
cols: isLoading ? [
|
|
7433
|
+
rows: 6,
|
|
7434
|
+
cols: isLoading ? [
|
|
7435
|
+
{ colSpan: 4, trimLastXRows: 3 },
|
|
7436
|
+
{ colSpan: 1, parts: 2 }
|
|
7437
|
+
] : [
|
|
7595
7438
|
{ colSpan: 4 },
|
|
7596
7439
|
{ colSpan: 1, colComponent: inactiveBankTransactionsActions }
|
|
7597
7440
|
],
|
|
@@ -7601,7 +7444,7 @@ var BankTransactionsLoader = ({
|
|
|
7601
7444
|
};
|
|
7602
7445
|
|
|
7603
7446
|
// src/components/SyncingComponent/SyncingComponent.tsx
|
|
7604
|
-
var
|
|
7447
|
+
var import_react84 = __toESM(require("react"));
|
|
7605
7448
|
var import_classnames38 = __toESM(require("classnames"));
|
|
7606
7449
|
var SyncingComponent = ({
|
|
7607
7450
|
title = "Syncing account data",
|
|
@@ -7620,7 +7463,7 @@ var SyncingComponent = ({
|
|
|
7620
7463
|
}
|
|
7621
7464
|
return `${timeSync} minutes`;
|
|
7622
7465
|
};
|
|
7623
|
-
return /* @__PURE__ */
|
|
7466
|
+
return /* @__PURE__ */ import_react84.default.createElement(
|
|
7624
7467
|
"div",
|
|
7625
7468
|
{
|
|
7626
7469
|
className: (0, import_classnames38.default)(
|
|
@@ -7628,8 +7471,8 @@ var SyncingComponent = ({
|
|
|
7628
7471
|
inProgress ? "Layer__syncing-component--with-border" : ""
|
|
7629
7472
|
)
|
|
7630
7473
|
},
|
|
7631
|
-
/* @__PURE__ */
|
|
7632
|
-
!hideContent && /* @__PURE__ */
|
|
7474
|
+
/* @__PURE__ */ import_react84.default.createElement("div", { className: "Layer__syncing-component__actions" }, inProgress ? /* @__PURE__ */ import_react84.default.createElement(SmallLoader, null) : /* @__PURE__ */ import_react84.default.createElement(IconButton, { icon: /* @__PURE__ */ import_react84.default.createElement(RefreshCcw_default, null), onClick: handleRefresh })),
|
|
7475
|
+
!hideContent && /* @__PURE__ */ import_react84.default.createElement("div", { className: "Layer__syncing-component__content" }, /* @__PURE__ */ import_react84.default.createElement("div", { className: "Layer__syncing-component__title" }, title), /* @__PURE__ */ import_react84.default.createElement("div", { className: "Layer__syncing-component__message" }, `${message} ${timeSyncInfo()}`))
|
|
7633
7476
|
);
|
|
7634
7477
|
};
|
|
7635
7478
|
|
|
@@ -7645,24 +7488,22 @@ var BankTransactionsTable = ({
|
|
|
7645
7488
|
removeTransaction,
|
|
7646
7489
|
showDescriptions = false,
|
|
7647
7490
|
showReceiptUploads = false,
|
|
7648
|
-
hardRefreshPnlOnCategorize = false,
|
|
7649
7491
|
stringOverrides,
|
|
7650
7492
|
isSyncing = false,
|
|
7651
7493
|
page,
|
|
7652
7494
|
lastPage,
|
|
7653
7495
|
onRefresh
|
|
7654
7496
|
}) => {
|
|
7655
|
-
return /* @__PURE__ */
|
|
7497
|
+
return /* @__PURE__ */ import_react85.default.createElement(
|
|
7656
7498
|
"table",
|
|
7657
7499
|
{
|
|
7658
7500
|
width: "100%",
|
|
7659
7501
|
className: "Layer__table Layer__bank-transactions__table with-cell-separators"
|
|
7660
7502
|
},
|
|
7661
|
-
/* @__PURE__ */
|
|
7662
|
-
isLoading && page && page === 1 ? /* @__PURE__ */
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
(bankTransaction, index) => /* @__PURE__ */ import_react86.default.createElement(
|
|
7503
|
+
/* @__PURE__ */ import_react85.default.createElement("thead", null, /* @__PURE__ */ import_react85.default.createElement("tr", null, /* @__PURE__ */ import_react85.default.createElement("th", { className: "Layer__table-header Layer__bank-transactions__date-col" }, stringOverrides?.transactionsTable?.dateColumnHeaderText || "Date"), /* @__PURE__ */ import_react85.default.createElement("th", { className: "Layer__table-header Layer__bank-transactions__tx-col" }, stringOverrides?.transactionsTable?.transactionColumnHeaderText || "Transaction"), /* @__PURE__ */ import_react85.default.createElement("th", { className: "Layer__table-header Layer__bank-transactions__account-col" }, stringOverrides?.transactionsTable?.accountColumnHeaderText || "Account"), /* @__PURE__ */ import_react85.default.createElement("th", { className: "Layer__table-header Layer__table-cell--amount Layer__table-cell__amount-col" }, stringOverrides?.transactionsTable?.amountColumnHeaderText || "Amount"), categorizeView && editable ? /* @__PURE__ */ import_react85.default.createElement("th", { className: "Layer__table-header Layer__table-header--primary Layer__table-cell__category-col" }, stringOverrides?.transactionsTable?.categorizeColumnHeaderText || "Categorize") : /* @__PURE__ */ import_react85.default.createElement("th", { className: "Layer__table-header Layer__table-cell__category-col" }, stringOverrides?.transactionsTable?.categoryColumnHeaderText || "Category"))),
|
|
7504
|
+
isLoading && page && page === 1 ? /* @__PURE__ */ import_react85.default.createElement(BankTransactionsLoader, { isLoading: true }) : null,
|
|
7505
|
+
/* @__PURE__ */ import_react85.default.createElement("tbody", null, !isLoading && bankTransactions?.map(
|
|
7506
|
+
(bankTransaction, index) => /* @__PURE__ */ import_react85.default.createElement(
|
|
7666
7507
|
BankTransactionRow,
|
|
7667
7508
|
{
|
|
7668
7509
|
initialLoad,
|
|
@@ -7676,11 +7517,10 @@ var BankTransactionsTable = ({
|
|
|
7676
7517
|
containerWidth,
|
|
7677
7518
|
showDescriptions,
|
|
7678
7519
|
showReceiptUploads,
|
|
7679
|
-
hardRefreshPnlOnCategorize,
|
|
7680
7520
|
stringOverrides: stringOverrides?.bankTransactionCTAs
|
|
7681
7521
|
}
|
|
7682
7522
|
)
|
|
7683
|
-
), isSyncing && (lastPage || (!bankTransactions || bankTransactions.length === 0) && page === 1) ? /* @__PURE__ */
|
|
7523
|
+
), isSyncing && (lastPage || (!bankTransactions || bankTransactions.length === 0) && page === 1) ? /* @__PURE__ */ import_react85.default.createElement("tr", null, /* @__PURE__ */ import_react85.default.createElement("td", { colSpan: 3 }, /* @__PURE__ */ import_react85.default.createElement(
|
|
7684
7524
|
SyncingComponent,
|
|
7685
7525
|
{
|
|
7686
7526
|
title: "Syncing historical account data",
|
|
@@ -7691,12 +7531,12 @@ var BankTransactionsTable = ({
|
|
|
7691
7531
|
};
|
|
7692
7532
|
|
|
7693
7533
|
// src/components/ErrorBoundary/ErrorBoundary.tsx
|
|
7694
|
-
var
|
|
7534
|
+
var import_react87 = __toESM(require("react"));
|
|
7695
7535
|
|
|
7696
7536
|
// src/components/ErrorBoundary/ErrorBoundaryMessage.tsx
|
|
7697
|
-
var
|
|
7537
|
+
var import_react86 = __toESM(require("react"));
|
|
7698
7538
|
var ErrorBoundaryMessage = () => {
|
|
7699
|
-
return /* @__PURE__ */
|
|
7539
|
+
return /* @__PURE__ */ import_react86.default.createElement("div", { className: "Layer__component Layer__component-container Layer__error-boundary" }, /* @__PURE__ */ import_react86.default.createElement(
|
|
7700
7540
|
DataState,
|
|
7701
7541
|
{
|
|
7702
7542
|
status: "failed" /* failed */,
|
|
@@ -7707,7 +7547,7 @@ var ErrorBoundaryMessage = () => {
|
|
|
7707
7547
|
};
|
|
7708
7548
|
|
|
7709
7549
|
// src/components/ErrorBoundary/ErrorBoundary.tsx
|
|
7710
|
-
var ErrorBoundary = class extends
|
|
7550
|
+
var ErrorBoundary = class extends import_react87.Component {
|
|
7711
7551
|
constructor(props) {
|
|
7712
7552
|
super(props);
|
|
7713
7553
|
this.onError = props.onError;
|
|
@@ -7725,17 +7565,17 @@ var ErrorBoundary = class extends import_react88.Component {
|
|
|
7725
7565
|
}
|
|
7726
7566
|
render() {
|
|
7727
7567
|
if (this.state.hasError) {
|
|
7728
|
-
return /* @__PURE__ */
|
|
7568
|
+
return /* @__PURE__ */ import_react87.default.createElement(ErrorBoundaryMessage, null);
|
|
7729
7569
|
}
|
|
7730
7570
|
return this.props.children;
|
|
7731
7571
|
}
|
|
7732
7572
|
};
|
|
7733
7573
|
|
|
7734
7574
|
// src/components/Pagination/Pagination.tsx
|
|
7735
|
-
var
|
|
7575
|
+
var import_react89 = __toESM(require("react"));
|
|
7736
7576
|
|
|
7737
7577
|
// src/hooks/usePagination/usePagination.ts
|
|
7738
|
-
var
|
|
7578
|
+
var import_react88 = require("react");
|
|
7739
7579
|
var DOTS = "...";
|
|
7740
7580
|
var usePagination = ({
|
|
7741
7581
|
totalCount,
|
|
@@ -7743,7 +7583,7 @@ var usePagination = ({
|
|
|
7743
7583
|
siblingCount = 1,
|
|
7744
7584
|
currentPage
|
|
7745
7585
|
}) => {
|
|
7746
|
-
const paginationRange = (0,
|
|
7586
|
+
const paginationRange = (0, import_react88.useMemo)(() => {
|
|
7747
7587
|
const totalPageCount = Math.ceil(totalCount / pageSize);
|
|
7748
7588
|
const totalPageNumbers = siblingCount + 5;
|
|
7749
7589
|
if (totalPageNumbers >= totalPageCount) {
|
|
@@ -7827,7 +7667,7 @@ var Pagination = ({
|
|
|
7827
7667
|
return;
|
|
7828
7668
|
}
|
|
7829
7669
|
let lastPage = paginationRange[paginationRange.length - 1];
|
|
7830
|
-
return /* @__PURE__ */
|
|
7670
|
+
return /* @__PURE__ */ import_react89.default.createElement("ul", { className: "Layer__pagination" }, /* @__PURE__ */ import_react89.default.createElement(
|
|
7831
7671
|
"li",
|
|
7832
7672
|
{
|
|
7833
7673
|
key: `page-prev`,
|
|
@@ -7839,10 +7679,10 @@ var Pagination = ({
|
|
|
7839
7679
|
),
|
|
7840
7680
|
onClick: () => onPageChange(currentPage - 1)
|
|
7841
7681
|
},
|
|
7842
|
-
/* @__PURE__ */
|
|
7682
|
+
/* @__PURE__ */ import_react89.default.createElement(ChevronLeft_default, { size: 12 })
|
|
7843
7683
|
), paginationRange.map((pageNumber, idx) => {
|
|
7844
7684
|
if (pageNumber === DOTS) {
|
|
7845
|
-
return /* @__PURE__ */
|
|
7685
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
7846
7686
|
"li",
|
|
7847
7687
|
{
|
|
7848
7688
|
key: `${idx}-page-${pageNumber}`,
|
|
@@ -7851,7 +7691,7 @@ var Pagination = ({
|
|
|
7851
7691
|
"\u2026"
|
|
7852
7692
|
);
|
|
7853
7693
|
}
|
|
7854
|
-
return /* @__PURE__ */
|
|
7694
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
7855
7695
|
"li",
|
|
7856
7696
|
{
|
|
7857
7697
|
key: `page-${pageNumber}`,
|
|
@@ -7869,7 +7709,7 @@ var Pagination = ({
|
|
|
7869
7709
|
},
|
|
7870
7710
|
pageNumber
|
|
7871
7711
|
);
|
|
7872
|
-
}), hasMore && fetchMore ? /* @__PURE__ */
|
|
7712
|
+
}), hasMore && fetchMore ? /* @__PURE__ */ import_react89.default.createElement(
|
|
7873
7713
|
"li",
|
|
7874
7714
|
{
|
|
7875
7715
|
key: `page-has-more`,
|
|
@@ -7877,7 +7717,7 @@ var Pagination = ({
|
|
|
7877
7717
|
onClick: fetchMore
|
|
7878
7718
|
},
|
|
7879
7719
|
"..."
|
|
7880
|
-
) : null, /* @__PURE__ */
|
|
7720
|
+
) : null, /* @__PURE__ */ import_react89.default.createElement(
|
|
7881
7721
|
"li",
|
|
7882
7722
|
{
|
|
7883
7723
|
key: `page-last`,
|
|
@@ -7889,12 +7729,12 @@ var Pagination = ({
|
|
|
7889
7729
|
),
|
|
7890
7730
|
onClick: () => onPageChange(currentPage + 1)
|
|
7891
7731
|
},
|
|
7892
|
-
/* @__PURE__ */
|
|
7732
|
+
/* @__PURE__ */ import_react89.default.createElement(ChevronRight_default, { size: 12 })
|
|
7893
7733
|
));
|
|
7894
7734
|
};
|
|
7895
7735
|
|
|
7896
7736
|
// src/components/BankTransactions/BankTransactionsHeader.tsx
|
|
7897
|
-
var
|
|
7737
|
+
var import_react94 = __toESM(require("react"));
|
|
7898
7738
|
|
|
7899
7739
|
// src/icons/DownloadCloud.tsx
|
|
7900
7740
|
var React103 = __toESM(require("react"));
|
|
@@ -7939,11 +7779,11 @@ var DownloadCloud = ({ size = 18, ...props }) => /* @__PURE__ */ React103.create
|
|
|
7939
7779
|
var DownloadCloud_default = DownloadCloud;
|
|
7940
7780
|
|
|
7941
7781
|
// src/utils/business.ts
|
|
7942
|
-
var
|
|
7782
|
+
var import_date_fns12 = require("date-fns");
|
|
7943
7783
|
var getActivationDate = (business) => {
|
|
7944
7784
|
try {
|
|
7945
7785
|
if (business && business.activation_at) {
|
|
7946
|
-
return (0,
|
|
7786
|
+
return (0, import_date_fns12.parseISO)(business.activation_at);
|
|
7947
7787
|
}
|
|
7948
7788
|
return;
|
|
7949
7789
|
} catch (_err) {
|
|
@@ -7953,7 +7793,7 @@ var getActivationDate = (business) => {
|
|
|
7953
7793
|
var getEarliestDateToBrowse = (business) => {
|
|
7954
7794
|
const activationDate = getActivationDate(business);
|
|
7955
7795
|
if (activationDate) {
|
|
7956
|
-
return (0,
|
|
7796
|
+
return (0, import_date_fns12.startOfMonth)(activationDate);
|
|
7957
7797
|
}
|
|
7958
7798
|
return;
|
|
7959
7799
|
};
|
|
@@ -7965,16 +7805,16 @@ var isDateAllowedToBrowse = (date, business) => {
|
|
|
7965
7805
|
if (!activationDate) {
|
|
7966
7806
|
return true;
|
|
7967
7807
|
}
|
|
7968
|
-
return (0,
|
|
7808
|
+
return (0, import_date_fns12.differenceInCalendarMonths)((0, import_date_fns12.startOfMonth)(date), activationDate) >= 0;
|
|
7969
7809
|
};
|
|
7970
7810
|
|
|
7971
7811
|
// src/components/DatePicker/DatePicker.tsx
|
|
7972
|
-
var
|
|
7812
|
+
var import_react91 = __toESM(require("react"));
|
|
7973
7813
|
var import_react_datepicker = __toESM(require("react-datepicker"));
|
|
7974
7814
|
|
|
7975
7815
|
// src/components/DatePicker/DatePickerOptions.tsx
|
|
7976
|
-
var
|
|
7977
|
-
var
|
|
7816
|
+
var import_react90 = __toESM(require("react"));
|
|
7817
|
+
var import_date_fns13 = require("date-fns");
|
|
7978
7818
|
var DatePickerOptions = ({
|
|
7979
7819
|
options,
|
|
7980
7820
|
setSelectedDate
|
|
@@ -7983,87 +7823,87 @@ var DatePickerOptions = ({
|
|
|
7983
7823
|
const getOptionComponent = (option) => {
|
|
7984
7824
|
switch (option) {
|
|
7985
7825
|
case "this-month":
|
|
7986
|
-
return /* @__PURE__ */
|
|
7826
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
7987
7827
|
TextButton,
|
|
7988
7828
|
{
|
|
7989
7829
|
key: option,
|
|
7990
7830
|
onClick: () => {
|
|
7991
7831
|
setSelectedDate([
|
|
7992
|
-
(0,
|
|
7993
|
-
(0,
|
|
7832
|
+
(0, import_date_fns13.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
7833
|
+
(0, import_date_fns13.endOfMonth)(/* @__PURE__ */ new Date())
|
|
7994
7834
|
]);
|
|
7995
7835
|
}
|
|
7996
7836
|
},
|
|
7997
7837
|
"This month"
|
|
7998
7838
|
);
|
|
7999
7839
|
case "last-month":
|
|
8000
|
-
return /* @__PURE__ */
|
|
7840
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
8001
7841
|
TextButton,
|
|
8002
7842
|
{
|
|
8003
7843
|
key: option,
|
|
8004
7844
|
onClick: () => {
|
|
8005
7845
|
setSelectedDate([
|
|
8006
|
-
(0,
|
|
8007
|
-
(0,
|
|
7846
|
+
(0, import_date_fns13.startOfMonth)((0, import_date_fns13.subMonths)(/* @__PURE__ */ new Date(), 1)),
|
|
7847
|
+
(0, import_date_fns13.endOfMonth)((0, import_date_fns13.subMonths)(/* @__PURE__ */ new Date(), 1))
|
|
8008
7848
|
]);
|
|
8009
7849
|
}
|
|
8010
7850
|
},
|
|
8011
7851
|
"Last month"
|
|
8012
7852
|
);
|
|
8013
7853
|
case "this-quarter":
|
|
8014
|
-
return /* @__PURE__ */
|
|
7854
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
8015
7855
|
TextButton,
|
|
8016
7856
|
{
|
|
8017
7857
|
key: option,
|
|
8018
7858
|
onClick: () => {
|
|
8019
7859
|
setSelectedDate([
|
|
8020
|
-
(0,
|
|
8021
|
-
(0,
|
|
7860
|
+
(0, import_date_fns13.startOfQuarter)(/* @__PURE__ */ new Date()),
|
|
7861
|
+
(0, import_date_fns13.endOfQuarter)(/* @__PURE__ */ new Date())
|
|
8022
7862
|
]);
|
|
8023
7863
|
}
|
|
8024
7864
|
},
|
|
8025
7865
|
"This quarter"
|
|
8026
7866
|
);
|
|
8027
7867
|
case "last-quarter":
|
|
8028
|
-
return /* @__PURE__ */
|
|
7868
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
8029
7869
|
TextButton,
|
|
8030
7870
|
{
|
|
8031
7871
|
key: option,
|
|
8032
7872
|
onClick: () => {
|
|
8033
|
-
const lastQuarter = (0,
|
|
7873
|
+
const lastQuarter = (0, import_date_fns13.subQuarters)(/* @__PURE__ */ new Date(), 1);
|
|
8034
7874
|
setSelectedDate([
|
|
8035
|
-
(0,
|
|
8036
|
-
(0,
|
|
7875
|
+
(0, import_date_fns13.startOfQuarter)(lastQuarter),
|
|
7876
|
+
(0, import_date_fns13.endOfQuarter)(lastQuarter)
|
|
8037
7877
|
]);
|
|
8038
7878
|
}
|
|
8039
7879
|
},
|
|
8040
7880
|
"Last quarter"
|
|
8041
7881
|
);
|
|
8042
7882
|
case "this-year":
|
|
8043
|
-
return /* @__PURE__ */
|
|
7883
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
8044
7884
|
TextButton,
|
|
8045
7885
|
{
|
|
8046
7886
|
key: option,
|
|
8047
7887
|
onClick: () => {
|
|
8048
|
-
setSelectedDate([(0,
|
|
7888
|
+
setSelectedDate([(0, import_date_fns13.startOfYear)(/* @__PURE__ */ new Date()), (0, import_date_fns13.endOfYear)(/* @__PURE__ */ new Date())]);
|
|
8049
7889
|
}
|
|
8050
7890
|
},
|
|
8051
7891
|
"This year"
|
|
8052
7892
|
);
|
|
8053
7893
|
case "last-year":
|
|
8054
|
-
return /* @__PURE__ */
|
|
7894
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
8055
7895
|
TextButton,
|
|
8056
7896
|
{
|
|
8057
7897
|
key: option,
|
|
8058
7898
|
onClick: () => {
|
|
8059
|
-
const lastYear = (0,
|
|
8060
|
-
setSelectedDate([(0,
|
|
7899
|
+
const lastYear = (0, import_date_fns13.subYears)(/* @__PURE__ */ new Date(), 1);
|
|
7900
|
+
setSelectedDate([(0, import_date_fns13.startOfYear)(lastYear), (0, import_date_fns13.endOfYear)(lastYear)]);
|
|
8061
7901
|
}
|
|
8062
7902
|
},
|
|
8063
7903
|
"Last year"
|
|
8064
7904
|
);
|
|
8065
7905
|
}
|
|
8066
|
-
return /* @__PURE__ */
|
|
7906
|
+
return /* @__PURE__ */ import_react90.default.createElement(import_react90.default.Fragment, null);
|
|
8067
7907
|
};
|
|
8068
7908
|
if (options.length === 0) {
|
|
8069
7909
|
const allOptions = [
|
|
@@ -8083,9 +7923,9 @@ var DatePickerOptions = ({
|
|
|
8083
7923
|
});
|
|
8084
7924
|
}
|
|
8085
7925
|
if (optionsComponents.length === 0) {
|
|
8086
|
-
return /* @__PURE__ */
|
|
7926
|
+
return /* @__PURE__ */ import_react90.default.createElement(import_react90.default.Fragment, null);
|
|
8087
7927
|
}
|
|
8088
|
-
return /* @__PURE__ */
|
|
7928
|
+
return /* @__PURE__ */ import_react90.default.createElement("div", { className: "Layer__datepicker__popper__custom-footer" }, optionsComponents);
|
|
8089
7929
|
};
|
|
8090
7930
|
|
|
8091
7931
|
// src/components/DatePicker/DatePicker.tsx
|
|
@@ -8122,28 +7962,28 @@ var DatePicker = ({
|
|
|
8122
7962
|
navigateArrows = mode === "monthPicker",
|
|
8123
7963
|
...props
|
|
8124
7964
|
}) => {
|
|
8125
|
-
const pickerRef = (0,
|
|
8126
|
-
const [updatePickerDate, setPickerDate] = (0,
|
|
8127
|
-
const [selectedDates, setSelectedDates] = (0,
|
|
7965
|
+
const pickerRef = (0, import_react91.useRef)(null);
|
|
7966
|
+
const [updatePickerDate, setPickerDate] = (0, import_react91.useState)(false);
|
|
7967
|
+
const [selectedDates, setSelectedDates] = (0, import_react91.useState)(selected);
|
|
8128
7968
|
const { isDesktop } = useSizeClass();
|
|
8129
|
-
const [startDate, setStartDate] = (0,
|
|
7969
|
+
const [startDate, setStartDate] = (0, import_react91.useState)(
|
|
8130
7970
|
getDefaultRangeDate("start", mode, selected) ?? /* @__PURE__ */ new Date()
|
|
8131
7971
|
);
|
|
8132
|
-
const [endDate, setEndDate] = (0,
|
|
7972
|
+
const [endDate, setEndDate] = (0, import_react91.useState)(
|
|
8133
7973
|
getDefaultRangeDate("end", mode, selected)
|
|
8134
7974
|
);
|
|
8135
|
-
(0,
|
|
7975
|
+
(0, import_react91.useEffect)(() => {
|
|
8136
7976
|
try {
|
|
8137
7977
|
setPickerDate(true);
|
|
8138
|
-
if (!isRangeMode(mode) && selected !== selectedDates) {
|
|
7978
|
+
if (!isRangeMode(mode) && selected?.getTime() !== selectedDates?.getTime()) {
|
|
8139
7979
|
setSelectedDates(selected);
|
|
8140
7980
|
return;
|
|
8141
7981
|
}
|
|
8142
7982
|
if (isRangeMode(mode) && Array.isArray(selected)) {
|
|
8143
|
-
if (startDate !== selected[0]) {
|
|
7983
|
+
if (startDate?.getTime() !== selected[0]?.getTime()) {
|
|
8144
7984
|
setStartDate(selected[0]);
|
|
8145
7985
|
}
|
|
8146
|
-
if (endDate !== selected[1]) {
|
|
7986
|
+
if (endDate?.getTime() !== selected[1]?.getTime()) {
|
|
8147
7987
|
setEndDate(selected[1]);
|
|
8148
7988
|
}
|
|
8149
7989
|
}
|
|
@@ -8151,14 +7991,14 @@ var DatePicker = ({
|
|
|
8151
7991
|
return;
|
|
8152
7992
|
}
|
|
8153
7993
|
}, [selected]);
|
|
8154
|
-
(0,
|
|
8155
|
-
if (onChange && !updatePickerDate) {
|
|
7994
|
+
(0, import_react91.useEffect)(() => {
|
|
7995
|
+
if (onChange && (!isRangeMode(mode) || isRangeMode(mode) && !updatePickerDate)) {
|
|
8156
7996
|
onChange(selectedDates);
|
|
8157
7997
|
} else {
|
|
8158
7998
|
setPickerDate(false);
|
|
8159
7999
|
}
|
|
8160
8000
|
}, [selectedDates]);
|
|
8161
|
-
(0,
|
|
8001
|
+
(0, import_react91.useEffect)(() => {
|
|
8162
8002
|
if (isRangeMode(mode)) {
|
|
8163
8003
|
setSelectedDates([startDate, endDate]);
|
|
8164
8004
|
}
|
|
@@ -8235,7 +8075,7 @@ var DatePicker = ({
|
|
|
8235
8075
|
);
|
|
8236
8076
|
}
|
|
8237
8077
|
};
|
|
8238
|
-
return /* @__PURE__ */
|
|
8078
|
+
return /* @__PURE__ */ import_react91.default.createElement("div", { className: wrapperClassNames }, /* @__PURE__ */ import_react91.default.createElement(
|
|
8239
8079
|
import_react_datepicker.default,
|
|
8240
8080
|
{
|
|
8241
8081
|
ref: pickerRef,
|
|
@@ -8251,7 +8091,7 @@ var DatePicker = ({
|
|
|
8251
8091
|
selectsRange: isRangeMode(mode),
|
|
8252
8092
|
showMonthYearPicker: mode === "monthPicker" || mode === "monthRangePicker",
|
|
8253
8093
|
dateFormat,
|
|
8254
|
-
renderDayContents: (day) => /* @__PURE__ */
|
|
8094
|
+
renderDayContents: (day) => /* @__PURE__ */ import_react91.default.createElement("span", { className: "Layer__datepicker__day-contents" }, day),
|
|
8255
8095
|
timeIntervals,
|
|
8256
8096
|
timeCaption,
|
|
8257
8097
|
timeFormat: "h mm aa",
|
|
@@ -8283,14 +8123,14 @@ var DatePicker = ({
|
|
|
8283
8123
|
},
|
|
8284
8124
|
...props
|
|
8285
8125
|
},
|
|
8286
|
-
mode === "dayRangePicker" && /* @__PURE__ */
|
|
8126
|
+
mode === "dayRangePicker" && /* @__PURE__ */ import_react91.default.createElement(
|
|
8287
8127
|
DatePickerOptions,
|
|
8288
8128
|
{
|
|
8289
8129
|
options,
|
|
8290
8130
|
setSelectedDate: setSelectedDates
|
|
8291
8131
|
}
|
|
8292
8132
|
)
|
|
8293
|
-
), navigateArrows && !isDesktop && /* @__PURE__ */
|
|
8133
|
+
), navigateArrows && !isDesktop && /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, /* @__PURE__ */ import_react91.default.createElement(
|
|
8294
8134
|
Button,
|
|
8295
8135
|
{
|
|
8296
8136
|
"aria-label": "Previous Date",
|
|
@@ -8302,8 +8142,8 @@ var DatePicker = ({
|
|
|
8302
8142
|
variant: "secondary" /* secondary */,
|
|
8303
8143
|
disabled: isBeforeMinDate
|
|
8304
8144
|
},
|
|
8305
|
-
/* @__PURE__ */
|
|
8306
|
-
), /* @__PURE__ */
|
|
8145
|
+
/* @__PURE__ */ import_react91.default.createElement(ChevronLeft_default, { className: "Layer__datepicker__button-icon", size: 16 })
|
|
8146
|
+
), /* @__PURE__ */ import_react91.default.createElement(
|
|
8307
8147
|
Button,
|
|
8308
8148
|
{
|
|
8309
8149
|
"aria-label": "Next Date",
|
|
@@ -8315,14 +8155,14 @@ var DatePicker = ({
|
|
|
8315
8155
|
onClick: () => changeDate(1),
|
|
8316
8156
|
disabled: isTodayOrAfter
|
|
8317
8157
|
},
|
|
8318
|
-
/* @__PURE__ */
|
|
8158
|
+
/* @__PURE__ */ import_react91.default.createElement(
|
|
8319
8159
|
ChevronRight_default,
|
|
8320
8160
|
{
|
|
8321
8161
|
className: "Layer__datepicker__button-icon",
|
|
8322
8162
|
size: 16
|
|
8323
8163
|
}
|
|
8324
8164
|
)
|
|
8325
|
-
)), currentDateOption && (mode === "dayPicker" || mode === "monthPicker") && /* @__PURE__ */
|
|
8165
|
+
)), currentDateOption && (mode === "dayPicker" || mode === "monthPicker") && /* @__PURE__ */ import_react91.default.createElement(
|
|
8326
8166
|
Button,
|
|
8327
8167
|
{
|
|
8328
8168
|
className: "Layer__datepicker__current-button",
|
|
@@ -8335,10 +8175,10 @@ var DatePicker = ({
|
|
|
8335
8175
|
};
|
|
8336
8176
|
|
|
8337
8177
|
// src/components/Tabs/Tabs.tsx
|
|
8338
|
-
var
|
|
8178
|
+
var import_react93 = __toESM(require("react"));
|
|
8339
8179
|
|
|
8340
8180
|
// src/components/Tabs/Tab.tsx
|
|
8341
|
-
var
|
|
8181
|
+
var import_react92 = __toESM(require("react"));
|
|
8342
8182
|
var Tab = ({
|
|
8343
8183
|
checked,
|
|
8344
8184
|
label,
|
|
@@ -8351,7 +8191,7 @@ var Tab = ({
|
|
|
8351
8191
|
index
|
|
8352
8192
|
}) => {
|
|
8353
8193
|
if (disabled) {
|
|
8354
|
-
return /* @__PURE__ */
|
|
8194
|
+
return /* @__PURE__ */ import_react92.default.createElement(Tooltip, null, /* @__PURE__ */ import_react92.default.createElement(TooltipTrigger, null, /* @__PURE__ */ import_react92.default.createElement("label", { className: `Layer__tabs-option`, "data-checked": checked }, /* @__PURE__ */ import_react92.default.createElement(
|
|
8355
8195
|
"input",
|
|
8356
8196
|
{
|
|
8357
8197
|
type: "radio",
|
|
@@ -8362,9 +8202,9 @@ var Tab = ({
|
|
|
8362
8202
|
disabled: disabled ?? false,
|
|
8363
8203
|
"data-idx": index
|
|
8364
8204
|
}
|
|
8365
|
-
), /* @__PURE__ */
|
|
8205
|
+
), /* @__PURE__ */ import_react92.default.createElement("span", { className: "Layer__tabs-option-content" }, leftIcon && /* @__PURE__ */ import_react92.default.createElement("span", { className: "Layer__tabs-option__icon" }, leftIcon), /* @__PURE__ */ import_react92.default.createElement("span", null, label)))), /* @__PURE__ */ import_react92.default.createElement(TooltipContent, { className: "Layer__tooltip" }, disabledMessage));
|
|
8366
8206
|
}
|
|
8367
|
-
return /* @__PURE__ */
|
|
8207
|
+
return /* @__PURE__ */ import_react92.default.createElement("label", { className: `Layer__tabs-option`, "data-checked": checked }, /* @__PURE__ */ import_react92.default.createElement(
|
|
8368
8208
|
"input",
|
|
8369
8209
|
{
|
|
8370
8210
|
type: "radio",
|
|
@@ -8375,15 +8215,15 @@ var Tab = ({
|
|
|
8375
8215
|
disabled: disabled ?? false,
|
|
8376
8216
|
"data-idx": index
|
|
8377
8217
|
}
|
|
8378
|
-
), /* @__PURE__ */
|
|
8218
|
+
), /* @__PURE__ */ import_react92.default.createElement("span", { className: "Layer__tabs-option-content" }, leftIcon && /* @__PURE__ */ import_react92.default.createElement("span", { className: "Layer__tabs-option__icon" }, leftIcon), /* @__PURE__ */ import_react92.default.createElement("span", null, label)));
|
|
8379
8219
|
};
|
|
8380
8220
|
|
|
8381
8221
|
// src/components/Tabs/Tabs.tsx
|
|
8382
8222
|
var import_classnames41 = __toESM(require("classnames"));
|
|
8383
8223
|
var Tabs = ({ name, options, selected, onChange }) => {
|
|
8384
|
-
const [initialized, setInitialized] = (0,
|
|
8385
|
-
const [thumbPos, setThumbPos] = (0,
|
|
8386
|
-
const [currentWidth, setCurrentWidth] = (0,
|
|
8224
|
+
const [initialized, setInitialized] = (0, import_react93.useState)(false);
|
|
8225
|
+
const [thumbPos, setThumbPos] = (0, import_react93.useState)({ left: 0, width: 0 });
|
|
8226
|
+
const [currentWidth, setCurrentWidth] = (0, import_react93.useState)(0);
|
|
8387
8227
|
const selectedValue = selected || options[0].value;
|
|
8388
8228
|
const baseClassName = (0, import_classnames41.default)(
|
|
8389
8229
|
"Layer__tabs",
|
|
@@ -8417,7 +8257,7 @@ var Tabs = ({ name, options, selected, onChange }) => {
|
|
|
8417
8257
|
shift2 = shift2 + 1.5;
|
|
8418
8258
|
setThumbPos({ left: shift2, width });
|
|
8419
8259
|
};
|
|
8420
|
-
(0,
|
|
8260
|
+
(0, import_react93.useEffect)(() => {
|
|
8421
8261
|
const selectedIndex = getSelectedIndex();
|
|
8422
8262
|
updateSelectPosition(selectedIndex);
|
|
8423
8263
|
setTimeout(() => {
|
|
@@ -8433,7 +8273,7 @@ var Tabs = ({ name, options, selected, onChange }) => {
|
|
|
8433
8273
|
}
|
|
8434
8274
|
return selectedIndex;
|
|
8435
8275
|
};
|
|
8436
|
-
return /* @__PURE__ */
|
|
8276
|
+
return /* @__PURE__ */ import_react93.default.createElement("div", { className: baseClassName, ref: elementRef }, options.map((option, index) => /* @__PURE__ */ import_react93.default.createElement(
|
|
8437
8277
|
Tab,
|
|
8438
8278
|
{
|
|
8439
8279
|
...option,
|
|
@@ -8445,17 +8285,17 @@ var Tabs = ({ name, options, selected, onChange }) => {
|
|
|
8445
8285
|
disabledMessage: option.disabledMessage,
|
|
8446
8286
|
index
|
|
8447
8287
|
}
|
|
8448
|
-
)), /* @__PURE__ */
|
|
8288
|
+
)), /* @__PURE__ */ import_react93.default.createElement("span", { className: "Layer__tabs__thumb", style: { ...thumbPos } }));
|
|
8449
8289
|
};
|
|
8450
8290
|
|
|
8451
8291
|
// src/components/BankTransactions/BankTransactionsHeader.tsx
|
|
8452
8292
|
var import_classnames42 = __toESM(require("classnames"));
|
|
8453
|
-
var
|
|
8293
|
+
var import_date_fns14 = require("date-fns");
|
|
8454
8294
|
var DownloadButton = ({
|
|
8455
8295
|
downloadButtonTextOverride
|
|
8456
8296
|
}) => {
|
|
8457
8297
|
const { auth, businessId, apiUrl } = useLayerContext();
|
|
8458
|
-
const [requestFailed, setRequestFailed] = (0,
|
|
8298
|
+
const [requestFailed, setRequestFailed] = (0, import_react94.useState)(false);
|
|
8459
8299
|
const handleClick = async () => {
|
|
8460
8300
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear().toString();
|
|
8461
8301
|
const getBankTransactionsCsv2 = Layer.getBankTransactionsCsv(
|
|
@@ -8480,7 +8320,7 @@ var DownloadButton = ({
|
|
|
8480
8320
|
setRequestFailed(true);
|
|
8481
8321
|
}
|
|
8482
8322
|
};
|
|
8483
|
-
return requestFailed ? /* @__PURE__ */
|
|
8323
|
+
return requestFailed ? /* @__PURE__ */ import_react94.default.createElement(
|
|
8484
8324
|
RetryButton,
|
|
8485
8325
|
{
|
|
8486
8326
|
onClick: handleClick,
|
|
@@ -8488,11 +8328,11 @@ var DownloadButton = ({
|
|
|
8488
8328
|
error: "Approval failed. Check connection and retry in few seconds."
|
|
8489
8329
|
},
|
|
8490
8330
|
"Retry"
|
|
8491
|
-
) : /* @__PURE__ */
|
|
8331
|
+
) : /* @__PURE__ */ import_react94.default.createElement(
|
|
8492
8332
|
Button,
|
|
8493
8333
|
{
|
|
8494
8334
|
variant: "secondary" /* secondary */,
|
|
8495
|
-
rightIcon: /* @__PURE__ */
|
|
8335
|
+
rightIcon: /* @__PURE__ */ import_react94.default.createElement(DownloadCloud_default, { size: 12 }),
|
|
8496
8336
|
onClick: handleClick
|
|
8497
8337
|
},
|
|
8498
8338
|
downloadButtonTextOverride || "Download"
|
|
@@ -8514,7 +8354,7 @@ var BankTransactionsHeader = ({
|
|
|
8514
8354
|
isSyncing
|
|
8515
8355
|
}) => {
|
|
8516
8356
|
const { business } = useLayerContext();
|
|
8517
|
-
return /* @__PURE__ */
|
|
8357
|
+
return /* @__PURE__ */ import_react94.default.createElement(
|
|
8518
8358
|
Header,
|
|
8519
8359
|
{
|
|
8520
8360
|
className: (0, import_classnames42.default)(
|
|
@@ -8524,21 +8364,21 @@ var BankTransactionsHeader = ({
|
|
|
8524
8364
|
),
|
|
8525
8365
|
style: { top: shiftStickyHeader }
|
|
8526
8366
|
},
|
|
8527
|
-
/* @__PURE__ */
|
|
8367
|
+
/* @__PURE__ */ import_react94.default.createElement("div", { className: "Layer__bank-transactions__header__content" }, /* @__PURE__ */ import_react94.default.createElement("div", { className: "Layer__bank-transactions__header__content-title" }, /* @__PURE__ */ import_react94.default.createElement(
|
|
8528
8368
|
Heading,
|
|
8529
8369
|
{
|
|
8530
8370
|
className: "Layer__bank-transactions__title",
|
|
8531
8371
|
size: asWidget ? "secondary" /* secondary */ : "secondary" /* secondary */
|
|
8532
8372
|
},
|
|
8533
8373
|
stringOverrides?.header || "Transactions"
|
|
8534
|
-
), isSyncing && /* @__PURE__ */
|
|
8374
|
+
), isSyncing && /* @__PURE__ */ import_react94.default.createElement(
|
|
8535
8375
|
SyncingComponent,
|
|
8536
8376
|
{
|
|
8537
8377
|
timeSync: 5,
|
|
8538
8378
|
inProgress: true,
|
|
8539
8379
|
hideContent: listView
|
|
8540
8380
|
}
|
|
8541
|
-
)), withDatePicker && dateRange && setDateRange ? /* @__PURE__ */
|
|
8381
|
+
)), withDatePicker && dateRange && setDateRange ? /* @__PURE__ */ import_react94.default.createElement(
|
|
8542
8382
|
DatePicker,
|
|
8543
8383
|
{
|
|
8544
8384
|
mode: "monthPicker",
|
|
@@ -8546,20 +8386,20 @@ var BankTransactionsHeader = ({
|
|
|
8546
8386
|
onChange: (date) => {
|
|
8547
8387
|
if (!Array.isArray(date)) {
|
|
8548
8388
|
setDateRange({
|
|
8549
|
-
startDate: (0,
|
|
8550
|
-
endDate: (0,
|
|
8389
|
+
startDate: (0, import_date_fns14.startOfMonth)(date),
|
|
8390
|
+
endDate: (0, import_date_fns14.endOfMonth)(date)
|
|
8551
8391
|
});
|
|
8552
8392
|
}
|
|
8553
8393
|
},
|
|
8554
8394
|
minDate: getEarliestDateToBrowse(business)
|
|
8555
8395
|
}
|
|
8556
8396
|
) : null),
|
|
8557
|
-
/* @__PURE__ */
|
|
8397
|
+
/* @__PURE__ */ import_react94.default.createElement("div", { className: "Layer__header__actions-wrapper" }, /* @__PURE__ */ import_react94.default.createElement("div", { className: "Layer__header__actions" }, /* @__PURE__ */ import_react94.default.createElement(
|
|
8558
8398
|
DownloadButton,
|
|
8559
8399
|
{
|
|
8560
8400
|
downloadButtonTextOverride: stringOverrides?.downloadButton
|
|
8561
8401
|
}
|
|
8562
|
-
), !categorizedOnly && !(mobileComponent == "mobileList" && listView) && categorizeView && /* @__PURE__ */
|
|
8402
|
+
), !categorizedOnly && !(mobileComponent == "mobileList" && listView) && categorizeView && /* @__PURE__ */ import_react94.default.createElement(
|
|
8563
8403
|
Toggle,
|
|
8564
8404
|
{
|
|
8565
8405
|
name: "bank-transaction-display",
|
|
@@ -8570,7 +8410,7 @@ var BankTransactionsHeader = ({
|
|
|
8570
8410
|
selected: display,
|
|
8571
8411
|
onChange: onCategorizationDisplayChange
|
|
8572
8412
|
}
|
|
8573
|
-
)), !categorizedOnly && mobileComponent === "mobileList" && listView && categorizeView && /* @__PURE__ */
|
|
8413
|
+
)), !categorizedOnly && mobileComponent === "mobileList" && listView && categorizeView && /* @__PURE__ */ import_react94.default.createElement(
|
|
8574
8414
|
Tabs,
|
|
8575
8415
|
{
|
|
8576
8416
|
name: "bank-transaction-display",
|
|
@@ -8586,7 +8426,7 @@ var BankTransactionsHeader = ({
|
|
|
8586
8426
|
};
|
|
8587
8427
|
|
|
8588
8428
|
// src/components/BankTransactions/DataStates.tsx
|
|
8589
|
-
var
|
|
8429
|
+
var import_react95 = __toESM(require("react"));
|
|
8590
8430
|
|
|
8591
8431
|
// src/icons/Inbox.tsx
|
|
8592
8432
|
var React109 = __toESM(require("react"));
|
|
@@ -8633,7 +8473,7 @@ var DataStates = ({
|
|
|
8633
8473
|
let title = editable ? "You are up to date with transactions!" : "You have no categorized transactions";
|
|
8634
8474
|
let description = editable ? "All uncategorized transaction will be displayed here" : "All transaction will be displayed here once reviewed";
|
|
8635
8475
|
const showRefreshButton = bankTransactions?.length;
|
|
8636
|
-
return /* @__PURE__ */
|
|
8476
|
+
return /* @__PURE__ */ import_react95.default.createElement(import_react95.default.Fragment, null, !isLoading && !error && (bankTransactions === void 0 || bankTransactions !== void 0 && bankTransactions.length === 0) ? /* @__PURE__ */ import_react95.default.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ import_react95.default.createElement(
|
|
8637
8477
|
DataState,
|
|
8638
8478
|
{
|
|
8639
8479
|
status: isLoading ? "info" /* info */ : "allDone" /* allDone */,
|
|
@@ -8641,9 +8481,9 @@ var DataStates = ({
|
|
|
8641
8481
|
description,
|
|
8642
8482
|
onRefresh: showRefreshButton ? refetch : void 0,
|
|
8643
8483
|
isLoading: isValidating,
|
|
8644
|
-
icon: !editable ? /* @__PURE__ */
|
|
8484
|
+
icon: !editable ? /* @__PURE__ */ import_react95.default.createElement(Inbox_default, null) : void 0
|
|
8645
8485
|
}
|
|
8646
|
-
)) : null, !isLoading && error ? /* @__PURE__ */
|
|
8486
|
+
)) : null, !isLoading && error ? /* @__PURE__ */ import_react95.default.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ import_react95.default.createElement(
|
|
8647
8487
|
DataState,
|
|
8648
8488
|
{
|
|
8649
8489
|
status: "failed" /* failed */,
|
|
@@ -8656,7 +8496,7 @@ var DataStates = ({
|
|
|
8656
8496
|
};
|
|
8657
8497
|
|
|
8658
8498
|
// src/components/BankTransactions/BankTransactions.tsx
|
|
8659
|
-
var
|
|
8499
|
+
var import_date_fns15 = require("date-fns");
|
|
8660
8500
|
var COMPONENT_NAME2 = "bank-transactions";
|
|
8661
8501
|
var TEST_EMPTY_STATE = false;
|
|
8662
8502
|
var POLL_INTERVAL = 1e4;
|
|
@@ -8670,7 +8510,7 @@ var BankTransactions = ({
|
|
|
8670
8510
|
onError,
|
|
8671
8511
|
...props
|
|
8672
8512
|
}) => {
|
|
8673
|
-
return /* @__PURE__ */
|
|
8513
|
+
return /* @__PURE__ */ import_react96.default.createElement(ErrorBoundary, { onError }, /* @__PURE__ */ import_react96.default.createElement(BankTransactionsContent, { ...props }));
|
|
8674
8514
|
};
|
|
8675
8515
|
var BankTransactionsContent = ({
|
|
8676
8516
|
asWidget = false,
|
|
@@ -8678,18 +8518,17 @@ var BankTransactionsContent = ({
|
|
|
8678
8518
|
mode = "self-serve",
|
|
8679
8519
|
showDescriptions = false,
|
|
8680
8520
|
showReceiptUploads = false,
|
|
8681
|
-
hardRefreshPnlOnCategorize = false,
|
|
8682
8521
|
monthlyView = false,
|
|
8683
8522
|
mobileComponent,
|
|
8684
8523
|
filters: inputFilters,
|
|
8685
8524
|
hideHeader = false,
|
|
8686
8525
|
stringOverrides
|
|
8687
8526
|
}) => {
|
|
8688
|
-
const [currentPage, setCurrentPage] = (0,
|
|
8689
|
-
const [initialLoad, setInitialLoad] = (0,
|
|
8690
|
-
const [dateRange, setDateRange] = (0,
|
|
8691
|
-
startDate: (0,
|
|
8692
|
-
endDate: (0,
|
|
8527
|
+
const [currentPage, setCurrentPage] = (0, import_react96.useState)(1);
|
|
8528
|
+
const [initialLoad, setInitialLoad] = (0, import_react96.useState)(true);
|
|
8529
|
+
const [dateRange, setDateRange] = (0, import_react96.useState)({
|
|
8530
|
+
startDate: (0, import_date_fns15.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
8531
|
+
endDate: (0, import_date_fns15.endOfMonth)(/* @__PURE__ */ new Date())
|
|
8693
8532
|
});
|
|
8694
8533
|
const categorizeView = categorizationEnabled(mode);
|
|
8695
8534
|
const {
|
|
@@ -8708,23 +8547,23 @@ var BankTransactionsContent = ({
|
|
|
8708
8547
|
removeAfterCategorize
|
|
8709
8548
|
} = useBankTransactionsContext();
|
|
8710
8549
|
const { data: linkedAccounts, refetchAccounts } = useLinkedAccounts();
|
|
8711
|
-
const isSyncing = (0,
|
|
8550
|
+
const isSyncing = (0, import_react96.useMemo)(
|
|
8712
8551
|
() => Boolean(linkedAccounts?.some((item) => item.is_syncing)),
|
|
8713
8552
|
[linkedAccounts]
|
|
8714
8553
|
);
|
|
8715
|
-
const transactionsNotSynced = (0,
|
|
8554
|
+
const transactionsNotSynced = (0, import_react96.useMemo)(
|
|
8716
8555
|
() => loadingStatus === "complete" && isSyncing && (!data || data?.length === 0),
|
|
8717
8556
|
[data, isSyncing, loadingStatus]
|
|
8718
8557
|
);
|
|
8719
8558
|
let intervalId = void 0;
|
|
8720
|
-
const [refreshTrigger, setRefreshTrigger] = (0,
|
|
8721
|
-
(0,
|
|
8559
|
+
const [refreshTrigger, setRefreshTrigger] = (0, import_react96.useState)(-1);
|
|
8560
|
+
(0, import_react96.useEffect)(() => {
|
|
8722
8561
|
if (refreshTrigger !== -1) {
|
|
8723
8562
|
refetch();
|
|
8724
8563
|
refetchAccounts();
|
|
8725
8564
|
}
|
|
8726
8565
|
}, [refreshTrigger]);
|
|
8727
|
-
(0,
|
|
8566
|
+
(0, import_react96.useEffect)(() => {
|
|
8728
8567
|
if (isSyncing) {
|
|
8729
8568
|
intervalId = setInterval(() => {
|
|
8730
8569
|
setRefreshTrigger(Math.random());
|
|
@@ -8740,10 +8579,10 @@ var BankTransactionsContent = ({
|
|
|
8740
8579
|
}
|
|
8741
8580
|
};
|
|
8742
8581
|
}, [isSyncing, transactionsNotSynced]);
|
|
8743
|
-
(0,
|
|
8582
|
+
(0, import_react96.useEffect)(() => {
|
|
8744
8583
|
activate();
|
|
8745
8584
|
}, []);
|
|
8746
|
-
(0,
|
|
8585
|
+
(0, import_react96.useEffect)(() => {
|
|
8747
8586
|
if (JSON.stringify(inputFilters) !== JSON.stringify(filters)) {
|
|
8748
8587
|
if (!filters?.categorizationStatus && categorizeView) {
|
|
8749
8588
|
setFilters({
|
|
@@ -8770,7 +8609,7 @@ var BankTransactionsContent = ({
|
|
|
8770
8609
|
});
|
|
8771
8610
|
}
|
|
8772
8611
|
}, [inputFilters, categorizeView, mode]);
|
|
8773
|
-
(0,
|
|
8612
|
+
(0, import_react96.useEffect)(() => {
|
|
8774
8613
|
if (loadingStatus === "complete") {
|
|
8775
8614
|
const timeoutLoad = setTimeout(() => {
|
|
8776
8615
|
setInitialLoad(false);
|
|
@@ -8778,10 +8617,10 @@ var BankTransactionsContent = ({
|
|
|
8778
8617
|
return () => clearTimeout(timeoutLoad);
|
|
8779
8618
|
}
|
|
8780
8619
|
}, [loadingStatus]);
|
|
8781
|
-
const bankTransactions = TEST_EMPTY_STATE ? [] : (0,
|
|
8620
|
+
const bankTransactions = TEST_EMPTY_STATE ? [] : (0, import_react96.useMemo)(() => {
|
|
8782
8621
|
if (monthlyView) {
|
|
8783
8622
|
return data?.filter(
|
|
8784
|
-
(x) => (0,
|
|
8623
|
+
(x) => (0, import_date_fns15.parseISO)(x.date) >= dateRange.startDate && (0, import_date_fns15.parseISO)(x.date) <= dateRange.endDate
|
|
8785
8624
|
);
|
|
8786
8625
|
}
|
|
8787
8626
|
const firstPageIndex = (currentPage - 1) * pageSize;
|
|
@@ -8794,10 +8633,10 @@ var BankTransactionsContent = ({
|
|
|
8794
8633
|
});
|
|
8795
8634
|
setCurrentPage(1);
|
|
8796
8635
|
};
|
|
8797
|
-
const [shiftStickyHeader, setShiftStickyHeader] = (0,
|
|
8636
|
+
const [shiftStickyHeader, setShiftStickyHeader] = (0, import_react96.useState)(0);
|
|
8798
8637
|
const debounceShiftStickyHeader = debounce(setShiftStickyHeader, 500);
|
|
8799
|
-
const [listView, setListView] = (0,
|
|
8800
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
8638
|
+
const [listView, setListView] = (0, import_react96.useState)(false);
|
|
8639
|
+
const [containerWidth, setContainerWidth] = (0, import_react96.useState)(0);
|
|
8801
8640
|
const debounceContainerWidth = debounce(setContainerWidth, 500);
|
|
8802
8641
|
const removeTransaction = (bankTransaction) => removeAfterCategorize(bankTransaction);
|
|
8803
8642
|
const containerRef = useElementSize((_el, _en, size) => {
|
|
@@ -8818,7 +8657,7 @@ var BankTransactionsContent = ({
|
|
|
8818
8657
|
});
|
|
8819
8658
|
const editable = display === "review" /* review */;
|
|
8820
8659
|
const isLastPage = data && !hasMore && Math.ceil((data?.length || 0) / pageSize) === currentPage;
|
|
8821
|
-
return /* @__PURE__ */
|
|
8660
|
+
return /* @__PURE__ */ import_react96.default.createElement(
|
|
8822
8661
|
Container,
|
|
8823
8662
|
{
|
|
8824
8663
|
className: display === "review" /* review */ ? "Layer__bank-transactions--to-review" : "Layer__bank-transactions--categorized",
|
|
@@ -8827,7 +8666,7 @@ var BankTransactionsContent = ({
|
|
|
8827
8666
|
asWidget,
|
|
8828
8667
|
ref: containerRef
|
|
8829
8668
|
},
|
|
8830
|
-
!hideHeader && /* @__PURE__ */
|
|
8669
|
+
!hideHeader && /* @__PURE__ */ import_react96.default.createElement(
|
|
8831
8670
|
BankTransactionsHeader,
|
|
8832
8671
|
{
|
|
8833
8672
|
shiftStickyHeader,
|
|
@@ -8846,7 +8685,7 @@ var BankTransactionsContent = ({
|
|
|
8846
8685
|
isSyncing
|
|
8847
8686
|
}
|
|
8848
8687
|
),
|
|
8849
|
-
!listView && /* @__PURE__ */
|
|
8688
|
+
!listView && /* @__PURE__ */ import_react96.default.createElement("div", { className: "Layer__bank-transactions__table-wrapper" }, /* @__PURE__ */ import_react96.default.createElement(
|
|
8850
8689
|
BankTransactionsTable,
|
|
8851
8690
|
{
|
|
8852
8691
|
categorizeView,
|
|
@@ -8861,13 +8700,12 @@ var BankTransactionsContent = ({
|
|
|
8861
8700
|
showDescriptions,
|
|
8862
8701
|
showReceiptUploads,
|
|
8863
8702
|
page: currentPage,
|
|
8864
|
-
hardRefreshPnlOnCategorize,
|
|
8865
8703
|
stringOverrides,
|
|
8866
8704
|
lastPage: isLastPage,
|
|
8867
8705
|
onRefresh: refetch
|
|
8868
8706
|
}
|
|
8869
8707
|
)),
|
|
8870
|
-
!isLoading && listView && mobileComponent !== "mobileList" ? /* @__PURE__ */
|
|
8708
|
+
!isLoading && listView && mobileComponent !== "mobileList" ? /* @__PURE__ */ import_react96.default.createElement(
|
|
8871
8709
|
BankTransactionList,
|
|
8872
8710
|
{
|
|
8873
8711
|
mode,
|
|
@@ -8875,23 +8713,21 @@ var BankTransactionsContent = ({
|
|
|
8875
8713
|
editable,
|
|
8876
8714
|
removeTransaction,
|
|
8877
8715
|
containerWidth,
|
|
8878
|
-
hardRefreshPnlOnCategorize,
|
|
8879
8716
|
stringOverrides: stringOverrides?.bankTransactionCTAs
|
|
8880
8717
|
}
|
|
8881
8718
|
) : null,
|
|
8882
|
-
!isLoading && listView && mobileComponent === "mobileList" ? /* @__PURE__ */
|
|
8719
|
+
!isLoading && listView && mobileComponent === "mobileList" ? /* @__PURE__ */ import_react96.default.createElement(
|
|
8883
8720
|
BankTransactionMobileList,
|
|
8884
8721
|
{
|
|
8885
8722
|
bankTransactions,
|
|
8886
8723
|
editable,
|
|
8887
8724
|
mode,
|
|
8888
8725
|
removeTransaction,
|
|
8889
|
-
initialLoad
|
|
8890
|
-
hardRefreshPnlOnCategorize
|
|
8726
|
+
initialLoad
|
|
8891
8727
|
}
|
|
8892
8728
|
) : null,
|
|
8893
|
-
listView && isLoading ? /* @__PURE__ */
|
|
8894
|
-
!isSyncing || listView ? /* @__PURE__ */
|
|
8729
|
+
listView && isLoading ? /* @__PURE__ */ import_react96.default.createElement("div", { className: "Layer__bank-transactions__list-loader" }, /* @__PURE__ */ import_react96.default.createElement(Loader2, null)) : null,
|
|
8730
|
+
!isSyncing || listView ? /* @__PURE__ */ import_react96.default.createElement(
|
|
8895
8731
|
DataStates,
|
|
8896
8732
|
{
|
|
8897
8733
|
bankTransactions,
|
|
@@ -8902,7 +8738,7 @@ var BankTransactionsContent = ({
|
|
|
8902
8738
|
editable
|
|
8903
8739
|
}
|
|
8904
8740
|
) : null,
|
|
8905
|
-
!monthlyView && /* @__PURE__ */
|
|
8741
|
+
!monthlyView && /* @__PURE__ */ import_react96.default.createElement("div", { className: "Layer__bank-transactions__pagination" }, /* @__PURE__ */ import_react96.default.createElement(
|
|
8906
8742
|
Pagination,
|
|
8907
8743
|
{
|
|
8908
8744
|
currentPage,
|
|
@@ -8917,19 +8753,19 @@ var BankTransactionsContent = ({
|
|
|
8917
8753
|
};
|
|
8918
8754
|
|
|
8919
8755
|
// src/components/Quickbooks/Quickbooks.tsx
|
|
8920
|
-
var
|
|
8756
|
+
var import_react98 = __toESM(require("react"));
|
|
8921
8757
|
|
|
8922
8758
|
// src/hooks/useQuickbooks/useQuickbooks.ts
|
|
8923
|
-
var
|
|
8759
|
+
var import_react97 = require("react");
|
|
8924
8760
|
var DEBUG2 = true;
|
|
8925
8761
|
var useQuickbooks = () => {
|
|
8926
8762
|
const { auth, businessId, apiUrl } = useLayerContext();
|
|
8927
|
-
const [isSyncingFromQuickbooks, setIsSyncingFromQuickbooks] = (0,
|
|
8928
|
-
const [quickbooksIsLinked, setQuickbooksIsLinked] = (0,
|
|
8763
|
+
const [isSyncingFromQuickbooks, setIsSyncingFromQuickbooks] = (0, import_react97.useState)(false);
|
|
8764
|
+
const [quickbooksIsLinked, setQuickbooksIsLinked] = (0, import_react97.useState)(
|
|
8929
8765
|
null
|
|
8930
8766
|
);
|
|
8931
|
-
const syncStatusIntervalRef = (0,
|
|
8932
|
-
(0,
|
|
8767
|
+
const syncStatusIntervalRef = (0, import_react97.useRef)(null);
|
|
8768
|
+
(0, import_react97.useEffect)(() => {
|
|
8933
8769
|
if (isSyncingFromQuickbooks && syncStatusIntervalRef.current === null) {
|
|
8934
8770
|
const interval = setInterval(() => fetchIsSyncingFromQuickbooks(), 2e3);
|
|
8935
8771
|
syncStatusIntervalRef.current = interval;
|
|
@@ -8939,7 +8775,7 @@ var useQuickbooks = () => {
|
|
|
8939
8775
|
syncStatusIntervalRef.current = null;
|
|
8940
8776
|
}
|
|
8941
8777
|
}, [isSyncingFromQuickbooks]);
|
|
8942
|
-
(0,
|
|
8778
|
+
(0, import_react97.useEffect)(() => {
|
|
8943
8779
|
fetchQuickbooksConnectionStatus();
|
|
8944
8780
|
}, []);
|
|
8945
8781
|
const fetchQuickbooksConnectionStatus = async () => {
|
|
@@ -8996,7 +8832,7 @@ var Quickbooks = () => {
|
|
|
8996
8832
|
linkQuickbooks,
|
|
8997
8833
|
unlinkQuickbooks
|
|
8998
8834
|
} = useQuickbooks();
|
|
8999
|
-
return /* @__PURE__ */
|
|
8835
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", null, /* @__PURE__ */ import_react98.default.createElement("div", null, "Quickbooks OAuth connection status:", " ", quickbooksIsLinked === void 0 ? "" : quickbooksIsLinked ? "established" : "not connected"), /* @__PURE__ */ import_react98.default.createElement("br", null), quickbooksIsLinked === null && "Loading...", quickbooksIsLinked === false && /* @__PURE__ */ import_react98.default.createElement(
|
|
9000
8836
|
"button",
|
|
9001
8837
|
{
|
|
9002
8838
|
onClick: async () => {
|
|
@@ -9005,14 +8841,14 @@ var Quickbooks = () => {
|
|
|
9005
8841
|
}
|
|
9006
8842
|
},
|
|
9007
8843
|
"Link Quickbooks"
|
|
9008
|
-
), quickbooksIsLinked === true && (isSyncingFromQuickbooks ? "Syncing data from Quickbooks..." : /* @__PURE__ */
|
|
8844
|
+
), quickbooksIsLinked === true && (isSyncingFromQuickbooks ? "Syncing data from Quickbooks..." : /* @__PURE__ */ import_react98.default.createElement("div", null, /* @__PURE__ */ import_react98.default.createElement("button", { onClick: syncFromQuickbooks2 }, "Sync Quickbooks"), /* @__PURE__ */ import_react98.default.createElement("button", { onClick: unlinkQuickbooks }, "Unlink Quickbooks"))));
|
|
9009
8845
|
};
|
|
9010
8846
|
|
|
9011
8847
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
9012
8848
|
var import_react113 = __toESM(require("react"));
|
|
9013
8849
|
|
|
9014
8850
|
// src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
|
|
9015
|
-
var
|
|
8851
|
+
var import_react100 = require("react");
|
|
9016
8852
|
|
|
9017
8853
|
// src/utils/profitAndLossUtils.ts
|
|
9018
8854
|
var doesLineItemQualifies = (item) => {
|
|
@@ -9068,34 +8904,35 @@ var applyShare = (items, total) => {
|
|
|
9068
8904
|
};
|
|
9069
8905
|
|
|
9070
8906
|
// src/hooks/useProfitAndLoss/useProfitAndLossQuery.tsx
|
|
9071
|
-
var
|
|
9072
|
-
var
|
|
9073
|
-
var
|
|
8907
|
+
var import_react99 = require("react");
|
|
8908
|
+
var import_date_fns16 = require("date-fns");
|
|
8909
|
+
var import_swr3 = __toESM(require("swr"));
|
|
9074
8910
|
var useProfitAndLossQuery = ({
|
|
9075
8911
|
startDate,
|
|
9076
8912
|
endDate,
|
|
9077
8913
|
tagFilter,
|
|
9078
8914
|
reportingBasis
|
|
9079
8915
|
} = {
|
|
9080
|
-
startDate: (0,
|
|
9081
|
-
endDate: (0,
|
|
8916
|
+
startDate: (0, import_date_fns16.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
8917
|
+
endDate: (0, import_date_fns16.endOfMonth)(/* @__PURE__ */ new Date())
|
|
9082
8918
|
}) => {
|
|
9083
8919
|
const { auth, businessId, apiUrl, syncTimestamps, read, hasBeenTouched } = useLayerContext();
|
|
8920
|
+
const queryKey = businessId && startDate && endDate && auth?.access_token && `profit-and-loss-${businessId}-${startDate.valueOf()}-${endDate.valueOf()}-${tagFilter?.key}-${tagFilter?.values?.join(
|
|
8921
|
+
","
|
|
8922
|
+
)}-${reportingBasis}`;
|
|
9084
8923
|
const {
|
|
9085
8924
|
data: rawData,
|
|
9086
8925
|
isLoading,
|
|
9087
8926
|
isValidating,
|
|
9088
8927
|
error: rawError,
|
|
9089
8928
|
mutate
|
|
9090
|
-
} = (0,
|
|
9091
|
-
|
|
9092
|
-
","
|
|
9093
|
-
)}-${reportingBasis}`,
|
|
8929
|
+
} = (0, import_swr3.default)(
|
|
8930
|
+
queryKey,
|
|
9094
8931
|
Layer.getProfitAndLoss(apiUrl, auth?.access_token, {
|
|
9095
8932
|
params: {
|
|
9096
8933
|
businessId,
|
|
9097
|
-
startDate: (0,
|
|
9098
|
-
endDate: (0,
|
|
8934
|
+
startDate: (0, import_date_fns16.formatISO)(startDate.valueOf()),
|
|
8935
|
+
endDate: (0, import_date_fns16.formatISO)(endDate.valueOf()),
|
|
9099
8936
|
tagKey: tagFilter?.key,
|
|
9100
8937
|
tagValues: tagFilter?.values?.join(","),
|
|
9101
8938
|
reportingBasis
|
|
@@ -9105,16 +8942,16 @@ var useProfitAndLossQuery = ({
|
|
|
9105
8942
|
const refetch = () => {
|
|
9106
8943
|
mutate();
|
|
9107
8944
|
};
|
|
9108
|
-
(0,
|
|
9109
|
-
if (isLoading || isValidating) {
|
|
9110
|
-
read("PROFIT_AND_LOSS" /* PROFIT_AND_LOSS
|
|
8945
|
+
(0, import_react99.useEffect)(() => {
|
|
8946
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
8947
|
+
read("PROFIT_AND_LOSS" /* PROFIT_AND_LOSS */, queryKey);
|
|
9111
8948
|
}
|
|
9112
8949
|
}, [isLoading, isValidating]);
|
|
9113
|
-
(0,
|
|
9114
|
-
if (hasBeenTouched(
|
|
8950
|
+
(0, import_react99.useEffect)(() => {
|
|
8951
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
9115
8952
|
refetch();
|
|
9116
8953
|
}
|
|
9117
|
-
}, [syncTimestamps]);
|
|
8954
|
+
}, [syncTimestamps, startDate, endDate, tagFilter, reportingBasis]);
|
|
9118
8955
|
return {
|
|
9119
8956
|
startDate,
|
|
9120
8957
|
endDate,
|
|
@@ -9127,27 +8964,27 @@ var useProfitAndLossQuery = ({
|
|
|
9127
8964
|
};
|
|
9128
8965
|
|
|
9129
8966
|
// src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
|
|
9130
|
-
var
|
|
8967
|
+
var import_date_fns17 = require("date-fns");
|
|
9131
8968
|
var useProfitAndLoss = ({
|
|
9132
8969
|
startDate: initialStartDate,
|
|
9133
8970
|
endDate: initialEndDate,
|
|
9134
8971
|
tagFilter,
|
|
9135
8972
|
reportingBasis
|
|
9136
8973
|
} = {
|
|
9137
|
-
startDate: (0,
|
|
9138
|
-
endDate: (0,
|
|
8974
|
+
startDate: (0, import_date_fns17.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
8975
|
+
endDate: (0, import_date_fns17.endOfMonth)(/* @__PURE__ */ new Date())
|
|
9139
8976
|
}) => {
|
|
9140
|
-
const [startDate, setStartDate] = (0,
|
|
9141
|
-
initialStartDate || (0,
|
|
8977
|
+
const [startDate, setStartDate] = (0, import_react100.useState)(
|
|
8978
|
+
initialStartDate || (0, import_date_fns17.startOfMonth)(Date.now())
|
|
9142
8979
|
);
|
|
9143
|
-
const [endDate, setEndDate] = (0,
|
|
9144
|
-
initialEndDate || (0,
|
|
8980
|
+
const [endDate, setEndDate] = (0, import_react100.useState)(
|
|
8981
|
+
initialEndDate || (0, import_date_fns17.endOfMonth)(Date.now())
|
|
9145
8982
|
);
|
|
9146
|
-
const [filters, setFilters] = (0,
|
|
8983
|
+
const [filters, setFilters] = (0, import_react100.useState)({
|
|
9147
8984
|
expenses: void 0,
|
|
9148
8985
|
revenue: void 0
|
|
9149
8986
|
});
|
|
9150
|
-
const [sidebarScope, setSidebarScope] = (0,
|
|
8987
|
+
const [sidebarScope, setSidebarScope] = (0, import_react100.useState)(void 0);
|
|
9151
8988
|
const { data, isLoading, isValidating, error, refetch } = useProfitAndLossQuery({
|
|
9152
8989
|
startDate,
|
|
9153
8990
|
endDate,
|
|
@@ -9180,7 +9017,7 @@ var useProfitAndLoss = ({
|
|
|
9180
9017
|
}
|
|
9181
9018
|
});
|
|
9182
9019
|
};
|
|
9183
|
-
const { filteredDataRevenue, filteredTotalRevenue } = (0,
|
|
9020
|
+
const { filteredDataRevenue, filteredTotalRevenue } = (0, import_react100.useMemo)(() => {
|
|
9184
9021
|
if (!data) {
|
|
9185
9022
|
return { filteredDataRevenue: [], filteredTotalRevenue: void 0 };
|
|
9186
9023
|
}
|
|
@@ -9217,7 +9054,7 @@ var useProfitAndLoss = ({
|
|
|
9217
9054
|
const withShare = applyShare(sorted, total);
|
|
9218
9055
|
return { filteredDataRevenue: withShare, filteredTotalRevenue: total };
|
|
9219
9056
|
}, [data, startDate, filters, sidebarScope]);
|
|
9220
|
-
const { filteredDataExpenses, filteredTotalExpenses } = (0,
|
|
9057
|
+
const { filteredDataExpenses, filteredTotalExpenses } = (0, import_react100.useMemo)(() => {
|
|
9221
9058
|
if (!data) {
|
|
9222
9059
|
return { filteredDataExpenses: [], filteredTotalExpenses: void 0 };
|
|
9223
9060
|
}
|
|
@@ -9277,6 +9114,164 @@ var useProfitAndLoss = ({
|
|
|
9277
9114
|
// src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
|
|
9278
9115
|
var import_react103 = __toESM(require("react"));
|
|
9279
9116
|
|
|
9117
|
+
// src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
|
|
9118
|
+
var import_react101 = require("react");
|
|
9119
|
+
var import_date_fns18 = require("date-fns");
|
|
9120
|
+
var import_swr4 = __toESM(require("swr"));
|
|
9121
|
+
var buildDates = ({ currentDate }) => {
|
|
9122
|
+
return {
|
|
9123
|
+
startYear: (0, import_date_fns18.startOfMonth)(currentDate).getFullYear() - 1,
|
|
9124
|
+
startMonth: (0, import_date_fns18.startOfMonth)(currentDate).getMonth() + 1,
|
|
9125
|
+
endYear: (0, import_date_fns18.startOfMonth)(currentDate).getFullYear(),
|
|
9126
|
+
endMonth: (0, import_date_fns18.startOfMonth)(currentDate).getMonth() + 1
|
|
9127
|
+
};
|
|
9128
|
+
};
|
|
9129
|
+
var buildMonthsArray = (startDate, endDate) => {
|
|
9130
|
+
if (startDate >= endDate) {
|
|
9131
|
+
return [];
|
|
9132
|
+
}
|
|
9133
|
+
var dates = [];
|
|
9134
|
+
for (var d = startDate; d <= endDate; d.setMonth(d.getMonth() + 1)) {
|
|
9135
|
+
dates.push(new Date(d));
|
|
9136
|
+
}
|
|
9137
|
+
return dates;
|
|
9138
|
+
};
|
|
9139
|
+
var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
9140
|
+
currentDate: (0, import_date_fns18.startOfMonth)(Date.now())
|
|
9141
|
+
}) => {
|
|
9142
|
+
const {
|
|
9143
|
+
businessId,
|
|
9144
|
+
auth,
|
|
9145
|
+
apiUrl,
|
|
9146
|
+
syncTimestamps,
|
|
9147
|
+
read,
|
|
9148
|
+
readTimestamps,
|
|
9149
|
+
hasBeenTouched
|
|
9150
|
+
} = useLayerContext();
|
|
9151
|
+
const [date, setDate] = (0, import_react101.useState)(currentDate);
|
|
9152
|
+
const [loaded, setLoaded] = (0, import_react101.useState)("initial");
|
|
9153
|
+
const [data, setData] = (0, import_react101.useState)([]);
|
|
9154
|
+
const { startYear, startMonth, endYear, endMonth } = (0, import_react101.useMemo)(() => {
|
|
9155
|
+
return buildDates({ currentDate: date });
|
|
9156
|
+
}, [date, businessId, tagFilter, reportingBasis]);
|
|
9157
|
+
const queryKey = businessId && Boolean(startYear) && Boolean(startMonth) && Boolean(endYear) && Boolean(endMonth) && auth?.access_token && `profit-and-loss-summaries-${businessId}-${startYear.toString()}-${startMonth.toString()}-${tagFilter?.key}-${tagFilter?.values?.join(
|
|
9158
|
+
","
|
|
9159
|
+
)}-${reportingBasis}`;
|
|
9160
|
+
const {
|
|
9161
|
+
data: rawData,
|
|
9162
|
+
isLoading,
|
|
9163
|
+
isValidating,
|
|
9164
|
+
error,
|
|
9165
|
+
mutate
|
|
9166
|
+
} = (0, import_swr4.default)(
|
|
9167
|
+
queryKey,
|
|
9168
|
+
Layer.getProfitAndLossSummaries(apiUrl, auth?.access_token, {
|
|
9169
|
+
params: {
|
|
9170
|
+
businessId,
|
|
9171
|
+
startYear: startYear.toString(),
|
|
9172
|
+
startMonth: startMonth.toString(),
|
|
9173
|
+
endYear: endYear.toString(),
|
|
9174
|
+
endMonth: endMonth.toString(),
|
|
9175
|
+
tagKey: tagFilter?.key,
|
|
9176
|
+
tagValues: tagFilter?.values?.join(","),
|
|
9177
|
+
reportingBasis
|
|
9178
|
+
}
|
|
9179
|
+
})
|
|
9180
|
+
);
|
|
9181
|
+
(0, import_react101.useEffect)(() => {
|
|
9182
|
+
const newData = data.slice();
|
|
9183
|
+
const newPeriod = buildMonthsArray((0, import_date_fns18.sub)(date, { years: 1 }), date);
|
|
9184
|
+
if (newData && newPeriod) {
|
|
9185
|
+
newPeriod.forEach((x) => {
|
|
9186
|
+
if (!newData?.find(
|
|
9187
|
+
(n) => x.getMonth() + 1 === n.month && x.getFullYear() === n.year
|
|
9188
|
+
)) {
|
|
9189
|
+
newData.push({
|
|
9190
|
+
year: x.getFullYear(),
|
|
9191
|
+
month: x.getMonth() + 1,
|
|
9192
|
+
income: 0,
|
|
9193
|
+
costOfGoodsSold: 0,
|
|
9194
|
+
grossProfit: 0,
|
|
9195
|
+
operatingExpenses: 0,
|
|
9196
|
+
profitBeforeTaxes: 0,
|
|
9197
|
+
taxes: 0,
|
|
9198
|
+
netProfit: 0,
|
|
9199
|
+
fullyCategorized: false,
|
|
9200
|
+
totalExpenses: 0,
|
|
9201
|
+
uncategorizedInflows: 0,
|
|
9202
|
+
uncategorizedOutflows: 0,
|
|
9203
|
+
uncategorized_transactions: 0,
|
|
9204
|
+
isLoading: true
|
|
9205
|
+
});
|
|
9206
|
+
}
|
|
9207
|
+
});
|
|
9208
|
+
}
|
|
9209
|
+
if (newData) {
|
|
9210
|
+
setData(
|
|
9211
|
+
newData.sort(
|
|
9212
|
+
(a, b) => Number(new Date(a.year, a.month, 1)) - Number(new Date(b.year, b.month, 1))
|
|
9213
|
+
)
|
|
9214
|
+
);
|
|
9215
|
+
}
|
|
9216
|
+
}, [startYear, startMonth]);
|
|
9217
|
+
(0, import_react101.useEffect)(() => {
|
|
9218
|
+
const newData = rawData?.data?.months?.slice();
|
|
9219
|
+
if (data && newData) {
|
|
9220
|
+
data.forEach((x) => {
|
|
9221
|
+
if (!newData?.find((n) => x.month === n.month && x.year === n.year)) {
|
|
9222
|
+
newData.push({ ...x });
|
|
9223
|
+
}
|
|
9224
|
+
});
|
|
9225
|
+
}
|
|
9226
|
+
if (newData) {
|
|
9227
|
+
setData(
|
|
9228
|
+
newData.sort(
|
|
9229
|
+
(a, b) => Number(new Date(a.year, a.month, 1)) - Number(new Date(b.year, b.month, 1))
|
|
9230
|
+
)
|
|
9231
|
+
);
|
|
9232
|
+
}
|
|
9233
|
+
}, [rawData]);
|
|
9234
|
+
(0, import_react101.useEffect)(() => {
|
|
9235
|
+
if (isLoading && loaded === "initial") {
|
|
9236
|
+
setLoaded("loading");
|
|
9237
|
+
return;
|
|
9238
|
+
}
|
|
9239
|
+
if (!isLoading && rawData) {
|
|
9240
|
+
setLoaded("complete");
|
|
9241
|
+
}
|
|
9242
|
+
}, [data, isLoading]);
|
|
9243
|
+
const pullData = (date2) => setDate(date2);
|
|
9244
|
+
(0, import_react101.useEffect)(() => {
|
|
9245
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
9246
|
+
read("PROFIT_AND_LOSS" /* PROFIT_AND_LOSS */, queryKey);
|
|
9247
|
+
}
|
|
9248
|
+
}, [isLoading, isValidating]);
|
|
9249
|
+
(0, import_react101.useEffect)(() => {
|
|
9250
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
9251
|
+
mutate();
|
|
9252
|
+
}
|
|
9253
|
+
}, [
|
|
9254
|
+
syncTimestamps,
|
|
9255
|
+
startYear,
|
|
9256
|
+
startMonth,
|
|
9257
|
+
endYear,
|
|
9258
|
+
endMonth,
|
|
9259
|
+
tagFilter,
|
|
9260
|
+
reportingBasis
|
|
9261
|
+
]);
|
|
9262
|
+
const refetch = () => {
|
|
9263
|
+
mutate();
|
|
9264
|
+
};
|
|
9265
|
+
return {
|
|
9266
|
+
data,
|
|
9267
|
+
isLoading,
|
|
9268
|
+
loaded,
|
|
9269
|
+
error,
|
|
9270
|
+
pullData,
|
|
9271
|
+
refetch
|
|
9272
|
+
};
|
|
9273
|
+
};
|
|
9274
|
+
|
|
9280
9275
|
// src/components/ProfitAndLossChart/Indicator.tsx
|
|
9281
9276
|
var import_react102 = __toESM(require("react"));
|
|
9282
9277
|
var emptyViewBox = { x: 0, y: 0, width: 0, height: 0 };
|
|
@@ -10797,17 +10792,8 @@ var ProfitAndLossSummaries = ({
|
|
|
10797
10792
|
data: storedData,
|
|
10798
10793
|
isLoading,
|
|
10799
10794
|
setSidebarScope,
|
|
10800
|
-
sidebarScope
|
|
10801
|
-
refetch,
|
|
10802
|
-
dateRange
|
|
10795
|
+
sidebarScope
|
|
10803
10796
|
} = (0, import_react110.useContext)(ProfitAndLoss.Context);
|
|
10804
|
-
const [trigger, setTrigger] = (0, import_react110.useState)(-1);
|
|
10805
|
-
(0, import_react110.useEffect)(() => {
|
|
10806
|
-
setTrigger(Math.random());
|
|
10807
|
-
}, [dateRange?.startDate]);
|
|
10808
|
-
(0, import_react110.useEffect)(() => {
|
|
10809
|
-
refetch();
|
|
10810
|
-
}, [trigger]);
|
|
10811
10797
|
const dataItem = Array.isArray(storedData) ? storedData[storedData.length - 1] : storedData;
|
|
10812
10798
|
const expensesChartData = (0, import_react110.useMemo)(() => {
|
|
10813
10799
|
return buildMiniChartData("expenses", dataItem);
|
|
@@ -11311,8 +11297,9 @@ var import_swr5 = __toESM(require("swr"));
|
|
|
11311
11297
|
var useBalanceSheet = (date = /* @__PURE__ */ new Date()) => {
|
|
11312
11298
|
const { auth, businessId, apiUrl, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
11313
11299
|
const dateString = (0, import_date_fns23.format)((0, import_date_fns23.startOfDay)(date), "yyyy-MM-dd'T'HH:mm:ssXXX");
|
|
11300
|
+
const queryKey = businessId && dateString && auth?.access_token && `balance-sheet-${businessId}-${dateString}`;
|
|
11314
11301
|
const { data, isLoading, isValidating, error, mutate } = (0, import_swr5.default)(
|
|
11315
|
-
|
|
11302
|
+
queryKey,
|
|
11316
11303
|
Layer.getBalanceSheet(apiUrl, auth?.access_token, {
|
|
11317
11304
|
params: {
|
|
11318
11305
|
businessId,
|
|
@@ -11324,15 +11311,15 @@ var useBalanceSheet = (date = /* @__PURE__ */ new Date()) => {
|
|
|
11324
11311
|
mutate();
|
|
11325
11312
|
};
|
|
11326
11313
|
(0, import_react116.useEffect)(() => {
|
|
11327
|
-
if (isLoading || isValidating) {
|
|
11328
|
-
read("BALANCE_SHEET" /* BALANCE_SHEET
|
|
11314
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
11315
|
+
read("BALANCE_SHEET" /* BALANCE_SHEET */, queryKey);
|
|
11329
11316
|
}
|
|
11330
11317
|
}, [isLoading, isValidating]);
|
|
11331
11318
|
(0, import_react116.useEffect)(() => {
|
|
11332
|
-
if (hasBeenTouched(
|
|
11319
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
11333
11320
|
refetch();
|
|
11334
11321
|
}
|
|
11335
|
-
}, [syncTimestamps]);
|
|
11322
|
+
}, [syncTimestamps, dateString]);
|
|
11336
11323
|
return { data: data?.data, isLoading, error, refetch };
|
|
11337
11324
|
};
|
|
11338
11325
|
|
|
@@ -11689,7 +11676,14 @@ var import_date_fns24 = require("date-fns");
|
|
|
11689
11676
|
var COMPONENT_NAME3 = "balance-sheet";
|
|
11690
11677
|
var BalanceSheet = (props) => {
|
|
11691
11678
|
const balanceSheetContextData = useBalanceSheet(props.effectiveDate);
|
|
11692
|
-
return /* @__PURE__ */ import_react129.default.createElement(BalanceSheetContext.Provider, { value: balanceSheetContextData }, /* @__PURE__ */ import_react129.default.createElement(
|
|
11679
|
+
return /* @__PURE__ */ import_react129.default.createElement(BalanceSheetContext.Provider, { value: balanceSheetContextData }, /* @__PURE__ */ import_react129.default.createElement(
|
|
11680
|
+
BalanceSheetView,
|
|
11681
|
+
{
|
|
11682
|
+
asWidget: props.asWidget,
|
|
11683
|
+
stringOverrides: props.stringOverrides,
|
|
11684
|
+
...props
|
|
11685
|
+
}
|
|
11686
|
+
));
|
|
11693
11687
|
};
|
|
11694
11688
|
var BalanceSheetView = ({
|
|
11695
11689
|
withExpandAllButton = true,
|
|
@@ -11723,7 +11717,14 @@ var BalanceSheetView = ({
|
|
|
11723
11717
|
}
|
|
11724
11718
|
), withExpandAllButton && /* @__PURE__ */ import_react129.default.createElement(BalanceSheetExpandAllButton, null))
|
|
11725
11719
|
},
|
|
11726
|
-
!data || isLoading ? /* @__PURE__ */ import_react129.default.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ import_react129.default.createElement(Loader2, null)) : /* @__PURE__ */ import_react129.default.createElement(
|
|
11720
|
+
!data || isLoading ? /* @__PURE__ */ import_react129.default.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ import_react129.default.createElement(Loader2, null)) : /* @__PURE__ */ import_react129.default.createElement(
|
|
11721
|
+
BalanceSheetTable,
|
|
11722
|
+
{
|
|
11723
|
+
data,
|
|
11724
|
+
config: BALANCE_SHEET_ROWS,
|
|
11725
|
+
stringOverrides: stringOverrides?.balanceSheetTable
|
|
11726
|
+
}
|
|
11727
|
+
)
|
|
11727
11728
|
)));
|
|
11728
11729
|
}
|
|
11729
11730
|
return /* @__PURE__ */ import_react129.default.createElement(TableProvider, null, /* @__PURE__ */ import_react129.default.createElement(
|
|
@@ -11738,7 +11739,14 @@ var BalanceSheetView = ({
|
|
|
11738
11739
|
}
|
|
11739
11740
|
), withExpandAllButton && /* @__PURE__ */ import_react129.default.createElement(BalanceSheetExpandAllButton, null))
|
|
11740
11741
|
},
|
|
11741
|
-
!data || isLoading ? /* @__PURE__ */ import_react129.default.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ import_react129.default.createElement(Loader2, null)) : /* @__PURE__ */ import_react129.default.createElement(
|
|
11742
|
+
!data || isLoading ? /* @__PURE__ */ import_react129.default.createElement("div", { className: `Layer__${COMPONENT_NAME3}__loader-container` }, /* @__PURE__ */ import_react129.default.createElement(Loader2, null)) : /* @__PURE__ */ import_react129.default.createElement(
|
|
11743
|
+
BalanceSheetTable,
|
|
11744
|
+
{
|
|
11745
|
+
data,
|
|
11746
|
+
config: BALANCE_SHEET_ROWS,
|
|
11747
|
+
stringOverrides: stringOverrides?.balanceSheetTable
|
|
11748
|
+
}
|
|
11749
|
+
)
|
|
11742
11750
|
));
|
|
11743
11751
|
};
|
|
11744
11752
|
|
|
@@ -11766,8 +11774,9 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
11766
11774
|
"yyyy-MM-dd'T'HH:mm:ssXXX"
|
|
11767
11775
|
);
|
|
11768
11776
|
const endDateString = (0, import_date_fns25.format)((0, import_date_fns25.startOfDay)(endDate), "yyyy-MM-dd'T'HH:mm:ssXXX");
|
|
11777
|
+
const queryKey = businessId && startDateString && endDateString && auth?.access_token && `statement-of-cash-${businessId}-${startDateString}-${endDateString}`;
|
|
11769
11778
|
const { data, isLoading, isValidating, error, mutate } = (0, import_swr6.default)(
|
|
11770
|
-
|
|
11779
|
+
queryKey,
|
|
11771
11780
|
Layer.getStatementOfCashFlow(apiUrl, auth?.access_token, {
|
|
11772
11781
|
params: {
|
|
11773
11782
|
businessId,
|
|
@@ -11780,15 +11789,15 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
11780
11789
|
mutate();
|
|
11781
11790
|
};
|
|
11782
11791
|
(0, import_react131.useEffect)(() => {
|
|
11783
|
-
if (isLoading || isValidating) {
|
|
11784
|
-
read("STATEMENT_OF_CASH_FLOWS" /* STATEMENT_OF_CASH_FLOWS
|
|
11792
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
11793
|
+
read("STATEMENT_OF_CASH_FLOWS" /* STATEMENT_OF_CASH_FLOWS */, queryKey);
|
|
11785
11794
|
}
|
|
11786
11795
|
}, [isLoading, isValidating]);
|
|
11787
11796
|
(0, import_react131.useEffect)(() => {
|
|
11788
|
-
if (hasBeenTouched(
|
|
11797
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
11789
11798
|
refetch();
|
|
11790
11799
|
}
|
|
11791
|
-
}, [syncTimestamps]);
|
|
11800
|
+
}, [syncTimestamps, startDateString, endDateString]);
|
|
11792
11801
|
return { data: data?.data, isLoading, error, refetch };
|
|
11793
11802
|
};
|
|
11794
11803
|
|
|
@@ -12310,8 +12319,9 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
12310
12319
|
const [endDate, setEndDate] = (0, import_react136.useState)(
|
|
12311
12320
|
initialEndDate ?? (0, import_date_fns28.endOfMonth)(Date.now())
|
|
12312
12321
|
);
|
|
12322
|
+
const queryKey = businessId && auth?.access_token && `chart-of-accounts-${businessId}-${startDate?.valueOf()}-${endDate?.valueOf()}`;
|
|
12313
12323
|
const { data, isLoading, isValidating, error, mutate } = (0, import_swr7.default)(
|
|
12314
|
-
|
|
12324
|
+
queryKey,
|
|
12315
12325
|
Layer.getLedgerAccountBalances(apiUrl, auth?.access_token, {
|
|
12316
12326
|
params: {
|
|
12317
12327
|
businessId,
|
|
@@ -12488,15 +12498,15 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
12488
12498
|
};
|
|
12489
12499
|
const refetch = () => mutate();
|
|
12490
12500
|
(0, import_react136.useEffect)(() => {
|
|
12491
|
-
if (isLoading || isValidating) {
|
|
12492
|
-
read("CHART_OF_ACCOUNTS" /* CHART_OF_ACCOUNTS
|
|
12501
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
12502
|
+
read("CHART_OF_ACCOUNTS" /* CHART_OF_ACCOUNTS */, queryKey);
|
|
12493
12503
|
}
|
|
12494
12504
|
}, [isLoading, isValidating]);
|
|
12495
12505
|
(0, import_react136.useEffect)(() => {
|
|
12496
|
-
if (hasBeenTouched(
|
|
12506
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
12497
12507
|
refetch();
|
|
12498
12508
|
}
|
|
12499
|
-
}, [syncTimestamps]);
|
|
12509
|
+
}, [syncTimestamps, startDate, endDate]);
|
|
12500
12510
|
return {
|
|
12501
12511
|
data: data?.data,
|
|
12502
12512
|
isLoading,
|
|
@@ -12524,8 +12534,9 @@ var useLedgerAccounts = () => {
|
|
|
12524
12534
|
const { auth, businessId, apiUrl, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
12525
12535
|
const [accountId, setAccountId] = (0, import_react137.useState)();
|
|
12526
12536
|
const [selectedEntryId, setSelectedEntryId] = (0, import_react137.useState)();
|
|
12537
|
+
const queryKey = businessId && accountId && auth?.access_token && `ledger-accounts-lines-${businessId}-${accountId}`;
|
|
12527
12538
|
const { data, isLoading, isValidating, error, mutate } = (0, import_swr8.default)(
|
|
12528
|
-
|
|
12539
|
+
queryKey,
|
|
12529
12540
|
Layer.getLedgerAccountsLines(apiUrl, auth?.access_token, {
|
|
12530
12541
|
params: { businessId, accountId }
|
|
12531
12542
|
})
|
|
@@ -12548,15 +12559,15 @@ var useLedgerAccounts = () => {
|
|
|
12548
12559
|
mutateEntryData();
|
|
12549
12560
|
};
|
|
12550
12561
|
(0, import_react137.useEffect)(() => {
|
|
12551
|
-
if (isLoading || isValidating) {
|
|
12552
|
-
read("LEDGER_ACCOUNTS" /* LEDGER_ACCOUNTS
|
|
12562
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
12563
|
+
read("LEDGER_ACCOUNTS" /* LEDGER_ACCOUNTS */, queryKey);
|
|
12553
12564
|
}
|
|
12554
12565
|
}, [isLoading, isValidating]);
|
|
12555
12566
|
(0, import_react137.useEffect)(() => {
|
|
12556
|
-
if (hasBeenTouched(
|
|
12567
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
12557
12568
|
refetch();
|
|
12558
12569
|
}
|
|
12559
|
-
}, [syncTimestamps]);
|
|
12570
|
+
}, [syncTimestamps, accountId]);
|
|
12560
12571
|
return {
|
|
12561
12572
|
data: data?.data,
|
|
12562
12573
|
entryData: entryData?.data,
|
|
@@ -13665,8 +13676,9 @@ var useJournal = () => {
|
|
|
13665
13676
|
const [addingEntry, setAddingEntry] = (0, import_react153.useState)(false);
|
|
13666
13677
|
const [sendingForm, setSendingForm] = (0, import_react153.useState)(false);
|
|
13667
13678
|
const [apiError, setApiError] = (0, import_react153.useState)(void 0);
|
|
13679
|
+
const queryKey = businessId && auth?.access_token && `journal-lines-${businessId}`;
|
|
13668
13680
|
const { data, isLoading, isValidating, error, mutate } = (0, import_swr9.default)(
|
|
13669
|
-
|
|
13681
|
+
queryKey,
|
|
13670
13682
|
Layer.getJournal(apiUrl, auth?.access_token, {
|
|
13671
13683
|
params: { businessId }
|
|
13672
13684
|
})
|
|
@@ -13890,12 +13902,12 @@ var useJournal = () => {
|
|
|
13890
13902
|
});
|
|
13891
13903
|
};
|
|
13892
13904
|
(0, import_react153.useEffect)(() => {
|
|
13893
|
-
if (isLoading || isValidating) {
|
|
13894
|
-
read("JOURNAL" /* JOURNAL
|
|
13905
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
13906
|
+
read("JOURNAL" /* JOURNAL */, queryKey);
|
|
13895
13907
|
}
|
|
13896
13908
|
}, [isLoading, isValidating]);
|
|
13897
13909
|
(0, import_react153.useEffect)(() => {
|
|
13898
|
-
if (hasBeenTouched(
|
|
13910
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
13899
13911
|
refetch();
|
|
13900
13912
|
}
|
|
13901
13913
|
}, [syncTimestamps]);
|
|
@@ -14579,8 +14591,9 @@ var import_swr10 = __toESM(require("swr"));
|
|
|
14579
14591
|
var useTasks = () => {
|
|
14580
14592
|
const [loadedStatus, setLoadedStatus] = (0, import_react162.useState)("initial");
|
|
14581
14593
|
const { auth, businessId, apiUrl, read, syncTimestamps, hasBeenTouched } = useLayerContext();
|
|
14594
|
+
const queryKey = businessId && auth?.access_token && `tasks-${businessId}`;
|
|
14582
14595
|
const { data, isLoading, isValidating, error, mutate } = (0, import_swr10.default)(
|
|
14583
|
-
|
|
14596
|
+
queryKey,
|
|
14584
14597
|
Layer.getTasks(apiUrl, auth?.access_token, {
|
|
14585
14598
|
params: { businessId }
|
|
14586
14599
|
})
|
|
@@ -14606,12 +14619,12 @@ var useTasks = () => {
|
|
|
14606
14619
|
}).then(() => refetch());
|
|
14607
14620
|
};
|
|
14608
14621
|
(0, import_react162.useEffect)(() => {
|
|
14609
|
-
if (isLoading || isValidating) {
|
|
14610
|
-
read("TASKS" /* TASKS
|
|
14622
|
+
if (queryKey && (isLoading || isValidating)) {
|
|
14623
|
+
read("TASKS" /* TASKS */, queryKey);
|
|
14611
14624
|
}
|
|
14612
14625
|
}, [isLoading, isValidating]);
|
|
14613
14626
|
(0, import_react162.useEffect)(() => {
|
|
14614
|
-
if (hasBeenTouched(
|
|
14627
|
+
if (queryKey && hasBeenTouched(queryKey)) {
|
|
14615
14628
|
refetch();
|
|
14616
14629
|
}
|
|
14617
14630
|
}, [syncTimestamps]);
|
|
@@ -14917,7 +14930,6 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
14917
14930
|
setCurrentPage(currentPage + 1);
|
|
14918
14931
|
}
|
|
14919
14932
|
};
|
|
14920
|
-
console.log("TasksList", { tasks, sortedTasks, currentPage });
|
|
14921
14933
|
return /* @__PURE__ */ import_react165.default.createElement("div", { className: "Layer__tasks-list" }, sortedTasks && sortedTasks.length > 0 ? /* @__PURE__ */ import_react165.default.createElement(import_react165.default.Fragment, null, sortedTasks.map((task, index) => /* @__PURE__ */ import_react165.default.createElement(
|
|
14922
14934
|
TasksListItem,
|
|
14923
14935
|
{
|
|
@@ -15452,7 +15464,6 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
15452
15464
|
showUnlinkItem = false,
|
|
15453
15465
|
showBreakConnection = false,
|
|
15454
15466
|
mode = "self-serve",
|
|
15455
|
-
hardRefreshPnlOnCategorize = false,
|
|
15456
15467
|
showDescriptions,
|
|
15457
15468
|
showReceiptUploads,
|
|
15458
15469
|
mobileComponent,
|
|
@@ -15475,7 +15486,6 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
15475
15486
|
showReceiptUploads,
|
|
15476
15487
|
mobileComponent,
|
|
15477
15488
|
mode,
|
|
15478
|
-
hardRefreshPnlOnCategorize,
|
|
15479
15489
|
stringOverrides: stringOverrides?.bankTransactions
|
|
15480
15490
|
}
|
|
15481
15491
|
));
|