@layerfi/components 0.1.114-alpha → 0.1.114-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +486 -478
- package/dist/esm/index.mjs +487 -479
- package/dist/index.css +2309 -1814
- package/dist/index.d.ts +11 -7
- package/package.json +1 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -65,7 +65,7 @@ import { Schema, pipe, BigDecimal, Option, Effect } from "effect";
|
|
|
65
65
|
import useSWRInfinite from "swr/infinite";
|
|
66
66
|
import { debounce, uniqBy, merge, uniqueId } from "lodash-es";
|
|
67
67
|
import useSWRMutation from "swr/mutation";
|
|
68
|
-
import { Button as Button$2, Menu as Menu$1, MenuItem as MenuItem$2, Header as Header$3, Label as Label$1, Text as Text$1, MenuTrigger, Popover as Popover$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Checkbox as Checkbox$1, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, Group, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, SearchField as SearchField$1, Input as Input$2, Switch as Switch$1, TextArea as TextArea$1,
|
|
68
|
+
import { Button as Button$2, Menu as Menu$1, MenuItem as MenuItem$2, Header as Header$3, Label as Label$1, Text as Text$1, MenuTrigger, Popover as Popover$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Checkbox as Checkbox$1, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, Group, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, SearchField as SearchField$1, Input as Input$2, GridListItem, GridList, Switch as Switch$1, TextArea as TextArea$1, DialogTrigger, Table as Table$2, Column as Column$1, Cell as Cell$1, TableHeader as TableHeader$1, TableBody as TableBody$2, Row as Row$1, Link as Link$3, Meter as Meter$1 } from "react-aria-components";
|
|
69
69
|
import useResizeObserver from "@react-hook/resize-observer";
|
|
70
70
|
import { mergeRefs } from "react-merge-refs";
|
|
71
71
|
import { UploadCloud as UploadCloud$1, LoaderCircle, X as X$1, Minus, Check as Check$1, TriangleAlert, ChevronDown as ChevronDown$1, Search, ChevronLeft as ChevronLeft$1, FileSpreadsheet, FileDownIcon, CopyIcon, RefreshCcw as RefreshCcw$1, ChevronRight as ChevronRight$1, MenuIcon, PencilRuler, SearchX, Trash2, CheckIcon, AlertCircle as AlertCircle$1, List, AlertTriangle, Save as Save$1, Calendar as Calendar$2, Download, Users, Milestone, Video, Clock as Clock$1, Link as Link$4, Plus as Plus$1, HandCoins, Trash as Trash$1, Menu as Menu$2, Send } from "lucide-react";
|
|
@@ -110,7 +110,7 @@ const LinkedAccountsContext = createContext({
|
|
|
110
110
|
setAccountsToAddOpeningBalanceInModal: () => {
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
const version = "0.1.114-alpha";
|
|
113
|
+
const version = "0.1.114-alpha.1";
|
|
114
114
|
const pkg = {
|
|
115
115
|
version
|
|
116
116
|
};
|
|
@@ -4759,7 +4759,7 @@ const ProfitAndLossReportSchema = Schema.Struct({
|
|
|
4759
4759
|
expenses: LineItemSchema,
|
|
4760
4760
|
taxes: LineItemSchema,
|
|
4761
4761
|
customLineItems: pipe(
|
|
4762
|
-
Schema.propertySignature(Schema.
|
|
4762
|
+
Schema.propertySignature(Schema.NullishOr(Schema.Array(LineItemSchema))),
|
|
4763
4763
|
Schema.fromKey("custom_line_items")
|
|
4764
4764
|
),
|
|
4765
4765
|
otherOutflows: pipe(
|
|
@@ -5882,6 +5882,10 @@ const getBankTransactionMatchAsSuggestedMatch = (bankTransaction) => {
|
|
|
5882
5882
|
}
|
|
5883
5883
|
return void 0;
|
|
5884
5884
|
};
|
|
5885
|
+
const getBankTransactionFirstSuggestedMatch = (bankTransaction) => {
|
|
5886
|
+
var _a, _b;
|
|
5887
|
+
return (_b = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) != null ? _b : (_a = bankTransaction == null ? void 0 : bankTransaction.suggested_matches) == null ? void 0 : _a[0];
|
|
5888
|
+
};
|
|
5885
5889
|
const IconButton = (_y) => {
|
|
5886
5890
|
var _z = _y, {
|
|
5887
5891
|
className,
|
|
@@ -8665,7 +8669,6 @@ const Popover = forwardRef(
|
|
|
8665
8669
|
const DATE_FORMAT$1 = "LLL d, yyyy";
|
|
8666
8670
|
const DATE_FORMAT_SHORT = "M/d/yyyy";
|
|
8667
8671
|
const DATE_FORMAT_WITH_TIME_READABLE = "LLLL do, yyyy 'at' h:mm a";
|
|
8668
|
-
const MONTH_DAY_FORMAT = "LLL d";
|
|
8669
8672
|
const TIME_FORMAT = "p";
|
|
8670
8673
|
const BREAKPOINTS = {
|
|
8671
8674
|
TABLET: 760,
|
|
@@ -11706,7 +11709,7 @@ const MatchBadge = ({
|
|
|
11706
11709
|
}
|
|
11707
11710
|
return;
|
|
11708
11711
|
};
|
|
11709
|
-
const MatchForm
|
|
11712
|
+
const MatchForm = ({
|
|
11710
11713
|
classNamePrefix,
|
|
11711
11714
|
bankTransaction,
|
|
11712
11715
|
selectedMatchId,
|
|
@@ -12601,14 +12604,12 @@ const MoneySpan = forwardRef(
|
|
|
12601
12604
|
var _xb = _wb, { amount, bold, size, displayPlusSign, className } = _xb, restProps = __objRest(_xb, ["amount", "bold", "size", "displayPlusSign", "className"]);
|
|
12602
12605
|
const dataProperties = toDataProperties({
|
|
12603
12606
|
bold,
|
|
12604
|
-
positive: amount >= 0,
|
|
12605
|
-
negative: amount < 0,
|
|
12606
|
-
size
|
|
12607
|
+
"positive": amount >= 0,
|
|
12608
|
+
"negative": amount < 0,
|
|
12609
|
+
size,
|
|
12610
|
+
"display-plus-sign": displayPlusSign
|
|
12607
12611
|
});
|
|
12608
|
-
return /* @__PURE__ */
|
|
12609
|
-
displayPlusSign && "+",
|
|
12610
|
-
centsToDollars(Math.abs(amount))
|
|
12611
|
-
] }));
|
|
12612
|
+
return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$8, className), ref, children: centsToDollars(Math.abs(amount)) }));
|
|
12612
12613
|
}
|
|
12613
12614
|
);
|
|
12614
12615
|
MoneySpan.displayName = "MoneySpan";
|
|
@@ -13214,7 +13215,6 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13214
13215
|
showDescriptions,
|
|
13215
13216
|
showReceiptUploads
|
|
13216
13217
|
}, ref) => {
|
|
13217
|
-
var _a, _b;
|
|
13218
13218
|
const {
|
|
13219
13219
|
categorize: categorizeBankTransaction2,
|
|
13220
13220
|
match: matchBankTransaction2
|
|
@@ -13232,7 +13232,7 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13232
13232
|
/* categorize */
|
|
13233
13233
|
);
|
|
13234
13234
|
const [selectedMatch, setSelectedMatch] = useState(
|
|
13235
|
-
(
|
|
13235
|
+
getBankTransactionFirstSuggestedMatch(bankTransaction)
|
|
13236
13236
|
);
|
|
13237
13237
|
const [matchFormError, setMatchFormError] = useState();
|
|
13238
13238
|
const bodyRef = useRef(null);
|
|
@@ -13295,12 +13295,12 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13295
13295
|
}
|
|
13296
13296
|
};
|
|
13297
13297
|
const save = () => __async(null, null, function* () {
|
|
13298
|
-
var
|
|
13298
|
+
var _a;
|
|
13299
13299
|
if (purpose === "match") {
|
|
13300
13300
|
if (!selectedMatch) {
|
|
13301
13301
|
setMatchFormError("Select an option to match the transaction");
|
|
13302
13302
|
return;
|
|
13303
|
-
} else if (selectedMatch && selectedMatch.id !== ((
|
|
13303
|
+
} else if (selectedMatch && selectedMatch.id !== ((_a = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a.id)) {
|
|
13304
13304
|
yield onMatchSubmit(selectedMatch.id);
|
|
13305
13305
|
return;
|
|
13306
13306
|
}
|
|
@@ -13320,8 +13320,8 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13320
13320
|
save
|
|
13321
13321
|
}));
|
|
13322
13322
|
const onMatchSubmit = (matchId) => __async(null, null, function* () {
|
|
13323
|
-
var
|
|
13324
|
-
const foundMatch = (
|
|
13323
|
+
var _a;
|
|
13324
|
+
const foundMatch = (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.find(
|
|
13325
13325
|
(x) => x.id === matchId
|
|
13326
13326
|
);
|
|
13327
13327
|
if (!foundMatch) {
|
|
@@ -13377,7 +13377,7 @@ const ExpandedBankTransactionRow = forwardRef(
|
|
|
13377
13377
|
purpose === "match" ? `${className}__content-panel--active` : ""
|
|
13378
13378
|
),
|
|
13379
13379
|
children: /* @__PURE__ */ jsx("div", { className: `${className}__content-panel-container`, children: /* @__PURE__ */ jsx(
|
|
13380
|
-
MatchForm
|
|
13380
|
+
MatchForm,
|
|
13381
13381
|
{
|
|
13382
13382
|
classNamePrefix: className,
|
|
13383
13383
|
bankTransaction,
|
|
@@ -13971,10 +13971,14 @@ const BankTransactionRow = ({
|
|
|
13971
13971
|
__spreadProps(__spreadValues(__spreadValues({
|
|
13972
13972
|
className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
|
|
13973
13973
|
}, openRow), showReceiptDataProperties), {
|
|
13974
|
-
children: /* @__PURE__ */
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13974
|
+
children: /* @__PURE__ */ jsx(
|
|
13975
|
+
MoneySpan,
|
|
13976
|
+
{
|
|
13977
|
+
amount: bankTransaction.amount,
|
|
13978
|
+
displayPlusSign: isCredit(bankTransaction),
|
|
13979
|
+
className: "Layer__table-cell-content"
|
|
13980
|
+
}
|
|
13981
|
+
)
|
|
13978
13982
|
})
|
|
13979
13983
|
),
|
|
13980
13984
|
/* @__PURE__ */ jsx(
|
|
@@ -14145,6 +14149,39 @@ const normalizeFromBankTransaction = (bankTransaction) => {
|
|
|
14145
14149
|
label: (_e = (_d = bankTransaction.category) == null ? void 0 : _d.display_name) != null ? _e : ""
|
|
14146
14150
|
};
|
|
14147
14151
|
};
|
|
14152
|
+
const DATE_FORMAT = "LLL d";
|
|
14153
|
+
const BankTransactionsAmountDate = ({ amount, date, slotProps }) => {
|
|
14154
|
+
return /* @__PURE__ */ jsxs(
|
|
14155
|
+
VStack,
|
|
14156
|
+
{
|
|
14157
|
+
align: "end",
|
|
14158
|
+
gap: "3xs",
|
|
14159
|
+
pb: "sm",
|
|
14160
|
+
children: [
|
|
14161
|
+
/* @__PURE__ */ jsx(HStack, { children: /* @__PURE__ */ jsx(
|
|
14162
|
+
MoneySpan,
|
|
14163
|
+
__spreadValues({
|
|
14164
|
+
amount
|
|
14165
|
+
}, slotProps == null ? void 0 : slotProps.MoneySpan)
|
|
14166
|
+
) }),
|
|
14167
|
+
/* @__PURE__ */ jsx(
|
|
14168
|
+
DateTime,
|
|
14169
|
+
{
|
|
14170
|
+
value: date,
|
|
14171
|
+
dateFormat: DATE_FORMAT,
|
|
14172
|
+
onlyDate: true,
|
|
14173
|
+
slotProps: {
|
|
14174
|
+
Date: __spreadValues({
|
|
14175
|
+
variant: "subtle",
|
|
14176
|
+
size: "sm"
|
|
14177
|
+
}, slotProps == null ? void 0 : slotProps.DateTime)
|
|
14178
|
+
}
|
|
14179
|
+
}
|
|
14180
|
+
)
|
|
14181
|
+
]
|
|
14182
|
+
}
|
|
14183
|
+
);
|
|
14184
|
+
};
|
|
14148
14185
|
const BankTransactionsListItem = ({
|
|
14149
14186
|
index,
|
|
14150
14187
|
dateFormat,
|
|
@@ -14253,11 +14290,14 @@ const BankTransactionsListItem = ({
|
|
|
14253
14290
|
/* @__PURE__ */ jsx(Span, { withTooltip: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description })
|
|
14254
14291
|
] }),
|
|
14255
14292
|
/* @__PURE__ */ jsx(
|
|
14256
|
-
|
|
14293
|
+
BankTransactionsAmountDate,
|
|
14257
14294
|
{
|
|
14258
|
-
className: `Layer__bank-transaction-list-item__amount-${isCredit(bankTransaction) ? "credit" : "debit"}`,
|
|
14259
14295
|
amount: bankTransaction.amount,
|
|
14260
|
-
|
|
14296
|
+
date: bankTransaction.date,
|
|
14297
|
+
slotProps: {
|
|
14298
|
+
MoneySpan: { size: "md", displayPlusSign: isCredit(bankTransaction) },
|
|
14299
|
+
DateTime: { size: "sm" }
|
|
14300
|
+
}
|
|
14261
14301
|
}
|
|
14262
14302
|
)
|
|
14263
14303
|
] }),
|
|
@@ -14290,8 +14330,7 @@ const BankTransactionsListItem = ({
|
|
|
14290
14330
|
},
|
|
14291
14331
|
isLoading: bankTransaction.processing
|
|
14292
14332
|
}
|
|
14293
|
-
) :
|
|
14294
|
-
categorized ? /* @__PURE__ */ jsx(
|
|
14333
|
+
) : categorized ? /* @__PURE__ */ jsx(
|
|
14295
14334
|
BankTransactionsCategorizedSelectedValue,
|
|
14296
14335
|
{
|
|
14297
14336
|
bankTransaction
|
|
@@ -14436,53 +14475,76 @@ const BankTransactionsList = ({
|
|
|
14436
14475
|
) })
|
|
14437
14476
|
] });
|
|
14438
14477
|
};
|
|
14439
|
-
const
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14443
|
-
|
|
14444
|
-
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
}, props), {
|
|
14448
|
-
width: size,
|
|
14449
|
-
height: size,
|
|
14450
|
-
children: [
|
|
14451
|
-
/* @__PURE__ */ jsx(
|
|
14452
|
-
"path",
|
|
14453
|
-
{
|
|
14454
|
-
d: "M8.75 3.25L3.25 8.75",
|
|
14455
|
-
stroke: "currentColor",
|
|
14456
|
-
strokeLinecap: "round",
|
|
14457
|
-
strokeLinejoin: "round"
|
|
14458
|
-
}
|
|
14459
|
-
),
|
|
14460
|
-
/* @__PURE__ */ jsx(
|
|
14461
|
-
"path",
|
|
14462
|
-
{
|
|
14463
|
-
d: "M3.25 3.25L8.75 8.75",
|
|
14464
|
-
stroke: "currentColor",
|
|
14465
|
-
strokeLinecap: "round",
|
|
14466
|
-
strokeLinejoin: "round"
|
|
14467
|
-
}
|
|
14468
|
-
)
|
|
14469
|
-
]
|
|
14470
|
-
})
|
|
14471
|
-
);
|
|
14478
|
+
const useTransactionToOpen = () => {
|
|
14479
|
+
const [transactionIdToOpen, setTransactionIdToOpen] = useState(void 0);
|
|
14480
|
+
const clearTransactionIdToOpen = useCallback(() => setTransactionIdToOpen(void 0), []);
|
|
14481
|
+
return {
|
|
14482
|
+
transactionIdToOpen,
|
|
14483
|
+
setTransactionIdToOpen,
|
|
14484
|
+
clearTransactionIdToOpen
|
|
14485
|
+
};
|
|
14472
14486
|
};
|
|
14473
|
-
const
|
|
14474
|
-
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14487
|
+
const TransactionToOpenContext = createContext({
|
|
14488
|
+
transactionIdToOpen: void 0,
|
|
14489
|
+
setTransactionIdToOpen: () => void 0,
|
|
14490
|
+
clearTransactionIdToOpen: () => void 0
|
|
14491
|
+
});
|
|
14492
|
+
const BankTransactionsMobileListItemCheckbox = ({
|
|
14493
|
+
bulkActionsEnabled,
|
|
14494
|
+
bankTransaction,
|
|
14495
|
+
checkboxContainerRef
|
|
14496
|
+
}) => {
|
|
14497
|
+
const internalRef = useRef(null);
|
|
14498
|
+
const ref = checkboxContainerRef || internalRef;
|
|
14499
|
+
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
14500
|
+
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
14501
|
+
const { select, deselect } = useBulkSelectionActions();
|
|
14502
|
+
const isSelected = useIdIsSelected();
|
|
14503
|
+
const isTransactionSelected = isSelected(bankTransaction.id);
|
|
14504
|
+
if (!categorizationEnabled || !bulkActionsEnabled) {
|
|
14505
|
+
return null;
|
|
14506
|
+
}
|
|
14507
|
+
return /* @__PURE__ */ jsx(VStack, { align: "start", pis: "md", pie: "2xs", ref, children: /* @__PURE__ */ jsx(
|
|
14508
|
+
Checkbox,
|
|
14509
|
+
{
|
|
14510
|
+
size: "md",
|
|
14511
|
+
isSelected: isTransactionSelected,
|
|
14512
|
+
onChange: (selected) => {
|
|
14513
|
+
if (selected) {
|
|
14514
|
+
select(bankTransaction.id);
|
|
14515
|
+
} else {
|
|
14516
|
+
deselect(bankTransaction.id);
|
|
14517
|
+
}
|
|
14518
|
+
}
|
|
14519
|
+
}
|
|
14520
|
+
) });
|
|
14521
|
+
};
|
|
14522
|
+
const BankTransactionsMobileListItemCategory = ({
|
|
14523
|
+
bankTransaction
|
|
14524
|
+
}) => {
|
|
14525
|
+
const categorized = isCategorized(bankTransaction);
|
|
14526
|
+
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
14527
|
+
if (categorized) {
|
|
14528
|
+
return /* @__PURE__ */ jsx(
|
|
14529
|
+
BankTransactionsCategorizedSelectedValue,
|
|
14530
|
+
{
|
|
14531
|
+
bankTransaction,
|
|
14532
|
+
className: "Layer__bankTransactionsMobileListItemCategory",
|
|
14533
|
+
slotProps: { Label: { size: "sm" } }
|
|
14534
|
+
}
|
|
14535
|
+
);
|
|
14536
|
+
}
|
|
14537
|
+
return selectedCategory ? /* @__PURE__ */ jsx(
|
|
14538
|
+
BankTransactionsUncategorizedSelectedValue,
|
|
14539
|
+
{
|
|
14540
|
+
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
14541
|
+
className: "Layer__bankTransactionsMobileListItemCategory",
|
|
14542
|
+
slotProps: { Label: { size: "sm" } }
|
|
14543
|
+
}
|
|
14544
|
+
) : /* @__PURE__ */ jsx(Span, { ellipsis: true, className: "Layer__bankTransactionsMobileListItemCategory", size: "sm", children: "No category selected" });
|
|
14483
14545
|
};
|
|
14484
|
-
const Paperclip = (
|
|
14485
|
-
var
|
|
14546
|
+
const Paperclip = (_Cb) => {
|
|
14547
|
+
var _Db = _Cb, { size = 20 } = _Db, props = __objRest(_Db, ["size"]);
|
|
14486
14548
|
return /* @__PURE__ */ jsx(
|
|
14487
14549
|
"svg",
|
|
14488
14550
|
__spreadProps(__spreadValues({
|
|
@@ -14577,8 +14639,8 @@ const flattenCategories = (categories) => {
|
|
|
14577
14639
|
return leafCategories.map((cat) => new CategoryAsOption(cat));
|
|
14578
14640
|
});
|
|
14579
14641
|
};
|
|
14580
|
-
const X = (
|
|
14581
|
-
var
|
|
14642
|
+
const X = (_Eb) => {
|
|
14643
|
+
var _Fb = _Eb, { size = 18 } = _Fb, props = __objRest(_Fb, ["size"]);
|
|
14582
14644
|
return /* @__PURE__ */ jsxs(
|
|
14583
14645
|
"svg",
|
|
14584
14646
|
__spreadProps(__spreadValues({
|
|
@@ -14612,11 +14674,11 @@ const X = (_Ib) => {
|
|
|
14612
14674
|
);
|
|
14613
14675
|
};
|
|
14614
14676
|
const CLASS_NAME$7 = "Layer__MinimalSearchField";
|
|
14615
|
-
function MinimalSearchField(
|
|
14616
|
-
var
|
|
14677
|
+
function MinimalSearchField(_Gb) {
|
|
14678
|
+
var _Hb = _Gb, {
|
|
14617
14679
|
placeholder,
|
|
14618
14680
|
isDisabled
|
|
14619
|
-
} =
|
|
14681
|
+
} = _Hb, restProps = __objRest(_Hb, [
|
|
14620
14682
|
"placeholder",
|
|
14621
14683
|
"isDisabled"
|
|
14622
14684
|
]);
|
|
@@ -14632,8 +14694,8 @@ function MinimalSearchField(_Kb) {
|
|
|
14632
14694
|
] }));
|
|
14633
14695
|
}
|
|
14634
14696
|
const CLASS_NAME$6 = "Layer__SearchField";
|
|
14635
|
-
function SearchField(
|
|
14636
|
-
var
|
|
14697
|
+
function SearchField(_Ib) {
|
|
14698
|
+
var _Jb = _Ib, { slot = "search", className, label, isDisabled } = _Jb, restProps = __objRest(_Jb, ["slot", "className", "label", "isDisabled"]);
|
|
14637
14699
|
const combinedClassName = classNames(CLASS_NAME$6, className);
|
|
14638
14700
|
return /* @__PURE__ */ jsxs(InputGroup, { slot, className: combinedClassName, children: [
|
|
14639
14701
|
/* @__PURE__ */ jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsx(Search, { size: 14 }) }),
|
|
@@ -14650,7 +14712,7 @@ function SearchField(_Mb) {
|
|
|
14650
14712
|
const isGroup = (item) => {
|
|
14651
14713
|
return "categories" in item;
|
|
14652
14714
|
};
|
|
14653
|
-
const
|
|
14715
|
+
const BankTransactionsMobileListBusinessCategories = ({
|
|
14654
14716
|
select,
|
|
14655
14717
|
selectedId,
|
|
14656
14718
|
showTooltips
|
|
@@ -14725,7 +14787,7 @@ const CategorySelectDrawer = ({
|
|
|
14725
14787
|
onOpenChange
|
|
14726
14788
|
}) => {
|
|
14727
14789
|
return /* @__PURE__ */ jsx(Drawer, { isOpen, onOpenChange, variant: "mobile-drawer", isDismissable: true, children: ({ close: close2 }) => /* @__PURE__ */ jsx(
|
|
14728
|
-
|
|
14790
|
+
BankTransactionsMobileListBusinessCategories,
|
|
14729
14791
|
{
|
|
14730
14792
|
select: (option) => {
|
|
14731
14793
|
onSelect(option);
|
|
@@ -14736,7 +14798,7 @@ const CategorySelectDrawer = ({
|
|
|
14736
14798
|
}
|
|
14737
14799
|
) });
|
|
14738
14800
|
};
|
|
14739
|
-
const
|
|
14801
|
+
const BankTransactionsMobileListBusinessForm = ({
|
|
14740
14802
|
bankTransaction,
|
|
14741
14803
|
showCategorization,
|
|
14742
14804
|
showDescriptions,
|
|
@@ -14912,7 +14974,7 @@ const isAlreadyAssigned = (bankTransaction) => {
|
|
|
14912
14974
|
)
|
|
14913
14975
|
);
|
|
14914
14976
|
};
|
|
14915
|
-
const
|
|
14977
|
+
const BankTransactionsMobileListPersonalForm = ({
|
|
14916
14978
|
bankTransaction,
|
|
14917
14979
|
showReceiptUploads,
|
|
14918
14980
|
showDescriptions,
|
|
@@ -14988,92 +15050,89 @@ const PersonalForm = ({
|
|
|
14988
15050
|
fullWidth: true,
|
|
14989
15051
|
disabled: alreadyAssigned || isLoading || bankTransaction.processing,
|
|
14990
15052
|
onClick: save,
|
|
14991
|
-
children: isLoading || bankTransaction.processing ? "
|
|
15053
|
+
children: isLoading || bankTransaction.processing ? "Confirming..." : alreadyAssigned ? "Confirmed" : "Confirm"
|
|
14992
15054
|
}
|
|
14993
15055
|
) : null
|
|
14994
15056
|
] }),
|
|
14995
15057
|
bankTransaction.error && showRetry ? /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
14996
15058
|
] });
|
|
14997
15059
|
};
|
|
15060
|
+
const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
|
|
15061
|
+
return /* @__PURE__ */ jsx(
|
|
15062
|
+
GridListItem,
|
|
15063
|
+
{
|
|
15064
|
+
id: match.id,
|
|
15065
|
+
textValue: match.details.description,
|
|
15066
|
+
children: /* @__PURE__ */ jsxs(HStack, { gap: "md", pis: "md", children: [
|
|
15067
|
+
/* @__PURE__ */ jsx(
|
|
15068
|
+
Checkbox,
|
|
15069
|
+
{
|
|
15070
|
+
slot: "selection",
|
|
15071
|
+
variant: "round"
|
|
15072
|
+
}
|
|
15073
|
+
),
|
|
15074
|
+
/* @__PURE__ */ jsx(Span, { ellipsis: true, pbs: "sm", size: "sm", children: match.details.description }),
|
|
15075
|
+
/* @__PURE__ */ jsx(
|
|
15076
|
+
BankTransactionsAmountDate,
|
|
15077
|
+
{
|
|
15078
|
+
amount: match.details.amount,
|
|
15079
|
+
date: match.details.date,
|
|
15080
|
+
slotProps: {
|
|
15081
|
+
MoneySpan: { size: "sm", displayPlusSign: isCredit(bankTransaction) },
|
|
15082
|
+
DateTime: { size: "xs" }
|
|
15083
|
+
}
|
|
15084
|
+
}
|
|
15085
|
+
),
|
|
15086
|
+
/* @__PURE__ */ jsx(HStack, { children: inAppLink })
|
|
15087
|
+
] })
|
|
15088
|
+
},
|
|
15089
|
+
match.id
|
|
15090
|
+
);
|
|
15091
|
+
};
|
|
14998
15092
|
const MatchFormMobile = ({
|
|
14999
|
-
classNamePrefix,
|
|
15000
15093
|
bankTransaction,
|
|
15001
15094
|
selectedMatchId,
|
|
15002
15095
|
setSelectedMatch,
|
|
15003
15096
|
matchFormError,
|
|
15004
15097
|
readOnly
|
|
15005
15098
|
}) => {
|
|
15006
|
-
var _a;
|
|
15007
15099
|
const { renderInAppLink } = useInAppLinkContext();
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
|
|
15023
|
-
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15030
|
-
|
|
15031
|
-
|
|
15032
|
-
|
|
15033
|
-
|
|
15034
|
-
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
|
|
15040
|
-
|
|
15041
|
-
|
|
15042
|
-
"$",
|
|
15043
|
-
centsToDollars(match.details.amount)
|
|
15044
|
-
]
|
|
15045
|
-
}
|
|
15046
|
-
)
|
|
15047
|
-
] }),
|
|
15048
|
-
/* @__PURE__ */ jsxs("div", { className: `${classNamePrefix}__match-item__details`, children: [
|
|
15049
|
-
/* @__PURE__ */ jsx(HStack, { children: inAppLink }),
|
|
15050
|
-
/* @__PURE__ */ jsx(
|
|
15051
|
-
Text,
|
|
15052
|
-
{
|
|
15053
|
-
className: `${classNamePrefix}__match-item__date`,
|
|
15054
|
-
size: TextSize.sm,
|
|
15055
|
-
as: "span",
|
|
15056
|
-
children: format(parseISO(match.details.date), MONTH_DAY_FORMAT)
|
|
15057
|
-
}
|
|
15058
|
-
)
|
|
15059
|
-
] })
|
|
15060
|
-
] }),
|
|
15061
|
-
/* @__PURE__ */ jsx("div", { className: `${classNamePrefix}__match-item__col-status`, children: selectedMatchId && selectedMatchId === match.id ? /* @__PURE__ */ jsx(
|
|
15062
|
-
Check,
|
|
15063
|
-
{
|
|
15064
|
-
size: 16,
|
|
15065
|
-
className: `${classNamePrefix}__match-item__selected-icon`
|
|
15066
|
-
}
|
|
15067
|
-
) : null })
|
|
15068
|
-
]
|
|
15069
|
-
},
|
|
15070
|
-
idx
|
|
15071
|
-
);
|
|
15072
|
-
}),
|
|
15073
|
-
matchFormError && /* @__PURE__ */ jsx(ErrorText, { children: matchFormError })
|
|
15074
|
-
] });
|
|
15100
|
+
const suggestedMatches = bankTransaction.suggested_matches;
|
|
15101
|
+
return /* @__PURE__ */ jsxs(
|
|
15102
|
+
GridList,
|
|
15103
|
+
{
|
|
15104
|
+
"aria-label": "Select a match",
|
|
15105
|
+
selectionMode: "single",
|
|
15106
|
+
selectedKeys: selectedMatchId ? /* @__PURE__ */ new Set([selectedMatchId]) : /* @__PURE__ */ new Set(),
|
|
15107
|
+
onSelectionChange: (keys) => {
|
|
15108
|
+
if (readOnly) return;
|
|
15109
|
+
const selectedKey = [...keys][0];
|
|
15110
|
+
const selectedMatch = suggestedMatches == null ? void 0 : suggestedMatches.find((m) => m.id === selectedKey);
|
|
15111
|
+
if (selectedMatch) {
|
|
15112
|
+
setSelectedMatch(selectedMatch);
|
|
15113
|
+
}
|
|
15114
|
+
},
|
|
15115
|
+
className: "Layer__MatchFormMobile",
|
|
15116
|
+
children: [
|
|
15117
|
+
suggestedMatches == null ? void 0 : suggestedMatches.map((match) => {
|
|
15118
|
+
const matchDetails = match.details ? decodeMatchDetails(match.details) : void 0;
|
|
15119
|
+
const inAppLink = renderInAppLink && matchDetails ? renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails)) : null;
|
|
15120
|
+
return /* @__PURE__ */ jsx(
|
|
15121
|
+
MatchFormMobileItem,
|
|
15122
|
+
{
|
|
15123
|
+
match,
|
|
15124
|
+
bankTransaction,
|
|
15125
|
+
inAppLink
|
|
15126
|
+
},
|
|
15127
|
+
match.id
|
|
15128
|
+
);
|
|
15129
|
+
}),
|
|
15130
|
+
matchFormError && /* @__PURE__ */ jsx(ErrorText, { children: matchFormError })
|
|
15131
|
+
]
|
|
15132
|
+
}
|
|
15133
|
+
);
|
|
15075
15134
|
};
|
|
15076
|
-
const
|
|
15135
|
+
const BankTransactionsMobileListMatchForm = ({
|
|
15077
15136
|
bankTransaction,
|
|
15078
15137
|
showReceiptUploads,
|
|
15079
15138
|
showDescriptions,
|
|
@@ -15083,7 +15142,7 @@ const MatchForm = ({
|
|
|
15083
15142
|
const receiptsRef = useRef(null);
|
|
15084
15143
|
const { match: matchBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
15085
15144
|
const [selectedMatch, setSelectedMatch] = useState(
|
|
15086
|
-
|
|
15145
|
+
getBankTransactionFirstSuggestedMatch(bankTransaction)
|
|
15087
15146
|
);
|
|
15088
15147
|
const [formError, setFormError] = useState();
|
|
15089
15148
|
const showRetry = Boolean(bankTransaction.error);
|
|
@@ -15109,12 +15168,11 @@ const MatchForm = ({
|
|
|
15109
15168
|
}
|
|
15110
15169
|
return;
|
|
15111
15170
|
});
|
|
15112
|
-
return /* @__PURE__ */ jsxs("
|
|
15113
|
-
/* @__PURE__ */ jsx(
|
|
15171
|
+
return /* @__PURE__ */ jsxs(VStack, { pi: "md", children: [
|
|
15172
|
+
/* @__PURE__ */ jsx(Span, { size: "sm", weight: "bold", children: "Find Match" }),
|
|
15114
15173
|
/* @__PURE__ */ jsx(
|
|
15115
15174
|
MatchFormMobile,
|
|
15116
15175
|
{
|
|
15117
|
-
classNamePrefix: "Layer__bank-transaction-mobile-list-item",
|
|
15118
15176
|
readOnly: !showCategorization,
|
|
15119
15177
|
bankTransaction,
|
|
15120
15178
|
selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
|
|
@@ -15221,7 +15279,7 @@ const CategorySelectDrawerWithTrigger = ({
|
|
|
15221
15279
|
)
|
|
15222
15280
|
] });
|
|
15223
15281
|
};
|
|
15224
|
-
const
|
|
15282
|
+
const BankTransactionsMobileListSplitForm = ({
|
|
15225
15283
|
bankTransaction,
|
|
15226
15284
|
showTooltips,
|
|
15227
15285
|
showCategorization,
|
|
@@ -15367,14 +15425,14 @@ const SplitForm = ({
|
|
|
15367
15425
|
fullWidth: true,
|
|
15368
15426
|
onClick: () => void save(),
|
|
15369
15427
|
disabled: isLoading || bankTransaction.processing,
|
|
15370
|
-
children: isLoading || bankTransaction.processing ? "
|
|
15428
|
+
children: isLoading || bankTransaction.processing ? "Confirming..." : "Confirm"
|
|
15371
15429
|
}
|
|
15372
15430
|
)
|
|
15373
15431
|
] }),
|
|
15374
15432
|
bankTransaction.error && showRetry ? /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
15375
15433
|
] });
|
|
15376
15434
|
};
|
|
15377
|
-
const
|
|
15435
|
+
const BankTransactionsMobileListSplitAndMatchForm = ({
|
|
15378
15436
|
bankTransaction,
|
|
15379
15437
|
showTooltips,
|
|
15380
15438
|
showReceiptUploads,
|
|
@@ -15388,7 +15446,7 @@ const SplitAndMatchForm = ({
|
|
|
15388
15446
|
);
|
|
15389
15447
|
return /* @__PURE__ */ jsxs("div", { className: "Layer__bank-transaction-mobile-list-item__split-and-match-form", children: [
|
|
15390
15448
|
formType === "categorize" && /* @__PURE__ */ jsx(
|
|
15391
|
-
|
|
15449
|
+
BankTransactionsMobileListSplitForm,
|
|
15392
15450
|
{
|
|
15393
15451
|
bankTransaction,
|
|
15394
15452
|
showTooltips,
|
|
@@ -15398,7 +15456,7 @@ const SplitAndMatchForm = ({
|
|
|
15398
15456
|
}
|
|
15399
15457
|
),
|
|
15400
15458
|
formType === "match" && /* @__PURE__ */ jsx(
|
|
15401
|
-
|
|
15459
|
+
BankTransactionsMobileListMatchForm,
|
|
15402
15460
|
{
|
|
15403
15461
|
bankTransaction,
|
|
15404
15462
|
showReceiptUploads,
|
|
@@ -15416,7 +15474,7 @@ const SplitAndMatchForm = ({
|
|
|
15416
15474
|
), children: "or find match" }) }) : null
|
|
15417
15475
|
] });
|
|
15418
15476
|
};
|
|
15419
|
-
const
|
|
15477
|
+
const BankTransactionsMobileForms = ({
|
|
15420
15478
|
purpose,
|
|
15421
15479
|
bankTransaction,
|
|
15422
15480
|
showTooltips,
|
|
@@ -15429,7 +15487,7 @@ const BankTransactionMobileForms = ({
|
|
|
15429
15487
|
switch (purpose) {
|
|
15430
15488
|
case Purpose.business:
|
|
15431
15489
|
return /* @__PURE__ */ jsx(
|
|
15432
|
-
|
|
15490
|
+
BankTransactionsMobileListBusinessForm,
|
|
15433
15491
|
{
|
|
15434
15492
|
bankTransaction,
|
|
15435
15493
|
showCategorization,
|
|
@@ -15440,7 +15498,7 @@ const BankTransactionMobileForms = ({
|
|
|
15440
15498
|
);
|
|
15441
15499
|
case Purpose.personal:
|
|
15442
15500
|
return /* @__PURE__ */ jsx(
|
|
15443
|
-
|
|
15501
|
+
BankTransactionsMobileListPersonalForm,
|
|
15444
15502
|
{
|
|
15445
15503
|
bankTransaction,
|
|
15446
15504
|
showReceiptUploads,
|
|
@@ -15450,7 +15508,7 @@ const BankTransactionMobileForms = ({
|
|
|
15450
15508
|
);
|
|
15451
15509
|
case Purpose.more:
|
|
15452
15510
|
return /* @__PURE__ */ jsx(
|
|
15453
|
-
|
|
15511
|
+
BankTransactionsMobileListSplitAndMatchForm,
|
|
15454
15512
|
{
|
|
15455
15513
|
bankTransaction,
|
|
15456
15514
|
showCategorization,
|
|
@@ -15465,73 +15523,67 @@ const BankTransactionMobileForms = ({
|
|
|
15465
15523
|
};
|
|
15466
15524
|
return /* @__PURE__ */ jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: /* @__PURE__ */ jsx("div", { className: "Layer__bank-transaction-mobile-list-item__form-container", children: getContent() }) });
|
|
15467
15525
|
};
|
|
15468
|
-
const
|
|
15469
|
-
|
|
15470
|
-
|
|
15471
|
-
|
|
15472
|
-
|
|
15473
|
-
|
|
15474
|
-
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
|
|
15480
|
-
|
|
15481
|
-
|
|
15482
|
-
|
|
15483
|
-
|
|
15526
|
+
const PURPOSE_TOGGLE_OPTIONS = [
|
|
15527
|
+
{
|
|
15528
|
+
value: "business",
|
|
15529
|
+
label: "Business",
|
|
15530
|
+
style: { minWidth: 84 }
|
|
15531
|
+
},
|
|
15532
|
+
{
|
|
15533
|
+
value: "personal",
|
|
15534
|
+
label: "Personal",
|
|
15535
|
+
style: { minWidth: 84 }
|
|
15536
|
+
},
|
|
15537
|
+
{
|
|
15538
|
+
value: "more",
|
|
15539
|
+
label: "More",
|
|
15540
|
+
style: { minWidth: 84 }
|
|
15541
|
+
}
|
|
15542
|
+
];
|
|
15543
|
+
const BankTransactionsMobileListItemExpandedRow = ({
|
|
15484
15544
|
bankTransaction,
|
|
15485
|
-
|
|
15545
|
+
showCategorization,
|
|
15546
|
+
showDescriptions,
|
|
15547
|
+
showReceiptUploads,
|
|
15548
|
+
showTooltips
|
|
15486
15549
|
}) => {
|
|
15487
|
-
const
|
|
15488
|
-
const
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
Checkbox,
|
|
15499
|
-
{
|
|
15500
|
-
size: "md",
|
|
15501
|
-
isSelected: isTransactionSelected,
|
|
15502
|
-
onChange: (selected) => {
|
|
15503
|
-
if (selected) {
|
|
15504
|
-
select(bankTransaction.id);
|
|
15505
|
-
} else {
|
|
15506
|
-
deselect(bankTransaction.id);
|
|
15507
|
-
}
|
|
15550
|
+
const [purpose, setPurpose] = useState(getInitialPurpose(bankTransaction));
|
|
15551
|
+
const onChangePurpose = (event) => setPurpose(event.target.value);
|
|
15552
|
+
return /* @__PURE__ */ jsx("div", { className: "Layer__bank-transaction-mobile-list-item__expanded-row", children: /* @__PURE__ */ jsxs(VStack, { pb: "md", justify: "space-between", align: "center", children: [
|
|
15553
|
+
showCategorization ? /* @__PURE__ */ jsx(HStack, { align: "center", justify: "space-between", children: /* @__PURE__ */ jsx(
|
|
15554
|
+
Toggle,
|
|
15555
|
+
{
|
|
15556
|
+
name: `purpose-${bankTransaction.id}`,
|
|
15557
|
+
size: ToggleSize.medium,
|
|
15558
|
+
options: PURPOSE_TOGGLE_OPTIONS,
|
|
15559
|
+
selected: purpose,
|
|
15560
|
+
onChange: onChangePurpose
|
|
15508
15561
|
}
|
|
15509
|
-
}
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
const BankTransactionsMobileListItemCategory = ({
|
|
15513
|
-
bankTransaction
|
|
15514
|
-
}) => {
|
|
15515
|
-
const categorized = isCategorized(bankTransaction);
|
|
15516
|
-
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
15517
|
-
if (categorized) {
|
|
15518
|
-
return /* @__PURE__ */ jsx(
|
|
15519
|
-
BankTransactionsCategorizedSelectedValue,
|
|
15562
|
+
) }) : null,
|
|
15563
|
+
/* @__PURE__ */ jsx(
|
|
15564
|
+
BankTransactionsMobileForms,
|
|
15520
15565
|
{
|
|
15566
|
+
purpose,
|
|
15521
15567
|
bankTransaction,
|
|
15522
|
-
|
|
15523
|
-
|
|
15568
|
+
showCategorization,
|
|
15569
|
+
showDescriptions,
|
|
15570
|
+
showReceiptUploads,
|
|
15571
|
+
showTooltips
|
|
15524
15572
|
}
|
|
15525
|
-
)
|
|
15526
|
-
}
|
|
15527
|
-
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
slotProps: { Label: { size: "sm" } }
|
|
15573
|
+
)
|
|
15574
|
+
] }) });
|
|
15575
|
+
};
|
|
15576
|
+
const getInitialPurpose = (bankTransaction) => {
|
|
15577
|
+
if (bankTransaction.category) {
|
|
15578
|
+
if (bankTransaction.category.type === "Exclusion") {
|
|
15579
|
+
return Purpose.personal;
|
|
15533
15580
|
}
|
|
15534
|
-
|
|
15581
|
+
if (bankTransaction.categorization_status === CategorizationStatus.SPLIT) {
|
|
15582
|
+
return Purpose.more;
|
|
15583
|
+
}
|
|
15584
|
+
return Purpose.business;
|
|
15585
|
+
}
|
|
15586
|
+
return hasMatch(bankTransaction) ? Purpose.more : Purpose.business;
|
|
15535
15587
|
};
|
|
15536
15588
|
var Purpose = /* @__PURE__ */ ((Purpose2) => {
|
|
15537
15589
|
Purpose2["business"] = "business";
|
|
@@ -15539,7 +15591,6 @@ var Purpose = /* @__PURE__ */ ((Purpose2) => {
|
|
|
15539
15591
|
Purpose2["more"] = "more";
|
|
15540
15592
|
return Purpose2;
|
|
15541
15593
|
})(Purpose || {});
|
|
15542
|
-
const DATE_FORMAT = "LLL d";
|
|
15543
15594
|
const getAssignedValue = (bankTransaction, renderInAppLink) => {
|
|
15544
15595
|
var _a, _b, _c, _d;
|
|
15545
15596
|
if (bankTransaction.categorization_status === CategorizationStatus.SPLIT) {
|
|
@@ -15575,21 +15626,8 @@ const BankTransactionsMobileListItem = ({
|
|
|
15575
15626
|
} = useContext(TransactionToOpenContext);
|
|
15576
15627
|
const { shouldHideAfterCategorize } = useBankTransactionsContext();
|
|
15577
15628
|
const categorized = isCategorized(bankTransaction);
|
|
15578
|
-
const formRowRef = useElementSize(
|
|
15579
|
-
(_a2, _b2, { height: height2 }) => setHeight(height2)
|
|
15580
|
-
);
|
|
15581
|
-
const headingRowRef = useElementSize((_a2, _b2, { height: height2 }) => {
|
|
15582
|
-
setHeadingHeight(height2);
|
|
15583
|
-
});
|
|
15584
15629
|
const itemRef = useRef(null);
|
|
15585
|
-
const [removeAnim, setRemoveAnim] = useState(false);
|
|
15586
|
-
const [purpose, setPurpose] = useState(
|
|
15587
|
-
bankTransaction.category ? bankTransaction.category.type === "Exclusion" ? "personal" : bankTransaction.categorization_status === CategorizationStatus.SPLIT ? "more" : "business" : hasMatch(bankTransaction) ? "more" : "business"
|
|
15588
|
-
/* business */
|
|
15589
|
-
);
|
|
15590
15630
|
const [open, setOpen] = useState(isFirstItem);
|
|
15591
|
-
const [height, setHeight] = useState(0);
|
|
15592
|
-
const [headingHeight, setHeadingHeight] = useState(63);
|
|
15593
15631
|
const openNext = () => {
|
|
15594
15632
|
if (editable && itemRef.current && itemRef.current.nextSibling) {
|
|
15595
15633
|
const txId = itemRef.current.nextSibling.getAttribute(
|
|
@@ -15619,10 +15657,12 @@ const BankTransactionsMobileListItem = ({
|
|
|
15619
15657
|
}
|
|
15620
15658
|
}, [bankTransaction.id, clearTransactionIdToOpen, transactionIdToOpen]);
|
|
15621
15659
|
useEffect(() => {
|
|
15622
|
-
if (
|
|
15660
|
+
if (bankTransaction.recently_categorized) {
|
|
15623
15661
|
if (editable && shouldHideAfterCategorize()) {
|
|
15624
|
-
|
|
15625
|
-
|
|
15662
|
+
setTimeout(() => {
|
|
15663
|
+
removeTransaction(bankTransaction);
|
|
15664
|
+
openNext();
|
|
15665
|
+
}, 300);
|
|
15626
15666
|
} else {
|
|
15627
15667
|
close2();
|
|
15628
15668
|
}
|
|
@@ -15633,14 +15673,10 @@ const BankTransactionsMobileListItem = ({
|
|
|
15633
15673
|
bankTransaction.match
|
|
15634
15674
|
]);
|
|
15635
15675
|
const toggleOpen = () => {
|
|
15636
|
-
if (open) {
|
|
15637
|
-
setHeight(0);
|
|
15638
|
-
}
|
|
15639
15676
|
setOpen(!open);
|
|
15640
15677
|
};
|
|
15641
15678
|
const close2 = () => {
|
|
15642
15679
|
setOpen(false);
|
|
15643
|
-
setHeight(0);
|
|
15644
15680
|
};
|
|
15645
15681
|
const checkboxContainerRef = useRef(null);
|
|
15646
15682
|
const handleRowClick = (event) => {
|
|
@@ -15665,7 +15701,6 @@ const BankTransactionsMobileListItem = ({
|
|
|
15665
15701
|
}, 300);
|
|
15666
15702
|
}
|
|
15667
15703
|
}, [bankTransaction.recently_categorized]);
|
|
15668
|
-
const onChangePurpose = (event) => setPurpose(event.target.value);
|
|
15669
15704
|
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
15670
15705
|
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
15671
15706
|
const { select, deselect } = useBulkSelectionActions();
|
|
@@ -15677,169 +15712,95 @@ const BankTransactionsMobileListItem = ({
|
|
|
15677
15712
|
const openClassName = open ? `${className}--expanded` : "";
|
|
15678
15713
|
const rowClassName = classNames(
|
|
15679
15714
|
className,
|
|
15680
|
-
removeAnim ? "Layer__bank-transaction-row--removing" : "",
|
|
15681
15715
|
open ? openClassName : "",
|
|
15682
15716
|
isVisible ? "show" : ""
|
|
15683
15717
|
);
|
|
15684
|
-
return /* @__PURE__ */
|
|
15685
|
-
/* @__PURE__ */
|
|
15718
|
+
return /* @__PURE__ */ jsx("li", { ref: itemRef, className: rowClassName, "data-item": bankTransaction.id, children: /* @__PURE__ */ jsxs(VStack, { children: [
|
|
15719
|
+
/* @__PURE__ */ jsxs(
|
|
15686
15720
|
"div",
|
|
15687
15721
|
{
|
|
15688
15722
|
onClick: handleRowClick,
|
|
15689
15723
|
role: "button",
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15696
|
-
|
|
15697
|
-
|
|
15698
|
-
|
|
15699
|
-
HStack,
|
|
15700
|
-
|
|
15701
|
-
|
|
15702
|
-
|
|
15703
|
-
|
|
15704
|
-
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15710
|
-
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15716
|
-
|
|
15717
|
-
{
|
|
15718
|
-
|
|
15719
|
-
|
|
15720
|
-
|
|
15721
|
-
|
|
15722
|
-
|
|
15723
|
-
|
|
15724
|
-
|
|
15725
|
-
|
|
15726
|
-
|
|
15727
|
-
|
|
15728
|
-
hasReceipts(bankTransaction) ? /* @__PURE__ */ jsx(File, { size: 12 }) : null
|
|
15729
|
-
] }),
|
|
15730
|
-
!categorizationEnabled && !categorized ? /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, {}) : null
|
|
15731
|
-
]
|
|
15732
|
-
}
|
|
15733
|
-
)
|
|
15734
|
-
] }),
|
|
15735
|
-
/* @__PURE__ */ jsxs(
|
|
15736
|
-
VStack,
|
|
15737
|
-
{
|
|
15738
|
-
align: "end",
|
|
15739
|
-
gap: "3xs",
|
|
15740
|
-
pb: "sm",
|
|
15741
|
-
children: [
|
|
15742
|
-
/* @__PURE__ */ jsxs(HStack, { children: [
|
|
15743
|
-
/* @__PURE__ */ jsx(Span, { size: "md", children: isCredit(bankTransaction) ? "+" : "" }),
|
|
15744
|
-
/* @__PURE__ */ jsx(
|
|
15745
|
-
MoneySpan,
|
|
15746
|
-
{
|
|
15747
|
-
amount: bankTransaction.amount
|
|
15748
|
-
}
|
|
15749
|
-
)
|
|
15750
|
-
] }),
|
|
15751
|
-
/* @__PURE__ */ jsx(
|
|
15752
|
-
DateTime,
|
|
15753
|
-
{
|
|
15754
|
-
value: bankTransaction.date,
|
|
15755
|
-
dateFormat: DATE_FORMAT,
|
|
15756
|
-
onlyDate: true,
|
|
15757
|
-
slotProps: {
|
|
15758
|
-
Date: { size: "sm", variant: "subtle" }
|
|
15759
|
-
}
|
|
15760
|
-
}
|
|
15761
|
-
)
|
|
15762
|
-
]
|
|
15763
|
-
}
|
|
15764
|
-
)
|
|
15765
|
-
]
|
|
15766
|
-
}
|
|
15767
|
-
),
|
|
15768
|
-
/* @__PURE__ */ jsx(
|
|
15769
|
-
BankTransactionsMobileListItemCategory,
|
|
15770
|
-
{
|
|
15771
|
-
bankTransaction
|
|
15772
|
-
}
|
|
15773
|
-
)
|
|
15774
|
-
]
|
|
15775
|
-
}
|
|
15776
|
-
)
|
|
15777
|
-
}
|
|
15778
|
-
),
|
|
15779
|
-
/* @__PURE__ */ jsx(
|
|
15780
|
-
"div",
|
|
15781
|
-
{
|
|
15782
|
-
className: `${className}__expanded-row`,
|
|
15783
|
-
style: { height: !open || removeAnim ? 0 : height },
|
|
15784
|
-
children: open && /* @__PURE__ */ jsxs(
|
|
15785
|
-
"div",
|
|
15786
|
-
{
|
|
15787
|
-
className: `${className}__expanded-row__content`,
|
|
15788
|
-
ref: formRowRef,
|
|
15789
|
-
children: [
|
|
15790
|
-
categorizationEnabled ? /* @__PURE__ */ jsxs("div", { className: `${className}__toggle-row`, children: [
|
|
15724
|
+
children: [
|
|
15725
|
+
/* @__PURE__ */ jsxs(
|
|
15726
|
+
HStack,
|
|
15727
|
+
{
|
|
15728
|
+
gap: "md",
|
|
15729
|
+
justify: "space-between",
|
|
15730
|
+
align: "center",
|
|
15731
|
+
pie: "md",
|
|
15732
|
+
children: [
|
|
15733
|
+
/* @__PURE__ */ jsxs(HStack, { align: "center", children: [
|
|
15734
|
+
/* @__PURE__ */ jsx(
|
|
15735
|
+
BankTransactionsMobileListItemCheckbox,
|
|
15736
|
+
{
|
|
15737
|
+
bulkActionsEnabled,
|
|
15738
|
+
bankTransaction,
|
|
15739
|
+
checkboxContainerRef
|
|
15740
|
+
}
|
|
15741
|
+
),
|
|
15742
|
+
/* @__PURE__ */ jsxs(
|
|
15743
|
+
VStack,
|
|
15744
|
+
{
|
|
15745
|
+
align: "start",
|
|
15746
|
+
gap: "3xs",
|
|
15747
|
+
className: "Layer__bankTransactionsMobileListItem__headingContentLeft",
|
|
15748
|
+
pi: "md",
|
|
15749
|
+
pb: "sm",
|
|
15750
|
+
children: [
|
|
15751
|
+
/* @__PURE__ */ jsx(Span, { ellipsis: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description }),
|
|
15752
|
+
/* @__PURE__ */ jsx(Span, { className: "Layer__bankTransactionsMobileListItem__categorizedValue", children: categorized && bankTransaction.categorization_status ? getAssignedValue(bankTransaction, renderInAppLink) : null }),
|
|
15753
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "2xs", align: "center", children: [
|
|
15754
|
+
/* @__PURE__ */ jsx(Span, { size: "sm", ellipsis: true, children: fullAccountName }),
|
|
15755
|
+
hasReceipts(bankTransaction) ? /* @__PURE__ */ jsx(File, { size: 12 }) : null
|
|
15756
|
+
] }),
|
|
15757
|
+
!categorizationEnabled && !categorized ? /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, {}) : null
|
|
15758
|
+
]
|
|
15759
|
+
}
|
|
15760
|
+
)
|
|
15761
|
+
] }),
|
|
15791
15762
|
/* @__PURE__ */ jsx(
|
|
15792
|
-
|
|
15763
|
+
BankTransactionsAmountDate,
|
|
15793
15764
|
{
|
|
15794
|
-
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
{
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
style: { minWidth: 84 }
|
|
15801
|
-
},
|
|
15802
|
-
{
|
|
15803
|
-
value: "personal",
|
|
15804
|
-
label: "Personal",
|
|
15805
|
-
style: { minWidth: 84 }
|
|
15806
|
-
},
|
|
15807
|
-
{
|
|
15808
|
-
value: "more",
|
|
15809
|
-
label: "More",
|
|
15810
|
-
style: { minWidth: 84 }
|
|
15765
|
+
amount: bankTransaction.amount,
|
|
15766
|
+
date: bankTransaction.date,
|
|
15767
|
+
slotProps: {
|
|
15768
|
+
MoneySpan: {
|
|
15769
|
+
size: "md",
|
|
15770
|
+
displayPlusSign: isCredit(bankTransaction)
|
|
15811
15771
|
}
|
|
15812
|
-
|
|
15813
|
-
selected: purpose,
|
|
15814
|
-
onChange: onChangePurpose
|
|
15772
|
+
}
|
|
15815
15773
|
}
|
|
15816
|
-
)
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
|
|
15821
|
-
|
|
15822
|
-
|
|
15823
|
-
|
|
15824
|
-
|
|
15825
|
-
|
|
15826
|
-
|
|
15827
|
-
|
|
15828
|
-
|
|
15829
|
-
|
|
15830
|
-
|
|
15831
|
-
|
|
15832
|
-
|
|
15833
|
-
|
|
15774
|
+
)
|
|
15775
|
+
]
|
|
15776
|
+
}
|
|
15777
|
+
),
|
|
15778
|
+
!open && /* @__PURE__ */ jsx(
|
|
15779
|
+
BankTransactionsMobileListItemCategory,
|
|
15780
|
+
{
|
|
15781
|
+
bankTransaction
|
|
15782
|
+
}
|
|
15783
|
+
)
|
|
15784
|
+
]
|
|
15785
|
+
}
|
|
15786
|
+
),
|
|
15787
|
+
open && /* @__PURE__ */ jsx(
|
|
15788
|
+
BankTransactionsMobileListItemExpandedRow,
|
|
15789
|
+
{
|
|
15790
|
+
bankTransaction,
|
|
15791
|
+
showCategorization: categorizationEnabled,
|
|
15792
|
+
showDescriptions,
|
|
15793
|
+
showReceiptUploads,
|
|
15794
|
+
showTooltips
|
|
15834
15795
|
}
|
|
15835
15796
|
)
|
|
15836
|
-
] });
|
|
15797
|
+
] }) });
|
|
15837
15798
|
};
|
|
15838
15799
|
const SWITCH_CLASS_NAME = "Layer__Switch";
|
|
15839
|
-
const Switch = forwardRef((
|
|
15840
|
-
var
|
|
15800
|
+
const Switch = forwardRef((_Kb, ref) => {
|
|
15801
|
+
var _Lb = _Kb, {
|
|
15841
15802
|
children
|
|
15842
|
-
} =
|
|
15803
|
+
} = _Lb, props = __objRest(_Lb, [
|
|
15843
15804
|
"children"
|
|
15844
15805
|
]);
|
|
15845
15806
|
return /* @__PURE__ */ jsx(
|
|
@@ -16215,8 +16176,8 @@ const usePaginationRange = ({
|
|
|
16215
16176
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
16216
16177
|
return paginationRange;
|
|
16217
16178
|
};
|
|
16218
|
-
const PaginationButton = (
|
|
16219
|
-
var
|
|
16179
|
+
const PaginationButton = (_Mb) => {
|
|
16180
|
+
var _Nb = _Mb, { children, isSelected } = _Nb, buttonProps = __objRest(_Nb, ["children", "isSelected"]);
|
|
16220
16181
|
return /* @__PURE__ */ jsx(
|
|
16221
16182
|
Button,
|
|
16222
16183
|
__spreadProps(__spreadValues({
|
|
@@ -16763,8 +16724,8 @@ function BaseFormTextField({
|
|
|
16763
16724
|
}
|
|
16764
16725
|
const INPUT_CLASS_NAME = "Layer__UI__Input";
|
|
16765
16726
|
const Input = forwardRef(
|
|
16766
|
-
function Input2(
|
|
16767
|
-
var
|
|
16727
|
+
function Input2(_Ob, ref) {
|
|
16728
|
+
var _Pb = _Ob, { inset, placement } = _Pb, restProps = __objRest(_Pb, ["inset", "placement"]);
|
|
16768
16729
|
const dataProperties = toDataProperties({ inset, placement });
|
|
16769
16730
|
return /* @__PURE__ */ jsx(
|
|
16770
16731
|
Input$2,
|
|
@@ -16860,15 +16821,15 @@ const withForceUpdate = (value) => {
|
|
|
16860
16821
|
writable: false
|
|
16861
16822
|
});
|
|
16862
16823
|
};
|
|
16863
|
-
function FormBigDecimalField(
|
|
16864
|
-
var
|
|
16824
|
+
function FormBigDecimalField(_Qb) {
|
|
16825
|
+
var _Rb = _Qb, {
|
|
16865
16826
|
mode = "decimal",
|
|
16866
16827
|
allowNegative = false,
|
|
16867
16828
|
maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
|
|
16868
16829
|
minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
|
|
16869
16830
|
maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
|
|
16870
16831
|
slots
|
|
16871
|
-
} =
|
|
16832
|
+
} = _Rb, restProps = __objRest(_Rb, [
|
|
16872
16833
|
"mode",
|
|
16873
16834
|
"allowNegative",
|
|
16874
16835
|
"maxValue",
|
|
@@ -17033,8 +16994,8 @@ function FormDateField({
|
|
|
17033
16994
|
}
|
|
17034
16995
|
const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
|
|
17035
16996
|
const TextArea = forwardRef(
|
|
17036
|
-
function TextArea2(
|
|
17037
|
-
var
|
|
16997
|
+
function TextArea2(_Sb, ref) {
|
|
16998
|
+
var _Tb = _Sb, { resize = "none" } = _Tb, restProps = __objRest(_Tb, ["resize"]);
|
|
17038
16999
|
const dataProperties = toDataProperties({ resize });
|
|
17039
17000
|
return /* @__PURE__ */ jsx(
|
|
17040
17001
|
TextArea$1,
|
|
@@ -17316,6 +17277,40 @@ const CustomAccountForm = ({ initialAccountName, onCancel, onSuccess }) => {
|
|
|
17316
17277
|
}
|
|
17317
17278
|
);
|
|
17318
17279
|
};
|
|
17280
|
+
const CloseIcon = (_Ub) => {
|
|
17281
|
+
var _Vb = _Ub, { size = 12 } = _Vb, props = __objRest(_Vb, ["size"]);
|
|
17282
|
+
return /* @__PURE__ */ jsxs(
|
|
17283
|
+
"svg",
|
|
17284
|
+
__spreadProps(__spreadValues({
|
|
17285
|
+
viewBox: "0 0 12 12",
|
|
17286
|
+
fill: "none",
|
|
17287
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
17288
|
+
}, props), {
|
|
17289
|
+
width: size,
|
|
17290
|
+
height: size,
|
|
17291
|
+
children: [
|
|
17292
|
+
/* @__PURE__ */ jsx(
|
|
17293
|
+
"path",
|
|
17294
|
+
{
|
|
17295
|
+
d: "M8.75 3.25L3.25 8.75",
|
|
17296
|
+
stroke: "currentColor",
|
|
17297
|
+
strokeLinecap: "round",
|
|
17298
|
+
strokeLinejoin: "round"
|
|
17299
|
+
}
|
|
17300
|
+
),
|
|
17301
|
+
/* @__PURE__ */ jsx(
|
|
17302
|
+
"path",
|
|
17303
|
+
{
|
|
17304
|
+
d: "M3.25 3.25L8.75 8.75",
|
|
17305
|
+
stroke: "currentColor",
|
|
17306
|
+
strokeLinecap: "round",
|
|
17307
|
+
strokeLinejoin: "round"
|
|
17308
|
+
}
|
|
17309
|
+
)
|
|
17310
|
+
]
|
|
17311
|
+
})
|
|
17312
|
+
);
|
|
17313
|
+
};
|
|
17319
17314
|
const VALID_EXTENSIONS = [".csv"];
|
|
17320
17315
|
const VALID_FILE_TYPES = ["text/csv", "text/plain", "application/vnd.ms-excel"];
|
|
17321
17316
|
const MAX_FILE_SIZE = 2 * 1024 * 1024;
|
|
@@ -19105,8 +19100,8 @@ const BankTransactionsHeader = ({
|
|
|
19105
19100
|
}
|
|
19106
19101
|
);
|
|
19107
19102
|
};
|
|
19108
|
-
const Inbox = (
|
|
19109
|
-
var
|
|
19103
|
+
const Inbox = (_Wb) => {
|
|
19104
|
+
var _Xb = _Wb, { size = 18 } = _Xb, props = __objRest(_Xb, ["size"]);
|
|
19110
19105
|
return /* @__PURE__ */ jsxs(
|
|
19111
19106
|
"svg",
|
|
19112
19107
|
__spreadProps(__spreadValues({
|
|
@@ -19653,8 +19648,8 @@ function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
|
19653
19648
|
const CSS_PREFIX$1 = "Layer__UI__Table";
|
|
19654
19649
|
const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
|
|
19655
19650
|
const Table$1 = forwardRef(
|
|
19656
|
-
(
|
|
19657
|
-
var
|
|
19651
|
+
(_Yb, ref) => {
|
|
19652
|
+
var _Zb = _Yb, { children, className } = _Zb, restProps = __objRest(_Zb, ["children", "className"]);
|
|
19658
19653
|
return /* @__PURE__ */ jsx(
|
|
19659
19654
|
Table$2,
|
|
19660
19655
|
__spreadProps(__spreadValues({
|
|
@@ -19667,8 +19662,8 @@ const Table$1 = forwardRef(
|
|
|
19667
19662
|
}
|
|
19668
19663
|
);
|
|
19669
19664
|
Table$1.displayName = "Table";
|
|
19670
|
-
const TableHeaderInner = (
|
|
19671
|
-
var
|
|
19665
|
+
const TableHeaderInner = (__b, ref) => {
|
|
19666
|
+
var _$b = __b, { children, className, hideHeader } = _$b, restProps = __objRest(_$b, ["children", "className", "hideHeader"]);
|
|
19672
19667
|
return /* @__PURE__ */ jsx(
|
|
19673
19668
|
TableHeader$1,
|
|
19674
19669
|
__spreadProps(__spreadValues({
|
|
@@ -19681,8 +19676,8 @@ const TableHeaderInner = (_ac, ref) => {
|
|
|
19681
19676
|
};
|
|
19682
19677
|
const TableHeader = forwardRef(TableHeaderInner);
|
|
19683
19678
|
TableHeader.displayName = "TableHeader";
|
|
19684
|
-
const TableBodyInner = (
|
|
19685
|
-
var
|
|
19679
|
+
const TableBodyInner = (_ac, ref) => {
|
|
19680
|
+
var _bc = _ac, { children, className } = _bc, restProps = __objRest(_bc, ["children", "className"]);
|
|
19686
19681
|
return /* @__PURE__ */ jsx(
|
|
19687
19682
|
TableBody$2,
|
|
19688
19683
|
__spreadProps(__spreadValues({
|
|
@@ -19695,8 +19690,8 @@ const TableBodyInner = (_cc, ref) => {
|
|
|
19695
19690
|
};
|
|
19696
19691
|
const TableBody$1 = forwardRef(TableBodyInner);
|
|
19697
19692
|
TableBody$1.displayName = "TableBody";
|
|
19698
|
-
const RowInner = (
|
|
19699
|
-
var
|
|
19693
|
+
const RowInner = (_cc, ref) => {
|
|
19694
|
+
var _dc = _cc, { children, className, depth = 0 } = _dc, restProps = __objRest(_dc, ["children", "className", "depth"]);
|
|
19700
19695
|
const dataProperties = toDataProperties({ depth });
|
|
19701
19696
|
return /* @__PURE__ */ jsx(
|
|
19702
19697
|
Row$1,
|
|
@@ -19711,8 +19706,8 @@ const RowInner = (_ec, ref) => {
|
|
|
19711
19706
|
const Row = forwardRef(RowInner);
|
|
19712
19707
|
Row.displayName = "Row";
|
|
19713
19708
|
const Column = forwardRef(
|
|
19714
|
-
(
|
|
19715
|
-
var
|
|
19709
|
+
(_ec, ref) => {
|
|
19710
|
+
var _fc = _ec, { children, className, textAlign = "left" } = _fc, restProps = __objRest(_fc, ["children", "className", "textAlign"]);
|
|
19716
19711
|
const dataProperties = toDataProperties({ "text-align": textAlign });
|
|
19717
19712
|
return /* @__PURE__ */ jsx(
|
|
19718
19713
|
Column$1,
|
|
@@ -19727,8 +19722,8 @@ const Column = forwardRef(
|
|
|
19727
19722
|
);
|
|
19728
19723
|
Column.displayName = "Column";
|
|
19729
19724
|
const Cell = forwardRef(
|
|
19730
|
-
(
|
|
19731
|
-
var
|
|
19725
|
+
(_gc, ref) => {
|
|
19726
|
+
var _hc = _gc, { children, className } = _hc, restProps = __objRest(_hc, ["children", "className"]);
|
|
19732
19727
|
return /* @__PURE__ */ jsx(
|
|
19733
19728
|
Cell$1,
|
|
19734
19729
|
__spreadProps(__spreadValues({
|
|
@@ -20021,8 +20016,8 @@ const SuggestedCategorizationRuleUpdatesDrawer = ({
|
|
|
20021
20016
|
/* @__PURE__ */ jsx(SuggestedCategorizationRuleUpdates, { ruleSuggestion, close: close2 })
|
|
20022
20017
|
] }) });
|
|
20023
20018
|
};
|
|
20024
|
-
const BackArrow = (
|
|
20025
|
-
var
|
|
20019
|
+
const BackArrow = (_ic) => {
|
|
20020
|
+
var _jc = _ic, { size = 18 } = _jc, props = __objRest(_jc, ["size"]);
|
|
20026
20021
|
return /* @__PURE__ */ jsx(
|
|
20027
20022
|
"svg",
|
|
20028
20023
|
__spreadProps(__spreadValues({
|
|
@@ -20393,8 +20388,8 @@ const CategorizationRulesDrawer = () => {
|
|
|
20393
20388
|
) });
|
|
20394
20389
|
};
|
|
20395
20390
|
const COMPONENT_NAME$a = "bank-transactions";
|
|
20396
|
-
const BankTransactions = (
|
|
20397
|
-
var
|
|
20391
|
+
const BankTransactions = (_kc) => {
|
|
20392
|
+
var _lc = _kc, {
|
|
20398
20393
|
onError,
|
|
20399
20394
|
showTags = false,
|
|
20400
20395
|
showCustomerVendor = false,
|
|
@@ -20402,7 +20397,7 @@ const BankTransactions = (_mc) => {
|
|
|
20402
20397
|
applyGlobalDateRange = false,
|
|
20403
20398
|
mode,
|
|
20404
20399
|
renderInAppLink
|
|
20405
|
-
} =
|
|
20400
|
+
} = _lc, props = __objRest(_lc, [
|
|
20406
20401
|
"onError",
|
|
20407
20402
|
"showTags",
|
|
20408
20403
|
"showCustomerVendor",
|
|
@@ -20689,8 +20684,8 @@ const BankTransactionsTableView = ({
|
|
|
20689
20684
|
}
|
|
20690
20685
|
);
|
|
20691
20686
|
};
|
|
20692
|
-
const QuickbooksIcon = (
|
|
20693
|
-
var
|
|
20687
|
+
const QuickbooksIcon = (_mc) => {
|
|
20688
|
+
var _nc = _mc, { size = 24 } = _nc, props = __objRest(_nc, ["size"]);
|
|
20694
20689
|
return /* @__PURE__ */ jsxs(
|
|
20695
20690
|
"svg",
|
|
20696
20691
|
__spreadProps(__spreadValues({
|
|
@@ -20971,8 +20966,8 @@ function QuickbooksContextProvider({ children }) {
|
|
|
20971
20966
|
const quickbooksContextData = useQuickbooks();
|
|
20972
20967
|
return /* @__PURE__ */ jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
|
|
20973
20968
|
}
|
|
20974
|
-
const Cog = (
|
|
20975
|
-
var
|
|
20969
|
+
const Cog = (_oc) => {
|
|
20970
|
+
var _pc = _oc, { size = 12 } = _pc, props = __objRest(_pc, ["size"]);
|
|
20976
20971
|
const id = useId();
|
|
20977
20972
|
return /* @__PURE__ */ jsxs(
|
|
20978
20973
|
"svg",
|
|
@@ -21092,12 +21087,12 @@ const collectRevenueItems = (data) => {
|
|
|
21092
21087
|
}
|
|
21093
21088
|
return revenueItems;
|
|
21094
21089
|
};
|
|
21095
|
-
const humanizeTitle = (sidebarView) => {
|
|
21090
|
+
const humanizeTitle = (sidebarView, overrides) => {
|
|
21096
21091
|
switch (sidebarView) {
|
|
21097
21092
|
case "expenses":
|
|
21098
|
-
return "Expenses";
|
|
21093
|
+
return (overrides == null ? void 0 : overrides.expenseChartHeader) || "Expenses";
|
|
21099
21094
|
case "revenue":
|
|
21100
|
-
return "Revenue";
|
|
21095
|
+
return (overrides == null ? void 0 : overrides.revenueChartHeader) || "Revenue";
|
|
21101
21096
|
default:
|
|
21102
21097
|
return "Profit & Loss";
|
|
21103
21098
|
}
|
|
@@ -21609,8 +21604,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
21609
21604
|
refetch
|
|
21610
21605
|
};
|
|
21611
21606
|
};
|
|
21612
|
-
const BarChart2 = (
|
|
21613
|
-
var
|
|
21607
|
+
const BarChart2 = (_qc) => {
|
|
21608
|
+
var _rc = _qc, { size = 12 } = _rc, props = __objRest(_rc, ["size"]);
|
|
21614
21609
|
return /* @__PURE__ */ jsxs(
|
|
21615
21610
|
"svg",
|
|
21616
21611
|
__spreadProps(__spreadValues({
|
|
@@ -22402,11 +22397,11 @@ const ProfitAndLossChart = ({
|
|
|
22402
22397
|
isSyncing && !hasNonZeroData ? /* @__PURE__ */ jsx(ChartStateCard, {}) : null
|
|
22403
22398
|
] });
|
|
22404
22399
|
};
|
|
22405
|
-
const BackButton = (
|
|
22406
|
-
var
|
|
22400
|
+
const BackButton = (_sc) => {
|
|
22401
|
+
var _tc = _sc, {
|
|
22407
22402
|
className,
|
|
22408
22403
|
textOnly = false
|
|
22409
|
-
} =
|
|
22404
|
+
} = _tc, props = __objRest(_tc, [
|
|
22410
22405
|
"className",
|
|
22411
22406
|
"textOnly"
|
|
22412
22407
|
]);
|
|
@@ -22431,8 +22426,8 @@ const TASKS_CHARTS_COLORS = {
|
|
|
22431
22426
|
done: "#3B9C63",
|
|
22432
22427
|
pending: "#DFA000"
|
|
22433
22428
|
};
|
|
22434
|
-
const SortArrows = (
|
|
22435
|
-
var
|
|
22429
|
+
const SortArrows = (_uc) => {
|
|
22430
|
+
var _vc = _uc, { size = 13 } = _vc, props = __objRest(_vc, ["size"]);
|
|
22436
22431
|
return /* @__PURE__ */ jsxs(
|
|
22437
22432
|
"svg",
|
|
22438
22433
|
__spreadProps(__spreadValues({
|
|
@@ -23203,6 +23198,17 @@ const Header = forwardRef(
|
|
|
23203
23198
|
}
|
|
23204
23199
|
);
|
|
23205
23200
|
Header.displayName = "Header";
|
|
23201
|
+
const CloseButton = (_wc) => {
|
|
23202
|
+
var _xc = _wc, {
|
|
23203
|
+
className,
|
|
23204
|
+
textOnly = false
|
|
23205
|
+
} = _xc, props = __objRest(_xc, [
|
|
23206
|
+
"className",
|
|
23207
|
+
"textOnly"
|
|
23208
|
+
]);
|
|
23209
|
+
const baseClassName2 = classNames("Layer__btn", "Layer__back-btn", className);
|
|
23210
|
+
return /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues({}, props), { className: baseClassName2, children: textOnly ? "Back" : /* @__PURE__ */ jsx(CloseIcon, { size: 16 }) }));
|
|
23211
|
+
};
|
|
23206
23212
|
const LedgerAccountsContext = createContext({
|
|
23207
23213
|
data: void 0,
|
|
23208
23214
|
entryData: void 0,
|
|
@@ -23993,7 +23999,7 @@ const ProfitAndLossDetailedCharts = ({
|
|
|
23993
23999
|
return /* @__PURE__ */ jsxs("div", { className: "Layer__profit-and-loss-detailed-charts", children: [
|
|
23994
24000
|
/* @__PURE__ */ jsxs("header", { className: "Layer__profit-and-loss-detailed-charts__header", children: [
|
|
23995
24001
|
/* @__PURE__ */ jsxs("div", { className: "Layer__profit-and-loss-detailed-charts__head", children: [
|
|
23996
|
-
/* @__PURE__ */ jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope) }),
|
|
24002
|
+
/* @__PURE__ */ jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope, stringOverrides == null ? void 0 : stringOverrides.detailedChartStringOverrides) }),
|
|
23997
24003
|
/* @__PURE__ */ jsx(Text, { size: TextSize.sm, className: "date", children: format(dateRange.startDate, "LLLL, y") }),
|
|
23998
24004
|
showDatePicker && /* @__PURE__ */ jsx(GlobalMonthPicker, {})
|
|
23999
24005
|
] }),
|
|
@@ -24010,7 +24016,7 @@ const ProfitAndLossDetailedCharts = ({
|
|
|
24010
24016
|
/* @__PURE__ */ jsxs("header", { className: "Layer__profit-and-loss-detailed-charts__header--tablet", children: [
|
|
24011
24017
|
!hideClose && /* @__PURE__ */ jsx(BackButton, { onClick: () => setSidebarScope(void 0) }),
|
|
24012
24018
|
/* @__PURE__ */ jsxs("div", { className: "Layer__profit-and-loss-detailed-charts__head", children: [
|
|
24013
|
-
/* @__PURE__ */ jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope) }),
|
|
24019
|
+
/* @__PURE__ */ jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope, stringOverrides == null ? void 0 : stringOverrides.detailedChartStringOverrides) }),
|
|
24014
24020
|
/* @__PURE__ */ jsx(Text, { size: TextSize.sm, className: "date", children: format(dateRange.startDate, "LLLL, y") })
|
|
24015
24021
|
] })
|
|
24016
24022
|
] }),
|
|
@@ -24760,8 +24766,8 @@ const getComparisonValue = (name, depth, cellData) => {
|
|
|
24760
24766
|
} else {
|
|
24761
24767
|
return (cellData == null ? void 0 : cellData.value) !== void 0 ? cellData.value : "";
|
|
24762
24768
|
}
|
|
24763
|
-
} else if (typeof cellData === "object" && cellData !== null && "
|
|
24764
|
-
for (const item of cellData.
|
|
24769
|
+
} else if (typeof cellData === "object" && cellData !== null && "line_items" in cellData) {
|
|
24770
|
+
for (const item of cellData.line_items || []) {
|
|
24765
24771
|
const result = getComparisonLineItemValue(item, name, depth);
|
|
24766
24772
|
if (result !== "") {
|
|
24767
24773
|
return result;
|
|
@@ -24772,11 +24778,11 @@ const getComparisonValue = (name, depth, cellData) => {
|
|
|
24772
24778
|
};
|
|
24773
24779
|
const getComparisonLineItemValue = (lineItem, name, depth) => {
|
|
24774
24780
|
if (depth === 1) {
|
|
24775
|
-
if (lineItem.
|
|
24781
|
+
if (lineItem.display_name === name) {
|
|
24776
24782
|
return lineItem.value !== void 0 ? lineItem.value : "";
|
|
24777
24783
|
}
|
|
24778
|
-
} else if (lineItem.
|
|
24779
|
-
for (const childLineItem of lineItem.
|
|
24784
|
+
} else if (lineItem.line_items && lineItem.line_items.length > 0) {
|
|
24785
|
+
for (const childLineItem of lineItem.line_items) {
|
|
24780
24786
|
const result = getComparisonLineItemValue(childLineItem, name, depth - 1);
|
|
24781
24787
|
if (result !== "") {
|
|
24782
24788
|
return result;
|
|
@@ -24786,25 +24792,24 @@ const getComparisonLineItemValue = (lineItem, name, depth) => {
|
|
|
24786
24792
|
return "";
|
|
24787
24793
|
};
|
|
24788
24794
|
const mergeComparisonLineItemsAtDepth = (lineItems) => {
|
|
24795
|
+
var _a, _b, _c;
|
|
24789
24796
|
const map = /* @__PURE__ */ new Map();
|
|
24790
|
-
const
|
|
24791
|
-
|
|
24792
|
-
|
|
24793
|
-
|
|
24794
|
-
|
|
24795
|
-
const
|
|
24796
|
-
|
|
24797
|
-
|
|
24798
|
-
|
|
24799
|
-
|
|
24800
|
-
|
|
24801
|
-
|
|
24802
|
-
|
|
24803
|
-
|
|
24804
|
-
|
|
24805
|
-
|
|
24806
|
-
};
|
|
24807
|
-
mergeItems(lineItems);
|
|
24797
|
+
for (const item of lineItems) {
|
|
24798
|
+
const key = item.display_name;
|
|
24799
|
+
const existing = (_b = map.get(key)) != null ? _b : __spreadProps(__spreadValues({}, item), { line_items: (_a = item.line_items) != null ? _a : [] });
|
|
24800
|
+
let next = existing;
|
|
24801
|
+
if (item.line_items && item.line_items.length > 0) {
|
|
24802
|
+
const mergedChildren = mergeComparisonLineItemsAtDepth([
|
|
24803
|
+
...(_c = existing.line_items) != null ? _c : [],
|
|
24804
|
+
...item.line_items
|
|
24805
|
+
]);
|
|
24806
|
+
next = __spreadProps(__spreadValues({}, next), { line_items: mergedChildren });
|
|
24807
|
+
}
|
|
24808
|
+
if (item.value !== void 0) {
|
|
24809
|
+
next = __spreadProps(__spreadValues({}, next), { value: item.value });
|
|
24810
|
+
}
|
|
24811
|
+
map.set(key, next);
|
|
24812
|
+
}
|
|
24808
24813
|
return Array.from(map.values());
|
|
24809
24814
|
};
|
|
24810
24815
|
const ProfitAndLossCompareTable = ({
|
|
@@ -24862,7 +24867,7 @@ const ProfitAndLossCompareTable = ({
|
|
|
24862
24867
|
)[0];
|
|
24863
24868
|
lineItem = "display_name" in mergedLineItems ? mergedLineItems : void 0;
|
|
24864
24869
|
}
|
|
24865
|
-
const expandable = (lineItem == null ? void 0 : lineItem.
|
|
24870
|
+
const expandable = (lineItem == null ? void 0 : lineItem.line_items) && lineItem.line_items.length > 0 ? true : false;
|
|
24866
24871
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
24867
24872
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
24868
24873
|
/* @__PURE__ */ jsxs(
|
|
@@ -24875,20 +24880,20 @@ const ProfitAndLossCompareTable = ({
|
|
|
24875
24880
|
variant: expandable ? "expandable" : "default",
|
|
24876
24881
|
handleExpand: () => setIsOpen(rowKey),
|
|
24877
24882
|
children: [
|
|
24878
|
-
/* @__PURE__ */ jsx(TableCell, { primary: true, withExpandIcon: expandable, children: lineItem ? lineItem.
|
|
24883
|
+
/* @__PURE__ */ jsx(TableCell, { primary: true, withExpandIcon: expandable, children: lineItem ? lineItem.display_name : rowDisplayName }),
|
|
24879
24884
|
rowData.map((cell, i) => /* @__PURE__ */ jsx(TableCell, { isCurrency: true, children: getComparisonValue(
|
|
24880
|
-
lineItem ? lineItem.
|
|
24885
|
+
lineItem ? lineItem.display_name : rowDisplayName,
|
|
24881
24886
|
depth,
|
|
24882
24887
|
cell
|
|
24883
24888
|
) }, "compare-value" + i))
|
|
24884
24889
|
]
|
|
24885
24890
|
}
|
|
24886
24891
|
),
|
|
24887
|
-
expanded && (lineItem == null ? void 0 : lineItem.
|
|
24892
|
+
expanded && (lineItem == null ? void 0 : lineItem.line_items) ? lineItem.line_items.map(
|
|
24888
24893
|
(child) => renderRow(
|
|
24889
|
-
child.
|
|
24894
|
+
child.display_name,
|
|
24890
24895
|
depth + 1,
|
|
24891
|
-
child.
|
|
24896
|
+
child.display_name,
|
|
24892
24897
|
child,
|
|
24893
24898
|
rowData
|
|
24894
24899
|
)
|
|
@@ -25126,13 +25131,15 @@ const ProfitAndLossTableComponent = ({
|
|
|
25126
25131
|
rowKey: "other_outflows",
|
|
25127
25132
|
rowIndex: 8
|
|
25128
25133
|
}),
|
|
25129
|
-
data.customLineItems &&
|
|
25130
|
-
|
|
25131
|
-
|
|
25132
|
-
|
|
25133
|
-
|
|
25134
|
-
|
|
25135
|
-
|
|
25134
|
+
data.customLineItems && data.customLineItems.map(
|
|
25135
|
+
(customLineItem, index) => renderLineItem({
|
|
25136
|
+
lineItem: customLineItem,
|
|
25137
|
+
depth: 0,
|
|
25138
|
+
rowKey: `custom_line_item_${index}`,
|
|
25139
|
+
rowIndex: 9 + index,
|
|
25140
|
+
showValue: false
|
|
25141
|
+
})
|
|
25142
|
+
)
|
|
25136
25143
|
] }) });
|
|
25137
25144
|
};
|
|
25138
25145
|
const ProfitAndLossTableWithProvider = (props) => {
|
|
@@ -34731,7 +34738,8 @@ const BookkeepingOverview = ({
|
|
|
34731
34738
|
{
|
|
34732
34739
|
text: ((_e = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _e.header) || "Profit & Loss",
|
|
34733
34740
|
withDatePicker: true,
|
|
34734
|
-
withStatus: true
|
|
34741
|
+
withStatus: true,
|
|
34742
|
+
dateSelectionMode: "month"
|
|
34735
34743
|
}
|
|
34736
34744
|
),
|
|
34737
34745
|
/* @__PURE__ */ jsx(BookkeepingProfitAndLossSummariesContainer, { children: /* @__PURE__ */ jsx(
|
|
@@ -34845,7 +34853,7 @@ const AccountingOverview = ({
|
|
|
34845
34853
|
children: /* @__PURE__ */ jsxs(
|
|
34846
34854
|
View,
|
|
34847
34855
|
{
|
|
34848
|
-
title,
|
|
34856
|
+
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title,
|
|
34849
34857
|
showHeader: showTitle,
|
|
34850
34858
|
header: /* @__PURE__ */ jsx(Header, { children: /* @__PURE__ */ jsx(HeaderRow, { children: /* @__PURE__ */ jsx(HeaderCol, { children: /* @__PURE__ */ jsx(GlobalMonthPicker, {}) }) }) }),
|
|
34851
34859
|
children: [
|