@layerfi/components 0.1.50 → 0.1.52
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/.idea/codeStyles/Project.xml +61 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/layer-react.iml +9 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/esm/index.js +29 -29
- package/dist/esm/index.js.map +3 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.js +29 -28
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3454,7 +3454,7 @@ declare module '@layerfi/components/contexts/JournalContext/JournalContext' {
|
|
|
3454
3454
|
form?: import("@layerfi/components/hooks/useJournal/useJournal").JournalFormTypes | undefined;
|
|
3455
3455
|
apiError?: string | undefined;
|
|
3456
3456
|
setForm: (form?: import("@layerfi/components/hooks/useJournal/useJournal").JournalFormTypes | undefined) => void;
|
|
3457
|
-
addEntryLine: (direction: import("@layerfi/components/
|
|
3457
|
+
addEntryLine: (direction: import("@layerfi/components/index").Direction) => void;
|
|
3458
3458
|
removeEntryLine: (index: number) => void;
|
|
3459
3459
|
}>;
|
|
3460
3460
|
|
|
@@ -4348,7 +4348,7 @@ declare module '@layerfi/components/index' {
|
|
|
4348
4348
|
export { useLayerContext } from '@layerfi/components/contexts/LayerContext/index';
|
|
4349
4349
|
export { useBankTransactionsContext } from '@layerfi/components/contexts/BankTransactionsContext/index';
|
|
4350
4350
|
export { BankTransactionsProvider } from '@layerfi/components/providers/BankTransactionsProvider/index';
|
|
4351
|
-
export { DisplayState } from '@layerfi/components/types/bank_transactions';
|
|
4351
|
+
export { DisplayState, Direction } from '@layerfi/components/types/bank_transactions';
|
|
4352
4352
|
|
|
4353
4353
|
}
|
|
4354
4354
|
declare module '@layerfi/components/models/APIError' {
|
|
@@ -4502,6 +4502,7 @@ declare module '@layerfi/components/types/bank_transactions' {
|
|
|
4502
4502
|
CONFIRM_MATCH = "Confirm_Match"
|
|
4503
4503
|
}
|
|
4504
4504
|
export enum DisplayState {
|
|
4505
|
+
all = "all",
|
|
4505
4506
|
review = "review",
|
|
4506
4507
|
categorized = "categorized"
|
|
4507
4508
|
}
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(src_exports, {
|
|
|
38
38
|
BookkeepingOverview: () => BookkeepingOverview,
|
|
39
39
|
BookkeepingUpsellBar: () => BookkeepingUpsellBar,
|
|
40
40
|
ChartOfAccounts: () => ChartOfAccounts,
|
|
41
|
+
Direction: () => Direction,
|
|
41
42
|
DisplayState: () => DisplayState,
|
|
42
43
|
GeneralLedgerView: () => GeneralLedgerView,
|
|
43
44
|
Journal: () => Journal,
|
|
@@ -691,6 +692,7 @@ var Direction = /* @__PURE__ */ ((Direction3) => {
|
|
|
691
692
|
return Direction3;
|
|
692
693
|
})(Direction || {});
|
|
693
694
|
var DisplayState = /* @__PURE__ */ ((DisplayState2) => {
|
|
695
|
+
DisplayState2["all"] = "all";
|
|
694
696
|
DisplayState2["review"] = "review";
|
|
695
697
|
DisplayState2["categorized"] = "categorized";
|
|
696
698
|
return DisplayState2;
|
|
@@ -751,7 +753,7 @@ var filterVisibility = (scope, bankTransaction) => {
|
|
|
751
753
|
const inReview = ReviewCategories.includes(
|
|
752
754
|
bankTransaction.categorization_status
|
|
753
755
|
);
|
|
754
|
-
return scope === "review" /* review */ && inReview || scope === "categorized" /* categorized */ && categorized;
|
|
756
|
+
return scope === "all" /* all */ || scope === "review" /* review */ && inReview || scope === "categorized" /* categorized */ && categorized;
|
|
755
757
|
};
|
|
756
758
|
var isCategorized = (bankTransaction) => CategorizedCategories.includes(bankTransaction.categorization_status);
|
|
757
759
|
|
|
@@ -800,7 +802,7 @@ var applyCategorizationStatusFilter = (data, filter) => {
|
|
|
800
802
|
return data;
|
|
801
803
|
}
|
|
802
804
|
return data?.filter(
|
|
803
|
-
(tx) => filterVisibility(filter, tx) || filter === "review" /* review */ && tx.recently_categorized || filter === "categorized" /* categorized */ && tx.recently_categorized
|
|
805
|
+
(tx) => filterVisibility(filter, tx) || filter === "all" /* all */ || filter === "review" /* review */ && tx.recently_categorized || filter === "categorized" /* categorized */ && tx.recently_categorized
|
|
804
806
|
);
|
|
805
807
|
};
|
|
806
808
|
var appplyDateRangeFilter = (data, filter) => {
|
|
@@ -839,6 +841,8 @@ var useBankTransactions = (params) => {
|
|
|
839
841
|
const display = (0, import_react10.useMemo)(() => {
|
|
840
842
|
if (filters?.categorizationStatus === "review" /* review */) {
|
|
841
843
|
return "review" /* review */;
|
|
844
|
+
} else if (filters?.categorizationStatus === "all" /* all */) {
|
|
845
|
+
return "all" /* all */;
|
|
842
846
|
}
|
|
843
847
|
return "categorized" /* categorized */;
|
|
844
848
|
}, [filters?.categorizationStatus]);
|
|
@@ -4813,25 +4817,20 @@ var allCategoriesDivider = [
|
|
|
4813
4817
|
}
|
|
4814
4818
|
];
|
|
4815
4819
|
function flattenCategories2(categories) {
|
|
4816
|
-
|
|
4817
|
-
if (category
|
|
4818
|
-
|
|
4819
|
-
return [
|
|
4820
|
-
{
|
|
4821
|
-
label: category.display_name,
|
|
4822
|
-
options: category.subCategories.map((x) => mapCategoryToOption2(x))
|
|
4823
|
-
}
|
|
4824
|
-
];
|
|
4825
|
-
}
|
|
4826
|
-
return flattenCategories2(category.subCategories);
|
|
4820
|
+
function getLeafCategories(category) {
|
|
4821
|
+
if (!category.subCategories || category.subCategories.length === 0) {
|
|
4822
|
+
return [category];
|
|
4827
4823
|
}
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4824
|
+
return category.subCategories.flatMap((subCategory) => getLeafCategories(subCategory));
|
|
4825
|
+
}
|
|
4826
|
+
return categories.map(
|
|
4827
|
+
(category) => {
|
|
4828
|
+
return {
|
|
4829
|
+
label: category.display_name,
|
|
4830
|
+
options: getLeafCategories(category).map((x) => mapCategoryToOption2(x))
|
|
4831
|
+
};
|
|
4832
|
+
}
|
|
4833
|
+
);
|
|
4835
4834
|
}
|
|
4836
4835
|
var CategorySelect = ({
|
|
4837
4836
|
bankTransaction,
|
|
@@ -8404,6 +8403,7 @@ var BankTransactionsContent = ({
|
|
|
8404
8403
|
showDescriptions = false,
|
|
8405
8404
|
showReceiptUploads = false,
|
|
8406
8405
|
monthlyView = false,
|
|
8406
|
+
categorizeView: categorizeViewProp,
|
|
8407
8407
|
mobileComponent,
|
|
8408
8408
|
filters: inputFilters,
|
|
8409
8409
|
hideHeader = false,
|
|
@@ -8415,7 +8415,7 @@ var BankTransactionsContent = ({
|
|
|
8415
8415
|
startDate: (0, import_date_fns15.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
8416
8416
|
endDate: (0, import_date_fns15.endOfMonth)(/* @__PURE__ */ new Date())
|
|
8417
8417
|
});
|
|
8418
|
-
const categorizeView = categorizationEnabled(mode);
|
|
8418
|
+
const categorizeView = categorizeViewProp ?? categorizationEnabled(mode);
|
|
8419
8419
|
const {
|
|
8420
8420
|
activate,
|
|
8421
8421
|
data,
|
|
@@ -8469,13 +8469,13 @@ var BankTransactionsContent = ({
|
|
|
8469
8469
|
}, []);
|
|
8470
8470
|
(0, import_react94.useEffect)(() => {
|
|
8471
8471
|
if (JSON.stringify(inputFilters) !== JSON.stringify(filters)) {
|
|
8472
|
-
if (!
|
|
8472
|
+
if (!inputFilters?.categorizationStatus && categorizeView) {
|
|
8473
8473
|
setFilters({
|
|
8474
8474
|
...filters,
|
|
8475
8475
|
...inputFilters,
|
|
8476
8476
|
categorizationStatus: "review" /* review */
|
|
8477
8477
|
});
|
|
8478
|
-
} else if (!
|
|
8478
|
+
} else if (!inputFilters?.categorizationStatus && !categorizationEnabled(mode)) {
|
|
8479
8479
|
setFilters({
|
|
8480
8480
|
...filters,
|
|
8481
8481
|
...inputFilters,
|
|
@@ -8484,11 +8484,11 @@ var BankTransactionsContent = ({
|
|
|
8484
8484
|
} else {
|
|
8485
8485
|
setFilters({ ...filters, ...inputFilters });
|
|
8486
8486
|
}
|
|
8487
|
-
} else if (!
|
|
8487
|
+
} else if (!inputFilters?.categorizationStatus && categorizeView) {
|
|
8488
8488
|
setFilters({
|
|
8489
8489
|
categorizationStatus: "review" /* review */
|
|
8490
8490
|
});
|
|
8491
|
-
} else if (!
|
|
8491
|
+
} else if (!inputFilters?.categorizationStatus && !categorizationEnabled(mode)) {
|
|
8492
8492
|
setFilters({
|
|
8493
8493
|
categorizationStatus: "categorized" /* categorized */
|
|
8494
8494
|
});
|
|
@@ -8514,7 +8514,7 @@ var BankTransactionsContent = ({
|
|
|
8514
8514
|
}, [currentPage, data, dateRange]);
|
|
8515
8515
|
const onCategorizationDisplayChange = (event) => {
|
|
8516
8516
|
setFilters({
|
|
8517
|
-
categorizationStatus: event.target.value === "categorized" /* categorized */ ? "categorized" /* categorized */ : "review" /* review */
|
|
8517
|
+
categorizationStatus: event.target.value === "categorized" /* categorized */ ? "categorized" /* categorized */ : event.target.value === "all" /* all */ ? "all" /* all */ : "review" /* review */
|
|
8518
8518
|
});
|
|
8519
8519
|
setCurrentPage(1);
|
|
8520
8520
|
};
|
|
@@ -8540,7 +8540,7 @@ var BankTransactionsContent = ({
|
|
|
8540
8540
|
}
|
|
8541
8541
|
debounceContainerWidth(size?.width);
|
|
8542
8542
|
});
|
|
8543
|
-
const editable = display === "review" /* review */;
|
|
8543
|
+
const editable = display === "review" /* review */ || display === "all" /* all */;
|
|
8544
8544
|
const isLastPage = data && !hasMore && Math.ceil((data?.length || 0) / pageSize) === currentPage;
|
|
8545
8545
|
return /* @__PURE__ */ import_react94.default.createElement(
|
|
8546
8546
|
Container,
|
|
@@ -11300,7 +11300,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
11300
11300
|
void 0,
|
|
11301
11301
|
void 0,
|
|
11302
11302
|
"summation"
|
|
11303
|
-
), data.
|
|
11303
|
+
), data.personal_expenses ? /* @__PURE__ */ import_react116.default.createElement(import_react116.default.Fragment, null, renderLineItem(data.personal_expenses, 0, "personal_expenses", 7)) : null, data.other_outflows ? /* @__PURE__ */ import_react116.default.createElement(import_react116.default.Fragment, null, renderLineItem(data.other_outflows, 0, "other_outflows", 6)) : null));
|
|
11304
11304
|
};
|
|
11305
11305
|
|
|
11306
11306
|
// src/components/ProfitAndLossTable/ProfitAndLossTableWithProvider.tsx
|
|
@@ -15663,6 +15663,7 @@ var Components = ({
|
|
|
15663
15663
|
BookkeepingOverview,
|
|
15664
15664
|
BookkeepingUpsellBar,
|
|
15665
15665
|
ChartOfAccounts,
|
|
15666
|
+
Direction,
|
|
15666
15667
|
DisplayState,
|
|
15667
15668
|
GeneralLedgerView,
|
|
15668
15669
|
Journal,
|