@axos-web-dev/shared-components 0.0.175 → 0.0.177
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/NavigationMenu/AxosBank/SubNavBar.js +153 -224
- package/dist/main.js +2 -0
- package/dist/utils/appendQueryParams.d.ts +1 -0
- package/dist/utils/appendQueryParams.js +48 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
- package/dist/utils/RetainQueryLink.d.ts +0 -11
- package/dist/utils/RetainQueryLink.js +0 -15
package/dist/main.js
CHANGED
|
@@ -169,6 +169,7 @@ import { associatedEmail } from "./utils/EverestValidity.js";
|
|
|
169
169
|
import { getVariant, getVariantWithRegex } from "./utils/getVariant.js";
|
|
170
170
|
import { isAbsoluteUrl, isEmailLink, isPhoneLink, shortUrl, validateLink } from "./utils/validateExternalLinks.js";
|
|
171
171
|
import { columnValues } from "./utils/variant.types.js";
|
|
172
|
+
import { appendQueryParams } from "./utils/appendQueryParams.js";
|
|
172
173
|
import { padding_in_footer, smb_section, smb_wrapper } from "./SocialMediaBar/SocialMediaBar.css.js";
|
|
173
174
|
export {
|
|
174
175
|
default20 as AASLogo,
|
|
@@ -338,6 +339,7 @@ export {
|
|
|
338
339
|
ant_section,
|
|
339
340
|
ant_svg_fill,
|
|
340
341
|
app_col,
|
|
342
|
+
appendQueryParams,
|
|
341
343
|
apy_billboard,
|
|
342
344
|
apy_table,
|
|
343
345
|
associatedEmail,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const appendQueryParams: () => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const appendQueryParams = () => {
|
|
2
|
+
const query = window.location.search.substring(1);
|
|
3
|
+
const filterParams = (href) => {
|
|
4
|
+
const vars = query.split("&");
|
|
5
|
+
const arrParams = [];
|
|
6
|
+
const arrControl = [];
|
|
7
|
+
const objControl = {};
|
|
8
|
+
const objControlCopyCat = {};
|
|
9
|
+
vars.forEach((item) => {
|
|
10
|
+
const [key, value] = item.split("=");
|
|
11
|
+
const lowerKey = key.toLowerCase();
|
|
12
|
+
if (href.toLowerCase().indexOf(lowerKey) === -1 && !arrControl.includes(lowerKey) && !key.includes("[]")) {
|
|
13
|
+
arrParams.push(item);
|
|
14
|
+
arrControl.push(lowerKey);
|
|
15
|
+
} else if (key.includes("[]") && href.toLowerCase().indexOf(item.toLowerCase()) === -1) {
|
|
16
|
+
const arrayName = key.replace("[]", "");
|
|
17
|
+
if (!objControl[arrayName]) {
|
|
18
|
+
objControl[arrayName] = [];
|
|
19
|
+
objControlCopyCat[arrayName] = [];
|
|
20
|
+
}
|
|
21
|
+
if (!objControlCopyCat[arrayName].includes(value.toLowerCase())) {
|
|
22
|
+
objControl[arrayName].push(value);
|
|
23
|
+
objControlCopyCat[arrayName].push(value.toLowerCase());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const arrayValues = [];
|
|
28
|
+
for (const property in objControl) {
|
|
29
|
+
const arrKey = property + "[]";
|
|
30
|
+
objControl[property].forEach((item) => {
|
|
31
|
+
arrayValues.push(`${arrKey}=${item}`);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return arrParams.concat(arrayValues).join("&");
|
|
35
|
+
};
|
|
36
|
+
if (query.length) {
|
|
37
|
+
document.querySelectorAll("a[href]:not(.ext-link)").forEach((anchor) => {
|
|
38
|
+
const href = anchor.href;
|
|
39
|
+
const finalQuery = filterParams(href);
|
|
40
|
+
if (finalQuery.length) {
|
|
41
|
+
anchor.href = href.includes("?") ? `${href}&${finalQuery}` : `${href}?${finalQuery}`;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
appendQueryParams
|
|
48
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -3,7 +3,9 @@ import { associatedEmail } from "./EverestValidity.js";
|
|
|
3
3
|
import { getVariant, getVariantWithRegex } from "./getVariant.js";
|
|
4
4
|
import { isAbsoluteUrl, isEmailLink, isPhoneLink, shortUrl, validateLink } from "./validateExternalLinks.js";
|
|
5
5
|
import { columnValues } from "./variant.types.js";
|
|
6
|
+
import { appendQueryParams } from "./appendQueryParams.js";
|
|
6
7
|
export {
|
|
8
|
+
appendQueryParams,
|
|
7
9
|
associatedEmail,
|
|
8
10
|
columnValues,
|
|
9
11
|
findMoreAxosDomains,
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LinkProps } from 'next/link';
|
|
2
|
-
import { PropsWithChildren } from 'react';
|
|
3
|
-
|
|
4
|
-
interface RetainQueryLinkProps extends LinkProps {
|
|
5
|
-
id?: string;
|
|
6
|
-
role?: string;
|
|
7
|
-
onKeyDown?: any;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
declare const RetainQueryLink: ({ href, ...props }: RetainQueryLinkProps & PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default RetainQueryLink;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import Link from "next/link.js";
|
|
4
|
-
import { useSearchParams } from "next/navigation.js";
|
|
5
|
-
const RetainQueryLink = ({
|
|
6
|
-
href,
|
|
7
|
-
...props
|
|
8
|
-
}) => {
|
|
9
|
-
const params = useSearchParams().toString();
|
|
10
|
-
const url = params ? `${href}?${params}` : href;
|
|
11
|
-
return /* @__PURE__ */ jsx(Link, { ...props, href: url });
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
RetainQueryLink as default
|
|
15
|
-
};
|