@arkitektbedriftene/fe-lib 0.4.35 → 0.4.37
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/elements/components/CompanyLogo.d.ts +7 -2
- package/dist/elements.es.js +35 -21
- package/dist/oidc/impersonate.d.ts +1 -1
- package/dist/oidc.es.js +494 -449
- package/package.json +2 -1
|
@@ -3,7 +3,7 @@ import { type CSS } from "@ui";
|
|
|
3
3
|
export declare const CompanyLogo: ({ companyId, maxWidth, fallback, width, css, }: {
|
|
4
4
|
companyId: number | string;
|
|
5
5
|
maxWidth: string;
|
|
6
|
-
fallback
|
|
6
|
+
fallback?: string | undefined;
|
|
7
7
|
width?: number | undefined;
|
|
8
8
|
css?: CSS<{
|
|
9
9
|
media: {};
|
|
@@ -11,4 +11,9 @@ export declare const CompanyLogo: ({ companyId, maxWidth, fallback, width, css,
|
|
|
11
11
|
themeMap: {};
|
|
12
12
|
utils: {};
|
|
13
13
|
}> | undefined;
|
|
14
|
-
}) => JSX.Element;
|
|
14
|
+
}) => JSX.Element | null;
|
|
15
|
+
export declare const createCompanyLogoElement: ({ companyId, maxWidth, width, }: {
|
|
16
|
+
companyId: string | number;
|
|
17
|
+
maxWidth: string;
|
|
18
|
+
width?: number | undefined;
|
|
19
|
+
}) => HTMLImageElement;
|
package/dist/elements.es.js
CHANGED
|
@@ -1,32 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a } from "react";
|
|
3
3
|
import { Box as p } from "./ui.es.js";
|
|
4
|
-
const
|
|
5
|
-
companyId:
|
|
6
|
-
maxWidth:
|
|
7
|
-
fallback:
|
|
8
|
-
width:
|
|
9
|
-
css:
|
|
4
|
+
const l = ({
|
|
5
|
+
companyId: r,
|
|
6
|
+
maxWidth: e,
|
|
7
|
+
fallback: o = void 0,
|
|
8
|
+
width: t = 500,
|
|
9
|
+
css: s
|
|
10
10
|
}) => {
|
|
11
|
-
const [
|
|
12
|
-
`https://prod-content-ab.azurewebsites.net/api/Logo/${
|
|
13
|
-
)
|
|
14
|
-
|
|
11
|
+
const [n, c] = a(
|
|
12
|
+
`https://prod-content-ab.azurewebsites.net/api/Logo/${r}?width=${t}`
|
|
13
|
+
), i = () => {
|
|
14
|
+
c(o);
|
|
15
|
+
};
|
|
16
|
+
return n ? /* @__PURE__ */ m(
|
|
15
17
|
p,
|
|
16
18
|
{
|
|
17
19
|
as: "img",
|
|
18
|
-
src:
|
|
19
|
-
onError:
|
|
20
|
-
c(r);
|
|
21
|
-
} : void 0,
|
|
20
|
+
src: n,
|
|
21
|
+
onError: n !== o ? i : void 0,
|
|
22
22
|
css: {
|
|
23
|
-
maxWidth:
|
|
24
|
-
maxHeight: `calc(${
|
|
25
|
-
...
|
|
23
|
+
maxWidth: e,
|
|
24
|
+
maxHeight: `calc(${e} / 2)`,
|
|
25
|
+
...s
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
);
|
|
28
|
+
) : null;
|
|
29
|
+
}, h = ({
|
|
30
|
+
companyId: r,
|
|
31
|
+
maxWidth: e,
|
|
32
|
+
width: o = 500
|
|
33
|
+
}) => {
|
|
34
|
+
const t = document.createElement("img");
|
|
35
|
+
return t.style.maxWidth = e, t.style.maxHeight = `calc(${e} / 2)`, t.addEventListener(
|
|
36
|
+
"error",
|
|
37
|
+
() => {
|
|
38
|
+
t.remove();
|
|
39
|
+
},
|
|
40
|
+
{ once: !0 }
|
|
41
|
+
), t.src = `https://prod-content-ab.azurewebsites.net/api/Logo/${r}?width=${o}`, t;
|
|
29
42
|
};
|
|
30
43
|
export {
|
|
31
|
-
|
|
44
|
+
l as CompanyLogo,
|
|
45
|
+
h as createCompanyLogoElement
|
|
32
46
|
};
|