@altinn/altinn-components 0.33.3 → 0.33.4

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.
@@ -11,18 +11,18 @@ import { useRootContext as _ } from "../RootProvider/RootProvider.js";
11
11
  import "../Searchbar/AutocompleteBase.js";
12
12
  import "../Snackbar/useSnackbar.js";
13
13
  import { u as R } from "../../useId-BVFxCjkq.js";
14
- import '../../assets/ContextMenu.css';var E = function(t, l) {
14
+ import '../../assets/ContextMenu.css';var E = function(e, l) {
15
15
  var r = {};
16
- for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && l.indexOf(e) < 0 && (r[e] = t[e]);
17
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
18
- for (var o = 0, e = Object.getOwnPropertySymbols(t); o < e.length; o++)
19
- l.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[o]) && (r[e[o]] = t[e[o]]);
16
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && l.indexOf(t) < 0 && (r[t] = e[t]);
17
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
18
+ for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
19
+ l.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (r[t[o]] = e[t[o]]);
20
20
  return r;
21
21
  };
22
- const M = b((t, l) => {
23
- var { title: r, titleId: e } = t, o = E(t, ["title", "titleId"]);
22
+ const M = b((e, l) => {
23
+ var { title: r, titleId: t } = e, o = E(e, ["title", "titleId"]);
24
24
  let n = R();
25
- return n = r ? e || "title-" + n : void 0, a.createElement(
25
+ return n = r ? t || "title-" + n : void 0, a.createElement(
26
26
  "svg",
27
27
  Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: l, "aria-labelledby": n }, o),
28
28
  r ? a.createElement("title", { id: n }, r) : null,
@@ -31,23 +31,25 @@ const M = b((t, l) => {
31
31
  }), k = "_toggle_nol5i_1", B = {
32
32
  toggle: k
33
33
  }, F = ({
34
- id: t = "context-menu",
34
+ id: e = "context-menu",
35
35
  ariaLabel: l,
36
36
  placement: r = "right",
37
- groups: e = {},
37
+ groups: t = {},
38
38
  className: o,
39
39
  items: n
40
40
  }) => {
41
- const { currentId: f, toggleId: d, closeAll: c } = _(), m = h(null);
42
- I(m, () => c());
43
- const p = () => d(t), g = f === t, x = w(() => n.map((i) => ({
41
+ const { currentId: d, toggleId: m, closeAll: u } = _(), f = h(null), g = () => m(e), c = d === e;
42
+ I(f, () => {
43
+ c && m(e);
44
+ });
45
+ const x = w(() => n.map((i) => ({
44
46
  ...i,
45
47
  onClick: () => {
46
- var u;
47
- (u = i.onClick) == null || u.call(i), c();
48
+ var p;
49
+ (p = i.onClick) == null || p.call(i), u();
48
50
  }
49
- })), [n, c]);
50
- return /* @__PURE__ */ v("div", { className: O(B.toggle, o), "data-color": "neutral", ref: m, children: [
51
+ })), [n, u]);
52
+ return /* @__PURE__ */ v("div", { className: O(B.toggle, o), "data-color": "neutral", ref: f, children: [
51
53
  /* @__PURE__ */ s(
52
54
  y,
53
55
  {
@@ -55,11 +57,11 @@ const M = b((t, l) => {
55
57
  rounded: !0,
56
58
  icon: M,
57
59
  variant: "text",
58
- onClick: p,
59
- iconAltText: l || `Open ${t}`
60
+ onClick: g,
61
+ iconAltText: l || `Open ${e}`
60
62
  }
61
63
  ),
62
- /* @__PURE__ */ s(j, { placement: r, open: g, children: /* @__PURE__ */ s(C, { groups: e, items: x }) })
64
+ c && /* @__PURE__ */ s(j, { placement: r, open: c, children: /* @__PURE__ */ s(C, { groups: t, items: x }) })
63
65
  ] });
64
66
  };
65
67
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.33.3",
3
+ "version": "0.33.4",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",