@layerfi/components 0.1.55 → 0.1.56
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 +2247 -1575
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +238 -3
- package/dist/index.js +2320 -1650
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +163 -3
- package/dist/styles/index.css.map +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -308,13 +308,20 @@ declare module '@layerfi/components/api/layer/linked_accounts' {
|
|
|
308
308
|
declare module '@layerfi/components/api/layer/profit_and_loss' {
|
|
309
309
|
import { ProfitAndLoss } from '@layerfi/components/types';
|
|
310
310
|
import { S3PresignedUrl } from '@layerfi/components/types/general';
|
|
311
|
-
import { ProfitAndLossSummaries } from '@layerfi/components/types/profit_and_loss';
|
|
311
|
+
import { ProfitAndLossComparison, ProfitAndLossSummaries } from '@layerfi/components/types/profit_and_loss';
|
|
312
312
|
export const getProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
313
313
|
params?: Record<string, string | undefined> | undefined;
|
|
314
314
|
} | undefined) => () => Promise<{
|
|
315
315
|
data?: ProfitAndLoss | undefined;
|
|
316
316
|
error?: unknown;
|
|
317
317
|
}>;
|
|
318
|
+
export const compareProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
319
|
+
params?: Record<string, string | undefined> | undefined;
|
|
320
|
+
body?: Record<string, unknown> | undefined;
|
|
321
|
+
} | undefined) => Promise<{
|
|
322
|
+
data?: ProfitAndLossComparison | undefined;
|
|
323
|
+
error?: unknown;
|
|
324
|
+
}>;
|
|
318
325
|
export const getProfitAndLossSummaries: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
319
326
|
params?: Record<string, string | undefined> | undefined;
|
|
320
327
|
} | undefined) => () => Promise<{
|
|
@@ -554,6 +561,13 @@ declare module '@layerfi/components/api/layer' {
|
|
|
554
561
|
} | undefined) => () => Promise<{
|
|
555
562
|
data: import("@layerfi/components/types").JournalEntry[];
|
|
556
563
|
}>;
|
|
564
|
+
compareProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
565
|
+
params?: Record<string, string | undefined> | undefined;
|
|
566
|
+
body?: Record<string, unknown> | undefined;
|
|
567
|
+
} | undefined) => Promise<{
|
|
568
|
+
data?: import("@layerfi/components/types/profit_and_loss").ProfitAndLossComparison | undefined;
|
|
569
|
+
error?: unknown;
|
|
570
|
+
}>;
|
|
557
571
|
createJournalEntries: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
558
572
|
params?: Record<string, string | undefined> | undefined;
|
|
559
573
|
body?: Record<string, unknown> | undefined;
|
|
@@ -744,6 +758,7 @@ declare module '@layerfi/components/components/Badge/Badge' {
|
|
|
744
758
|
}
|
|
745
759
|
export enum BadgeVariant {
|
|
746
760
|
DEFAULT = "default",
|
|
761
|
+
INFO = "info",
|
|
747
762
|
SUCCESS = "success",
|
|
748
763
|
WARNING = "warning",
|
|
749
764
|
ERROR = "error"
|
|
@@ -1342,6 +1357,20 @@ declare module '@layerfi/components/components/Button/SubmitButton' {
|
|
|
1342
1357
|
}
|
|
1343
1358
|
export const SubmitButton: ({ active, className, processing, disabled, error, children, action, noIcon, ...props }: SubmitButtonProps) => React.JSX.Element;
|
|
1344
1359
|
|
|
1360
|
+
}
|
|
1361
|
+
declare module '@layerfi/components/components/Button/SwitchButton' {
|
|
1362
|
+
import React from 'react';
|
|
1363
|
+
interface SwitchButtonProps {
|
|
1364
|
+
children: string;
|
|
1365
|
+
labelPosition?: 'left' | 'right';
|
|
1366
|
+
checked?: boolean;
|
|
1367
|
+
defaultChecked?: boolean;
|
|
1368
|
+
onChange?: (checked: boolean) => void;
|
|
1369
|
+
disabled?: boolean;
|
|
1370
|
+
}
|
|
1371
|
+
export const SwitchButton: React.FC<SwitchButtonProps>;
|
|
1372
|
+
export {};
|
|
1373
|
+
|
|
1345
1374
|
}
|
|
1346
1375
|
declare module '@layerfi/components/components/Button/TextButton' {
|
|
1347
1376
|
import React, { ButtonHTMLAttributes } from 'react';
|
|
@@ -1358,6 +1387,7 @@ declare module '@layerfi/components/components/Button/index' {
|
|
|
1358
1387
|
export { BackButton } from '@layerfi/components/components/Button/BackButton';
|
|
1359
1388
|
export { CloseButton } from '@layerfi/components/components/Button/CloseButton';
|
|
1360
1389
|
export { ExpandButton } from '@layerfi/components/components/Button/ExpandButton';
|
|
1390
|
+
export { SwitchButton } from '@layerfi/components/components/Button/SwitchButton';
|
|
1361
1391
|
export { Link } from '@layerfi/components/components/Button/Link';
|
|
1362
1392
|
|
|
1363
1393
|
}
|
|
@@ -1411,6 +1441,7 @@ declare module '@layerfi/components/components/CategorySelect/CategorySelect' {
|
|
|
1411
1441
|
payload: CategoryOptionPayload;
|
|
1412
1442
|
}
|
|
1413
1443
|
export const mapCategoryToOption: (category: Category) => CategoryOption;
|
|
1444
|
+
export const mapCategoryToExclusionOption: (category: Category) => CategoryOption;
|
|
1414
1445
|
export const mapSuggestedMatchToOption: (record: SuggestedMatch) => CategoryOption;
|
|
1415
1446
|
export const CategorySelect: ({ bankTransaction, name, value, onChange, disabled, className, excludeMatches, asDrawer, }: Props) => React.JSX.Element;
|
|
1416
1447
|
export {};
|
|
@@ -1869,6 +1900,25 @@ declare module '@layerfi/components/components/Input/InputWithBadge' {
|
|
|
1869
1900
|
}
|
|
1870
1901
|
export const InputWithBadge: ({ className, isInvalid, errorMessage, leftText, badge, variant, ...props }: InputWithBadgeProps) => React.JSX.Element;
|
|
1871
1902
|
|
|
1903
|
+
}
|
|
1904
|
+
declare module '@layerfi/components/components/Input/MultiSelect' {
|
|
1905
|
+
import React from 'react';
|
|
1906
|
+
import { GroupBase, MultiValue, OptionsOrGroups } from 'react-select';
|
|
1907
|
+
export interface SelectProps<T> {
|
|
1908
|
+
name?: string;
|
|
1909
|
+
options?: OptionsOrGroups<T, GroupBase<T>>;
|
|
1910
|
+
className?: string;
|
|
1911
|
+
classNamePrefix?: string;
|
|
1912
|
+
value?: T[];
|
|
1913
|
+
defaultValue?: T[];
|
|
1914
|
+
onChange: (selected: MultiValue<T>) => void;
|
|
1915
|
+
disabled?: boolean;
|
|
1916
|
+
placeholder?: string;
|
|
1917
|
+
isInvalid?: boolean;
|
|
1918
|
+
errorMessage?: string;
|
|
1919
|
+
}
|
|
1920
|
+
export const MultiSelect: <T>({ name, options, className, classNamePrefix, value, defaultValue, onChange, disabled, placeholder, isInvalid, errorMessage, }: SelectProps<T>) => React.JSX.Element;
|
|
1921
|
+
|
|
1872
1922
|
}
|
|
1873
1923
|
declare module '@layerfi/components/components/Input/Select' {
|
|
1874
1924
|
import React from 'react';
|
|
@@ -1894,6 +1944,7 @@ declare module '@layerfi/components/components/Input/index' {
|
|
|
1894
1944
|
export { FileInput } from '@layerfi/components/components/Input/FileInput';
|
|
1895
1945
|
export { Select } from '@layerfi/components/components/Input/Select';
|
|
1896
1946
|
export { InputWithBadge } from '@layerfi/components/components/Input/InputWithBadge';
|
|
1947
|
+
export { MultiSelect } from '@layerfi/components/components/Input/MultiSelect';
|
|
1897
1948
|
|
|
1898
1949
|
}
|
|
1899
1950
|
declare module '@layerfi/components/components/Journal/Journal' {
|
|
@@ -2378,7 +2429,21 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
|
|
|
2378
2429
|
sortBy: (scope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").Scope, field: string, direction?: import("../../types").SortDirection | undefined) => void;
|
|
2379
2430
|
setFilterTypes: (scope: import("@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss").Scope, types: string[]) => void;
|
|
2380
2431
|
}>;
|
|
2432
|
+
ComparisonContext: React.Context<{
|
|
2433
|
+
data: import("@layerfi/components/types/profit_and_loss").ProfitAndLossComparisonItem[] | undefined;
|
|
2434
|
+
isLoading: boolean;
|
|
2435
|
+
isValidating: boolean;
|
|
2436
|
+
error: unknown;
|
|
2437
|
+
compareMode: boolean;
|
|
2438
|
+
setCompareMode: (mode: boolean) => void;
|
|
2439
|
+
compareMonths: number;
|
|
2440
|
+
setCompareMonths: (months: number) => void;
|
|
2441
|
+
compareOptions: import("@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions").TagComparisonOption[];
|
|
2442
|
+
setCompareOptions: (options: import("@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions").TagComparisonOption[]) => void;
|
|
2443
|
+
refetch: (dateRange: import("@layerfi/components/types").DateRange, actAsInitial?: boolean | undefined) => void;
|
|
2444
|
+
}>;
|
|
2381
2445
|
DatePicker: () => React.JSX.Element;
|
|
2446
|
+
CompareOptions: ({ tagComparisonOptions, defaultTagFilter: defaultOption, }: import("@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions").ProfitAndLossCompareOptionsProps) => React.JSX.Element;
|
|
2382
2447
|
Summaries: ({ vertical, actionable, revenueLabel, stringOverrides, }: {
|
|
2383
2448
|
vertical?: boolean | undefined;
|
|
2384
2449
|
actionable?: boolean | undefined;
|
|
@@ -2393,6 +2458,7 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
|
|
|
2393
2458
|
chartColorsList?: string[] | undefined;
|
|
2394
2459
|
stringOverrides?: import("@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts").ProfitAndLossDetailedChartsStringOverrides | undefined;
|
|
2395
2460
|
}) => React.JSX.Element;
|
|
2461
|
+
Header: ({ text, className, headingClassName, withDatePicker, }: import("@layerfi/components/components/ProfitAndLossHeader/ProfitAndLossHeader").ProfitAndLossHeaderProps) => React.JSX.Element;
|
|
2396
2462
|
};
|
|
2397
2463
|
export { ProfitAndLoss };
|
|
2398
2464
|
|
|
@@ -2400,6 +2466,11 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
|
|
|
2400
2466
|
declare module '@layerfi/components/components/ProfitAndLoss/index' {
|
|
2401
2467
|
export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss';
|
|
2402
2468
|
|
|
2469
|
+
}
|
|
2470
|
+
declare module '@layerfi/components/components/ProfitAndLossChart/ChartStateCard' {
|
|
2471
|
+
import React from 'react';
|
|
2472
|
+
export const ChartStateCard: () => React.JSX.Element;
|
|
2473
|
+
|
|
2403
2474
|
}
|
|
2404
2475
|
declare module '@layerfi/components/components/ProfitAndLossChart/Indicator' {
|
|
2405
2476
|
import React from 'react';
|
|
@@ -2428,6 +2499,31 @@ declare module '@layerfi/components/components/ProfitAndLossChart/ProfitAndLossC
|
|
|
2428
2499
|
declare module '@layerfi/components/components/ProfitAndLossChart/index' {
|
|
2429
2500
|
export { ProfitAndLossChart } from '@layerfi/components/components/ProfitAndLossChart/ProfitAndLossChart';
|
|
2430
2501
|
|
|
2502
|
+
}
|
|
2503
|
+
declare module '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions' {
|
|
2504
|
+
import React from 'react';
|
|
2505
|
+
export interface ProfitAndLossCompareOptionsProps {
|
|
2506
|
+
tagComparisonOptions: TagComparisonOption[];
|
|
2507
|
+
defaultTagFilter: TagComparisonOption;
|
|
2508
|
+
}
|
|
2509
|
+
export interface TagComparisonOption {
|
|
2510
|
+
displayName: string;
|
|
2511
|
+
tagFilterConfig: TagViewConfig;
|
|
2512
|
+
}
|
|
2513
|
+
export type TagViewConfig = {
|
|
2514
|
+
structure?: string;
|
|
2515
|
+
tagFilters: TagFilterInput;
|
|
2516
|
+
};
|
|
2517
|
+
export type TagFilterInput = {
|
|
2518
|
+
tagKey: string;
|
|
2519
|
+
tagValues: string[];
|
|
2520
|
+
} | 'None';
|
|
2521
|
+
export const ProfitAndLossCompareOptions: ({ tagComparisonOptions, defaultTagFilter: defaultOption, }: ProfitAndLossCompareOptionsProps) => React.JSX.Element;
|
|
2522
|
+
|
|
2523
|
+
}
|
|
2524
|
+
declare module '@layerfi/components/components/ProfitAndLossCompareOptions/index' {
|
|
2525
|
+
export { ProfitAndLossCompareOptions } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
|
|
2526
|
+
|
|
2431
2527
|
}
|
|
2432
2528
|
declare module '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker' {
|
|
2433
2529
|
import React from 'react';
|
|
@@ -2516,6 +2612,21 @@ declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/Profi
|
|
|
2516
2612
|
declare module '@layerfi/components/components/ProfitAndLossDetailedCharts/index' {
|
|
2517
2613
|
export { ProfitAndLossDetailedCharts } from '@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts';
|
|
2518
2614
|
|
|
2615
|
+
}
|
|
2616
|
+
declare module '@layerfi/components/components/ProfitAndLossHeader/ProfitAndLossHeader' {
|
|
2617
|
+
import React from 'react';
|
|
2618
|
+
export interface ProfitAndLossHeaderProps {
|
|
2619
|
+
text?: string;
|
|
2620
|
+
className?: string;
|
|
2621
|
+
headingClassName?: string;
|
|
2622
|
+
withDatePicker?: boolean;
|
|
2623
|
+
}
|
|
2624
|
+
export const ProfitAndLossHeader: ({ text, className, headingClassName, withDatePicker, }: ProfitAndLossHeaderProps) => React.JSX.Element;
|
|
2625
|
+
|
|
2626
|
+
}
|
|
2627
|
+
declare module '@layerfi/components/components/ProfitAndLossHeader/index' {
|
|
2628
|
+
export { ProfitAndLossHeader } from '@layerfi/components/components/ProfitAndLossHeader/ProfitAndLossHeader';
|
|
2629
|
+
|
|
2519
2630
|
}
|
|
2520
2631
|
declare module '@layerfi/components/components/ProfitAndLossSummaries/MiniChart' {
|
|
2521
2632
|
import React from 'react';
|
|
@@ -2546,6 +2657,16 @@ declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndL
|
|
|
2546
2657
|
declare module '@layerfi/components/components/ProfitAndLossSummaries/index' {
|
|
2547
2658
|
export { ProfitAndLossSummaries } from '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries';
|
|
2548
2659
|
|
|
2660
|
+
}
|
|
2661
|
+
declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossCompareTable' {
|
|
2662
|
+
import React from 'react';
|
|
2663
|
+
import { ProfitAndLossTableStringOverrides } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableComponent';
|
|
2664
|
+
interface ProfilAndLostCompareTableProps {
|
|
2665
|
+
stringOverrides?: ProfitAndLossTableStringOverrides;
|
|
2666
|
+
}
|
|
2667
|
+
export const ProfitAndLossCompareTable: ({ stringOverrides, }: ProfilAndLostCompareTableProps) => React.JSX.Element;
|
|
2668
|
+
export {};
|
|
2669
|
+
|
|
2549
2670
|
}
|
|
2550
2671
|
declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTableComponent' {
|
|
2551
2672
|
import React from 'react';
|
|
@@ -2701,6 +2822,15 @@ declare module '@layerfi/components/components/StatementOfCashFlowTable/Statemen
|
|
|
2701
2822
|
declare module '@layerfi/components/components/StatementOfCashFlowTable/index' {
|
|
2702
2823
|
export { StatementOfCashFlowTable } from '@layerfi/components/components/StatementOfCashFlowTable/StatementOfCashFlowTable';
|
|
2703
2824
|
|
|
2825
|
+
}
|
|
2826
|
+
declare module '@layerfi/components/components/SyncingBadge/SyncingBadge' {
|
|
2827
|
+
import React from 'react';
|
|
2828
|
+
export const SyncingBadge: () => React.JSX.Element;
|
|
2829
|
+
|
|
2830
|
+
}
|
|
2831
|
+
declare module '@layerfi/components/components/SyncingBadge/index' {
|
|
2832
|
+
export { SyncingBadge } from '@layerfi/components/components/SyncingBadge/SyncingBadge';
|
|
2833
|
+
|
|
2704
2834
|
}
|
|
2705
2835
|
declare module '@layerfi/components/components/SyncingComponent/SyncingComponent' {
|
|
2706
2836
|
import React from 'react';
|
|
@@ -3536,6 +3666,29 @@ declare module '@layerfi/components/contexts/LinkedAccountsContext/LinkedAccount
|
|
|
3536
3666
|
declare module '@layerfi/components/contexts/LinkedAccountsContext/index' {
|
|
3537
3667
|
export { LinkedAccountsContext } from '@layerfi/components/contexts/LinkedAccountsContext/LinkedAccountsContext';
|
|
3538
3668
|
|
|
3669
|
+
}
|
|
3670
|
+
declare module '@layerfi/components/contexts/ProfitAndLossComparisonContext/ProfitAndLossComparisonContext' {
|
|
3671
|
+
/// <reference types="react" />
|
|
3672
|
+
import { TagComparisonOption } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
|
|
3673
|
+
import { DateRange } from '@layerfi/components/types';
|
|
3674
|
+
export const PNLComparisonContext: import("react").Context<{
|
|
3675
|
+
data: import("@layerfi/components/types/profit_and_loss").ProfitAndLossComparisonItem[] | undefined;
|
|
3676
|
+
isLoading: boolean;
|
|
3677
|
+
isValidating: boolean;
|
|
3678
|
+
error: unknown;
|
|
3679
|
+
compareMode: boolean;
|
|
3680
|
+
setCompareMode: (mode: boolean) => void;
|
|
3681
|
+
compareMonths: number;
|
|
3682
|
+
setCompareMonths: (months: number) => void;
|
|
3683
|
+
compareOptions: TagComparisonOption[];
|
|
3684
|
+
setCompareOptions: (options: TagComparisonOption[]) => void;
|
|
3685
|
+
refetch: (dateRange: DateRange, actAsInitial?: boolean | undefined) => void;
|
|
3686
|
+
}>;
|
|
3687
|
+
|
|
3688
|
+
}
|
|
3689
|
+
declare module '@layerfi/components/contexts/ProfitAndLossComparisonContext/index' {
|
|
3690
|
+
export { PNLComparisonContext } from '@layerfi/components/contexts/ProfitAndLossComparisonContext/ProfitAndLossComparisonContext';
|
|
3691
|
+
|
|
3539
3692
|
}
|
|
3540
3693
|
declare module '@layerfi/components/contexts/StatementOfCashContext/StatementOfCashFlowContext' {
|
|
3541
3694
|
/// <reference types="react" />
|
|
@@ -3656,12 +3809,13 @@ declare module '@layerfi/components/hooks/useBankTransactions/useBankTransaction
|
|
|
3656
3809
|
|
|
3657
3810
|
}
|
|
3658
3811
|
declare module '@layerfi/components/hooks/useBankTransactions/utils' {
|
|
3659
|
-
import { BankTransaction } from '@layerfi/components/types';
|
|
3812
|
+
import { BankTransaction, DisplayState } from '@layerfi/components/types';
|
|
3660
3813
|
import { AccountItem, NumericRangeFilter } from '@layerfi/components/hooks/useBankTransactions/types';
|
|
3661
3814
|
export const collectAccounts: (transactions?: BankTransaction[]) => AccountItem[];
|
|
3662
3815
|
export const uniqAccountsList: (arr: AccountItem[], track?: Set<unknown>) => AccountItem[];
|
|
3663
3816
|
export const applyAmountFilter: (data?: BankTransaction[], filter?: NumericRangeFilter) => BankTransaction[] | undefined;
|
|
3664
3817
|
export const applyAccountFilter: (data?: BankTransaction[], filter?: string[]) => BankTransaction[] | undefined;
|
|
3818
|
+
export const applyCategorizationStatusFilter: (data?: BankTransaction[], filter?: DisplayState) => BankTransaction[] | undefined;
|
|
3665
3819
|
|
|
3666
3820
|
}
|
|
3667
3821
|
declare module '@layerfi/components/hooks/useChartOfAccounts/index' {
|
|
@@ -3989,6 +4143,36 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossQuery
|
|
|
3989
4143
|
export const useProfitAndLossQuery: UseProfitAndLossQueryReturn;
|
|
3990
4144
|
export {};
|
|
3991
4145
|
|
|
4146
|
+
}
|
|
4147
|
+
declare module '@layerfi/components/hooks/useProfitAndLossComparison/index' {
|
|
4148
|
+
export { useProfitAndLossComparison } from '@layerfi/components/hooks/useProfitAndLossComparison/useProfitAndLossComparison';
|
|
4149
|
+
|
|
4150
|
+
}
|
|
4151
|
+
declare module '@layerfi/components/hooks/useProfitAndLossComparison/useProfitAndLossComparison' {
|
|
4152
|
+
import { TagComparisonOption } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
|
|
4153
|
+
import { DateRange, ReportingBasis } from '@layerfi/components/types';
|
|
4154
|
+
import { ProfitAndLossComparisonItem } from '@layerfi/components/types/profit_and_loss';
|
|
4155
|
+
export type Scope = 'expenses' | 'revenue';
|
|
4156
|
+
export type SidebarScope = Scope | undefined;
|
|
4157
|
+
type Props = {
|
|
4158
|
+
reportingBasis?: ReportingBasis;
|
|
4159
|
+
};
|
|
4160
|
+
type UseProfitAndLossComparison = (props: Props) => {
|
|
4161
|
+
data: ProfitAndLossComparisonItem[] | undefined;
|
|
4162
|
+
isLoading: boolean;
|
|
4163
|
+
isValidating: boolean;
|
|
4164
|
+
error: unknown;
|
|
4165
|
+
compareMode: boolean;
|
|
4166
|
+
setCompareMode: (mode: boolean) => void;
|
|
4167
|
+
compareMonths: number;
|
|
4168
|
+
setCompareMonths: (months: number) => void;
|
|
4169
|
+
compareOptions: TagComparisonOption[];
|
|
4170
|
+
setCompareOptions: (options: TagComparisonOption[]) => void;
|
|
4171
|
+
refetch: (dateRange: DateRange, actAsInitial?: boolean) => void;
|
|
4172
|
+
};
|
|
4173
|
+
export const useProfitAndLossComparison: UseProfitAndLossComparison;
|
|
4174
|
+
export {};
|
|
4175
|
+
|
|
3992
4176
|
}
|
|
3993
4177
|
declare module '@layerfi/components/hooks/useQuickbooks/index' {
|
|
3994
4178
|
export { useQuickbooks } from '@layerfi/components/hooks/useQuickbooks/useQuickbooks';
|
|
@@ -4092,6 +4276,13 @@ declare module '@layerfi/components/icons/BackArrow' {
|
|
|
4092
4276
|
const BackArrow: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
4093
4277
|
export default BackArrow;
|
|
4094
4278
|
|
|
4279
|
+
}
|
|
4280
|
+
declare module '@layerfi/components/icons/BarChart2' {
|
|
4281
|
+
import * as React from 'react';
|
|
4282
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
4283
|
+
const BarChart2: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
4284
|
+
export default BarChart2;
|
|
4285
|
+
|
|
4095
4286
|
}
|
|
4096
4287
|
declare module '@layerfi/components/icons/Bell' {
|
|
4097
4288
|
import * as React from 'react';
|
|
@@ -4612,6 +4803,7 @@ declare module '@layerfi/components/types/categories' {
|
|
|
4612
4803
|
MATCHED = "MATCHED"
|
|
4613
4804
|
}
|
|
4614
4805
|
export interface CategoryEntry {
|
|
4806
|
+
type?: string;
|
|
4615
4807
|
amount?: number;
|
|
4616
4808
|
category: Category;
|
|
4617
4809
|
}
|
|
@@ -5131,6 +5323,39 @@ declare module '@layerfi/components/types/profit_and_loss' {
|
|
|
5131
5323
|
personal_expenses?: LineItem | null;
|
|
5132
5324
|
fully_categorized: boolean;
|
|
5133
5325
|
}
|
|
5326
|
+
export interface ProfitAndLossComparison {
|
|
5327
|
+
type: string;
|
|
5328
|
+
pnls: ProfitAndLossComparisonItem[];
|
|
5329
|
+
}
|
|
5330
|
+
export interface ProfitAndLossComparisonPnl {
|
|
5331
|
+
business_id: string;
|
|
5332
|
+
start_date: string;
|
|
5333
|
+
end_date: string;
|
|
5334
|
+
income: LineItem;
|
|
5335
|
+
cost_of_goods_sold: LineItem;
|
|
5336
|
+
gross_profit: number;
|
|
5337
|
+
expenses: LineItem;
|
|
5338
|
+
profit_before_taxes: number;
|
|
5339
|
+
taxes: LineItem;
|
|
5340
|
+
net_profit: number;
|
|
5341
|
+
other_outflows?: LineItem | null;
|
|
5342
|
+
personal_expenses?: LineItem | null;
|
|
5343
|
+
fully_categorized: boolean;
|
|
5344
|
+
}
|
|
5345
|
+
export interface ProfitAndLossComparisonItem {
|
|
5346
|
+
period: {
|
|
5347
|
+
type: string;
|
|
5348
|
+
year?: number;
|
|
5349
|
+
month?: number;
|
|
5350
|
+
start_date?: string;
|
|
5351
|
+
end_date?: string;
|
|
5352
|
+
};
|
|
5353
|
+
tag_filter?: {
|
|
5354
|
+
key: string;
|
|
5355
|
+
values: string[];
|
|
5356
|
+
};
|
|
5357
|
+
pnl: ProfitAndLossComparisonPnl;
|
|
5358
|
+
}
|
|
5134
5359
|
export interface ProfitAndLossSummary {
|
|
5135
5360
|
year: number;
|
|
5136
5361
|
month: number;
|
|
@@ -5355,6 +5580,13 @@ declare module '@layerfi/components/utils/journal' {
|
|
|
5355
5580
|
import { JournalEntryLineItem } from '@layerfi/components/types/journal';
|
|
5356
5581
|
export const getAccountIdentifierPayload: (journalLineItem: JournalEntryLineItem) => AccountIdentifierPayloadObject;
|
|
5357
5582
|
|
|
5583
|
+
}
|
|
5584
|
+
declare module '@layerfi/components/utils/profitAndLossComparisonUtils' {
|
|
5585
|
+
import { LineItem } from '@layerfi/components/types';
|
|
5586
|
+
export const generatComparisonMonths: (startDate: number | Date, numberOfMonths: number) => string[];
|
|
5587
|
+
export const getComparisonValue: (name: string, depth: number, cellData: string | number | LineItem) => string | number;
|
|
5588
|
+
export const mergeComparisonLineItemsAtDepth: (lineItems: LineItem[]) => LineItem[];
|
|
5589
|
+
|
|
5358
5590
|
}
|
|
5359
5591
|
declare module '@layerfi/components/utils/profitAndLossUtils' {
|
|
5360
5592
|
import { SidebarScope } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
|
|
@@ -5471,6 +5703,7 @@ declare module '@layerfi/components/views/GeneralLedger/index' {
|
|
|
5471
5703
|
declare module '@layerfi/components/views/Reports/Reports' {
|
|
5472
5704
|
import React, { RefObject } from 'react';
|
|
5473
5705
|
import { BalanceSheetStringOverrides } from '@layerfi/components/components/BalanceSheet/BalanceSheet';
|
|
5706
|
+
import { ProfitAndLossCompareOptionsProps } from '@layerfi/components/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions';
|
|
5474
5707
|
import { ProfitAndLossDetailedChartsStringOverrides } from '@layerfi/components/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts';
|
|
5475
5708
|
import { ProfitAndLossTableStringOverrides } from '@layerfi/components/components/ProfitAndLossTable/index';
|
|
5476
5709
|
import { StatementOfCashFlowStringOverrides } from '@layerfi/components/components/StatementOfCashFlow/StatementOfCashFlow';
|
|
@@ -5488,18 +5721,20 @@ declare module '@layerfi/components/views/Reports/Reports' {
|
|
|
5488
5721
|
title?: string;
|
|
5489
5722
|
stringOverrides?: ReportsStringOverrides;
|
|
5490
5723
|
enabledReports?: ReportType[];
|
|
5724
|
+
comparisonConfig: ProfitAndLossCompareOptionsProps;
|
|
5491
5725
|
}
|
|
5492
5726
|
type ReportType = 'profitAndLoss' | 'balanceSheet' | 'statementOfCashFlow';
|
|
5493
5727
|
export interface ReportsPanelProps {
|
|
5494
5728
|
containerRef: RefObject<HTMLDivElement>;
|
|
5495
5729
|
openReport: ReportType;
|
|
5496
5730
|
stringOverrides?: ReportsStringOverrides;
|
|
5731
|
+
comparisonConfig: ProfitAndLossCompareOptionsProps;
|
|
5497
5732
|
}
|
|
5498
5733
|
interface DownloadButtonStringOverrides {
|
|
5499
5734
|
downloadButtonText?: string;
|
|
5500
5735
|
retryButtonText?: string;
|
|
5501
5736
|
}
|
|
5502
|
-
export const Reports: ({ title, stringOverrides, enabledReports, }: ReportsProps) => React.JSX.Element;
|
|
5737
|
+
export const Reports: ({ title, stringOverrides, enabledReports, comparisonConfig, }: ReportsProps) => React.JSX.Element;
|
|
5503
5738
|
export {};
|
|
5504
5739
|
|
|
5505
5740
|
}
|