@carbon-labs/wc-global-header 0.70.0 → 0.73.0
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.
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
import E from "react";
|
|
2
|
-
import { l as
|
|
2
|
+
import { l as L } from "./HybridIpaasHeader-BLMNjN4w.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
5
5
|
* Copyright 2018 Google LLC
|
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
let n =
|
|
14
|
-
|
|
15
|
-
})(t,
|
|
16
|
-
},
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
for (const [
|
|
20
|
-
return t.useLayoutEffect(() => {
|
|
21
|
-
if (n.current
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return u.displayName = b ?? r.name, u;
|
|
8
|
+
const N = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), k = /* @__PURE__ */ new WeakMap(), A = (t, r, c, b, o) => {
|
|
9
|
+
const u = o == null ? void 0 : o[r];
|
|
10
|
+
u === void 0 || c === b ? (t[r] = c, c == null && r in HTMLElement.prototype && t.removeAttribute(r)) : ((s, l, e) => {
|
|
11
|
+
let i = k.get(s);
|
|
12
|
+
i === void 0 && k.set(s, i = /* @__PURE__ */ new Map());
|
|
13
|
+
let n = i.get(l);
|
|
14
|
+
e !== void 0 ? n === void 0 ? (i.set(l, n = { handleEvent: e }), s.addEventListener(l, n)) : n.handleEvent = e : n !== void 0 && (i.delete(l), s.removeEventListener(l, n));
|
|
15
|
+
})(t, u, c);
|
|
16
|
+
}, S = ({ react: t, tagName: r, elementClass: c, events: b, displayName: o }) => {
|
|
17
|
+
const u = new Set(Object.keys(b ?? {})), s = t.forwardRef(((l, e) => {
|
|
18
|
+
const i = t.useRef(null), n = t.useRef(null), d = {}, p = {};
|
|
19
|
+
for (const [a, C] of Object.entries(l)) N.has(a) ? d[a === "className" ? "class" : a] = C : u.has(a) || a in c.prototype ? p[a] = C : d[a] = C;
|
|
20
|
+
return t.useLayoutEffect((() => {
|
|
21
|
+
if (n.current !== null) {
|
|
22
|
+
for (const a in p) A(n.current, a, l[a], i.current ? i.current[a] : void 0, b);
|
|
23
|
+
i.current = l;
|
|
24
|
+
}
|
|
25
|
+
})), t.useLayoutEffect((() => {
|
|
26
|
+
var a;
|
|
27
|
+
(a = n.current) == null || a.removeAttribute("defer-hydration");
|
|
28
|
+
}), []), d.suppressHydrationWarning = !0, t.createElement(r, { ...d, ref: t.useCallback(((a) => {
|
|
29
|
+
n.current = a, typeof e == "function" ? e(a) : e !== null && (e.current = a);
|
|
30
|
+
}), [e]) });
|
|
31
|
+
}));
|
|
32
|
+
return s.displayName = o ?? c.name, s;
|
|
34
33
|
};
|
|
35
34
|
/**
|
|
36
35
|
* @license
|
|
@@ -40,56 +39,56 @@ const S = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "cla
|
|
|
40
39
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
41
40
|
* LICENSE file in the root directory of this source tree.
|
|
42
41
|
*/
|
|
43
|
-
const h = "clabs-hybrid-ipaas-header-ai-callback",
|
|
42
|
+
const h = "clabs-hybrid-ipaas-header-ai-callback", f = "clabs-hybrid-ipaas-header-notification-open-callback", m = "clabs-hybrid-ipaas-logout-callback", v = "clabs-hybrid-ipaas-search-callback", y = "clabs-hybrid-ipaas-search-submit-callback", O = S({
|
|
44
43
|
tagName: "clabs-global-header-hybrid-ipaas",
|
|
45
|
-
elementClass:
|
|
44
|
+
elementClass: L,
|
|
46
45
|
react: E,
|
|
47
46
|
events: {
|
|
48
47
|
onaiCallback: h,
|
|
49
|
-
onNotificationOpenCallback:
|
|
50
|
-
onLogoutCallback:
|
|
51
|
-
onSearchCallback:
|
|
52
|
-
onSearchSubmitCallback:
|
|
48
|
+
onNotificationOpenCallback: f,
|
|
49
|
+
onLogoutCallback: m,
|
|
50
|
+
onSearchCallback: v,
|
|
51
|
+
onSearchSubmitCallback: y
|
|
53
52
|
}
|
|
54
|
-
}),
|
|
53
|
+
}), H = (t) => {
|
|
55
54
|
const {
|
|
56
|
-
aiCallback:
|
|
57
|
-
notificationOpenCallback:
|
|
58
|
-
logoutCallback:
|
|
59
|
-
searchCallback:
|
|
60
|
-
searchSubmitCallback:
|
|
61
|
-
...
|
|
55
|
+
aiCallback: r,
|
|
56
|
+
notificationOpenCallback: c,
|
|
57
|
+
logoutCallback: b,
|
|
58
|
+
searchCallback: o,
|
|
59
|
+
searchSubmitCallback: u,
|
|
60
|
+
...s
|
|
62
61
|
} = t;
|
|
63
62
|
return /* @__PURE__ */ E.createElement(
|
|
64
63
|
O,
|
|
65
64
|
{
|
|
66
65
|
role: "banner",
|
|
67
|
-
onaiCallback:
|
|
68
|
-
o();
|
|
69
|
-
}),
|
|
70
|
-
aiCallbackEvent: o && h,
|
|
71
|
-
onNotificationOpenCallback: r && (() => {
|
|
66
|
+
onaiCallback: r && (() => {
|
|
72
67
|
r();
|
|
73
68
|
}),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
aiCallbackEvent: r && h,
|
|
70
|
+
onNotificationOpenCallback: c && (() => {
|
|
71
|
+
c();
|
|
72
|
+
}),
|
|
73
|
+
notificationOpenCallbackEvent: c && f,
|
|
74
|
+
onLogoutCallback: b && (() => {
|
|
75
|
+
b();
|
|
77
76
|
}),
|
|
78
|
-
logoutCallbackEvent:
|
|
79
|
-
onSearchCallback:
|
|
80
|
-
var
|
|
81
|
-
|
|
77
|
+
logoutCallbackEvent: b && m,
|
|
78
|
+
onSearchCallback: o && ((l) => {
|
|
79
|
+
var e;
|
|
80
|
+
o(((e = l.detail) == null ? void 0 : e.value) || "");
|
|
82
81
|
}),
|
|
83
|
-
searchCallbackEvent:
|
|
84
|
-
onSearchSubmitCallback:
|
|
85
|
-
var
|
|
86
|
-
|
|
82
|
+
searchCallbackEvent: o && v,
|
|
83
|
+
onSearchSubmitCallback: u && ((l) => {
|
|
84
|
+
var e;
|
|
85
|
+
u(((e = l.detail) == null ? void 0 : e.value) || "");
|
|
87
86
|
}),
|
|
88
|
-
searchSubmitCallbackEvent:
|
|
89
|
-
...
|
|
87
|
+
searchSubmitCallbackEvent: u && y,
|
|
88
|
+
...s
|
|
90
89
|
}
|
|
91
90
|
);
|
|
92
91
|
};
|
|
93
92
|
export {
|
|
94
|
-
|
|
93
|
+
H as HybridIpaasHeaderReactWrapper
|
|
95
94
|
};
|