@layerfi/components 0.1.51 → 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 +15 -10
- package/dist/esm/index.js.map +3 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.js +15 -9
- 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]);
|
|
@@ -8399,6 +8403,7 @@ var BankTransactionsContent = ({
|
|
|
8399
8403
|
showDescriptions = false,
|
|
8400
8404
|
showReceiptUploads = false,
|
|
8401
8405
|
monthlyView = false,
|
|
8406
|
+
categorizeView: categorizeViewProp,
|
|
8402
8407
|
mobileComponent,
|
|
8403
8408
|
filters: inputFilters,
|
|
8404
8409
|
hideHeader = false,
|
|
@@ -8410,7 +8415,7 @@ var BankTransactionsContent = ({
|
|
|
8410
8415
|
startDate: (0, import_date_fns15.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
8411
8416
|
endDate: (0, import_date_fns15.endOfMonth)(/* @__PURE__ */ new Date())
|
|
8412
8417
|
});
|
|
8413
|
-
const categorizeView = categorizationEnabled(mode);
|
|
8418
|
+
const categorizeView = categorizeViewProp ?? categorizationEnabled(mode);
|
|
8414
8419
|
const {
|
|
8415
8420
|
activate,
|
|
8416
8421
|
data,
|
|
@@ -8464,13 +8469,13 @@ var BankTransactionsContent = ({
|
|
|
8464
8469
|
}, []);
|
|
8465
8470
|
(0, import_react94.useEffect)(() => {
|
|
8466
8471
|
if (JSON.stringify(inputFilters) !== JSON.stringify(filters)) {
|
|
8467
|
-
if (!
|
|
8472
|
+
if (!inputFilters?.categorizationStatus && categorizeView) {
|
|
8468
8473
|
setFilters({
|
|
8469
8474
|
...filters,
|
|
8470
8475
|
...inputFilters,
|
|
8471
8476
|
categorizationStatus: "review" /* review */
|
|
8472
8477
|
});
|
|
8473
|
-
} else if (!
|
|
8478
|
+
} else if (!inputFilters?.categorizationStatus && !categorizationEnabled(mode)) {
|
|
8474
8479
|
setFilters({
|
|
8475
8480
|
...filters,
|
|
8476
8481
|
...inputFilters,
|
|
@@ -8479,11 +8484,11 @@ var BankTransactionsContent = ({
|
|
|
8479
8484
|
} else {
|
|
8480
8485
|
setFilters({ ...filters, ...inputFilters });
|
|
8481
8486
|
}
|
|
8482
|
-
} else if (!
|
|
8487
|
+
} else if (!inputFilters?.categorizationStatus && categorizeView) {
|
|
8483
8488
|
setFilters({
|
|
8484
8489
|
categorizationStatus: "review" /* review */
|
|
8485
8490
|
});
|
|
8486
|
-
} else if (!
|
|
8491
|
+
} else if (!inputFilters?.categorizationStatus && !categorizationEnabled(mode)) {
|
|
8487
8492
|
setFilters({
|
|
8488
8493
|
categorizationStatus: "categorized" /* categorized */
|
|
8489
8494
|
});
|
|
@@ -8509,7 +8514,7 @@ var BankTransactionsContent = ({
|
|
|
8509
8514
|
}, [currentPage, data, dateRange]);
|
|
8510
8515
|
const onCategorizationDisplayChange = (event) => {
|
|
8511
8516
|
setFilters({
|
|
8512
|
-
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 */
|
|
8513
8518
|
});
|
|
8514
8519
|
setCurrentPage(1);
|
|
8515
8520
|
};
|
|
@@ -8535,7 +8540,7 @@ var BankTransactionsContent = ({
|
|
|
8535
8540
|
}
|
|
8536
8541
|
debounceContainerWidth(size?.width);
|
|
8537
8542
|
});
|
|
8538
|
-
const editable = display === "review" /* review */;
|
|
8543
|
+
const editable = display === "review" /* review */ || display === "all" /* all */;
|
|
8539
8544
|
const isLastPage = data && !hasMore && Math.ceil((data?.length || 0) / pageSize) === currentPage;
|
|
8540
8545
|
return /* @__PURE__ */ import_react94.default.createElement(
|
|
8541
8546
|
Container,
|
|
@@ -15658,6 +15663,7 @@ var Components = ({
|
|
|
15658
15663
|
BookkeepingOverview,
|
|
15659
15664
|
BookkeepingUpsellBar,
|
|
15660
15665
|
ChartOfAccounts,
|
|
15666
|
+
Direction,
|
|
15661
15667
|
DisplayState,
|
|
15662
15668
|
GeneralLedgerView,
|
|
15663
15669
|
Journal,
|