@semcore/dropdown-menu 4.43.5-prerelease.0 → 4.44.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 +12 -0
- package/lib/cjs/DropdownMenu.js +79 -40
- package/lib/cjs/DropdownMenu.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/es6/DropdownMenu.js +79 -40
- package/lib/es6/DropdownMenu.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/types/index.d.ts +9 -2
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [4.44.0] - 2024-12-23
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `menuitemcheckbox` and `menuitemradio` roles for DropdownMenu.Item.
|
|
10
|
+
|
|
11
|
+
## [4.43.6] - 2024-12-16
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Removed tabIndex on Menu Items in advanced mode.
|
|
16
|
+
|
|
5
17
|
## [4.43.5] - 2024-12-09
|
|
6
18
|
|
|
7
19
|
### Changed
|
package/lib/cjs/DropdownMenu.js
CHANGED
|
@@ -36,24 +36,24 @@ var _button = _interopRequireDefault(require("@semcore/button"));
|
|
|
36
36
|
var _typography = require("@semcore/typography");
|
|
37
37
|
var _excluded = ["className"];
|
|
38
38
|
/*__reshadow-styles__:"./style/dropdown-menu.shadow.css"*/
|
|
39
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
40
|
-
"__SDropdownMenuItemContainer": "
|
|
41
|
-
"_nesting-trigger": "__nesting-
|
|
42
|
-
"__SDropdownMenuNesting": "
|
|
43
|
-
"_size_l": "
|
|
44
|
-
"_size_m": "
|
|
45
|
-
"_highlighted": "
|
|
46
|
-
"__SDropdownNestingItem": "
|
|
47
|
-
"__SItemContent": "
|
|
48
|
-
"__SItemHint": "
|
|
49
|
-
"__SDropdownMenuList": "
|
|
50
|
-
"__SShadowHorizontal": "
|
|
51
|
-
"_position_median": "
|
|
52
|
-
"_position_start": "
|
|
53
|
-
"_position_end": "
|
|
54
|
-
"__SShadowVertical": "
|
|
55
|
-
"__SDropdownMenuItemAddon": "
|
|
56
|
-
"__SItemContentText": "
|
|
39
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SDropdownMenuList_1wzjs_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_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_:after,.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_:before{width:16px;height:100%;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_median_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_median_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_start_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_end_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_:after,.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_:before{width:100%;height:16px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_median_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_median_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_start_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_end_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuItemContainer_1wzjs_gg_.__nesting-trigger_1wzjs_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_1wzjs_gg_,.___SItemContentText_1wzjs_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_1wzjs_gg_:first-child,.___SItemContentText_1wzjs_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_1wzjs_gg_:last-child,.___SItemContentText_1wzjs_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_1wzjs_gg_,.___SDropdownMenuNesting_1wzjs_gg_._size_l_1wzjs_gg_,.___SDropdownMenuNesting_1wzjs_gg_._size_m_1wzjs_gg_{padding:0}.___SDropdownMenuNesting_1wzjs_gg_.__highlighted_1wzjs_gg_{z-index:1;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5)) inset}.___SDropdownNestingItem_1wzjs_gg_._size_l_1wzjs_gg_,.___SDropdownNestingItem_1wzjs_gg_._size_m_1wzjs_gg_{padding-right:0}.___SDropdownNestingItem_1wzjs_gg_ .___SDropdownMenuItemContainer_1wzjs_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemContent_1wzjs_gg_:focus{outline:0}.___SItemHint_1wzjs_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}" /*__inner_css_end__*/, "1wzjs_gg_") /*__reshadow_css_end__*/, {
|
|
40
|
+
"__SDropdownMenuItemContainer": "___SDropdownMenuItemContainer_1wzjs_gg_",
|
|
41
|
+
"_nesting-trigger": "__nesting-trigger_1wzjs_gg_",
|
|
42
|
+
"__SDropdownMenuNesting": "___SDropdownMenuNesting_1wzjs_gg_",
|
|
43
|
+
"_size_l": "_size_l_1wzjs_gg_",
|
|
44
|
+
"_size_m": "_size_m_1wzjs_gg_",
|
|
45
|
+
"_highlighted": "__highlighted_1wzjs_gg_",
|
|
46
|
+
"__SDropdownNestingItem": "___SDropdownNestingItem_1wzjs_gg_",
|
|
47
|
+
"__SItemContent": "___SItemContent_1wzjs_gg_",
|
|
48
|
+
"__SItemHint": "___SItemHint_1wzjs_gg_",
|
|
49
|
+
"__SDropdownMenuList": "___SDropdownMenuList_1wzjs_gg_",
|
|
50
|
+
"__SShadowHorizontal": "___SShadowHorizontal_1wzjs_gg_",
|
|
51
|
+
"_position_median": "_position_median_1wzjs_gg_",
|
|
52
|
+
"_position_start": "_position_start_1wzjs_gg_",
|
|
53
|
+
"_position_end": "_position_end_1wzjs_gg_",
|
|
54
|
+
"__SShadowVertical": "___SShadowVertical_1wzjs_gg_",
|
|
55
|
+
"__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_1wzjs_gg_",
|
|
56
|
+
"__SItemContentText": "___SItemContentText_1wzjs_gg_"
|
|
57
57
|
});
|
|
58
58
|
var ListBoxContextProvider = function ListBoxContextProvider(_ref22) {
|
|
59
59
|
var children = _ref22.children;
|
|
@@ -77,6 +77,33 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
77
77
|
return _this;
|
|
78
78
|
}
|
|
79
79
|
(0, _createClass2["default"])(DropdownMenuRoot, [{
|
|
80
|
+
key: "uncontrolledProps",
|
|
81
|
+
value: function uncontrolledProps() {
|
|
82
|
+
var _this2 = this;
|
|
83
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "uncontrolledProps", this).call(this)), {}, {
|
|
84
|
+
visible: [null, function (visible) {
|
|
85
|
+
if (visible === true) {
|
|
86
|
+
setTimeout(function () {
|
|
87
|
+
var _this2$menuRef$curren, _this2$menuRef$curren2;
|
|
88
|
+
var options = (_this2$menuRef$curren = _this2.menuRef.current) === null || _this2$menuRef$curren === void 0 ? void 0 : _this2$menuRef$curren.querySelectorAll('[role="menuitemcheckbox"], [role="menuitemradio"]');
|
|
89
|
+
var selected = (_this2$menuRef$curren2 = _this2.menuRef.current) === null || _this2$menuRef$curren2 === void 0 ? void 0 : _this2$menuRef$curren2.querySelector('[aria-checked="true"]');
|
|
90
|
+
if (selected && options) {
|
|
91
|
+
_this2.scrollToNode(selected);
|
|
92
|
+
for (var i = 0; i < options.length; i++) {
|
|
93
|
+
if (options[i] === selected) {
|
|
94
|
+
_this2.handlers.highlightedIndex(i);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// for some reason, Google Chrome optimizes this timeout with 0 value with previous render (when we set aria-selected)
|
|
100
|
+
// and that's why its skip scrollToNodes. We selected the appropriate timeout manually.
|
|
101
|
+
}, 30);
|
|
102
|
+
}
|
|
103
|
+
}]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
80
107
|
key: "itemRef",
|
|
81
108
|
value: function itemRef(props, index, node) {
|
|
82
109
|
(0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "itemRef", this).call(this, props, index, node);
|
|
@@ -124,7 +151,7 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
124
151
|
}, {
|
|
125
152
|
key: "getItemProps",
|
|
126
153
|
value: function getItemProps(props, index) {
|
|
127
|
-
var
|
|
154
|
+
var _this3 = this;
|
|
128
155
|
var _this$asProps2 = this.asProps,
|
|
129
156
|
highlightedIndex = _this$asProps2.highlightedIndex,
|
|
130
157
|
visible = _this$asProps2.visible;
|
|
@@ -132,7 +159,7 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
132
159
|
var itemProps = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "getItemProps", this).call(this, props, index)), {}, {
|
|
133
160
|
tabIndex: isHighlighted && visible ? 0 : -1,
|
|
134
161
|
ref: function ref(node) {
|
|
135
|
-
return
|
|
162
|
+
return _this3.itemRef(props, index, node);
|
|
136
163
|
},
|
|
137
164
|
actionsRef: this.actionsRef
|
|
138
165
|
});
|
|
@@ -142,44 +169,52 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
142
169
|
itemProps.theme = (_props$theme = props.theme) !== null && _props$theme !== void 0 ? _props$theme : 'muted';
|
|
143
170
|
itemProps.size = (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : 's';
|
|
144
171
|
}
|
|
172
|
+
if (props.selected) {
|
|
173
|
+
itemProps['aria-checked'] = true;
|
|
174
|
+
}
|
|
175
|
+
if ((0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "childRole", this) === 'menuitemradio') {
|
|
176
|
+
itemProps.onClick = function () {
|
|
177
|
+
_this3.handlers.visible(false);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
145
180
|
return itemProps;
|
|
146
181
|
}
|
|
147
182
|
}, {
|
|
148
183
|
key: "handleKeyDownForMenu",
|
|
149
184
|
value: function handleKeyDownForMenu(place) {
|
|
150
|
-
var
|
|
185
|
+
var _this4 = this;
|
|
151
186
|
return function (e) {
|
|
152
|
-
var
|
|
153
|
-
var
|
|
154
|
-
visible =
|
|
155
|
-
placement =
|
|
156
|
-
inlineActions =
|
|
187
|
+
var _this4$menuRef$curren, _e$target$getAttribut;
|
|
188
|
+
var _this4$asProps = _this4.asProps,
|
|
189
|
+
visible = _this4$asProps.visible,
|
|
190
|
+
placement = _this4$asProps.placement,
|
|
191
|
+
inlineActions = _this4$asProps.inlineActions;
|
|
157
192
|
|
|
158
193
|
// stop propagation keyboard events if it calls not on DropdownMenu.Items
|
|
159
|
-
if (place === 'list' && !((
|
|
194
|
+
if (place === 'list' && !((_this4$menuRef$curren = _this4.menuRef.current) !== null && _this4$menuRef$curren !== void 0 && _this4$menuRef$curren.contains(e.target)) && !inlineActions) {
|
|
160
195
|
e.stopPropagation();
|
|
161
196
|
return false;
|
|
162
197
|
}
|
|
163
198
|
var show = e.key === 'ArrowRight' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('right')) || e.key === 'ArrowLeft' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('left'));
|
|
164
199
|
var hide = e.key === 'ArrowLeft' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('right')) || e.key === 'ArrowRight' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('left')) || e.key === 'Escape';
|
|
165
|
-
var isMenuItem = e.target.getAttribute('role') === (0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "childRole",
|
|
200
|
+
var isMenuItem = (_e$target$getAttribut = e.target.getAttribute('role')) === null || _e$target$getAttribut === void 0 ? void 0 : _e$target$getAttribut.startsWith((0, _get2["default"])((0, _getPrototypeOf2["default"])(DropdownMenuRoot.prototype), "childRole", _this4));
|
|
166
201
|
if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {
|
|
167
|
-
|
|
168
|
-
|
|
202
|
+
_this4.handlers.visible(true);
|
|
203
|
+
_this4.handlers.highlightedIndex(0);
|
|
169
204
|
setTimeout(function () {
|
|
170
|
-
var
|
|
171
|
-
var highlightedIndex =
|
|
172
|
-
(
|
|
205
|
+
var _this4$itemRefs$highl;
|
|
206
|
+
var highlightedIndex = _this4.asProps.highlightedIndex;
|
|
207
|
+
(_this4$itemRefs$highl = _this4.itemRefs[highlightedIndex]) === null || _this4$itemRefs$highl === void 0 ? void 0 : _this4$itemRefs$highl.focus();
|
|
173
208
|
}, 0);
|
|
174
209
|
e.preventDefault();
|
|
175
210
|
e.stopPropagation();
|
|
176
211
|
return false;
|
|
177
212
|
}
|
|
178
213
|
if (place === 'list' && visible && hide && isMenuItem) {
|
|
179
|
-
if (!inlineActions || inlineActions && (e.key === 'Escape' ||
|
|
180
|
-
var
|
|
181
|
-
|
|
182
|
-
(
|
|
214
|
+
if (!inlineActions || inlineActions && (e.key === 'Escape' || _this4.asProps.highlightedIndex === 0)) {
|
|
215
|
+
var _this4$triggerRef$cur;
|
|
216
|
+
_this4.handlers.visible(false);
|
|
217
|
+
(_this4$triggerRef$cur = _this4.triggerRef.current) === null || _this4$triggerRef$cur === void 0 ? void 0 : _this4$triggerRef$cur.focus();
|
|
183
218
|
e.preventDefault();
|
|
184
219
|
e.stopPropagation();
|
|
185
220
|
return false;
|
|
@@ -289,7 +324,8 @@ function Item(_ref25) {
|
|
|
289
324
|
forwardRef = _ref25.forwardRef,
|
|
290
325
|
role = _ref25.role,
|
|
291
326
|
tabIndex = _ref25.tabIndex,
|
|
292
|
-
actionsRef = _ref25.actionsRef
|
|
327
|
+
actionsRef = _ref25.actionsRef,
|
|
328
|
+
ariaChecked = _ref25['aria-checked'];
|
|
293
329
|
var SDropdownMenuItemContainer = _dropdown["default"].Item;
|
|
294
330
|
var itemRef = _react["default"].useRef();
|
|
295
331
|
var _React$useState = _react["default"].useState(false),
|
|
@@ -300,7 +336,8 @@ function Item(_ref25) {
|
|
|
300
336
|
contentId: id,
|
|
301
337
|
ref: (0, _ref31.forkRef)(forwardRef, itemRef),
|
|
302
338
|
role: role,
|
|
303
|
-
tabIndex: tabIndex
|
|
339
|
+
tabIndex: tabIndex,
|
|
340
|
+
ariaChecked: ariaChecked
|
|
304
341
|
};
|
|
305
342
|
var ariaDescribes = [];
|
|
306
343
|
var hasSubMenu = (0, _findComponent.isAdvanceMode)(Children, [DropdownMenu.displayName], true);
|
|
@@ -355,7 +392,8 @@ function Item(_ref25) {
|
|
|
355
392
|
"use:highlighted": !disabled && highlighted && focusSourceRef.current === 'keyboard',
|
|
356
393
|
"use:role": advancedMode ? undefined : role,
|
|
357
394
|
"use:id": advancedMode ? undefined : id,
|
|
358
|
-
"use:tabIndex": advancedMode ?
|
|
395
|
+
"use:tabIndex": advancedMode ? undefined : tabIndex,
|
|
396
|
+
"use:aria-checked": advancedMode ? undefined : ariaChecked
|
|
359
397
|
}, _ref5))), /*#__PURE__*/_react["default"].createElement(Children, _ref16.cn("Children", {}))));
|
|
360
398
|
}
|
|
361
399
|
function Addon(props) {
|
|
@@ -407,6 +445,7 @@ function ItemContent(_ref26) {
|
|
|
407
445
|
"use:aria-describedby": (0, _toConsumableArray2["default"])(describedby).join(' '),
|
|
408
446
|
"aria-haspopup": menuItemCtxValue.hasSubMenu ? 'true' : undefined,
|
|
409
447
|
"aria-expanded": subMenu,
|
|
448
|
+
"aria-checked": menuItemCtxValue.ariaChecked,
|
|
410
449
|
"alignItems": 'center',
|
|
411
450
|
"justifyContent": menuItemCtxValue.hasSubMenu ? 'space-between' : undefined
|
|
412
451
|
}, _ref7))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_classnames","_dropdown","_flexBox","_scrollArea","_uniqueID","_intergalacticDynamicLocales","_keyboardFocusEnhance","_findComponent","_ref31","_assignProps14","_button","_typography","_excluded","style","_index","sstyled","insert","ListBoxContextProvider","_ref22","children","createElement","hideScrollBarsFromScreenReadersContext","Provider","value","menuItemContext","React","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","createRef","_createClass2","key","itemRef","props","index","node","_get2","_getPrototypeOf2","prototype","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","visible","hasMenu","isAdvanceMode","DropdownMenu","Menu","displayName","ariaControls","_objectSpread2","onKeyDown","callAllEventHandlers","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_this2","_this$asProps2","highlightedIndex","isHighlighted","itemProps","tabIndex","tag","ButtonComponent","_props$use","_props$theme","_props$size","use","theme","size","place","_this3","e","_this3$menuRef$curren","_this3$asProps","placement","inlineActions","menuRef","current","contains","target","stopPropagation","show","startsWith","hide","isMenuItem","getAttribute","handlers","setTimeout","_this3$itemRefs$highl","itemRefs","focus","preventDefault","_this3$triggerRef$cur","triggerRef","render","_ref","_this$asProps3","selectedIndex","interaction","timeout","selectedIndexContext","Dropdown","assignProps","AbstractDropdown","Object","values","enhance","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","localizedMessages","locale","trigger","popper","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","ScrollAreaComponent","cn","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","Flex","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends2","role","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray2","highlighted","setHighlighted","menuItemContextValue","contentId","forkRef","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","useUID","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","useFocusSource","Addon","_useBox","useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties2","Trigger","_ref6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_toConsumableArray2","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","Text","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_ref10","_ref20","Title","_ref11","_ref21","Nesting","_ref29","_ref12","NestingTrigger","_ref30","_ref13","createComponent","ItemTitle","Group","_default","exports"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n static nestedMenuInteraction = {\n trigger: [\n ['onClick', 'onMouseEnter'],\n ['onClick', 'onMouseLeave'],\n ],\n popper: [['onMouseEnter'], ['onMouseLeave']],\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemProps(props, index) {\n const { highlightedIndex, visible } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted && visible ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n // stop propagation keyboard events if it calls not on DropdownMenu.Items\n if (place === 'list' && !this.menuRef.current?.contains(e.target) && !inlineActions) {\n e.stopPropagation();\n return false;\n }\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role') === super.childRole;\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({ id, styles, disabled, Children, forwardRef, role, tabIndex, actionsRef }) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? -1 : tabIndex}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAFA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,SAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,4BAAA,GAAAR,OAAA;AAEA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA2C,IAAAe,SAAA;AAAA;AAAA,IAAAC,KAAA,+BAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE3C,IAA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AAClB,CAAC,EACD;EACE/B,MAAM,EAAE,CAACtG,oBAAQ;AACnB,CAAC,CACF;AAEDnE,YAAY,CAACkE,oBAAoB,GAAGA,8BAAoB;AAAC,IAAAuI,QAAA,GAE1CzM,YAAY;AAAA0M,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_classnames","_dropdown","_flexBox","_scrollArea","_uniqueID","_intergalacticDynamicLocales","_keyboardFocusEnhance","_findComponent","_ref31","_assignProps14","_button","_typography","_excluded","style","_index","sstyled","insert","ListBoxContextProvider","_ref22","children","createElement","hideScrollBarsFromScreenReadersContext","Provider","value","menuItemContext","React","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","createRef","_createClass2","key","uncontrolledProps","_this2","_objectSpread2","_get2","_getPrototypeOf2","prototype","visible","setTimeout","_this2$menuRef$curren","_this2$menuRef$curren2","options","menuRef","current","querySelectorAll","selected","querySelector","scrollToNode","i","handlers","highlightedIndex","itemRef","props","index","node","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","hasMenu","isAdvanceMode","DropdownMenu","Menu","displayName","ariaControls","onKeyDown","callAllEventHandlers","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_this3","_this$asProps2","isHighlighted","itemProps","tabIndex","tag","ButtonComponent","_props$use","_props$theme","_props$size","use","theme","size","onClick","place","_this4","e","_this4$menuRef$curren","_e$target$getAttribut","_this4$asProps","placement","inlineActions","contains","target","stopPropagation","show","startsWith","hide","isMenuItem","getAttribute","_this4$itemRefs$highl","itemRefs","focus","preventDefault","_this4$triggerRef$cur","triggerRef","render","_ref","_this$asProps3","selectedIndex","interaction","timeout","selectedIndexContext","Dropdown","assignProps","AbstractDropdown","Object","values","enhance","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","localizedMessages","locale","trigger","popper","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","ScrollAreaComponent","cn","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","Flex","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends2","role","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","ariaChecked","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray2","highlighted","setHighlighted","menuItemContextValue","contentId","forkRef","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","useUID","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","useFocusSource","Addon","_useBox","useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties2","Trigger","_ref6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_toConsumableArray2","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","Text","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_ref10","_ref20","Title","_ref11","_ref21","Nesting","_ref29","_ref12","NestingTrigger","_ref30","_ref13","createComponent","ItemTitle","Group","_default","exports"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n static nestedMenuInteraction = {\n trigger: [\n ['onClick', 'onMouseEnter'],\n ['onClick', 'onMouseLeave'],\n ],\n popper: [['onMouseEnter'], ['onMouseLeave']],\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n uncontrolledProps() {\n return {\n ...super.uncontrolledProps(),\n visible: [\n null,\n (visible) => {\n if (visible === true) {\n setTimeout(() => {\n const options = this.menuRef.current?.querySelectorAll(\n '[role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]',\n );\n const selected = this.menuRef.current?.querySelector('[aria-checked=\"true\"]');\n\n if (selected && options) {\n this.scrollToNode(selected);\n\n for (let i = 0; i < options.length; i++) {\n if (options[i] === selected) {\n this.handlers.highlightedIndex(i);\n break;\n }\n }\n }\n // for some reason, Google Chrome optimizes this timeout with 0 value with previous render (when we set aria-selected)\n // and that's why its skip scrollToNodes. We selected the appropriate timeout manually.\n }, 30);\n }\n },\n ],\n };\n }\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemProps(props, index) {\n const { highlightedIndex, visible } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted && visible ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n if (props.selected) {\n itemProps['aria-checked'] = true;\n }\n\n if (super.childRole === 'menuitemradio') {\n itemProps.onClick = () => {\n this.handlers.visible(false);\n };\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n // stop propagation keyboard events if it calls not on DropdownMenu.Items\n if (place === 'list' && !this.menuRef.current?.contains(e.target) && !inlineActions) {\n e.stopPropagation();\n return false;\n }\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role')?.startsWith(super.childRole);\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({\n id,\n styles,\n disabled,\n Children,\n forwardRef,\n role,\n tabIndex,\n actionsRef,\n 'aria-checked': ariaChecked,\n}) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n ariaChecked,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? undefined : tabIndex}\n use:aria-checked={advancedMode ? undefined : ariaChecked}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n aria-checked={menuItemCtxValue.ariaChecked}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown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8D,oBAAoB,GAAGA,8BAAoB;AAAC,IAAAwI,QAAA,GAE1CtM,YAAY;AAAAuM,OAAA,cAAAD,QAAA"}
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\nimport { eventInteraction } from '@semcore/popper';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\nimport { eventInteraction } from '@semcore/popper';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\n /**\n * Set role `menuitemradio` (or `menuitemcheckbox` if `multiselect`) for Dropdown.Item\n */\n selectable?: boolean;\n /**\n * Multiple select\n */\n multiselect?: boolean;\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state. For selectable dropdowns only.\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n highlightedIndex?: number;\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps & DropdownPopperAriaProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n nestedMenuInteraction: eventInteraction;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
|
package/lib/es6/DropdownMenu.js
CHANGED
|
@@ -35,24 +35,24 @@ import ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@se
|
|
|
35
35
|
import { useUID } from '@semcore/utils/lib/uniqueID';
|
|
36
36
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
37
37
|
/*__reshadow-styles__:"./style/dropdown-menu.shadow.css"*/
|
|
38
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
39
|
-
"__SDropdownMenuItemContainer": "
|
|
40
|
-
"_nesting-trigger": "__nesting-
|
|
41
|
-
"__SDropdownMenuNesting": "
|
|
42
|
-
"_size_l": "
|
|
43
|
-
"_size_m": "
|
|
44
|
-
"_highlighted": "
|
|
45
|
-
"__SDropdownNestingItem": "
|
|
46
|
-
"__SItemContent": "
|
|
47
|
-
"__SItemHint": "
|
|
48
|
-
"__SDropdownMenuList": "
|
|
49
|
-
"__SShadowHorizontal": "
|
|
50
|
-
"_position_median": "
|
|
51
|
-
"_position_start": "
|
|
52
|
-
"_position_end": "
|
|
53
|
-
"__SShadowVertical": "
|
|
54
|
-
"__SDropdownMenuItemAddon": "
|
|
55
|
-
"__SItemContentText": "
|
|
38
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SDropdownMenuList_1wzjs_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_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_:after,.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_:before{width:16px;height:100%;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_median_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_median_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_start_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-left,\n linear-gradient(to right, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowHorizontal_1wzjs_gg_._position_end_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-right,\n linear-gradient(to left, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_:after,.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_:before{width:100%;height:16px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_median_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_median_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_start_1wzjs_gg_:before{background:var(--intergalactic-scroll-area-dropdown-menu-top,\n linear-gradient(to bottom, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuList_1wzjs_gg_ .___SShadowVertical_1wzjs_gg_._position_end_1wzjs_gg_:after{background:var(--intergalactic-scroll-area-dropdown-menu-bottom,\n linear-gradient(to top, rgba(255, 255, 255, 1) 34.38%, rgba(255, 255, 255, 0) 100%)\n )}.___SDropdownMenuItemContainer_1wzjs_gg_.__nesting-trigger_1wzjs_gg_{justify-content:space-between}.___SDropdownMenuItemAddon_1wzjs_gg_,.___SItemContentText_1wzjs_gg_{display:inline-flex;margin-left:var(--intergalactic-spacing-1x, 4px);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SDropdownMenuItemAddon_1wzjs_gg_:first-child,.___SItemContentText_1wzjs_gg_:first-child{margin-left:0}.___SDropdownMenuItemAddon_1wzjs_gg_:last-child,.___SItemContentText_1wzjs_gg_:last-child{margin-right:0}.___SDropdownMenuNesting_1wzjs_gg_,.___SDropdownMenuNesting_1wzjs_gg_._size_l_1wzjs_gg_,.___SDropdownMenuNesting_1wzjs_gg_._size_m_1wzjs_gg_{padding:0}.___SDropdownMenuNesting_1wzjs_gg_.__highlighted_1wzjs_gg_{z-index:1;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5)) inset}.___SDropdownNestingItem_1wzjs_gg_._size_l_1wzjs_gg_,.___SDropdownNestingItem_1wzjs_gg_._size_m_1wzjs_gg_{padding-right:0}.___SDropdownNestingItem_1wzjs_gg_ .___SDropdownMenuItemContainer_1wzjs_gg_{width:auto;padding-top:0;padding-bottom:0;padding-left:0;min-height:auto}.___SItemContent_1wzjs_gg_:focus{outline:0}.___SItemHint_1wzjs_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}" /*__inner_css_end__*/, "1wzjs_gg_") /*__reshadow_css_end__*/, {
|
|
39
|
+
"__SDropdownMenuItemContainer": "___SDropdownMenuItemContainer_1wzjs_gg_",
|
|
40
|
+
"_nesting-trigger": "__nesting-trigger_1wzjs_gg_",
|
|
41
|
+
"__SDropdownMenuNesting": "___SDropdownMenuNesting_1wzjs_gg_",
|
|
42
|
+
"_size_l": "_size_l_1wzjs_gg_",
|
|
43
|
+
"_size_m": "_size_m_1wzjs_gg_",
|
|
44
|
+
"_highlighted": "__highlighted_1wzjs_gg_",
|
|
45
|
+
"__SDropdownNestingItem": "___SDropdownNestingItem_1wzjs_gg_",
|
|
46
|
+
"__SItemContent": "___SItemContent_1wzjs_gg_",
|
|
47
|
+
"__SItemHint": "___SItemHint_1wzjs_gg_",
|
|
48
|
+
"__SDropdownMenuList": "___SDropdownMenuList_1wzjs_gg_",
|
|
49
|
+
"__SShadowHorizontal": "___SShadowHorizontal_1wzjs_gg_",
|
|
50
|
+
"_position_median": "_position_median_1wzjs_gg_",
|
|
51
|
+
"_position_start": "_position_start_1wzjs_gg_",
|
|
52
|
+
"_position_end": "_position_end_1wzjs_gg_",
|
|
53
|
+
"__SShadowVertical": "___SShadowVertical_1wzjs_gg_",
|
|
54
|
+
"__SDropdownMenuItemAddon": "___SDropdownMenuItemAddon_1wzjs_gg_",
|
|
55
|
+
"__SItemContentText": "___SItemContentText_1wzjs_gg_"
|
|
56
56
|
});
|
|
57
57
|
import { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
58
58
|
import { isAdvanceMode } from '@semcore/utils/lib/findComponent';
|
|
@@ -82,6 +82,33 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
82
82
|
return _this;
|
|
83
83
|
}
|
|
84
84
|
_createClass(DropdownMenuRoot, [{
|
|
85
|
+
key: "uncontrolledProps",
|
|
86
|
+
value: function uncontrolledProps() {
|
|
87
|
+
var _this2 = this;
|
|
88
|
+
return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DropdownMenuRoot.prototype), "uncontrolledProps", this).call(this)), {}, {
|
|
89
|
+
visible: [null, function (visible) {
|
|
90
|
+
if (visible === true) {
|
|
91
|
+
setTimeout(function () {
|
|
92
|
+
var _this2$menuRef$curren, _this2$menuRef$curren2;
|
|
93
|
+
var options = (_this2$menuRef$curren = _this2.menuRef.current) === null || _this2$menuRef$curren === void 0 ? void 0 : _this2$menuRef$curren.querySelectorAll('[role="menuitemcheckbox"], [role="menuitemradio"]');
|
|
94
|
+
var selected = (_this2$menuRef$curren2 = _this2.menuRef.current) === null || _this2$menuRef$curren2 === void 0 ? void 0 : _this2$menuRef$curren2.querySelector('[aria-checked="true"]');
|
|
95
|
+
if (selected && options) {
|
|
96
|
+
_this2.scrollToNode(selected);
|
|
97
|
+
for (var i = 0; i < options.length; i++) {
|
|
98
|
+
if (options[i] === selected) {
|
|
99
|
+
_this2.handlers.highlightedIndex(i);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// for some reason, Google Chrome optimizes this timeout with 0 value with previous render (when we set aria-selected)
|
|
105
|
+
// and that's why its skip scrollToNodes. We selected the appropriate timeout manually.
|
|
106
|
+
}, 30);
|
|
107
|
+
}
|
|
108
|
+
}]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
85
112
|
key: "itemRef",
|
|
86
113
|
value: function itemRef(props, index, node) {
|
|
87
114
|
_get(_getPrototypeOf(DropdownMenuRoot.prototype), "itemRef", this).call(this, props, index, node);
|
|
@@ -129,7 +156,7 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
129
156
|
}, {
|
|
130
157
|
key: "getItemProps",
|
|
131
158
|
value: function getItemProps(props, index) {
|
|
132
|
-
var
|
|
159
|
+
var _this3 = this;
|
|
133
160
|
var _this$asProps2 = this.asProps,
|
|
134
161
|
highlightedIndex = _this$asProps2.highlightedIndex,
|
|
135
162
|
visible = _this$asProps2.visible;
|
|
@@ -137,7 +164,7 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
137
164
|
var itemProps = _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DropdownMenuRoot.prototype), "getItemProps", this).call(this, props, index)), {}, {
|
|
138
165
|
tabIndex: isHighlighted && visible ? 0 : -1,
|
|
139
166
|
ref: function ref(node) {
|
|
140
|
-
return
|
|
167
|
+
return _this3.itemRef(props, index, node);
|
|
141
168
|
},
|
|
142
169
|
actionsRef: this.actionsRef
|
|
143
170
|
});
|
|
@@ -147,44 +174,52 @@ var DropdownMenuRoot = /*#__PURE__*/function (_AbstractDropdown) {
|
|
|
147
174
|
itemProps.theme = (_props$theme = props.theme) !== null && _props$theme !== void 0 ? _props$theme : 'muted';
|
|
148
175
|
itemProps.size = (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : 's';
|
|
149
176
|
}
|
|
177
|
+
if (props.selected) {
|
|
178
|
+
itemProps['aria-checked'] = true;
|
|
179
|
+
}
|
|
180
|
+
if (_get(_getPrototypeOf(DropdownMenuRoot.prototype), "childRole", this) === 'menuitemradio') {
|
|
181
|
+
itemProps.onClick = function () {
|
|
182
|
+
_this3.handlers.visible(false);
|
|
183
|
+
};
|
|
184
|
+
}
|
|
150
185
|
return itemProps;
|
|
151
186
|
}
|
|
152
187
|
}, {
|
|
153
188
|
key: "handleKeyDownForMenu",
|
|
154
189
|
value: function handleKeyDownForMenu(place) {
|
|
155
|
-
var
|
|
190
|
+
var _this4 = this;
|
|
156
191
|
return function (e) {
|
|
157
|
-
var
|
|
158
|
-
var
|
|
159
|
-
visible =
|
|
160
|
-
placement =
|
|
161
|
-
inlineActions =
|
|
192
|
+
var _this4$menuRef$curren, _e$target$getAttribut;
|
|
193
|
+
var _this4$asProps = _this4.asProps,
|
|
194
|
+
visible = _this4$asProps.visible,
|
|
195
|
+
placement = _this4$asProps.placement,
|
|
196
|
+
inlineActions = _this4$asProps.inlineActions;
|
|
162
197
|
|
|
163
198
|
// stop propagation keyboard events if it calls not on DropdownMenu.Items
|
|
164
|
-
if (place === 'list' && !((
|
|
199
|
+
if (place === 'list' && !((_this4$menuRef$curren = _this4.menuRef.current) !== null && _this4$menuRef$curren !== void 0 && _this4$menuRef$curren.contains(e.target)) && !inlineActions) {
|
|
165
200
|
e.stopPropagation();
|
|
166
201
|
return false;
|
|
167
202
|
}
|
|
168
203
|
var show = e.key === 'ArrowRight' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('right')) || e.key === 'ArrowLeft' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('left'));
|
|
169
204
|
var hide = e.key === 'ArrowLeft' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('right')) || e.key === 'ArrowRight' && (placement === null || placement === void 0 ? void 0 : placement.startsWith('left')) || e.key === 'Escape';
|
|
170
|
-
var isMenuItem = e.target.getAttribute('role') === _get(_getPrototypeOf(DropdownMenuRoot.prototype), "childRole",
|
|
205
|
+
var isMenuItem = (_e$target$getAttribut = e.target.getAttribute('role')) === null || _e$target$getAttribut === void 0 ? void 0 : _e$target$getAttribut.startsWith(_get(_getPrototypeOf(DropdownMenuRoot.prototype), "childRole", _this4));
|
|
171
206
|
if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {
|
|
172
|
-
|
|
173
|
-
|
|
207
|
+
_this4.handlers.visible(true);
|
|
208
|
+
_this4.handlers.highlightedIndex(0);
|
|
174
209
|
setTimeout(function () {
|
|
175
|
-
var
|
|
176
|
-
var highlightedIndex =
|
|
177
|
-
(
|
|
210
|
+
var _this4$itemRefs$highl;
|
|
211
|
+
var highlightedIndex = _this4.asProps.highlightedIndex;
|
|
212
|
+
(_this4$itemRefs$highl = _this4.itemRefs[highlightedIndex]) === null || _this4$itemRefs$highl === void 0 ? void 0 : _this4$itemRefs$highl.focus();
|
|
178
213
|
}, 0);
|
|
179
214
|
e.preventDefault();
|
|
180
215
|
e.stopPropagation();
|
|
181
216
|
return false;
|
|
182
217
|
}
|
|
183
218
|
if (place === 'list' && visible && hide && isMenuItem) {
|
|
184
|
-
if (!inlineActions || inlineActions && (e.key === 'Escape' ||
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
(
|
|
219
|
+
if (!inlineActions || inlineActions && (e.key === 'Escape' || _this4.asProps.highlightedIndex === 0)) {
|
|
220
|
+
var _this4$triggerRef$cur;
|
|
221
|
+
_this4.handlers.visible(false);
|
|
222
|
+
(_this4$triggerRef$cur = _this4.triggerRef.current) === null || _this4$triggerRef$cur === void 0 ? void 0 : _this4$triggerRef$cur.focus();
|
|
188
223
|
e.preventDefault();
|
|
189
224
|
e.stopPropagation();
|
|
190
225
|
return false;
|
|
@@ -294,7 +329,8 @@ function Item(_ref25) {
|
|
|
294
329
|
forwardRef = _ref25.forwardRef,
|
|
295
330
|
role = _ref25.role,
|
|
296
331
|
tabIndex = _ref25.tabIndex,
|
|
297
|
-
actionsRef = _ref25.actionsRef
|
|
332
|
+
actionsRef = _ref25.actionsRef,
|
|
333
|
+
ariaChecked = _ref25['aria-checked'];
|
|
298
334
|
var SDropdownMenuItemContainer = Dropdown.Item;
|
|
299
335
|
var itemRef = React.useRef();
|
|
300
336
|
var _React$useState = React.useState(false),
|
|
@@ -305,7 +341,8 @@ function Item(_ref25) {
|
|
|
305
341
|
contentId: id,
|
|
306
342
|
ref: forkRef(forwardRef, itemRef),
|
|
307
343
|
role: role,
|
|
308
|
-
tabIndex: tabIndex
|
|
344
|
+
tabIndex: tabIndex,
|
|
345
|
+
ariaChecked: ariaChecked
|
|
309
346
|
};
|
|
310
347
|
var ariaDescribes = [];
|
|
311
348
|
var hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);
|
|
@@ -360,7 +397,8 @@ function Item(_ref25) {
|
|
|
360
397
|
"use:highlighted": !disabled && highlighted && focusSourceRef.current === 'keyboard',
|
|
361
398
|
"use:role": advancedMode ? undefined : role,
|
|
362
399
|
"use:id": advancedMode ? undefined : id,
|
|
363
|
-
"use:tabIndex": advancedMode ?
|
|
400
|
+
"use:tabIndex": advancedMode ? undefined : tabIndex,
|
|
401
|
+
"use:aria-checked": advancedMode ? undefined : ariaChecked
|
|
364
402
|
}, _ref5))), /*#__PURE__*/React.createElement(Children, _ref16.cn("Children", {}))));
|
|
365
403
|
}
|
|
366
404
|
function Addon(props) {
|
|
@@ -412,6 +450,7 @@ function ItemContent(_ref26) {
|
|
|
412
450
|
"use:aria-describedby": _toConsumableArray(describedby).join(' '),
|
|
413
451
|
"aria-haspopup": menuItemCtxValue.hasSubMenu ? 'true' : undefined,
|
|
414
452
|
"aria-expanded": subMenu,
|
|
453
|
+
"aria-checked": menuItemCtxValue.ariaChecked,
|
|
415
454
|
"alignItems": 'center',
|
|
416
455
|
"justifyContent": menuItemCtxValue.hasSubMenu ? 'space-between' : undefined
|
|
417
456
|
}, _ref7))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["React","cn","createComponent","sstyled","Root","Dropdown","AbstractDropdown","selectedIndexContext","enhance","Flex","useBox","ScrollAreaComponent","hideScrollBarsFromScreenReadersContext","useUID","localizedMessages","style","_sstyled","insert","useFocusSource","isAdvanceMode","forkRef","callAllEventHandlers","ButtonComponent","Text","ListBoxContextProvider","_ref22","children","createElement","Provider","value","menuItemContext","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","createRef","_createClass","key","itemRef","props","index","node","_get","_getPrototypeOf","prototype","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","visible","hasMenu","DropdownMenu","Menu","displayName","ariaControls","_objectSpread","onKeyDown","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_this2","_this$asProps2","highlightedIndex","isHighlighted","itemProps","tabIndex","tag","_props$use","_props$theme","_props$size","use","theme","size","place","_this3","e","_this3$menuRef$curren","_this3$asProps","placement","inlineActions","menuRef","current","contains","target","stopPropagation","show","startsWith","hide","isMenuItem","getAttribute","handlers","setTimeout","_this3$itemRefs$highl","itemRefs","focus","preventDefault","_this3$triggerRef$cur","triggerRef","render","_ref","_this$asProps3","selectedIndex","interaction","timeout","_assignProps","Object","values","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","locale","trigger","popper","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","_assignProps2","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","_assignProps3","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends","role","_assignProps4","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray","highlighted","setHighlighted","menuItemContextValue","contentId","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","_assignProps5","Addon","_useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties","_excluded","Trigger","_ref6","_assignProps6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_assignProps7","_toConsumableArray","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","_assignProps8","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_assignProps9","_ref10","_ref20","_assignProps10","Title","_ref11","_ref21","_assignProps11","Nesting","_ref29","_ref12","_assignProps12","NestingTrigger","_ref30","_ref13","_assignProps13","ItemTitle","Group"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n static nestedMenuInteraction = {\n trigger: [\n ['onClick', 'onMouseEnter'],\n ['onClick', 'onMouseLeave'],\n ],\n popper: [['onMouseEnter'], ['onMouseLeave']],\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemProps(props, index) {\n const { highlightedIndex, visible } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted && visible ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n // stop propagation keyboard events if it calls not on DropdownMenu.Items\n if (place === 'list' && !this.menuRef.current?.contains(e.target) && !inlineActions) {\n e.stopPropagation();\n return false;\n }\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role') === super.childRole;\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({ id, styles, disabled, Children, forwardRef, role, tabIndex, actionsRef }) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? -1 : tabIndex}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,YAAY;AAC3B,OAAOC,eAAe,IAAIC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC9D,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,oBAAoB,EAAEC,OAAO,QAAQ,mBAAmB;AAC7F,SAASC,IAAI,EAAEC,MAAM,QAAQ,mBAAmB;AAChD,OAAOC,mBAAmB,IAAIC,sCAAsC,QAAQ,sBAAsB;AAClG,SAASC,MAAM,QAAQ,6BAA6B;AACpD,SAASC,iBAAiB,QAAQ,gDAAgD;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAEnF,SAASC,cAAc,QAAQ,kDAAkD;AACjF,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,OAAOC,eAAe,MAAM,iBAAiB;AAC7C,SAASC,IAAI,QAAQ,qBAAqB;AAE1C,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,MAAA;EAAA,IAAMC,QAAQ,GAAAD,MAAA,CAARC,QAAQ;EAAA,oBACxC1B,KAAA,CAAA2B,aAAA,CAACf,sCAAsC,CAACgB,QAAQ;IAACC,KAAK,EAAE;EAAK,GAC1DH,QAAQ,CACuC;AAAA,CACnD;AAED,IAAMI,eAAe,gBAAG9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K,QAAQ,CAACkK,MAAM;EACvBxB,IAAI,EAAJA,IAAI;EACJW,OAAO,EAAPA,OAAO;EACPpF,IAAI,EAAJA,IAAI;EACJqG,IAAI,EAAE,CAACA,IAAI,EAAE;IAAEiC,KAAK,EAALA,KAAK;IAAEX,OAAO,EAAEuB,WAAW;IAAEjM,IAAI,EAAEsN,eAAe;IAAE9C,IAAI,EAAEoD;EAAS,CAAC,CAAC;EACpF;AACJ;AACA;EACIc,OAAO,EAAE,CAACA,OAAO,EAAE;IAAE5C,OAAO,EAAEgD,cAAc;IAAEzD,KAAK,EAALA;EAAM,CAAC,CAAC;EACtD6D,SAAS,EAAEZ,KAAK;EAChBV,QAAQ,EAAEpD,IAAI;EACd2E,KAAK,EAAErQ,QAAQ,CAACqQ;AAClB,CAAC,EACD;EACEpC,MAAM,EAAE,CAACjO,QAAQ;AACnB,CAAC,CACF;AAEDgE,YAAY,CAAC9D,oBAAoB,GAAGA,oBAAoB;AAExD,eAAe8D,YAAY"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["React","cn","createComponent","sstyled","Root","Dropdown","AbstractDropdown","selectedIndexContext","enhance","Flex","useBox","ScrollAreaComponent","hideScrollBarsFromScreenReadersContext","useUID","localizedMessages","style","_sstyled","insert","useFocusSource","isAdvanceMode","forkRef","callAllEventHandlers","ButtonComponent","Text","ListBoxContextProvider","_ref22","children","createElement","Provider","value","menuItemContext","createContext","DropdownMenuRoot","_AbstractDropdown","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","createRef","_createClass","key","uncontrolledProps","_this2","_objectSpread","_get","_getPrototypeOf","prototype","visible","setTimeout","_this2$menuRef$curren","_this2$menuRef$curren2","options","menuRef","current","querySelectorAll","selected","querySelector","scrollToNode","i","handlers","highlightedIndex","itemRef","props","index","node","document","activeElement","getTriggerProps","_this$asProps","asProps","Children","uid","hasMenu","DropdownMenu","Menu","displayName","ariaControls","onKeyDown","handlePreventCommonKeyDown","bind","handleOpenKeyDown","handleKeyDownForMenu","undefined","getListProps","handleArrowKeyDown","getPopperProps","handlePreventPopperKeyDown","getActionsProps","ref","actionsRef","handlePreventTabOnActions","getItemProps","_this3","_this$asProps2","isHighlighted","itemProps","tabIndex","tag","_props$use","_props$theme","_props$size","use","theme","size","onClick","place","_this4","e","_this4$menuRef$curren","_e$target$getAttribut","_this4$asProps","placement","inlineActions","contains","target","stopPropagation","show","startsWith","hide","isMenuItem","getAttribute","_this4$itemRefs$highl","itemRefs","focus","preventDefault","_this4$triggerRef$cur","triggerRef","render","_ref","_this$asProps3","selectedIndex","interaction","timeout","_assignProps","Object","values","defaultVisible","defaultHighlightedIndex","defaultSelectedIndex","i18n","locale","trigger","popper","List","_ref23","_ref2","arguments[0]","_ref14","styles","SDropdownMenuList","_assignProps2","Container","Bar","orientation","Actions","_ref24","_ref3","_ref15","SDropdownMenuActions","_assignProps3","_ref4","disablePortal","ignorePortalsStacking","disableEnforceFocus","autoFocus","animationsDisabled","popperProps","Popper","_extends","role","_assignProps4","Item","_ref25","_ref5","_ref16","id","disabled","forwardRef","ariaChecked","SDropdownMenuItemContainer","useRef","_React$useState","useState","_React$useState2","_slicedToArray","highlighted","setHighlighted","menuItemContextValue","contentId","ariaDescribes","hasSubMenu","hasHint","Hint","advancedMode","Content","hintId","push","useEffect","onFocus","onBlur","addEventListener","capture","removeEventListener","focusSourceRef","_assignProps5","Addon","_useBox","_useBox2","SDropdownMenuItemAddon","_useBox2$","className","other","_objectWithoutProperties","_excluded","Trigger","_ref6","_assignProps6","ItemContent","_ref26","_ref7","_ref17","SItemContent","menuItemCtxValue","useContext","subMenu","_React$useState3","Set","_React$useState4","describedby","setDescribedby","element","parent","parentElement","prev","add","_assignProps7","_toConsumableArray","join","ItemContentText","_ref27","_ref8","_ref18","SItemContentText","_assignProps8","ItemHint","_ref28","_ref9","_ref19","SItemHint","_React$useContext","_assignProps9","_ref10","_ref20","_assignProps10","Title","_ref11","_ref21","_assignProps11","Nesting","_ref29","_ref12","_assignProps12","NestingTrigger","_ref30","_ref13","_assignProps13","ItemTitle","Group"],"sources":["../../src/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport createComponent, { sstyled, Root } from '@semcore/core';\nimport Dropdown, { AbstractDropdown, selectedIndexContext, enhance } from '@semcore/dropdown';\nimport { Flex, useBox } from '@semcore/flex-box';\nimport ScrollAreaComponent, { hideScrollBarsFromScreenReadersContext } from '@semcore/scroll-area';\nimport { useUID } from '@semcore/utils/lib/uniqueID';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport style from './style/dropdown-menu.shadow.css';\nimport { useFocusSource } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\nimport { forkRef } from '@semcore/utils/lib/ref';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonComponent from '@semcore/button';\nimport { Text } from '@semcore/typography';\n\nconst ListBoxContextProvider = ({ children }) => (\n <hideScrollBarsFromScreenReadersContext.Provider value={true}>\n {children}\n </hideScrollBarsFromScreenReadersContext.Provider>\n);\n\nconst menuItemContext = React.createContext({});\n\nclass DropdownMenuRoot extends AbstractDropdown {\n static displayName = 'DropdownMenu';\n static style = style;\n static enhance = Object.values(enhance);\n\n static defaultProps = {\n size: 'm',\n defaultVisible: false,\n defaultHighlightedIndex: 0,\n defaultSelectedIndex: 0,\n i18n: localizedMessages,\n locale: 'en',\n interaction: 'click',\n inlineActions: false,\n placement: 'bottom-start',\n timeout: 0,\n };\n\n static nestedMenuInteraction = {\n trigger: [\n ['onClick', 'onMouseEnter'],\n ['onClick', 'onMouseLeave'],\n ],\n popper: [['onMouseEnter'], ['onMouseLeave']],\n };\n\n actionsRef = React.createRef();\n role = 'menu';\n\n uncontrolledProps() {\n return {\n ...super.uncontrolledProps(),\n visible: [\n null,\n (visible) => {\n if (visible === true) {\n setTimeout(() => {\n const options = this.menuRef.current?.querySelectorAll(\n '[role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]',\n );\n const selected = this.menuRef.current?.querySelector('[aria-checked=\"true\"]');\n\n if (selected && options) {\n this.scrollToNode(selected);\n\n for (let i = 0; i < options.length; i++) {\n if (options[i] === selected) {\n this.handlers.highlightedIndex(i);\n break;\n }\n }\n }\n // for some reason, Google Chrome optimizes this timeout with 0 value with previous render (when we set aria-selected)\n // and that's why its skip scrollToNodes. We selected the appropriate timeout manually.\n }, 30);\n }\n },\n ],\n };\n }\n\n itemRef(props, index, node) {\n super.itemRef(props, index, node);\n\n if (node === document.activeElement) {\n super.scrollToNode(node);\n }\n }\n\n getTriggerProps() {\n const { Children, uid, visible } = this.asProps;\n const hasMenu = isAdvanceMode(Children, [DropdownMenu.Menu.displayName]);\n const ariaControls = hasMenu ? `igc-${uid}-list` : `igc-${uid}-popper`;\n\n return {\n ...super.getTriggerProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleOpenKeyDown.bind(this),\n this.handleKeyDownForMenu('trigger'),\n ),\n 'aria-controls': visible ? ariaControls : undefined,\n 'aria-haspopup': hasMenu ? 'true' : 'dialog',\n };\n }\n\n getListProps() {\n return {\n ...super.getListProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getPopperProps() {\n return {\n ...super.getPopperProps(),\n onKeyDown: callAllEventHandlers(\n this.handlePreventCommonKeyDown.bind(this),\n this.handlePreventPopperKeyDown.bind(this),\n ),\n };\n }\n\n getActionsProps() {\n return {\n ...this.getListProps(),\n ref: this.actionsRef,\n onKeyDown: callAllEventHandlers(\n this.handlePreventTabOnActions.bind(this),\n this.handlePreventCommonKeyDown.bind(this),\n this.handleKeyDownForMenu('list'),\n this.handleArrowKeyDown.bind(this),\n ),\n };\n }\n\n getItemProps(props, index) {\n const { highlightedIndex, visible } = this.asProps;\n const isHighlighted = index === highlightedIndex;\n const itemProps = {\n ...super.getItemProps(props, index),\n tabIndex: isHighlighted && visible ? 0 : -1,\n ref: (node) => this.itemRef(props, index, node),\n actionsRef: this.actionsRef,\n };\n\n if (props.tag === ButtonComponent) {\n itemProps.use = props.use ?? 'tertiary';\n itemProps.theme = props.theme ?? 'muted';\n itemProps.size = props.size ?? 's';\n }\n\n if (props.selected) {\n itemProps['aria-checked'] = true;\n }\n\n if (super.childRole === 'menuitemradio') {\n itemProps.onClick = () => {\n this.handlers.visible(false);\n };\n }\n\n return itemProps;\n }\n\n handleKeyDownForMenu(place) {\n return (e) => {\n const { visible, placement, inlineActions } = this.asProps;\n\n // stop propagation keyboard events if it calls not on DropdownMenu.Items\n if (place === 'list' && !this.menuRef.current?.contains(e.target) && !inlineActions) {\n e.stopPropagation();\n return false;\n }\n\n const show =\n (e.key === 'ArrowRight' && placement?.startsWith('right')) ||\n (e.key === 'ArrowLeft' && placement?.startsWith('left'));\n const hide =\n (e.key === 'ArrowLeft' && placement?.startsWith('right')) ||\n (e.key === 'ArrowRight' && placement?.startsWith('left')) ||\n e.key === 'Escape';\n const isMenuItem = e.target.getAttribute('role')?.startsWith(super.childRole);\n\n if (place === 'trigger' && (!visible || inlineActions) && show && isMenuItem) {\n this.handlers.visible(true);\n this.handlers.highlightedIndex(0);\n setTimeout(() => {\n const { highlightedIndex } = this.asProps;\n this.itemRefs[highlightedIndex]?.focus();\n }, 0);\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n if (place === 'list' && visible && hide && isMenuItem) {\n if (\n !inlineActions ||\n (inlineActions && (e.key === 'Escape' || this.asProps.highlightedIndex === 0))\n ) {\n this.handlers.visible(false);\n this.triggerRef.current?.focus();\n\n e.preventDefault();\n e.stopPropagation();\n return false;\n }\n }\n };\n }\n\n handlePreventTabOnActions(e) {\n if (e.key === 'Tab') {\n e.stopPropagation();\n e.preventDefault();\n return false;\n }\n }\n\n render() {\n const { Children, selectedIndex, interaction, timeout } = this.asProps;\n\n this.itemProps = [];\n\n return (\n <selectedIndexContext.Provider value={selectedIndex}>\n <Root\n render={Dropdown}\n timeout={timeout || (interaction === 'hover' ? [0, 100] : undefined)}\n >\n <Children />\n </Root>\n </selectedIndexContext.Provider>\n );\n }\n}\n\nfunction List({ styles, Children }) {\n const SDropdownMenuList = Root;\n\n return sstyled(styles)(\n <ListBoxContextProvider>\n <SDropdownMenuList render={ScrollAreaComponent} shadow={true}>\n <ScrollAreaComponent.Container tabIndex={undefined}>\n <Children />\n </ScrollAreaComponent.Container>\n <ScrollAreaComponent.Bar orientation='horizontal' />\n <ScrollAreaComponent.Bar orientation='vertical' />\n </SDropdownMenuList>\n </ListBoxContextProvider>,\n );\n}\nfunction Actions({ styles }) {\n const SDropdownMenuActions = Root;\n\n return sstyled(styles)(<SDropdownMenuActions render={Flex} />);\n}\n\nfunction Menu(props) {\n const {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n } = props;\n const popperProps = {\n visible,\n disablePortal,\n ignorePortalsStacking,\n disableEnforceFocus,\n interaction,\n autoFocus,\n animationsDisabled,\n };\n return (\n <ListBoxContextProvider>\n <DropdownMenu.Popper {...popperProps} role={null}>\n <Root render={DropdownMenu.List} />\n </DropdownMenu.Popper>\n </ListBoxContextProvider>\n );\n}\n\nfunction Item({\n id,\n styles,\n disabled,\n Children,\n forwardRef,\n role,\n tabIndex,\n actionsRef,\n 'aria-checked': ariaChecked,\n}) {\n const SDropdownMenuItemContainer = Root;\n const itemRef = React.useRef();\n\n const [highlighted, setHighlighted] = React.useState(false);\n\n const menuItemContextValue = {\n contentId: id,\n ref: forkRef(forwardRef, itemRef),\n role,\n tabIndex,\n ariaChecked,\n };\n const ariaDescribes = [];\n\n const hasSubMenu = isAdvanceMode(Children, [DropdownMenu.displayName], true);\n const hasHint = isAdvanceMode(Children, [DropdownMenu.Item.Hint.displayName], true);\n const advancedMode =\n isAdvanceMode(Children, [DropdownMenu.Item.Content.displayName], true) || hasSubMenu || hasHint;\n\n if (hasHint) {\n const hintId = `igc-${useUID()}-option-hint`;\n\n menuItemContextValue.hintId = hintId;\n ariaDescribes.push(hintId);\n }\n\n if (hasSubMenu) {\n menuItemContextValue.hasSubMenu = true;\n }\n\n menuItemContextValue.ariaDescribes = ariaDescribes;\n\n React.useEffect(() => {\n const onFocus = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(true);\n\n if (hasSubMenu) {\n e.stopPropagation();\n }\n }\n };\n const onBlur = (e) => {\n if (e.target === itemRef.current) {\n setHighlighted(false);\n\n if (actionsRef.current) {\n itemRef.current.tabIndex = -1;\n }\n }\n };\n\n document.addEventListener('focus', onFocus, { capture: true });\n document.addEventListener('blur', onBlur, { capture: true });\n\n return () => {\n document.removeEventListener('focus', onFocus, { capture: true });\n document.removeEventListener('blur', onBlur, { capture: true });\n };\n }, [itemRef.current]);\n\n const focusSourceRef = useFocusSource();\n\n return sstyled(styles)(\n <menuItemContext.Provider value={menuItemContextValue}>\n <SDropdownMenuItemContainer\n render={Dropdown.Item}\n ref={advancedMode ? undefined : menuItemContextValue.ref}\n use:highlighted={!disabled && highlighted && focusSourceRef.current === 'keyboard'}\n use:role={advancedMode ? undefined : role}\n use:id={advancedMode ? undefined : id}\n use:tabIndex={advancedMode ? undefined : tabIndex}\n use:aria-checked={advancedMode ? undefined : ariaChecked}\n >\n <Children />\n </SDropdownMenuItemContainer>\n </menuItemContext.Provider>,\n );\n}\n\nfunction Addon(props) {\n const [SDropdownMenuItemAddon, { className, ...other }] = useBox(props, props.forwardRef);\n const styles = sstyled(props.styles);\n return (\n <SDropdownMenuItemAddon\n className={cn(styles.cn('SDropdownMenuItemAddon', props).className, className) || undefined}\n {...other}\n />\n );\n}\n\nfunction Trigger() {\n return <Root render={Dropdown.Trigger} />;\n}\n\nfunction ItemContent({ styles }) {\n const SItemContent = Root;\n const ref = React.useRef();\n const menuItemCtxValue = React.useContext(menuItemContext);\n\n let subMenu = undefined;\n\n if (menuItemCtxValue.hasSubMenu) {\n subMenu = 'true';\n }\n\n const [describedby, setDescribedby] = React.useState(new Set(menuItemCtxValue.ariaDescribes));\n\n React.useEffect(() => {\n const element = ref.current;\n const parent = element?.parentElement;\n\n if (\n parent.getAttribute('aria-haspopup') === 'true' &&\n parent.getAttribute('aria-describedby')\n ) {\n setDescribedby((prev) => {\n prev.add(parent.getAttribute('aria-describedby'));\n\n return new Set(prev);\n });\n }\n }, [menuItemCtxValue.ariaDescribes]);\n\n return sstyled(styles)(\n <SItemContent\n render={Flex}\n role={menuItemCtxValue.role}\n id={menuItemCtxValue.contentId}\n tabIndex={menuItemCtxValue.tabIndex}\n ref={forkRef(menuItemCtxValue.ref, ref)}\n use:aria-describedby={[...describedby].join(' ')}\n aria-haspopup={menuItemCtxValue.hasSubMenu ? 'true' : undefined}\n aria-expanded={subMenu}\n aria-checked={menuItemCtxValue.ariaChecked}\n alignItems='center'\n justifyContent={menuItemCtxValue.hasSubMenu ? 'space-between' : undefined}\n />,\n );\n}\n\nfunction ItemContentText({ styles }) {\n const SItemContentText = Root;\n return sstyled(styles)(<SItemContentText render={Text} />);\n}\n\nfunction ItemHint({ styles }) {\n const SItemHint = Root;\n const { hintId } = React.useContext(menuItemContext);\n\n return sstyled(styles)(<SItemHint render={Flex} id={hintId} aria-hidden={'true'} />);\n}\n\n/**\n * @deprecated Use Item hint\n */\nfunction Hint(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='hint' />,\n );\n}\n/**\n * @deprecated Use Group with title prop\n */\nfunction Title(props) {\n const SDropdownMenuItemContainer = Root;\n return sstyled(props.styles)(\n <SDropdownMenuItemContainer render={Dropdown.Item} variant='title' />,\n );\n}\n\n/**\n * @deprecated\n */\nfunction Nesting({ forwardRef }) {\n return <Root render={DropdownMenu.Item} ref={forwardRef} />;\n}\n\n/**\n * @deprecated\n */\nfunction NestingTrigger({ forwardRef }) {\n return (\n <Root\n render={DropdownMenu.Item.Content}\n tag={DropdownMenu.Trigger}\n ref={forwardRef}\n use:role={'menuitem'}\n />\n );\n}\n\nconst DropdownMenu = createComponent(\n DropdownMenuRoot,\n {\n Trigger,\n Popper: Dropdown.Popper,\n List,\n Actions,\n Menu,\n Item: [Item, { Addon, Content: ItemContent, Text: ItemContentText, Hint: ItemHint }],\n /**\n * @deprecated. Use just Item. See examples on\n */\n Nesting: [Nesting, { Trigger: NestingTrigger, Addon }],\n ItemTitle: Title,\n ItemHint: Hint,\n Group: Dropdown.Group,\n },\n {\n parent: [Dropdown],\n },\n);\n\nDropdownMenu.selectedIndexContext = selectedIndexContext;\n\nexport default DropdownMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,YAAY;AAC3B,OAAOC,eAAe,IAAIC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC9D,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,oBAAoB,EAAEC,OAAO,QAAQ,mBAAmB;AAC7F,SAASC,IAAI,EAAEC,MAAM,QAAQ,mBAAmB;AAChD,OAAOC,mBAAmB,IAAIC,sCAAsC,QAAQ,sBAAsB;AAClG,SAASC,MAAM,QAAQ,6BAA6B;AACpD,SAASC,iBAAiB,QAAQ,gDAAgD;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAEnF,SAASC,cAAc,QAAQ,kDAAkD;AACjF,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,OAAOC,eAAe,MAAM,iBAAiB;AAC7C,SAASC,IAAI,QAAQ,qB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":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\nimport { eventInteraction } from '@semcore/popper';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport Dropdown, {\n DropdownContext,\n DropdownProps,\n DropdownHandlers,\n DropdownTriggerProps,\n DropdownPopperAriaProps,\n} from '@semcore/dropdown';\nimport { Box, BoxProps, FlexProps, Flex } from '@semcore/flex-box';\nimport { ScrollAreaProps } from '@semcore/scroll-area';\nimport { Text } from '@semcore/typography';\nimport { eventInteraction } from '@semcore/popper';\n\nexport type DropdownMenuSize = 'm' | 'l';\n\n/** @deprecated */\nexport interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}\nexport type DropdownMenuProps = DropdownProps & {\n /**\n * Set role `menuitemradio` (or `menuitemcheckbox` if `multiselect`) for Dropdown.Item\n */\n selectable?: boolean;\n /**\n * Multiple select\n */\n multiselect?: boolean;\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n /**\n * Index of the element selected by default\n */\n defaultHighlightedIndex?: number | null;\n /**\n * Index of the selected item\n */\n highlightedIndex?: number | null;\n /**\n * Callback for highlightedIndex change\n * highlightedIndex - Index of the selected item\n */\n onHighlightedIndexChange?: (highlightedIndex: number | null) => void;\n locale?: string;\n /**\n * Flag for menu that using as actions on DropdownMenu.Item\n */\n inlineActions?: boolean;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuListProps extends DropdownMenuListProps, UnknownProperties {}\nexport type DropdownMenuListProps = BoxProps &\n ScrollAreaProps & {\n /**\n * Size of the menu\n * @default m\n */\n size?: DropdownMenuSize;\n };\n\n/** @deprecated */\nexport interface IDropdownMenuMenuProps extends DropdownMenuMenuProps, UnknownProperties {}\nexport type DropdownMenuMenuProps = DropdownMenuListProps & {};\n\n/** @deprecated */\nexport interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}\nexport type DropdownMenuItemProps = FlexProps & {\n /**\n * Enables selected state. For selectable dropdowns only.\n */\n selected?: boolean;\n /**\n * Disables item\n */\n disabled?: boolean;\n /**\n * Adds focus styles around\n */\n highlighted?: boolean;\n /**\n * Disables hover state\n * @deprecated use `disabled` instead\n */\n notInteractive?: boolean;\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemHintProps extends DropdownMenuItemHintProps, UnknownProperties {}\nexport type DropdownMenuItemHintProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuItemTitleProps\n extends DropdownMenuItemTitleProps,\n UnknownProperties {}\nexport type DropdownMenuItemTitleProps = FlexProps & {\n /**\n * Size of the component\n * @default m\n */\n size?: DropdownMenuSize;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuContext extends DropdownMenuContext, UnknownProperties {}\nexport type DropdownMenuContext = DropdownContext & {\n highlightedIndex?: number;\n getListProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getItemHintProps: PropGetterFn;\n getItemTitleProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IDropdownMenuHandlers extends DropdownMenuHandlers, UnknownProperties {}\nexport type DropdownMenuHandlers = DropdownHandlers & {\n highlightedIndex: (index: number) => void;\n};\n\nexport type DropdownMenuTriggerProps = DropdownTriggerProps;\n\ndeclare const DropdownMenu: Intergalactic.Component<\n 'div',\n DropdownMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n> & {\n Trigger: typeof Dropdown.Trigger;\n Popper: Intergalactic.Component<'div', DropdownMenuProps & DropdownPopperAriaProps>;\n List: Intergalactic.Component<\n 'div',\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Actions: Intergalactic.Component<\n typeof Flex,\n DropdownMenuListProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Menu: Intergalactic.Component<\n 'div',\n DropdownMenuMenuProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n >;\n Item: Intergalactic.Component<\n typeof Dropdown.Item,\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n Addon: typeof Box;\n Content: typeof Flex;\n Text: typeof Text;\n Hint: typeof Flex;\n };\n /**\n * @deprecated Use Group with title prop\n */\n ItemTitle: Intergalactic.Component<'div', DropdownMenuItemTitleProps>;\n /**\n * @deprecated Use prop subTitle on Group or Item component\n */\n ItemHint: Intergalactic.Component<'div', DropdownMenuItemHintProps>;\n Group: typeof Dropdown.Group;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Nesting: Intergalactic.Component<\n 'div',\n DropdownMenuItemProps,\n DropdownMenuContext,\n [handlers: DropdownMenuHandlers]\n > & {\n /**\n * @deprecated Use Item instead of Nesting\n */\n Trigger: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Item: Intergalactic.Component<'div', DropdownMenuItemProps>;\n /**\n * @deprecated Use Item instead of Nesting\n */\n Addon: typeof Box;\n };\n\n selectedIndexContext: React.Context<number>;\n nestedMenuInteraction: eventInteraction;\n};\n\nexport default DropdownMenu;\n"],"mappings":""}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -16,6 +16,14 @@ export type DropdownMenuSize = 'm' | 'l';
|
|
|
16
16
|
/** @deprecated */
|
|
17
17
|
export interface IDropdownMenuProps extends DropdownMenuProps, UnknownProperties {}
|
|
18
18
|
export type DropdownMenuProps = DropdownProps & {
|
|
19
|
+
/**
|
|
20
|
+
* Set role `menuitemradio` (or `menuitemcheckbox` if `multiselect`) for Dropdown.Item
|
|
21
|
+
*/
|
|
22
|
+
selectable?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Multiple select
|
|
25
|
+
*/
|
|
26
|
+
multiselect?: boolean;
|
|
19
27
|
/**
|
|
20
28
|
* Size of the menu
|
|
21
29
|
* @default m
|
|
@@ -60,8 +68,7 @@ export type DropdownMenuMenuProps = DropdownMenuListProps & {};
|
|
|
60
68
|
export interface IDropdownMenuItemProps extends DropdownMenuItemProps, UnknownProperties {}
|
|
61
69
|
export type DropdownMenuItemProps = FlexProps & {
|
|
62
70
|
/**
|
|
63
|
-
* Enables selected state
|
|
64
|
-
* @deprecated Dropdown menu item can't have that state
|
|
71
|
+
* Enables selected state. For selectable dropdowns only.
|
|
65
72
|
*/
|
|
66
73
|
selected?: boolean;
|
|
67
74
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/dropdown-menu",
|
|
3
3
|
"description": "Semrush DropdownMenu Component",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.44.0-prerelease.2",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@semcore/dropdown": "4.
|
|
13
|
-
"@semcore/flex-box": "5.39.
|
|
14
|
-
"@semcore/scroll-area": "5.43.
|
|
15
|
-
"@semcore/utils": "4.44.
|
|
16
|
-
"@semcore/icon": "4.53.
|
|
17
|
-
"@semcore/typography": "5.48.
|
|
12
|
+
"@semcore/dropdown": "4.42.0-prerelease.2",
|
|
13
|
+
"@semcore/flex-box": "5.39.1-prerelease.2",
|
|
14
|
+
"@semcore/scroll-area": "5.43.1-prerelease.2",
|
|
15
|
+
"@semcore/utils": "4.44.1-prerelease.2",
|
|
16
|
+
"@semcore/icon": "4.53.1-prerelease.2",
|
|
17
|
+
"@semcore/typography": "5.48.1-prerelease.2",
|
|
18
18
|
"classnames": "2.2.6"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@semcore/core": "^2.
|
|
21
|
+
"@semcore/core": "^2.37.1-prerelease.2",
|
|
22
22
|
"react": "16.8 - 18",
|
|
23
23
|
"react-dom": "16.8 - 18"
|
|
24
24
|
},
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@types/classnames": "2.2.6",
|
|
33
33
|
"@semcore/testing-utils": "1.0.0",
|
|
34
34
|
"@semcore/base-trigger": "4.26.1",
|
|
35
|
-
"@semcore/icon": "4.53.
|
|
36
|
-
"@semcore/button": "5.40.
|
|
35
|
+
"@semcore/icon": "4.53.1-prerelease.2",
|
|
36
|
+
"@semcore/button": "5.40.2-prerelease.2"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "pnpm semcore-builder --source=js"
|