@layerfi/components 0.1.17 → 0.1.19
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/LICENSE +21 -0
- package/README.md +15 -5
- package/dist/esm/index.js +571 -520
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +14 -0
- package/dist/index.js +701 -649
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +76 -14
- package/dist/styles/index.css.map +2 -2
- package/package.json +2 -2
- package/image.png +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -4333,8 +4333,21 @@ var BankTransactions = ({
|
|
|
4333
4333
|
);
|
|
4334
4334
|
};
|
|
4335
4335
|
|
|
4336
|
+
// src/components/Hello/Hello.tsx
|
|
4337
|
+
import React61 from "react";
|
|
4338
|
+
import useSWR3 from "swr";
|
|
4339
|
+
var fetcher = (url) => fetch(url).then((res) => res.json());
|
|
4340
|
+
var Hello = ({ user }) => {
|
|
4341
|
+
const { data, isLoading } = useSWR3(
|
|
4342
|
+
`https://api.github.com/users/${user || "jyurek"}`,
|
|
4343
|
+
fetcher
|
|
4344
|
+
);
|
|
4345
|
+
const name = (isLoading ? "..." : data?.name) || "User";
|
|
4346
|
+
return /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement("div", { className: "hello" }, "Hello, ", name, "!"));
|
|
4347
|
+
};
|
|
4348
|
+
|
|
4336
4349
|
// src/components/LinkedAccounts/LinkedAccounts.tsx
|
|
4337
|
-
import
|
|
4350
|
+
import React70, { useContext as useContext3 } from "react";
|
|
4338
4351
|
|
|
4339
4352
|
// src/contexts/LinkedAccountsContext/LinkedAccountsContext.ts
|
|
4340
4353
|
import { createContext as createContext2 } from "react";
|
|
@@ -4357,7 +4370,7 @@ var LinkedAccountsContext = createContext2({
|
|
|
4357
4370
|
});
|
|
4358
4371
|
|
|
4359
4372
|
// src/providers/LinkedAccountsProvider/LinkedAccountsProvider.tsx
|
|
4360
|
-
import
|
|
4373
|
+
import React62 from "react";
|
|
4361
4374
|
|
|
4362
4375
|
// src/hooks/useLinkedAccounts/useLinkedAccounts.ts
|
|
4363
4376
|
import { useEffect as useEffect9, useState as useState12 } from "react";
|
|
@@ -4456,7 +4469,7 @@ var LINKED_ACCOUNTS_MOCK_DATA = [
|
|
|
4456
4469
|
];
|
|
4457
4470
|
|
|
4458
4471
|
// src/hooks/useLinkedAccounts/useLinkedAccounts.ts
|
|
4459
|
-
import
|
|
4472
|
+
import useSWR4 from "swr";
|
|
4460
4473
|
var DEBUG = true;
|
|
4461
4474
|
var USE_MOCK_RESPONSE_DATA = false;
|
|
4462
4475
|
var USE_PLAID_SANDBOX = true;
|
|
@@ -4470,7 +4483,7 @@ var useLinkedAccounts = () => {
|
|
|
4470
4483
|
isValidating,
|
|
4471
4484
|
error: responseError,
|
|
4472
4485
|
mutate
|
|
4473
|
-
} =
|
|
4486
|
+
} = useSWR4(
|
|
4474
4487
|
businessId && auth?.access_token && `linked-accounts-${businessId}`,
|
|
4475
4488
|
Layer.getLinkedAccounts(apiUrl, auth?.access_token, {
|
|
4476
4489
|
params: { businessId }
|
|
@@ -4596,15 +4609,15 @@ var LinkedAccountsProvider = ({
|
|
|
4596
4609
|
children
|
|
4597
4610
|
}) => {
|
|
4598
4611
|
const linkedAccountsContextData = useLinkedAccounts();
|
|
4599
|
-
return /* @__PURE__ */
|
|
4612
|
+
return /* @__PURE__ */ React62.createElement(LinkedAccountsContext.Provider, { value: linkedAccountsContextData }, children);
|
|
4600
4613
|
};
|
|
4601
4614
|
|
|
4602
4615
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
4603
|
-
import
|
|
4616
|
+
import React69, { useContext as useContext2 } from "react";
|
|
4604
4617
|
|
|
4605
4618
|
// src/icons/PlusIcon.tsx
|
|
4606
|
-
import * as
|
|
4607
|
-
var PlusIcon = ({ size = 14, ...props }) => /* @__PURE__ */
|
|
4619
|
+
import * as React63 from "react";
|
|
4620
|
+
var PlusIcon = ({ size = 14, ...props }) => /* @__PURE__ */ React63.createElement(
|
|
4608
4621
|
"svg",
|
|
4609
4622
|
{
|
|
4610
4623
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4614,7 +4627,7 @@ var PlusIcon = ({ size = 14, ...props }) => /* @__PURE__ */ React62.createElemen
|
|
|
4614
4627
|
width: size,
|
|
4615
4628
|
height: size
|
|
4616
4629
|
},
|
|
4617
|
-
/* @__PURE__ */
|
|
4630
|
+
/* @__PURE__ */ React63.createElement(
|
|
4618
4631
|
"path",
|
|
4619
4632
|
{
|
|
4620
4633
|
d: "M14.6667 8.49996C14.6667 4.81806 11.6819 1.83329 8.00004 1.83329C4.31814 1.83329 1.33337 4.81806 1.33337 8.49996C1.33337 12.1819 4.31814 15.1666 8.00004 15.1666C11.6819 15.1666 14.6667 12.1819 14.6667 8.49996Z",
|
|
@@ -4623,7 +4636,7 @@ var PlusIcon = ({ size = 14, ...props }) => /* @__PURE__ */ React62.createElemen
|
|
|
4623
4636
|
strokeLinejoin: "round"
|
|
4624
4637
|
}
|
|
4625
4638
|
),
|
|
4626
|
-
/* @__PURE__ */
|
|
4639
|
+
/* @__PURE__ */ React63.createElement(
|
|
4627
4640
|
"path",
|
|
4628
4641
|
{
|
|
4629
4642
|
d: "M5.33337 8.5L10.6667 8.5",
|
|
@@ -4632,7 +4645,7 @@ var PlusIcon = ({ size = 14, ...props }) => /* @__PURE__ */ React62.createElemen
|
|
|
4632
4645
|
strokeLinejoin: "round"
|
|
4633
4646
|
}
|
|
4634
4647
|
),
|
|
4635
|
-
/* @__PURE__ */
|
|
4648
|
+
/* @__PURE__ */ React63.createElement(
|
|
4636
4649
|
"path",
|
|
4637
4650
|
{
|
|
4638
4651
|
d: "M8 11.1666L8 5.83329",
|
|
@@ -4645,12 +4658,12 @@ var PlusIcon = ({ size = 14, ...props }) => /* @__PURE__ */ React62.createElemen
|
|
|
4645
4658
|
var PlusIcon_default = PlusIcon;
|
|
4646
4659
|
|
|
4647
4660
|
// src/components/LinkedAccountOptions/LinkedAccountOptions.tsx
|
|
4648
|
-
import
|
|
4661
|
+
import React66 from "react";
|
|
4649
4662
|
|
|
4650
4663
|
// src/icons/MoreVertical.tsx
|
|
4651
|
-
import
|
|
4664
|
+
import React64 from "react";
|
|
4652
4665
|
var MoreVertical = ({ size = 18, ...props }) => {
|
|
4653
|
-
return /* @__PURE__ */
|
|
4666
|
+
return /* @__PURE__ */ React64.createElement(
|
|
4654
4667
|
"svg",
|
|
4655
4668
|
{
|
|
4656
4669
|
viewBox: "0 0 16 14",
|
|
@@ -4660,7 +4673,7 @@ var MoreVertical = ({ size = 18, ...props }) => {
|
|
|
4660
4673
|
width: size,
|
|
4661
4674
|
height: size
|
|
4662
4675
|
},
|
|
4663
|
-
/* @__PURE__ */
|
|
4676
|
+
/* @__PURE__ */ React64.createElement(
|
|
4664
4677
|
"path",
|
|
4665
4678
|
{
|
|
4666
4679
|
d: "M8.66659 8C8.66659 7.63181 8.36811 7.33333 7.99992 7.33333C7.63173 7.33333 7.33325 7.63181 7.33325 8C7.33325 8.36819 7.63173 8.66667 7.99992 8.66667C8.36811 8.66667 8.66659 8.36819 8.66659 8Z",
|
|
@@ -4670,7 +4683,7 @@ var MoreVertical = ({ size = 18, ...props }) => {
|
|
|
4670
4683
|
strokeLinejoin: "round"
|
|
4671
4684
|
}
|
|
4672
4685
|
),
|
|
4673
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ React64.createElement(
|
|
4674
4687
|
"path",
|
|
4675
4688
|
{
|
|
4676
4689
|
d: "M8.66659 3.33333C8.66659 2.96514 8.36811 2.66667 7.99992 2.66667C7.63173 2.66667 7.33325 2.96514 7.33325 3.33333C7.33325 3.70152 7.63173 4 7.99992 4C8.36811 4 8.66659 3.70152 8.66659 3.33333Z",
|
|
@@ -4680,7 +4693,7 @@ var MoreVertical = ({ size = 18, ...props }) => {
|
|
|
4680
4693
|
strokeLinejoin: "round"
|
|
4681
4694
|
}
|
|
4682
4695
|
),
|
|
4683
|
-
/* @__PURE__ */
|
|
4696
|
+
/* @__PURE__ */ React64.createElement(
|
|
4684
4697
|
"path",
|
|
4685
4698
|
{
|
|
4686
4699
|
d: "M8.66659 12.6667C8.66659 12.2985 8.36811 12 7.99992 12C7.63173 12 7.33325 12.2985 7.33325 12.6667C7.33325 13.0349 7.63173 13.3333 7.99992 13.3333C8.36811 13.3333 8.66659 13.0349 8.66659 12.6667Z",
|
|
@@ -4695,7 +4708,7 @@ var MoreVertical = ({ size = 18, ...props }) => {
|
|
|
4695
4708
|
var MoreVertical_default = MoreVertical;
|
|
4696
4709
|
|
|
4697
4710
|
// src/components/HoverMenu/HoverMenu.tsx
|
|
4698
|
-
import
|
|
4711
|
+
import React65, { useEffect as useEffect10, useRef as useRef12, useState as useState13 } from "react";
|
|
4699
4712
|
import classNames26 from "classnames";
|
|
4700
4713
|
var HoverMenu = ({
|
|
4701
4714
|
children,
|
|
@@ -4721,14 +4734,14 @@ var HoverMenu = ({
|
|
|
4721
4734
|
document.removeEventListener("click", handleClickOutside);
|
|
4722
4735
|
};
|
|
4723
4736
|
}, []);
|
|
4724
|
-
return /* @__PURE__ */
|
|
4737
|
+
return /* @__PURE__ */ React65.createElement(
|
|
4725
4738
|
"div",
|
|
4726
4739
|
{
|
|
4727
4740
|
className: hoverMenuClassName,
|
|
4728
4741
|
ref: hoverMenuRef,
|
|
4729
4742
|
onMouseLeave: () => setOpenMenu(false)
|
|
4730
4743
|
},
|
|
4731
|
-
/* @__PURE__ */
|
|
4744
|
+
/* @__PURE__ */ React65.createElement(
|
|
4732
4745
|
"div",
|
|
4733
4746
|
{
|
|
4734
4747
|
className: "Layer__hover-menu__children",
|
|
@@ -4738,13 +4751,13 @@ var HoverMenu = ({
|
|
|
4738
4751
|
},
|
|
4739
4752
|
children
|
|
4740
4753
|
),
|
|
4741
|
-
/* @__PURE__ */
|
|
4754
|
+
/* @__PURE__ */ React65.createElement("div", { className: "Layer__hover-menu__list-wrapper" }, /* @__PURE__ */ React65.createElement("ul", { className: "Layer__hover-menu__list" }, config && config.length > 0 && config.map((item) => /* @__PURE__ */ React65.createElement(
|
|
4742
4755
|
"li",
|
|
4743
4756
|
{
|
|
4744
4757
|
key: `hover-menu-${item.name}`,
|
|
4745
4758
|
className: "Layer__hover-menu__list-item"
|
|
4746
4759
|
},
|
|
4747
|
-
/* @__PURE__ */
|
|
4760
|
+
/* @__PURE__ */ React65.createElement(
|
|
4748
4761
|
"button",
|
|
4749
4762
|
{
|
|
4750
4763
|
className: "Layer__hover-menu__list-item-button",
|
|
@@ -4770,7 +4783,7 @@ var LinkedAccountOptions = ({
|
|
|
4770
4783
|
"Layer__linked-accounts__options",
|
|
4771
4784
|
showLedgerBalance == false && "--hide-ledger-balance"
|
|
4772
4785
|
);
|
|
4773
|
-
return /* @__PURE__ */
|
|
4786
|
+
return /* @__PURE__ */ React66.createElement("div", { className: linkedAccountOptionsClassName }, /* @__PURE__ */ React66.createElement("div", { className: "Layer__linked-accounts__options-overlay" }, /* @__PURE__ */ React66.createElement("div", { className: "Layer__linked-accounts__options-overlay-button" }, /* @__PURE__ */ React66.createElement(
|
|
4774
4787
|
HoverMenu,
|
|
4775
4788
|
{
|
|
4776
4789
|
config,
|
|
@@ -4778,16 +4791,16 @@ var LinkedAccountOptions = ({
|
|
|
4778
4791
|
connectionId,
|
|
4779
4792
|
source
|
|
4780
4793
|
},
|
|
4781
|
-
/* @__PURE__ */
|
|
4794
|
+
/* @__PURE__ */ React66.createElement(MoreVertical_default, { size: 16 })
|
|
4782
4795
|
))), children);
|
|
4783
4796
|
};
|
|
4784
4797
|
|
|
4785
4798
|
// src/components/LinkedAccountThumb/LinkedAccountThumb.tsx
|
|
4786
|
-
import
|
|
4799
|
+
import React68 from "react";
|
|
4787
4800
|
|
|
4788
4801
|
// src/icons/InstitutionIcon.tsx
|
|
4789
|
-
import * as
|
|
4790
|
-
var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */
|
|
4802
|
+
import * as React67 from "react";
|
|
4803
|
+
var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React67.createElement(
|
|
4791
4804
|
"svg",
|
|
4792
4805
|
{
|
|
4793
4806
|
viewBox: "0 0 27 28",
|
|
@@ -4797,42 +4810,42 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4797
4810
|
width: size,
|
|
4798
4811
|
height: size
|
|
4799
4812
|
},
|
|
4800
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ React67.createElement("g", { filter: "url(#filter0_i_2320_122784)" }, /* @__PURE__ */ React67.createElement(
|
|
4801
4814
|
"path",
|
|
4802
4815
|
{
|
|
4803
4816
|
d: "M0 8.50225C0 8.13268 0.20383 7.79324 0.530047 7.61956L13.03 0.964441C13.3238 0.80803 13.6762 0.808029 13.97 0.964441L26.47 7.61956C26.7962 7.79324 27 8.13268 27 8.50225V9.71423C27 10.2665 26.5523 10.7142 26 10.7142H0.999999C0.447715 10.7142 0 10.2665 0 9.71423V8.50225Z",
|
|
4804
4817
|
fill: "currentColor"
|
|
4805
4818
|
}
|
|
4806
4819
|
)),
|
|
4807
|
-
/* @__PURE__ */
|
|
4820
|
+
/* @__PURE__ */ React67.createElement("g", { filter: "url(#filter1_i_2320_122784)" }, /* @__PURE__ */ React67.createElement(
|
|
4808
4821
|
"path",
|
|
4809
4822
|
{
|
|
4810
4823
|
d: "M3 13C3 12.4477 3.44772 12 4 12H7C7.55228 12 8 12.4477 8 13V20C8 20.5523 7.55228 21 7 21H4C3.44772 21 3 20.5523 3 20L3 13Z",
|
|
4811
4824
|
fill: "currentColor"
|
|
4812
4825
|
}
|
|
4813
4826
|
)),
|
|
4814
|
-
/* @__PURE__ */
|
|
4827
|
+
/* @__PURE__ */ React67.createElement("g", { filter: "url(#filter2_i_2320_122784)" }, /* @__PURE__ */ React67.createElement(
|
|
4815
4828
|
"path",
|
|
4816
4829
|
{
|
|
4817
4830
|
d: "M11 13C11 12.4477 11.4477 12 12 12H15C15.5523 12 16 12.4477 16 13V20C16 20.5523 15.5523 21 15 21H12C11.4477 21 11 20.5523 11 20L11 13Z",
|
|
4818
4831
|
fill: "currentColor"
|
|
4819
4832
|
}
|
|
4820
4833
|
)),
|
|
4821
|
-
/* @__PURE__ */
|
|
4834
|
+
/* @__PURE__ */ React67.createElement("g", { filter: "url(#filter3_i_2320_122784)" }, /* @__PURE__ */ React67.createElement(
|
|
4822
4835
|
"path",
|
|
4823
4836
|
{
|
|
4824
4837
|
d: "M19 13C19 12.4477 19.4477 12 20 12H23C23.5523 12 24 12.4477 24 13V20C24 20.5523 23.5523 21 23 21H20C19.4477 21 19 20.5523 19 20L19 13Z",
|
|
4825
4838
|
fill: "currentColor"
|
|
4826
4839
|
}
|
|
4827
4840
|
)),
|
|
4828
|
-
/* @__PURE__ */
|
|
4841
|
+
/* @__PURE__ */ React67.createElement("g", { filter: "url(#filter4_i_2320_122784)" }, /* @__PURE__ */ React67.createElement(
|
|
4829
4842
|
"path",
|
|
4830
4843
|
{
|
|
4831
4844
|
d: "M1 23.2856C1 22.7334 1.44772 22.2856 2 22.2856H25C25.5523 22.2856 26 22.7334 26 23.2856V26.2856C26 26.8379 25.5523 27.2856 25 27.2856H2C1.44772 27.2856 1 26.8379 1 26.2856L1 23.2856Z",
|
|
4832
4845
|
fill: "currentColor"
|
|
4833
4846
|
}
|
|
4834
4847
|
)),
|
|
4835
|
-
/* @__PURE__ */
|
|
4848
|
+
/* @__PURE__ */ React67.createElement("defs", null, /* @__PURE__ */ React67.createElement(
|
|
4836
4849
|
"filter",
|
|
4837
4850
|
{
|
|
4838
4851
|
id: "filter0_i_2320_122784",
|
|
@@ -4843,8 +4856,8 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4843
4856
|
filterUnits: "userSpaceOnUse",
|
|
4844
4857
|
colorInterpolationFilters: "sRGB"
|
|
4845
4858
|
},
|
|
4846
|
-
/* @__PURE__ */
|
|
4847
|
-
/* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ React67.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
4860
|
+
/* @__PURE__ */ React67.createElement(
|
|
4848
4861
|
"feBlend",
|
|
4849
4862
|
{
|
|
4850
4863
|
mode: "normal",
|
|
@@ -4853,7 +4866,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4853
4866
|
result: "shape"
|
|
4854
4867
|
}
|
|
4855
4868
|
),
|
|
4856
|
-
/* @__PURE__ */
|
|
4869
|
+
/* @__PURE__ */ React67.createElement(
|
|
4857
4870
|
"feColorMatrix",
|
|
4858
4871
|
{
|
|
4859
4872
|
in: "SourceAlpha",
|
|
@@ -4862,17 +4875,17 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4862
4875
|
result: "hardAlpha"
|
|
4863
4876
|
}
|
|
4864
4877
|
),
|
|
4865
|
-
/* @__PURE__ */
|
|
4866
|
-
/* @__PURE__ */
|
|
4867
|
-
/* @__PURE__ */
|
|
4868
|
-
/* @__PURE__ */
|
|
4878
|
+
/* @__PURE__ */ React67.createElement("feOffset", null),
|
|
4879
|
+
/* @__PURE__ */ React67.createElement("feGaussianBlur", { stdDeviation: "0.5" }),
|
|
4880
|
+
/* @__PURE__ */ React67.createElement("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
4881
|
+
/* @__PURE__ */ React67.createElement(
|
|
4869
4882
|
"feColorMatrix",
|
|
4870
4883
|
{
|
|
4871
4884
|
type: "matrix",
|
|
4872
4885
|
values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.04 0"
|
|
4873
4886
|
}
|
|
4874
4887
|
),
|
|
4875
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ React67.createElement(
|
|
4876
4889
|
"feBlend",
|
|
4877
4890
|
{
|
|
4878
4891
|
mode: "normal",
|
|
@@ -4880,7 +4893,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4880
4893
|
result: "effect1_innerShadow_2320_122784"
|
|
4881
4894
|
}
|
|
4882
4895
|
)
|
|
4883
|
-
), /* @__PURE__ */
|
|
4896
|
+
), /* @__PURE__ */ React67.createElement(
|
|
4884
4897
|
"filter",
|
|
4885
4898
|
{
|
|
4886
4899
|
id: "filter1_i_2320_122784",
|
|
@@ -4891,8 +4904,8 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4891
4904
|
filterUnits: "userSpaceOnUse",
|
|
4892
4905
|
colorInterpolationFilters: "sRGB"
|
|
4893
4906
|
},
|
|
4894
|
-
/* @__PURE__ */
|
|
4895
|
-
/* @__PURE__ */
|
|
4907
|
+
/* @__PURE__ */ React67.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
4908
|
+
/* @__PURE__ */ React67.createElement(
|
|
4896
4909
|
"feBlend",
|
|
4897
4910
|
{
|
|
4898
4911
|
mode: "normal",
|
|
@@ -4901,7 +4914,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4901
4914
|
result: "shape"
|
|
4902
4915
|
}
|
|
4903
4916
|
),
|
|
4904
|
-
/* @__PURE__ */
|
|
4917
|
+
/* @__PURE__ */ React67.createElement(
|
|
4905
4918
|
"feColorMatrix",
|
|
4906
4919
|
{
|
|
4907
4920
|
in: "SourceAlpha",
|
|
@@ -4910,17 +4923,17 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4910
4923
|
result: "hardAlpha"
|
|
4911
4924
|
}
|
|
4912
4925
|
),
|
|
4913
|
-
/* @__PURE__ */
|
|
4914
|
-
/* @__PURE__ */
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
4926
|
+
/* @__PURE__ */ React67.createElement("feOffset", null),
|
|
4927
|
+
/* @__PURE__ */ React67.createElement("feGaussianBlur", { stdDeviation: "0.5" }),
|
|
4928
|
+
/* @__PURE__ */ React67.createElement("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
4929
|
+
/* @__PURE__ */ React67.createElement(
|
|
4917
4930
|
"feColorMatrix",
|
|
4918
4931
|
{
|
|
4919
4932
|
type: "matrix",
|
|
4920
4933
|
values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.04 0"
|
|
4921
4934
|
}
|
|
4922
4935
|
),
|
|
4923
|
-
/* @__PURE__ */
|
|
4936
|
+
/* @__PURE__ */ React67.createElement(
|
|
4924
4937
|
"feBlend",
|
|
4925
4938
|
{
|
|
4926
4939
|
mode: "normal",
|
|
@@ -4928,7 +4941,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4928
4941
|
result: "effect1_innerShadow_2320_122784"
|
|
4929
4942
|
}
|
|
4930
4943
|
)
|
|
4931
|
-
), /* @__PURE__ */
|
|
4944
|
+
), /* @__PURE__ */ React67.createElement(
|
|
4932
4945
|
"filter",
|
|
4933
4946
|
{
|
|
4934
4947
|
id: "filter2_i_2320_122784",
|
|
@@ -4939,8 +4952,8 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4939
4952
|
filterUnits: "userSpaceOnUse",
|
|
4940
4953
|
colorInterpolationFilters: "sRGB"
|
|
4941
4954
|
},
|
|
4942
|
-
/* @__PURE__ */
|
|
4943
|
-
/* @__PURE__ */
|
|
4955
|
+
/* @__PURE__ */ React67.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
4956
|
+
/* @__PURE__ */ React67.createElement(
|
|
4944
4957
|
"feBlend",
|
|
4945
4958
|
{
|
|
4946
4959
|
mode: "normal",
|
|
@@ -4949,7 +4962,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4949
4962
|
result: "shape"
|
|
4950
4963
|
}
|
|
4951
4964
|
),
|
|
4952
|
-
/* @__PURE__ */
|
|
4965
|
+
/* @__PURE__ */ React67.createElement(
|
|
4953
4966
|
"feColorMatrix",
|
|
4954
4967
|
{
|
|
4955
4968
|
in: "SourceAlpha",
|
|
@@ -4958,17 +4971,17 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4958
4971
|
result: "hardAlpha"
|
|
4959
4972
|
}
|
|
4960
4973
|
),
|
|
4961
|
-
/* @__PURE__ */
|
|
4962
|
-
/* @__PURE__ */
|
|
4963
|
-
/* @__PURE__ */
|
|
4964
|
-
/* @__PURE__ */
|
|
4974
|
+
/* @__PURE__ */ React67.createElement("feOffset", null),
|
|
4975
|
+
/* @__PURE__ */ React67.createElement("feGaussianBlur", { stdDeviation: "0.5" }),
|
|
4976
|
+
/* @__PURE__ */ React67.createElement("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
4977
|
+
/* @__PURE__ */ React67.createElement(
|
|
4965
4978
|
"feColorMatrix",
|
|
4966
4979
|
{
|
|
4967
4980
|
type: "matrix",
|
|
4968
4981
|
values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.04 0"
|
|
4969
4982
|
}
|
|
4970
4983
|
),
|
|
4971
|
-
/* @__PURE__ */
|
|
4984
|
+
/* @__PURE__ */ React67.createElement(
|
|
4972
4985
|
"feBlend",
|
|
4973
4986
|
{
|
|
4974
4987
|
mode: "normal",
|
|
@@ -4976,7 +4989,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4976
4989
|
result: "effect1_innerShadow_2320_122784"
|
|
4977
4990
|
}
|
|
4978
4991
|
)
|
|
4979
|
-
), /* @__PURE__ */
|
|
4992
|
+
), /* @__PURE__ */ React67.createElement(
|
|
4980
4993
|
"filter",
|
|
4981
4994
|
{
|
|
4982
4995
|
id: "filter3_i_2320_122784",
|
|
@@ -4987,8 +5000,8 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4987
5000
|
filterUnits: "userSpaceOnUse",
|
|
4988
5001
|
colorInterpolationFilters: "sRGB"
|
|
4989
5002
|
},
|
|
4990
|
-
/* @__PURE__ */
|
|
4991
|
-
/* @__PURE__ */
|
|
5003
|
+
/* @__PURE__ */ React67.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
5004
|
+
/* @__PURE__ */ React67.createElement(
|
|
4992
5005
|
"feBlend",
|
|
4993
5006
|
{
|
|
4994
5007
|
mode: "normal",
|
|
@@ -4997,7 +5010,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
4997
5010
|
result: "shape"
|
|
4998
5011
|
}
|
|
4999
5012
|
),
|
|
5000
|
-
/* @__PURE__ */
|
|
5013
|
+
/* @__PURE__ */ React67.createElement(
|
|
5001
5014
|
"feColorMatrix",
|
|
5002
5015
|
{
|
|
5003
5016
|
in: "SourceAlpha",
|
|
@@ -5006,17 +5019,17 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
5006
5019
|
result: "hardAlpha"
|
|
5007
5020
|
}
|
|
5008
5021
|
),
|
|
5009
|
-
/* @__PURE__ */
|
|
5010
|
-
/* @__PURE__ */
|
|
5011
|
-
/* @__PURE__ */
|
|
5012
|
-
/* @__PURE__ */
|
|
5022
|
+
/* @__PURE__ */ React67.createElement("feOffset", null),
|
|
5023
|
+
/* @__PURE__ */ React67.createElement("feGaussianBlur", { stdDeviation: "0.5" }),
|
|
5024
|
+
/* @__PURE__ */ React67.createElement("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
5025
|
+
/* @__PURE__ */ React67.createElement(
|
|
5013
5026
|
"feColorMatrix",
|
|
5014
5027
|
{
|
|
5015
5028
|
type: "matrix",
|
|
5016
5029
|
values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.04 0"
|
|
5017
5030
|
}
|
|
5018
5031
|
),
|
|
5019
|
-
/* @__PURE__ */
|
|
5032
|
+
/* @__PURE__ */ React67.createElement(
|
|
5020
5033
|
"feBlend",
|
|
5021
5034
|
{
|
|
5022
5035
|
mode: "normal",
|
|
@@ -5024,7 +5037,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
5024
5037
|
result: "effect1_innerShadow_2320_122784"
|
|
5025
5038
|
}
|
|
5026
5039
|
)
|
|
5027
|
-
), /* @__PURE__ */
|
|
5040
|
+
), /* @__PURE__ */ React67.createElement(
|
|
5028
5041
|
"filter",
|
|
5029
5042
|
{
|
|
5030
5043
|
id: "filter4_i_2320_122784",
|
|
@@ -5035,8 +5048,8 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
5035
5048
|
filterUnits: "userSpaceOnUse",
|
|
5036
5049
|
colorInterpolationFilters: "sRGB"
|
|
5037
5050
|
},
|
|
5038
|
-
/* @__PURE__ */
|
|
5039
|
-
/* @__PURE__ */
|
|
5051
|
+
/* @__PURE__ */ React67.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
5052
|
+
/* @__PURE__ */ React67.createElement(
|
|
5040
5053
|
"feBlend",
|
|
5041
5054
|
{
|
|
5042
5055
|
mode: "normal",
|
|
@@ -5045,7 +5058,7 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
5045
5058
|
result: "shape"
|
|
5046
5059
|
}
|
|
5047
5060
|
),
|
|
5048
|
-
/* @__PURE__ */
|
|
5061
|
+
/* @__PURE__ */ React67.createElement(
|
|
5049
5062
|
"feColorMatrix",
|
|
5050
5063
|
{
|
|
5051
5064
|
in: "SourceAlpha",
|
|
@@ -5054,17 +5067,17 @@ var InstitutionIcon = ({ size = 18, ...props }) => /* @__PURE__ */ React66.creat
|
|
|
5054
5067
|
result: "hardAlpha"
|
|
5055
5068
|
}
|
|
5056
5069
|
),
|
|
5057
|
-
/* @__PURE__ */
|
|
5058
|
-
/* @__PURE__ */
|
|
5059
|
-
/* @__PURE__ */
|
|
5060
|
-
/* @__PURE__ */
|
|
5070
|
+
/* @__PURE__ */ React67.createElement("feOffset", null),
|
|
5071
|
+
/* @__PURE__ */ React67.createElement("feGaussianBlur", { stdDeviation: "0.5" }),
|
|
5072
|
+
/* @__PURE__ */ React67.createElement("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
5073
|
+
/* @__PURE__ */ React67.createElement(
|
|
5061
5074
|
"feColorMatrix",
|
|
5062
5075
|
{
|
|
5063
5076
|
type: "matrix",
|
|
5064
5077
|
values: "0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.04 0"
|
|
5065
5078
|
}
|
|
5066
5079
|
),
|
|
5067
|
-
/* @__PURE__ */
|
|
5080
|
+
/* @__PURE__ */ React67.createElement(
|
|
5068
5081
|
"feBlend",
|
|
5069
5082
|
{
|
|
5070
5083
|
mode: "normal",
|
|
@@ -5078,7 +5091,7 @@ var InstitutionIcon_default = InstitutionIcon;
|
|
|
5078
5091
|
|
|
5079
5092
|
// src/components/LinkedAccountThumb/LinkedAccountThumb.tsx
|
|
5080
5093
|
import classNames28 from "classnames";
|
|
5081
|
-
var AccountNumber = ({ accountNumber }) => /* @__PURE__ */
|
|
5094
|
+
var AccountNumber = ({ accountNumber }) => /* @__PURE__ */ React68.createElement("div", { className: "account-number" }, /* @__PURE__ */ React68.createElement(Text, { size: "sm" }, "\u2022\u2022\u2022 ", accountNumber));
|
|
5082
5095
|
var LinkedAccountThumb = ({
|
|
5083
5096
|
account,
|
|
5084
5097
|
asWidget,
|
|
@@ -5088,7 +5101,7 @@ var LinkedAccountThumb = ({
|
|
|
5088
5101
|
"Layer__linked-account-thumb",
|
|
5089
5102
|
asWidget && "--as-widget"
|
|
5090
5103
|
);
|
|
5091
|
-
return /* @__PURE__ */
|
|
5104
|
+
return /* @__PURE__ */ React68.createElement("div", { className: linkedAccountThumbClassName }, /* @__PURE__ */ React68.createElement("div", { className: "topbar" }, /* @__PURE__ */ React68.createElement("div", { className: "topbar-details" }, /* @__PURE__ */ React68.createElement(Text, { as: "span", className: "account-name" }, account.external_account_name), !asWidget && account.mask && /* @__PURE__ */ React68.createElement(AccountNumber, { accountNumber: account.mask }), /* @__PURE__ */ React68.createElement(
|
|
5092
5105
|
Text,
|
|
5093
5106
|
{
|
|
5094
5107
|
as: "span",
|
|
@@ -5096,7 +5109,7 @@ var LinkedAccountThumb = ({
|
|
|
5096
5109
|
size: "sm"
|
|
5097
5110
|
},
|
|
5098
5111
|
account.institution?.name
|
|
5099
|
-
)), /* @__PURE__ */
|
|
5112
|
+
)), /* @__PURE__ */ React68.createElement("div", { className: "topbar-logo" }, account.institution?.logo != void 0 ? /* @__PURE__ */ React68.createElement(
|
|
5100
5113
|
"img",
|
|
5101
5114
|
{
|
|
5102
5115
|
width: 28,
|
|
@@ -5104,7 +5117,7 @@ var LinkedAccountThumb = ({
|
|
|
5104
5117
|
src: `data:image/png;base64,${account.institution.logo}`,
|
|
5105
5118
|
alt: account.institution?.name
|
|
5106
5119
|
}
|
|
5107
|
-
) : /* @__PURE__ */
|
|
5120
|
+
) : /* @__PURE__ */ React68.createElement(InstitutionIcon_default, null))), !asWidget && /* @__PURE__ */ React68.createElement("div", { className: "middlebar" }, /* @__PURE__ */ React68.createElement(
|
|
5108
5121
|
Text,
|
|
5109
5122
|
{
|
|
5110
5123
|
as: "span",
|
|
@@ -5112,7 +5125,7 @@ var LinkedAccountThumb = ({
|
|
|
5112
5125
|
size: "sm"
|
|
5113
5126
|
},
|
|
5114
5127
|
"Bank balance"
|
|
5115
|
-
), /* @__PURE__ */
|
|
5128
|
+
), /* @__PURE__ */ React68.createElement(Text, { as: "span", className: "account-balance" }, "$", centsToDollars(account.latest_balance_timestamp?.balance))), showLedgerBalance && /* @__PURE__ */ React68.createElement("div", { className: "bottombar" }, asWidget && account.mask ? /* @__PURE__ */ React68.createElement(AccountNumber, { accountNumber: account.mask }) : /* @__PURE__ */ React68.createElement(
|
|
5116
5129
|
Text,
|
|
5117
5130
|
{
|
|
5118
5131
|
as: "span",
|
|
@@ -5120,7 +5133,7 @@ var LinkedAccountThumb = ({
|
|
|
5120
5133
|
size: "sm"
|
|
5121
5134
|
},
|
|
5122
5135
|
"Ledger balance"
|
|
5123
|
-
), /* @__PURE__ */
|
|
5136
|
+
), /* @__PURE__ */ React68.createElement(Text, { as: "span", className: "account-balance" }, "$", centsToDollars(account.current_ledger_balance))));
|
|
5124
5137
|
};
|
|
5125
5138
|
|
|
5126
5139
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
@@ -5142,7 +5155,7 @@ var LinkedAccountsContent = ({
|
|
|
5142
5155
|
"Layer__linked-accounts__new-account",
|
|
5143
5156
|
asWidget && "--as-widget"
|
|
5144
5157
|
);
|
|
5145
|
-
return /* @__PURE__ */
|
|
5158
|
+
return /* @__PURE__ */ React69.createElement("div", { className: "Layer__linked-accounts__list" }, data?.map((account, index) => /* @__PURE__ */ React69.createElement(
|
|
5146
5159
|
LinkedAccountOptions,
|
|
5147
5160
|
{
|
|
5148
5161
|
key: `linked-acc-${index}`,
|
|
@@ -5152,7 +5165,7 @@ var LinkedAccountsContent = ({
|
|
|
5152
5165
|
source: account.external_account_source,
|
|
5153
5166
|
showLedgerBalance
|
|
5154
5167
|
},
|
|
5155
|
-
/* @__PURE__ */
|
|
5168
|
+
/* @__PURE__ */ React69.createElement(
|
|
5156
5169
|
LinkedAccountThumb,
|
|
5157
5170
|
{
|
|
5158
5171
|
account,
|
|
@@ -5160,7 +5173,7 @@ var LinkedAccountsContent = ({
|
|
|
5160
5173
|
showLedgerBalance
|
|
5161
5174
|
}
|
|
5162
5175
|
)
|
|
5163
|
-
)), /* @__PURE__ */
|
|
5176
|
+
)), /* @__PURE__ */ React69.createElement(
|
|
5164
5177
|
"div",
|
|
5165
5178
|
{
|
|
5166
5179
|
role: "button",
|
|
@@ -5169,14 +5182,14 @@ var LinkedAccountsContent = ({
|
|
|
5169
5182
|
onClick: () => addConnection("PLAID"),
|
|
5170
5183
|
className: linkedAccountsNewAccountClassName
|
|
5171
5184
|
},
|
|
5172
|
-
/* @__PURE__ */
|
|
5185
|
+
/* @__PURE__ */ React69.createElement("div", { className: "Layer__linked-accounts__new-account-label" }, /* @__PURE__ */ React69.createElement(PlusIcon_default, { size: 15 }), /* @__PURE__ */ React69.createElement(Text, { as: "span", size: "sm" }, "Add Account"))
|
|
5173
5186
|
));
|
|
5174
5187
|
};
|
|
5175
5188
|
|
|
5176
5189
|
// src/components/LinkedAccounts/LinkedAccounts.tsx
|
|
5177
5190
|
var COMPONENT_NAME2 = "linked-accounts";
|
|
5178
5191
|
var LinkedAccounts = (props) => {
|
|
5179
|
-
return /* @__PURE__ */
|
|
5192
|
+
return /* @__PURE__ */ React70.createElement(LinkedAccountsProvider, null, /* @__PURE__ */ React70.createElement(LinkedAccountsComponent, { ...props }));
|
|
5180
5193
|
};
|
|
5181
5194
|
var LinkedAccountsComponent = ({
|
|
5182
5195
|
asWidget,
|
|
@@ -5186,14 +5199,14 @@ var LinkedAccountsComponent = ({
|
|
|
5186
5199
|
const { isLoading, error, isValidating, refetchAccounts } = useContext3(
|
|
5187
5200
|
LinkedAccountsContext
|
|
5188
5201
|
);
|
|
5189
|
-
return /* @__PURE__ */
|
|
5202
|
+
return /* @__PURE__ */ React70.createElement(Container, { name: COMPONENT_NAME2, elevated }, /* @__PURE__ */ React70.createElement(Header, { className: "Layer__linked-accounts__header" }, /* @__PURE__ */ React70.createElement(
|
|
5190
5203
|
Heading,
|
|
5191
5204
|
{
|
|
5192
5205
|
className: "Layer__linked-accounts__title",
|
|
5193
5206
|
size: "secondary" /* secondary */
|
|
5194
5207
|
},
|
|
5195
5208
|
"Linked Accounts"
|
|
5196
|
-
)), isLoading && /* @__PURE__ */
|
|
5209
|
+
)), isLoading && /* @__PURE__ */ React70.createElement("div", { className: "Layer__linked-accounts__loader-container" }, /* @__PURE__ */ React70.createElement(Loader2, null)), error && !isLoading ? /* @__PURE__ */ React70.createElement(
|
|
5197
5210
|
DataState,
|
|
5198
5211
|
{
|
|
5199
5212
|
status: "failed" /* failed */,
|
|
@@ -5202,7 +5215,7 @@ var LinkedAccountsComponent = ({
|
|
|
5202
5215
|
onRefresh: () => refetchAccounts(),
|
|
5203
5216
|
isLoading: isValidating
|
|
5204
5217
|
}
|
|
5205
|
-
) : null, !error && !isLoading ? /* @__PURE__ */
|
|
5218
|
+
) : null, !error && !isLoading ? /* @__PURE__ */ React70.createElement(
|
|
5206
5219
|
LinkedAccountsContent,
|
|
5207
5220
|
{
|
|
5208
5221
|
asWidget,
|
|
@@ -5212,7 +5225,7 @@ var LinkedAccountsComponent = ({
|
|
|
5212
5225
|
};
|
|
5213
5226
|
|
|
5214
5227
|
// src/components/ProfitAndLoss/ProfitAndLoss.tsx
|
|
5215
|
-
import
|
|
5228
|
+
import React87, { createContext as createContext3 } from "react";
|
|
5216
5229
|
|
|
5217
5230
|
// src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
|
|
5218
5231
|
import { useMemo as useMemo3, useState as useState14 } from "react";
|
|
@@ -5272,7 +5285,7 @@ var applyShare = (items, total) => {
|
|
|
5272
5285
|
|
|
5273
5286
|
// src/hooks/useProfitAndLoss/useProfitAndLossQuery.tsx
|
|
5274
5287
|
import { startOfMonth, endOfMonth, formatISO } from "date-fns";
|
|
5275
|
-
import
|
|
5288
|
+
import useSWR5 from "swr";
|
|
5276
5289
|
var useProfitAndLossQuery = ({
|
|
5277
5290
|
startDate,
|
|
5278
5291
|
endDate,
|
|
@@ -5289,7 +5302,7 @@ var useProfitAndLossQuery = ({
|
|
|
5289
5302
|
isValidating,
|
|
5290
5303
|
error: rawError,
|
|
5291
5304
|
mutate
|
|
5292
|
-
} =
|
|
5305
|
+
} = useSWR5(
|
|
5293
5306
|
businessId && startDate && endDate && auth?.access_token && `profit-and-loss-${businessId}-${startDate.valueOf()}-${endDate.valueOf()}-${tagFilter?.key}-${tagFilter?.values?.join(
|
|
5294
5307
|
","
|
|
5295
5308
|
)}-${reportingBasis}`,
|
|
@@ -5467,7 +5480,7 @@ var useProfitAndLoss = ({
|
|
|
5467
5480
|
};
|
|
5468
5481
|
|
|
5469
5482
|
// src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
|
|
5470
|
-
import
|
|
5483
|
+
import React72, { useContext as useContext4, useEffect as useEffect13, useMemo as useMemo5, useState as useState17 } from "react";
|
|
5471
5484
|
|
|
5472
5485
|
// src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
|
|
5473
5486
|
import { useEffect as useEffect11, useMemo as useMemo4, useState as useState15 } from "react";
|
|
@@ -5861,7 +5874,7 @@ var convertCurrencyToNumber = (amount) => {
|
|
|
5861
5874
|
};
|
|
5862
5875
|
|
|
5863
5876
|
// src/components/ProfitAndLossChart/Indicator.tsx
|
|
5864
|
-
import
|
|
5877
|
+
import React71, { useEffect as useEffect12, useState as useState16 } from "react";
|
|
5865
5878
|
var emptyViewBox = { x: 0, y: 0, width: 0, height: 0 };
|
|
5866
5879
|
var Indicator = ({
|
|
5867
5880
|
className,
|
|
@@ -5902,7 +5915,7 @@ var Indicator = ({
|
|
|
5902
5915
|
}
|
|
5903
5916
|
};
|
|
5904
5917
|
const actualX = animateFrom === -1 ? animateTo : animateFrom;
|
|
5905
|
-
return /* @__PURE__ */
|
|
5918
|
+
return /* @__PURE__ */ React71.createElement(
|
|
5906
5919
|
"rect",
|
|
5907
5920
|
{
|
|
5908
5921
|
ref: rectRef,
|
|
@@ -5982,7 +5995,7 @@ var ProfitAndLossChart = () => {
|
|
|
5982
5995
|
if (active && payload && payload.length) {
|
|
5983
5996
|
const netProfit = payload[0].payload.netProfit ?? 0;
|
|
5984
5997
|
const netProfitClass = netProfit > 0 ? "positive" : netProfit < 0 ? "negative" : "";
|
|
5985
|
-
return /* @__PURE__ */
|
|
5998
|
+
return /* @__PURE__ */ React72.createElement("div", { className: "Layer__chart__tooltip" }, loaded !== "complete" ? /* @__PURE__ */ React72.createElement(Text, null, "Loading...") : /* @__PURE__ */ React72.createElement("ul", { className: "Layer__chart__tooltip-list" }, /* @__PURE__ */ React72.createElement("li", null, /* @__PURE__ */ React72.createElement("label", { className: "Layer__chart__tooltip-label" }, capitalizeFirstLetter(payload[0].name ?? "")), /* @__PURE__ */ React72.createElement("span", { className: "Layer__chart__tooltip-value" }, "$", centsToDollars(Math.abs(payload[0].value ?? 0)))), /* @__PURE__ */ React72.createElement("li", null, /* @__PURE__ */ React72.createElement("label", { className: "Layer__chart__tooltip-label" }, capitalizeFirstLetter(payload[1].name ?? "")), /* @__PURE__ */ React72.createElement("span", { className: "Layer__chart__tooltip-value" }, "$", centsToDollars(Math.abs(payload[1].value ?? 0)))), /* @__PURE__ */ React72.createElement("li", null, /* @__PURE__ */ React72.createElement("label", { className: "Layer__chart__tooltip-label" }, "Net Profit"), /* @__PURE__ */ React72.createElement(
|
|
5986
5999
|
"span",
|
|
5987
6000
|
{
|
|
5988
6001
|
className: `Layer__chart__tooltip-value ${netProfitClass}`
|
|
@@ -5997,7 +6010,7 @@ var ProfitAndLossChart = () => {
|
|
|
5997
6010
|
const { x, y, width: rectWidth } = props;
|
|
5998
6011
|
const { width, height } = customCursorSize;
|
|
5999
6012
|
const offsetX = (rectWidth - width) / 2;
|
|
6000
|
-
return /* @__PURE__ */
|
|
6013
|
+
return /* @__PURE__ */ React72.createElement(
|
|
6001
6014
|
Rectangle,
|
|
6002
6015
|
{
|
|
6003
6016
|
fill: "#F7F8FA",
|
|
@@ -6024,7 +6037,7 @@ var ProfitAndLossChart = () => {
|
|
|
6024
6037
|
return data?.map((x) => summarizePnL(x.data));
|
|
6025
6038
|
}, [startSelectionMonth, endSelectionMonth, loaded]);
|
|
6026
6039
|
const [animateFrom, setAnimateFrom] = useState17(-1);
|
|
6027
|
-
return /* @__PURE__ */
|
|
6040
|
+
return /* @__PURE__ */ React72.createElement(
|
|
6028
6041
|
ResponsiveContainer,
|
|
6029
6042
|
{
|
|
6030
6043
|
className: classNames30(
|
|
@@ -6034,7 +6047,7 @@ var ProfitAndLossChart = () => {
|
|
|
6034
6047
|
width: "100%",
|
|
6035
6048
|
height: "100%"
|
|
6036
6049
|
},
|
|
6037
|
-
/* @__PURE__ */
|
|
6050
|
+
/* @__PURE__ */ React72.createElement(
|
|
6038
6051
|
BarChart,
|
|
6039
6052
|
{
|
|
6040
6053
|
margin: { left: 12, right: 12, bottom: 12 },
|
|
@@ -6043,17 +6056,17 @@ var ProfitAndLossChart = () => {
|
|
|
6043
6056
|
barGap,
|
|
6044
6057
|
className: "Layer__profit-and-loss-chart"
|
|
6045
6058
|
},
|
|
6046
|
-
/* @__PURE__ */
|
|
6059
|
+
/* @__PURE__ */ React72.createElement(
|
|
6047
6060
|
Tooltip2,
|
|
6048
6061
|
{
|
|
6049
6062
|
wrapperClassName: "Layer__chart__tooltip-wrapper",
|
|
6050
|
-
content: /* @__PURE__ */
|
|
6051
|
-
cursor: /* @__PURE__ */
|
|
6063
|
+
content: /* @__PURE__ */ React72.createElement(CustomTooltip, null),
|
|
6064
|
+
cursor: /* @__PURE__ */ React72.createElement(CustomizedCursor, null),
|
|
6052
6065
|
animationDuration: 100,
|
|
6053
6066
|
animationEasing: "ease-out"
|
|
6054
6067
|
}
|
|
6055
6068
|
),
|
|
6056
|
-
/* @__PURE__ */
|
|
6069
|
+
/* @__PURE__ */ React72.createElement(
|
|
6057
6070
|
CartesianGrid,
|
|
6058
6071
|
{
|
|
6059
6072
|
vertical: false,
|
|
@@ -6061,7 +6074,7 @@ var ProfitAndLossChart = () => {
|
|
|
6061
6074
|
strokeDasharray: "5 5"
|
|
6062
6075
|
}
|
|
6063
6076
|
),
|
|
6064
|
-
/* @__PURE__ */
|
|
6077
|
+
/* @__PURE__ */ React72.createElement(
|
|
6065
6078
|
Legend,
|
|
6066
6079
|
{
|
|
6067
6080
|
verticalAlign: "top",
|
|
@@ -6080,8 +6093,8 @@ var ProfitAndLossChart = () => {
|
|
|
6080
6093
|
]
|
|
6081
6094
|
}
|
|
6082
6095
|
),
|
|
6083
|
-
/* @__PURE__ */
|
|
6084
|
-
/* @__PURE__ */
|
|
6096
|
+
/* @__PURE__ */ React72.createElement(XAxis, { dataKey: "name", tickLine: false }),
|
|
6097
|
+
/* @__PURE__ */ React72.createElement(
|
|
6085
6098
|
Bar,
|
|
6086
6099
|
{
|
|
6087
6100
|
dataKey: "revenue",
|
|
@@ -6090,10 +6103,10 @@ var ProfitAndLossChart = () => {
|
|
|
6090
6103
|
radius: [2, 2, 0, 0],
|
|
6091
6104
|
className: "Layer__profit-and-loss-chart__bar--income"
|
|
6092
6105
|
},
|
|
6093
|
-
/* @__PURE__ */
|
|
6106
|
+
/* @__PURE__ */ React72.createElement(
|
|
6094
6107
|
LabelList,
|
|
6095
6108
|
{
|
|
6096
|
-
content: /* @__PURE__ */
|
|
6109
|
+
content: /* @__PURE__ */ React72.createElement(
|
|
6097
6110
|
Indicator,
|
|
6098
6111
|
{
|
|
6099
6112
|
setCustomCursorSize: (width, height, x) => setCustomCursorSize({ width, height, x }),
|
|
@@ -6105,7 +6118,7 @@ var ProfitAndLossChart = () => {
|
|
|
6105
6118
|
}
|
|
6106
6119
|
),
|
|
6107
6120
|
theData?.map((entry) => {
|
|
6108
|
-
return /* @__PURE__ */
|
|
6121
|
+
return /* @__PURE__ */ React72.createElement(
|
|
6109
6122
|
Cell,
|
|
6110
6123
|
{
|
|
6111
6124
|
key: entry.name,
|
|
@@ -6114,7 +6127,7 @@ var ProfitAndLossChart = () => {
|
|
|
6114
6127
|
);
|
|
6115
6128
|
})
|
|
6116
6129
|
),
|
|
6117
|
-
/* @__PURE__ */
|
|
6130
|
+
/* @__PURE__ */ React72.createElement(
|
|
6118
6131
|
Bar,
|
|
6119
6132
|
{
|
|
6120
6133
|
dataKey: "expenses",
|
|
@@ -6123,7 +6136,7 @@ var ProfitAndLossChart = () => {
|
|
|
6123
6136
|
radius: [2, 2, 0, 0],
|
|
6124
6137
|
className: "Layer__profit-and-loss-chart__bar--expenses"
|
|
6125
6138
|
},
|
|
6126
|
-
theData.map((entry) => /* @__PURE__ */
|
|
6139
|
+
theData.map((entry) => /* @__PURE__ */ React72.createElement(
|
|
6127
6140
|
Cell,
|
|
6128
6141
|
{
|
|
6129
6142
|
key: entry.name,
|
|
@@ -6136,10 +6149,10 @@ var ProfitAndLossChart = () => {
|
|
|
6136
6149
|
};
|
|
6137
6150
|
|
|
6138
6151
|
// src/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker.tsx
|
|
6139
|
-
import
|
|
6152
|
+
import React74, { useContext as useContext5 } from "react";
|
|
6140
6153
|
|
|
6141
6154
|
// src/components/DateMonthPicker/DateMonthPicker.tsx
|
|
6142
|
-
import
|
|
6155
|
+
import React73, { useState as useState18, useEffect as useEffect14 } from "react";
|
|
6143
6156
|
import { add, endOfMonth as endOfMonth4, format as format5, startOfMonth as startOfMonth5 } from "date-fns";
|
|
6144
6157
|
var DateMonthPicker = ({
|
|
6145
6158
|
dateRange,
|
|
@@ -6191,14 +6204,14 @@ var DateMonthPicker = ({
|
|
|
6191
6204
|
const currentLabel = format5(localDate, "LLLL, y");
|
|
6192
6205
|
const prevLabel = format5(add(localDate, { months: -1 }), "LLLL, y");
|
|
6193
6206
|
const nextLabel = format5(add(localDate, { months: 1 }), "LLLL, y");
|
|
6194
|
-
return /* @__PURE__ */
|
|
6207
|
+
return /* @__PURE__ */ React73.createElement("div", { className: "Layer__date-month-picker" }, /* @__PURE__ */ React73.createElement(
|
|
6195
6208
|
"div",
|
|
6196
6209
|
{
|
|
6197
6210
|
className: "Layer__date-month-picker__labels-container",
|
|
6198
6211
|
style: transformStyle
|
|
6199
6212
|
},
|
|
6200
|
-
/* @__PURE__ */
|
|
6201
|
-
/* @__PURE__ */
|
|
6213
|
+
/* @__PURE__ */ React73.createElement("span", { className: "Layer__date-month-picker__label" }, prevLabel),
|
|
6214
|
+
/* @__PURE__ */ React73.createElement(
|
|
6202
6215
|
"span",
|
|
6203
6216
|
{
|
|
6204
6217
|
className: "Layer__date-month-picker__label",
|
|
@@ -6206,7 +6219,7 @@ var DateMonthPicker = ({
|
|
|
6206
6219
|
},
|
|
6207
6220
|
currentLabel
|
|
6208
6221
|
),
|
|
6209
|
-
/* @__PURE__ */
|
|
6222
|
+
/* @__PURE__ */ React73.createElement(
|
|
6210
6223
|
"span",
|
|
6211
6224
|
{
|
|
6212
6225
|
className: "Layer__date-month-picker__label",
|
|
@@ -6214,7 +6227,7 @@ var DateMonthPicker = ({
|
|
|
6214
6227
|
},
|
|
6215
6228
|
nextLabel
|
|
6216
6229
|
)
|
|
6217
|
-
), /* @__PURE__ */
|
|
6230
|
+
), /* @__PURE__ */ React73.createElement(
|
|
6218
6231
|
"button",
|
|
6219
6232
|
{
|
|
6220
6233
|
"aria-label": "View Previous Month",
|
|
@@ -6222,14 +6235,14 @@ var DateMonthPicker = ({
|
|
|
6222
6235
|
onClick: () => change(-1),
|
|
6223
6236
|
disabled: isAnimating
|
|
6224
6237
|
},
|
|
6225
|
-
/* @__PURE__ */
|
|
6238
|
+
/* @__PURE__ */ React73.createElement(
|
|
6226
6239
|
ChevronLeft_default,
|
|
6227
6240
|
{
|
|
6228
6241
|
className: "Layer__date-month-picker__button-icon",
|
|
6229
6242
|
size: 16
|
|
6230
6243
|
}
|
|
6231
6244
|
)
|
|
6232
|
-
), /* @__PURE__ */
|
|
6245
|
+
), /* @__PURE__ */ React73.createElement(
|
|
6233
6246
|
"button",
|
|
6234
6247
|
{
|
|
6235
6248
|
"aria-label": "View Next Month",
|
|
@@ -6237,28 +6250,28 @@ var DateMonthPicker = ({
|
|
|
6237
6250
|
onClick: () => change(1),
|
|
6238
6251
|
disabled: isAnimating
|
|
6239
6252
|
},
|
|
6240
|
-
/* @__PURE__ */
|
|
6253
|
+
/* @__PURE__ */ React73.createElement(
|
|
6241
6254
|
ChevronRight_default,
|
|
6242
6255
|
{
|
|
6243
6256
|
className: "Layer__date-month-picker__button-icon",
|
|
6244
6257
|
size: 16
|
|
6245
6258
|
}
|
|
6246
6259
|
)
|
|
6247
|
-
), /* @__PURE__ */
|
|
6260
|
+
), /* @__PURE__ */ React73.createElement("div", { className: "Layer__date-month-picker__effect-blur" }));
|
|
6248
6261
|
};
|
|
6249
6262
|
|
|
6250
6263
|
// src/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker.tsx
|
|
6251
6264
|
var ProfitAndLossDatePicker = () => {
|
|
6252
6265
|
const { changeDateRange, dateRange } = useContext5(ProfitAndLoss.Context);
|
|
6253
|
-
return /* @__PURE__ */
|
|
6266
|
+
return /* @__PURE__ */ React74.createElement(DateMonthPicker, { dateRange, changeDateRange });
|
|
6254
6267
|
};
|
|
6255
6268
|
|
|
6256
6269
|
// src/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts.tsx
|
|
6257
|
-
import
|
|
6270
|
+
import React80, { useContext as useContext6, useState as useState19 } from "react";
|
|
6258
6271
|
|
|
6259
6272
|
// src/icons/X.tsx
|
|
6260
|
-
import * as
|
|
6261
|
-
var X = ({ size = 18, ...props }) => /* @__PURE__ */
|
|
6273
|
+
import * as React75 from "react";
|
|
6274
|
+
var X = ({ size = 18, ...props }) => /* @__PURE__ */ React75.createElement(
|
|
6262
6275
|
"svg",
|
|
6263
6276
|
{
|
|
6264
6277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6268,7 +6281,7 @@ var X = ({ size = 18, ...props }) => /* @__PURE__ */ React74.createElement(
|
|
|
6268
6281
|
width: size,
|
|
6269
6282
|
height: size
|
|
6270
6283
|
},
|
|
6271
|
-
/* @__PURE__ */
|
|
6284
|
+
/* @__PURE__ */ React75.createElement(
|
|
6272
6285
|
"path",
|
|
6273
6286
|
{
|
|
6274
6287
|
d: "M13.5 4.5L4.5 13.5",
|
|
@@ -6277,7 +6290,7 @@ var X = ({ size = 18, ...props }) => /* @__PURE__ */ React74.createElement(
|
|
|
6277
6290
|
strokeLinejoin: "round"
|
|
6278
6291
|
}
|
|
6279
6292
|
),
|
|
6280
|
-
/* @__PURE__ */
|
|
6293
|
+
/* @__PURE__ */ React75.createElement(
|
|
6281
6294
|
"path",
|
|
6282
6295
|
{
|
|
6283
6296
|
d: "M4.5 4.5L13.5 13.5",
|
|
@@ -6290,7 +6303,7 @@ var X = ({ size = 18, ...props }) => /* @__PURE__ */ React74.createElement(
|
|
|
6290
6303
|
var X_default = X;
|
|
6291
6304
|
|
|
6292
6305
|
// src/components/ProfitAndLossDetailedCharts/DetailedChart.tsx
|
|
6293
|
-
import
|
|
6306
|
+
import React76, { useMemo as useMemo6 } from "react";
|
|
6294
6307
|
|
|
6295
6308
|
// src/config/charts.ts
|
|
6296
6309
|
var INACTIVE_OPACITY_LEVELS = [
|
|
@@ -6414,7 +6427,7 @@ var DetailedChart = ({
|
|
|
6414
6427
|
});
|
|
6415
6428
|
}, [filteredData, isLoading]);
|
|
6416
6429
|
const noValue = chartData.length === 0 || !chartData.find((x) => x.value !== 0);
|
|
6417
|
-
return /* @__PURE__ */
|
|
6430
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "chart-field" }, /* @__PURE__ */ React76.createElement("div", { className: "header--tablet" }, /* @__PURE__ */ React76.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, humanizeTitle(sidebarScope)), /* @__PURE__ */ React76.createElement(ProfitAndLossDatePicker, null)), /* @__PURE__ */ React76.createElement("div", { className: "chart-container" }, /* @__PURE__ */ React76.createElement(ResponsiveContainer2, null, /* @__PURE__ */ React76.createElement(PieChart, null, !isLoading && !noValue ? /* @__PURE__ */ React76.createElement(
|
|
6418
6431
|
Pie,
|
|
6419
6432
|
{
|
|
6420
6433
|
data: chartData,
|
|
@@ -6422,8 +6435,8 @@ var DetailedChart = ({
|
|
|
6422
6435
|
nameKey: "name",
|
|
6423
6436
|
cx: "50%",
|
|
6424
6437
|
cy: "50%",
|
|
6425
|
-
innerRadius:
|
|
6426
|
-
outerRadius:
|
|
6438
|
+
innerRadius: "91%",
|
|
6439
|
+
outerRadius: "100%",
|
|
6427
6440
|
paddingAngle: 0.5,
|
|
6428
6441
|
fill: "#8884d8",
|
|
6429
6442
|
animationDuration: 200,
|
|
@@ -6439,7 +6452,7 @@ var DetailedChart = ({
|
|
|
6439
6452
|
fill = void 0;
|
|
6440
6453
|
opacity = INACTIVE_OPACITY_LEVELS[index % INACTIVE_OPACITY_LEVELS.length];
|
|
6441
6454
|
}
|
|
6442
|
-
return /* @__PURE__ */
|
|
6455
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6443
6456
|
Cell2,
|
|
6444
6457
|
{
|
|
6445
6458
|
key: `cell-${index}`,
|
|
@@ -6451,7 +6464,7 @@ var DetailedChart = ({
|
|
|
6451
6464
|
}
|
|
6452
6465
|
);
|
|
6453
6466
|
}),
|
|
6454
|
-
/* @__PURE__ */
|
|
6467
|
+
/* @__PURE__ */ React76.createElement(
|
|
6455
6468
|
Label,
|
|
6456
6469
|
{
|
|
6457
6470
|
position: "center",
|
|
@@ -6472,7 +6485,7 @@ var DetailedChart = ({
|
|
|
6472
6485
|
if (hoveredItem) {
|
|
6473
6486
|
text = hoveredItem;
|
|
6474
6487
|
}
|
|
6475
|
-
return /* @__PURE__ */
|
|
6488
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6476
6489
|
ChartText,
|
|
6477
6490
|
{
|
|
6478
6491
|
...positioningProps,
|
|
@@ -6483,7 +6496,7 @@ var DetailedChart = ({
|
|
|
6483
6496
|
}
|
|
6484
6497
|
}
|
|
6485
6498
|
),
|
|
6486
|
-
/* @__PURE__ */
|
|
6499
|
+
/* @__PURE__ */ React76.createElement(
|
|
6487
6500
|
Label,
|
|
6488
6501
|
{
|
|
6489
6502
|
position: "center",
|
|
@@ -6506,7 +6519,7 @@ var DetailedChart = ({
|
|
|
6506
6519
|
(x) => x.display_name === hoveredItem
|
|
6507
6520
|
)?.value;
|
|
6508
6521
|
}
|
|
6509
|
-
return /* @__PURE__ */
|
|
6522
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6510
6523
|
ChartText,
|
|
6511
6524
|
{
|
|
6512
6525
|
...positioningProps,
|
|
@@ -6517,7 +6530,7 @@ var DetailedChart = ({
|
|
|
6517
6530
|
}
|
|
6518
6531
|
}
|
|
6519
6532
|
),
|
|
6520
|
-
/* @__PURE__ */
|
|
6533
|
+
/* @__PURE__ */ React76.createElement(
|
|
6521
6534
|
Label,
|
|
6522
6535
|
{
|
|
6523
6536
|
position: "center",
|
|
@@ -6536,7 +6549,7 @@ var DetailedChart = ({
|
|
|
6536
6549
|
verticalAnchor: "middle"
|
|
6537
6550
|
};
|
|
6538
6551
|
if (hoveredItem) {
|
|
6539
|
-
return /* @__PURE__ */
|
|
6552
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6540
6553
|
ChartText,
|
|
6541
6554
|
{
|
|
6542
6555
|
...positioningProps,
|
|
@@ -6553,7 +6566,7 @@ var DetailedChart = ({
|
|
|
6553
6566
|
}
|
|
6554
6567
|
}
|
|
6555
6568
|
)
|
|
6556
|
-
) : null, !isLoading && noValue ? /* @__PURE__ */
|
|
6569
|
+
) : null, !isLoading && noValue ? /* @__PURE__ */ React76.createElement(
|
|
6557
6570
|
Pie,
|
|
6558
6571
|
{
|
|
6559
6572
|
data: [{ name: "Total", value: 1 }],
|
|
@@ -6561,14 +6574,14 @@ var DetailedChart = ({
|
|
|
6561
6574
|
nameKey: "name",
|
|
6562
6575
|
cx: "50%",
|
|
6563
6576
|
cy: "50%",
|
|
6564
|
-
innerRadius:
|
|
6565
|
-
outerRadius:
|
|
6577
|
+
innerRadius: "91%",
|
|
6578
|
+
outerRadius: "100%",
|
|
6566
6579
|
paddingAngle: 0,
|
|
6567
6580
|
fill: "#F8F8FA",
|
|
6568
6581
|
animationDuration: 200,
|
|
6569
6582
|
animationEasing: "ease-in-out"
|
|
6570
6583
|
},
|
|
6571
|
-
/* @__PURE__ */
|
|
6584
|
+
/* @__PURE__ */ React76.createElement(
|
|
6572
6585
|
Label,
|
|
6573
6586
|
{
|
|
6574
6587
|
position: "center",
|
|
@@ -6589,7 +6602,7 @@ var DetailedChart = ({
|
|
|
6589
6602
|
if (hoveredItem) {
|
|
6590
6603
|
text = hoveredItem;
|
|
6591
6604
|
}
|
|
6592
|
-
return /* @__PURE__ */
|
|
6605
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6593
6606
|
ChartText,
|
|
6594
6607
|
{
|
|
6595
6608
|
...positioningProps,
|
|
@@ -6600,7 +6613,7 @@ var DetailedChart = ({
|
|
|
6600
6613
|
}
|
|
6601
6614
|
}
|
|
6602
6615
|
),
|
|
6603
|
-
/* @__PURE__ */
|
|
6616
|
+
/* @__PURE__ */ React76.createElement(
|
|
6604
6617
|
Label,
|
|
6605
6618
|
{
|
|
6606
6619
|
position: "center",
|
|
@@ -6623,7 +6636,7 @@ var DetailedChart = ({
|
|
|
6623
6636
|
(x) => x.display_name === hoveredItem
|
|
6624
6637
|
)?.value;
|
|
6625
6638
|
}
|
|
6626
|
-
return /* @__PURE__ */
|
|
6639
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6627
6640
|
ChartText,
|
|
6628
6641
|
{
|
|
6629
6642
|
...positioningProps,
|
|
@@ -6634,7 +6647,7 @@ var DetailedChart = ({
|
|
|
6634
6647
|
}
|
|
6635
6648
|
}
|
|
6636
6649
|
)
|
|
6637
|
-
) : null, isLoading ? /* @__PURE__ */
|
|
6650
|
+
) : null, isLoading ? /* @__PURE__ */ React76.createElement(
|
|
6638
6651
|
Pie,
|
|
6639
6652
|
{
|
|
6640
6653
|
data: [{ name: "loading...", value: 1 }],
|
|
@@ -6642,8 +6655,8 @@ var DetailedChart = ({
|
|
|
6642
6655
|
nameKey: "name",
|
|
6643
6656
|
cx: "50%",
|
|
6644
6657
|
cy: "50%",
|
|
6645
|
-
innerRadius:
|
|
6646
|
-
outerRadius:
|
|
6658
|
+
innerRadius: "91%",
|
|
6659
|
+
outerRadius: "100%",
|
|
6647
6660
|
paddingAngle: 0,
|
|
6648
6661
|
fill: "#F8F8FA",
|
|
6649
6662
|
animationDuration: 200,
|
|
@@ -6653,11 +6666,11 @@ var DetailedChart = ({
|
|
|
6653
6666
|
};
|
|
6654
6667
|
|
|
6655
6668
|
// src/components/ProfitAndLossDetailedCharts/DetailedTable.tsx
|
|
6656
|
-
import
|
|
6669
|
+
import React78 from "react";
|
|
6657
6670
|
|
|
6658
6671
|
// src/icons/SortArrows.tsx
|
|
6659
|
-
import * as
|
|
6660
|
-
var SortArrows = ({ size = 13, ...props }) => /* @__PURE__ */
|
|
6672
|
+
import * as React77 from "react";
|
|
6673
|
+
var SortArrows = ({ size = 13, ...props }) => /* @__PURE__ */ React77.createElement(
|
|
6661
6674
|
"svg",
|
|
6662
6675
|
{
|
|
6663
6676
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6667,7 +6680,7 @@ var SortArrows = ({ size = 13, ...props }) => /* @__PURE__ */ React76.createElem
|
|
|
6667
6680
|
width: size,
|
|
6668
6681
|
height: size
|
|
6669
6682
|
},
|
|
6670
|
-
/* @__PURE__ */
|
|
6683
|
+
/* @__PURE__ */ React77.createElement("g", { clipPath: "url(#clip0_1758_75388)" }, /* @__PURE__ */ React77.createElement(
|
|
6671
6684
|
"path",
|
|
6672
6685
|
{
|
|
6673
6686
|
d: "M1.33325 8.5L3.99992 11.1667L6.66659 8.5",
|
|
@@ -6676,7 +6689,7 @@ var SortArrows = ({ size = 13, ...props }) => /* @__PURE__ */ React76.createElem
|
|
|
6676
6689
|
strokeLinejoin: "round",
|
|
6677
6690
|
className: "desc-arrow"
|
|
6678
6691
|
}
|
|
6679
|
-
), /* @__PURE__ */
|
|
6692
|
+
), /* @__PURE__ */ React77.createElement(
|
|
6680
6693
|
"path",
|
|
6681
6694
|
{
|
|
6682
6695
|
d: "M4 2.5L4 11.1667",
|
|
@@ -6685,7 +6698,7 @@ var SortArrows = ({ size = 13, ...props }) => /* @__PURE__ */ React76.createElem
|
|
|
6685
6698
|
strokeLinejoin: "round",
|
|
6686
6699
|
className: "desc-arrow"
|
|
6687
6700
|
}
|
|
6688
|
-
), /* @__PURE__ */
|
|
6701
|
+
), /* @__PURE__ */ React77.createElement(
|
|
6689
6702
|
"path",
|
|
6690
6703
|
{
|
|
6691
6704
|
d: "M5.99988 5.16602L8.66654 2.49935L11.3332 5.16602",
|
|
@@ -6694,7 +6707,7 @@ var SortArrows = ({ size = 13, ...props }) => /* @__PURE__ */ React76.createElem
|
|
|
6694
6707
|
strokeLinejoin: "round",
|
|
6695
6708
|
className: "asc-arrow"
|
|
6696
6709
|
}
|
|
6697
|
-
), /* @__PURE__ */
|
|
6710
|
+
), /* @__PURE__ */ React77.createElement(
|
|
6698
6711
|
"path",
|
|
6699
6712
|
{
|
|
6700
6713
|
d: "M8.66663 11.166L8.66663 2.49935",
|
|
@@ -6704,7 +6717,7 @@ var SortArrows = ({ size = 13, ...props }) => /* @__PURE__ */ React76.createElem
|
|
|
6704
6717
|
className: "asc-arrow"
|
|
6705
6718
|
}
|
|
6706
6719
|
)),
|
|
6707
|
-
/* @__PURE__ */
|
|
6720
|
+
/* @__PURE__ */ React77.createElement("defs", null, /* @__PURE__ */ React77.createElement("clipPath", { id: "clip0_1758_75388" }, /* @__PURE__ */ React77.createElement(
|
|
6708
6721
|
"rect",
|
|
6709
6722
|
{
|
|
6710
6723
|
width: "12",
|
|
@@ -6732,33 +6745,33 @@ var DetailedTable = ({
|
|
|
6732
6745
|
sidebarScope && filters[sidebarScope]?.sortBy === column ? `sort--${(sidebarScope && filters[sidebarScope]?.sortDirection) ?? "desc"}` : ""
|
|
6733
6746
|
);
|
|
6734
6747
|
};
|
|
6735
|
-
return /* @__PURE__ */
|
|
6748
|
+
return /* @__PURE__ */ React78.createElement("div", { className: "details-container" }, /* @__PURE__ */ React78.createElement("div", { className: "table" }, /* @__PURE__ */ React78.createElement("table", null, /* @__PURE__ */ React78.createElement("thead", null, /* @__PURE__ */ React78.createElement("tr", null, /* @__PURE__ */ React78.createElement(
|
|
6736
6749
|
"th",
|
|
6737
6750
|
{
|
|
6738
6751
|
className: buildColClass("category"),
|
|
6739
6752
|
onClick: () => sortBy(sidebarScope ?? "expenses", "category")
|
|
6740
6753
|
},
|
|
6741
6754
|
"Category ",
|
|
6742
|
-
/* @__PURE__ */
|
|
6743
|
-
), /* @__PURE__ */
|
|
6755
|
+
/* @__PURE__ */ React78.createElement(SortArrows_default, { className: "Layer__sort-arrows" })
|
|
6756
|
+
), /* @__PURE__ */ React78.createElement(
|
|
6744
6757
|
"th",
|
|
6745
6758
|
{
|
|
6746
6759
|
className: buildColClass("type"),
|
|
6747
6760
|
onClick: () => sortBy(sidebarScope ?? "expenses", "type")
|
|
6748
6761
|
},
|
|
6749
6762
|
"Type ",
|
|
6750
|
-
/* @__PURE__ */
|
|
6751
|
-
), /* @__PURE__ */
|
|
6763
|
+
/* @__PURE__ */ React78.createElement(SortArrows_default, { className: "Layer__sort-arrows" })
|
|
6764
|
+
), /* @__PURE__ */ React78.createElement("th", null), /* @__PURE__ */ React78.createElement(
|
|
6752
6765
|
"th",
|
|
6753
6766
|
{
|
|
6754
6767
|
className: buildColClass("value"),
|
|
6755
6768
|
onClick: () => sortBy(sidebarScope ?? "expenses", "value")
|
|
6756
6769
|
},
|
|
6757
6770
|
"Value ",
|
|
6758
|
-
/* @__PURE__ */
|
|
6759
|
-
))), /* @__PURE__ */
|
|
6771
|
+
/* @__PURE__ */ React78.createElement(SortArrows_default, { className: "Layer__sort-arrows" })
|
|
6772
|
+
))), /* @__PURE__ */ React78.createElement("tbody", null, filteredData.filter((x) => !x.hidden).map((item, idx) => {
|
|
6760
6773
|
const colorConfig = DEFAULT_CHART_COLORS[idx % DEFAULT_CHART_COLORS.length];
|
|
6761
|
-
return /* @__PURE__ */
|
|
6774
|
+
return /* @__PURE__ */ React78.createElement(
|
|
6762
6775
|
"tr",
|
|
6763
6776
|
{
|
|
6764
6777
|
key: `pl-side-table-item-${idx}`,
|
|
@@ -6769,10 +6782,10 @@ var DetailedTable = ({
|
|
|
6769
6782
|
onMouseEnter: () => setHoveredItem(item.display_name),
|
|
6770
6783
|
onMouseLeave: () => setHoveredItem(void 0)
|
|
6771
6784
|
},
|
|
6772
|
-
/* @__PURE__ */
|
|
6773
|
-
/* @__PURE__ */
|
|
6774
|
-
/* @__PURE__ */
|
|
6775
|
-
/* @__PURE__ */
|
|
6785
|
+
/* @__PURE__ */ React78.createElement("td", { className: "category-col" }, item.display_name),
|
|
6786
|
+
/* @__PURE__ */ React78.createElement("td", { className: "type-col" }, item.type),
|
|
6787
|
+
/* @__PURE__ */ React78.createElement("td", { className: "value-col" }, "$", centsToDollars(item.value)),
|
|
6788
|
+
/* @__PURE__ */ React78.createElement("td", { className: "share-col" }, /* @__PURE__ */ React78.createElement("span", { className: "share-cell-content" }, formatPercent(item.share), "%", /* @__PURE__ */ React78.createElement(
|
|
6776
6789
|
"div",
|
|
6777
6790
|
{
|
|
6778
6791
|
className: "share-icon",
|
|
@@ -6787,7 +6800,7 @@ var DetailedTable = ({
|
|
|
6787
6800
|
};
|
|
6788
6801
|
|
|
6789
6802
|
// src/components/ProfitAndLossDetailedCharts/Filters.tsx
|
|
6790
|
-
import
|
|
6803
|
+
import React79 from "react";
|
|
6791
6804
|
import Select3, { components as components3 } from "react-select";
|
|
6792
6805
|
var Filters = ({
|
|
6793
6806
|
filteredData,
|
|
@@ -6795,7 +6808,7 @@ var Filters = ({
|
|
|
6795
6808
|
filters,
|
|
6796
6809
|
setFilterTypes
|
|
6797
6810
|
}) => {
|
|
6798
|
-
return /* @__PURE__ */
|
|
6811
|
+
return /* @__PURE__ */ React79.createElement("div", { className: "filters" }, /* @__PURE__ */ React79.createElement(Text, { size: "sm" /* sm */, className: "Layer__label" }, "Filters"), /* @__PURE__ */ React79.createElement(
|
|
6799
6812
|
Select3,
|
|
6800
6813
|
{
|
|
6801
6814
|
className: "Layer__select type-select",
|
|
@@ -6817,8 +6830,8 @@ var Filters = ({
|
|
|
6817
6830
|
);
|
|
6818
6831
|
},
|
|
6819
6832
|
components: {
|
|
6820
|
-
DropdownIndicator: (props) => /* @__PURE__ */
|
|
6821
|
-
Placeholder: (props) => /* @__PURE__ */
|
|
6833
|
+
DropdownIndicator: (props) => /* @__PURE__ */ React79.createElement(components3.DropdownIndicator, { ...props }, /* @__PURE__ */ React79.createElement(ChevronDown_default, null)),
|
|
6834
|
+
Placeholder: (props) => /* @__PURE__ */ React79.createElement(components3.Placeholder, { ...props }, /* @__PURE__ */ React79.createElement("div", { className: "Layer__select__multi-all-placeholder-badge" }, "All"))
|
|
6822
6835
|
}
|
|
6823
6836
|
}
|
|
6824
6837
|
));
|
|
@@ -6848,15 +6861,15 @@ var ProfitAndLossDetailedCharts = ({
|
|
|
6848
6861
|
const data = theScope === "revenue" ? filteredDataRevenue : filteredDataExpenses;
|
|
6849
6862
|
const total = theScope === "revenue" ? filteredTotalRevenue : filteredTotalExpenses;
|
|
6850
6863
|
const [hoveredItem, setHoveredItem] = useState19();
|
|
6851
|
-
return /* @__PURE__ */
|
|
6864
|
+
return /* @__PURE__ */ React80.createElement("div", { className: "Layer__profit-and-loss-detailed-charts" }, /* @__PURE__ */ React80.createElement("header", { className: "Layer__profit-and-loss-detailed-charts__header" }, /* @__PURE__ */ React80.createElement("div", { className: "Layer__profit-and-loss-detailed-charts__head" }, /* @__PURE__ */ React80.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, humanizeTitle(theScope)), /* @__PURE__ */ React80.createElement(Text, { size: "sm" /* sm */, className: "date" }, format6(dateRange.startDate, "LLLL, y")), showDatePicker && /* @__PURE__ */ React80.createElement(ProfitAndLossDatePicker, null)), !hideClose && /* @__PURE__ */ React80.createElement(
|
|
6852
6865
|
Button,
|
|
6853
6866
|
{
|
|
6854
|
-
rightIcon: /* @__PURE__ */
|
|
6867
|
+
rightIcon: /* @__PURE__ */ React80.createElement(X_default, null),
|
|
6855
6868
|
iconOnly: true,
|
|
6856
6869
|
onClick: () => setSidebarScope(void 0),
|
|
6857
6870
|
variant: "secondary" /* secondary */
|
|
6858
6871
|
}
|
|
6859
|
-
)), /* @__PURE__ */
|
|
6872
|
+
)), /* @__PURE__ */ React80.createElement("header", { className: "Layer__profit-and-loss-detailed-charts__header--tablet" }, /* @__PURE__ */ React80.createElement(BackButton, { onClick: () => setSidebarScope(void 0) })), /* @__PURE__ */ React80.createElement("div", { className: "Layer__profit-and-loss-detailed-charts__content" }, /* @__PURE__ */ React80.createElement(
|
|
6860
6873
|
DetailedChart,
|
|
6861
6874
|
{
|
|
6862
6875
|
filteredData: data,
|
|
@@ -6867,7 +6880,7 @@ var ProfitAndLossDetailedCharts = ({
|
|
|
6867
6880
|
date: dateRange.startDate,
|
|
6868
6881
|
isLoading
|
|
6869
6882
|
}
|
|
6870
|
-
), /* @__PURE__ */
|
|
6883
|
+
), /* @__PURE__ */ React80.createElement("div", { className: "Layer__profit-and-loss-detailed-charts__table-wrapper" }, /* @__PURE__ */ React80.createElement(
|
|
6871
6884
|
Filters,
|
|
6872
6885
|
{
|
|
6873
6886
|
filteredData: data,
|
|
@@ -6875,7 +6888,7 @@ var ProfitAndLossDetailedCharts = ({
|
|
|
6875
6888
|
filters,
|
|
6876
6889
|
setFilterTypes
|
|
6877
6890
|
}
|
|
6878
|
-
), /* @__PURE__ */
|
|
6891
|
+
), /* @__PURE__ */ React80.createElement(
|
|
6879
6892
|
DetailedTable,
|
|
6880
6893
|
{
|
|
6881
6894
|
filteredData: data,
|
|
@@ -6889,10 +6902,10 @@ var ProfitAndLossDetailedCharts = ({
|
|
|
6889
6902
|
};
|
|
6890
6903
|
|
|
6891
6904
|
// src/components/ProfitAndLossSummaries/ProfitAndLossSummaries.tsx
|
|
6892
|
-
import
|
|
6905
|
+
import React83, { useContext as useContext7, useMemo as useMemo7 } from "react";
|
|
6893
6906
|
|
|
6894
6907
|
// src/components/SkeletonLoader/SkeletonLoader.tsx
|
|
6895
|
-
import
|
|
6908
|
+
import React81 from "react";
|
|
6896
6909
|
import classNames32 from "classnames";
|
|
6897
6910
|
var SkeletonLoader = ({
|
|
6898
6911
|
height,
|
|
@@ -6903,14 +6916,14 @@ var SkeletonLoader = ({
|
|
|
6903
6916
|
"Layer__skeleton-loader Layer__anim--skeleton-loading",
|
|
6904
6917
|
className
|
|
6905
6918
|
);
|
|
6906
|
-
return /* @__PURE__ */
|
|
6919
|
+
return /* @__PURE__ */ React81.createElement("div", { className: baseClassName, style: { width, height } });
|
|
6907
6920
|
};
|
|
6908
6921
|
|
|
6909
6922
|
// src/components/ProfitAndLossSummaries/MiniChart.tsx
|
|
6910
|
-
import
|
|
6923
|
+
import React82 from "react";
|
|
6911
6924
|
import { PieChart as PieChart2, Pie as Pie2, Cell as Cell3 } from "recharts";
|
|
6912
6925
|
var MiniChart = ({ data }) => {
|
|
6913
|
-
return /* @__PURE__ */
|
|
6926
|
+
return /* @__PURE__ */ React82.createElement(PieChart2, { width: 52, height: 52, className: "mini-chart" }, /* @__PURE__ */ React82.createElement(
|
|
6914
6927
|
Pie2,
|
|
6915
6928
|
{
|
|
6916
6929
|
data,
|
|
@@ -6920,7 +6933,7 @@ var MiniChart = ({ data }) => {
|
|
|
6920
6933
|
cy: "50%",
|
|
6921
6934
|
innerRadius: 10,
|
|
6922
6935
|
outerRadius: 16,
|
|
6923
|
-
paddingAngle: 0.
|
|
6936
|
+
paddingAngle: 0.4,
|
|
6924
6937
|
fill: "#8884d8",
|
|
6925
6938
|
width: 24,
|
|
6926
6939
|
height: 24,
|
|
@@ -6929,7 +6942,7 @@ var MiniChart = ({ data }) => {
|
|
|
6929
6942
|
},
|
|
6930
6943
|
data.map((entry, index) => {
|
|
6931
6944
|
const colorConfig = DEFAULT_CHART_COLORS[index % DEFAULT_CHART_COLORS.length];
|
|
6932
|
-
return /* @__PURE__ */
|
|
6945
|
+
return /* @__PURE__ */ React82.createElement(
|
|
6933
6946
|
Cell3,
|
|
6934
6947
|
{
|
|
6935
6948
|
key: `cell-${index}`,
|
|
@@ -6992,12 +7005,12 @@ var ProfitAndLossSummaries = ({
|
|
|
6992
7005
|
const incomeDirectionClass = (data.income.value ?? NaN) < 0 ? "Layer__profit-and-loss-summaries__amount--negative" : "Layer__profit-and-loss-summaries__amount--positive";
|
|
6993
7006
|
const expensesDirectionClass = (data?.income?.value ?? NaN) - data.net_profit < 0 ? "Layer__profit-and-loss-summaries__amount--negative" : "Layer__profit-and-loss-summaries__amount--positive";
|
|
6994
7007
|
const netProfitDirectionClass = data.net_profit < 0 ? "Layer__profit-and-loss-summaries__amount--negative" : "Layer__profit-and-loss-summaries__amount--positive";
|
|
6995
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ React83.createElement(
|
|
6996
7009
|
"div",
|
|
6997
7010
|
{
|
|
6998
7011
|
className: `Layer__profit-and-loss-summaries ${vertical ? "flex-col" : ""}`
|
|
6999
7012
|
},
|
|
7000
|
-
/* @__PURE__ */
|
|
7013
|
+
/* @__PURE__ */ React83.createElement(
|
|
7001
7014
|
"div",
|
|
7002
7015
|
{
|
|
7003
7016
|
className: classNames33(
|
|
@@ -7010,8 +7023,8 @@ var ProfitAndLossSummaries = ({
|
|
|
7010
7023
|
actionable && setSidebarScope("revenue");
|
|
7011
7024
|
}
|
|
7012
7025
|
},
|
|
7013
|
-
/* @__PURE__ */
|
|
7014
|
-
/* @__PURE__ */
|
|
7026
|
+
/* @__PURE__ */ React83.createElement(MiniChart, { data: revenueChartData }),
|
|
7027
|
+
/* @__PURE__ */ React83.createElement("div", { className: "Layer__profit-and-loss-summaries__text" }, /* @__PURE__ */ React83.createElement("span", { className: "Layer__profit-and-loss-summaries__title" }, revenueLabel), isLoading || storedData === void 0 ? /* @__PURE__ */ React83.createElement("div", { className: "Layer__profit-and-loss-summaries__loader" }, /* @__PURE__ */ React83.createElement(SkeletonLoader, null)) : /* @__PURE__ */ React83.createElement(
|
|
7015
7028
|
"span",
|
|
7016
7029
|
{
|
|
7017
7030
|
className: `Layer__profit-and-loss-summaries__amount ${incomeDirectionClass}`
|
|
@@ -7019,7 +7032,7 @@ var ProfitAndLossSummaries = ({
|
|
|
7019
7032
|
centsToDollars(Math.abs(data?.income?.value ?? NaN))
|
|
7020
7033
|
))
|
|
7021
7034
|
),
|
|
7022
|
-
/* @__PURE__ */
|
|
7035
|
+
/* @__PURE__ */ React83.createElement(
|
|
7023
7036
|
"div",
|
|
7024
7037
|
{
|
|
7025
7038
|
className: classNames33(
|
|
@@ -7032,8 +7045,8 @@ var ProfitAndLossSummaries = ({
|
|
|
7032
7045
|
actionable && setSidebarScope("expenses");
|
|
7033
7046
|
}
|
|
7034
7047
|
},
|
|
7035
|
-
/* @__PURE__ */
|
|
7036
|
-
/* @__PURE__ */
|
|
7048
|
+
/* @__PURE__ */ React83.createElement(MiniChart, { data: expensesChartData }),
|
|
7049
|
+
/* @__PURE__ */ React83.createElement("div", { className: "Layer__profit-and-loss-summaries__text" }, /* @__PURE__ */ React83.createElement("span", { className: "Layer__profit-and-loss-summaries__title" }, "Expenses"), isLoading || storedData === void 0 ? /* @__PURE__ */ React83.createElement("div", { className: "Layer__profit-and-loss-summaries__loader" }, /* @__PURE__ */ React83.createElement(SkeletonLoader, { className: "Layer__profit-and-loss-summaries__loader" })) : /* @__PURE__ */ React83.createElement(
|
|
7037
7050
|
"span",
|
|
7038
7051
|
{
|
|
7039
7052
|
className: `Layer__profit-and-loss-summaries__amount ${expensesDirectionClass}`
|
|
@@ -7043,7 +7056,7 @@ var ProfitAndLossSummaries = ({
|
|
|
7043
7056
|
)
|
|
7044
7057
|
))
|
|
7045
7058
|
),
|
|
7046
|
-
/* @__PURE__ */
|
|
7059
|
+
/* @__PURE__ */ React83.createElement(
|
|
7047
7060
|
"div",
|
|
7048
7061
|
{
|
|
7049
7062
|
className: classNames33(
|
|
@@ -7051,7 +7064,7 @@ var ProfitAndLossSummaries = ({
|
|
|
7051
7064
|
actionable && "Layer__actionable"
|
|
7052
7065
|
)
|
|
7053
7066
|
},
|
|
7054
|
-
/* @__PURE__ */
|
|
7067
|
+
/* @__PURE__ */ React83.createElement("div", { className: "Layer__profit-and-loss-summaries__text" }, /* @__PURE__ */ React83.createElement("span", { className: "Layer__profit-and-loss-summaries__title" }, "Net Profit"), isLoading || storedData === void 0 ? /* @__PURE__ */ React83.createElement("div", { className: "Layer__profit-and-loss-summaries__loader" }, /* @__PURE__ */ React83.createElement(SkeletonLoader, { className: "Layer__profit-and-loss-summaries__loader" })) : /* @__PURE__ */ React83.createElement(
|
|
7055
7068
|
"span",
|
|
7056
7069
|
{
|
|
7057
7070
|
className: `Layer__profit-and-loss-summaries__amount ${netProfitDirectionClass}`
|
|
@@ -7063,14 +7076,14 @@ var ProfitAndLossSummaries = ({
|
|
|
7063
7076
|
};
|
|
7064
7077
|
|
|
7065
7078
|
// src/components/ProfitAndLossTable/ProfitAndLossTable.tsx
|
|
7066
|
-
import
|
|
7079
|
+
import React86, { useContext as useContext8 } from "react";
|
|
7067
7080
|
|
|
7068
7081
|
// src/components/ProfitAndLossRow/ProfitAndLossRow.tsx
|
|
7069
|
-
import
|
|
7082
|
+
import React85, { useState as useState20 } from "react";
|
|
7070
7083
|
|
|
7071
7084
|
// src/icons/PieChart.tsx
|
|
7072
|
-
import * as
|
|
7073
|
-
var PieChart3 = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
7085
|
+
import * as React84 from "react";
|
|
7086
|
+
var PieChart3 = ({ size = 12, ...props }) => /* @__PURE__ */ React84.createElement(
|
|
7074
7087
|
"svg",
|
|
7075
7088
|
{
|
|
7076
7089
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7080,7 +7093,7 @@ var PieChart3 = ({ size = 12, ...props }) => /* @__PURE__ */ React83.createEleme
|
|
|
7080
7093
|
width: size,
|
|
7081
7094
|
height: size
|
|
7082
7095
|
},
|
|
7083
|
-
/* @__PURE__ */
|
|
7096
|
+
/* @__PURE__ */ React84.createElement("g", null, /* @__PURE__ */ React84.createElement(
|
|
7084
7097
|
"path",
|
|
7085
7098
|
{
|
|
7086
7099
|
d: "M10.2213 7.78271C9.92969 8.47226 9.47363 9.07989 8.89297 9.55247C8.3123 10.0251 7.62471 10.3482 6.89031 10.4936C6.1559 10.6391 5.39705 10.6024 4.68009 10.3869C3.96313 10.1713 3.30989 9.78337 2.77749 9.25701C2.24509 8.73065 1.84973 8.08189 1.62598 7.36744C1.40223 6.65298 1.3569 5.8946 1.49396 5.15858C1.63102 4.42257 1.94629 3.73133 2.41221 3.14531C2.87813 2.55928 3.48051 2.09631 4.16669 1.79688",
|
|
@@ -7088,7 +7101,7 @@ var PieChart3 = ({ size = 12, ...props }) => /* @__PURE__ */ React83.createEleme
|
|
|
7088
7101
|
strokeLinecap: "round",
|
|
7089
7102
|
strokeLinejoin: "round"
|
|
7090
7103
|
}
|
|
7091
|
-
), /* @__PURE__ */
|
|
7104
|
+
), /* @__PURE__ */ React84.createElement(
|
|
7092
7105
|
"path",
|
|
7093
7106
|
{
|
|
7094
7107
|
d: "M10.5833 6.00033C10.5833 5.39843 10.4648 4.80244 10.2344 4.24636C10.0041 3.69028 9.66651 3.18502 9.24091 2.75942C8.8153 2.33382 8.31004 1.99621 7.75397 1.76588C7.19789 1.53554 6.60189 1.41699 6 1.41699V6.00033H10.5833Z",
|
|
@@ -7146,20 +7159,20 @@ var ProfitAndLossRow = ({
|
|
|
7146
7159
|
);
|
|
7147
7160
|
displayChildren && expanded && labelClasses.push("Layer__profit-and-loss-row__label--expanded");
|
|
7148
7161
|
displayChildren && expanded && valueClasses.push("Layer__profit-and-loss-row__value--expanded");
|
|
7149
|
-
return /* @__PURE__ */
|
|
7162
|
+
return /* @__PURE__ */ React85.createElement(React85.Fragment, null, /* @__PURE__ */ React85.createElement(
|
|
7150
7163
|
"div",
|
|
7151
7164
|
{
|
|
7152
7165
|
className: labelClasses.join(" "),
|
|
7153
7166
|
onClick: () => !lockExpanded && toggleExpanded()
|
|
7154
7167
|
},
|
|
7155
|
-
/* @__PURE__ */
|
|
7168
|
+
/* @__PURE__ */ React85.createElement("span", { className: "Layer__profit-and-loss-row__label__title" }, !lockExpanded && variant !== "summation" ? /* @__PURE__ */ React85.createElement(
|
|
7156
7169
|
ChevronDownFill_default,
|
|
7157
7170
|
{
|
|
7158
7171
|
size: 16,
|
|
7159
7172
|
className: "Layer__profit-and-loss-row__label__chevron"
|
|
7160
7173
|
}
|
|
7161
|
-
) : null, /* @__PURE__ */
|
|
7162
|
-
setSidebarScope && /* @__PURE__ */
|
|
7174
|
+
) : null, /* @__PURE__ */ React85.createElement(Text, null, display_name)),
|
|
7175
|
+
setSidebarScope && /* @__PURE__ */ React85.createElement(
|
|
7163
7176
|
"span",
|
|
7164
7177
|
{
|
|
7165
7178
|
className: "Layer__profit-and-loss-row__detailed-chart-btn",
|
|
@@ -7168,14 +7181,14 @@ var ProfitAndLossRow = ({
|
|
|
7168
7181
|
setSidebarScope && setSidebarScope(scope ?? "expenses");
|
|
7169
7182
|
}
|
|
7170
7183
|
},
|
|
7171
|
-
/* @__PURE__ */
|
|
7184
|
+
/* @__PURE__ */ React85.createElement(PieChart_default, null)
|
|
7172
7185
|
)
|
|
7173
|
-
), /* @__PURE__ */
|
|
7186
|
+
), /* @__PURE__ */ React85.createElement("div", { className: valueClasses.join(" ") }, /* @__PURE__ */ React85.createElement(Text, null, amountString)), canGoDeeper && hasChildren && /* @__PURE__ */ React85.createElement(
|
|
7174
7187
|
"div",
|
|
7175
7188
|
{
|
|
7176
7189
|
className: `Layer__profit-and-loss-row__children ${expanded && "Layer__profit-and-loss-row__children--expanded"}`
|
|
7177
7190
|
},
|
|
7178
|
-
/* @__PURE__ */
|
|
7191
|
+
/* @__PURE__ */ React85.createElement("div", { className: "Layer__profit-and-loss-row__children--content" }, (line_items || []).map((line_item) => /* @__PURE__ */ React85.createElement(
|
|
7179
7192
|
ProfitAndLossRow,
|
|
7180
7193
|
{
|
|
7181
7194
|
key: line_item.display_name,
|
|
@@ -7247,7 +7260,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7247
7260
|
const currentData = Array.isArray(actualData) ? actualData[actualData.length - 1] : actualData;
|
|
7248
7261
|
const data = !currentData || isLoading ? empty_profit_and_loss_report_default : currentData;
|
|
7249
7262
|
if (isLoading || actualData === void 0) {
|
|
7250
|
-
return /* @__PURE__ */
|
|
7263
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7251
7264
|
"div",
|
|
7252
7265
|
{
|
|
7253
7266
|
className: classNames34(
|
|
@@ -7255,10 +7268,10 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7255
7268
|
asContainer && "Layer__component-container"
|
|
7256
7269
|
)
|
|
7257
7270
|
},
|
|
7258
|
-
/* @__PURE__ */
|
|
7271
|
+
/* @__PURE__ */ React86.createElement(Loader2, null)
|
|
7259
7272
|
);
|
|
7260
7273
|
}
|
|
7261
|
-
return /* @__PURE__ */
|
|
7274
|
+
return /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(
|
|
7262
7275
|
"div",
|
|
7263
7276
|
{
|
|
7264
7277
|
className: classNames34(
|
|
@@ -7266,7 +7279,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7266
7279
|
asContainer && "Layer__component-container"
|
|
7267
7280
|
)
|
|
7268
7281
|
},
|
|
7269
|
-
/* @__PURE__ */
|
|
7282
|
+
/* @__PURE__ */ React86.createElement(
|
|
7270
7283
|
ProfitAndLossRow,
|
|
7271
7284
|
{
|
|
7272
7285
|
lineItem: data.income,
|
|
@@ -7276,7 +7289,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7276
7289
|
setSidebarScope
|
|
7277
7290
|
}
|
|
7278
7291
|
),
|
|
7279
|
-
/* @__PURE__ */
|
|
7292
|
+
/* @__PURE__ */ React86.createElement(
|
|
7280
7293
|
ProfitAndLossRow,
|
|
7281
7294
|
{
|
|
7282
7295
|
lineItem: data.cost_of_goods_sold,
|
|
@@ -7286,7 +7299,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7286
7299
|
setSidebarScope
|
|
7287
7300
|
}
|
|
7288
7301
|
),
|
|
7289
|
-
/* @__PURE__ */
|
|
7302
|
+
/* @__PURE__ */ React86.createElement(
|
|
7290
7303
|
ProfitAndLossRow,
|
|
7291
7304
|
{
|
|
7292
7305
|
lineItem: {
|
|
@@ -7300,7 +7313,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7300
7313
|
setSidebarScope
|
|
7301
7314
|
}
|
|
7302
7315
|
),
|
|
7303
|
-
/* @__PURE__ */
|
|
7316
|
+
/* @__PURE__ */ React86.createElement(
|
|
7304
7317
|
ProfitAndLossRow,
|
|
7305
7318
|
{
|
|
7306
7319
|
lineItem: data.expenses,
|
|
@@ -7310,7 +7323,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7310
7323
|
setSidebarScope
|
|
7311
7324
|
}
|
|
7312
7325
|
),
|
|
7313
|
-
/* @__PURE__ */
|
|
7326
|
+
/* @__PURE__ */ React86.createElement(
|
|
7314
7327
|
ProfitAndLossRow,
|
|
7315
7328
|
{
|
|
7316
7329
|
lineItem: {
|
|
@@ -7324,7 +7337,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7324
7337
|
setSidebarScope
|
|
7325
7338
|
}
|
|
7326
7339
|
),
|
|
7327
|
-
/* @__PURE__ */
|
|
7340
|
+
/* @__PURE__ */ React86.createElement(
|
|
7328
7341
|
ProfitAndLossRow,
|
|
7329
7342
|
{
|
|
7330
7343
|
lineItem: data.taxes,
|
|
@@ -7334,7 +7347,7 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7334
7347
|
setSidebarScope
|
|
7335
7348
|
}
|
|
7336
7349
|
),
|
|
7337
|
-
/* @__PURE__ */
|
|
7350
|
+
/* @__PURE__ */ React86.createElement(
|
|
7338
7351
|
ProfitAndLossRow,
|
|
7339
7352
|
{
|
|
7340
7353
|
lineItem: {
|
|
@@ -7346,14 +7359,14 @@ var ProfitAndLossTable = ({ lockExpanded, asContainer }) => {
|
|
|
7346
7359
|
lockExpanded
|
|
7347
7360
|
}
|
|
7348
7361
|
)
|
|
7349
|
-
), data.other_outflows || data.personal_expenses ? /* @__PURE__ */
|
|
7362
|
+
), data.other_outflows || data.personal_expenses ? /* @__PURE__ */ React86.createElement("div", { className: "Layer__profit-and-loss-table Layer__profit-and-loss-table__outflows" }, /* @__PURE__ */ React86.createElement(
|
|
7350
7363
|
ProfitAndLossRow,
|
|
7351
7364
|
{
|
|
7352
7365
|
lineItem: data.other_outflows,
|
|
7353
7366
|
direction: "DEBIT" /* DEBIT */,
|
|
7354
7367
|
lockExpanded
|
|
7355
7368
|
}
|
|
7356
|
-
), /* @__PURE__ */
|
|
7369
|
+
), /* @__PURE__ */ React86.createElement(
|
|
7357
7370
|
ProfitAndLossRow,
|
|
7358
7371
|
{
|
|
7359
7372
|
lineItem: data.personal_expenses,
|
|
@@ -7401,7 +7414,7 @@ var ProfitAndLoss = ({
|
|
|
7401
7414
|
asContainer = true
|
|
7402
7415
|
}) => {
|
|
7403
7416
|
const contextData = useProfitAndLoss({ tagFilter, reportingBasis });
|
|
7404
|
-
return /* @__PURE__ */
|
|
7417
|
+
return /* @__PURE__ */ React87.createElement(PNLContext.Provider, { value: contextData }, asContainer ? /* @__PURE__ */ React87.createElement(Container, { name: "profit-and-loss" }, children) : children);
|
|
7405
7418
|
};
|
|
7406
7419
|
ProfitAndLoss.Chart = ProfitAndLossChart;
|
|
7407
7420
|
ProfitAndLoss.Context = PNLContext;
|
|
@@ -7411,10 +7424,10 @@ ProfitAndLoss.Table = ProfitAndLossTable;
|
|
|
7411
7424
|
ProfitAndLoss.DetailedCharts = ProfitAndLossDetailedCharts;
|
|
7412
7425
|
|
|
7413
7426
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
7414
|
-
import
|
|
7427
|
+
import React89, { useContext as useContext9, useRef as useRef14 } from "react";
|
|
7415
7428
|
|
|
7416
7429
|
// src/components/Panel/Panel.tsx
|
|
7417
|
-
import
|
|
7430
|
+
import React88, { useEffect as useEffect15, useState as useState21 } from "react";
|
|
7418
7431
|
import classNames35 from "classnames";
|
|
7419
7432
|
var Panel = ({
|
|
7420
7433
|
children,
|
|
@@ -7430,7 +7443,7 @@ var Panel = ({
|
|
|
7430
7443
|
setSidebarHeight(parentRef?.current?.offsetHeight - 1);
|
|
7431
7444
|
}
|
|
7432
7445
|
}, [parentRef?.current?.offsetHeight, sidebarIsOpen]);
|
|
7433
|
-
return /* @__PURE__ */
|
|
7446
|
+
return /* @__PURE__ */ React88.createElement(
|
|
7434
7447
|
"div",
|
|
7435
7448
|
{
|
|
7436
7449
|
className: classNames35(
|
|
@@ -7439,8 +7452,8 @@ var Panel = ({
|
|
|
7439
7452
|
sidebarIsOpen && "Layer__panel--open"
|
|
7440
7453
|
)
|
|
7441
7454
|
},
|
|
7442
|
-
/* @__PURE__ */
|
|
7443
|
-
sidebar && /* @__PURE__ */
|
|
7455
|
+
/* @__PURE__ */ React88.createElement("div", { className: "Layer__panel__content" }, header, children),
|
|
7456
|
+
sidebar && /* @__PURE__ */ React88.createElement(
|
|
7444
7457
|
"div",
|
|
7445
7458
|
{
|
|
7446
7459
|
className: "Layer__panel__sidebar",
|
|
@@ -7448,7 +7461,7 @@ var Panel = ({
|
|
|
7448
7461
|
maxHeight: sidebarHeight > 0 && sidebarIsOpen ? sidebarHeight : 0
|
|
7449
7462
|
}
|
|
7450
7463
|
},
|
|
7451
|
-
/* @__PURE__ */
|
|
7464
|
+
/* @__PURE__ */ React88.createElement("div", { className: "Layer__panel__sidebar-content" }, sidebar)
|
|
7452
7465
|
)
|
|
7453
7466
|
);
|
|
7454
7467
|
};
|
|
@@ -7457,22 +7470,22 @@ var Panel = ({
|
|
|
7457
7470
|
var COMPONENT_NAME3 = "profit-and-loss";
|
|
7458
7471
|
var ProfitAndLossView = (props) => {
|
|
7459
7472
|
const containerRef = useRef14(null);
|
|
7460
|
-
return /* @__PURE__ */
|
|
7473
|
+
return /* @__PURE__ */ React89.createElement(Container, { name: COMPONENT_NAME3, ref: containerRef }, /* @__PURE__ */ React89.createElement(ProfitAndLoss, null, /* @__PURE__ */ React89.createElement(ProfitAndLossPanel, { containerRef, ...props })));
|
|
7461
7474
|
};
|
|
7462
7475
|
var ProfitAndLossPanel = ({
|
|
7463
7476
|
containerRef,
|
|
7464
7477
|
...props
|
|
7465
7478
|
}) => {
|
|
7466
7479
|
const { sidebarScope } = useContext9(ProfitAndLoss.Context);
|
|
7467
|
-
return /* @__PURE__ */
|
|
7480
|
+
return /* @__PURE__ */ React89.createElement(
|
|
7468
7481
|
Panel,
|
|
7469
7482
|
{
|
|
7470
|
-
sidebar: /* @__PURE__ */
|
|
7483
|
+
sidebar: /* @__PURE__ */ React89.createElement(ProfitAndLossDetailedCharts, null),
|
|
7471
7484
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
7472
7485
|
parentRef: containerRef
|
|
7473
7486
|
},
|
|
7474
|
-
/* @__PURE__ */
|
|
7475
|
-
/* @__PURE__ */
|
|
7487
|
+
/* @__PURE__ */ React89.createElement(Header, { className: `Layer__${COMPONENT_NAME3}__header` }, /* @__PURE__ */ React89.createElement(Heading, { className: "Layer__profit-and-loss__title" }, "Profit & Loss")),
|
|
7488
|
+
/* @__PURE__ */ React89.createElement(Components, { ...props })
|
|
7476
7489
|
);
|
|
7477
7490
|
};
|
|
7478
7491
|
var Components = ({
|
|
@@ -7483,7 +7496,7 @@ var Components = ({
|
|
|
7483
7496
|
ProfitAndLoss.Context
|
|
7484
7497
|
);
|
|
7485
7498
|
if (!isLoading && error) {
|
|
7486
|
-
return /* @__PURE__ */
|
|
7499
|
+
return /* @__PURE__ */ React89.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React89.createElement(
|
|
7487
7500
|
DataState,
|
|
7488
7501
|
{
|
|
7489
7502
|
status: "failed" /* failed */,
|
|
@@ -7494,24 +7507,24 @@ var Components = ({
|
|
|
7494
7507
|
}
|
|
7495
7508
|
));
|
|
7496
7509
|
}
|
|
7497
|
-
return /* @__PURE__ */
|
|
7510
|
+
return /* @__PURE__ */ React89.createElement(React89.Fragment, null, !hideChart && /* @__PURE__ */ React89.createElement("div", { className: `Layer__${COMPONENT_NAME3}__chart_with_summaries` }, /* @__PURE__ */ React89.createElement(
|
|
7498
7511
|
"div",
|
|
7499
7512
|
{
|
|
7500
7513
|
className: `Layer__${COMPONENT_NAME3}__chart_with_summaries__summary-col`
|
|
7501
7514
|
},
|
|
7502
|
-
/* @__PURE__ */
|
|
7503
|
-
/* @__PURE__ */
|
|
7504
|
-
), /* @__PURE__ */
|
|
7515
|
+
/* @__PURE__ */ React89.createElement(ProfitAndLoss.DatePicker, null),
|
|
7516
|
+
/* @__PURE__ */ React89.createElement(ProfitAndLoss.Summaries, { vertical: true })
|
|
7517
|
+
), /* @__PURE__ */ React89.createElement(
|
|
7505
7518
|
"div",
|
|
7506
7519
|
{
|
|
7507
7520
|
className: `Layer__${COMPONENT_NAME3}__chart_with_summaries__chart-col`
|
|
7508
7521
|
},
|
|
7509
|
-
/* @__PURE__ */
|
|
7510
|
-
)), !hideTable && /* @__PURE__ */
|
|
7522
|
+
/* @__PURE__ */ React89.createElement(ProfitAndLoss.Chart, null)
|
|
7523
|
+
)), !hideTable && /* @__PURE__ */ React89.createElement(ProfitAndLoss.Table, null));
|
|
7511
7524
|
};
|
|
7512
7525
|
|
|
7513
7526
|
// src/components/ChartOfAccounts/ChartOfAccounts.tsx
|
|
7514
|
-
import
|
|
7527
|
+
import React104, { useContext as useContext17, useState as useState28 } from "react";
|
|
7515
7528
|
|
|
7516
7529
|
// src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
|
|
7517
7530
|
import { createContext as createContext4 } from "react";
|
|
@@ -7775,7 +7788,7 @@ var LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE = {
|
|
|
7775
7788
|
|
|
7776
7789
|
// src/hooks/useChartOfAccounts/useChartOfAccounts.tsx
|
|
7777
7790
|
import { endOfMonth as endOfMonth7, formatISO as formatISO2, startOfMonth as startOfMonth8 } from "date-fns";
|
|
7778
|
-
import
|
|
7791
|
+
import useSWR6 from "swr";
|
|
7779
7792
|
var validate = (formData) => {
|
|
7780
7793
|
const errors = [];
|
|
7781
7794
|
const nameError = validateName(formData);
|
|
@@ -7868,7 +7881,7 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
7868
7881
|
const [endDate, setEndDate] = useState22(
|
|
7869
7882
|
initialEndDate ?? endOfMonth7(Date.now())
|
|
7870
7883
|
);
|
|
7871
|
-
const { data, isLoading, isValidating, error, mutate } =
|
|
7884
|
+
const { data, isLoading, isValidating, error, mutate } = useSWR6(
|
|
7872
7885
|
businessId && auth?.access_token && `chart-of-accounts-${businessId}-${startDate?.valueOf()}-${endDate?.valueOf()}`,
|
|
7873
7886
|
Layer.getLedgerAccountBalances(apiUrl, auth?.access_token, {
|
|
7874
7887
|
params: {
|
|
@@ -8065,12 +8078,12 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
|
|
|
8065
8078
|
|
|
8066
8079
|
// src/hooks/useLedgerAccounts/useLedgerAccounts.tsx
|
|
8067
8080
|
import { useState as useState23 } from "react";
|
|
8068
|
-
import
|
|
8081
|
+
import useSWR7 from "swr";
|
|
8069
8082
|
var useLedgerAccounts = () => {
|
|
8070
8083
|
const { auth, businessId, apiUrl } = useLayerContext();
|
|
8071
8084
|
const [accountId, setAccountId] = useState23();
|
|
8072
8085
|
const [selectedEntryId, setSelectedEntryId] = useState23();
|
|
8073
|
-
const { data, isLoading, isValidating, error, mutate } =
|
|
8086
|
+
const { data, isLoading, isValidating, error, mutate } = useSWR7(
|
|
8074
8087
|
businessId && accountId && auth?.access_token && `ledger-accounts-lines-${businessId}-${accountId}`,
|
|
8075
8088
|
Layer.getLedgerAccountsLines(apiUrl, auth?.access_token, {
|
|
8076
8089
|
params: { businessId, accountId }
|
|
@@ -8082,7 +8095,7 @@ var useLedgerAccounts = () => {
|
|
|
8082
8095
|
isLoading: isLoadingEntry,
|
|
8083
8096
|
isValidating: isValdiatingEntry,
|
|
8084
8097
|
error: errorEntry
|
|
8085
|
-
} =
|
|
8098
|
+
} = useSWR7(
|
|
8086
8099
|
businessId && selectedEntryId && auth?.access_token && `ledger-accounts-entry-${businessId}-${selectedEntryId}}`,
|
|
8087
8100
|
Layer.getLedgerAccountsEntry(apiUrl, auth?.access_token, {
|
|
8088
8101
|
params: { businessId, entryId: selectedEntryId }
|
|
@@ -8112,21 +8125,21 @@ var useLedgerAccounts = () => {
|
|
|
8112
8125
|
};
|
|
8113
8126
|
|
|
8114
8127
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
8115
|
-
import
|
|
8128
|
+
import React96, { useContext as useContext13, useState as useState25 } from "react";
|
|
8116
8129
|
|
|
8117
8130
|
// src/components/ChartOfAccountsDatePicker/ChartOfAccountsDatePicker.tsx
|
|
8118
|
-
import
|
|
8131
|
+
import React90, { useContext as useContext10 } from "react";
|
|
8119
8132
|
var ChartOfAccountsDatePicker = () => {
|
|
8120
8133
|
const { changeDateRange, dateRange } = useContext10(ChartOfAccountsContext);
|
|
8121
|
-
return /* @__PURE__ */
|
|
8134
|
+
return /* @__PURE__ */ React90.createElement(DateMonthPicker, { dateRange, changeDateRange });
|
|
8122
8135
|
};
|
|
8123
8136
|
|
|
8124
8137
|
// src/components/ChartOfAccountsRow/ChartOfAccountsRow.tsx
|
|
8125
|
-
import
|
|
8138
|
+
import React92, { useContext as useContext11, useEffect as useEffect16, useState as useState24 } from "react";
|
|
8126
8139
|
|
|
8127
8140
|
// src/icons/Edit2.tsx
|
|
8128
|
-
import * as
|
|
8129
|
-
var Edit2 = ({ size = 18, ...props }) => /* @__PURE__ */
|
|
8141
|
+
import * as React91 from "react";
|
|
8142
|
+
var Edit2 = ({ size = 18, ...props }) => /* @__PURE__ */ React91.createElement(
|
|
8130
8143
|
"svg",
|
|
8131
8144
|
{
|
|
8132
8145
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8136,7 +8149,7 @@ var Edit2 = ({ size = 18, ...props }) => /* @__PURE__ */ React90.createElement(
|
|
|
8136
8149
|
width: size,
|
|
8137
8150
|
height: size
|
|
8138
8151
|
},
|
|
8139
|
-
/* @__PURE__ */
|
|
8152
|
+
/* @__PURE__ */ React91.createElement(
|
|
8140
8153
|
"path",
|
|
8141
8154
|
{
|
|
8142
8155
|
d: "M12.75 2.25C12.947 2.05301 13.1808 1.89676 13.4382 1.79015C13.6956 1.68355 13.9714 1.62868 14.25 1.62868C14.5286 1.62868 14.8044 1.68355 15.0618 1.79015C15.3192 1.89676 15.553 2.05301 15.75 2.25C15.947 2.44698 16.1032 2.68083 16.2098 2.9382C16.3165 3.19557 16.3713 3.47142 16.3713 3.75C16.3713 4.02857 16.3165 4.30442 16.2098 4.56179C16.1032 4.81916 15.947 5.05302 15.75 5.25L5.625 15.375L1.5 16.5L2.625 12.375L12.75 2.25Z",
|
|
@@ -8221,7 +8234,7 @@ var ChartOfAccountsRow = ({
|
|
|
8221
8234
|
baseClass,
|
|
8222
8235
|
"Layer__chart-of-accounts__row---mobile"
|
|
8223
8236
|
);
|
|
8224
|
-
return /* @__PURE__ */
|
|
8237
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, view === "desktop" && /* @__PURE__ */ React92.createElement(
|
|
8225
8238
|
"tr",
|
|
8226
8239
|
{
|
|
8227
8240
|
className: desktopRowClass,
|
|
@@ -8231,7 +8244,7 @@ var ChartOfAccountsRow = ({
|
|
|
8231
8244
|
setAccountId(account.id);
|
|
8232
8245
|
}
|
|
8233
8246
|
},
|
|
8234
|
-
/* @__PURE__ */
|
|
8247
|
+
/* @__PURE__ */ React92.createElement("td", { className: "Layer__table-cell Layer__coa__name" }, /* @__PURE__ */ React92.createElement("span", { className: "Layer__table-cell-content", style }, /* @__PURE__ */ React92.createElement(
|
|
8235
8248
|
"span",
|
|
8236
8249
|
{
|
|
8237
8250
|
className: "Layer__table-cell-content-indentation",
|
|
@@ -8239,7 +8252,7 @@ var ChartOfAccountsRow = ({
|
|
|
8239
8252
|
paddingLeft: INDENTATION * depth + 16
|
|
8240
8253
|
}
|
|
8241
8254
|
},
|
|
8242
|
-
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */
|
|
8255
|
+
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */ React92.createElement(
|
|
8243
8256
|
ChevronDownFill_default,
|
|
8244
8257
|
{
|
|
8245
8258
|
size: 16,
|
|
@@ -8250,22 +8263,22 @@ var ChartOfAccountsRow = ({
|
|
|
8250
8263
|
}
|
|
8251
8264
|
}
|
|
8252
8265
|
),
|
|
8253
|
-
/* @__PURE__ */
|
|
8266
|
+
/* @__PURE__ */ React92.createElement("span", { className: "Layer__coa__name__text" }, account.name)
|
|
8254
8267
|
))),
|
|
8255
|
-
/* @__PURE__ */
|
|
8268
|
+
/* @__PURE__ */ React92.createElement("td", { className: "Layer__table-cell Layer__coa__type" }, /* @__PURE__ */ React92.createElement(
|
|
8256
8269
|
"span",
|
|
8257
8270
|
{
|
|
8258
8271
|
className: "Layer__table-cell-content Layer__mobile--hidden",
|
|
8259
8272
|
style
|
|
8260
8273
|
},
|
|
8261
8274
|
account.account_type?.display_name
|
|
8262
|
-
), /* @__PURE__ */
|
|
8275
|
+
), /* @__PURE__ */ React92.createElement(
|
|
8263
8276
|
"span",
|
|
8264
8277
|
{
|
|
8265
8278
|
className: "Layer__table-cell-content Layer__desktop--hidden",
|
|
8266
8279
|
style
|
|
8267
8280
|
},
|
|
8268
|
-
/* @__PURE__ */
|
|
8281
|
+
/* @__PURE__ */ React92.createElement(
|
|
8269
8282
|
Text,
|
|
8270
8283
|
{
|
|
8271
8284
|
weight: "bold" /* bold */,
|
|
@@ -8273,10 +8286,10 @@ var ChartOfAccountsRow = ({
|
|
|
8273
8286
|
},
|
|
8274
8287
|
account.normality
|
|
8275
8288
|
),
|
|
8276
|
-
/* @__PURE__ */
|
|
8289
|
+
/* @__PURE__ */ React92.createElement(Text, { className: "Layer__coa__subtype--mobile" }, account.account_subtype?.display_name)
|
|
8277
8290
|
)),
|
|
8278
|
-
/* @__PURE__ */
|
|
8279
|
-
/* @__PURE__ */
|
|
8291
|
+
/* @__PURE__ */ React92.createElement("td", { className: "Layer__table-cell Layer__coa__subtype Layer__mobile--hidden" }, /* @__PURE__ */ React92.createElement("span", { className: "Layer__table-cell-content", style }, account.account_subtype?.display_name)),
|
|
8292
|
+
/* @__PURE__ */ React92.createElement("td", { className: "Layer__table-cell Layer__coa__balance" }, /* @__PURE__ */ React92.createElement(
|
|
8280
8293
|
"span",
|
|
8281
8294
|
{
|
|
8282
8295
|
className: "Layer__table-cell-content Layer__table-cell--amount",
|
|
@@ -8285,11 +8298,11 @@ var ChartOfAccountsRow = ({
|
|
|
8285
8298
|
"$",
|
|
8286
8299
|
centsToDollars(Math.abs(account.balance || 0))
|
|
8287
8300
|
)),
|
|
8288
|
-
/* @__PURE__ */
|
|
8301
|
+
/* @__PURE__ */ React92.createElement("td", { className: "Layer__table-cell Layer__coa__actions" }, /* @__PURE__ */ React92.createElement("span", { className: "Layer__table-cell-content", style }, /* @__PURE__ */ React92.createElement(
|
|
8289
8302
|
Button,
|
|
8290
8303
|
{
|
|
8291
8304
|
variant: "secondary" /* secondary */,
|
|
8292
|
-
rightIcon: /* @__PURE__ */
|
|
8305
|
+
rightIcon: /* @__PURE__ */ React92.createElement(Edit2_default, { size: 12 }),
|
|
8293
8306
|
iconOnly: true,
|
|
8294
8307
|
onClick: (e) => {
|
|
8295
8308
|
e.preventDefault();
|
|
@@ -8299,7 +8312,7 @@ var ChartOfAccountsRow = ({
|
|
|
8299
8312
|
},
|
|
8300
8313
|
"Edit"
|
|
8301
8314
|
)))
|
|
8302
|
-
), view === "mobile" || view === "tablet" ? /* @__PURE__ */
|
|
8315
|
+
), view === "mobile" || view === "tablet" ? /* @__PURE__ */ React92.createElement(
|
|
8303
8316
|
"tr",
|
|
8304
8317
|
{
|
|
8305
8318
|
className: mobileRowClass,
|
|
@@ -8309,7 +8322,7 @@ var ChartOfAccountsRow = ({
|
|
|
8309
8322
|
setAccountId(account.id);
|
|
8310
8323
|
}
|
|
8311
8324
|
},
|
|
8312
|
-
/* @__PURE__ */
|
|
8325
|
+
/* @__PURE__ */ React92.createElement("td", { className: "Layer__table-cell", colSpan: 5 }, /* @__PURE__ */ React92.createElement(
|
|
8313
8326
|
"span",
|
|
8314
8327
|
{
|
|
8315
8328
|
className: "Layer__table-cell-content Layer__table-cell-content-indentation",
|
|
@@ -8318,7 +8331,7 @@ var ChartOfAccountsRow = ({
|
|
|
8318
8331
|
...style
|
|
8319
8332
|
}
|
|
8320
8333
|
},
|
|
8321
|
-
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */
|
|
8334
|
+
account.sub_accounts && account.sub_accounts.length > 0 && /* @__PURE__ */ React92.createElement(
|
|
8322
8335
|
ChevronDownFill_default,
|
|
8323
8336
|
{
|
|
8324
8337
|
size: 16,
|
|
@@ -8329,14 +8342,14 @@ var ChartOfAccountsRow = ({
|
|
|
8329
8342
|
}
|
|
8330
8343
|
}
|
|
8331
8344
|
),
|
|
8332
|
-
/* @__PURE__ */
|
|
8345
|
+
/* @__PURE__ */ React92.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content" }, /* @__PURE__ */ React92.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content__top-row" }, /* @__PURE__ */ React92.createElement(
|
|
8333
8346
|
Text,
|
|
8334
8347
|
{
|
|
8335
8348
|
as: "span",
|
|
8336
8349
|
className: "Layer__chart-of-accounts__mobile-row-content__name"
|
|
8337
8350
|
},
|
|
8338
8351
|
account.name
|
|
8339
|
-
), /* @__PURE__ */
|
|
8352
|
+
), /* @__PURE__ */ React92.createElement(
|
|
8340
8353
|
TextButton,
|
|
8341
8354
|
{
|
|
8342
8355
|
onClick: (e) => {
|
|
@@ -8346,7 +8359,7 @@ var ChartOfAccountsRow = ({
|
|
|
8346
8359
|
}
|
|
8347
8360
|
},
|
|
8348
8361
|
"Edit"
|
|
8349
|
-
)), /* @__PURE__ */
|
|
8362
|
+
)), /* @__PURE__ */ React92.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content__bottom-row" }, /* @__PURE__ */ React92.createElement("div", { className: "Layer__chart-of-accounts__mobile-row-content__types" }, /* @__PURE__ */ React92.createElement(Text, { as: "span" }, account.normality), /* @__PURE__ */ React92.createElement("span", { className: "Layer__chart-of-accounts__mobile-row-content__separator" }), /* @__PURE__ */ React92.createElement(Text, { as: "span" }, "Sub-Type")), /* @__PURE__ */ React92.createElement(
|
|
8350
8363
|
Text,
|
|
8351
8364
|
{
|
|
8352
8365
|
as: "span",
|
|
@@ -8356,7 +8369,7 @@ var ChartOfAccountsRow = ({
|
|
|
8356
8369
|
centsToDollars(Math.abs(account.balance || 0))
|
|
8357
8370
|
)))
|
|
8358
8371
|
))
|
|
8359
|
-
) : null, (account.sub_accounts || []).map((subAccount, idx) => /* @__PURE__ */
|
|
8372
|
+
) : null, (account.sub_accounts || []).map((subAccount, idx) => /* @__PURE__ */ React92.createElement(
|
|
8360
8373
|
ChartOfAccountsRow,
|
|
8361
8374
|
{
|
|
8362
8375
|
key: subAccount.id,
|
|
@@ -8373,10 +8386,10 @@ var ChartOfAccountsRow = ({
|
|
|
8373
8386
|
};
|
|
8374
8387
|
|
|
8375
8388
|
// src/components/ChartOfAccountsSidebar/ChartOfAccountsSidebar.tsx
|
|
8376
|
-
import
|
|
8389
|
+
import React95 from "react";
|
|
8377
8390
|
|
|
8378
8391
|
// src/components/ChartOfAccountsForm/ChartOfAccountsForm.tsx
|
|
8379
|
-
import
|
|
8392
|
+
import React94, { useContext as useContext12, useMemo as useMemo9 } from "react";
|
|
8380
8393
|
|
|
8381
8394
|
// src/components/ChartOfAccountsForm/useParentOptions.ts
|
|
8382
8395
|
import { useMemo as useMemo8 } from "react";
|
|
@@ -8413,7 +8426,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8413
8426
|
if (!form) {
|
|
8414
8427
|
return;
|
|
8415
8428
|
}
|
|
8416
|
-
return /* @__PURE__ */
|
|
8429
|
+
return /* @__PURE__ */ React94.createElement(
|
|
8417
8430
|
"form",
|
|
8418
8431
|
{
|
|
8419
8432
|
className: "Layer__form",
|
|
@@ -8422,7 +8435,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8422
8435
|
submitForm();
|
|
8423
8436
|
}
|
|
8424
8437
|
},
|
|
8425
|
-
/* @__PURE__ */
|
|
8438
|
+
/* @__PURE__ */ React94.createElement("div", { className: "Layer__chart-of-accounts__sidebar__header" }, /* @__PURE__ */ React94.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, form?.action === "edit" ? "Edit" : "Add New", " Account"), /* @__PURE__ */ React94.createElement("div", { className: "actions" }, /* @__PURE__ */ React94.createElement(
|
|
8426
8439
|
Button,
|
|
8427
8440
|
{
|
|
8428
8441
|
type: "button",
|
|
@@ -8431,7 +8444,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8431
8444
|
disabled: sendingForm
|
|
8432
8445
|
},
|
|
8433
8446
|
"Cancel"
|
|
8434
|
-
), apiError && /* @__PURE__ */
|
|
8447
|
+
), apiError && /* @__PURE__ */ React94.createElement(
|
|
8435
8448
|
RetryButton,
|
|
8436
8449
|
{
|
|
8437
8450
|
type: "submit",
|
|
@@ -8440,7 +8453,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8440
8453
|
disabled: sendingForm
|
|
8441
8454
|
},
|
|
8442
8455
|
"Retry"
|
|
8443
|
-
), !apiError && /* @__PURE__ */
|
|
8456
|
+
), !apiError && /* @__PURE__ */ React94.createElement(
|
|
8444
8457
|
SubmitButton,
|
|
8445
8458
|
{
|
|
8446
8459
|
type: "submit",
|
|
@@ -8450,7 +8463,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8450
8463
|
},
|
|
8451
8464
|
"Save"
|
|
8452
8465
|
))),
|
|
8453
|
-
apiError && /* @__PURE__ */
|
|
8466
|
+
apiError && /* @__PURE__ */ React94.createElement(
|
|
8454
8467
|
Text,
|
|
8455
8468
|
{
|
|
8456
8469
|
size: "sm" /* sm */,
|
|
@@ -8458,8 +8471,8 @@ var ChartOfAccountsForm = () => {
|
|
|
8458
8471
|
},
|
|
8459
8472
|
apiError
|
|
8460
8473
|
),
|
|
8461
|
-
entry && /* @__PURE__ */
|
|
8462
|
-
/* @__PURE__ */
|
|
8474
|
+
entry && /* @__PURE__ */ React94.createElement("div", { className: "Layer__chart-of-accounts__form-edit-entry" }, /* @__PURE__ */ React94.createElement(Text, { weight: "bold" /* bold */ }, entry.name), /* @__PURE__ */ React94.createElement(Text, { weight: "bold" /* bold */ }, "$", centsToDollars(entry.balance || 0))),
|
|
8475
|
+
/* @__PURE__ */ React94.createElement("div", { className: "Layer__chart-of-accounts__form" }, /* @__PURE__ */ React94.createElement(InputGroup, { name: "parent", label: "Parent", inline: true }, /* @__PURE__ */ React94.createElement(
|
|
8463
8476
|
Select2,
|
|
8464
8477
|
{
|
|
8465
8478
|
options: parentOptions,
|
|
@@ -8467,7 +8480,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8467
8480
|
onChange: (sel) => changeFormData("parent", sel),
|
|
8468
8481
|
disabled: sendingForm
|
|
8469
8482
|
}
|
|
8470
|
-
)), /* @__PURE__ */
|
|
8483
|
+
)), /* @__PURE__ */ React94.createElement(InputGroup, { name: "name", label: "Name", inline: true }, /* @__PURE__ */ React94.createElement(
|
|
8471
8484
|
Input,
|
|
8472
8485
|
{
|
|
8473
8486
|
name: "name",
|
|
@@ -8478,7 +8491,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8478
8491
|
disabled: sendingForm,
|
|
8479
8492
|
onChange: (e) => changeFormData("name", e.target.value)
|
|
8480
8493
|
}
|
|
8481
|
-
)), /* @__PURE__ */
|
|
8494
|
+
)), /* @__PURE__ */ React94.createElement(InputGroup, { name: "type", label: "Type", inline: true }, /* @__PURE__ */ React94.createElement(
|
|
8482
8495
|
Select2,
|
|
8483
8496
|
{
|
|
8484
8497
|
options: LEDGER_ACCOUNT_TYPES,
|
|
@@ -8488,7 +8501,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8488
8501
|
errorMessage: form?.errors?.find((x) => x.field === "type")?.message,
|
|
8489
8502
|
disabled: sendingForm || form.action === "edit" || form.data.parent !== void 0
|
|
8490
8503
|
}
|
|
8491
|
-
)), /* @__PURE__ */
|
|
8504
|
+
)), /* @__PURE__ */ React94.createElement(InputGroup, { name: "subType", label: "Sub-Type", inline: true }, /* @__PURE__ */ React94.createElement(
|
|
8492
8505
|
Select2,
|
|
8493
8506
|
{
|
|
8494
8507
|
options: form?.data.type?.value !== void 0 ? LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE[form?.data.type?.value] : LEDGER_ACCOUNT_SUBTYPES,
|
|
@@ -8496,7 +8509,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8496
8509
|
onChange: (sel) => changeFormData("subType", sel),
|
|
8497
8510
|
disabled: sendingForm
|
|
8498
8511
|
}
|
|
8499
|
-
)), /* @__PURE__ */
|
|
8512
|
+
)), /* @__PURE__ */ React94.createElement(InputGroup, { name: "normality", label: "Normality", inline: true }, /* @__PURE__ */ React94.createElement(
|
|
8500
8513
|
Select2,
|
|
8501
8514
|
{
|
|
8502
8515
|
options: NORMALITY_OPTIONS,
|
|
@@ -8516,7 +8529,7 @@ var ChartOfAccountsForm = () => {
|
|
|
8516
8529
|
var ChartOfAccountsSidebar = ({
|
|
8517
8530
|
parentRef: _parentRef
|
|
8518
8531
|
}) => {
|
|
8519
|
-
return /* @__PURE__ */
|
|
8532
|
+
return /* @__PURE__ */ React95.createElement(ChartOfAccountsForm, null);
|
|
8520
8533
|
};
|
|
8521
8534
|
|
|
8522
8535
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
@@ -8532,20 +8545,20 @@ var ChartOfAccountsTable = ({
|
|
|
8532
8545
|
const [expandAll, setExpandAll] = useState25();
|
|
8533
8546
|
let cumulativeIndex = 0;
|
|
8534
8547
|
const accountsLength = data?.accounts.length ?? 0;
|
|
8535
|
-
return /* @__PURE__ */
|
|
8548
|
+
return /* @__PURE__ */ React96.createElement(
|
|
8536
8549
|
Panel,
|
|
8537
8550
|
{
|
|
8538
|
-
sidebar: /* @__PURE__ */
|
|
8551
|
+
sidebar: /* @__PURE__ */ React96.createElement(ChartOfAccountsSidebar, { parentRef: containerRef }),
|
|
8539
8552
|
sidebarIsOpen: Boolean(form),
|
|
8540
8553
|
parentRef: containerRef
|
|
8541
8554
|
},
|
|
8542
|
-
/* @__PURE__ */
|
|
8555
|
+
/* @__PURE__ */ React96.createElement(
|
|
8543
8556
|
Header,
|
|
8544
8557
|
{
|
|
8545
8558
|
className: `Layer__${COMPONENT_NAME4}__header`,
|
|
8546
8559
|
layout: withDateControl ? "next-line-actions" /* NEXT_LINE_ACTIONS */ : void 0
|
|
8547
8560
|
},
|
|
8548
|
-
/* @__PURE__ */
|
|
8561
|
+
/* @__PURE__ */ React96.createElement(
|
|
8549
8562
|
Heading,
|
|
8550
8563
|
{
|
|
8551
8564
|
className: `Layer__${COMPONENT_NAME4}__title`,
|
|
@@ -8553,12 +8566,12 @@ var ChartOfAccountsTable = ({
|
|
|
8553
8566
|
},
|
|
8554
8567
|
"Chart of Accounts"
|
|
8555
8568
|
),
|
|
8556
|
-
/* @__PURE__ */
|
|
8569
|
+
/* @__PURE__ */ React96.createElement(
|
|
8557
8570
|
"div",
|
|
8558
8571
|
{
|
|
8559
8572
|
className: `Layer__${COMPONENT_NAME4}__actions Layer__header__actions`
|
|
8560
8573
|
},
|
|
8561
|
-
withDateControl || withExpandAllButton ? /* @__PURE__ */
|
|
8574
|
+
withDateControl || withExpandAllButton ? /* @__PURE__ */ React96.createElement("div", { className: "Layer__header__actions-col" }, withDateControl && /* @__PURE__ */ React96.createElement(ChartOfAccountsDatePicker, null), withExpandAllButton && /* @__PURE__ */ React96.createElement(
|
|
8562
8575
|
Button,
|
|
8563
8576
|
{
|
|
8564
8577
|
variant: "secondary" /* secondary */,
|
|
@@ -8566,23 +8579,23 @@ var ChartOfAccountsTable = ({
|
|
|
8566
8579
|
!expandAll || expandAll === "collapsed" ? "expanded" : "collapsed"
|
|
8567
8580
|
)
|
|
8568
8581
|
},
|
|
8569
|
-
!expandAll || expandAll === "collapsed" ? "Expand all rows" : "
|
|
8582
|
+
!expandAll || expandAll === "collapsed" ? "Expand all rows" : "Collapse all rows"
|
|
8570
8583
|
)) : null,
|
|
8571
|
-
/* @__PURE__ */
|
|
8584
|
+
/* @__PURE__ */ React96.createElement("div", { className: "Layer__header__actions-col" }, /* @__PURE__ */ React96.createElement(
|
|
8572
8585
|
Button,
|
|
8573
8586
|
{
|
|
8574
8587
|
variant: "secondary" /* secondary */,
|
|
8575
8588
|
disabled: isLoading,
|
|
8576
|
-
rightIcon: /* @__PURE__ */
|
|
8589
|
+
rightIcon: /* @__PURE__ */ React96.createElement(DownloadCloud_default, { size: 12 })
|
|
8577
8590
|
},
|
|
8578
8591
|
"Download"
|
|
8579
|
-
), /* @__PURE__ */
|
|
8592
|
+
), /* @__PURE__ */ React96.createElement(Button, { onClick: () => addAccount(), disabled: isLoading }, "Add Account"))
|
|
8580
8593
|
)
|
|
8581
8594
|
),
|
|
8582
|
-
/* @__PURE__ */
|
|
8595
|
+
/* @__PURE__ */ React96.createElement("table", { className: "Layer__chart-of-accounts__table" }, /* @__PURE__ */ React96.createElement("thead", null, /* @__PURE__ */ React96.createElement("tr", { className: "Layer__table-row--header" }, /* @__PURE__ */ React96.createElement("th", { className: "Layer__table-header Layer__coa__name" }, "Name"), /* @__PURE__ */ React96.createElement("th", { className: "Layer__table-header Layer__coa__type" }, "Type"), /* @__PURE__ */ React96.createElement("th", { className: "Layer__table-header Layer__coa__subtype Layer__mobile--hidden" }, "Sub-Type"), /* @__PURE__ */ React96.createElement("th", { className: "Layer__table-header Layer__coa__balance" }, "Balance"), /* @__PURE__ */ React96.createElement("th", { className: "Layer__table-header Layer__coa__actions" }))), /* @__PURE__ */ React96.createElement("tbody", null, !error && data?.accounts.map((account, idx) => {
|
|
8583
8596
|
const currentCumulativeIndex = cumulativeIndex;
|
|
8584
8597
|
cumulativeIndex = (account.sub_accounts?.length || 0) + cumulativeIndex + 1;
|
|
8585
|
-
return /* @__PURE__ */
|
|
8598
|
+
return /* @__PURE__ */ React96.createElement(
|
|
8586
8599
|
ChartOfAccountsRow,
|
|
8587
8600
|
{
|
|
8588
8601
|
key: account.id,
|
|
@@ -8598,7 +8611,7 @@ var ChartOfAccountsTable = ({
|
|
|
8598
8611
|
}
|
|
8599
8612
|
);
|
|
8600
8613
|
}))),
|
|
8601
|
-
error ? /* @__PURE__ */
|
|
8614
|
+
error ? /* @__PURE__ */ React96.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React96.createElement(
|
|
8602
8615
|
DataState,
|
|
8603
8616
|
{
|
|
8604
8617
|
status: "failed" /* failed */,
|
|
@@ -8608,8 +8621,8 @@ var ChartOfAccountsTable = ({
|
|
|
8608
8621
|
isLoading: isValidating || isLoading
|
|
8609
8622
|
}
|
|
8610
8623
|
)) : null,
|
|
8611
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
8612
|
-
!isLoading && !error && data?.accounts.length === 0 ? /* @__PURE__ */
|
|
8624
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React96.createElement("div", { className: `Layer__${COMPONENT_NAME4}__loader-container` }, /* @__PURE__ */ React96.createElement(Loader2, null)) : null,
|
|
8625
|
+
!isLoading && !error && data?.accounts.length === 0 ? /* @__PURE__ */ React96.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React96.createElement(
|
|
8613
8626
|
DataState,
|
|
8614
8627
|
{
|
|
8615
8628
|
status: "info" /* info */,
|
|
@@ -8623,7 +8636,7 @@ var ChartOfAccountsTable = ({
|
|
|
8623
8636
|
};
|
|
8624
8637
|
|
|
8625
8638
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
8626
|
-
import
|
|
8639
|
+
import React103, {
|
|
8627
8640
|
useContext as useContext16,
|
|
8628
8641
|
useEffect as useEffect18,
|
|
8629
8642
|
useMemo as useMemo11,
|
|
@@ -8631,17 +8644,17 @@ import React102, {
|
|
|
8631
8644
|
} from "react";
|
|
8632
8645
|
|
|
8633
8646
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
8634
|
-
import
|
|
8647
|
+
import React101, { useContext as useContext14, useMemo as useMemo10 } from "react";
|
|
8635
8648
|
|
|
8636
8649
|
// src/components/Card/Card.tsx
|
|
8637
|
-
import
|
|
8650
|
+
import React97 from "react";
|
|
8638
8651
|
import classNames37 from "classnames";
|
|
8639
8652
|
var Card = ({ children, className }) => {
|
|
8640
|
-
return /* @__PURE__ */
|
|
8653
|
+
return /* @__PURE__ */ React97.createElement("div", { className: classNames37("Layer__card", className) }, children);
|
|
8641
8654
|
};
|
|
8642
8655
|
|
|
8643
8656
|
// src/components/DateTime/DateTime.tsx
|
|
8644
|
-
import
|
|
8657
|
+
import React98 from "react";
|
|
8645
8658
|
import { parseISO as parseISO9, format as formatTime7 } from "date-fns";
|
|
8646
8659
|
var DateTime = ({
|
|
8647
8660
|
value,
|
|
@@ -8652,11 +8665,11 @@ var DateTime = ({
|
|
|
8652
8665
|
onlyTime
|
|
8653
8666
|
}) => {
|
|
8654
8667
|
if (format7) {
|
|
8655
|
-
return /* @__PURE__ */
|
|
8668
|
+
return /* @__PURE__ */ React98.createElement(Text, { className: "Layer__datetime" }, formatTime7(parseISO9(value), format7));
|
|
8656
8669
|
}
|
|
8657
8670
|
const date = formatTime7(parseISO9(value), dateFormat ?? DATE_FORMAT);
|
|
8658
8671
|
const time = formatTime7(parseISO9(value), timeFormat ?? TIME_FORMAT);
|
|
8659
|
-
return /* @__PURE__ */
|
|
8672
|
+
return /* @__PURE__ */ React98.createElement(Text, { className: "Layer__datetime" }, !onlyTime && /* @__PURE__ */ React98.createElement(
|
|
8660
8673
|
Text,
|
|
8661
8674
|
{
|
|
8662
8675
|
as: "span",
|
|
@@ -8665,7 +8678,7 @@ var DateTime = ({
|
|
|
8665
8678
|
className: "Layer__datetime__date"
|
|
8666
8679
|
},
|
|
8667
8680
|
date
|
|
8668
|
-
), !onlyDate && /* @__PURE__ */
|
|
8681
|
+
), !onlyDate && /* @__PURE__ */ React98.createElement(
|
|
8669
8682
|
Text,
|
|
8670
8683
|
{
|
|
8671
8684
|
as: "span",
|
|
@@ -8678,7 +8691,7 @@ var DateTime = ({
|
|
|
8678
8691
|
};
|
|
8679
8692
|
|
|
8680
8693
|
// src/components/DetailsList/DetailsList.tsx
|
|
8681
|
-
import
|
|
8694
|
+
import React99 from "react";
|
|
8682
8695
|
import classNames38 from "classnames";
|
|
8683
8696
|
var DetailsList = ({
|
|
8684
8697
|
title,
|
|
@@ -8686,14 +8699,14 @@ var DetailsList = ({
|
|
|
8686
8699
|
className,
|
|
8687
8700
|
actions
|
|
8688
8701
|
}) => {
|
|
8689
|
-
return /* @__PURE__ */
|
|
8702
|
+
return /* @__PURE__ */ React99.createElement("div", { className: classNames38("Layer__details-list", className) }, title && /* @__PURE__ */ React99.createElement(Header, null, /* @__PURE__ */ React99.createElement(Heading, { size: "secondary" /* secondary */ }, title), actions && /* @__PURE__ */ React99.createElement("div", { className: "Layer__details-list__actions" }, actions)), /* @__PURE__ */ React99.createElement("ul", { className: "Layer__details-list__list" }, children));
|
|
8690
8703
|
};
|
|
8691
8704
|
|
|
8692
8705
|
// src/components/DetailsList/DetailsListItem.tsx
|
|
8693
|
-
import
|
|
8706
|
+
import React100 from "react";
|
|
8694
8707
|
var renderValue = (value) => {
|
|
8695
8708
|
if (typeof value === "string") {
|
|
8696
|
-
return /* @__PURE__ */
|
|
8709
|
+
return /* @__PURE__ */ React100.createElement(Text, { weight: "bold" /* bold */, size: "sm" /* sm */ }, value);
|
|
8697
8710
|
}
|
|
8698
8711
|
return value;
|
|
8699
8712
|
};
|
|
@@ -8702,7 +8715,7 @@ var DetailsListItem = ({
|
|
|
8702
8715
|
children,
|
|
8703
8716
|
isLoading
|
|
8704
8717
|
}) => {
|
|
8705
|
-
return /* @__PURE__ */
|
|
8718
|
+
return /* @__PURE__ */ React100.createElement("li", { className: "Layer__details-list-item" }, /* @__PURE__ */ React100.createElement("label", { className: "Layer__details-list-item__label" }, label), /* @__PURE__ */ React100.createElement("span", { className: "Layer__details-list-item__value" }, isLoading ? /* @__PURE__ */ React100.createElement(SkeletonLoader, null) : renderValue(children)));
|
|
8706
8719
|
};
|
|
8707
8720
|
|
|
8708
8721
|
// src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
|
|
@@ -8710,31 +8723,31 @@ var SourceDetailView = ({ source }) => {
|
|
|
8710
8723
|
switch (source.type) {
|
|
8711
8724
|
case "Transaction_Ledger_Entry_Source": {
|
|
8712
8725
|
const transactionSource = source;
|
|
8713
|
-
return /* @__PURE__ */
|
|
8726
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Account name" }, transactionSource.account_name), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Date" }, /* @__PURE__ */ React101.createElement(DateTime, { value: transactionSource.date })), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Amount" }, `$${centsToDollars(transactionSource.amount)}`), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Direction" }, transactionSource.direction), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Counterparty" }, transactionSource.counterparty));
|
|
8714
8727
|
}
|
|
8715
8728
|
case "Invoice_Ledger_Entry_Source": {
|
|
8716
8729
|
const invoiceSource = source;
|
|
8717
|
-
return /* @__PURE__ */
|
|
8730
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Invoice number" }, invoiceSource.invoice_number), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Recipient name" }, invoiceSource.recipient_name), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Date" }, /* @__PURE__ */ React101.createElement(DateTime, { value: invoiceSource.date })), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Amount" }, `$${centsToDollars(invoiceSource.amount)}`));
|
|
8718
8731
|
}
|
|
8719
8732
|
case "Manual_Ledger_Entry_Source": {
|
|
8720
8733
|
const manualSource = source;
|
|
8721
|
-
return /* @__PURE__ */
|
|
8734
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Memo" }, manualSource.memo), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Created by" }, manualSource.created_by));
|
|
8722
8735
|
}
|
|
8723
8736
|
case "Invoice_Payment_Ledger_Entry_Source": {
|
|
8724
8737
|
const invoicePaymentSource = source;
|
|
8725
|
-
return /* @__PURE__ */
|
|
8738
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Invoice number" }, invoicePaymentSource.invoice_number), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Amount" }, `$${centsToDollars(invoicePaymentSource.amount)}`));
|
|
8726
8739
|
}
|
|
8727
8740
|
case "Refund_Ledger_Entry_Source": {
|
|
8728
8741
|
const refundSource = source;
|
|
8729
|
-
return /* @__PURE__ */
|
|
8742
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Amount" }, `$${centsToDollars(refundSource.refunded_to_customer_amount)}`), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Recipient name" }, refundSource.recipient_name));
|
|
8730
8743
|
}
|
|
8731
8744
|
case "Opening_Balance_Ledger_Entry_Source": {
|
|
8732
8745
|
const openingBalanceSource = source;
|
|
8733
|
-
return /* @__PURE__ */
|
|
8746
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Account name" }, openingBalanceSource.account_name));
|
|
8734
8747
|
}
|
|
8735
8748
|
case "Payout_Ledger_Entry_Source": {
|
|
8736
8749
|
const payoutSource = source;
|
|
8737
|
-
return /* @__PURE__ */
|
|
8750
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Amount" }, `$${centsToDollars(payoutSource.paid_out_amount)}`), /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Processor" }, payoutSource.processor));
|
|
8738
8751
|
}
|
|
8739
8752
|
default:
|
|
8740
8753
|
return null;
|
|
@@ -8754,36 +8767,36 @@ var LedgerAccountEntryDetails = () => {
|
|
|
8754
8767
|
});
|
|
8755
8768
|
return { totalDebit: totalDebit2, totalCredit: totalCredit2 };
|
|
8756
8769
|
}, [entryData]);
|
|
8757
|
-
return /* @__PURE__ */
|
|
8770
|
+
return /* @__PURE__ */ React101.createElement("div", { className: "Layer__ledger-account__entry-details" }, /* @__PURE__ */ React101.createElement("div", { className: "Layer__ledger-account__entry-details__back-btn" }, /* @__PURE__ */ React101.createElement(BackButton, { onClick: () => closeSelectedEntry() })), /* @__PURE__ */ React101.createElement(
|
|
8758
8771
|
DetailsList,
|
|
8759
8772
|
{
|
|
8760
8773
|
title: "Transaction source",
|
|
8761
|
-
actions: /* @__PURE__ */
|
|
8774
|
+
actions: /* @__PURE__ */ React101.createElement(
|
|
8762
8775
|
IconButton,
|
|
8763
8776
|
{
|
|
8764
|
-
icon: /* @__PURE__ */
|
|
8777
|
+
icon: /* @__PURE__ */ React101.createElement(X_default, null),
|
|
8765
8778
|
onClick: () => closeSelectedEntry(),
|
|
8766
8779
|
className: "Layer__hidden-sm Layer__hidden-xs"
|
|
8767
8780
|
}
|
|
8768
8781
|
)
|
|
8769
8782
|
},
|
|
8770
|
-
/* @__PURE__ */
|
|
8771
|
-
entryData?.source?.display_description && /* @__PURE__ */
|
|
8772
|
-
), /* @__PURE__ */
|
|
8783
|
+
/* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Source", isLoading: isLoadingEntry }, /* @__PURE__ */ React101.createElement(Badge, null, entryData?.source?.entity_name)),
|
|
8784
|
+
entryData?.source?.display_description && /* @__PURE__ */ React101.createElement(SourceDetailView, { source: entryData?.source })
|
|
8785
|
+
), /* @__PURE__ */ React101.createElement(
|
|
8773
8786
|
DetailsList,
|
|
8774
8787
|
{
|
|
8775
8788
|
title: `Journal Entry ${entryData?.id.substring(0, 5)}`,
|
|
8776
8789
|
className: "Layer__border-top"
|
|
8777
8790
|
},
|
|
8778
|
-
/* @__PURE__ */
|
|
8779
|
-
/* @__PURE__ */
|
|
8780
|
-
/* @__PURE__ */
|
|
8781
|
-
entryData?.reversal_id && /* @__PURE__ */
|
|
8782
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
8791
|
+
/* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Entry type", isLoading: isLoadingEntry }, humanizeEnum(entryData?.entry_type ?? "")),
|
|
8792
|
+
/* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Date", isLoading: isLoadingEntry }, entryData?.entry_at && /* @__PURE__ */ React101.createElement(DateTime, { value: entryData?.entry_at })),
|
|
8793
|
+
/* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Creation date", isLoading: isLoadingEntry }, entryData?.date && /* @__PURE__ */ React101.createElement(DateTime, { value: entryData?.date })),
|
|
8794
|
+
entryData?.reversal_id && /* @__PURE__ */ React101.createElement(DetailsListItem, { label: "Reversal", isLoading: isLoadingEntry }, entryData?.reversal_id.substring(0, 5))
|
|
8795
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React101.createElement("div", { className: "Layer__ledger-account__entry-details__line-items" }, /* @__PURE__ */ React101.createElement(Card, null, /* @__PURE__ */ React101.createElement("table", { className: "Layer__table Layer__ledger-account__entry-details__table" }, /* @__PURE__ */ React101.createElement("thead", null, /* @__PURE__ */ React101.createElement("tr", null, /* @__PURE__ */ React101.createElement("th", { className: "Layer__table-header" }, "Line items"), /* @__PURE__ */ React101.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Debit"), /* @__PURE__ */ React101.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Credit"))), /* @__PURE__ */ React101.createElement("tbody", null, entryData?.line_items?.map((item) => /* @__PURE__ */ React101.createElement("tr", { key: `ledger-line-item-${item.id}` }, /* @__PURE__ */ React101.createElement("td", { className: "Layer__table-cell" }, item.account?.name || ""), /* @__PURE__ */ React101.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React101.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))), /* @__PURE__ */ React101.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React101.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0))))), /* @__PURE__ */ React101.createElement("tr", { className: "Layer__table Layer__ledger-account__entry-details__table__total-row" }, /* @__PURE__ */ React101.createElement("td", { className: "Layer__table-cell" }, "Total"), /* @__PURE__ */ React101.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, "$", centsToDollars(totalDebit || 0)), /* @__PURE__ */ React101.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, "$", centsToDollars(totalCredit || 0))))))) : null);
|
|
8783
8796
|
};
|
|
8784
8797
|
|
|
8785
8798
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
8786
|
-
import
|
|
8799
|
+
import React102, { useContext as useContext15, useEffect as useEffect17, useState as useState26 } from "react";
|
|
8787
8800
|
import classNames39 from "classnames";
|
|
8788
8801
|
import { parseISO as parseISO10, format as formatTime8 } from "date-fns";
|
|
8789
8802
|
var LedgerAccountRow = ({
|
|
@@ -8805,7 +8818,7 @@ var LedgerAccountRow = ({
|
|
|
8805
8818
|
}
|
|
8806
8819
|
}, []);
|
|
8807
8820
|
if (view === "tablet") {
|
|
8808
|
-
return /* @__PURE__ */
|
|
8821
|
+
return /* @__PURE__ */ React102.createElement(
|
|
8809
8822
|
"tr",
|
|
8810
8823
|
{
|
|
8811
8824
|
className: classNames39(
|
|
@@ -8824,21 +8837,21 @@ var LedgerAccountRow = ({
|
|
|
8824
8837
|
}
|
|
8825
8838
|
}
|
|
8826
8839
|
},
|
|
8827
|
-
/* @__PURE__ */
|
|
8840
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React102.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React102.createElement(Text, null, row.date && formatTime8(parseISO10(row.date), DATE_FORMAT)), /* @__PURE__ */ React102.createElement(
|
|
8828
8841
|
Text,
|
|
8829
8842
|
{
|
|
8830
8843
|
weight: "normal" /* normal */,
|
|
8831
8844
|
className: "Layer__ledger_account-table__journal-id"
|
|
8832
8845
|
},
|
|
8833
8846
|
row.entry_id.substring(0, 5)
|
|
8834
|
-
)), /* @__PURE__ */
|
|
8835
|
-
/* @__PURE__ */
|
|
8836
|
-
/* @__PURE__ */
|
|
8837
|
-
/* @__PURE__ */
|
|
8847
|
+
)), /* @__PURE__ */ React102.createElement(Text, null, row.source?.display_description ?? ""))),
|
|
8848
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
8849
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
8850
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
8838
8851
|
);
|
|
8839
8852
|
}
|
|
8840
8853
|
if (view === "mobile") {
|
|
8841
|
-
return /* @__PURE__ */
|
|
8854
|
+
return /* @__PURE__ */ React102.createElement(
|
|
8842
8855
|
"tr",
|
|
8843
8856
|
{
|
|
8844
8857
|
className: classNames39(
|
|
@@ -8857,17 +8870,17 @@ var LedgerAccountRow = ({
|
|
|
8857
8870
|
}
|
|
8858
8871
|
}
|
|
8859
8872
|
},
|
|
8860
|
-
/* @__PURE__ */
|
|
8873
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React102.createElement("div", { className: "Layer__ledger-account-table__tablet-main-col__date" }, /* @__PURE__ */ React102.createElement(Text, null, row.date && formatTime8(parseISO10(row.date), DATE_FORMAT)), /* @__PURE__ */ React102.createElement(
|
|
8861
8874
|
Text,
|
|
8862
8875
|
{
|
|
8863
8876
|
weight: "normal" /* normal */,
|
|
8864
8877
|
className: "Layer__ledger_account-table__journal-id"
|
|
8865
8878
|
},
|
|
8866
8879
|
row.entry_id.substring(0, 5)
|
|
8867
|
-
)), /* @__PURE__ */
|
|
8880
|
+
)), /* @__PURE__ */ React102.createElement(Text, null, row.source?.display_description ?? ""), /* @__PURE__ */ React102.createElement("div", { className: "Layer__ledger_account-table__balances-mobile" }, /* @__PURE__ */ React102.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Debit"), /* @__PURE__ */ React102.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, " ", row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars(row?.amount || 0)}`)), /* @__PURE__ */ React102.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Credit"), /* @__PURE__ */ React102.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars(row?.amount || 0)}`)), /* @__PURE__ */ React102.createElement("div", { className: "Layer__ledger_account-table__balance-item" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__label" }, "Running balance"), /* @__PURE__ */ React102.createElement("span", { className: "Layer__ledger_account-table__balances-mobile__value" }, `$${centsToDollars(row.running_balance)}`)))))
|
|
8868
8881
|
);
|
|
8869
8882
|
}
|
|
8870
|
-
return /* @__PURE__ */
|
|
8883
|
+
return /* @__PURE__ */ React102.createElement(
|
|
8871
8884
|
"tr",
|
|
8872
8885
|
{
|
|
8873
8886
|
className: classNames39(
|
|
@@ -8886,12 +8899,12 @@ var LedgerAccountRow = ({
|
|
|
8886
8899
|
}
|
|
8887
8900
|
}
|
|
8888
8901
|
},
|
|
8889
|
-
/* @__PURE__ */
|
|
8890
|
-
/* @__PURE__ */
|
|
8891
|
-
/* @__PURE__ */
|
|
8892
|
-
/* @__PURE__ */
|
|
8893
|
-
/* @__PURE__ */
|
|
8894
|
-
/* @__PURE__ */
|
|
8902
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content" }, row.date && formatTime8(parseISO10(row.date), DATE_FORMAT))),
|
|
8903
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content" }, row.entry_id.substring(0, 5))),
|
|
8904
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content" }, row.source?.display_description ?? "")),
|
|
8905
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "DEBIT" /* DEBIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
8906
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, row.direction === "CREDIT" /* CREDIT */ && `$${centsToDollars(row?.amount || 0)}`)),
|
|
8907
|
+
/* @__PURE__ */ React102.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React102.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, `$${centsToDollars(row.running_balance)}`))
|
|
8895
8908
|
);
|
|
8896
8909
|
};
|
|
8897
8910
|
|
|
@@ -8942,36 +8955,36 @@ var LedgerAccount = ({
|
|
|
8942
8955
|
setAccountId(void 0);
|
|
8943
8956
|
closeSelectedEntry();
|
|
8944
8957
|
};
|
|
8945
|
-
return /* @__PURE__ */
|
|
8958
|
+
return /* @__PURE__ */ React103.createElement(
|
|
8946
8959
|
Panel,
|
|
8947
8960
|
{
|
|
8948
|
-
sidebar: /* @__PURE__ */
|
|
8961
|
+
sidebar: /* @__PURE__ */ React103.createElement(LedgerAccountEntryDetails, null),
|
|
8949
8962
|
sidebarIsOpen: Boolean(selectedEntryId),
|
|
8950
8963
|
parentRef: containerRef,
|
|
8951
8964
|
className: "Layer__ledger-account__panel"
|
|
8952
8965
|
},
|
|
8953
|
-
/* @__PURE__ */
|
|
8966
|
+
/* @__PURE__ */ React103.createElement("div", { className: baseClassName }, /* @__PURE__ */ React103.createElement("div", { className: "Layer__ledger-account__header" }, /* @__PURE__ */ React103.createElement(BackButton, { onClick: close }), /* @__PURE__ */ React103.createElement("div", { className: "Layer__ledger-account__title-container" }, /* @__PURE__ */ React103.createElement(
|
|
8954
8967
|
Text,
|
|
8955
8968
|
{
|
|
8956
8969
|
weight: "bold" /* bold */,
|
|
8957
8970
|
className: "Layer__ledger-account__title"
|
|
8958
8971
|
},
|
|
8959
8972
|
entry?.name ?? ""
|
|
8960
|
-
), /* @__PURE__ */
|
|
8973
|
+
), /* @__PURE__ */ React103.createElement(
|
|
8961
8974
|
Button,
|
|
8962
8975
|
{
|
|
8963
8976
|
variant: "secondary" /* secondary */,
|
|
8964
|
-
rightIcon: /* @__PURE__ */
|
|
8977
|
+
rightIcon: /* @__PURE__ */ React103.createElement(DownloadCloud_default, { size: 12 })
|
|
8965
8978
|
},
|
|
8966
8979
|
"Download"
|
|
8967
|
-
)), /* @__PURE__ */
|
|
8980
|
+
)), /* @__PURE__ */ React103.createElement("div", { className: "Layer__ledger-account__balance-container" }, /* @__PURE__ */ React103.createElement(
|
|
8968
8981
|
Text,
|
|
8969
8982
|
{
|
|
8970
8983
|
weight: "bold" /* bold */,
|
|
8971
8984
|
className: "Layer__ledger-account__balance-label"
|
|
8972
8985
|
},
|
|
8973
8986
|
"Current balance"
|
|
8974
|
-
), /* @__PURE__ */
|
|
8987
|
+
), /* @__PURE__ */ React103.createElement(
|
|
8975
8988
|
Text,
|
|
8976
8989
|
{
|
|
8977
8990
|
weight: "bold" /* bold */,
|
|
@@ -8979,7 +8992,7 @@ var LedgerAccount = ({
|
|
|
8979
8992
|
},
|
|
8980
8993
|
"$",
|
|
8981
8994
|
centsToDollars(entry?.balance || 0)
|
|
8982
|
-
))), /* @__PURE__ */
|
|
8995
|
+
))), /* @__PURE__ */ React103.createElement("table", { className: "Layer__table Layer__table--hover-effect Layer__ledger-account-table" }, /* @__PURE__ */ React103.createElement("thead", null, /* @__PURE__ */ React103.createElement("tr", null, view !== "desktop" && /* @__PURE__ */ React103.createElement("th", null), view === "desktop" && /* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement("th", { className: "Layer__table-header" }, "Date"), /* @__PURE__ */ React103.createElement("th", { className: "Layer__table-header" }, "Journal id #"), /* @__PURE__ */ React103.createElement("th", { className: "Layer__table-header" }, "Source")), view !== "mobile" && /* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Debit"), /* @__PURE__ */ React103.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Credit"), /* @__PURE__ */ React103.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Running balance")))), /* @__PURE__ */ React103.createElement("tbody", null, data?.map((x, index) => /* @__PURE__ */ React103.createElement(
|
|
8983
8996
|
LedgerAccountRow,
|
|
8984
8997
|
{
|
|
8985
8998
|
key: x.id,
|
|
@@ -8988,7 +9001,7 @@ var LedgerAccount = ({
|
|
|
8988
9001
|
initialLoad,
|
|
8989
9002
|
view
|
|
8990
9003
|
}
|
|
8991
|
-
)))), data && /* @__PURE__ */
|
|
9004
|
+
)))), data && /* @__PURE__ */ React103.createElement("div", { className: "Layer__ledger-account__pagination" }, /* @__PURE__ */ React103.createElement(
|
|
8992
9005
|
Pagination,
|
|
8993
9006
|
{
|
|
8994
9007
|
currentPage,
|
|
@@ -8996,7 +9009,7 @@ var LedgerAccount = ({
|
|
|
8996
9009
|
pageSize,
|
|
8997
9010
|
onPageChange: (page) => setCurrentPage(page)
|
|
8998
9011
|
}
|
|
8999
|
-
)), error ? /* @__PURE__ */
|
|
9012
|
+
)), error ? /* @__PURE__ */ React103.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React103.createElement(
|
|
9000
9013
|
DataState,
|
|
9001
9014
|
{
|
|
9002
9015
|
status: "failed" /* failed */,
|
|
@@ -9005,7 +9018,7 @@ var LedgerAccount = ({
|
|
|
9005
9018
|
onRefresh: () => refetch(),
|
|
9006
9019
|
isLoading: isValidating || isLoading
|
|
9007
9020
|
}
|
|
9008
|
-
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */
|
|
9021
|
+
)) : null, (!data || isLoading) && !error ? /* @__PURE__ */ React103.createElement("div", { className: `Layer__ledger-account__loader-container` }, /* @__PURE__ */ React103.createElement(Loader2, null)) : null, !isLoading && !error && data?.length === 0 ? /* @__PURE__ */ React103.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React103.createElement(
|
|
9009
9022
|
DataState,
|
|
9010
9023
|
{
|
|
9011
9024
|
status: "info" /* info */,
|
|
@@ -9023,7 +9036,7 @@ var ChartOfAccounts = (props) => {
|
|
|
9023
9036
|
withDates: props.withDateControl
|
|
9024
9037
|
});
|
|
9025
9038
|
const ledgerAccountsContextData = useLedgerAccounts();
|
|
9026
|
-
return /* @__PURE__ */
|
|
9039
|
+
return /* @__PURE__ */ React104.createElement(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData }, /* @__PURE__ */ React104.createElement(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData }, /* @__PURE__ */ React104.createElement(ChartOfAccountsContent, { ...props })));
|
|
9027
9040
|
};
|
|
9028
9041
|
var ChartOfAccountsContent = ({
|
|
9029
9042
|
asWidget,
|
|
@@ -9043,7 +9056,7 @@ var ChartOfAccountsContent = ({
|
|
|
9043
9056
|
}
|
|
9044
9057
|
}
|
|
9045
9058
|
});
|
|
9046
|
-
return /* @__PURE__ */
|
|
9059
|
+
return /* @__PURE__ */ React104.createElement(Container, { name: "chart-of-accounts", ref: containerRef, asWidget }, accountId ? /* @__PURE__ */ React104.createElement(LedgerAccount, { view, containerRef }) : /* @__PURE__ */ React104.createElement(
|
|
9047
9060
|
ChartOfAccountsTable,
|
|
9048
9061
|
{
|
|
9049
9062
|
asWidget,
|
|
@@ -9056,12 +9069,12 @@ var ChartOfAccountsContent = ({
|
|
|
9056
9069
|
};
|
|
9057
9070
|
|
|
9058
9071
|
// src/providers/LayerProvider/LayerProvider.tsx
|
|
9059
|
-
import
|
|
9072
|
+
import React105, {
|
|
9060
9073
|
useReducer,
|
|
9061
9074
|
useEffect as useEffect19
|
|
9062
9075
|
} from "react";
|
|
9063
9076
|
import { add as add2, isBefore } from "date-fns";
|
|
9064
|
-
import
|
|
9077
|
+
import useSWR8, { SWRConfig } from "swr";
|
|
9065
9078
|
var reducer = (state, action) => {
|
|
9066
9079
|
switch (action.type) {
|
|
9067
9080
|
case "LayerContext.setAuth" /* setAuth */:
|
|
@@ -9116,7 +9129,7 @@ var LayerProvider = ({
|
|
|
9116
9129
|
colors,
|
|
9117
9130
|
onboardingStep: void 0
|
|
9118
9131
|
});
|
|
9119
|
-
const { data: auth } = appId !== void 0 && appSecret !== void 0 ?
|
|
9132
|
+
const { data: auth } = appId !== void 0 && appSecret !== void 0 ? useSWR8(
|
|
9120
9133
|
businessAccessToken === void 0 && appId !== void 0 && appSecret !== void 0 && isBefore(state.auth.expires_at, /* @__PURE__ */ new Date()) && "authenticate",
|
|
9121
9134
|
Layer.authenticate({
|
|
9122
9135
|
appId,
|
|
@@ -9151,7 +9164,7 @@ var LayerProvider = ({
|
|
|
9151
9164
|
});
|
|
9152
9165
|
}
|
|
9153
9166
|
}, [businessAccessToken, auth?.access_token]);
|
|
9154
|
-
|
|
9167
|
+
useSWR8(
|
|
9155
9168
|
businessId && auth?.access_token && `categories-${businessId}`,
|
|
9156
9169
|
Layer.getCategories(apiUrl, auth?.access_token, { params: { businessId } }),
|
|
9157
9170
|
{
|
|
@@ -9204,7 +9217,7 @@ var LayerProvider = ({
|
|
|
9204
9217
|
type: "LayerContext.setOnboardingStep" /* setOnboardingStep */,
|
|
9205
9218
|
payload: { onboardingStep: value }
|
|
9206
9219
|
});
|
|
9207
|
-
return /* @__PURE__ */
|
|
9220
|
+
return /* @__PURE__ */ React105.createElement(SWRConfig, { value: defaultSWRConfig }, /* @__PURE__ */ React105.createElement(
|
|
9208
9221
|
LayerContext.Provider,
|
|
9209
9222
|
{
|
|
9210
9223
|
value: {
|
|
@@ -9222,7 +9235,7 @@ var LayerProvider = ({
|
|
|
9222
9235
|
};
|
|
9223
9236
|
|
|
9224
9237
|
// src/components/Journal/Journal.tsx
|
|
9225
|
-
import
|
|
9238
|
+
import React112, { useState as useState33 } from "react";
|
|
9226
9239
|
|
|
9227
9240
|
// src/contexts/JournalContext/JournalContext.tsx
|
|
9228
9241
|
import { createContext as createContext7 } from "react";
|
|
@@ -9260,7 +9273,7 @@ var JournalContext = createContext7({
|
|
|
9260
9273
|
|
|
9261
9274
|
// src/hooks/useJournal/useJournal.tsx
|
|
9262
9275
|
import { useState as useState30 } from "react";
|
|
9263
|
-
import
|
|
9276
|
+
import useSWR9 from "swr";
|
|
9264
9277
|
var useJournal = () => {
|
|
9265
9278
|
const { auth, businessId, apiUrl } = useLayerContext();
|
|
9266
9279
|
const [selectedEntryId, setSelectedEntryId] = useState30();
|
|
@@ -9268,7 +9281,7 @@ var useJournal = () => {
|
|
|
9268
9281
|
const [addingEntry, setAddingEntry] = useState30(false);
|
|
9269
9282
|
const [sendingForm, setSendingForm] = useState30(false);
|
|
9270
9283
|
const [apiError, setApiError] = useState30(void 0);
|
|
9271
|
-
const { data, isLoading, isValidating, error, mutate } =
|
|
9284
|
+
const { data, isLoading, isValidating, error, mutate } = useSWR9(
|
|
9272
9285
|
businessId && auth?.access_token && `journal-lines-${businessId}`,
|
|
9273
9286
|
Layer.getJournal(apiUrl, auth?.access_token, {
|
|
9274
9287
|
params: { businessId }
|
|
@@ -9520,10 +9533,10 @@ var useJournal = () => {
|
|
|
9520
9533
|
var flattenEntries = (entries) => entries.flatMap((a) => [a, flattenEntries(a.line_items || [])]).flat().filter((id) => id);
|
|
9521
9534
|
|
|
9522
9535
|
// src/components/JournalTable/JournalTable.tsx
|
|
9523
|
-
import
|
|
9536
|
+
import React111, { useContext as useContext23, useMemo as useMemo13, useState as useState32 } from "react";
|
|
9524
9537
|
|
|
9525
9538
|
// src/components/JournalRow/JournalRow.tsx
|
|
9526
|
-
import
|
|
9539
|
+
import React106, { useContext as useContext18, useEffect as useEffect20, useState as useState31 } from "react";
|
|
9527
9540
|
import classNames41 from "classnames";
|
|
9528
9541
|
import { parseISO as parseISO11, format as formatTime9 } from "date-fns";
|
|
9529
9542
|
var INDENTATION2 = 24;
|
|
@@ -9587,7 +9600,7 @@ var JournalRow = ({
|
|
|
9587
9600
|
}
|
|
9588
9601
|
}, []);
|
|
9589
9602
|
if ("line_items" in row) {
|
|
9590
|
-
return /* @__PURE__ */
|
|
9603
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
9591
9604
|
"tr",
|
|
9592
9605
|
{
|
|
9593
9606
|
className: baseClass,
|
|
@@ -9601,7 +9614,7 @@ var JournalRow = ({
|
|
|
9601
9614
|
}
|
|
9602
9615
|
}
|
|
9603
9616
|
},
|
|
9604
|
-
/* @__PURE__ */
|
|
9617
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell Layer__journal__arrow" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ React106.createElement(
|
|
9605
9618
|
"span",
|
|
9606
9619
|
{
|
|
9607
9620
|
className: "Layer__table-cell-content-indentation",
|
|
@@ -9614,32 +9627,32 @@ var JournalRow = ({
|
|
|
9614
9627
|
setIsOpen(!isOpen);
|
|
9615
9628
|
}
|
|
9616
9629
|
},
|
|
9617
|
-
row.line_items && row.line_items.length > 0 && /* @__PURE__ */
|
|
9630
|
+
row.line_items && row.line_items.length > 0 && /* @__PURE__ */ React106.createElement(
|
|
9618
9631
|
ChevronDownFill_default,
|
|
9619
9632
|
{
|
|
9620
9633
|
size: 16,
|
|
9621
9634
|
className: "Layer__table__expand-icon",
|
|
9622
9635
|
style: {
|
|
9623
|
-
transform: isOpen ? "rotate(0deg)" : "rotate(
|
|
9636
|
+
transform: isOpen ? "rotate(0deg)" : "rotate(-90deg)"
|
|
9624
9637
|
}
|
|
9625
9638
|
}
|
|
9626
9639
|
)
|
|
9627
9640
|
))),
|
|
9628
|
-
/* @__PURE__ */
|
|
9629
|
-
/* @__PURE__ */
|
|
9630
|
-
/* @__PURE__ */
|
|
9631
|
-
/* @__PURE__ */
|
|
9632
|
-
/* @__PURE__ */
|
|
9641
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content" }, row.id.substring(0, 5))),
|
|
9642
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content" }, row.date && formatTime9(parseISO11(row.date), DATE_FORMAT))),
|
|
9643
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content" }, humanizeEnum(row.entry_type))),
|
|
9644
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content" }, `(${row.line_items.length})`)),
|
|
9645
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, "$", centsToDollars(
|
|
9633
9646
|
Math.abs(
|
|
9634
9647
|
row.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
9635
9648
|
)
|
|
9636
9649
|
))),
|
|
9637
|
-
/* @__PURE__ */
|
|
9650
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content Layer__table-cell--amount" }, "$", centsToDollars(
|
|
9638
9651
|
Math.abs(
|
|
9639
9652
|
row.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
9640
9653
|
)
|
|
9641
9654
|
)))
|
|
9642
|
-
), (row.line_items || []).map((lineItem, idx) => /* @__PURE__ */
|
|
9655
|
+
), (row.line_items || []).map((lineItem, idx) => /* @__PURE__ */ React106.createElement(
|
|
9643
9656
|
JournalRow,
|
|
9644
9657
|
{
|
|
9645
9658
|
key: lineItem.id,
|
|
@@ -9654,18 +9667,18 @@ var JournalRow = ({
|
|
|
9654
9667
|
}
|
|
9655
9668
|
)));
|
|
9656
9669
|
}
|
|
9657
|
-
return /* @__PURE__ */
|
|
9670
|
+
return /* @__PURE__ */ React106.createElement(
|
|
9658
9671
|
"tr",
|
|
9659
9672
|
{
|
|
9660
9673
|
className: journalEntryLineClass,
|
|
9661
9674
|
style: { transitionDelay: `${15 * index}ms` }
|
|
9662
9675
|
},
|
|
9663
|
-
/* @__PURE__ */
|
|
9664
|
-
/* @__PURE__ */
|
|
9665
|
-
/* @__PURE__ */
|
|
9666
|
-
/* @__PURE__ */
|
|
9667
|
-
/* @__PURE__ */
|
|
9668
|
-
/* @__PURE__ */
|
|
9676
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content", style })),
|
|
9677
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content", style }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-hidden" }, row.id.substring(0, 5)))),
|
|
9678
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }),
|
|
9679
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }),
|
|
9680
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell" }, /* @__PURE__ */ React106.createElement("span", { className: "Layer__table-cell-content", style }, row.account.name)),
|
|
9681
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, row.direction === "DEBIT" && /* @__PURE__ */ React106.createElement(
|
|
9669
9682
|
"span",
|
|
9670
9683
|
{
|
|
9671
9684
|
className: "Layer__table-cell-content Layer__table-cell--amount",
|
|
@@ -9674,7 +9687,7 @@ var JournalRow = ({
|
|
|
9674
9687
|
"$",
|
|
9675
9688
|
centsToDollars(Math.abs(row.amount))
|
|
9676
9689
|
)),
|
|
9677
|
-
/* @__PURE__ */
|
|
9690
|
+
/* @__PURE__ */ React106.createElement("td", { className: "Layer__table-cell Layer__table-cell--primary" }, row.direction === "CREDIT" && /* @__PURE__ */ React106.createElement(
|
|
9678
9691
|
"span",
|
|
9679
9692
|
{
|
|
9680
9693
|
className: "Layer__table-cell-content Layer__table-cell--amount",
|
|
@@ -9687,10 +9700,10 @@ var JournalRow = ({
|
|
|
9687
9700
|
};
|
|
9688
9701
|
|
|
9689
9702
|
// src/components/JournalSidebar/JournalSidebar.tsx
|
|
9690
|
-
import
|
|
9703
|
+
import React110, { useContext as useContext22 } from "react";
|
|
9691
9704
|
|
|
9692
9705
|
// src/components/JournalEntryDetails/JournalEntryDetails.tsx
|
|
9693
|
-
import
|
|
9706
|
+
import React107, { useContext as useContext19, useMemo as useMemo12 } from "react";
|
|
9694
9707
|
var JournalEntryDetails = () => {
|
|
9695
9708
|
const {
|
|
9696
9709
|
data,
|
|
@@ -9705,22 +9718,22 @@ var JournalEntryDetails = () => {
|
|
|
9705
9718
|
}
|
|
9706
9719
|
return;
|
|
9707
9720
|
}, [data, selectedEntryId]);
|
|
9708
|
-
return /* @__PURE__ */
|
|
9721
|
+
return /* @__PURE__ */ React107.createElement("div", { className: "Layer__journal__entry-details" }, /* @__PURE__ */ React107.createElement(
|
|
9709
9722
|
DetailsList,
|
|
9710
9723
|
{
|
|
9711
9724
|
className: "Layer__journal__entry-details__title",
|
|
9712
9725
|
title: `Journal Entry #${entry?.id.substring(0, 5)}`,
|
|
9713
|
-
actions: /* @__PURE__ */
|
|
9726
|
+
actions: /* @__PURE__ */ React107.createElement("div", { className: "Layer__journal__entry-details__back-btn" }, /* @__PURE__ */ React107.createElement(CloseButton, { onClick: () => closeSelectedEntry() }))
|
|
9714
9727
|
},
|
|
9715
|
-
/* @__PURE__ */
|
|
9716
|
-
/* @__PURE__ */
|
|
9717
|
-
/* @__PURE__ */
|
|
9718
|
-
entry?.reversal_id && /* @__PURE__ */
|
|
9719
|
-
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */
|
|
9728
|
+
/* @__PURE__ */ React107.createElement(DetailsListItem, { label: "Entry type", isLoading: isLoadingEntry }, humanizeEnum(entry?.entry_type ?? "")),
|
|
9729
|
+
/* @__PURE__ */ React107.createElement(DetailsListItem, { label: "Date", isLoading: isLoadingEntry }, entry?.entry_at && /* @__PURE__ */ React107.createElement(DateTime, { value: entry?.entry_at })),
|
|
9730
|
+
/* @__PURE__ */ React107.createElement(DetailsListItem, { label: "Creation date", isLoading: isLoadingEntry }, entry?.date && /* @__PURE__ */ React107.createElement(DateTime, { value: entry?.date })),
|
|
9731
|
+
entry?.reversal_id && /* @__PURE__ */ React107.createElement(DetailsListItem, { label: "Reversal", isLoading: isLoadingEntry }, "Journal Entry #", entry?.reversal_id)
|
|
9732
|
+
), !isLoadingEntry && !errorEntry ? /* @__PURE__ */ React107.createElement("div", { className: "Layer__ledger-account__entry-details__line-items" }, /* @__PURE__ */ React107.createElement(Card, null, /* @__PURE__ */ React107.createElement("table", { className: "Layer__table Layer__ledger-account__entry-details__table" }, /* @__PURE__ */ React107.createElement("thead", null, /* @__PURE__ */ React107.createElement("tr", null, /* @__PURE__ */ React107.createElement("th", { className: "Layer__table-header" }, "Line items"), /* @__PURE__ */ React107.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Debit"), /* @__PURE__ */ React107.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Credit"))), /* @__PURE__ */ React107.createElement("tbody", null, entry?.line_items?.map((item) => /* @__PURE__ */ React107.createElement("tr", { key: `ledger-line-item-${item.id}` }, /* @__PURE__ */ React107.createElement("td", { className: "Layer__table-cell" }, item.account?.name || ""), /* @__PURE__ */ React107.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, item.direction === "DEBIT" /* DEBIT */ && /* @__PURE__ */ React107.createElement(Badge, { variant: "warning" /* WARNING */ }, "$", centsToDollars(item.amount || 0))), /* @__PURE__ */ React107.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, item.direction === "CREDIT" /* CREDIT */ && /* @__PURE__ */ React107.createElement(Badge, { variant: "success" /* SUCCESS */ }, "$", centsToDollars(item.amount || 0))))), /* @__PURE__ */ React107.createElement("tr", { className: "Layer__table Layer__ledger-account__entry-details__table__total-row" }, /* @__PURE__ */ React107.createElement("td", { className: "Layer__table-cell" }, "Total"), /* @__PURE__ */ React107.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, "$", centsToDollars(
|
|
9720
9733
|
Math.abs(
|
|
9721
9734
|
entry?.line_items.filter((item) => item.direction === "DEBIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
9722
9735
|
) || 0
|
|
9723
|
-
)), /* @__PURE__ */
|
|
9736
|
+
)), /* @__PURE__ */ React107.createElement("td", { className: "Layer__table-cell Layer__table-cell--amount" }, "$", centsToDollars(
|
|
9724
9737
|
Math.abs(
|
|
9725
9738
|
entry?.line_items.filter((item) => item.direction === "CREDIT").map((item) => item.amount).reduce((a, b) => a + b, 0)
|
|
9726
9739
|
) || 0
|
|
@@ -9728,10 +9741,10 @@ var JournalEntryDetails = () => {
|
|
|
9728
9741
|
};
|
|
9729
9742
|
|
|
9730
9743
|
// src/components/JournalForm/JournalForm.tsx
|
|
9731
|
-
import
|
|
9744
|
+
import React109, { useContext as useContext21 } from "react";
|
|
9732
9745
|
|
|
9733
9746
|
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
9734
|
-
import
|
|
9747
|
+
import React108, { useContext as useContext20 } from "react";
|
|
9735
9748
|
var JournalFormEntryLines = ({
|
|
9736
9749
|
entrylineItems,
|
|
9737
9750
|
addEntryLine,
|
|
@@ -9743,14 +9756,14 @@ var JournalFormEntryLines = ({
|
|
|
9743
9756
|
const { data: accountsData } = useContext20(ChartOfAccountsContext);
|
|
9744
9757
|
const { form } = useContext20(JournalContext);
|
|
9745
9758
|
const parentOptions = useParentOptions(accountsData);
|
|
9746
|
-
return /* @__PURE__ */
|
|
9747
|
-
return /* @__PURE__ */
|
|
9759
|
+
return /* @__PURE__ */ React108.createElement(React108.Fragment, null, Object.keys(Direction).map((direction, idx) => {
|
|
9760
|
+
return /* @__PURE__ */ React108.createElement(
|
|
9748
9761
|
"div",
|
|
9749
9762
|
{
|
|
9750
9763
|
key: "Layer__journal__form__input-group-" + idx,
|
|
9751
9764
|
className: "Layer__journal__form__input-group Layer__journal__form__input-group__border"
|
|
9752
9765
|
},
|
|
9753
|
-
/* @__PURE__ */
|
|
9766
|
+
/* @__PURE__ */ React108.createElement(
|
|
9754
9767
|
Text,
|
|
9755
9768
|
{
|
|
9756
9769
|
className: "Layer__journal__form__input-group__title",
|
|
@@ -9764,13 +9777,13 @@ var JournalFormEntryLines = ({
|
|
|
9764
9777
|
if (item.direction !== direction) {
|
|
9765
9778
|
return null;
|
|
9766
9779
|
}
|
|
9767
|
-
return /* @__PURE__ */
|
|
9780
|
+
return /* @__PURE__ */ React108.createElement(
|
|
9768
9781
|
"div",
|
|
9769
9782
|
{
|
|
9770
9783
|
className: "Layer__journal__form__input-group__line-item",
|
|
9771
9784
|
key: direction + "-" + idx2
|
|
9772
9785
|
},
|
|
9773
|
-
/* @__PURE__ */
|
|
9786
|
+
/* @__PURE__ */ React108.createElement(InputGroup, { name: direction, label: "Amount", inline: true }, /* @__PURE__ */ React108.createElement(
|
|
9774
9787
|
InputWithBadge,
|
|
9775
9788
|
{
|
|
9776
9789
|
name: direction,
|
|
@@ -9796,14 +9809,14 @@ var JournalFormEntryLines = ({
|
|
|
9796
9809
|
)?.message
|
|
9797
9810
|
}
|
|
9798
9811
|
)),
|
|
9799
|
-
/* @__PURE__ */
|
|
9812
|
+
/* @__PURE__ */ React108.createElement(
|
|
9800
9813
|
InputGroup,
|
|
9801
9814
|
{
|
|
9802
9815
|
name: "account-name",
|
|
9803
9816
|
label: "Account name",
|
|
9804
9817
|
inline: true
|
|
9805
9818
|
},
|
|
9806
|
-
/* @__PURE__ */
|
|
9819
|
+
/* @__PURE__ */ React108.createElement(
|
|
9807
9820
|
Select2,
|
|
9808
9821
|
{
|
|
9809
9822
|
options: parentOptions,
|
|
@@ -9827,18 +9840,18 @@ var JournalFormEntryLines = ({
|
|
|
9827
9840
|
)?.message
|
|
9828
9841
|
}
|
|
9829
9842
|
),
|
|
9830
|
-
idx2 >= 2 && /* @__PURE__ */
|
|
9843
|
+
idx2 >= 2 && /* @__PURE__ */ React108.createElement(
|
|
9831
9844
|
IconButton,
|
|
9832
9845
|
{
|
|
9833
9846
|
className: "Layer__remove__button",
|
|
9834
9847
|
onClick: () => removeEntryLine(idx2),
|
|
9835
|
-
icon: /* @__PURE__ */
|
|
9848
|
+
icon: /* @__PURE__ */ React108.createElement(Trash_default, null)
|
|
9836
9849
|
}
|
|
9837
9850
|
)
|
|
9838
9851
|
)
|
|
9839
9852
|
);
|
|
9840
9853
|
}),
|
|
9841
|
-
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > entrylineItems?.length) && /* @__PURE__ */
|
|
9854
|
+
(config.form.addEntryLinesLimit === void 0 || config.form.addEntryLinesLimit > entrylineItems?.length) && /* @__PURE__ */ React108.createElement(
|
|
9842
9855
|
TextButton,
|
|
9843
9856
|
{
|
|
9844
9857
|
className: "Layer__journal__add-entry-line",
|
|
@@ -9862,7 +9875,7 @@ var JournalForm = ({ config }) => {
|
|
|
9862
9875
|
addEntryLine,
|
|
9863
9876
|
removeEntryLine
|
|
9864
9877
|
} = useContext21(JournalContext);
|
|
9865
|
-
return /* @__PURE__ */
|
|
9878
|
+
return /* @__PURE__ */ React109.createElement(
|
|
9866
9879
|
"form",
|
|
9867
9880
|
{
|
|
9868
9881
|
className: "Layer__form",
|
|
@@ -9871,7 +9884,7 @@ var JournalForm = ({ config }) => {
|
|
|
9871
9884
|
submitForm();
|
|
9872
9885
|
}
|
|
9873
9886
|
},
|
|
9874
|
-
/* @__PURE__ */
|
|
9887
|
+
/* @__PURE__ */ React109.createElement("div", { className: "Layer__journal__sidebar__header" }, /* @__PURE__ */ React109.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, "Add New Entry"), /* @__PURE__ */ React109.createElement("div", { className: "actions" }, /* @__PURE__ */ React109.createElement(
|
|
9875
9888
|
Button,
|
|
9876
9889
|
{
|
|
9877
9890
|
type: "button",
|
|
@@ -9880,7 +9893,7 @@ var JournalForm = ({ config }) => {
|
|
|
9880
9893
|
disabled: sendingForm
|
|
9881
9894
|
},
|
|
9882
9895
|
"Cancel"
|
|
9883
|
-
), apiError && /* @__PURE__ */
|
|
9896
|
+
), apiError && /* @__PURE__ */ React109.createElement(
|
|
9884
9897
|
RetryButton,
|
|
9885
9898
|
{
|
|
9886
9899
|
type: "submit",
|
|
@@ -9889,7 +9902,7 @@ var JournalForm = ({ config }) => {
|
|
|
9889
9902
|
disabled: sendingForm
|
|
9890
9903
|
},
|
|
9891
9904
|
"Retry"
|
|
9892
|
-
), !apiError && /* @__PURE__ */
|
|
9905
|
+
), !apiError && /* @__PURE__ */ React109.createElement(
|
|
9893
9906
|
SubmitButton,
|
|
9894
9907
|
{
|
|
9895
9908
|
type: "submit",
|
|
@@ -9899,7 +9912,7 @@ var JournalForm = ({ config }) => {
|
|
|
9899
9912
|
},
|
|
9900
9913
|
"Save"
|
|
9901
9914
|
))),
|
|
9902
|
-
apiError && /* @__PURE__ */
|
|
9915
|
+
apiError && /* @__PURE__ */ React109.createElement(
|
|
9903
9916
|
Text,
|
|
9904
9917
|
{
|
|
9905
9918
|
size: "sm" /* sm */,
|
|
@@ -9907,7 +9920,7 @@ var JournalForm = ({ config }) => {
|
|
|
9907
9920
|
},
|
|
9908
9921
|
apiError
|
|
9909
9922
|
),
|
|
9910
|
-
/* @__PURE__ */
|
|
9923
|
+
/* @__PURE__ */ React109.createElement("div", { className: "Layer__journal__form__input-group" }, /* @__PURE__ */ React109.createElement(InputGroup, { name: "date", label: "Date", inline: true }, /* @__PURE__ */ React109.createElement("div", { className: "Layer__journal__datepicker__wrapper" }, /* @__PURE__ */ React109.createElement(
|
|
9911
9924
|
DateInput,
|
|
9912
9925
|
{
|
|
9913
9926
|
selected: form?.data.entry_at,
|
|
@@ -9915,7 +9928,7 @@ var JournalForm = ({ config }) => {
|
|
|
9915
9928
|
dateFormat: "MMMM d, yyyy",
|
|
9916
9929
|
placeholderText: "Select date"
|
|
9917
9930
|
}
|
|
9918
|
-
), /* @__PURE__ */
|
|
9931
|
+
), /* @__PURE__ */ React109.createElement(
|
|
9919
9932
|
DateInput,
|
|
9920
9933
|
{
|
|
9921
9934
|
selected: form?.data.entry_at,
|
|
@@ -9928,7 +9941,7 @@ var JournalForm = ({ config }) => {
|
|
|
9928
9941
|
placeholderText: "Select time"
|
|
9929
9942
|
}
|
|
9930
9943
|
)))),
|
|
9931
|
-
/* @__PURE__ */
|
|
9944
|
+
/* @__PURE__ */ React109.createElement(
|
|
9932
9945
|
JournalFormEntryLines,
|
|
9933
9946
|
{
|
|
9934
9947
|
entrylineItems: form?.data.line_items || [],
|
|
@@ -9939,7 +9952,7 @@ var JournalForm = ({ config }) => {
|
|
|
9939
9952
|
config
|
|
9940
9953
|
}
|
|
9941
9954
|
),
|
|
9942
|
-
/* @__PURE__ */
|
|
9955
|
+
/* @__PURE__ */ React109.createElement("div", { className: "Layer__journal__form__input-group Layer__journal__form__input-group__textarea" }, /* @__PURE__ */ React109.createElement(InputGroup, { name: "memo", label: "Notes" }, /* @__PURE__ */ React109.createElement(
|
|
9943
9956
|
Textarea,
|
|
9944
9957
|
{
|
|
9945
9958
|
name: "memo",
|
|
@@ -9959,9 +9972,9 @@ var JournalSidebar = ({
|
|
|
9959
9972
|
}) => {
|
|
9960
9973
|
const { selectedEntryId } = useContext22(JournalContext);
|
|
9961
9974
|
if (selectedEntryId !== "new") {
|
|
9962
|
-
return /* @__PURE__ */
|
|
9975
|
+
return /* @__PURE__ */ React110.createElement(JournalEntryDetails, null);
|
|
9963
9976
|
}
|
|
9964
|
-
return /* @__PURE__ */
|
|
9977
|
+
return /* @__PURE__ */ React110.createElement(JournalForm, { config });
|
|
9965
9978
|
};
|
|
9966
9979
|
|
|
9967
9980
|
// src/components/JournalTable/JournalTable.tsx
|
|
@@ -9987,24 +10000,24 @@ var JournalTable = ({
|
|
|
9987
10000
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
9988
10001
|
return rawData?.sort((a, b) => Date.parse(b.date) - Date.parse(a.date))?.slice(firstPageIndex, lastPageIndex);
|
|
9989
10002
|
}, [rawData, currentPage]);
|
|
9990
|
-
return /* @__PURE__ */
|
|
10003
|
+
return /* @__PURE__ */ React111.createElement(
|
|
9991
10004
|
Panel,
|
|
9992
10005
|
{
|
|
9993
|
-
sidebar: /* @__PURE__ */
|
|
10006
|
+
sidebar: /* @__PURE__ */ React111.createElement(JournalSidebar, { parentRef: containerRef, config }),
|
|
9994
10007
|
sidebarIsOpen: Boolean(selectedEntryId),
|
|
9995
10008
|
parentRef: containerRef
|
|
9996
10009
|
},
|
|
9997
|
-
/* @__PURE__ */
|
|
10010
|
+
/* @__PURE__ */ React111.createElement(Header, { className: `Layer__${COMPONENT_NAME5}__header` }, /* @__PURE__ */ React111.createElement(Heading, { className: `Layer__${COMPONENT_NAME5}__title` }, "Journal"), /* @__PURE__ */ React111.createElement("div", { className: `Layer__${COMPONENT_NAME5}__actions` }, /* @__PURE__ */ React111.createElement(
|
|
9998
10011
|
Button,
|
|
9999
10012
|
{
|
|
10000
10013
|
variant: "secondary" /* secondary */,
|
|
10001
10014
|
disabled: isLoading,
|
|
10002
|
-
rightIcon: /* @__PURE__ */
|
|
10015
|
+
rightIcon: /* @__PURE__ */ React111.createElement(DownloadCloud_default, { size: 12 })
|
|
10003
10016
|
},
|
|
10004
10017
|
"Download"
|
|
10005
|
-
), /* @__PURE__ */
|
|
10006
|
-
/* @__PURE__ */
|
|
10007
|
-
return /* @__PURE__ */
|
|
10018
|
+
), /* @__PURE__ */ React111.createElement(Button, { onClick: () => addEntry(), disabled: isLoading }, "Add Entry"))),
|
|
10019
|
+
/* @__PURE__ */ React111.createElement("table", { className: "Layer__table Layer__table--hover-effect Layer__journal__table" }, /* @__PURE__ */ React111.createElement("thead", null, /* @__PURE__ */ React111.createElement("tr", null, /* @__PURE__ */ React111.createElement("th", { className: "Layer__table-header" }), /* @__PURE__ */ React111.createElement("th", { className: "Layer__table-header" }, "Id"), /* @__PURE__ */ React111.createElement("th", { className: "Layer__table-header" }, "Date"), /* @__PURE__ */ React111.createElement("th", { className: "Layer__table-header" }, "Transaction"), /* @__PURE__ */ React111.createElement("th", { className: "Layer__table-header" }, "Account"), /* @__PURE__ */ React111.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Debit"), /* @__PURE__ */ React111.createElement("th", { className: "Layer__table-header Layer__table-cell--amount" }, "Credit"))), /* @__PURE__ */ React111.createElement("tbody", null, !error && data?.map((entry, idx) => {
|
|
10020
|
+
return /* @__PURE__ */ React111.createElement(
|
|
10008
10021
|
JournalRow,
|
|
10009
10022
|
{
|
|
10010
10023
|
key: "journal-row-" + idx + entry.id,
|
|
@@ -10014,7 +10027,7 @@ var JournalTable = ({
|
|
|
10014
10027
|
}
|
|
10015
10028
|
);
|
|
10016
10029
|
}))),
|
|
10017
|
-
data && /* @__PURE__ */
|
|
10030
|
+
data && /* @__PURE__ */ React111.createElement("div", { className: "Layer__journal__pagination" }, /* @__PURE__ */ React111.createElement(
|
|
10018
10031
|
Pagination,
|
|
10019
10032
|
{
|
|
10020
10033
|
currentPage,
|
|
@@ -10023,7 +10036,7 @@ var JournalTable = ({
|
|
|
10023
10036
|
onPageChange: (page) => setCurrentPage(page)
|
|
10024
10037
|
}
|
|
10025
10038
|
)),
|
|
10026
|
-
error ? /* @__PURE__ */
|
|
10039
|
+
error ? /* @__PURE__ */ React111.createElement("div", { className: "Layer__table-state-container" }, /* @__PURE__ */ React111.createElement(
|
|
10027
10040
|
DataState,
|
|
10028
10041
|
{
|
|
10029
10042
|
status: "failed" /* failed */,
|
|
@@ -10033,7 +10046,7 @@ var JournalTable = ({
|
|
|
10033
10046
|
isLoading: isValidating || isLoading
|
|
10034
10047
|
}
|
|
10035
10048
|
)) : null,
|
|
10036
|
-
(!data || isLoading) && !error ? /* @__PURE__ */
|
|
10049
|
+
(!data || isLoading) && !error ? /* @__PURE__ */ React111.createElement("div", { className: `Layer__${COMPONENT_NAME5}__loader-container` }, /* @__PURE__ */ React111.createElement(Loader2, null)) : null
|
|
10037
10050
|
);
|
|
10038
10051
|
};
|
|
10039
10052
|
|
|
@@ -10046,7 +10059,7 @@ var JOURNAL_CONFIG = {
|
|
|
10046
10059
|
var Journal = (props) => {
|
|
10047
10060
|
const JournalContextData = useJournal();
|
|
10048
10061
|
const AccountsContextData = useChartOfAccounts();
|
|
10049
|
-
return /* @__PURE__ */
|
|
10062
|
+
return /* @__PURE__ */ React112.createElement(ChartOfAccountsContext.Provider, { value: AccountsContextData }, /* @__PURE__ */ React112.createElement(JournalContext.Provider, { value: JournalContextData }, /* @__PURE__ */ React112.createElement(JournalContent, { ...props })));
|
|
10050
10063
|
};
|
|
10051
10064
|
var JournalContent = ({
|
|
10052
10065
|
asWidget,
|
|
@@ -10064,18 +10077,18 @@ var JournalContent = ({
|
|
|
10064
10077
|
}
|
|
10065
10078
|
}
|
|
10066
10079
|
});
|
|
10067
|
-
return /* @__PURE__ */
|
|
10080
|
+
return /* @__PURE__ */ React112.createElement(Container, { name: "journal", ref: containerRef, asWidget }, /* @__PURE__ */ React112.createElement(JournalTable, { view, containerRef, config }));
|
|
10068
10081
|
};
|
|
10069
10082
|
|
|
10070
10083
|
// src/components/Onboarding/Onboarding.tsx
|
|
10071
|
-
import
|
|
10084
|
+
import React120, { useContext as useContext25, useEffect as useEffect21, useState as useState34 } from "react";
|
|
10072
10085
|
|
|
10073
10086
|
// src/components/Onboarding/ConnectAccount.tsx
|
|
10074
|
-
import
|
|
10087
|
+
import React119, { useContext as useContext24, useMemo as useMemo14 } from "react";
|
|
10075
10088
|
|
|
10076
10089
|
// src/icons/CreditCard.tsx
|
|
10077
|
-
import * as
|
|
10078
|
-
var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
10090
|
+
import * as React113 from "react";
|
|
10091
|
+
var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */ React113.createElement(
|
|
10079
10092
|
"svg",
|
|
10080
10093
|
{
|
|
10081
10094
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10085,7 +10098,7 @@ var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */ React112.createEle
|
|
|
10085
10098
|
width: size,
|
|
10086
10099
|
height: size
|
|
10087
10100
|
},
|
|
10088
|
-
/* @__PURE__ */
|
|
10101
|
+
/* @__PURE__ */ React113.createElement(
|
|
10089
10102
|
"path",
|
|
10090
10103
|
{
|
|
10091
10104
|
d: "M10.5 2H1.5C0.947715 2 0.5 2.44772 0.5 3V9C0.5 9.55228 0.947715 10 1.5 10H10.5C11.0523 10 11.5 9.55228 11.5 9V3C11.5 2.44772 11.0523 2 10.5 2Z",
|
|
@@ -10094,7 +10107,7 @@ var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */ React112.createEle
|
|
|
10094
10107
|
strokeLinejoin: "round"
|
|
10095
10108
|
}
|
|
10096
10109
|
),
|
|
10097
|
-
/* @__PURE__ */
|
|
10110
|
+
/* @__PURE__ */ React113.createElement(
|
|
10098
10111
|
"path",
|
|
10099
10112
|
{
|
|
10100
10113
|
d: "M0.5 5H11.5",
|
|
@@ -10107,8 +10120,8 @@ var CreditCard = ({ size = 12, ...props }) => /* @__PURE__ */ React112.createEle
|
|
|
10107
10120
|
var CreditCard_default = CreditCard;
|
|
10108
10121
|
|
|
10109
10122
|
// src/icons/Folder.tsx
|
|
10110
|
-
import * as
|
|
10111
|
-
var Folder = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
10123
|
+
import * as React114 from "react";
|
|
10124
|
+
var Folder = ({ size = 12, ...props }) => /* @__PURE__ */ React114.createElement(
|
|
10112
10125
|
"svg",
|
|
10113
10126
|
{
|
|
10114
10127
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10118,7 +10131,7 @@ var Folder = ({ size = 12, ...props }) => /* @__PURE__ */ React113.createElement
|
|
|
10118
10131
|
width: size,
|
|
10119
10132
|
height: size
|
|
10120
10133
|
},
|
|
10121
|
-
/* @__PURE__ */
|
|
10134
|
+
/* @__PURE__ */ React114.createElement(
|
|
10122
10135
|
"path",
|
|
10123
10136
|
{
|
|
10124
10137
|
d: "M11 9.5C11 9.76522 10.8946 10.0196 10.7071 10.2071C10.5196 10.3946 10.2652 10.5 10 10.5H2C1.73478 10.5 1.48043 10.3946 1.29289 10.2071C1.10536 10.0196 1 9.76522 1 9.5V2.5C1 2.23478 1.10536 1.98043 1.29289 1.79289C1.48043 1.60536 1.73478 1.5 2 1.5H4.5L5.5 3H10C10.2652 3 10.5196 3.10536 10.7071 3.29289C10.8946 3.48043 11 3.73478 11 4V9.5Z",
|
|
@@ -10131,8 +10144,8 @@ var Folder = ({ size = 12, ...props }) => /* @__PURE__ */ React113.createElement
|
|
|
10131
10144
|
var Folder_default = Folder;
|
|
10132
10145
|
|
|
10133
10146
|
// src/icons/Link.tsx
|
|
10134
|
-
import * as
|
|
10135
|
-
var Link = ({ size = 18, ...props }) => /* @__PURE__ */
|
|
10147
|
+
import * as React115 from "react";
|
|
10148
|
+
var Link = ({ size = 18, ...props }) => /* @__PURE__ */ React115.createElement(
|
|
10136
10149
|
"svg",
|
|
10137
10150
|
{
|
|
10138
10151
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10142,7 +10155,7 @@ var Link = ({ size = 18, ...props }) => /* @__PURE__ */ React114.createElement(
|
|
|
10142
10155
|
width: size,
|
|
10143
10156
|
height: size
|
|
10144
10157
|
},
|
|
10145
|
-
/* @__PURE__ */
|
|
10158
|
+
/* @__PURE__ */ React115.createElement(
|
|
10146
10159
|
"path",
|
|
10147
10160
|
{
|
|
10148
10161
|
d: "M7.5 9.75C7.82209 10.1806 8.23302 10.5369 8.70491 10.7947C9.17681 11.0525 9.69863 11.2058 10.235 11.2442C10.7713 11.2827 11.3097 11.2053 11.8135 11.0173C12.3173 10.8294 12.7748 10.5353 13.155 10.155L15.405 7.905C16.0881 7.19774 16.4661 6.25048 16.4575 5.26724C16.449 4.284 16.0546 3.34346 15.3593 2.64818C14.664 1.9529 13.7235 1.55851 12.7403 1.54997C11.757 1.54143 10.8098 1.9194 10.1025 2.6025L8.8125 3.885",
|
|
@@ -10151,7 +10164,7 @@ var Link = ({ size = 18, ...props }) => /* @__PURE__ */ React114.createElement(
|
|
|
10151
10164
|
strokeLinejoin: "round"
|
|
10152
10165
|
}
|
|
10153
10166
|
),
|
|
10154
|
-
/* @__PURE__ */
|
|
10167
|
+
/* @__PURE__ */ React115.createElement(
|
|
10155
10168
|
"path",
|
|
10156
10169
|
{
|
|
10157
10170
|
d: "M10.5 8.25C10.1779 7.8194 9.76698 7.46311 9.29508 7.2053C8.82319 6.94748 8.30137 6.79416 7.76501 6.75575C7.22865 6.71734 6.69031 6.79473 6.18649 6.98266C5.68267 7.1706 5.22516 7.4647 4.845 7.845L2.595 10.095C1.9119 10.8023 1.53393 11.7495 1.54247 12.7328C1.55101 13.716 1.9454 14.6565 2.64068 15.3518C3.33596 16.0471 4.2765 16.4415 5.25974 16.45C6.24298 16.4586 7.19024 16.0806 7.8975 15.3975L9.18 14.115",
|
|
@@ -10164,9 +10177,9 @@ var Link = ({ size = 18, ...props }) => /* @__PURE__ */ React114.createElement(
|
|
|
10164
10177
|
var Link_default = Link;
|
|
10165
10178
|
|
|
10166
10179
|
// src/icons/PlaidIcon.tsx
|
|
10167
|
-
import
|
|
10180
|
+
import React116 from "react";
|
|
10168
10181
|
var PlaidIcon = () => {
|
|
10169
|
-
return /* @__PURE__ */
|
|
10182
|
+
return /* @__PURE__ */ React116.createElement(
|
|
10170
10183
|
"img",
|
|
10171
10184
|
{
|
|
10172
10185
|
src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAhCAYAAAC4JqlRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQDSURBVHgB7VbpK65bFP+9XJTMJGPGDIVIpjIln2S4SIr4AxSOIZFwPxA+HUf5rhAZb3xQylCUizKLD+I1ROYpZcq+e63u+9S5t573XN1z3nvr/or97GVba+3fmrYGf8DBwSHx/f09VH7a4DvD2Nj414uLi1X61tAvOzu7z0KIT/iB0Gg0bdfX12UaafyTNP4ZBoB0okxja2u7L789YRhoyQEBA8IIBsZ/0wF7e3tYWVkpe2tra8hQ4iP46VsOWVpaIiYmBrGxsYiKikJERASWl5eRnZ0NU1NT9PX1ISwsDCsrK5iZmcHi4iKmpqbw+vqqV7feJCwsLERbW5uyX19fx/7+PjIyMrC5uQkTExP4+/tjZGQEvr6+CA4OVs6Wlpaiq6sLqiAH1H4GBgaEDqmpqYq8qalJkdfX1yvyrKwscXd3x/L+/n6hT79eBnZ3d3F6egobGxtInUhPT8f9/T3fWHfb7e1tpKSk8JmxsTGWPT4+wsnJCV5eXqoEqCYhUSo7JXp6epCWlkadC5OTkxgaGmLjFRUVKC8vR2BgIEZHR9k4OUlnJXOcnO7u7vhwCKqqqpjKxMRE3tOqQ3Nzs3KutbWVZU9PT0IywbKEhASW1dbWqoZAlQHKbEJISAiXXnt7O+/Pz8+Rn58PDw8PeHp6Ii8vDzLuMDMzQ0tLC988Li6Oz/r5+X2cARcXF7G1tcU3OTk54bWyslJIx8Tx8bGQ00wcHR2Jw8NDERoaKsrKyviMzBleZcUIZ2dnVQb0VkF0dLR4fn5mhbLeFXlBQYESDsnAX6rm5eWF/1efflUHXF1d+RY6BuSDRRQXF/NtdTe/ubnhb5JVV1d/xYCsDuHm5vZxB2QTYUU1NTVCxprDQU6QUR3tFA5y4OzsTKHdx8dHyOrgfW9v78eTcGdnh9e5uTlOMukI3t7euN47OztxcHAArVaL7u5uODo68lnJEGRuYHWVX1zcntWgOguothsbG5GcnIyHhwd0dHRA3hS3t7eoq6vD5eUlzM3NIalnQ9R0qPVSs4qPj2cd09PTaib0zwLq+9QJLSwseE/KZQgwPj6OgIAAlm1sbPBsIGbIaWpGxJisIm5matA7jicmJtgQ1XZJSQlTTsplbJUzw8PDzAr9raioiLtfUFAQT0R90DuOZ2dnkZOTwyOZDK2trWFvbw+ZmZk8AygnGhoaIBMS3t7eX01Dyh19+KY3IY3cpKQkREZGQrZjZfbn5ubyzB8cHER4eDiWlpawsLDAhufn5zlv/hEH/gzdZKRQEIgdephcXV3h7+L/V/G/wgEtDAetkUymLzAQyLaxfMX8JtspPeqj8QMhn3dfZEf9RaMTyNIKNTIy+hnfGXKa3splVXbOGdr/DtMw0L76HoUPAAAAAElFTkSuQmCC",
|
|
@@ -10177,8 +10190,8 @@ var PlaidIcon = () => {
|
|
|
10177
10190
|
var PlaidIcon_default = PlaidIcon;
|
|
10178
10191
|
|
|
10179
10192
|
// src/icons/Sunrise.tsx
|
|
10180
|
-
import * as
|
|
10181
|
-
var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */
|
|
10193
|
+
import * as React117 from "react";
|
|
10194
|
+
var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React117.createElement(
|
|
10182
10195
|
"svg",
|
|
10183
10196
|
{
|
|
10184
10197
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10188,7 +10201,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10188
10201
|
width: size,
|
|
10189
10202
|
height: size
|
|
10190
10203
|
},
|
|
10191
|
-
/* @__PURE__ */
|
|
10204
|
+
/* @__PURE__ */ React117.createElement(
|
|
10192
10205
|
"path",
|
|
10193
10206
|
{
|
|
10194
10207
|
d: "M8.5 9C8.5 8.33696 8.23661 7.70107 7.76777 7.23223C7.29893 6.76339 6.66304 6.5 6 6.5C5.33696 6.5 4.70107 6.76339 4.23223 7.23223C3.76339 7.70107 3.5 8.33696 3.5 9",
|
|
@@ -10197,7 +10210,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10197
10210
|
strokeLinejoin: "round"
|
|
10198
10211
|
}
|
|
10199
10212
|
),
|
|
10200
|
-
/* @__PURE__ */
|
|
10213
|
+
/* @__PURE__ */ React117.createElement(
|
|
10201
10214
|
"path",
|
|
10202
10215
|
{
|
|
10203
10216
|
d: "M6 3.3335V4.66683",
|
|
@@ -10206,7 +10219,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10206
10219
|
strokeLinejoin: "round"
|
|
10207
10220
|
}
|
|
10208
10221
|
),
|
|
10209
|
-
/* @__PURE__ */
|
|
10222
|
+
/* @__PURE__ */ React117.createElement(
|
|
10210
10223
|
"path",
|
|
10211
10224
|
{
|
|
10212
10225
|
d: "M2.11 5.10986L2.82 5.81986",
|
|
@@ -10215,7 +10228,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10215
10228
|
strokeLinejoin: "round"
|
|
10216
10229
|
}
|
|
10217
10230
|
),
|
|
10218
|
-
/* @__PURE__ */
|
|
10231
|
+
/* @__PURE__ */ React117.createElement(
|
|
10219
10232
|
"path",
|
|
10220
10233
|
{
|
|
10221
10234
|
d: "M0.5 9H1.5",
|
|
@@ -10224,7 +10237,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10224
10237
|
strokeLinejoin: "round"
|
|
10225
10238
|
}
|
|
10226
10239
|
),
|
|
10227
|
-
/* @__PURE__ */
|
|
10240
|
+
/* @__PURE__ */ React117.createElement(
|
|
10228
10241
|
"path",
|
|
10229
10242
|
{
|
|
10230
10243
|
d: "M10.5 9H11.5",
|
|
@@ -10233,7 +10246,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10233
10246
|
strokeLinejoin: "round"
|
|
10234
10247
|
}
|
|
10235
10248
|
),
|
|
10236
|
-
/* @__PURE__ */
|
|
10249
|
+
/* @__PURE__ */ React117.createElement(
|
|
10237
10250
|
"path",
|
|
10238
10251
|
{
|
|
10239
10252
|
d: "M9.17999 5.81986L9.88999 5.10986",
|
|
@@ -10242,7 +10255,7 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10242
10255
|
strokeLinejoin: "round"
|
|
10243
10256
|
}
|
|
10244
10257
|
),
|
|
10245
|
-
/* @__PURE__ */
|
|
10258
|
+
/* @__PURE__ */ React117.createElement(
|
|
10246
10259
|
"path",
|
|
10247
10260
|
{
|
|
10248
10261
|
d: "M11.5 11H0.5",
|
|
@@ -10255,19 +10268,19 @@ var Sunrise = ({ size = 12, ...props }) => /* @__PURE__ */ React116.createElemen
|
|
|
10255
10268
|
var Sunrise_default = Sunrise;
|
|
10256
10269
|
|
|
10257
10270
|
// src/components/ActionableRow/ActionableRow.tsx
|
|
10258
|
-
import
|
|
10271
|
+
import React118 from "react";
|
|
10259
10272
|
var renderIcon = (icon, iconBox) => {
|
|
10260
10273
|
if (iconBox) {
|
|
10261
10274
|
return iconBox;
|
|
10262
10275
|
}
|
|
10263
10276
|
if (icon) {
|
|
10264
|
-
return /* @__PURE__ */
|
|
10277
|
+
return /* @__PURE__ */ React118.createElement("span", { className: "Layer__actionable_row__icon" }, icon);
|
|
10265
10278
|
}
|
|
10266
10279
|
return;
|
|
10267
10280
|
};
|
|
10268
10281
|
var renderTitle = (title) => {
|
|
10269
10282
|
if (title && typeof title === "string") {
|
|
10270
|
-
return /* @__PURE__ */
|
|
10283
|
+
return /* @__PURE__ */ React118.createElement(Text, { className: "Layer__actionable_row__title" }, title);
|
|
10271
10284
|
}
|
|
10272
10285
|
if (title) {
|
|
10273
10286
|
return title;
|
|
@@ -10276,7 +10289,7 @@ var renderTitle = (title) => {
|
|
|
10276
10289
|
};
|
|
10277
10290
|
var renderDescription = (description) => {
|
|
10278
10291
|
if (description && typeof description === "string") {
|
|
10279
|
-
return /* @__PURE__ */
|
|
10292
|
+
return /* @__PURE__ */ React118.createElement(Text, { className: "Layer__actionable_row__description" }, description);
|
|
10280
10293
|
}
|
|
10281
10294
|
if (description) {
|
|
10282
10295
|
return description;
|
|
@@ -10291,11 +10304,11 @@ var ActionableRow = ({
|
|
|
10291
10304
|
button,
|
|
10292
10305
|
onClick
|
|
10293
10306
|
}) => {
|
|
10294
|
-
return /* @__PURE__ */
|
|
10307
|
+
return /* @__PURE__ */ React118.createElement("div", { className: "Layer__actionable_row" }, /* @__PURE__ */ React118.createElement("div", { className: "Layer__actionable_row__main" }, renderIcon(icon, iconBox), /* @__PURE__ */ React118.createElement("div", { className: "Layer__actionable_row__main__text" }, renderTitle(title), renderDescription(description))), /* @__PURE__ */ React118.createElement("div", { className: "Layer__actionable_row__action" }, button && button, !button && onClick ? /* @__PURE__ */ React118.createElement(
|
|
10295
10308
|
IconButton,
|
|
10296
10309
|
{
|
|
10297
10310
|
onClick,
|
|
10298
|
-
icon: /* @__PURE__ */
|
|
10311
|
+
icon: /* @__PURE__ */ React118.createElement(ChevronRight_default, { size: 11 }),
|
|
10299
10312
|
withBorder: true
|
|
10300
10313
|
}
|
|
10301
10314
|
) : null));
|
|
@@ -10315,44 +10328,44 @@ var ConnectAccount = ({
|
|
|
10315
10328
|
return 0;
|
|
10316
10329
|
}, [data, isLoading]);
|
|
10317
10330
|
if (onboardingStep === "connectAccount") {
|
|
10318
|
-
return /* @__PURE__ */
|
|
10331
|
+
return /* @__PURE__ */ React119.createElement(React119.Fragment, null, /* @__PURE__ */ React119.createElement(
|
|
10319
10332
|
DataState,
|
|
10320
10333
|
{
|
|
10321
10334
|
status: "info" /* info */,
|
|
10322
|
-
icon: /* @__PURE__ */
|
|
10335
|
+
icon: /* @__PURE__ */ React119.createElement(CreditCard_default, { size: 12 }),
|
|
10323
10336
|
title: "No accounts connected",
|
|
10324
10337
|
description: "Populate your accounting dashboard in 3 steps"
|
|
10325
10338
|
}
|
|
10326
|
-
), /* @__PURE__ */
|
|
10339
|
+
), /* @__PURE__ */ React119.createElement(
|
|
10327
10340
|
ActionableRow,
|
|
10328
10341
|
{
|
|
10329
|
-
iconBox: /* @__PURE__ */
|
|
10342
|
+
iconBox: /* @__PURE__ */ React119.createElement(PlaidIcon_default, null),
|
|
10330
10343
|
title: "Connect accounts",
|
|
10331
10344
|
description: "Import data with one simple integration.",
|
|
10332
|
-
button: /* @__PURE__ */
|
|
10345
|
+
button: /* @__PURE__ */ React119.createElement(
|
|
10333
10346
|
Button,
|
|
10334
10347
|
{
|
|
10335
10348
|
onClick: () => addConnection("PLAID"),
|
|
10336
|
-
rightIcon: /* @__PURE__ */
|
|
10349
|
+
rightIcon: /* @__PURE__ */ React119.createElement(Link_default, { size: 12 })
|
|
10337
10350
|
},
|
|
10338
10351
|
"Connect"
|
|
10339
10352
|
)
|
|
10340
10353
|
}
|
|
10341
10354
|
));
|
|
10342
10355
|
}
|
|
10343
|
-
return /* @__PURE__ */
|
|
10356
|
+
return /* @__PURE__ */ React119.createElement(React119.Fragment, null, /* @__PURE__ */ React119.createElement(
|
|
10344
10357
|
DataState,
|
|
10345
10358
|
{
|
|
10346
10359
|
status: "success" /* success */,
|
|
10347
|
-
icon: /* @__PURE__ */
|
|
10360
|
+
icon: /* @__PURE__ */ React119.createElement(Sunrise_default, { size: 12 }),
|
|
10348
10361
|
title: "Account linked successfully",
|
|
10349
10362
|
description: "Your transactions are now available on the platform, to see all data on the charts, categorise transactions."
|
|
10350
10363
|
}
|
|
10351
|
-
), onTransactionsToReviewClick && transactionsToReview > 0 ? /* @__PURE__ */
|
|
10364
|
+
), onTransactionsToReviewClick && transactionsToReview > 0 ? /* @__PURE__ */ React119.createElement(
|
|
10352
10365
|
ActionableRow,
|
|
10353
10366
|
{
|
|
10354
|
-
icon: /* @__PURE__ */
|
|
10355
|
-
title: /* @__PURE__ */
|
|
10367
|
+
icon: /* @__PURE__ */ React119.createElement(Folder_default, { size: 12 }),
|
|
10368
|
+
title: /* @__PURE__ */ React119.createElement(Text, null, "Categorise transactions", " ", /* @__PURE__ */ React119.createElement(Badge, { variant: "warning" /* WARNING */, size: "small" /* SMALL */ }, transactionsToReview, " pending")),
|
|
10356
10369
|
description: "Once your data is on the platform categorize them in Bank Transactions tab",
|
|
10357
10370
|
onClick: () => onTransactionsToReviewClick()
|
|
10358
10371
|
}
|
|
@@ -10372,7 +10385,7 @@ var EXPANDED_STYLE3 = {
|
|
|
10372
10385
|
transform: "scale(1)",
|
|
10373
10386
|
overflow: "hidden"
|
|
10374
10387
|
};
|
|
10375
|
-
var Onboarding = (props) => /* @__PURE__ */
|
|
10388
|
+
var Onboarding = (props) => /* @__PURE__ */ React120.createElement(LinkedAccountsProvider, null, /* @__PURE__ */ React120.createElement(OnboardingContent, { ...props }));
|
|
10376
10389
|
var OnboardingContent = ({
|
|
10377
10390
|
onTransactionsToReviewClick
|
|
10378
10391
|
}) => {
|
|
@@ -10400,7 +10413,7 @@ var OnboardingContent = ({
|
|
|
10400
10413
|
if (!onboardingStep) {
|
|
10401
10414
|
return null;
|
|
10402
10415
|
}
|
|
10403
|
-
return /* @__PURE__ */
|
|
10416
|
+
return /* @__PURE__ */ React120.createElement(Container, { name: "onboarding", style }, /* @__PURE__ */ React120.createElement("div", { className: "Layer__onboarding__content" }, /* @__PURE__ */ React120.createElement(
|
|
10404
10417
|
ConnectAccount,
|
|
10405
10418
|
{
|
|
10406
10419
|
onboardingStep,
|
|
@@ -10410,14 +10423,14 @@ var OnboardingContent = ({
|
|
|
10410
10423
|
};
|
|
10411
10424
|
|
|
10412
10425
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
10413
|
-
import
|
|
10426
|
+
import React127, { useState as useState36 } from "react";
|
|
10414
10427
|
|
|
10415
10428
|
// src/components/TransactionToReviewCard/TransactionToReviewCard.tsx
|
|
10416
|
-
import
|
|
10429
|
+
import React124, { useEffect as useEffect22, useMemo as useMemo15, useState as useState35 } from "react";
|
|
10417
10430
|
|
|
10418
10431
|
// src/icons/Bell.tsx
|
|
10419
|
-
import * as
|
|
10420
|
-
var Bell = ({ size = 18, ...props }) => /* @__PURE__ */
|
|
10432
|
+
import * as React121 from "react";
|
|
10433
|
+
var Bell = ({ size = 18, ...props }) => /* @__PURE__ */ React121.createElement(
|
|
10421
10434
|
"svg",
|
|
10422
10435
|
{
|
|
10423
10436
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10427,7 +10440,7 @@ var Bell = ({ size = 18, ...props }) => /* @__PURE__ */ React120.createElement(
|
|
|
10427
10440
|
width: size,
|
|
10428
10441
|
height: size
|
|
10429
10442
|
},
|
|
10430
|
-
/* @__PURE__ */
|
|
10443
|
+
/* @__PURE__ */ React121.createElement(
|
|
10431
10444
|
"path",
|
|
10432
10445
|
{
|
|
10433
10446
|
d: "M13.5 6C13.5 4.80653 13.0259 3.66193 12.182 2.81802C11.3381 1.97411 10.1935 1.5 9 1.5C7.80653 1.5 6.66193 1.97411 5.81802 2.81802C4.97411 3.66193 4.5 4.80653 4.5 6C4.5 11.25 2.25 12.75 2.25 12.75H15.75C15.75 12.75 13.5 11.25 13.5 6Z",
|
|
@@ -10436,7 +10449,7 @@ var Bell = ({ size = 18, ...props }) => /* @__PURE__ */ React120.createElement(
|
|
|
10436
10449
|
"stroke-linejoin": "round"
|
|
10437
10450
|
}
|
|
10438
10451
|
),
|
|
10439
|
-
/* @__PURE__ */
|
|
10452
|
+
/* @__PURE__ */ React121.createElement(
|
|
10440
10453
|
"path",
|
|
10441
10454
|
{
|
|
10442
10455
|
d: "M10.2975 15.75C10.1656 15.9773 9.97638 16.166 9.74867 16.2971C9.52096 16.4283 9.26278 16.4973 9 16.4973C8.73721 16.4973 8.47904 16.4283 8.25133 16.2971C8.02362 16.166 7.83436 15.9773 7.7025 15.75",
|
|
@@ -10449,23 +10462,23 @@ var Bell = ({ size = 18, ...props }) => /* @__PURE__ */ React120.createElement(
|
|
|
10449
10462
|
var Bell_default = Bell;
|
|
10450
10463
|
|
|
10451
10464
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
10452
|
-
import
|
|
10465
|
+
import React122 from "react";
|
|
10453
10466
|
var BadgeLoader = ({ children }) => {
|
|
10454
|
-
return /* @__PURE__ */
|
|
10467
|
+
return /* @__PURE__ */ React122.createElement("span", { className: "Layer__loader Layer__loader--as-badge" }, /* @__PURE__ */ React122.createElement(Loader_default, { size: 11, className: "Layer__anim--rotating" }), children);
|
|
10455
10468
|
};
|
|
10456
10469
|
|
|
10457
10470
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
10458
|
-
import
|
|
10471
|
+
import React123 from "react";
|
|
10459
10472
|
import classNames42 from "classnames";
|
|
10460
10473
|
var NotificationCard = ({
|
|
10461
10474
|
onClick,
|
|
10462
10475
|
children,
|
|
10463
10476
|
className
|
|
10464
10477
|
}) => {
|
|
10465
|
-
return /* @__PURE__ */
|
|
10478
|
+
return /* @__PURE__ */ React123.createElement("div", { className: classNames42("Layer__notification-card", className) }, /* @__PURE__ */ React123.createElement("div", { className: "Layer__notification-card__main" }, children), /* @__PURE__ */ React123.createElement(
|
|
10466
10479
|
IconButton,
|
|
10467
10480
|
{
|
|
10468
|
-
icon: /* @__PURE__ */
|
|
10481
|
+
icon: /* @__PURE__ */ React123.createElement(ChevronRight_default, null),
|
|
10469
10482
|
withBorder: true,
|
|
10470
10483
|
onClick: () => onClick()
|
|
10471
10484
|
}
|
|
@@ -10498,20 +10511,20 @@ var TransactionToReviewCard = ({
|
|
|
10498
10511
|
}
|
|
10499
10512
|
return 0;
|
|
10500
10513
|
}, [data, isLoading]);
|
|
10501
|
-
return /* @__PURE__ */
|
|
10514
|
+
return /* @__PURE__ */ React124.createElement(
|
|
10502
10515
|
NotificationCard,
|
|
10503
10516
|
{
|
|
10504
10517
|
className: "Layer__txs-to-review",
|
|
10505
10518
|
onClick: () => onClick && onClick()
|
|
10506
10519
|
},
|
|
10507
|
-
/* @__PURE__ */
|
|
10508
|
-
loaded === "initiated" || loaded === "loading" ? /* @__PURE__ */
|
|
10509
|
-
loaded === "complete" && error ? /* @__PURE__ */
|
|
10520
|
+
/* @__PURE__ */ React124.createElement(Text, { size: "sm" /* sm */ }, "Transactions to review"),
|
|
10521
|
+
loaded === "initiated" || loaded === "loading" ? /* @__PURE__ */ React124.createElement(BadgeLoader, null) : null,
|
|
10522
|
+
loaded === "complete" && error ? /* @__PURE__ */ React124.createElement(
|
|
10510
10523
|
Badge,
|
|
10511
10524
|
{
|
|
10512
10525
|
variant: "error" /* ERROR */,
|
|
10513
10526
|
size: "small" /* SMALL */,
|
|
10514
|
-
icon: /* @__PURE__ */
|
|
10527
|
+
icon: /* @__PURE__ */ React124.createElement(RefreshCcw_default, { size: 12 }),
|
|
10515
10528
|
onClick: () => {
|
|
10516
10529
|
setLoaded("loading");
|
|
10517
10530
|
refetch();
|
|
@@ -10519,22 +10532,22 @@ var TransactionToReviewCard = ({
|
|
|
10519
10532
|
},
|
|
10520
10533
|
"Refresh"
|
|
10521
10534
|
) : null,
|
|
10522
|
-
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */
|
|
10535
|
+
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ React124.createElement(
|
|
10523
10536
|
Badge,
|
|
10524
10537
|
{
|
|
10525
10538
|
variant: "warning" /* WARNING */,
|
|
10526
10539
|
size: "small" /* SMALL */,
|
|
10527
|
-
icon: /* @__PURE__ */
|
|
10540
|
+
icon: /* @__PURE__ */ React124.createElement(Bell_default, { size: 12 })
|
|
10528
10541
|
},
|
|
10529
10542
|
toReview,
|
|
10530
10543
|
" pending"
|
|
10531
10544
|
) : null,
|
|
10532
|
-
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */
|
|
10545
|
+
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ React124.createElement(
|
|
10533
10546
|
Badge,
|
|
10534
10547
|
{
|
|
10535
10548
|
variant: "success" /* SUCCESS */,
|
|
10536
10549
|
size: "small" /* SMALL */,
|
|
10537
|
-
icon: /* @__PURE__ */
|
|
10550
|
+
icon: /* @__PURE__ */ React124.createElement(Check_default, { size: 12 })
|
|
10538
10551
|
},
|
|
10539
10552
|
"All done"
|
|
10540
10553
|
) : null
|
|
@@ -10542,60 +10555,97 @@ var TransactionToReviewCard = ({
|
|
|
10542
10555
|
};
|
|
10543
10556
|
|
|
10544
10557
|
// src/components/View/View.tsx
|
|
10545
|
-
import
|
|
10558
|
+
import React126 from "react";
|
|
10546
10559
|
|
|
10547
10560
|
// src/components/ViewHeader/ViewHeader.tsx
|
|
10548
|
-
import
|
|
10561
|
+
import React125 from "react";
|
|
10549
10562
|
var ViewHeader = ({ title, controls }) => {
|
|
10550
|
-
return /* @__PURE__ */
|
|
10563
|
+
return /* @__PURE__ */ React125.createElement("div", { className: "Layer__view-header" }, /* @__PURE__ */ React125.createElement("div", { className: "Layer__view-header__content" }, /* @__PURE__ */ React125.createElement(Heading, null, title), controls && /* @__PURE__ */ React125.createElement("div", { className: "Layer__view-header__controls" }, controls)));
|
|
10551
10564
|
};
|
|
10552
10565
|
|
|
10553
10566
|
// src/components/View/View.tsx
|
|
10554
10567
|
var View3 = ({ title, children, headerControls }) => {
|
|
10555
10568
|
const { theme } = useLayerContext();
|
|
10556
10569
|
const styles = parseStylesFromThemeConfig(theme);
|
|
10557
|
-
return /* @__PURE__ */
|
|
10570
|
+
return /* @__PURE__ */ React126.createElement("div", { className: "Layer__view", style: { ...styles } }, /* @__PURE__ */ React126.createElement(ViewHeader, { title, controls: headerControls }), /* @__PURE__ */ React126.createElement("div", { className: "Layer__view-main" }, children));
|
|
10558
10571
|
};
|
|
10559
10572
|
|
|
10560
10573
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
10574
|
+
import classNames43 from "classnames";
|
|
10561
10575
|
var AccountingOverview = ({
|
|
10562
10576
|
title = "Accounting overview",
|
|
10563
10577
|
enableOnboarding = false,
|
|
10564
10578
|
onTransactionsToReviewClick
|
|
10565
10579
|
}) => {
|
|
10566
|
-
|
|
10580
|
+
const [pnlToggle, setPnlToggle] = useState36("revenue");
|
|
10581
|
+
return /* @__PURE__ */ React127.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React127.createElement(View3, { title, headerControls: /* @__PURE__ */ React127.createElement(ProfitAndLoss.DatePicker, null) }, enableOnboarding && /* @__PURE__ */ React127.createElement(Onboarding, null), /* @__PURE__ */ React127.createElement("div", { className: "Layer__accounting-overview__summaries-row" }, /* @__PURE__ */ React127.createElement(ProfitAndLoss.Summaries, { actionable: false }), /* @__PURE__ */ React127.createElement(TransactionToReviewCard, { onClick: onTransactionsToReviewClick })), /* @__PURE__ */ React127.createElement(
|
|
10567
10582
|
Container,
|
|
10568
10583
|
{
|
|
10569
10584
|
name: "accounting-overview-profit-and-loss",
|
|
10570
10585
|
asWidget: true,
|
|
10571
10586
|
elevated: true
|
|
10572
10587
|
},
|
|
10573
|
-
/* @__PURE__ */
|
|
10574
|
-
/* @__PURE__ */
|
|
10575
|
-
), /* @__PURE__ */
|
|
10588
|
+
/* @__PURE__ */ React127.createElement(Header, null, /* @__PURE__ */ React127.createElement(Heading, { size: "secondary" /* secondary */ }, "Profit & Loss")),
|
|
10589
|
+
/* @__PURE__ */ React127.createElement(ProfitAndLoss.Chart, null)
|
|
10590
|
+
), /* @__PURE__ */ React127.createElement("div", { className: "accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ React127.createElement(
|
|
10591
|
+
Toggle,
|
|
10592
|
+
{
|
|
10593
|
+
name: "pnl-detailed-charts",
|
|
10594
|
+
options: [
|
|
10595
|
+
{
|
|
10596
|
+
value: "revenue",
|
|
10597
|
+
label: "Revenue"
|
|
10598
|
+
},
|
|
10599
|
+
{
|
|
10600
|
+
value: "expenses",
|
|
10601
|
+
label: "Expenses"
|
|
10602
|
+
}
|
|
10603
|
+
],
|
|
10604
|
+
selected: pnlToggle,
|
|
10605
|
+
onChange: (e) => setPnlToggle(e.target.value)
|
|
10606
|
+
}
|
|
10607
|
+
), /* @__PURE__ */ React127.createElement(
|
|
10608
|
+
Container,
|
|
10609
|
+
{
|
|
10610
|
+
name: classNames43(
|
|
10611
|
+
"accounting-overview-profit-and-loss-chart",
|
|
10612
|
+
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
10613
|
+
)
|
|
10614
|
+
},
|
|
10615
|
+
/* @__PURE__ */ React127.createElement(ProfitAndLoss.DetailedCharts, { scope: "revenue", hideClose: true })
|
|
10616
|
+
), /* @__PURE__ */ React127.createElement(
|
|
10617
|
+
Container,
|
|
10618
|
+
{
|
|
10619
|
+
name: classNames43(
|
|
10620
|
+
"accounting-overview-profit-and-loss-chart",
|
|
10621
|
+
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
10622
|
+
)
|
|
10623
|
+
},
|
|
10624
|
+
/* @__PURE__ */ React127.createElement(ProfitAndLoss.DetailedCharts, { scope: "expenses", hideClose: true })
|
|
10625
|
+
))));
|
|
10576
10626
|
};
|
|
10577
10627
|
|
|
10578
10628
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|
|
10579
|
-
import
|
|
10629
|
+
import React128 from "react";
|
|
10580
10630
|
var BankTransactionsWithLinkedAccounts = ({
|
|
10581
10631
|
title = "Bank transactions",
|
|
10582
10632
|
elevatedLinkedAccounts = true,
|
|
10583
10633
|
showLedgerBalance = true
|
|
10584
10634
|
}) => {
|
|
10585
|
-
return /* @__PURE__ */
|
|
10635
|
+
return /* @__PURE__ */ React128.createElement(View3, { title }, /* @__PURE__ */ React128.createElement(
|
|
10586
10636
|
LinkedAccounts,
|
|
10587
10637
|
{
|
|
10588
10638
|
elevated: elevatedLinkedAccounts,
|
|
10589
10639
|
showLedgerBalance
|
|
10590
10640
|
}
|
|
10591
|
-
), /* @__PURE__ */
|
|
10641
|
+
), /* @__PURE__ */ React128.createElement(BankTransactions, { asWidget: true }));
|
|
10592
10642
|
};
|
|
10593
10643
|
|
|
10594
10644
|
// src/views/Reports/Reports.tsx
|
|
10595
|
-
import
|
|
10645
|
+
import React129, { useContext as useContext26, useRef as useRef15 } from "react";
|
|
10596
10646
|
var Reports = ({ title = "Reports" }) => {
|
|
10597
10647
|
const containerRef = useRef15(null);
|
|
10598
|
-
return /* @__PURE__ */
|
|
10648
|
+
return /* @__PURE__ */ React129.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React129.createElement(View3, { title, headerControls: /* @__PURE__ */ React129.createElement(ProfitAndLoss.DatePicker, null) }, /* @__PURE__ */ React129.createElement(
|
|
10599
10649
|
Toggle,
|
|
10600
10650
|
{
|
|
10601
10651
|
name: "reports-tabs",
|
|
@@ -10613,28 +10663,28 @@ var Reports = ({ title = "Reports" }) => {
|
|
|
10613
10663
|
selected: "profitAndLoss",
|
|
10614
10664
|
onChange: () => null
|
|
10615
10665
|
}
|
|
10616
|
-
), /* @__PURE__ */
|
|
10666
|
+
), /* @__PURE__ */ React129.createElement(Container, { name: "reports", ref: containerRef }, /* @__PURE__ */ React129.createElement(ReportsPanel, { containerRef }))));
|
|
10617
10667
|
};
|
|
10618
10668
|
var ReportsPanel = ({ containerRef }) => {
|
|
10619
10669
|
const { sidebarScope } = useContext26(ProfitAndLoss.Context);
|
|
10620
|
-
return /* @__PURE__ */
|
|
10670
|
+
return /* @__PURE__ */ React129.createElement(
|
|
10621
10671
|
Panel,
|
|
10622
10672
|
{
|
|
10623
|
-
sidebar: /* @__PURE__ */
|
|
10673
|
+
sidebar: /* @__PURE__ */ React129.createElement(ProfitAndLoss.DetailedCharts, null),
|
|
10624
10674
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
10625
10675
|
parentRef: containerRef
|
|
10626
10676
|
},
|
|
10627
|
-
/* @__PURE__ */
|
|
10677
|
+
/* @__PURE__ */ React129.createElement(ProfitAndLoss.Table, { asContainer: false })
|
|
10628
10678
|
);
|
|
10629
10679
|
};
|
|
10630
10680
|
|
|
10631
10681
|
// src/views/GeneralLedger/GeneralLedger.tsx
|
|
10632
|
-
import
|
|
10682
|
+
import React130, { useState as useState37 } from "react";
|
|
10633
10683
|
var GeneralLedgerView = ({
|
|
10634
10684
|
title = "General Ledger"
|
|
10635
10685
|
}) => {
|
|
10636
|
-
const [activeTab, setActiveTab] =
|
|
10637
|
-
return /* @__PURE__ */
|
|
10686
|
+
const [activeTab, setActiveTab] = useState37("chartOfAccounts");
|
|
10687
|
+
return /* @__PURE__ */ React130.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React130.createElement(View3, { title }, /* @__PURE__ */ React130.createElement(
|
|
10638
10688
|
Toggle,
|
|
10639
10689
|
{
|
|
10640
10690
|
name: "general-ledger-tabs",
|
|
@@ -10651,7 +10701,7 @@ var GeneralLedgerView = ({
|
|
|
10651
10701
|
selected: activeTab,
|
|
10652
10702
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
10653
10703
|
}
|
|
10654
|
-
), /* @__PURE__ */
|
|
10704
|
+
), /* @__PURE__ */ React130.createElement(Container, { name: "generalLedger" }, activeTab === "chartOfAccounts" ? /* @__PURE__ */ React130.createElement(ChartOfAccounts, { asWidget: true, withDateControl: true, withExpandAllButton: true }) : /* @__PURE__ */ React130.createElement(Journal, null))));
|
|
10655
10705
|
};
|
|
10656
10706
|
export {
|
|
10657
10707
|
AccountingOverview,
|
|
@@ -10660,6 +10710,7 @@ export {
|
|
|
10660
10710
|
BankTransactionsWithLinkedAccounts,
|
|
10661
10711
|
ChartOfAccounts,
|
|
10662
10712
|
GeneralLedgerView,
|
|
10713
|
+
Hello,
|
|
10663
10714
|
Journal,
|
|
10664
10715
|
LayerProvider,
|
|
10665
10716
|
LinkedAccounts,
|