@layerfi/components 0.1.63 → 0.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -4927,9 +4927,6 @@ var ActionableList = ({
4927
4927
  )));
4928
4928
  };
4929
4929
 
4930
- // src/components/BankTransactionMobileList/constants.ts
4931
- var PersonalCategories = ["PERSONAL_INCOME", "PERSONAL_EXPENSES"];
4932
-
4933
4930
  // src/components/BankTransactionMobileList/utils.ts
4934
4931
  var mapCategoryToOption = (category) => ({
4935
4932
  label: category.display_name,
@@ -4976,7 +4973,7 @@ var getAssignedValue = (bankTransaction) => {
4976
4973
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || bankTransaction?.categorization_status === "SPLIT" /* SPLIT */) {
4977
4974
  return;
4978
4975
  }
4979
- if (bankTransaction.category && !PersonalCategories.includes(bankTransaction.category.display_name)) {
4976
+ if (bankTransaction.category && bankTransaction.category.type != "Exclusion") {
4980
4977
  return mapCategoryToOption(bankTransaction.category);
4981
4978
  }
4982
4979
  if (hasSuggestions(bankTransaction.categorization_flow)) {
@@ -4992,7 +4989,9 @@ var BusinessCategories = ({
4992
4989
  selectedId
4993
4990
  }) => {
4994
4991
  const { categories } = useLayerContext();
4995
- const categoryOptions = flattenCategories(categories);
4992
+ const categoryOptions = flattenCategories(
4993
+ categories.filter((category) => category.type != "ExclusionNested")
4994
+ );
4996
4995
  const [optionsToShow, setOptionsToShow] = useState11(categoryOptions);
4997
4996
  const [selectedGroup, setSelectedGroup] = useState11();
4998
4997
  const onCategorySelect = (v) => {
@@ -7228,12 +7227,21 @@ var BusinessForm = ({ bankTransaction }) => {
7228
7227
 
7229
7228
  // src/components/BankTransactionMobileList/PersonalForm.tsx
7230
7229
  import React94, { useEffect as useEffect15, useState as useState18 } from "react";
7230
+
7231
+ // src/components/BankTransactionMobileList/constants.ts
7232
+ var PersonalCategories = /* @__PURE__ */ ((PersonalCategories2) => {
7233
+ PersonalCategories2["INCOME"] = "PERSONAL_INFLOWS";
7234
+ PersonalCategories2["EXPENSES"] = "PERSONAL_EXPENSES";
7235
+ return PersonalCategories2;
7236
+ })(PersonalCategories || {});
7237
+
7238
+ // src/components/BankTransactionMobileList/PersonalForm.tsx
7231
7239
  var isAlreadyAssigned = (bankTransaction) => {
7232
7240
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || bankTransaction?.categorization_status === "SPLIT" /* SPLIT */) {
7233
7241
  return false;
7234
7242
  }
7235
7243
  return Boolean(
7236
- bankTransaction.category && PersonalCategories.includes(bankTransaction.category.display_name)
7244
+ bankTransaction.category && Object.values(PersonalCategories).includes(bankTransaction.category.display_name)
7237
7245
  );
7238
7246
  };
7239
7247
  var PersonalForm = ({ bankTransaction }) => {
@@ -7250,8 +7258,8 @@ var PersonalForm = ({ bankTransaction }) => {
7250
7258
  {
7251
7259
  type: "Category",
7252
7260
  category: {
7253
- type: "StableName",
7254
- stable_name: isCredit(bankTransaction) ? "PERSONAL_INCOME" : "PERSONAL_EXPENSES"
7261
+ type: "Exclusion",
7262
+ exclusion_type: isCredit(bankTransaction) ? "PERSONAL_INFLOWS" /* INCOME */ : "PERSONAL_EXPENSES" /* EXPENSES */
7255
7263
  }
7256
7264
  },
7257
7265
  true
@@ -7619,7 +7627,7 @@ var BankTransactionMobileListItem = ({
7619
7627
  const itemRef = useRef11(null);
7620
7628
  const [removeAnim, setRemoveAnim] = useState23(false);
7621
7629
  const [purpose, setPurpose] = useState23(
7622
- bankTransaction.category ? bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
7630
+ bankTransaction.category ? bankTransaction.category.type === "Exclusion" ? "personal" /* personal */ : bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
7623
7631
  );
7624
7632
  const [open, setOpen] = useState23(isFirstItem);
7625
7633
  const [showComponent, setShowComponent] = useState23(!initialLoad);