@adyen/kyc-components 3.35.0 → 3.35.2

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.
@@ -12033,27 +12033,6 @@ function FieldContainer(props) {
12033
12033
  }
12034
12034
  return renderField(fieldName);
12035
12035
  }
12036
- const isIntersectionObserverSupported = typeof IntersectionObserver === "function";
12037
- function useIsElementVisible(ref, fallback = true) {
12038
- const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
12039
- const observerRef = useRef();
12040
- useEffect(() => {
12041
- if (!isIntersectionObserverSupported) return;
12042
- observerRef.current = new IntersectionObserver(
12043
- ([entry]) => setIsOnScreen(entry.isIntersecting)
12044
- );
12045
- }, []);
12046
- useEffect(() => {
12047
- var _a;
12048
- if (!ref.current) return;
12049
- (_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
12050
- return () => {
12051
- var _a2;
12052
- (_a2 = observerRef.current) == null ? void 0 : _a2.disconnect();
12053
- };
12054
- }, [ref]);
12055
- return isOnScreen;
12056
- }
12057
12036
  const logger$D = createLogger("SearchAddress");
12058
12037
  const SearchAddress = ({
12059
12038
  data,
@@ -12063,8 +12042,7 @@ const SearchAddress = ({
12063
12042
  handleAddressSearch,
12064
12043
  handleFindAddress,
12065
12044
  addressType,
12066
- kompanyAddress,
12067
- kompanyPrefilled = false
12045
+ kompanyAddress
12068
12046
  }) => {
12069
12047
  const { i18n } = useI18nContext();
12070
12048
  const [items, setItems] = useState([]);
@@ -12072,21 +12050,13 @@ const SearchAddress = ({
12072
12050
  const [resetSearch, setResetSearch] = useState(false);
12073
12051
  const [searchText, setSearchText] = useState(null);
12074
12052
  const [showSearchList, setShowSearchList] = useState(false);
12075
- const searchBoxRef = useRef(null);
12076
- const isVisible = useIsElementVisible(searchBoxRef);
12077
12053
  const canAutoFillKompanyAddress = kompanyAddress && searchText !== kompanyAddress && addressType === "registrationAddress";
12078
12054
  useEffect(() => {
12079
12055
  setSearchText(kompanyAddress);
12080
12056
  if (canAutoFillKompanyAddress) {
12081
- const searchForAddress = () => getSearchItems(kompanyAddress);
12082
- searchForAddress();
12057
+ getSearchItems(kompanyAddress);
12083
12058
  }
12084
12059
  }, [kompanyAddress]);
12085
- useEffect(() => {
12086
- if (isVisible && kompanyAddress && addressType === "registrationAddress" && !kompanyPrefilled) {
12087
- setShowSearchList(true);
12088
- }
12089
- }, [isVisible, kompanyAddress, addressType, kompanyPrefilled]);
12090
12060
  useEffect(() => {
12091
12061
  setItems([]);
12092
12062
  setResetSearch(true);
@@ -12227,7 +12197,6 @@ const SearchAddress = ({
12227
12197
  name: "searchAddress",
12228
12198
  className: "adyen-kyc-u-margin-bottom-8",
12229
12199
  label: i18n.get("searchAddress"),
12230
- wrapperRef: searchBoxRef,
12231
12200
  children: (childProps) => /* @__PURE__ */ jsx(
12232
12201
  Select,
12233
12202
  {
@@ -12599,16 +12568,14 @@ function Address(props) {
12599
12568
  [dataProp == null ? void 0 : dataProp.country, i18n]
12600
12569
  );
12601
12570
  const {
12571
+ schema,
12602
12572
  data,
12603
12573
  errors,
12604
12574
  valid,
12605
12575
  isValid,
12606
12576
  fieldProblems,
12607
12577
  handleChangeFor,
12608
- triggerValidation,
12609
- resetToDefaultData,
12610
- schema,
12611
- setData
12578
+ triggerValidation
12612
12579
  } = useForm({
12613
12580
  ...props,
12614
12581
  schema: requiredFields,
@@ -12683,26 +12650,6 @@ function Address(props) {
12683
12650
  setShowAddAddressButton(false);
12684
12651
  }
12685
12652
  }, [shouldValidate]);
12686
- const canAutofillVerifiedBusinessAddress = Boolean(
12687
- (verifiedBusiness == null ? void 0 : verifiedBusiness.street) && (verifiedBusiness == null ? void 0 : verifiedBusiness.city) && (verifiedBusiness == null ? void 0 : verifiedBusiness.state) && verifiedBusiness.zipcode
12688
- );
12689
- useEffect(() => {
12690
- if (!isExperimentEnabled("EnableNewBusinessDetailsFlow")) return;
12691
- if (verifiedBusiness && canAutofillVerifiedBusinessAddress) {
12692
- setShowAutocompletedAddressFields(true);
12693
- setShowAddAddressButton(false);
12694
- setData("address", verifiedBusiness.street);
12695
- setData("city", verifiedBusiness.city);
12696
- setData("stateOrProvince", verifiedBusiness.state);
12697
- setData("postalCode", verifiedBusiness.zipcode);
12698
- return triggerValidation();
12699
- }
12700
- if (!(dataProp == null ? void 0 : dataProp.address) || !(dataProp == null ? void 0 : dataProp.city) || !(dataProp == null ? void 0 : dataProp.postalCode)) {
12701
- setShowAutocompletedAddressFields(false);
12702
- setShowAddAddressButton(true);
12703
- resetToDefaultData();
12704
- }
12705
- }, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
12706
12653
  const getComponent = (fieldName) => {
12707
12654
  if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
12708
12655
  const hideField = fieldName === "country" && hideCountry;
@@ -12790,8 +12737,7 @@ function Address(props) {
12790
12737
  legalEntityId,
12791
12738
  autocompleteAddressForm,
12792
12739
  addressType,
12793
- kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address,
12794
- kompanyPrefilled: canAutofillVerifiedBusinessAddress
12740
+ kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address
12795
12741
  }
12796
12742
  ),
12797
12743
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-search-address--below", children: [
@@ -15158,7 +15104,7 @@ const mapSolePropToLegalEntity = (data) => {
15158
15104
  delete requestObj.soleProprietorship.vatNumber;
15159
15105
  delete requestObj.soleProprietorship.registrationNumber;
15160
15106
  }
15161
- if (data.solePropFinancialInformation) {
15107
+ if (!isEmpty(data.solePropFinancialInformation)) {
15162
15108
  requestObj.soleProprietorship.financialReports = [
15163
15109
  formatObject(
15164
15110
  data.solePropFinancialInformation,
@@ -41797,7 +41743,7 @@ const ConfigurationApiProvider = ({
41797
41743
  }) => {
41798
41744
  const authContext = useAuthContext();
41799
41745
  const { isEmbeddedDropin, loadingContext } = authContext;
41800
- const sdkVersion = "3.35.0";
41746
+ const sdkVersion = "3.35.2";
41801
41747
  useAnalytics({
41802
41748
  onUserEvent,
41803
41749
  legalEntityId: rootLegalEntityId,
@@ -42468,7 +42414,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42468
42414
  };
42469
42415
  const copyToClipboard = async () => {
42470
42416
  const toCopy = {
42471
- sdkVersion: "3.35.0",
42417
+ sdkVersion: "3.35.2",
42472
42418
  experiments: Object.fromEntries(allExperimentsWithValues),
42473
42419
  settings: Object.fromEntries(allSettingsWithValues)
42474
42420
  };
@@ -42533,7 +42479,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42533
42479
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
42534
42480
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42535
42481
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
42536
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.35.0" })
42482
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.35.2" })
42537
42483
  ] }) }),
42538
42484
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42539
42485
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
@@ -1,4 +1,4 @@
1
1
  import type { JSX } from 'preact';
2
2
  import type { SearchAddressProps } from '../types';
3
- declare const SearchAddress: ({ data, legalEntityId, autocompleteAddressForm, handleChangeFor, handleAddressSearch, handleFindAddress, addressType, kompanyAddress, kompanyPrefilled, }: SearchAddressProps) => JSX.Element;
3
+ declare const SearchAddress: ({ data, legalEntityId, autocompleteAddressForm, handleChangeFor, handleAddressSearch, handleFindAddress, addressType, kompanyAddress, }: SearchAddressProps) => JSX.Element;
4
4
  export default SearchAddress;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.35.0",
3
+ "version": "3.35.2",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",
@@ -1,2 +0,0 @@
1
- import type { MutableRef } from 'preact/hooks';
2
- export declare function useIsElementVisible(ref: MutableRef<Element>, fallback?: boolean): boolean;