@layerfi/components 0.1.87 → 0.1.88-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +134 -43
- package/dist/esm/index.mjs +365 -274
- package/dist/index.d.ts +72 -76
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -119,7 +119,7 @@ var import_react16 = require("react");
|
|
|
119
119
|
var import_react14 = require("react");
|
|
120
120
|
|
|
121
121
|
// package.json
|
|
122
|
-
var version = "0.1.
|
|
122
|
+
var version = "0.1.88-alpha";
|
|
123
123
|
|
|
124
124
|
// src/models/APIError.ts
|
|
125
125
|
var APIError = class _APIError extends Error {
|
|
@@ -341,7 +341,10 @@ var uploadBankTransactionDocument = (baseUrl, accessToken) => ({
|
|
|
341
341
|
var getBusiness = get(({ businessId }) => `/v1/businesses/${businessId}`);
|
|
342
342
|
|
|
343
343
|
// src/api/layer/categories.ts
|
|
344
|
-
var getCategories = get(({ businessId }) =>
|
|
344
|
+
var getCategories = get(({ businessId, mode }) => {
|
|
345
|
+
const parameters = toDefinedSearchParameters({ mode });
|
|
346
|
+
return `/v1/businesses/${businessId}/categories?${parameters}`;
|
|
347
|
+
});
|
|
345
348
|
|
|
346
349
|
// src/api/layer/chart_of_accounts.ts
|
|
347
350
|
var getChartOfAccounts = get(
|
|
@@ -3214,11 +3217,11 @@ var Loader_default = Loader;
|
|
|
3214
3217
|
var import_react22 = require("react");
|
|
3215
3218
|
|
|
3216
3219
|
// src/components/Tooltip/useTooltip.ts
|
|
3217
|
-
var import_react20 =
|
|
3220
|
+
var import_react20 = require("react");
|
|
3218
3221
|
var import_react21 = require("@floating-ui/react");
|
|
3219
|
-
var TooltipContext = import_react20.
|
|
3222
|
+
var TooltipContext = (0, import_react20.createContext)(null);
|
|
3220
3223
|
var useTooltipContext = () => {
|
|
3221
|
-
const context = import_react20.
|
|
3224
|
+
const context = (0, import_react20.useContext)(TooltipContext);
|
|
3222
3225
|
if (context == null) {
|
|
3223
3226
|
throw new Error("Tooltip components must be wrapped in <Tooltip />");
|
|
3224
3227
|
}
|
|
@@ -3271,7 +3274,7 @@ var useTooltip = ({
|
|
|
3271
3274
|
},
|
|
3272
3275
|
duration: 300
|
|
3273
3276
|
});
|
|
3274
|
-
return import_react20.
|
|
3277
|
+
return (0, import_react20.useMemo)(
|
|
3275
3278
|
() => __spreadValues(__spreadValues({
|
|
3276
3279
|
open,
|
|
3277
3280
|
setOpen,
|
|
@@ -5670,7 +5673,8 @@ function LinkedAccountToConfirm({
|
|
|
5670
5673
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(VStack, { children: [
|
|
5671
5674
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Heading2, { level: 3, size: "sm", children: account.external_account_name }),
|
|
5672
5675
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(P, { slot: "mask", children: [
|
|
5673
|
-
"\u2022\u2022\u2022
|
|
5676
|
+
"\u2022\u2022\u2022",
|
|
5677
|
+
" ",
|
|
5674
5678
|
account.mask
|
|
5675
5679
|
] }),
|
|
5676
5680
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(P, { slot: "institution", children: account.institution.name })
|
|
@@ -7669,7 +7673,7 @@ var ActionableList = ({
|
|
|
7669
7673
|
children: [
|
|
7670
7674
|
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "Layer__actionable-list__content", children: [
|
|
7671
7675
|
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { size: "sm" /* sm */, children: x.label }),
|
|
7672
|
-
/*TODO: Replace 'See all categories' with something more generic*/
|
|
7676
|
+
/* TODO: Replace 'See all categories' with something more generic */
|
|
7673
7677
|
showDescriptions && x.description && x.label !== "See all categories" && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
7674
7678
|
Text,
|
|
7675
7679
|
{
|
|
@@ -11462,7 +11466,7 @@ var SkeletonTableLoader = ({
|
|
|
11462
11466
|
{
|
|
11463
11467
|
colSpan: col.colSpan,
|
|
11464
11468
|
className: "Layer__skeleton-loader__row",
|
|
11465
|
-
children: col.colComponent ? col.colComponent : col.parts && col.parts > 1 ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "Layer__skeleton-loader__row__group", children:
|
|
11469
|
+
children: col.colComponent ? col.colComponent : col.parts && col.parts > 1 ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "Layer__skeleton-loader__row__group", children: Array(col.parts).map((_part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11466
11470
|
SkeletonLoader,
|
|
11467
11471
|
{
|
|
11468
11472
|
width: "100%",
|
|
@@ -15596,7 +15600,7 @@ var TableProvider = ({ children }) => {
|
|
|
15596
15600
|
};
|
|
15597
15601
|
|
|
15598
15602
|
// src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
|
|
15599
|
-
var import_react101 =
|
|
15603
|
+
var import_react101 = require("react");
|
|
15600
15604
|
|
|
15601
15605
|
// src/hooks/useTableExpandRow/useTableExpandRow.tsx
|
|
15602
15606
|
var import_react99 = require("react");
|
|
@@ -15922,7 +15926,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
15922
15926
|
}
|
|
15923
15927
|
const expandable = (lineItem == null ? void 0 : lineItem.line_items) && lineItem.line_items.length > 0 ? true : false;
|
|
15924
15928
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
15925
|
-
return /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_react101.
|
|
15929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_react101.Fragment, { children: [
|
|
15926
15930
|
/* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(
|
|
15927
15931
|
TableRow,
|
|
15928
15932
|
{
|
|
@@ -15956,7 +15960,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
15956
15960
|
return /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(Table, { borderCollapse: "collapse", bottomSpacing: false, children: [
|
|
15957
15961
|
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableHead, { children: compareOptions && compareOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(TableRow, { rowKey: "", children: [
|
|
15958
15962
|
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableCell, { isHeaderCell: true }),
|
|
15959
|
-
compareOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_react101.
|
|
15963
|
+
compareOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(import_react101.Fragment, { children: [
|
|
15960
15964
|
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableCell, { primary: true, isHeaderCell: true, children: option.displayName }, option + "-" + i),
|
|
15961
15965
|
compareMonths && Array.from({ length: compareMonths - 1 }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableCell, { isHeaderCell: true }, option + "-" + index))
|
|
15962
15966
|
] }, option + "-" + i))
|
|
@@ -15964,10 +15968,10 @@ var ProfitAndLossCompareTable = ({
|
|
|
15964
15968
|
/* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(TableBody, { children: [
|
|
15965
15969
|
compareMonths && /* @__PURE__ */ (0, import_jsx_runtime177.jsxs)(TableRow, { rowKey: "", children: [
|
|
15966
15970
|
/* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableCell, { isHeaderCell: true }),
|
|
15967
|
-
compareOptions && compareOptions.length > 0 ? compareOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react101.
|
|
15971
|
+
compareOptions && compareOptions.length > 0 ? compareOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react101.Fragment, { children: generatComparisonMonths(
|
|
15968
15972
|
dateRange.startDate,
|
|
15969
15973
|
compareMonths
|
|
15970
|
-
).map((month, index) => /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableCell, { isHeaderCell: true, children: month }, option + "-" + index)) }, option + "-" + i)) : /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react101.
|
|
15974
|
+
).map((month, index) => /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableCell, { isHeaderCell: true, children: month }, option + "-" + index)) }, option + "-" + i)) : /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_react101.Fragment, { children: generatComparisonMonths(
|
|
15971
15975
|
dateRange.startDate,
|
|
15972
15976
|
compareMonths
|
|
15973
15977
|
).map((month, index) => /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(TableCell, { isHeaderCell: true, children: month }, "total-" + index + "-cell")) }, "total-1")
|
|
@@ -15998,7 +16002,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
15998
16002
|
};
|
|
15999
16003
|
|
|
16000
16004
|
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
16001
|
-
var import_react102 =
|
|
16005
|
+
var import_react102 = require("react");
|
|
16002
16006
|
|
|
16003
16007
|
// src/icons/PieChart.tsx
|
|
16004
16008
|
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
@@ -16119,7 +16123,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
16119
16123
|
const renderLineItem = (lineItem, depth, rowKey, rowIndex, scope, setSidebarScope2, variant) => {
|
|
16120
16124
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
16121
16125
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
16122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)(import_react102.
|
|
16126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime179.jsxs)(import_react102.Fragment, { children: [
|
|
16123
16127
|
/* @__PURE__ */ (0, import_jsx_runtime179.jsxs)(
|
|
16124
16128
|
TableRow,
|
|
16125
16129
|
{
|
|
@@ -16229,8 +16233,8 @@ var ProfitAndLossTableComponent = ({
|
|
|
16229
16233
|
void 0,
|
|
16230
16234
|
"summation"
|
|
16231
16235
|
),
|
|
16232
|
-
data.personal_expenses ?
|
|
16233
|
-
data.other_outflows ?
|
|
16236
|
+
data.personal_expenses ? renderLineItem(data.personal_expenses, 0, "personal_expenses", 7) : null,
|
|
16237
|
+
data.other_outflows ? renderLineItem(data.other_outflows, 0, "other_outflows", 6) : null
|
|
16234
16238
|
] }) });
|
|
16235
16239
|
};
|
|
16236
16240
|
|
|
@@ -16416,7 +16420,7 @@ var BalanceSheetExpandAllButton = ({
|
|
|
16416
16420
|
};
|
|
16417
16421
|
|
|
16418
16422
|
// src/components/BalanceSheetTable/BalanceSheetTable.tsx
|
|
16419
|
-
var import_react108 =
|
|
16423
|
+
var import_react108 = require("react");
|
|
16420
16424
|
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
16421
16425
|
var BalanceSheetTable = ({
|
|
16422
16426
|
data,
|
|
@@ -16440,7 +16444,7 @@ var BalanceSheetTable = ({
|
|
|
16440
16444
|
if (expandable) {
|
|
16441
16445
|
allRowKeys.push(rowKey);
|
|
16442
16446
|
}
|
|
16443
|
-
return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(import_react108.
|
|
16447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(import_react108.Fragment, { children: [
|
|
16444
16448
|
/* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(
|
|
16445
16449
|
TableRow,
|
|
16446
16450
|
{
|
|
@@ -16491,7 +16495,7 @@ var BalanceSheetTable = ({
|
|
|
16491
16495
|
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(TableCell, { isHeaderCell: true, children: (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type" }),
|
|
16492
16496
|
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(TableCell, { isHeaderCell: true, align: "right" /* RIGHT */, children: (stringOverrides == null ? void 0 : stringOverrides.totalColumnHeader) || "Total" })
|
|
16493
16497
|
] }) }),
|
|
16494
|
-
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(TableBody, { children: config.map((row, idx) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_react108.
|
|
16498
|
+
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(TableBody, { children: config.map((row, idx) => /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_react108.Fragment, { children: data[row.lineItem] && renderLineItem(
|
|
16495
16499
|
data[row.lineItem],
|
|
16496
16500
|
0,
|
|
16497
16501
|
row.lineItem,
|
|
@@ -16531,7 +16535,7 @@ function useInvisibleDownload() {
|
|
|
16531
16535
|
const invisibleDownloadRef = (0, import_react109.useRef)(null);
|
|
16532
16536
|
const triggerInvisibleDownload = (0, import_react109.useCallback)((options) => {
|
|
16533
16537
|
var _a;
|
|
16534
|
-
(_a = invisibleDownloadRef.current) == null ? void 0 : _a.trigger(options);
|
|
16538
|
+
void ((_a = invisibleDownloadRef.current) == null ? void 0 : _a.trigger(options));
|
|
16535
16539
|
}, []);
|
|
16536
16540
|
return { invisibleDownloadRef, triggerInvisibleDownload };
|
|
16537
16541
|
}
|
|
@@ -16758,7 +16762,7 @@ var useStatementOfCashFlow = (startDate = /* @__PURE__ */ new Date(), endDate =
|
|
|
16758
16762
|
};
|
|
16759
16763
|
|
|
16760
16764
|
// src/components/StatementOfCashFlowTable/StatementOfCashFlowTable.tsx
|
|
16761
|
-
var import_react112 =
|
|
16765
|
+
var import_react112 = require("react");
|
|
16762
16766
|
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
16763
16767
|
var StatementOfCashFlowTable = ({
|
|
16764
16768
|
data,
|
|
@@ -16769,7 +16773,7 @@ var StatementOfCashFlowTable = ({
|
|
|
16769
16773
|
const renderLineItem = (lineItem, depth = 0, rowKey, rowIndex) => {
|
|
16770
16774
|
const expandable = !!lineItem.line_items && lineItem.line_items.length > 0;
|
|
16771
16775
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
16772
|
-
return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(import_react112.
|
|
16776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(import_react112.Fragment, { children: [
|
|
16773
16777
|
/* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(
|
|
16774
16778
|
TableRow,
|
|
16775
16779
|
{
|
|
@@ -16821,7 +16825,7 @@ var StatementOfCashFlowTable = ({
|
|
|
16821
16825
|
] }) }),
|
|
16822
16826
|
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(TableBody, { children: config.map((row, idx) => {
|
|
16823
16827
|
if (row.type === "line_item") {
|
|
16824
|
-
return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_react112.
|
|
16828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_react112.Fragment, { children: data[row.lineItem] && renderLineItem(
|
|
16825
16829
|
data[row.lineItem],
|
|
16826
16830
|
0,
|
|
16827
16831
|
row.lineItem ? row.lineItem : "",
|
|
@@ -18021,7 +18025,7 @@ var ChartOfAccountsSidebar = ({
|
|
|
18021
18025
|
};
|
|
18022
18026
|
|
|
18023
18027
|
// src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
|
|
18024
|
-
var import_react120 =
|
|
18028
|
+
var import_react120 = require("react");
|
|
18025
18029
|
|
|
18026
18030
|
// src/icons/Edit2.tsx
|
|
18027
18031
|
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
@@ -18111,7 +18115,7 @@ var ChartOfAccountsTableContent = ({
|
|
|
18111
18115
|
var _a, _b;
|
|
18112
18116
|
const expandable = !!account.sub_accounts && account.sub_accounts.length > 0;
|
|
18113
18117
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
18114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_react120.
|
|
18118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_react120.Fragment, { children: [
|
|
18115
18119
|
/* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
18116
18120
|
TableRow,
|
|
18117
18121
|
{
|
|
@@ -19654,7 +19658,56 @@ var import_react130 = require("react");
|
|
|
19654
19658
|
|
|
19655
19659
|
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
19656
19660
|
var import_react129 = require("react");
|
|
19661
|
+
|
|
19662
|
+
// src/hooks/categories/useAllCategories.ts
|
|
19663
|
+
var import_swr12 = __toESM(require("swr"));
|
|
19664
|
+
function buildKey7({
|
|
19665
|
+
access_token: accessToken,
|
|
19666
|
+
apiUrl,
|
|
19667
|
+
businessId
|
|
19668
|
+
}) {
|
|
19669
|
+
if (accessToken && apiUrl) {
|
|
19670
|
+
return {
|
|
19671
|
+
accessToken,
|
|
19672
|
+
apiUrl,
|
|
19673
|
+
businessId,
|
|
19674
|
+
mode: "ALL",
|
|
19675
|
+
tags: ["#categories"]
|
|
19676
|
+
};
|
|
19677
|
+
}
|
|
19678
|
+
}
|
|
19679
|
+
function useAllCategories() {
|
|
19680
|
+
const { data: auth } = useAuth();
|
|
19681
|
+
const { businessId } = useLayerContext();
|
|
19682
|
+
return (0, import_swr12.default)(
|
|
19683
|
+
() => buildKey7(__spreadProps(__spreadValues({}, auth), {
|
|
19684
|
+
businessId
|
|
19685
|
+
})),
|
|
19686
|
+
({ accessToken, apiUrl, businessId: businessId2, mode }) => getCategories(
|
|
19687
|
+
apiUrl,
|
|
19688
|
+
accessToken,
|
|
19689
|
+
{
|
|
19690
|
+
params: {
|
|
19691
|
+
businessId: businessId2,
|
|
19692
|
+
mode
|
|
19693
|
+
}
|
|
19694
|
+
}
|
|
19695
|
+
)().then(({ data }) => data.categories)
|
|
19696
|
+
);
|
|
19697
|
+
}
|
|
19698
|
+
|
|
19699
|
+
// src/components/JournalForm/JournalFormEntryLines.tsx
|
|
19657
19700
|
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
19701
|
+
function recursiveFlattenCategories(accounts) {
|
|
19702
|
+
const flattenedResult = accounts.flatMap((a) => {
|
|
19703
|
+
var _a;
|
|
19704
|
+
return [
|
|
19705
|
+
a,
|
|
19706
|
+
recursiveFlattenCategories((_a = a.subCategories) != null ? _a : [])
|
|
19707
|
+
];
|
|
19708
|
+
}).flat();
|
|
19709
|
+
return flattenedResult;
|
|
19710
|
+
}
|
|
19658
19711
|
var JournalFormEntryLines = ({
|
|
19659
19712
|
entrylineItems,
|
|
19660
19713
|
addEntryLine,
|
|
@@ -19663,9 +19716,47 @@ var JournalFormEntryLines = ({
|
|
|
19663
19716
|
sendingForm,
|
|
19664
19717
|
config
|
|
19665
19718
|
}) => {
|
|
19666
|
-
const { data
|
|
19719
|
+
const { data } = useAllCategories();
|
|
19667
19720
|
const { form } = (0, import_react129.useContext)(JournalContext);
|
|
19668
|
-
const parentOptions =
|
|
19721
|
+
const { flattenedCategories, parentOptions } = (0, import_react129.useMemo)(() => {
|
|
19722
|
+
const flattenedCategories2 = recursiveFlattenCategories(data != null ? data : []);
|
|
19723
|
+
const parentOptions2 = flattenedCategories2.sort((a, b) => a.display_name.localeCompare(b.display_name)).map(({ display_name, id }) => {
|
|
19724
|
+
return {
|
|
19725
|
+
label: display_name,
|
|
19726
|
+
value: id
|
|
19727
|
+
};
|
|
19728
|
+
});
|
|
19729
|
+
return { flattenedCategories: flattenedCategories2, parentOptions: parentOptions2 };
|
|
19730
|
+
}, [data]);
|
|
19731
|
+
const handleChangeParent = ({
|
|
19732
|
+
lineItemIndex,
|
|
19733
|
+
value
|
|
19734
|
+
}) => {
|
|
19735
|
+
var _a;
|
|
19736
|
+
const relevantCategory = flattenedCategories.find((x) => x.id === value.value);
|
|
19737
|
+
if (!relevantCategory) {
|
|
19738
|
+
return;
|
|
19739
|
+
}
|
|
19740
|
+
return changeFormData(
|
|
19741
|
+
"parent",
|
|
19742
|
+
value,
|
|
19743
|
+
lineItemIndex,
|
|
19744
|
+
[
|
|
19745
|
+
{
|
|
19746
|
+
id: relevantCategory.id,
|
|
19747
|
+
name: relevantCategory.display_name,
|
|
19748
|
+
stable_name: (_a = relevantCategory.stable_name) != null ? _a : "",
|
|
19749
|
+
account_type: {
|
|
19750
|
+
value: relevantCategory.id,
|
|
19751
|
+
display_name: relevantCategory.display_name
|
|
19752
|
+
},
|
|
19753
|
+
sub_accounts: [],
|
|
19754
|
+
balance: 0,
|
|
19755
|
+
normality: "DEBIT" /* DEBIT */
|
|
19756
|
+
}
|
|
19757
|
+
]
|
|
19758
|
+
);
|
|
19759
|
+
};
|
|
19669
19760
|
return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_jsx_runtime209.Fragment, { children: ["DEBIT", "CREDIT"].map((direction, idx) => {
|
|
19670
19761
|
return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
|
|
19671
19762
|
"div",
|
|
@@ -19678,9 +19769,11 @@ var JournalFormEntryLines = ({
|
|
|
19678
19769
|
className: "Layer__journal__form__input-group__title",
|
|
19679
19770
|
size: "lg" /* lg */,
|
|
19680
19771
|
children: [
|
|
19681
|
-
"Add
|
|
19772
|
+
"Add",
|
|
19773
|
+
" ",
|
|
19682
19774
|
humanizeEnum(direction),
|
|
19683
|
-
"
|
|
19775
|
+
" ",
|
|
19776
|
+
"Account"
|
|
19684
19777
|
]
|
|
19685
19778
|
}
|
|
19686
19779
|
),
|
|
@@ -19735,12 +19828,10 @@ var JournalFormEntryLines = ({
|
|
|
19735
19828
|
value: item.account_identifier.id,
|
|
19736
19829
|
label: item.account_identifier.name
|
|
19737
19830
|
},
|
|
19738
|
-
onChange: (
|
|
19739
|
-
|
|
19740
|
-
|
|
19741
|
-
|
|
19742
|
-
accountsData == null ? void 0 : accountsData.accounts
|
|
19743
|
-
),
|
|
19831
|
+
onChange: (value) => handleChangeParent({
|
|
19832
|
+
lineItemIndex: idx2,
|
|
19833
|
+
value
|
|
19834
|
+
}),
|
|
19744
19835
|
isInvalid: Boolean(
|
|
19745
19836
|
(_d = form == null ? void 0 : form.errors) == null ? void 0 : _d.lineItems.find(
|
|
19746
19837
|
(x) => x.id === idx2 && x.field === "account"
|
|
@@ -19954,7 +20045,7 @@ var JournalSidebar = ({
|
|
|
19954
20045
|
};
|
|
19955
20046
|
|
|
19956
20047
|
// src/components/JournalTable/JournalTable.tsx
|
|
19957
|
-
var import_react132 =
|
|
20048
|
+
var import_react132 = require("react");
|
|
19958
20049
|
var import_date_fns35 = require("date-fns");
|
|
19959
20050
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
19960
20051
|
var accountName = (row) => {
|
|
@@ -19992,7 +20083,7 @@ var JournalTableContent = ({
|
|
|
19992
20083
|
const renderJournalRow = (row, index, rowKey, depth) => {
|
|
19993
20084
|
const expandable = !!row.line_items && row.line_items.length > 0;
|
|
19994
20085
|
const expanded = expandable ? isOpen(rowKey) : true;
|
|
19995
|
-
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(import_react132.
|
|
20086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(import_react132.Fragment, { children: [
|
|
19996
20087
|
/* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(
|
|
19997
20088
|
TableRow,
|
|
19998
20089
|
{
|
|
@@ -20074,7 +20165,7 @@ var JournalTableContent = ({
|
|
|
20074
20165
|
|
|
20075
20166
|
// src/components/Journal/download/useJournalEntriesDownload.ts
|
|
20076
20167
|
var import_mutation6 = __toESM(require("swr/mutation"));
|
|
20077
|
-
function
|
|
20168
|
+
function buildKey8({
|
|
20078
20169
|
access_token: accessToken,
|
|
20079
20170
|
apiUrl,
|
|
20080
20171
|
businessId,
|
|
@@ -20100,7 +20191,7 @@ function useJournalEntriesDownload({
|
|
|
20100
20191
|
const { data: auth } = useAuth();
|
|
20101
20192
|
const { businessId } = useLayerContext();
|
|
20102
20193
|
return (0, import_mutation6.default)(
|
|
20103
|
-
() =>
|
|
20194
|
+
() => buildKey8(__spreadProps(__spreadValues({}, auth), {
|
|
20104
20195
|
businessId,
|
|
20105
20196
|
startCutoff,
|
|
20106
20197
|
endCutoff
|
|
@@ -20384,7 +20475,7 @@ var mockData = [
|
|
|
20384
20475
|
];
|
|
20385
20476
|
|
|
20386
20477
|
// src/hooks/useTasks/useTasks.tsx
|
|
20387
|
-
var
|
|
20478
|
+
var import_swr13 = __toESM(require("swr"));
|
|
20388
20479
|
var import_date_fns37 = require("date-fns");
|
|
20389
20480
|
var DEBUG_MODE = false;
|
|
20390
20481
|
var useTasks = ({
|
|
@@ -20401,7 +20492,7 @@ var useTasks = ({
|
|
|
20401
20492
|
});
|
|
20402
20493
|
const [currentDate, setCurrentDate] = (0, import_react135.useState)(/* @__PURE__ */ new Date());
|
|
20403
20494
|
const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `tasks-${businessId}-${dateRange.startDate}-${dateRange.endDate}`;
|
|
20404
|
-
const { data, isLoading, isValidating, error, mutate } = (0,
|
|
20495
|
+
const { data, isLoading, isValidating, error, mutate } = (0, import_swr13.default)(
|
|
20405
20496
|
queryKey,
|
|
20406
20497
|
Layer.getTasks(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
20407
20498
|
params: {
|