@layerfi/components 0.1.12 → 0.1.14

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/index.d.ts CHANGED
@@ -641,8 +641,18 @@ declare module '@layerfi/components/components/ChartOfAccountsForm/ChartOfAccoun
641
641
 
642
642
  }
643
643
  declare module '@layerfi/components/components/ChartOfAccountsForm/constants' {
644
+ import { Direction } from '@layerfi/components/types';
644
645
  import { BaseSelectOption } from '@layerfi/components/types/general';
645
- export const SUB_TYPE_OPTIONS: BaseSelectOption[];
646
+ export const LEDGER_ACCOUNT_TYPES: BaseSelectOption[];
647
+ export const DEFAULT_ACCOUNT_TYPE_DIRECTION: Record<string, Direction>;
648
+ export const NORMALITY_OPTIONS: BaseSelectOption[];
649
+ export const ASSET_LEDGER_ACCOUNT_SUBTYPES: BaseSelectOption[];
650
+ export const LIABILITY_LEDGER_ACCOUNT_SUBTYPES: BaseSelectOption[];
651
+ export const EQUITY_LEDGER_ACCOUNT_SUBTYPES: BaseSelectOption[];
652
+ export const REVENUE_LEDGER_ACCOUNT_SUBTYPES: BaseSelectOption[];
653
+ export const EXPENSE_LEDGER_ACCOUNT_SUBTYPES: BaseSelectOption[];
654
+ export const LEDGER_ACCOUNT_SUBTYPES: BaseSelectOption[];
655
+ export const LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE: Record<string, BaseSelectOption[]>;
646
656
 
647
657
  }
648
658
  declare module '@layerfi/components/components/ChartOfAccountsForm/index' {
@@ -901,8 +911,10 @@ declare module '@layerfi/components/components/Input/Select' {
901
911
  onChange: (selected: T) => void;
902
912
  disabled?: boolean;
903
913
  placeholder?: string;
914
+ isInvalid?: boolean;
915
+ errorMessage?: string;
904
916
  }
905
- export const Select: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, placeholder, }: SelectProps<T>) => React.JSX.Element;
917
+ export const Select: <T>({ name, options, className, classNamePrefix, value, onChange, disabled, placeholder, isInvalid, errorMessage, }: SelectProps<T>) => React.JSX.Element;
906
918
 
907
919
  }
908
920
  declare module '@layerfi/components/components/Input/index' {
@@ -1112,8 +1124,13 @@ declare module '@layerfi/components/components/ProfitAndLossChart/Indicator' {
1112
1124
  type Props = BaseProps & {
1113
1125
  animateFrom: number;
1114
1126
  setAnimateFrom: (x: number) => void;
1127
+ customCursorSize: {
1128
+ width: number;
1129
+ height: number;
1130
+ };
1131
+ setCustomCursorSize: (width: number, height: number, x: number) => void;
1115
1132
  };
1116
- export const Indicator: ({ viewBox, className, animateFrom, setAnimateFrom, }: Props) => React.JSX.Element | null;
1133
+ export const Indicator: ({ className, animateFrom, setAnimateFrom, customCursorSize, setCustomCursorSize, viewBox, }: Props) => React.JSX.Element | null;
1117
1134
  export {};
1118
1135
 
1119
1136
  }
@@ -1699,9 +1716,11 @@ declare module '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts'
1699
1716
  accountId?: string;
1700
1717
  data: {
1701
1718
  parent?: BaseSelectOption;
1719
+ stable_name?: string;
1702
1720
  name?: string;
1703
- type: BaseSelectOption;
1721
+ type?: BaseSelectOption;
1704
1722
  subType?: BaseSelectOption;
1723
+ normality?: BaseSelectOption;
1705
1724
  };
1706
1725
  errors?: FormError[];
1707
1726
  }
@@ -1836,6 +1855,7 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
1836
1855
  values: string[];
1837
1856
  };
1838
1857
  reportingBasis?: ReportingBasis;
1858
+ fetchMultipleMonths?: boolean;
1839
1859
  };
1840
1860
  type ProfitAndLossFilter = {
1841
1861
  sortBy?: string;
@@ -1864,6 +1884,61 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
1864
1884
  export const useProfitAndLoss: UseProfitAndLoss;
1865
1885
  export {};
1866
1886
 
1887
+ }
1888
+ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossLTM' {
1889
+ import { ProfitAndLoss, ReportingBasis } from '@layerfi/components/types';
1890
+ import { LoadedStatus } from '@layerfi/components/types/general';
1891
+ type UseProfitAndLossLTMProps = {
1892
+ currentDate: Date;
1893
+ tagFilter?: {
1894
+ key: string;
1895
+ values: string[];
1896
+ };
1897
+ reportingBasis?: ReportingBasis;
1898
+ };
1899
+ type UseProfitAndLossLTMReturn = (props?: UseProfitAndLossLTMProps) => {
1900
+ data: {
1901
+ data: ProfitAndLoss | undefined;
1902
+ isLoading: boolean;
1903
+ error: any;
1904
+ startDate: Date;
1905
+ endDate: Date;
1906
+ }[];
1907
+ isLoading?: boolean;
1908
+ loaded?: LoadedStatus;
1909
+ error?: any;
1910
+ };
1911
+ /**
1912
+ * Hooks fetch Last Twelve Months sending 12 requests (one for each month).
1913
+ * Implementation is not perfect, but we cannot use loops and arrays with hooks.
1914
+ */
1915
+ export const useProfitAndLossLTM: UseProfitAndLossLTMReturn;
1916
+ export {};
1917
+
1918
+ }
1919
+ declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLossQuery' {
1920
+ import { ProfitAndLoss, ReportingBasis } from '@layerfi/components/types';
1921
+ type UseProfitAndLossQueryProps = {
1922
+ startDate: Date;
1923
+ endDate: Date;
1924
+ tagFilter?: {
1925
+ key: string;
1926
+ values: string[];
1927
+ };
1928
+ reportingBasis?: ReportingBasis;
1929
+ };
1930
+ type UseProfitAndLossQueryReturn = (props?: UseProfitAndLossQueryProps) => {
1931
+ data?: ProfitAndLoss;
1932
+ isLoading: boolean;
1933
+ isValidating: boolean;
1934
+ error: any;
1935
+ refetch: () => void;
1936
+ startDate: Date;
1937
+ endDate: Date;
1938
+ };
1939
+ export const useProfitAndLossQuery: UseProfitAndLossQueryReturn;
1940
+ export {};
1941
+
1867
1942
  }
1868
1943
  declare module '@layerfi/components/icons/AlertCircle' {
1869
1944
  import * as React from 'react';
@@ -2332,7 +2407,7 @@ declare module '@layerfi/components/types/chart_of_accounts' {
2332
2407
  account_subtype?: string;
2333
2408
  };
2334
2409
  export type EditAccount = {
2335
- stable_name: string;
2410
+ stable_name?: string;
2336
2411
  name: string;
2337
2412
  normality: Direction;
2338
2413
  parent_id?: {
@@ -2341,7 +2416,6 @@ declare module '@layerfi/components/types/chart_of_accounts' {
2341
2416
  };
2342
2417
  account_type: string;
2343
2418
  account_subtype?: string;
2344
- always_show_in_pnl: boolean;
2345
2419
  };
2346
2420
 
2347
2421
  }
@@ -2351,6 +2425,7 @@ declare module '@layerfi/components/types/general' {
2351
2425
  label: string;
2352
2426
  value: string | number;
2353
2427
  }
2428
+ export type LoadedStatus = 'initial' | 'loading' | 'complete';
2354
2429
 
2355
2430
  }
2356
2431
  declare module '@layerfi/components/types/layer_context' {
@@ -2470,6 +2545,7 @@ declare module '@layerfi/components/types/ledger_accounts' {
2470
2545
  }
2471
2546
  export interface LedgerEntrySource {
2472
2547
  display_description: string;
2548
+ entity_name: string;
2473
2549
  type: string;
2474
2550
  }
2475
2551
  export interface TransactionLedgerEntrySource extends LedgerEntrySource {
@@ -2564,7 +2640,7 @@ declare module '@layerfi/components/types/linked_accounts' {
2564
2640
  }
2565
2641
  export type PublicToken = {
2566
2642
  public_token: string;
2567
- institution_id: PlaidInstitution | null;
2643
+ institution: PlaidInstitution | null;
2568
2644
  };
2569
2645
 
2570
2646
  }