qlu-20-ui-library 1.10.5 → 1.10.6

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.
@@ -41621,14 +41621,15 @@ const nte = ({
41621
41621
  iconSize: e = "24",
41622
41622
  className: n,
41623
41623
  altImageType: r = "profile",
41624
- key: i
41624
+ key: i,
41625
+ lazy: s = !1
41625
41626
  }) => {
41626
- const [s, a] = te(!1);
41627
+ const [a, l] = te(!1);
41627
41628
  de(() => {
41628
- a(!t);
41629
+ l(!t);
41629
41630
  }, [t]);
41630
- const l = (c) => c === "profile" ? /* @__PURE__ */ o.jsx(s8, { width: e, height: e }) : c === "company" ? /* @__PURE__ */ o.jsx(q6, { width: e, height: e }) : c === "education" ? /* @__PURE__ */ o.jsx(L5, { width: e, height: e }) : c === "companyPlaceholderAvatar" ? /* @__PURE__ */ o.jsx(Jp, { width: e, height: e }) : c === "profilePlaceholderAvatar" ? /* @__PURE__ */ o.jsx(Xp, { width: e, height: e }) : /* @__PURE__ */ o.jsx(s8, { width: e, height: e });
41631
- return s ? /* @__PURE__ */ o.jsx(
41631
+ const c = (u) => u === "profile" ? /* @__PURE__ */ o.jsx(s8, { width: e, height: e }) : u === "company" ? /* @__PURE__ */ o.jsx(q6, { width: e, height: e }) : u === "education" ? /* @__PURE__ */ o.jsx(L5, { width: e, height: e }) : u === "companyPlaceholderAvatar" ? /* @__PURE__ */ o.jsx(Jp, { width: e, height: e }) : u === "profilePlaceholderAvatar" ? /* @__PURE__ */ o.jsx(Xp, { width: e, height: e }) : /* @__PURE__ */ o.jsx(s8, { width: e, height: e });
41632
+ return a ? /* @__PURE__ */ o.jsx(
41632
41633
  "div",
41633
41634
  {
41634
41635
  style: {
@@ -41636,7 +41637,7 @@ const nte = ({
41636
41637
  height: e + "px"
41637
41638
  },
41638
41639
  className: "placeholder",
41639
- children: l(r)
41640
+ children: c(r)
41640
41641
  }
41641
41642
  ) : /* @__PURE__ */ o.jsx(
41642
41643
  "img",
@@ -41645,8 +41646,9 @@ const nte = ({
41645
41646
  width: e,
41646
41647
  height: e,
41647
41648
  src: t,
41649
+ loading: s ? "lazy" : "eager",
41648
41650
  onError: () => {
41649
- console.log("ERROR OCCURED"), a(!0);
41651
+ console.log("ERROR OCCURED"), l(!0);
41650
41652
  }
41651
41653
  },
41652
41654
  i
@@ -7,6 +7,7 @@ interface CircularIconProps {
7
7
  altImageType?: string;
8
8
  rerenderTrigger?: boolean;
9
9
  key?: string;
10
+ lazy?: boolean;
10
11
  }
11
- declare const CircularIcon: ({ iconPath, iconSize, className, altImageType, key, }: CircularIconProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const CircularIcon: ({ iconPath, iconSize, className, altImageType, key, lazy, }: CircularIconProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export default CircularIcon;
@@ -8,6 +8,7 @@ interface CircularIconProps {
8
8
  altImageType?: string;
9
9
  rerenderTrigger?: boolean;
10
10
  key?: string;
11
+ lazy?: boolean;
11
12
  }
12
- declare const CircularIcon: ({ iconPath, iconSize, className, altImageType, key, }: CircularIconProps) => import("react/jsx-runtime").JSX.Element;
13
+ declare const CircularIcon: ({ iconPath, iconSize, className, altImageType, key, lazy, }: CircularIconProps) => import("react/jsx-runtime").JSX.Element;
13
14
  export default CircularIcon;
@@ -6,7 +6,7 @@ import Company from "../Svg/Company";
6
6
  import { useEffect, useState } from "react";
7
7
  import CompanyPlaceholderAvatar from "../Svg/CompanyPlaceholderAvatar";
8
8
  import ProfilePlaceholderAvatar from "../Svg/ProfilePlaceholderAvatar";
9
- const CircularIcon = ({ iconPath = "", iconSize = "24", className, altImageType = "profile", key, }) => {
9
+ const CircularIcon = ({ iconPath = "", iconSize = "24", className, altImageType = "profile", key, lazy = false, }) => {
10
10
  const [error, setError] = useState(false);
11
11
  useEffect(() => {
12
12
  if (!iconPath) {
@@ -35,7 +35,7 @@ const CircularIcon = ({ iconPath = "", iconSize = "24", className, altImageType
35
35
  return _jsx(User, { width: iconSize, height: iconSize });
36
36
  };
37
37
  if (!error) {
38
- return (_jsx("img", { className: `circularIcon ${className ? ` ${className}` : ""}`, width: iconSize, height: iconSize, src: iconPath, onError: () => {
38
+ return (_jsx("img", { className: `circularIcon ${className ? ` ${className}` : ""}`, width: iconSize, height: iconSize, src: iconPath, loading: lazy ? "lazy" : "eager", onError: () => {
39
39
  console.log("ERROR OCCURED");
40
40
  setError(true);
41
41
  } }, key));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlu-20-ui-library",
3
- "version": "1.10.5",
3
+ "version": "1.10.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",