@axos-web-dev/shared-components 1.0.77-patch.62 → 1.0.77-patch.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/main.js CHANGED
@@ -70,6 +70,7 @@ import { CommercialDeposits } from "./Forms/CommercialDeposits.js";
70
70
  import { CommercialDepositsNoLendingOption } from "./Forms/CommercialDepositsNoLendingOption.js";
71
71
  import { CommercialLending } from "./Forms/CommercialLending.js";
72
72
  import { CommercialPremiumFinance } from "./Forms/CommercialPremiumFinance.js";
73
+ import { ConstructionLendingDynamic } from "./Forms/ConstructionLendingDynamic.js";
73
74
  import { ContactCompany } from "./Forms/ContactCompany.js";
74
75
  import { ContactCompanyTitle } from "./Forms/ContactCompanyTitle.js";
75
76
  import { ContactUs } from "./Forms/ContactUs.js";
@@ -102,6 +103,7 @@ import { ScheduleCallPremier } from "./Forms/ScheduleCallPremier.js";
102
103
  import { SuccesFormWrapper } from "./Forms/SuccesForm.js";
103
104
  import { VendorQuestionnaire } from "./Forms/VendorQuestionnaire.js";
104
105
  import { WCPLSurvey } from "./Forms/WcplSurvey.js";
106
+ import { BoatMooringLocation } from "./Forms/BoatMooringLocation.js";
105
107
  import { helpArticle_container, helpArticle_headline, helpArticle_p, insight_headline_2 } from "./HelpArticle/HelpArticle.css.js";
106
108
  import { HeroBanner } from "./HeroBanner/HeroBanner.js";
107
109
  import { headline_text, heroSupertag, hero_banner, hero_btns, hero_bullet_item, hero_content, hero_embedded_image, hero_img, hero_sub_bullets, hero_text, hero_wrapper, img_contents, logout, reversed, reversed_lg_image } from "./HeroBanner/HeroBanner.css.js";
@@ -248,6 +250,7 @@ export {
248
250
  default4 as AxosXBlue,
249
251
  BalanceAPYCalculator,
250
252
  Blockquote,
253
+ BoatMooringLocation,
251
254
  BreadcumbHeader,
252
255
  Bubble,
253
256
  BulletItem,
@@ -276,6 +279,7 @@ export {
276
279
  CommercialLending,
277
280
  CommercialPremiumFinance,
278
281
  ComparisonSet,
282
+ ConstructionLendingDynamic,
279
283
  ContactCompany,
280
284
  ContactCompanyTitle,
281
285
  ContactUs,
@@ -1,8 +1,12 @@
1
1
  const appendQueryParams = () => {
2
- const searchParams = new URLSearchParams(window.location.search);
3
- const filterParams = (href) => {
2
+ const currentOrigin = window.location.origin;
3
+ const currentPathname = window.location.pathname;
4
+ const filterParams = (href, currentSearch) => {
4
5
  try {
5
- const url = new URL(href, window.location.origin);
6
+ const search = currentSearch ?? window.location.search;
7
+ const searchParams = new URLSearchParams(search);
8
+ const base = window.location.origin + window.location.pathname + window.location.search;
9
+ const url = new URL(href, base);
6
10
  const existingParams = new URLSearchParams(url.search);
7
11
  const newParams = new URLSearchParams();
8
12
  const addedKeys = /* @__PURE__ */ new Set();
@@ -25,17 +29,44 @@ const appendQueryParams = () => {
25
29
  }
26
30
  const mergedParams = new URLSearchParams(existingParams);
27
31
  newParams.forEach((value, key) => mergedParams.append(key, value));
28
- return `${url.origin}${url.pathname}?${mergedParams.toString()}`;
32
+ return `${url.origin}${url.pathname}?${mergedParams.toString()}${url.hash}`;
29
33
  } catch (e) {
30
34
  console.error(e);
31
35
  return href;
32
36
  }
33
37
  };
38
+ const handleSamePageClick = (e) => {
39
+ const anchor = e.target?.closest?.("a[href]");
40
+ if (!anchor || anchor.classList.contains("ext-link"))
41
+ return;
42
+ const href = anchor.getAttribute("href")?.trim();
43
+ if (!href || href.startsWith("tel:") || href.startsWith("mailto:") || href === "#" || href === "" || href.startsWith("#"))
44
+ return;
45
+ const base = window.location.origin + window.location.pathname + window.location.search;
46
+ const url = new URL(href, base);
47
+ if (url.origin !== currentOrigin || url.pathname !== currentPathname)
48
+ return;
49
+ e.preventDefault();
50
+ e.stopImmediatePropagation();
51
+ const merged = filterParams(href, window.location.search);
52
+ const mergedUrl = new URL(merged, window.location.origin);
53
+ const fullUrl = `${mergedUrl.pathname}${mergedUrl.search}${mergedUrl.hash}`;
54
+ window.history.replaceState({ ...window.history.state }, "", fullUrl);
55
+ window.dispatchEvent(
56
+ new PopStateEvent("popstate", { state: window.history.state })
57
+ );
58
+ if (mergedUrl.hash) {
59
+ const el = document.querySelector(mergedUrl.hash);
60
+ el?.scrollIntoView({ behavior: "smooth" });
61
+ }
62
+ };
63
+ document.addEventListener("click", handleSamePageClick, true);
34
64
  if (window.location.search.length) {
65
+ const searchParams = new URLSearchParams(window.location.search);
35
66
  document.querySelectorAll("a[href]:not(.ext-link)").forEach((anchor) => {
36
67
  const href = anchor.getAttribute("href")?.trim();
37
68
  if (href && !href.startsWith("tel:") && !href.startsWith("mailto:") && href !== "#" && href !== "" && !href.startsWith("#")) {
38
- anchor.href = filterParams(href);
69
+ anchor.href = filterParams(href, searchParams.toString());
39
70
  }
40
71
  });
41
72
  }
@@ -8,12 +8,10 @@ const shortUrl = (url) => {
8
8
  return uri.hostname;
9
9
  };
10
10
  const isEmailLink = (url) => {
11
- const uri = new URL(url, location.href);
12
- return uri.protocol == "mailto:";
11
+ return typeof url === "string" && url.trim().toLowerCase().startsWith("mailto:");
13
12
  };
14
13
  const isPhoneLink = (url) => {
15
- const uri = new URL(url, location.href);
16
- return uri.protocol === "tel:";
14
+ return typeof url === "string" && url.trim().toLowerCase().startsWith("tel:");
17
15
  };
18
16
  const validateLink = (url) => {
19
17
  let openModal = false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@axos-web-dev/shared-components",
3
3
  "description": "Axos shared components library for web.",
4
- "version": "1.0.77-patch.62",
4
+ "version": "1.0.77-patch.64",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",