@layerfi/components 0.1.53 → 0.1.54
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 +23 -17
- package/dist/esm/index.js.map +3 -3
- package/dist/index.d.ts +4 -1
- package/dist/index.js +23 -17
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4720,7 +4720,10 @@ declare module '@layerfi/components/types/chart_of_accounts' {
|
|
|
4720
4720
|
account_subtype?: string;
|
|
4721
4721
|
};
|
|
4722
4722
|
export type EditAccount = {
|
|
4723
|
-
stable_name?:
|
|
4723
|
+
stable_name?: {
|
|
4724
|
+
type: 'StableName';
|
|
4725
|
+
stable_name: string;
|
|
4726
|
+
};
|
|
4724
4727
|
name: string;
|
|
4725
4728
|
normality: Direction;
|
|
4726
4729
|
parent_id?: {
|
package/dist/index.js
CHANGED
|
@@ -764,18 +764,6 @@ var useBankTransactionsContext = () => (0, import_react9.useContext)(BankTransac
|
|
|
764
764
|
// src/hooks/useBankTransactions/useBankTransactions.tsx
|
|
765
765
|
var import_react11 = require("react");
|
|
766
766
|
|
|
767
|
-
// src/components/BankTransactions/constants.ts
|
|
768
|
-
var CategorizedCategories = [
|
|
769
|
-
"CATEGORIZED" /* CATEGORIZED */,
|
|
770
|
-
"JOURNALING" /* JOURNALING */,
|
|
771
|
-
"SPLIT" /* SPLIT */,
|
|
772
|
-
"MATCHED" /* MATCHED */
|
|
773
|
-
];
|
|
774
|
-
var ReviewCategories = [
|
|
775
|
-
"READY_FOR_INPUT" /* READY_FOR_INPUT */,
|
|
776
|
-
"LAYER_REVIEW" /* LAYER_REVIEW */
|
|
777
|
-
];
|
|
778
|
-
|
|
779
767
|
// src/hooks/useLinkedAccounts/useLinkedAccounts.ts
|
|
780
768
|
var import_react10 = require("react");
|
|
781
769
|
var import_react_plaid_link = require("react-plaid-link");
|
|
@@ -1388,7 +1376,7 @@ var useBankTransactions = (params) => {
|
|
|
1388
1376
|
mutate(updatedData, { revalidate: false });
|
|
1389
1377
|
};
|
|
1390
1378
|
const shouldHideAfterCategorize = (bankTransaction) => {
|
|
1391
|
-
return filters?.categorizationStatus === "review" /* review
|
|
1379
|
+
return filters?.categorizationStatus === "review" /* review */;
|
|
1392
1380
|
};
|
|
1393
1381
|
const removeAfterCategorize = (bankTransaction) => {
|
|
1394
1382
|
if (shouldHideAfterCategorize(bankTransaction)) {
|
|
@@ -2330,6 +2318,18 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React16.createElement
|
|
|
2330
2318
|
);
|
|
2331
2319
|
var Sunrise_default = Sunrise;
|
|
2332
2320
|
|
|
2321
|
+
// src/components/BankTransactions/constants.ts
|
|
2322
|
+
var CategorizedCategories = [
|
|
2323
|
+
"CATEGORIZED" /* CATEGORIZED */,
|
|
2324
|
+
"JOURNALING" /* JOURNALING */,
|
|
2325
|
+
"SPLIT" /* SPLIT */,
|
|
2326
|
+
"MATCHED" /* MATCHED */
|
|
2327
|
+
];
|
|
2328
|
+
var ReviewCategories = [
|
|
2329
|
+
"READY_FOR_INPUT" /* READY_FOR_INPUT */,
|
|
2330
|
+
"LAYER_REVIEW" /* LAYER_REVIEW */
|
|
2331
|
+
];
|
|
2332
|
+
|
|
2333
2333
|
// src/components/BankTransactions/utils.ts
|
|
2334
2334
|
var filterVisibility = (scope, bankTransaction) => {
|
|
2335
2335
|
const categorized = CategorizedCategories.includes(
|
|
@@ -5725,7 +5725,7 @@ var import_classnames32 = __toESM(require("classnames"));
|
|
|
5725
5725
|
var isAlreadyMatched2 = (bankTransaction) => {
|
|
5726
5726
|
if (bankTransaction?.match) {
|
|
5727
5727
|
const foundMatch = bankTransaction.suggested_matches?.find(
|
|
5728
|
-
(x) => x.details.id === bankTransaction?.match?.details.id
|
|
5728
|
+
(x) => x.details.id === bankTransaction?.match?.details.id || x.details.id === bankTransaction?.match?.bank_transaction.id
|
|
5729
5729
|
);
|
|
5730
5730
|
return foundMatch?.id;
|
|
5731
5731
|
}
|
|
@@ -5763,7 +5763,7 @@ var ExpandedBankTransactionRow = (0, import_react66.forwardRef)(
|
|
|
5763
5763
|
bankTransaction.category ? "categorize" /* categorize */ : hasMatch(bankTransaction) ? "match" /* match */ : "categorize" /* categorize */
|
|
5764
5764
|
);
|
|
5765
5765
|
const [selectedMatchId, setSelectedMatchId] = (0, import_react66.useState)(
|
|
5766
|
-
isAlreadyMatched2(bankTransaction)
|
|
5766
|
+
isAlreadyMatched2(bankTransaction) ?? bankTransaction?.suggested_matches?.[0]?.id
|
|
5767
5767
|
);
|
|
5768
5768
|
const [matchFormError, setMatchFormError] = (0, import_react66.useState)();
|
|
5769
5769
|
const [splitFormError, setSplitFormError] = (0, import_react66.useState)();
|
|
@@ -5886,9 +5886,12 @@ var ExpandedBankTransactionRow = (0, import_react66.forwardRef)(
|
|
|
5886
5886
|
if (purpose === "match" /* match */) {
|
|
5887
5887
|
if (!selectedMatchId) {
|
|
5888
5888
|
setMatchFormError("Select an option to match the transaction");
|
|
5889
|
+
return;
|
|
5889
5890
|
} else if (selectedMatchId && selectedMatchId !== isAlreadyMatched2(bankTransaction)) {
|
|
5890
|
-
onMatchSubmit(selectedMatchId);
|
|
5891
|
+
await onMatchSubmit(selectedMatchId);
|
|
5892
|
+
return;
|
|
5891
5893
|
}
|
|
5894
|
+
close();
|
|
5892
5895
|
return;
|
|
5893
5896
|
}
|
|
5894
5897
|
if (!validateSplit(rowState)) {
|
|
@@ -12333,7 +12336,10 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
12333
12336
|
}
|
|
12334
12337
|
const data2 = {
|
|
12335
12338
|
name: form.data.name ?? "",
|
|
12336
|
-
stable_name: form.data.stable_name
|
|
12339
|
+
stable_name: form.data.stable_name ? {
|
|
12340
|
+
type: "StableName",
|
|
12341
|
+
stable_name: form.data.stable_name
|
|
12342
|
+
} : void 0,
|
|
12337
12343
|
parent_id: form.data.parent ? {
|
|
12338
12344
|
type: "AccountId",
|
|
12339
12345
|
id: form.data.parent.value
|