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