@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(
|
|
14
|
+
import '../../assets/ContextMenu.css';var E = function(e, l) {
|
|
15
15
|
var r = {};
|
|
16
|
-
for (var
|
|
17
|
-
if (
|
|
18
|
-
for (var o = 0,
|
|
19
|
-
l.indexOf(
|
|
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((
|
|
23
|
-
var { title: r, 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 ?
|
|
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:
|
|
34
|
+
id: e = "context-menu",
|
|
35
35
|
ariaLabel: l,
|
|
36
36
|
placement: r = "right",
|
|
37
|
-
groups:
|
|
37
|
+
groups: t = {},
|
|
38
38
|
className: o,
|
|
39
39
|
items: n
|
|
40
40
|
}) => {
|
|
41
|
-
const { currentId:
|
|
42
|
-
I(
|
|
43
|
-
|
|
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
|
|
47
|
-
(
|
|
48
|
+
var p;
|
|
49
|
+
(p = i.onClick) == null || p.call(i), u();
|
|
48
50
|
}
|
|
49
|
-
})), [n,
|
|
50
|
-
return /* @__PURE__ */ v("div", { className: O(B.toggle, o), "data-color": "neutral", ref:
|
|
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:
|
|
59
|
-
iconAltText: l || `Open ${
|
|
60
|
+
onClick: g,
|
|
61
|
+
iconAltText: l || `Open ${e}`
|
|
60
62
|
}
|
|
61
63
|
),
|
|
62
|
-
/* @__PURE__ */ s(j, { placement: r, open:
|
|
64
|
+
c && /* @__PURE__ */ s(j, { placement: r, open: c, children: /* @__PURE__ */ s(C, { groups: t, items: x }) })
|
|
63
65
|
] });
|
|
64
66
|
};
|
|
65
67
|
export {
|