@semcore/dropdown-menu 4.46.1 → 16.0.0-prerelease.2
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.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/DropdownMenu.js +26 -28
- package/lib/cjs/DropdownMenu.js.map +1 -1
- package/lib/es6/DropdownMenu.js +26 -27
- package/lib/es6/DropdownMenu.js.map +1 -1
- package/lib/esm/DropdownMenu.mjs +201 -205
- package/package.json +11 -14
package/lib/esm/DropdownMenu.mjs
CHANGED
|
@@ -1,100 +1,98 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import Q from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import X from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import N from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import W from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
import u from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { sstyled as ne } from "@semcore/
|
|
15
|
-
import oe, { assignProps as m, sstyled as y } from "@semcore/core";
|
|
6
|
+
import Y from "@babel/runtime/helpers/esm/classCallCheck";
|
|
7
|
+
import Z from "@babel/runtime/helpers/esm/createClass";
|
|
8
|
+
import O from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
9
|
+
import x from "@babel/runtime/helpers/esm/get";
|
|
10
|
+
import y from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
11
|
+
import ee from "@babel/runtime/helpers/esm/inherits";
|
|
12
|
+
import te from "@babel/runtime/helpers/esm/createSuper";
|
|
13
|
+
import M from "@babel/runtime/helpers/esm/defineProperty";
|
|
14
|
+
import { sstyled as b, createComponent as ne, assignProps as f, lastInteraction as re } from "@semcore/core";
|
|
16
15
|
import i from "react";
|
|
17
|
-
import
|
|
18
|
-
import D, { enhance as
|
|
19
|
-
import { useBox as
|
|
16
|
+
import oe from "classnames";
|
|
17
|
+
import D, { enhance as ie, selectedIndexContext as q, AbstractDropdown as ae } from "@semcore/dropdown";
|
|
18
|
+
import { useBox as _e, Flex as z } from "@semcore/flex-box";
|
|
20
19
|
import k, { hideScrollBarsFromScreenReadersContext as se } from "@semcore/scroll-area";
|
|
21
|
-
import { useUID as
|
|
22
|
-
import { localizedMessages as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
var me = ["className"], he = (
|
|
20
|
+
import { useUID as ge } from "@semcore/core/lib/utils/uniqueID";
|
|
21
|
+
import { localizedMessages as de } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
22
|
+
import { isAdvanceMode as L } from "@semcore/core/lib/utils/findComponent";
|
|
23
|
+
import { forkRef as G } from "@semcore/core/lib/utils/ref";
|
|
24
|
+
import { callAllEventHandlers as A } from "@semcore/core/lib/utils/assignProps";
|
|
25
|
+
import le from "@semcore/button";
|
|
26
|
+
import { Text as ue } from "@semcore/typography";
|
|
27
|
+
var ce = ["className"], pe = (
|
|
30
28
|
/*__reshadow_css_start__*/
|
|
31
|
-
(
|
|
29
|
+
(b.insert(
|
|
32
30
|
/*__inner_css_start__*/
|
|
33
|
-
`.
|
|
31
|
+
`.___SDropdownMenuList_g9pft_gg_{max-height:240px;padding:var(--intergalactic-spacing-1x, 4px)0;position:relative;min-height:26px;min-width:32px;box-sizing:content-box;z-index:0;color:var(--intergalactic-text-primary, #191b23)}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_:after,.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_:before{width:16px;height:100%;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_median_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,
|
|
34
32
|
linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
35
|
-
)}.
|
|
33
|
+
)}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_median_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,
|
|
36
34
|
linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
37
|
-
)}.
|
|
35
|
+
)}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_start_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,
|
|
38
36
|
linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
39
|
-
)}.
|
|
37
|
+
)}.___SDropdownMenuList_g9pft_gg_ .___SShadowHorizontal_g9pft_gg_._position_end_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,
|
|
40
38
|
linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
41
|
-
)}.
|
|
39
|
+
)}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_:after,.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_:before{width:100%;height:16px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_median_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,
|
|
42
40
|
linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
43
|
-
)}.
|
|
41
|
+
)}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_median_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,
|
|
44
42
|
linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
45
|
-
)}.
|
|
43
|
+
)}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_start_g9pft_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,
|
|
46
44
|
linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
47
|
-
)}.
|
|
45
|
+
)}.___SDropdownMenuList_g9pft_gg_ .___SShadowVertical_g9pft_gg_._position_end_g9pft_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,
|
|
48
46
|
linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)
|
|
49
|
-
)}.
|
|
50
|
-
"
|
|
47
|
+
)}.___SDropdownMenuItemContainer_g9pft_gg_.__nesting-trigger_g9pft_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_g9pft_gg_,.___SItemContentText_g9pft_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_g9pft_gg_:first-child,.___SItemContentText_g9pft_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_g9pft_gg_:last-child,.___SItemContentText_g9pft_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_g9pft_gg_,.___SDropdownMenuNesting_g9pft_gg_._size_l_g9pft_gg_,.___SDropdownMenuNesting_g9pft_gg_._size_m_g9pft_gg_{padding:0}.___SDropdownMenuNesting_g9pft_gg_.__highlighted_g9pft_gg_{z-index:1;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5)) inset}.___SDropdownNestingItem_g9pft_gg_._size_l_g9pft_gg_,.___SDropdownNestingItem_g9pft_gg_._size_m_g9pft_gg_{padding-right:0}.___SDropdownNestingItem_g9pft_gg_ .___SDropdownMenuItemContainer_g9pft_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemContent_g9pft_gg_:focus{outline:0}.___SItemHint_g9pft_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}`,
|
|
48
|
+
"g9pft_gg_"
|
|
51
49
|
), {
|
|
52
|
-
__SDropdownMenuItemContainer: "
|
|
53
|
-
"_nesting-trigger": "__nesting-
|
|
54
|
-
__SDropdownMenuNesting: "
|
|
55
|
-
_size_l: "
|
|
56
|
-
_size_m: "
|
|
57
|
-
_highlighted: "
|
|
58
|
-
__SDropdownNestingItem: "
|
|
59
|
-
__SItemContent: "
|
|
60
|
-
__SItemHint: "
|
|
61
|
-
__SDropdownMenuList: "
|
|
62
|
-
__SShadowHorizontal: "
|
|
63
|
-
_position_median: "
|
|
64
|
-
_position_start: "
|
|
65
|
-
_position_end: "
|
|
66
|
-
__SShadowVertical: "
|
|
67
|
-
__SDropdownMenuItemAddon: "
|
|
68
|
-
__SItemContentText: "
|
|
50
|
+
__SDropdownMenuItemContainer: "___SDropdownMenuItemContainer_g9pft_gg_",
|
|
51
|
+
"_nesting-trigger": "__nesting-trigger_g9pft_gg_",
|
|
52
|
+
__SDropdownMenuNesting: "___SDropdownMenuNesting_g9pft_gg_",
|
|
53
|
+
_size_l: "_size_l_g9pft_gg_",
|
|
54
|
+
_size_m: "_size_m_g9pft_gg_",
|
|
55
|
+
_highlighted: "__highlighted_g9pft_gg_",
|
|
56
|
+
__SDropdownNestingItem: "___SDropdownNestingItem_g9pft_gg_",
|
|
57
|
+
__SItemContent: "___SItemContent_g9pft_gg_",
|
|
58
|
+
__SItemHint: "___SItemHint_g9pft_gg_",
|
|
59
|
+
__SDropdownMenuList: "___SDropdownMenuList_g9pft_gg_",
|
|
60
|
+
__SShadowHorizontal: "___SShadowHorizontal_g9pft_gg_",
|
|
61
|
+
_position_median: "_position_median_g9pft_gg_",
|
|
62
|
+
_position_start: "_position_start_g9pft_gg_",
|
|
63
|
+
_position_end: "_position_end_g9pft_gg_",
|
|
64
|
+
__SShadowVertical: "___SShadowVertical_g9pft_gg_",
|
|
65
|
+
__SDropdownMenuItemAddon: "___SDropdownMenuItemAddon_g9pft_gg_",
|
|
66
|
+
__SItemContentText: "___SItemContentText_g9pft_gg_"
|
|
69
67
|
})
|
|
70
68
|
), U = function(_) {
|
|
71
69
|
var t = _.children;
|
|
72
70
|
return /* @__PURE__ */ i.createElement(se.Provider, {
|
|
73
71
|
value: !0
|
|
74
72
|
}, t);
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
var _ =
|
|
73
|
+
}, H = /* @__PURE__ */ i.createContext({}), P = /* @__PURE__ */ function(r) {
|
|
74
|
+
ee(t, r);
|
|
75
|
+
var _ = te(t);
|
|
78
76
|
function t() {
|
|
79
77
|
var a;
|
|
80
|
-
|
|
81
|
-
for (var
|
|
78
|
+
Y(this, t);
|
|
79
|
+
for (var n = arguments.length, o = new Array(n), e = 0; e < n; e++)
|
|
82
80
|
o[e] = arguments[e];
|
|
83
|
-
return a = _.call.apply(_, [this].concat(o)),
|
|
81
|
+
return a = _.call.apply(_, [this].concat(o)), M(O(a), "actionsRef", /* @__PURE__ */ i.createRef()), M(O(a), "role", "menu"), a;
|
|
84
82
|
}
|
|
85
|
-
return
|
|
83
|
+
return Z(t, [{
|
|
86
84
|
key: "uncontrolledProps",
|
|
87
85
|
value: function() {
|
|
88
|
-
var
|
|
89
|
-
return u(u({},
|
|
86
|
+
var n = this;
|
|
87
|
+
return u(u({}, x(y(t.prototype), "uncontrolledProps", this).call(this)), {}, {
|
|
90
88
|
visible: [null, function(o) {
|
|
91
89
|
o === !0 && setTimeout(function() {
|
|
92
|
-
var e,
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
for (var
|
|
96
|
-
if (
|
|
97
|
-
|
|
90
|
+
var e, s, g = (e = n.menuRef.current) === null || e === void 0 ? void 0 : e.querySelectorAll('[role="menuitemcheckbox"], [role="menuitemradio"]'), d = (s = n.menuRef.current) === null || s === void 0 ? void 0 : s.querySelector('[aria-checked="true"]');
|
|
91
|
+
if (d && g && n.asProps.itemsCount === void 0) {
|
|
92
|
+
n.scrollToNode(d, !0);
|
|
93
|
+
for (var p = 0; p < g.length; p++)
|
|
94
|
+
if (g[p] === d) {
|
|
95
|
+
n.handlers.highlightedIndex(p);
|
|
98
96
|
break;
|
|
99
97
|
}
|
|
100
98
|
}
|
|
@@ -104,31 +102,31 @@ var me = ["className"], he = (
|
|
|
104
102
|
}
|
|
105
103
|
}, {
|
|
106
104
|
key: "itemRef",
|
|
107
|
-
value: function(
|
|
108
|
-
|
|
105
|
+
value: function(n, o, e) {
|
|
106
|
+
x(y(t.prototype), "itemRef", this).call(this, n, o, e), e === document.activeElement && x(y(t.prototype), "scrollToNode", this).call(this, e);
|
|
109
107
|
}
|
|
110
108
|
}, {
|
|
111
109
|
key: "getTriggerProps",
|
|
112
110
|
value: function() {
|
|
113
|
-
var
|
|
114
|
-
return u(u({},
|
|
115
|
-
onKeyDown:
|
|
116
|
-
"aria-controls":
|
|
117
|
-
"aria-haspopup":
|
|
111
|
+
var n = this.asProps, o = n.Children, e = n.uid, s = n.visible, g = L(o, [v.Menu.displayName]), d = g ? "igc-".concat(e, "-list") : "igc-".concat(e, "-popper");
|
|
112
|
+
return u(u({}, x(y(t.prototype), "getTriggerProps", this).call(this)), {}, {
|
|
113
|
+
onKeyDown: A(this.handlePreventCommonKeyDown.bind(this), this.handleOpenKeyDown.bind(this), this.handleKeyDownForMenu("trigger")),
|
|
114
|
+
"aria-controls": s ? d : void 0,
|
|
115
|
+
"aria-haspopup": g ? "true" : "dialog"
|
|
118
116
|
});
|
|
119
117
|
}
|
|
120
118
|
}, {
|
|
121
119
|
key: "getListProps",
|
|
122
120
|
value: function() {
|
|
123
|
-
return u(u({},
|
|
124
|
-
onKeyDown:
|
|
121
|
+
return u(u({}, x(y(t.prototype), "getListProps", this).call(this)), {}, {
|
|
122
|
+
onKeyDown: A(this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu("list"), this.handleArrowKeyDown.bind(this))
|
|
125
123
|
});
|
|
126
124
|
}
|
|
127
125
|
}, {
|
|
128
126
|
key: "getPopperProps",
|
|
129
127
|
value: function() {
|
|
130
|
-
return u(u({},
|
|
131
|
-
onKeyDown:
|
|
128
|
+
return u(u({}, x(y(t.prototype), "getPopperProps", this).call(this)), {}, {
|
|
129
|
+
onKeyDown: A(this.handlePreventCommonKeyDown.bind(this), this.handlePreventPopperKeyDown.bind(this))
|
|
132
130
|
});
|
|
133
131
|
}
|
|
134
132
|
}, {
|
|
@@ -136,251 +134,249 @@ var me = ["className"], he = (
|
|
|
136
134
|
value: function() {
|
|
137
135
|
return u(u({}, this.getListProps()), {}, {
|
|
138
136
|
ref: this.actionsRef,
|
|
139
|
-
onKeyDown:
|
|
137
|
+
onKeyDown: A(this.handlePreventTabOnActions.bind(this), this.handlePreventCommonKeyDown.bind(this), this.handleKeyDownForMenu("list"), this.handleArrowKeyDown.bind(this))
|
|
140
138
|
});
|
|
141
139
|
}
|
|
142
140
|
}, {
|
|
143
141
|
key: "getItemProps",
|
|
144
|
-
value: function(
|
|
145
|
-
var e,
|
|
146
|
-
tabIndex:
|
|
147
|
-
ref: function(
|
|
148
|
-
return
|
|
142
|
+
value: function(n, o) {
|
|
143
|
+
var e, s = this, g = this.asProps, d = g.highlightedIndex, p = g.visible, l = (e = n.index) !== null && e !== void 0 ? e : o, m = l === d, c = u(u({}, x(y(t.prototype), "getItemProps", this).call(this, n, l)), {}, {
|
|
144
|
+
tabIndex: m && p ? 0 : -1,
|
|
145
|
+
ref: function(I) {
|
|
146
|
+
return s.itemRef(n, l, I);
|
|
149
147
|
},
|
|
150
148
|
actionsRef: this.actionsRef
|
|
151
149
|
});
|
|
152
|
-
if (
|
|
153
|
-
var
|
|
154
|
-
c.use = (
|
|
150
|
+
if (n.tag === le) {
|
|
151
|
+
var h, w, S;
|
|
152
|
+
c.use = (h = n.use) !== null && h !== void 0 ? h : "tertiary", c.theme = (w = n.theme) !== null && w !== void 0 ? w : "muted", c.size = (S = n.size) !== null && S !== void 0 ? S : "s", c.innerOutline = !1;
|
|
155
153
|
}
|
|
156
|
-
return
|
|
157
|
-
|
|
154
|
+
return n.selected && (c["aria-checked"] = !0), x(y(t.prototype), "childRole", this) === "menuitemradio" && (c.onClick = function() {
|
|
155
|
+
s.handlers.visible(!1);
|
|
158
156
|
}), c;
|
|
159
157
|
}
|
|
160
158
|
}, {
|
|
161
159
|
key: "handleKeyDownForMenu",
|
|
162
|
-
value: function(
|
|
160
|
+
value: function(n) {
|
|
163
161
|
var o = this;
|
|
164
162
|
return function(e) {
|
|
165
|
-
var
|
|
166
|
-
if (
|
|
163
|
+
var s, g, d = o.asProps, p = d.visible, l = d.placement, m = d.inlineActions;
|
|
164
|
+
if (n === "list" && !((s = o.menuRef.current) !== null && s !== void 0 && s.contains(e.target)) && !m)
|
|
167
165
|
return e.stopPropagation(), !1;
|
|
168
|
-
var c = e.key === "ArrowRight" && (
|
|
169
|
-
if (
|
|
166
|
+
var c = e.key === "ArrowRight" && (l == null ? void 0 : l.startsWith("right")) || e.key === "ArrowLeft" && (l == null ? void 0 : l.startsWith("left")), h = e.key === "ArrowLeft" && (l == null ? void 0 : l.startsWith("right")) || e.key === "ArrowRight" && (l == null ? void 0 : l.startsWith("left")) || e.key === "Escape", w = (g = e.target.getAttribute("role")) === null || g === void 0 ? void 0 : g.startsWith(x(y(t.prototype), "childRole", o));
|
|
167
|
+
if (n === "trigger" && (!p || m) && c && w)
|
|
170
168
|
return o.handlers.visible(!0), o.handlers.highlightedIndex(0), setTimeout(function() {
|
|
171
|
-
var
|
|
172
|
-
(
|
|
169
|
+
var C, I = o.asProps.highlightedIndex;
|
|
170
|
+
(C = o.itemRefs[I]) === null || C === void 0 || C.focus();
|
|
173
171
|
}, 0), e.preventDefault(), e.stopPropagation(), !1;
|
|
174
|
-
if (
|
|
175
|
-
var
|
|
176
|
-
return o.handlers.visible(!1), (
|
|
172
|
+
if (n === "list" && p && h && w && (!m || m && (e.key === "Escape" || o.asProps.highlightedIndex === 0))) {
|
|
173
|
+
var S;
|
|
174
|
+
return o.handlers.visible(!1), (S = o.triggerRef.current) === null || S === void 0 || S.focus(), e.preventDefault(), e.stopPropagation(), !1;
|
|
177
175
|
}
|
|
178
176
|
};
|
|
179
177
|
}
|
|
180
178
|
}, {
|
|
181
179
|
key: "handlePreventTabOnActions",
|
|
182
|
-
value: function(
|
|
183
|
-
if (
|
|
184
|
-
return
|
|
180
|
+
value: function(n) {
|
|
181
|
+
if (n.key === "Tab")
|
|
182
|
+
return n.stopPropagation(), n.preventDefault(), !1;
|
|
185
183
|
}
|
|
186
184
|
}, {
|
|
187
185
|
key: "render",
|
|
188
186
|
value: function() {
|
|
189
|
-
var
|
|
190
|
-
return this.itemProps = [], /* @__PURE__ */ i.createElement(
|
|
191
|
-
value:
|
|
192
|
-
}, /* @__PURE__ */ i.createElement(D,
|
|
193
|
-
timeout:
|
|
194
|
-
},
|
|
187
|
+
var n = this.asProps, o = this.asProps, e = o.Children, s = o.selectedIndex, g = o.interaction, d = o.timeout;
|
|
188
|
+
return this.itemProps = [], /* @__PURE__ */ i.createElement(q.Provider, {
|
|
189
|
+
value: s
|
|
190
|
+
}, /* @__PURE__ */ i.createElement(D, f({
|
|
191
|
+
timeout: d || (g === "hover" ? [0, 100] : void 0)
|
|
192
|
+
}, n), /* @__PURE__ */ i.createElement(e, null)));
|
|
195
193
|
}
|
|
196
194
|
}]), t;
|
|
197
|
-
}(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
195
|
+
}(ae);
|
|
196
|
+
M(P, "displayName", "DropdownMenu");
|
|
197
|
+
M(P, "style", pe);
|
|
198
|
+
M(P, "enhance", Object.values(ie));
|
|
199
|
+
M(P, "defaultProps", {
|
|
202
200
|
size: "m",
|
|
203
201
|
defaultVisible: !1,
|
|
204
202
|
defaultHighlightedIndex: 0,
|
|
205
203
|
defaultSelectedIndex: 0,
|
|
206
|
-
i18n:
|
|
204
|
+
i18n: de,
|
|
207
205
|
locale: "en",
|
|
208
206
|
interaction: "click",
|
|
209
207
|
inlineActions: !1,
|
|
210
208
|
placement: "bottom-start",
|
|
211
209
|
timeout: 0
|
|
212
210
|
});
|
|
213
|
-
|
|
211
|
+
M(P, "nestedMenuInteraction", {
|
|
214
212
|
trigger: [["onClick", "onMouseEnter"], ["onClick", "onMouseLeave"]],
|
|
215
213
|
popper: [["onMouseEnter"], ["onMouseLeave"]]
|
|
216
214
|
});
|
|
217
|
-
function
|
|
218
|
-
var _ = arguments[0], t, a =
|
|
219
|
-
return t =
|
|
215
|
+
function fe(r) {
|
|
216
|
+
var _ = arguments[0], t, a = r.styles, n = r.Children, o = k;
|
|
217
|
+
return t = b(a), /* @__PURE__ */ i.createElement(U, t.cn("ListBoxContextProvider", {}), /* @__PURE__ */ i.createElement(o, t.cn("SDropdownMenuList", u({}, f({
|
|
220
218
|
shadow: !0
|
|
221
219
|
}, _))), /* @__PURE__ */ i.createElement(k.Container, {
|
|
222
220
|
tabIndex: void 0
|
|
223
|
-
}, /* @__PURE__ */ i.createElement(
|
|
221
|
+
}, /* @__PURE__ */ i.createElement(n, t.cn("Children", {}))), /* @__PURE__ */ i.createElement(k.Bar, {
|
|
224
222
|
orientation: "horizontal"
|
|
225
223
|
}), /* @__PURE__ */ i.createElement(k.Bar, {
|
|
226
224
|
orientation: "vertical"
|
|
227
225
|
})));
|
|
228
226
|
}
|
|
229
|
-
function
|
|
230
|
-
var _ = arguments[0], t, a =
|
|
231
|
-
return t =
|
|
227
|
+
function me(r) {
|
|
228
|
+
var _ = arguments[0], t, a = r.styles, n = z;
|
|
229
|
+
return t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SDropdownMenuActions", u({}, f({}, _))));
|
|
232
230
|
}
|
|
233
|
-
function
|
|
234
|
-
var _ = arguments[0], t =
|
|
231
|
+
function he(r) {
|
|
232
|
+
var _ = arguments[0], t = r.visible, a = r.disablePortal, n = r.ignorePortalsStacking, o = r.disableEnforceFocus, e = r.interaction, s = r.autoFocus, g = r.animationsDisabled, d = {
|
|
235
233
|
visible: t,
|
|
236
234
|
disablePortal: a,
|
|
237
|
-
ignorePortalsStacking:
|
|
235
|
+
ignorePortalsStacking: n,
|
|
238
236
|
disableEnforceFocus: o,
|
|
239
237
|
interaction: e,
|
|
240
|
-
autoFocus:
|
|
241
|
-
animationsDisabled:
|
|
238
|
+
autoFocus: s,
|
|
239
|
+
animationsDisabled: g
|
|
242
240
|
};
|
|
243
|
-
return /* @__PURE__ */ i.createElement(U, null, /* @__PURE__ */ i.createElement(v.Popper,
|
|
241
|
+
return /* @__PURE__ */ i.createElement(U, null, /* @__PURE__ */ i.createElement(v.Popper, W({}, d, {
|
|
244
242
|
role: null
|
|
245
|
-
}), /* @__PURE__ */ i.createElement(v.List,
|
|
243
|
+
}), /* @__PURE__ */ i.createElement(v.List, f({}, _))));
|
|
246
244
|
}
|
|
247
|
-
function
|
|
248
|
-
var _ = arguments[0], t, a =
|
|
245
|
+
function ve(r) {
|
|
246
|
+
var _ = arguments[0], t, a = r.id, n = r.styles, o = r.disabled, e = r.Children, s = r.forwardRef, g = r.role, d = r.tabIndex, p = r.actionsRef, l = r["aria-checked"], m = D.Item, c = i.useRef(), h = i.useState(!1), w = N(h, 2), S = w[0], C = w[1], I = {
|
|
249
247
|
contentId: a,
|
|
250
|
-
ref: G(
|
|
251
|
-
role:
|
|
252
|
-
tabIndex:
|
|
253
|
-
ariaChecked:
|
|
254
|
-
},
|
|
255
|
-
if (
|
|
256
|
-
var F = "igc-".concat(
|
|
257
|
-
|
|
248
|
+
ref: G(s, c),
|
|
249
|
+
role: g,
|
|
250
|
+
tabIndex: d,
|
|
251
|
+
ariaChecked: l
|
|
252
|
+
}, K = [], T = L(e, [v.displayName], !0), B = L(e, [v.Item.Hint.displayName], !0), R = L(e, [v.Item.Content.displayName], !0) || T || B;
|
|
253
|
+
if (B) {
|
|
254
|
+
var F = "igc-".concat(ge(), "-option-hint");
|
|
255
|
+
I.hintId = F, K.push(F);
|
|
258
256
|
}
|
|
259
|
-
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
}, $ = function(
|
|
263
|
-
|
|
257
|
+
return T && (I.hasSubMenu = !0), I.ariaDescribes = K, i.useEffect(function() {
|
|
258
|
+
var V = function(E) {
|
|
259
|
+
E.target === c.current && (C(!0), T && E.stopPropagation());
|
|
260
|
+
}, $ = function(E) {
|
|
261
|
+
E.target === c.current && (C(!1), p.current && (c.current.tabIndex = -1));
|
|
264
262
|
};
|
|
265
|
-
return document.addEventListener("focus",
|
|
263
|
+
return document.addEventListener("focus", V, {
|
|
266
264
|
capture: !0
|
|
267
265
|
}), document.addEventListener("blur", $, {
|
|
268
266
|
capture: !0
|
|
269
267
|
}), function() {
|
|
270
|
-
document.removeEventListener("focus",
|
|
268
|
+
document.removeEventListener("focus", V, {
|
|
271
269
|
capture: !0
|
|
272
270
|
}), document.removeEventListener("blur", $, {
|
|
273
271
|
capture: !0
|
|
274
272
|
});
|
|
275
273
|
};
|
|
276
|
-
}, [c.current])
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
"use:
|
|
283
|
-
"use:
|
|
284
|
-
"use:
|
|
285
|
-
"use:tabIndex": P ? void 0 : l,
|
|
286
|
-
"use:aria-checked": P ? void 0 : g
|
|
274
|
+
}, [c.current]), t = b(n), /* @__PURE__ */ i.createElement(H.Provider, {
|
|
275
|
+
value: I
|
|
276
|
+
}, /* @__PURE__ */ i.createElement(m, t.cn("SDropdownMenuItemContainer", u({}, f({
|
|
277
|
+
ref: R ? void 0 : I.ref,
|
|
278
|
+
"use:highlighted": !o && S && re.isKeyboard(),
|
|
279
|
+
"use:role": R ? void 0 : g,
|
|
280
|
+
"use:id": R ? void 0 : a,
|
|
281
|
+
"use:tabIndex": R ? void 0 : d,
|
|
282
|
+
"use:aria-checked": R ? void 0 : l
|
|
287
283
|
}, _))), /* @__PURE__ */ i.createElement(e, t.cn("Children", {}))));
|
|
288
284
|
}
|
|
289
|
-
function j(
|
|
290
|
-
var _ =
|
|
291
|
-
return /* @__PURE__ */ i.createElement(a,
|
|
292
|
-
className:
|
|
285
|
+
function j(r) {
|
|
286
|
+
var _ = _e(r, r.forwardRef), t = N(_, 2), a = t[0], n = t[1], o = n.className, e = X(n, ce), s = b(r.styles);
|
|
287
|
+
return /* @__PURE__ */ i.createElement(a, W({
|
|
288
|
+
className: oe(s.cn("SDropdownMenuItemAddon", r).className, o) || void 0
|
|
293
289
|
}, e));
|
|
294
290
|
}
|
|
295
|
-
function
|
|
296
|
-
var
|
|
297
|
-
return /* @__PURE__ */ i.createElement(D.Trigger,
|
|
291
|
+
function be() {
|
|
292
|
+
var r = arguments[0];
|
|
293
|
+
return /* @__PURE__ */ i.createElement(D.Trigger, f({}, r));
|
|
298
294
|
}
|
|
299
|
-
function we(
|
|
300
|
-
var _ = arguments[0], t, a =
|
|
301
|
-
e.hasSubMenu && (
|
|
302
|
-
var
|
|
295
|
+
function we(r) {
|
|
296
|
+
var _ = arguments[0], t, a = r.styles, n = z, o = i.useRef(), e = i.useContext(H), s = void 0;
|
|
297
|
+
e.hasSubMenu && (s = "true");
|
|
298
|
+
var g = i.useState(new Set(e.ariaDescribes)), d = N(g, 2), p = d[0], l = d[1];
|
|
303
299
|
return i.useEffect(function() {
|
|
304
|
-
var
|
|
305
|
-
c.getAttribute("aria-haspopup") === "true" && c.getAttribute("aria-describedby") &&
|
|
306
|
-
return
|
|
300
|
+
var m = o.current, c = m == null ? void 0 : m.parentElement;
|
|
301
|
+
c.getAttribute("aria-haspopup") === "true" && c.getAttribute("aria-describedby") && l(function(h) {
|
|
302
|
+
return h.add(c.getAttribute("aria-describedby")), new Set(h);
|
|
307
303
|
});
|
|
308
|
-
}, [e.ariaDescribes]), t =
|
|
304
|
+
}, [e.ariaDescribes]), t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SItemContent", u({}, f({
|
|
309
305
|
role: e.role,
|
|
310
306
|
id: e.contentId,
|
|
311
307
|
tabIndex: e.tabIndex,
|
|
312
308
|
ref: G(e.ref, o),
|
|
313
|
-
"use:aria-describedby":
|
|
309
|
+
"use:aria-describedby": Q(p).join(" "),
|
|
314
310
|
"aria-haspopup": e.hasSubMenu ? "true" : void 0,
|
|
315
|
-
"aria-expanded":
|
|
311
|
+
"aria-expanded": s,
|
|
316
312
|
"aria-checked": e.ariaChecked,
|
|
317
313
|
alignItems: "center",
|
|
318
314
|
justifyContent: e.hasSubMenu ? "space-between" : void 0
|
|
319
315
|
}, _))));
|
|
320
316
|
}
|
|
321
|
-
function
|
|
322
|
-
var _ = arguments[0], t, a =
|
|
323
|
-
return t =
|
|
317
|
+
function Se(r) {
|
|
318
|
+
var _ = arguments[0], t, a = r.styles, n = ue;
|
|
319
|
+
return t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SItemContentText", u({}, f({}, _))));
|
|
324
320
|
}
|
|
325
|
-
function
|
|
326
|
-
var _ = arguments[0], t, a =
|
|
327
|
-
return t =
|
|
321
|
+
function Ie(r) {
|
|
322
|
+
var _ = arguments[0], t, a = r.styles, n = z, o = i.useContext(H), e = o.hintId;
|
|
323
|
+
return t = b(a), /* @__PURE__ */ i.createElement(n, t.cn("SItemHint", u({}, f({
|
|
328
324
|
id: e,
|
|
329
325
|
"aria-hidden": "true"
|
|
330
326
|
}, _))));
|
|
331
327
|
}
|
|
332
|
-
function
|
|
328
|
+
function xe(r) {
|
|
333
329
|
var _ = arguments[0], t, a = D.Item;
|
|
334
|
-
return t =
|
|
330
|
+
return t = b(r.styles), /* @__PURE__ */ i.createElement(a, t.cn("SDropdownMenuItemContainer", u({}, f({
|
|
335
331
|
variant: "hint"
|
|
336
332
|
}, _))));
|
|
337
333
|
}
|
|
338
|
-
function
|
|
334
|
+
function ye(r) {
|
|
339
335
|
var _ = arguments[0], t, a = D.Item;
|
|
340
|
-
return t =
|
|
336
|
+
return t = b(r.styles), /* @__PURE__ */ i.createElement(a, t.cn("SDropdownMenuItemContainer", u({}, f({
|
|
341
337
|
variant: "title"
|
|
342
338
|
}, _))));
|
|
343
339
|
}
|
|
344
|
-
function
|
|
345
|
-
var _ = arguments[0], t =
|
|
346
|
-
return /* @__PURE__ */ i.createElement(v.Item,
|
|
340
|
+
function De(r) {
|
|
341
|
+
var _ = arguments[0], t = r.forwardRef;
|
|
342
|
+
return /* @__PURE__ */ i.createElement(v.Item, f({
|
|
347
343
|
ref: t
|
|
348
344
|
}, _));
|
|
349
345
|
}
|
|
350
|
-
function
|
|
351
|
-
var _ = arguments[0], t =
|
|
352
|
-
return /* @__PURE__ */ i.createElement(v.Item.Content,
|
|
346
|
+
function Ce(r) {
|
|
347
|
+
var _ = arguments[0], t = r.forwardRef;
|
|
348
|
+
return /* @__PURE__ */ i.createElement(v.Item.Content, f({
|
|
353
349
|
tag: v.Trigger,
|
|
354
350
|
ref: t,
|
|
355
351
|
"use:role": "menuitem"
|
|
356
352
|
}, _));
|
|
357
353
|
}
|
|
358
|
-
var v =
|
|
359
|
-
Trigger:
|
|
354
|
+
var v = ne(P, {
|
|
355
|
+
Trigger: be,
|
|
360
356
|
Popper: D.Popper,
|
|
361
|
-
List:
|
|
362
|
-
Actions:
|
|
363
|
-
Menu:
|
|
364
|
-
Item: [
|
|
357
|
+
List: fe,
|
|
358
|
+
Actions: me,
|
|
359
|
+
Menu: he,
|
|
360
|
+
Item: [ve, {
|
|
365
361
|
Addon: j,
|
|
366
362
|
Content: we,
|
|
367
|
-
Text:
|
|
368
|
-
Hint:
|
|
363
|
+
Text: Se,
|
|
364
|
+
Hint: Ie
|
|
369
365
|
}],
|
|
370
366
|
/**
|
|
371
367
|
* @deprecated. Use just Item. See examples on
|
|
372
368
|
*/
|
|
373
|
-
Nesting: [
|
|
374
|
-
Trigger:
|
|
369
|
+
Nesting: [De, {
|
|
370
|
+
Trigger: Ce,
|
|
375
371
|
Addon: j
|
|
376
372
|
}],
|
|
377
|
-
ItemTitle:
|
|
378
|
-
ItemHint:
|
|
373
|
+
ItemTitle: ye,
|
|
374
|
+
ItemHint: xe,
|
|
379
375
|
Group: D.Group
|
|
380
376
|
}, {
|
|
381
377
|
parent: [D]
|
|
382
378
|
});
|
|
383
|
-
v.selectedIndexContext =
|
|
379
|
+
v.selectedIndexContext = q;
|
|
384
380
|
export {
|
|
385
381
|
v as default
|
|
386
382
|
};
|