@altinn/altinn-components 0.15.2 → 0.15.3

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,39 +1,39 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useRef as E, createElement as x } from "react";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useRef as b, createElement as v } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "../Icon/SvgIcon.js";
5
- import { useMenu as A } from "../../hooks/useMenu.js";
5
+ import { useMenu as x } from "../../hooks/useMenu.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { AutocompleteBase as h } from "./AutocompleteBase.js";
8
- import { AutocompleteGroup as v } from "./AutocompleteGroup.js";
9
- import { AutocompleteItem as k } from "./AutocompleteItem.js";
7
+ import { AutocompleteBase as A } from "./AutocompleteBase.js";
8
+ import { AutocompleteGroup as I } from "./AutocompleteGroup.js";
9
+ import { AutocompleteItem as h } from "./AutocompleteItem.js";
10
10
  import "../Snackbar/useSnackbar.js";
11
- import { useEnterKey as I } from "../../hooks/useEnterKey.js";
12
- const D = ({ className: s, items: i, groups: n = {}, expanded: c, onSelect: r }) => {
13
- const p = E(null);
14
- I(() => {
15
- var o;
16
- const t = (o = p.current) == null ? void 0 : o.querySelector('[data-active="true"]'), e = t == null ? void 0 : t.querySelector("a, button");
17
- e == null || e.dispatchEvent(new MouseEvent("click", { bubbles: !0 })), r == null || r();
11
+ import { useEnterKey as k } from "../../hooks/useEnterKey.js";
12
+ const D = ({ className: u, items: i, groups: s = {}, expanded: n, onSelect: r }) => {
13
+ const p = b(null);
14
+ k(() => {
15
+ var e;
16
+ const t = (e = p.current) == null ? void 0 : e.querySelector('[data-active="true"]');
17
+ t == null || t.dispatchEvent(new MouseEvent("click", { bubbles: !0 })), r == null || r();
18
18
  });
19
- const { menu: d, setActiveIndex: a } = A({
19
+ const { menu: c, setActiveIndex: d } = x({
20
20
  items: i,
21
- groups: n,
21
+ groups: s,
22
22
  groupByKey: "groupId",
23
23
  keyboardEvents: !0
24
24
  });
25
- return /* @__PURE__ */ m(h, { className: s, expanded: c, ref: p, children: d.map((t, e) => /* @__PURE__ */ x(v, { ...t.props, key: e }, /* @__PURE__ */ m("ul", { children: t.items.map((o, f) => {
25
+ return /* @__PURE__ */ o(A, { className: u, expanded: n, ref: p, children: c.map((t, e) => /* @__PURE__ */ v(I, { ...t.props, key: e }, /* @__PURE__ */ o("ul", { children: t.items.map((a, f) => {
26
26
  const {
27
27
  active: l,
28
28
  menuIndex: y,
29
- props: { groupId: M, onClick: u, ...b }
30
- } = o;
31
- return /* @__PURE__ */ m("li", { tabIndex: -1, onMouseEnter: () => a(y), children: /* @__PURE__ */ m(
32
- k,
29
+ props: { groupId: M, onClick: m, ...E }
30
+ } = a;
31
+ return /* @__PURE__ */ o("li", { tabIndex: -1, onMouseEnter: () => d(y), children: /* @__PURE__ */ o(
32
+ h,
33
33
  {
34
- ...b,
34
+ ...E,
35
35
  onClick: () => {
36
- u == null || u(), r == null || r();
36
+ m == null || m(), r == null || r();
37
37
  },
38
38
  active: l
39
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",