@layerfi/components 0.1.76 → 0.1.77
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/.eslintrc.js +21 -12
- package/dist/esm/index.js +162 -140
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +51 -40
- package/dist/index.js +91 -69
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +21 -4
- package/dist/styles/index.css.map +2 -2
- package/package.json +5 -7
- package/.prettierrc.json +0 -21
package/dist/index.js
CHANGED
|
@@ -640,7 +640,7 @@ var LayerContext = (0, import_react4.createContext)({
|
|
|
640
640
|
setOnboardingStep: () => void 0,
|
|
641
641
|
environment: "",
|
|
642
642
|
toasts: [],
|
|
643
|
-
addToast: (
|
|
643
|
+
addToast: (_toast) => void 0,
|
|
644
644
|
removeToast: () => void 0,
|
|
645
645
|
onError: () => void 0,
|
|
646
646
|
touch: () => void 0,
|
|
@@ -671,10 +671,10 @@ var Toast = (props) => {
|
|
|
671
671
|
/* @__PURE__ */ import_react5.default.createElement("p", null, content)
|
|
672
672
|
);
|
|
673
673
|
};
|
|
674
|
-
|
|
674
|
+
function ToastsContainer() {
|
|
675
675
|
const { toasts } = useLayerContext();
|
|
676
676
|
return /* @__PURE__ */ import_react5.default.createElement("div", { className: "Layer__toasts-container" }, toasts.map((toast, idx) => /* @__PURE__ */ import_react5.default.createElement(Toast, __spreadValues({ key: `layer-toast-${idx}` }, toast))));
|
|
677
|
-
}
|
|
677
|
+
}
|
|
678
678
|
|
|
679
679
|
// src/components/GlobalWidgets/GlobalWidgets.tsx
|
|
680
680
|
var DrawerWidget = () => {
|
|
@@ -1328,6 +1328,7 @@ var useLinkedAccounts = () => {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
});
|
|
1330
1330
|
const unlinkAccount2 = (source, accountId) => __async(void 0, null, function* () {
|
|
1331
|
+
DEBUG && console.debug("unlinking account");
|
|
1331
1332
|
if (source === "PLAID") {
|
|
1332
1333
|
yield Layer.unlinkAccount(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
1333
1334
|
params: { businessId, accountId }
|
|
@@ -1341,7 +1342,7 @@ var useLinkedAccounts = () => {
|
|
|
1341
1342
|
}
|
|
1342
1343
|
});
|
|
1343
1344
|
const confirmAccount = (source, accountId) => __async(void 0, null, function* () {
|
|
1344
|
-
DEBUG && console.
|
|
1345
|
+
DEBUG && console.debug("confirming account");
|
|
1345
1346
|
if (source === "PLAID") {
|
|
1346
1347
|
yield Layer.confirmConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
1347
1348
|
params: {
|
|
@@ -1358,7 +1359,7 @@ var useLinkedAccounts = () => {
|
|
|
1358
1359
|
}
|
|
1359
1360
|
});
|
|
1360
1361
|
const denyAccount = (source, accountId) => __async(void 0, null, function* () {
|
|
1361
|
-
DEBUG && console.
|
|
1362
|
+
DEBUG && console.debug("confirming account");
|
|
1362
1363
|
if (source === "PLAID") {
|
|
1363
1364
|
yield Layer.denyConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
1364
1365
|
params: {
|
|
@@ -1375,7 +1376,7 @@ var useLinkedAccounts = () => {
|
|
|
1375
1376
|
}
|
|
1376
1377
|
});
|
|
1377
1378
|
const breakConnection = (source, connectionExternalId) => __async(void 0, null, function* () {
|
|
1378
|
-
DEBUG && console.
|
|
1379
|
+
DEBUG && console.debug("Breaking sandbox plaid item connection");
|
|
1379
1380
|
if (source === "PLAID") {
|
|
1380
1381
|
yield Layer.breakPlaidItemConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
1381
1382
|
params: {
|
|
@@ -1392,23 +1393,23 @@ var useLinkedAccounts = () => {
|
|
|
1392
1393
|
}
|
|
1393
1394
|
});
|
|
1394
1395
|
const refetchAccounts = () => __async(void 0, null, function* () {
|
|
1395
|
-
DEBUG && console.
|
|
1396
|
+
DEBUG && console.debug("refetching accounts...");
|
|
1396
1397
|
yield mutate();
|
|
1397
1398
|
});
|
|
1398
1399
|
const syncAccounts = () => __async(void 0, null, function* () {
|
|
1399
|
-
DEBUG && console.
|
|
1400
|
+
DEBUG && console.debug("resyncing accounts...");
|
|
1400
1401
|
yield Layer.syncConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
1401
1402
|
params: { businessId }
|
|
1402
1403
|
});
|
|
1403
1404
|
});
|
|
1404
1405
|
const updateConnectionStatus2 = () => __async(void 0, null, function* () {
|
|
1405
|
-
DEBUG && console.
|
|
1406
|
+
DEBUG && console.debug("updating connection status...");
|
|
1406
1407
|
yield Layer.updateConnectionStatus(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
1407
1408
|
params: { businessId }
|
|
1408
1409
|
});
|
|
1409
1410
|
});
|
|
1410
1411
|
const unlinkPlaidItem2 = (plaidItemPlaidId) => __async(void 0, null, function* () {
|
|
1411
|
-
DEBUG && console.
|
|
1412
|
+
DEBUG && console.debug("unlinking plaid item");
|
|
1412
1413
|
yield Layer.unlinkPlaidItem(apiUrl, auth == null ? void 0 : auth.access_token, {
|
|
1413
1414
|
params: { businessId, plaidItemPlaidId }
|
|
1414
1415
|
});
|
|
@@ -2269,6 +2270,7 @@ var Container = (0, import_react17.forwardRef)(
|
|
|
2269
2270
|
);
|
|
2270
2271
|
}
|
|
2271
2272
|
);
|
|
2273
|
+
Container.displayName = "Container";
|
|
2272
2274
|
|
|
2273
2275
|
// src/components/Container/Header.tsx
|
|
2274
2276
|
var import_react18 = __toESM(require("react"));
|
|
@@ -2283,6 +2285,7 @@ var Header = (0, import_react18.forwardRef)(
|
|
|
2283
2285
|
return /* @__PURE__ */ import_react18.default.createElement("header", { ref, className: baseClassName, style }, children);
|
|
2284
2286
|
}
|
|
2285
2287
|
);
|
|
2288
|
+
Header.displayName = "Header";
|
|
2286
2289
|
|
|
2287
2290
|
// src/components/Onboarding/ConnectAccount.tsx
|
|
2288
2291
|
var import_react42 = __toESM(require("react"));
|
|
@@ -2812,7 +2815,7 @@ var TooltipTrigger = (0, import_react22.forwardRef)(function TooltipTrigger2(_a,
|
|
|
2812
2815
|
);
|
|
2813
2816
|
});
|
|
2814
2817
|
var TooltipContent = (0, import_react22.forwardRef)(function TooltipContent2(_a, propRef) {
|
|
2815
|
-
var _b = _a, {
|
|
2818
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2816
2819
|
const context = useTooltipContext();
|
|
2817
2820
|
const ref = (0, import_react23.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
2818
2821
|
if (!context.open || context.disabled)
|
|
@@ -2920,7 +2923,7 @@ var import_classnames5 = __toESM(require("classnames"));
|
|
|
2920
2923
|
var IconButton = (_a) => {
|
|
2921
2924
|
var _b = _a, {
|
|
2922
2925
|
className,
|
|
2923
|
-
children,
|
|
2926
|
+
children: _children,
|
|
2924
2927
|
icon,
|
|
2925
2928
|
active,
|
|
2926
2929
|
withBorder = false,
|
|
@@ -3020,7 +3023,7 @@ var RetryButton = (_a) => {
|
|
|
3020
3023
|
className,
|
|
3021
3024
|
processing,
|
|
3022
3025
|
disabled,
|
|
3023
|
-
error,
|
|
3026
|
+
error: _error,
|
|
3024
3027
|
children
|
|
3025
3028
|
} = _b, props = __objRest(_b, [
|
|
3026
3029
|
"className",
|
|
@@ -3285,11 +3288,9 @@ var import_classnames9 = __toESM(require("classnames"));
|
|
|
3285
3288
|
var BackButton = (_a) => {
|
|
3286
3289
|
var _b = _a, {
|
|
3287
3290
|
className,
|
|
3288
|
-
children,
|
|
3289
3291
|
textOnly = false
|
|
3290
3292
|
} = _b, props = __objRest(_b, [
|
|
3291
3293
|
"className",
|
|
3292
|
-
"children",
|
|
3293
3294
|
"textOnly"
|
|
3294
3295
|
]);
|
|
3295
3296
|
const baseClassName = (0, import_classnames9.default)("Layer__btn", "Layer__back-btn", className);
|
|
@@ -3340,11 +3341,9 @@ var import_classnames10 = __toESM(require("classnames"));
|
|
|
3340
3341
|
var CloseButton = (_a) => {
|
|
3341
3342
|
var _b = _a, {
|
|
3342
3343
|
className,
|
|
3343
|
-
children,
|
|
3344
3344
|
textOnly = false
|
|
3345
3345
|
} = _b, props = __objRest(_b, [
|
|
3346
3346
|
"className",
|
|
3347
|
-
"children",
|
|
3348
3347
|
"textOnly"
|
|
3349
3348
|
]);
|
|
3350
3349
|
const baseClassName = (0, import_classnames10.default)("Layer__btn", "Layer__back-btn", className);
|
|
@@ -3357,11 +3356,9 @@ var import_classnames11 = __toESM(require("classnames"));
|
|
|
3357
3356
|
var ExpandButton = (_a) => {
|
|
3358
3357
|
var _b = _a, {
|
|
3359
3358
|
className,
|
|
3360
|
-
children,
|
|
3361
3359
|
collapsed
|
|
3362
3360
|
} = _b, props = __objRest(_b, [
|
|
3363
3361
|
"className",
|
|
3364
|
-
"children",
|
|
3365
3362
|
"collapsed"
|
|
3366
3363
|
]);
|
|
3367
3364
|
const baseClassName = (0, import_classnames11.default)(
|
|
@@ -3688,9 +3685,9 @@ var TextWithTooltip = (_a) => {
|
|
|
3688
3685
|
as: Component2 = "p",
|
|
3689
3686
|
className,
|
|
3690
3687
|
children,
|
|
3691
|
-
size = "md" /* md */,
|
|
3692
|
-
weight = "normal" /* normal */,
|
|
3693
|
-
withTooltip = "whenTruncated" /* whenTruncated */,
|
|
3688
|
+
size: _size = "md" /* md */,
|
|
3689
|
+
weight: _weight = "normal" /* normal */,
|
|
3690
|
+
withTooltip: _withTooltip = "whenTruncated" /* whenTruncated */,
|
|
3694
3691
|
tooltipOptions
|
|
3695
3692
|
} = _b, props = __objRest(_b, [
|
|
3696
3693
|
"as",
|
|
@@ -5115,6 +5112,19 @@ var Scissors = (_a) => {
|
|
|
5115
5112
|
};
|
|
5116
5113
|
var Scissors_default = Scissors;
|
|
5117
5114
|
|
|
5115
|
+
// src/utils/styleUtils/toDataProperties.ts
|
|
5116
|
+
function toDataProperties(input) {
|
|
5117
|
+
const unsafeProperties = Object.fromEntries(
|
|
5118
|
+
Object.entries(input).map(([key, value]) => {
|
|
5119
|
+
if (typeof value !== "string" && typeof value !== "number" && value !== true) {
|
|
5120
|
+
return null;
|
|
5121
|
+
}
|
|
5122
|
+
return [`data-${key}`, value];
|
|
5123
|
+
}).filter((entry) => entry !== null)
|
|
5124
|
+
);
|
|
5125
|
+
return unsafeProperties;
|
|
5126
|
+
}
|
|
5127
|
+
|
|
5118
5128
|
// src/components/CategorySelect/CategorySelect.tsx
|
|
5119
5129
|
var import_react59 = __toESM(require("react"));
|
|
5120
5130
|
var import_react_select = __toESM(require("react-select"));
|
|
@@ -5433,7 +5443,7 @@ var import_classnames24 = __toESM(require("classnames"));
|
|
|
5433
5443
|
var CategorySelectDrawer = ({
|
|
5434
5444
|
onSelect,
|
|
5435
5445
|
selected,
|
|
5436
|
-
showTooltips
|
|
5446
|
+
showTooltips: _showTooltips
|
|
5437
5447
|
}) => {
|
|
5438
5448
|
var _a, _b;
|
|
5439
5449
|
const { setContent, close } = (0, import_react58.useContext)(DrawerContext);
|
|
@@ -6028,7 +6038,6 @@ var Eye_default = Eye;
|
|
|
6028
6038
|
var import_classnames26 = __toESM(require("classnames"));
|
|
6029
6039
|
var FileThumb = ({
|
|
6030
6040
|
url,
|
|
6031
|
-
type,
|
|
6032
6041
|
floatingActions = false,
|
|
6033
6042
|
uploadPending,
|
|
6034
6043
|
deletePending,
|
|
@@ -6419,6 +6428,7 @@ var BankTransactionReceiptsWithProvider = (0, import_react70.forwardRef)((_a, re
|
|
|
6419
6428
|
var _b = _a, { bankTransaction, isActive } = _b, props = __objRest(_b, ["bankTransaction", "isActive"]);
|
|
6420
6429
|
return /* @__PURE__ */ import_react70.default.createElement(ReceiptsProvider, { bankTransaction, isActive }, /* @__PURE__ */ import_react70.default.createElement(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })));
|
|
6421
6430
|
});
|
|
6431
|
+
BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
|
|
6422
6432
|
var BankTransactionReceipts = (0, import_react70.forwardRef)(
|
|
6423
6433
|
({
|
|
6424
6434
|
classNamePrefix = "Layer",
|
|
@@ -6460,6 +6470,7 @@ var BankTransactionReceipts = (0, import_react70.forwardRef)(
|
|
|
6460
6470
|
) : null);
|
|
6461
6471
|
}
|
|
6462
6472
|
);
|
|
6473
|
+
BankTransactionReceipts.displayName = "BankTransactionReceipts";
|
|
6463
6474
|
|
|
6464
6475
|
// src/components/MatchForm/MatchForm.tsx
|
|
6465
6476
|
var import_react72 = __toESM(require("react"));
|
|
@@ -6750,7 +6761,7 @@ var ToggleOption = ({
|
|
|
6750
6761
|
name,
|
|
6751
6762
|
onChange,
|
|
6752
6763
|
value,
|
|
6753
|
-
size,
|
|
6764
|
+
size: _size,
|
|
6754
6765
|
leftIcon,
|
|
6755
6766
|
disabled,
|
|
6756
6767
|
disabledMessage = "Disabled",
|
|
@@ -6949,8 +6960,7 @@ var ExpandedBankTransactionRow = (0, import_react77.forwardRef)(
|
|
|
6949
6960
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
6950
6961
|
const {
|
|
6951
6962
|
categorize: categorizeBankTransaction2,
|
|
6952
|
-
match: matchBankTransaction2
|
|
6953
|
-
updateOneLocal: updateBankTransaction
|
|
6963
|
+
match: matchBankTransaction2
|
|
6954
6964
|
} = useBankTransactionsContext();
|
|
6955
6965
|
const [purpose, setPurpose] = (0, import_react77.useState)(
|
|
6956
6966
|
bankTransaction.category ? "categorize" /* categorize */ : hasMatch(bankTransaction) ? "match" /* match */ : "categorize" /* categorize */
|
|
@@ -7063,19 +7073,15 @@ var ExpandedBankTransactionRow = (0, import_react77.forwardRef)(
|
|
|
7063
7073
|
};
|
|
7064
7074
|
const save = () => __async(void 0, null, function* () {
|
|
7065
7075
|
if (showDescriptions && memoText != void 0) {
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
},
|
|
7074
|
-
body: {
|
|
7075
|
-
memo: memoText
|
|
7076
|
-
}
|
|
7076
|
+
yield Layer.updateBankTransactionMetadata(apiUrl, auth.access_token, {
|
|
7077
|
+
params: {
|
|
7078
|
+
businessId,
|
|
7079
|
+
bankTransactionId: bankTransaction.id
|
|
7080
|
+
},
|
|
7081
|
+
body: {
|
|
7082
|
+
memo: memoText
|
|
7077
7083
|
}
|
|
7078
|
-
);
|
|
7084
|
+
});
|
|
7079
7085
|
}
|
|
7080
7086
|
if (purpose === "match" /* match */) {
|
|
7081
7087
|
if (!selectedMatchId) {
|
|
@@ -7389,6 +7395,7 @@ var ExpandedBankTransactionRow = (0, import_react77.forwardRef)(
|
|
|
7389
7395
|
);
|
|
7390
7396
|
}
|
|
7391
7397
|
);
|
|
7398
|
+
ExpandedBankTransactionRow.displayName = "ExpandedBankTransactionRow";
|
|
7392
7399
|
|
|
7393
7400
|
// src/components/IconBox/IconBox.tsx
|
|
7394
7401
|
var import_react78 = __toESM(require("react"));
|
|
@@ -7441,6 +7448,7 @@ var BankTransactionRow = ({
|
|
|
7441
7448
|
initialLoad,
|
|
7442
7449
|
showDescriptions,
|
|
7443
7450
|
showReceiptUploads,
|
|
7451
|
+
showReceiptUploadColumn,
|
|
7444
7452
|
showTooltips,
|
|
7445
7453
|
stringOverrides
|
|
7446
7454
|
}) => {
|
|
@@ -7527,6 +7535,10 @@ var BankTransactionRow = ({
|
|
|
7527
7535
|
initialLoad ? "initial-load" : "",
|
|
7528
7536
|
showComponent ? "show" : ""
|
|
7529
7537
|
);
|
|
7538
|
+
const showReceiptDataProperties = (0, import_react80.useMemo)(
|
|
7539
|
+
() => toDataProperties({ showReceiptUploadColumn }),
|
|
7540
|
+
[showReceiptUploadColumn]
|
|
7541
|
+
);
|
|
7530
7542
|
return /* @__PURE__ */ import_react80.default.createElement(import_react80.default.Fragment, null, /* @__PURE__ */ import_react80.default.createElement("tr", { className: rowClassName }, /* @__PURE__ */ import_react80.default.createElement(
|
|
7531
7543
|
"td",
|
|
7532
7544
|
__spreadValues({
|
|
@@ -7566,11 +7578,17 @@ var BankTransactionRow = ({
|
|
|
7566
7578
|
))
|
|
7567
7579
|
), /* @__PURE__ */ import_react80.default.createElement(
|
|
7568
7580
|
"td",
|
|
7569
|
-
__spreadValues({
|
|
7581
|
+
__spreadValues(__spreadValues({
|
|
7570
7582
|
className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
|
|
7571
|
-
}, openRow),
|
|
7583
|
+
}, openRow), showReceiptDataProperties),
|
|
7572
7584
|
/* @__PURE__ */ import_react80.default.createElement("span", { className: "Layer__table-cell-content" }, isCredit(bankTransaction) ? "+$" : " $", centsToDollars(bankTransaction.amount))
|
|
7573
|
-
), /* @__PURE__ */ import_react80.default.createElement(
|
|
7585
|
+
), /* @__PURE__ */ import_react80.default.createElement(
|
|
7586
|
+
"td",
|
|
7587
|
+
__spreadValues({
|
|
7588
|
+
className: "Layer__table-cell Layer__bank-transactions__documents-col"
|
|
7589
|
+
}, showReceiptDataProperties),
|
|
7590
|
+
showReceiptUploads && ((_c = bankTransaction.document_ids) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ import_react80.default.createElement("span", { className: "Layer__table-cell-content" }, /* @__PURE__ */ import_react80.default.createElement(IconBox, null, /* @__PURE__ */ import_react80.default.createElement(File_default, { size: 12 })))
|
|
7591
|
+
), /* @__PURE__ */ import_react80.default.createElement(
|
|
7574
7592
|
"td",
|
|
7575
7593
|
{
|
|
7576
7594
|
className: (0, import_classnames37.default)(
|
|
@@ -8224,7 +8242,6 @@ var isAlreadyAssigned = (bankTransaction) => {
|
|
|
8224
8242
|
var PersonalForm = ({
|
|
8225
8243
|
bankTransaction,
|
|
8226
8244
|
showReceiptUploads,
|
|
8227
|
-
isOpen,
|
|
8228
8245
|
showDescriptions
|
|
8229
8246
|
}) => {
|
|
8230
8247
|
var _a;
|
|
@@ -8444,8 +8461,7 @@ var SplitForm = ({
|
|
|
8444
8461
|
const receiptsRef = (0, import_react89.useRef)(null);
|
|
8445
8462
|
const {
|
|
8446
8463
|
categorize: categorizeBankTransaction2,
|
|
8447
|
-
isLoading
|
|
8448
|
-
error
|
|
8464
|
+
isLoading
|
|
8449
8465
|
} = useBankTransactionsContext();
|
|
8450
8466
|
const { memoText, setMemoText, saveMemoText } = useMemoTextContext();
|
|
8451
8467
|
const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_b = (_a = bankTransaction.categorization_flow) == null ? void 0 : _a.suggestions) == null ? void 0 : _b[0]);
|
|
@@ -8697,7 +8713,6 @@ var SplitAndMatchForm = ({
|
|
|
8697
8713
|
bankTransaction,
|
|
8698
8714
|
showTooltips,
|
|
8699
8715
|
showReceiptUploads,
|
|
8700
|
-
isOpen,
|
|
8701
8716
|
showDescriptions
|
|
8702
8717
|
}) => {
|
|
8703
8718
|
const anyMatch = hasMatch(bankTransaction);
|
|
@@ -8749,7 +8764,6 @@ var BankTransactionMobileForms = ({
|
|
|
8749
8764
|
{
|
|
8750
8765
|
bankTransaction,
|
|
8751
8766
|
showReceiptUploads,
|
|
8752
|
-
isOpen,
|
|
8753
8767
|
showDescriptions
|
|
8754
8768
|
}
|
|
8755
8769
|
);
|
|
@@ -8760,7 +8774,6 @@ var BankTransactionMobileForms = ({
|
|
|
8760
8774
|
bankTransaction,
|
|
8761
8775
|
showTooltips,
|
|
8762
8776
|
showReceiptUploads,
|
|
8763
|
-
isOpen,
|
|
8764
8777
|
showDescriptions
|
|
8765
8778
|
}
|
|
8766
8779
|
);
|
|
@@ -9169,14 +9182,35 @@ var BankTransactionsTable = ({
|
|
|
9169
9182
|
lastPage,
|
|
9170
9183
|
onRefresh
|
|
9171
9184
|
}) => {
|
|
9172
|
-
var _a, _b, _c, _d, _e, _f;
|
|
9185
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
9186
|
+
const showReceiptColumn = (_a = showReceiptUploads && (bankTransactions == null ? void 0 : bankTransactions.some(
|
|
9187
|
+
(transaction) => {
|
|
9188
|
+
var _a2;
|
|
9189
|
+
return ((_a2 = transaction.document_ids) == null ? void 0 : _a2.length) > 0;
|
|
9190
|
+
}
|
|
9191
|
+
))) != null ? _a : false;
|
|
9192
|
+
const showReceiptDataProperties = (0, import_react99.useMemo)(
|
|
9193
|
+
() => toDataProperties({ showReceiptUploadColumn: showReceiptColumn }),
|
|
9194
|
+
[showReceiptColumn]
|
|
9195
|
+
);
|
|
9173
9196
|
return /* @__PURE__ */ import_react99.default.createElement(
|
|
9174
9197
|
"table",
|
|
9175
9198
|
{
|
|
9176
9199
|
width: "100%",
|
|
9177
9200
|
className: "Layer__table Layer__bank-transactions__table with-cell-separators"
|
|
9178
9201
|
},
|
|
9179
|
-
/* @__PURE__ */ import_react99.default.createElement("thead", null, /* @__PURE__ */ import_react99.default.createElement("tr", null, /* @__PURE__ */ import_react99.default.createElement("th", { className: "Layer__table-header Layer__bank-transactions__date-col" }, ((
|
|
9202
|
+
/* @__PURE__ */ import_react99.default.createElement("thead", null, /* @__PURE__ */ import_react99.default.createElement("tr", null, /* @__PURE__ */ import_react99.default.createElement("th", { className: "Layer__table-header Layer__bank-transactions__date-col" }, ((_b = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _b.dateColumnHeaderText) || "Date"), /* @__PURE__ */ import_react99.default.createElement("th", { className: "Layer__table-header Layer__bank-transactions__tx-col" }, ((_c = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _c.transactionColumnHeaderText) || "Transaction"), /* @__PURE__ */ import_react99.default.createElement("th", { className: "Layer__table-header Layer__bank-transactions__account-col" }, ((_d = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _d.accountColumnHeaderText) || "Account"), /* @__PURE__ */ import_react99.default.createElement(
|
|
9203
|
+
"th",
|
|
9204
|
+
__spreadValues({
|
|
9205
|
+
className: "Layer__table-header Layer__table-cell--amount Layer__table-cell__amount-col"
|
|
9206
|
+
}, showReceiptDataProperties),
|
|
9207
|
+
((_e = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _e.amountColumnHeaderText) || "Amount"
|
|
9208
|
+
), /* @__PURE__ */ import_react99.default.createElement(
|
|
9209
|
+
"th",
|
|
9210
|
+
__spreadValues({
|
|
9211
|
+
className: "Layer__table-header Layer__bank-transactions__documents-col"
|
|
9212
|
+
}, showReceiptDataProperties)
|
|
9213
|
+
), categorizeView && editable ? /* @__PURE__ */ import_react99.default.createElement("th", { className: "Layer__table-header Layer__table-header--primary Layer__table-cell__category-col" }, ((_f = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _f.categorizeColumnHeaderText) || "Categorize") : /* @__PURE__ */ import_react99.default.createElement("th", { className: "Layer__table-header Layer__table-cell__category-col" }, ((_g = stringOverrides == null ? void 0 : stringOverrides.transactionsTable) == null ? void 0 : _g.categoryColumnHeaderText) || "Category"))),
|
|
9180
9214
|
isLoading && page && page === 1 ? /* @__PURE__ */ import_react99.default.createElement(BankTransactionsLoader, { isLoading: true, showTooltips }) : null,
|
|
9181
9215
|
/* @__PURE__ */ import_react99.default.createElement("tbody", null, !isLoading && (bankTransactions == null ? void 0 : bankTransactions.map(
|
|
9182
9216
|
(bankTransaction, index) => /* @__PURE__ */ import_react99.default.createElement(
|
|
@@ -9193,6 +9227,7 @@ var BankTransactionsTable = ({
|
|
|
9193
9227
|
containerWidth,
|
|
9194
9228
|
showDescriptions,
|
|
9195
9229
|
showReceiptUploads,
|
|
9230
|
+
showReceiptUploadColumn: showReceiptColumn,
|
|
9196
9231
|
showTooltips,
|
|
9197
9232
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.bankTransactionCTAs
|
|
9198
9233
|
}
|
|
@@ -9532,7 +9567,7 @@ var DatePicker = (_a) => {
|
|
|
9532
9567
|
dateFormat = mode === "monthPicker" || mode === "monthRangePicker" ? "MMM, yyyy" : mode === "timePicker" ? "h:mm aa" : "MMM d, yyyy",
|
|
9533
9568
|
timeIntervals = 15,
|
|
9534
9569
|
timeCaption,
|
|
9535
|
-
placeholderText,
|
|
9570
|
+
placeholderText: _placeholderText,
|
|
9536
9571
|
customDateRanges,
|
|
9537
9572
|
wrapperClassName,
|
|
9538
9573
|
calendarClassName,
|
|
@@ -10275,7 +10310,7 @@ var useQuickbooks = () => {
|
|
|
10275
10310
|
setQuickbooksIsLinked(isConnected);
|
|
10276
10311
|
});
|
|
10277
10312
|
const syncFromQuickbooks2 = () => {
|
|
10278
|
-
DEBUG2 && console.
|
|
10313
|
+
DEBUG2 && console.debug("Triggering sync from Quickbooks...");
|
|
10279
10314
|
setIsSyncingFromQuickbooks(true);
|
|
10280
10315
|
try {
|
|
10281
10316
|
Layer.syncFromQuickbooks(apiUrl, auth.access_token, {
|
|
@@ -10286,7 +10321,7 @@ var useQuickbooks = () => {
|
|
|
10286
10321
|
}
|
|
10287
10322
|
};
|
|
10288
10323
|
const fetchIsSyncingFromQuickbooks = () => __async(void 0, null, function* () {
|
|
10289
|
-
DEBUG2 && console.
|
|
10324
|
+
DEBUG2 && console.debug("Fetching status of sync from Quickbooks...");
|
|
10290
10325
|
const isSyncing = (yield Layer.statusOfSyncFromQuickbooks(apiUrl, auth.access_token, {
|
|
10291
10326
|
params: { businessId }
|
|
10292
10327
|
})()).data.is_syncing;
|
|
@@ -12837,6 +12872,7 @@ var Header2 = (0, import_react129.forwardRef)(
|
|
|
12837
12872
|
);
|
|
12838
12873
|
}
|
|
12839
12874
|
);
|
|
12875
|
+
Header2.displayName = "Header";
|
|
12840
12876
|
|
|
12841
12877
|
// src/components/Header/HeaderRow.tsx
|
|
12842
12878
|
var import_react130 = __toESM(require("react"));
|
|
@@ -12938,6 +12974,7 @@ var View = (0, import_react134.forwardRef)(
|
|
|
12938
12974
|
), withSidebar ? /* @__PURE__ */ import_react134.default.createElement(Panel, { sidebarIsOpen: true, sidebar, defaultSidebarHeight: true }, /* @__PURE__ */ import_react134.default.createElement("div", { className: "Layer__view-main" }, children)) : /* @__PURE__ */ import_react134.default.createElement("div", { className: "Layer__view-main" }, children));
|
|
12939
12975
|
}
|
|
12940
12976
|
);
|
|
12977
|
+
View.displayName = "View";
|
|
12941
12978
|
|
|
12942
12979
|
// src/components/ProfitAndLossReport/ProfitAndLossReport.tsx
|
|
12943
12980
|
var ProfitAndLossReport = ({
|
|
@@ -13016,21 +13053,6 @@ var import_react141 = __toESM(require("react"));
|
|
|
13016
13053
|
|
|
13017
13054
|
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesList.tsx
|
|
13018
13055
|
var import_react136 = __toESM(require("react"));
|
|
13019
|
-
|
|
13020
|
-
// src/utils/styleUtils/toDataProperties.ts
|
|
13021
|
-
function toDataProperties(input) {
|
|
13022
|
-
const unsafeProperties = Object.fromEntries(
|
|
13023
|
-
Object.entries(input).map(([key, value]) => {
|
|
13024
|
-
if (typeof value !== "string" && typeof value !== "number" && value !== true) {
|
|
13025
|
-
return null;
|
|
13026
|
-
}
|
|
13027
|
-
return [`data-${key}`, value];
|
|
13028
|
-
}).filter((entry) => entry !== null)
|
|
13029
|
-
);
|
|
13030
|
-
return unsafeProperties;
|
|
13031
|
-
}
|
|
13032
|
-
|
|
13033
|
-
// src/components/ProfitAndLossSummaries/internal/ProfitAndLossSummariesList.tsx
|
|
13034
13056
|
var LIST_ITEM_CLASS_NAME = "Layer__ProfitAndLossSummariesListItem";
|
|
13035
13057
|
function ProfitAndLossSummariesListItem({
|
|
13036
13058
|
children,
|
|
@@ -13828,7 +13850,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
13828
13850
|
/* @__PURE__ */ import_react150.default.createElement(PieChart_default, null)
|
|
13829
13851
|
)
|
|
13830
13852
|
),
|
|
13831
|
-
/* @__PURE__ */ import_react150.default.createElement(TableCell, { isCurrency: true, primary: true }, Number.isNaN(lineItem.value) ? 0 : lineItem.value)
|
|
13853
|
+
/* @__PURE__ */ import_react150.default.createElement(TableCell, { isCurrency: true, primary: true, align: "right" /* RIGHT */ }, Number.isNaN(lineItem.value) ? 0 : lineItem.value)
|
|
13832
13854
|
), expanded && lineItem.line_items ? lineItem.line_items.map(
|
|
13833
13855
|
(child, i) => renderLineItem(
|
|
13834
13856
|
child,
|