@qualtrics/ui-react 2.31.0 → 2.32.0
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 +18 -0
- package/dist/__shared/cjs/{index-c13fc74c.js → index-1c5b62c1.js} +39 -3
- package/dist/__shared/cjs/{index-434a3b72.js → index-95ae1cca.js} +294 -203
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Banner/Banner.css.js +12 -13
- package/dist/components/Banner/Banner.css.ts.vanilla.js +3 -3
- package/dist/components/Banner/Banner.js +2 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +2 -2
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/IconTypes.js +9 -0
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +13 -6
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +81 -38
- package/dist/components/NewMenu/parts/MenuItem.js +16 -4
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/AIEntityIcon.js +6 -0
- package/dist/icons/components/AISparkIcon.js +6 -0
- package/dist/icons/components/ButtonSelectorIcon.js +6 -0
- package/dist/icons/components/DropListSelectorIcon.js +6 -0
- package/dist/icons/components/HeatMapDiscoverIcon.js +6 -0
- package/dist/icons/components/HighlightPenSwatchIcon.js +6 -0
- package/dist/icons/components/HighlightSwatchIcon.js +6 -0
- package/dist/icons/components/MetricWidgetIcon.js +6 -0
- package/dist/icons/components/SearchSelectorIcon.js +6 -0
- package/dist/icons/index.d.ts +18 -0
- package/dist/icons/index.es.js +9 -0
- package/dist/icons/index.js +10 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +5 -3
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Hooks/useCSSVariable.js +5 -5
- package/dist/next/Menu/Hooks/useMaskDimensions.js +10 -12
- package/dist/next/Menu/Hooks/usePaneSearch.js +2 -4
- package/dist/next/Menu/Menu.js +21 -8
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuPane.js +55 -18
- package/dist/next/Menu/PaneChildren.js +6 -3
- package/dist/next/Menu/SubMenu.js +11 -7
- package/dist/next/Menu/constants.js +4 -1
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.js +167 -134
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Text/Text.js +2 -2
- package/icons/package.json +1 -1
- package/next/package.json +2 -2
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._fHn0u{display:inline-block}._brWKS{color:#085caf;cursor:pointer;font-size:14px;box-sizing:border-box;padding:4px;margin:-5px;outline:0;border:1px solid transparent;border-radius:4px;background-clip:padding-box;display:block}._brWKS::-moz-selection{background-color:rgba(11,110,208,.11)}._brWKS::selection{background-color:rgba(11,110,208,.11)}._brWKS:focus,._brWKS:hover{background-color:#f5f5f5}._brWKS:focus{border:2px solid #0a3f88;padding:3px}._brWKS:focus._m--4Z{background-color:#fafafa;cursor:text;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 1px 8px hsla(0,0%,66.7%,.5)}";
|
|
4
|
+
var styles = {"container":"_fHn0u","inlineInput":"_brWKS","isEditing":"_m--4Z"};
|
|
5
|
+
var stylesheet="._fHn0u{display:inline-block}._brWKS{color:#085caf;cursor:pointer;font-size:14px;box-sizing:border-box;padding:4px;margin:-5px;outline:0;border:1px solid transparent;border-radius:4px;background-clip:padding-box;display:block}._brWKS::-moz-selection{background-color:rgba(11,110,208,.11)}._brWKS::selection{background-color:rgba(11,110,208,.11)}._brWKS:focus,._brWKS:hover{background-color:#f5f5f5}._brWKS:focus{border:2px solid #0a3f88;padding:3px}._brWKS:focus._m--4Z{background-color:#fafafa;cursor:text;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 1px 8px hsla(0,0%,66.7%,.5)}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"input":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._oCnYG{display:inline-block;height:36px;min-height:36px;padding:8px 12px;line-height:20px;font-size:14px;color:#32363a;caret-color:#32363a;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._oCnYG::-moz-placeholder{color:#515559;opacity:1}._oCnYG::placeholder{color:#515559;opacity:1}._oCnYG:hover{cursor:pointer;background-color:#f5f5f5}._oCnYG:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa;cursor:text;outline:none;border-color:transparent}._oCnYG._r-Zmy{border-color:#b00}._oCnYG._r-Zmy:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._oCnYG:disabled{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._oCnYG:disabled::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._oCnYG:disabled::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._oCnYG._j2pOw{height:auto}._oCnYG._j2pOw::-webkit-resizer{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03IDF2M2EzIDMgMCAwMS0zIDNIMSIgc3Ryb2tlPSIjOTI5MjkyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==);background-size:8px 8px;background-repeat:no-repeat;background-position:50%}._oCnYG._0Bnnv{display:block;width:100%}._oCnYG._sC-mK{padding:4px 8px}input._oCnYG._sC-mK{height:26px;min-height:26px}[type=number]._oCnYG{-moz-appearance:textfield}[type=number]._oCnYG::-webkit-inner-spin-button,[type=number]._oCnYG::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._ickUu{line-height:20px;color:#6a6d70;display:flex;flex-direction:column;align-items:flex-start}._ickUu:hover{cursor:pointer}._ickUu._EbUtH{color:#0b6ed0}._9oYbD{margin-top:4px}";
|
|
4
|
+
var styles = {"input":"_oCnYG","invalid":"_r-Zmy","multiline":"_j2pOw","full":"_0Bnnv","small":"_sC-mK","label":"_ickUu","focused":"_EbUtH","wrappedInput":"_9oYbD"};
|
|
5
|
+
var stylesheet="._oCnYG{display:inline-block;height:36px;min-height:36px;padding:8px 12px;line-height:20px;font-size:14px;color:#32363a;caret-color:#32363a;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._oCnYG::-moz-placeholder{color:#515559;opacity:1}._oCnYG::placeholder{color:#515559;opacity:1}._oCnYG:hover{cursor:pointer;background-color:#f5f5f5}._oCnYG:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa;cursor:text;outline:none;border-color:transparent}._oCnYG._r-Zmy{border-color:#b00}._oCnYG._r-Zmy:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._oCnYG:disabled{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._oCnYG:disabled::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._oCnYG:disabled::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._oCnYG._j2pOw{height:auto}._oCnYG._j2pOw::-webkit-resizer{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03IDF2M2EzIDMgMCAwMS0zIDNIMSIgc3Ryb2tlPSIjOTI5MjkyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==);background-size:8px 8px;background-repeat:no-repeat;background-position:50%}._oCnYG._0Bnnv{display:block;width:100%}._oCnYG._sC-mK{padding:4px 8px}input._oCnYG._sC-mK{height:26px;min-height:26px}[type=number]._oCnYG{-moz-appearance:textfield}[type=number]._oCnYG::-webkit-inner-spin-button,[type=number]._oCnYG::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._ickUu{line-height:20px;color:#6a6d70;display:flex;flex-direction:column;align-items:flex-start}._ickUu:hover{cursor:pointer}._ickUu._EbUtH{color:#0b6ed0}._9oYbD{margin-top:4px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"addon":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._yXsQH{border:1px solid #898989;border-radius:4px;height:36px;min-height:36px;color:#6a6d70;fill:#6a6d70;background-color:#fafafa;font-size:14px;display:inline-flex;justify-content:center;align-items:center;line-height:1;padding:0 13px}._yXsQH._udh0h{height:26px;min-height:26px;padding:5px 8px}._YHoCD{display:flex;align-items:stretch}._YHoCD._YRTHU{width:100%}._YHoCD ._F672R{margin:0;position:relative;flex-shrink:0;z-index:10}._YHoCD ._F672R:first-child{margin:0 -1px 0 0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}._YHoCD ._F672R:not(:last-child):not(:first-child){margin:0 -1px 0 0;border-radius:0}._YHoCD ._F672R:last-child{border-top-left-radius:0;border-bottom-left-radius:0}._YHoCD ._F672R:last-child,._YHoCD ._F672R:only-child{margin:0;border-top-right-radius:4px;border-bottom-right-radius:4px}._YHoCD ._F672R:only-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._YHoCD ._F672R._roSnv{flex-shrink:1;min-width:40px;z-index:0}._YHoCD ._F672R._roSnv._YRTHU{flex-grow:1}._YHoCD ._F672R:focus{z-index:20}";
|
|
4
|
+
var styles = {"addon":"_yXsQH","small":"_udh0h","inputGroup":"_YHoCD","full":"_YRTHU","inputGroupElement":"_F672R","input":"_roSnv"};
|
|
5
|
+
var stylesheet="._yXsQH{border:1px solid #898989;border-radius:4px;height:36px;min-height:36px;color:#6a6d70;fill:#6a6d70;background-color:#fafafa;font-size:14px;display:inline-flex;justify-content:center;align-items:center;line-height:1;padding:0 13px}._yXsQH._udh0h{height:26px;min-height:26px;padding:5px 8px}._YHoCD{display:flex;align-items:stretch}._YHoCD._YRTHU{width:100%}._YHoCD ._F672R{margin:0;position:relative;flex-shrink:0;z-index:10}._YHoCD ._F672R:first-child{margin:0 -1px 0 0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}._YHoCD ._F672R:not(:last-child):not(:first-child){margin:0 -1px 0 0;border-radius:0}._YHoCD ._F672R:last-child{border-top-left-radius:0;border-bottom-left-radius:0}._YHoCD ._F672R:last-child,._YHoCD ._F672R:only-child{margin:0;border-top-right-radius:4px;border-bottom-right-radius:4px}._YHoCD ._F672R:only-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._YHoCD ._F672R._roSnv{flex-shrink:1;min-width:40px;z-index:0}._YHoCD ._F672R._roSnv._YRTHU{flex-grow:1}._YHoCD ._F672R:focus{z-index:20}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"label":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._429rL{font-size:14px}._efagb{color:#6a6d70;line-height:20px;display:inline-flex;flex-direction:column;align-items:flex-start}._KWp6l{color:#0b6ed0}";
|
|
4
|
+
var styles = {"label":"_429rL","control":"_efagb","focused":"_KWp6l"};
|
|
5
|
+
var stylesheet="._429rL{font-size:14px}._efagb{color:#6a6d70;line-height:20px;display:inline-flex;flex-direction:column;align-items:flex-start}._KWp6l{color:#0b6ed0}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"link":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._ZWu5z{color:#0b6ed0;cursor:pointer;text-decoration:underline;text-decoration-thickness:1px;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;text-underline-offset:3px;border-radius:1px}._ZWu5z:active:focus,._ZWu5z:focus{outline:none}._ZWu5z:visited{color:#0854a1}._ZWu5z:hover{color:#085caf}._ZWu5z:active{color:#0854a1}._ZWu5z.focus-visible,._ZWu5z:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"link":"_ZWu5z"};
|
|
5
|
+
var stylesheet="._ZWu5z{color:#0b6ed0;cursor:pointer;text-decoration:underline;text-decoration-thickness:1px;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;text-underline-offset:3px;border-radius:1px}._ZWu5z:active:focus,._ZWu5z:focus{outline:none}._ZWu5z:visited{color:#0854a1}._ZWu5z:hover{color:#085caf}._ZWu5z:active{color:#0854a1}._ZWu5z.focus-visible,._ZWu5z:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"spinnerContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._BQHbt{position:relative;display:inline-block}._BQHbt._Wcgnv{min-height:20px;min-width:20px}._BQHbt._NCz07{min-height:25px;min-width:25px}._BQHbt._tlTgh{min-height:40px;min-width:40px}._BQHbt._--bf-{min-height:64px;min-width:64px}._BQHbt ._2qdok{display:inline-block;background-color:transparent;position:absolute;z-index:10;width:0;height:0;left:50%;bottom:50%;pointer-events:none}._BQHbt ._2qdok._WJWLI{visibility:hidden}._BQHbt ._2qdok div{position:absolute;transform:rotate(20deg)}._BQHbt ._2qdok div div:nth-child(-n+9){background-color:#fff;transform-origin:0 0;animation:_2qdok .9s linear infinite}._BQHbt ._2qdok div div:nth-child(-n+9):after{content:\" \";display:block;position:absolute;top:5px;left:-1px;width:2px;height:10px;border-radius:20%;background:#000}._BQHbt ._2qdok div div:first-child{transform:rotate(20deg);animation-delay:-.8s}._BQHbt ._2qdok div div:nth-child(2){transform:rotate(60deg);animation-delay:-.7s}._BQHbt ._2qdok div div:nth-child(3){transform:rotate(100deg);animation-delay:-.6s}._BQHbt ._2qdok div div:nth-child(4){transform:rotate(140deg);animation-delay:-.5s}._BQHbt ._2qdok div div:nth-child(5){transform:rotate(180deg);animation-delay:-.4s}._BQHbt ._2qdok div div:nth-child(6){transform:rotate(220deg);animation-delay:-.3s}._BQHbt ._2qdok div div:nth-child(7){transform:rotate(260deg);animation-delay:-.2s}._BQHbt ._2qdok div div:nth-child(8){transform:rotate(300deg);animation-delay:-.1s}._BQHbt ._2qdok div div:nth-child(9){transform:rotate(340deg);animation-delay:0s}._BQHbt ._--bf- div div:nth-child(-n+9):after{top:10px;left:-2px;width:4px;height:18px}._BQHbt ._Wcgnv div div:nth-child(-n+9):after{top:2px;left:-1px;width:1.5px;height:6px}._BQHbt ._NCz07 div div:nth-child(-n+9):after{top:4px;left:-1px;width:2px;height:7px}._BQHbt ._zgK9C div div:nth-child(-n+9):after{background:#fff}._BQHbt ._ZrpJY{width:100%;height:100%}._BQHbt ._ZrpJY._6v6zP{pointer-events:none}._BQHbt ._ZrpJY._WJWLI{opacity:0}._BQHbt ._ZrpJY._Insym{opacity:.5}@keyframes _2qdok{0%{opacity:1}to{opacity:0}}";
|
|
4
|
+
var styles = {"spinnerContainer":"_BQHbt","xs":"_Wcgnv","small":"_NCz07","medium":"_tlTgh","large":"_--bf-","spinnerComponent":"_2qdok","hide":"_WJWLI","inverted":"_zgK9C","spinnerContent":"_ZrpJY","disablePointerEvents":"_6v6zP","fade":"_Insym"};
|
|
5
|
+
var stylesheet="._BQHbt{position:relative;display:inline-block}._BQHbt._Wcgnv{min-height:20px;min-width:20px}._BQHbt._NCz07{min-height:25px;min-width:25px}._BQHbt._tlTgh{min-height:40px;min-width:40px}._BQHbt._--bf-{min-height:64px;min-width:64px}._BQHbt ._2qdok{display:inline-block;background-color:transparent;position:absolute;z-index:10;width:0;height:0;left:50%;bottom:50%;pointer-events:none}._BQHbt ._2qdok._WJWLI{visibility:hidden}._BQHbt ._2qdok div{position:absolute;transform:rotate(20deg)}._BQHbt ._2qdok div div:nth-child(-n+9){background-color:#fff;transform-origin:0 0;animation:_2qdok .9s linear infinite}._BQHbt ._2qdok div div:nth-child(-n+9):after{content:\" \";display:block;position:absolute;top:5px;left:-1px;width:2px;height:10px;border-radius:20%;background:#000}._BQHbt ._2qdok div div:first-child{transform:rotate(20deg);animation-delay:-.8s}._BQHbt ._2qdok div div:nth-child(2){transform:rotate(60deg);animation-delay:-.7s}._BQHbt ._2qdok div div:nth-child(3){transform:rotate(100deg);animation-delay:-.6s}._BQHbt ._2qdok div div:nth-child(4){transform:rotate(140deg);animation-delay:-.5s}._BQHbt ._2qdok div div:nth-child(5){transform:rotate(180deg);animation-delay:-.4s}._BQHbt ._2qdok div div:nth-child(6){transform:rotate(220deg);animation-delay:-.3s}._BQHbt ._2qdok div div:nth-child(7){transform:rotate(260deg);animation-delay:-.2s}._BQHbt ._2qdok div div:nth-child(8){transform:rotate(300deg);animation-delay:-.1s}._BQHbt ._2qdok div div:nth-child(9){transform:rotate(340deg);animation-delay:0s}._BQHbt ._--bf- div div:nth-child(-n+9):after{top:10px;left:-2px;width:4px;height:18px}._BQHbt ._Wcgnv div div:nth-child(-n+9):after{top:2px;left:-1px;width:1.5px;height:6px}._BQHbt ._NCz07 div div:nth-child(-n+9):after{top:4px;left:-1px;width:2px;height:7px}._BQHbt ._zgK9C div div:nth-child(-n+9):after{background:#fff}._BQHbt ._ZrpJY{width:100%;height:100%}._BQHbt ._ZrpJY._6v6zP{pointer-events:none}._BQHbt ._ZrpJY._WJWLI{opacity:0}._BQHbt ._ZrpJY._Insym{opacity:.5}@keyframes _2qdok{0%{opacity:1}to{opacity:0}}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"set":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._maSul{width:100%}._BkZew{display:flex;align-items:center}._h5dZF{display:flex;flex-wrap:wrap;grid-gap:4px}._h5dZF._-7ELR>:nth-last-child(2){margin-right:42px}._wDZft{position:relative;padding-left:32px;padding-top:16px}._hMtfP ._wDZft{padding-top:0;padding-left:16px}._hMtfP ._wDZft+._wDZft{margin-top:16px}._6CA88{position:absolute;left:16px;top:0;height:34px;width:16px;border-left:1px solid #c2c2c2;border-bottom:1px solid #c2c2c2;border-bottom-left-radius:4px}._hMtfP ._wDZft:first-of-type ._6CA88{top:16px;border-bottom:none;border-bottom-left-radius:0;border-top:1px solid #c2c2c2;border-top-left-radius:4px}._hMtfP ._6CA88{top:-16px;left:0}._hMtfP ._wDZft:not(:first-of-type):not(:last-of-type) ._6CA88{border-bottom-left-radius:0}._rympA{margin-left:-46px}._qRiIq{margin:0 2px 0 4px}._qRiIq.focus-visible,._qRiIq:focus-visible{outline-width:2px}._tCavR{margin-left:4px}";
|
|
4
|
+
var styles = {"set":"_maSul","setWrapper":"_BkZew","condition":"_h5dZF","readOnly":"_-7ELR","branch":"_wDZft","fixedSet":"_hMtfP","connection":"_6CA88","conditionControlsContainer":"_rympA","controls":"_qRiIq","controlMenuItem":"_tCavR"};
|
|
5
|
+
var stylesheet="._maSul{width:100%}._BkZew{display:flex;align-items:center}._h5dZF{display:flex;flex-wrap:wrap;grid-gap:4px}._h5dZF._-7ELR>:nth-last-child(2){margin-right:42px}._wDZft{position:relative;padding-left:32px;padding-top:16px}._hMtfP ._wDZft{padding-top:0;padding-left:16px}._hMtfP ._wDZft+._wDZft{margin-top:16px}._6CA88{position:absolute;left:16px;top:0;height:34px;width:16px;border-left:1px solid #c2c2c2;border-bottom:1px solid #c2c2c2;border-bottom-left-radius:4px}._hMtfP ._wDZft:first-of-type ._6CA88{top:16px;border-bottom:none;border-bottom-left-radius:0;border-top:1px solid #c2c2c2;border-top-left-radius:4px}._hMtfP ._6CA88{top:-16px;left:0}._hMtfP ._wDZft:not(:first-of-type):not(:last-of-type) ._6CA88{border-bottom-left-radius:0}._rympA{margin-left:-46px}._qRiIq{margin:0 2px 0 4px}._qRiIq.focus-visible,._qRiIq:focus-visible{outline-width:2px}._tCavR{margin-left:4px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"backdrop":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._eDbTH{position:fixed;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,.3);align-items:flex-start}._eDbTH,._ganC0{display:flex;overflow:auto}._ganC0{flex-direction:column;box-shadow:0 12px 35px -8px rgba(0,0,0,.12);border-radius:8px;background-color:#fff;min-width:450px;min-height:198px;max-width:85%;max-height:85%;margin:auto;outline:none}:not(._Vo0an)._B86Ng{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._B86Ng{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}:not(._Vo0an)._xnYjG{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._xnYjG{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}@media screen and (min-width:768px){:not(._Vo0an)._xnYjG{max-width:700px}}:not(._Vo0an)._fGJVg{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._fGJVg{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}@media screen and (min-width:768px){:not(._Vo0an)._fGJVg{max-width:700px}}@media screen and (min-width:1024px){:not(._Vo0an)._fGJVg{max-width:1000px}}:not(._Vo0an)._b-2SQ{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._b-2SQ{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}@media screen and (min-width:768px){:not(._Vo0an)._b-2SQ{max-width:700px}}@media screen and (min-width:1024px){:not(._Vo0an)._b-2SQ{max-width:1000px}}@media screen and (min-width:1632px){:not(._Vo0an)._b-2SQ{max-width:1600px;max-height:calc(100vh - 32px)}}._Vo0an{min-width:200px;width:calc(100% - 48px)}._Vo0an,._Vo0an._B86Ng{max-height:calc(100vh - 80px)}._Vo0an._B86Ng{max-width:480px;border-radius:8px}._Vo0an._xnYjG{max-width:700px}._Vo0an._fGJVg{max-width:1000px}._Vo0an._b-2SQ{max-width:1600px;max-height:calc(100vh - 32px)}._bqT97{height:calc(100vh - 80px)}@media screen and (max-width:479px){._bqT97{height:100vh}}@media screen and (min-width:1632px){._bqT97{height:calc(100vh - 32px)}}._OT8Dh{position:relative;display:flex;flex-direction:row;flex-shrink:0;min-height:65px;padding:20px 24px;align-items:center;font-size:18px;font-weight:400;line-height:24px;color:#32363a;border-bottom:1px solid #eee}._wu7oz{padding-right:64px}._ZP6eT{position:absolute;top:14px;right:14px}._o-kIq{flex-grow:1;font-size:14px;overflow:auto;color:#32363a}._BFWd2,._o-kIq{padding:20px 24px}._BFWd2{display:flex;flex-direction:row;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:1px solid #eee}._BFWd2>*{margin:0 4px}._BFWd2>:first-child{margin-left:0}._BFWd2>:last-child{margin-right:0}@keyframes _6pa3U{0%{opacity:0}}._6pa3U{animation:_6pa3U ease-in both;animation-duration:.2s}@keyframes _F669v{to{opacity:0}}._F669v{animation:_F669v ease-out both;animation-duration:.2s}@keyframes _3StPU{0%{transform:scale3d(.7,.7,.7);opacity:0}}._3StPU{animation:_3StPU both;animation-duration:.2s}@keyframes _97UT4{to{transform:scale3d(.7,.7,.7);opacity:0}}._97UT4{animation:_97UT4 both;animation-duration:.2s}";
|
|
4
|
+
var styles = {"backdrop":"_eDbTH","modal":"_ganC0","responsive":"_Vo0an","dialogSmall":"_B86Ng","dialogMedium":"_xnYjG","dialogLarge":"_fGJVg","dialogExtraLarge":"_b-2SQ","growToMaxHeight":"_bqT97","modalHeader":"_OT8Dh","modalHeaderWithCloseButton":"_wu7oz","modalHeaderCloseButton":"_ZP6eT","modalBody":"_o-kIq","modalFooter":"_BFWd2","fadeEnter":"_6pa3U","fadeLeave":"_F669v","zoomEnter":"_3StPU","zoomLeave":"_97UT4"};
|
|
5
|
+
var stylesheet="._eDbTH{position:fixed;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,.3);align-items:flex-start}._eDbTH,._ganC0{display:flex;overflow:auto}._ganC0{flex-direction:column;box-shadow:0 12px 35px -8px rgba(0,0,0,.12);border-radius:8px;background-color:#fff;min-width:450px;min-height:198px;max-width:85%;max-height:85%;margin:auto;outline:none}:not(._Vo0an)._B86Ng{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._B86Ng{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}:not(._Vo0an)._xnYjG{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._xnYjG{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}@media screen and (min-width:768px){:not(._Vo0an)._xnYjG{max-width:700px}}:not(._Vo0an)._fGJVg{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._fGJVg{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}@media screen and (min-width:768px){:not(._Vo0an)._fGJVg{max-width:700px}}@media screen and (min-width:1024px){:not(._Vo0an)._fGJVg{max-width:1000px}}:not(._Vo0an)._b-2SQ{width:100vw;min-width:200px;max-width:none;max-height:100vh;border-radius:0}@media screen and (min-width:480px){:not(._Vo0an)._b-2SQ{max-width:480px;max-height:calc(100vh - 80px);border-radius:8px}}@media screen and (min-width:768px){:not(._Vo0an)._b-2SQ{max-width:700px}}@media screen and (min-width:1024px){:not(._Vo0an)._b-2SQ{max-width:1000px}}@media screen and (min-width:1632px){:not(._Vo0an)._b-2SQ{max-width:1600px;max-height:calc(100vh - 32px)}}._Vo0an{min-width:200px;width:calc(100% - 48px)}._Vo0an,._Vo0an._B86Ng{max-height:calc(100vh - 80px)}._Vo0an._B86Ng{max-width:480px;border-radius:8px}._Vo0an._xnYjG{max-width:700px}._Vo0an._fGJVg{max-width:1000px}._Vo0an._b-2SQ{max-width:1600px;max-height:calc(100vh - 32px)}._bqT97{height:calc(100vh - 80px)}@media screen and (max-width:479px){._bqT97{height:100vh}}@media screen and (min-width:1632px){._bqT97{height:calc(100vh - 32px)}}._OT8Dh{position:relative;display:flex;flex-direction:row;flex-shrink:0;min-height:65px;padding:20px 24px;align-items:center;font-size:18px;font-weight:400;line-height:24px;color:#32363a;border-bottom:1px solid #eee}._wu7oz{padding-right:64px}._ZP6eT{position:absolute;top:14px;right:14px}._o-kIq{flex-grow:1;font-size:14px;overflow:auto;color:#32363a}._BFWd2,._o-kIq{padding:20px 24px}._BFWd2{display:flex;flex-direction:row;flex-shrink:0;align-items:center;justify-content:flex-end;border-top:1px solid #eee}._BFWd2>*{margin:0 4px}._BFWd2>:first-child{margin-left:0}._BFWd2>:last-child{margin-right:0}@keyframes _6pa3U{0%{opacity:0}}._6pa3U{animation:_6pa3U ease-in both;animation-duration:.2s}@keyframes _F669v{to{opacity:0}}._F669v{animation:_F669v ease-out both;animation-duration:.2s}@keyframes _3StPU{0%{transform:scale3d(.7,.7,.7);opacity:0}}._3StPU{animation:_3StPU both;animation-duration:.2s}@keyframes _97UT4{to{transform:scale3d(.7,.7,.7);opacity:0}}._97UT4{animation:_97UT4 both;animation-duration:.2s}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -19,10 +19,10 @@ import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
|
19
19
|
import SubmenuAnchor from './parts/SubmenuAnchor.js';
|
|
20
20
|
import MenuAnchor from './parts/MenuAnchor.js';
|
|
21
21
|
import MenuSpinner from './parts/MenuSpinner.js';
|
|
22
|
+
import MenuSearchBox from './parts/MenuSearchBox.js';
|
|
22
23
|
import Popper from '../../utils/Popper/Popper.js';
|
|
23
24
|
import { SUBMENU_POPPER_OFFSET, FLYOUT_POPPER_OFFSET } from '../../utils/constants.js';
|
|
24
25
|
import ArrowNav from './parts/ArrowNav/ArrowNav.js';
|
|
25
|
-
import MenuSearchBox from './parts/MenuSearchBox.js';
|
|
26
26
|
|
|
27
27
|
const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
28
28
|
var _externalAnchor$props, _externalAnchor$props2, _useMenuContext, _externalAnchor$props3, _externalAnchor$props4, _externalAnchor$props5, _externalAnchor$props6, _externalAnchor$props7, _externalAnchor$props8, _externalAnchor$props9, _anchorRef$current;
|
|
@@ -62,6 +62,7 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
62
62
|
isMultiSelect = unstable_isMultiSelect,
|
|
63
63
|
zIndex = 1000,
|
|
64
64
|
maxFlyoutWidth,
|
|
65
|
+
isVirtualized = false,
|
|
65
66
|
private_isClosedMenuOpenedOnAnchorClick = true,
|
|
66
67
|
private_isFirstElementHighlightedOnUserActivatedOpen = true,
|
|
67
68
|
...rest
|
|
@@ -206,7 +207,8 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
206
207
|
defaultValue,
|
|
207
208
|
selectedValue,
|
|
208
209
|
onHighlightedIndexChange: setSubmenuHighlightedIndex,
|
|
209
|
-
onSelectedValueChange: handleSubmenuOnSelectedValueChange
|
|
210
|
+
onSelectedValueChange: handleSubmenuOnSelectedValueChange,
|
|
211
|
+
isVirtualized
|
|
210
212
|
});
|
|
211
213
|
}
|
|
212
214
|
if ((child === null || child === void 0 ? void 0 : child.type) === MenuItem) {
|
|
@@ -230,7 +232,7 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
230
232
|
const ariaLabelledBy = (_externalAnchor$props3 = externalAnchor === null || externalAnchor === void 0 || (_externalAnchor$props4 = externalAnchor.props) === null || _externalAnchor$props4 === void 0 ? void 0 : _externalAnchor$props4['aria-labelledby']) !== null && _externalAnchor$props3 !== void 0 ? _externalAnchor$props3 : externalAriaLabelledBy ? "".concat(externalAriaLabelledBy, " ").concat(anchorId) : undefined;
|
|
231
233
|
const ariaLabel = (_externalAnchor$props5 = externalAnchor === null || externalAnchor === void 0 || (_externalAnchor$props6 = externalAnchor.props) === null || _externalAnchor$props6 === void 0 ? void 0 : _externalAnchor$props6['aria-label']) !== null && _externalAnchor$props5 !== void 0 ? _externalAnchor$props5 : externalAriaLabel && typeof menuAnchorLabel === 'string' ? "".concat(externalAriaLabel, " ").concat(menuAnchorLabel) : externalAriaLabel;
|
|
232
234
|
const ariaExpanded = (externalAnchor === null || externalAnchor === void 0 ? void 0 : externalAnchor.props['aria-expanded']) !== undefined ? externalAnchor.props['aria-expanded'] : isOpen ? true : undefined;
|
|
233
|
-
const actualAnchor = externalAnchor !== undefined ? /*#__PURE__*/React__default.cloneElement(externalAnchor, {
|
|
235
|
+
const actualAnchor = externalAnchor !== undefined ? ( /*#__PURE__*/React__default.cloneElement(externalAnchor, {
|
|
234
236
|
ref: mergeRefs(ref, anchorRef, externalAnchor.ref),
|
|
235
237
|
tabIndex: (_externalAnchor$props7 = externalAnchor.props.tabIndex) !== null && _externalAnchor$props7 !== void 0 ? _externalAnchor$props7 : 0,
|
|
236
238
|
role: (_externalAnchor$props8 = externalAnchor.props.role) !== null && _externalAnchor$props8 !== void 0 ? _externalAnchor$props8 : 'button',
|
|
@@ -244,7 +246,7 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
244
246
|
onMouseDown: preventClickOutside,
|
|
245
247
|
onClick: wrapEvent(externalAnchor.props.onClick, handleAnchorClick),
|
|
246
248
|
onKeyDown: wrapEvent(externalAnchor.props.onKeyDown, handleAnchorKeyDown)
|
|
247
|
-
}) : isSubmenu ? /*#__PURE__*/React__default.createElement(SubmenuAnchor, _extends({
|
|
249
|
+
})) : isSubmenu ? /*#__PURE__*/React__default.createElement(SubmenuAnchor, _extends({
|
|
248
250
|
ref: mergeRefs(ref, anchorRef),
|
|
249
251
|
label: label,
|
|
250
252
|
id: anchorId,
|
|
@@ -296,6 +298,8 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
296
298
|
}, [noResults, popperIsOpen, announceToScreenReader, noMenuItemsToDisplayText]);
|
|
297
299
|
const searchBoxRef = useRef();
|
|
298
300
|
const arrowNavRef = useRef(null);
|
|
301
|
+
const handleHighlightedIndexChange = useCallback(i => setHighlightedIndex(i), [setHighlightedIndex]);
|
|
302
|
+
const isNavItem = useCallback(child => (child === null || child === void 0 ? void 0 : child.type) === MenuItem || (child === null || child === void 0 ? void 0 : child.type) === MenuSearchBox || isType(child, menuType), [menuType]);
|
|
299
303
|
return /*#__PURE__*/React__default.createElement(MenuContextProvider, {
|
|
300
304
|
value: {
|
|
301
305
|
closeAndFocusAnchor,
|
|
@@ -319,7 +323,7 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
319
323
|
id: arrowNavId,
|
|
320
324
|
role: "menu",
|
|
321
325
|
"aria-labelledby": anchorId,
|
|
322
|
-
isNavItem:
|
|
326
|
+
isNavItem: isNavItem,
|
|
323
327
|
style: {
|
|
324
328
|
zIndex,
|
|
325
329
|
maxWidth: maxFlyoutWidth !== null && maxFlyoutWidth !== void 0 ? maxFlyoutWidth : undefined,
|
|
@@ -331,7 +335,7 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
331
335
|
maxHeight: maxHeight,
|
|
332
336
|
minWidth: isSubmenu ? undefined : Math.min(350, Math.max(160, anchorRef === null || anchorRef === void 0 || (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 ? void 0 : _anchorRef$current.offsetWidth)),
|
|
333
337
|
searchable: searchable,
|
|
334
|
-
onHighlightedIndexChange:
|
|
338
|
+
onHighlightedIndexChange: handleHighlightedIndexChange,
|
|
335
339
|
searchTerm: searchTerm,
|
|
336
340
|
setSearchTerm: setSearchTerm,
|
|
337
341
|
onKeyDown: e => {
|
|
@@ -352,10 +356,13 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
352
356
|
var _arrowNavRef$current;
|
|
353
357
|
// Only update the highlighted index for the current menu (i.e. if the event bubbles up to a parent menu, don't update the highlighted index for the parent menu)
|
|
354
358
|
if ((_arrowNavRef$current = arrowNavRef.current) !== null && _arrowNavRef$current !== void 0 && _arrowNavRef$current.contains(e.target) && e.target !== searchBoxRef.current) {
|
|
359
|
+
var _anchorRef$current2;
|
|
355
360
|
setHighlightedIndex(-1);
|
|
361
|
+
(_anchorRef$current2 = anchorRef.current) === null || _anchorRef$current2 === void 0 || _anchorRef$current2.focus();
|
|
356
362
|
}
|
|
357
363
|
}
|
|
358
364
|
},
|
|
365
|
+
isVirtualized: isVirtualized,
|
|
359
366
|
isSubmenu: isSubmenu,
|
|
360
367
|
searchBoxRef: searchBoxRef,
|
|
361
368
|
anchorRef: anchorRef,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"menuBtn":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._uaHp5._uaHp5{min-width:0;max-width:100%;padding:0 4px 0 12px;white-space:nowrap;line-height:20px;font-size:14px;cursor:pointer;justify-content:space-between;text-align:left;outline:none;background-color:#fafafa;border:none;box-shadow:inset 0 0 0 1px #898989;border-radius:4px;height:36px;color:#515559;fill:#515559}._uaHp5._uaHp5,._uaHp5._uaHp5 ._Kl8V2{display:inline-flex;align-items:center}._uaHp5._uaHp5 ._Kl8V2{overflow:hidden;text-overflow:ellipsis}._uaHp5._uaHp5._OJk05{min-height:26px;height:26px}._uaHp5._uaHp5._BoI6f{color:#32363a}._uaHp5._uaHp5:hover:not([aria-disabled=true]){background-color:#f5f5f5}._uaHp5._uaHp5:focus{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._uaHp5._uaHp5[aria-disabled=true]{box-shadow:inset 0 0 0 1px #e5e5e5;color:#74777a;cursor:not-allowed}._uaHp5._uaHp5[aria-disabled=true]>svg{fill:#515559;opacity:.4}._uaHp5._uaHp5[aria-disabled=true]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._uaHp5._uaHp5._-ALaB{padding-left:0}._uaHp5._uaHp5._zMmmO{margin-top:4px}._uaHp5._uaHp5 ._GRz6q{fill:#515559}._uaHp5._uaHp5 ._GRz6q._OJk05{top:0}._uaHp5._uaHp5 ._GRz6q._jCKPP{transform:rotate(-180deg)}._oAkKe{margin:0;font-size:14px;color:#32363a;fill:#32363a;list-style:none;min-width:160px;max-width:350px;min-height:10px;max-height:99%;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._oAkKe::-webkit-scrollbar,._oAkKe::-webkit-scrollbar-thumb{visibility:hidden;width:8px;border-radius:4px}._oAkKe::-webkit-scrollbar{background-color:rgba(0,0,0,.06)}._oAkKe::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.4)}._oAkKe:hover::-webkit-scrollbar,._oAkKe:hover::-webkit-scrollbar-thumb,._oAkKe[focus-within]::-webkit-scrollbar,._oAkKe[focus-within]::-webkit-scrollbar-thumb{visibility:visible}._oAkKe:focus-within::-webkit-scrollbar,._oAkKe:focus-within::-webkit-scrollbar-thumb,._oAkKe:hover::-webkit-scrollbar,._oAkKe:hover::-webkit-scrollbar-thumb{visibility:visible}._B6QlX{position:relative;padding:10px 12px;min-height:40px;display:flex;flex-direction:row;align-items:center;cursor:pointer;outline:none;word-break:break-word}._B6QlX[aria-disabled=true]{cursor:not-allowed;color:rgba(50,54,58,.65);fill:rgba(50,54,58,.65)}._B6QlX._cF-8s{background-color:#efefef}._B6QlX._VKfrU{box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._B6QlX._BoI6f{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._B6QlX._BoI6f._cF-8s{background-color:#e4effa}._B6QlX._rYZld{cursor:default}._B6QlX:active:not(._Yxxam):not(._BoI6f):not([aria-disabled=true]):not(._rYZld){background-color:#e8e9e9}._Yxxam{padding-right:32px}._Yxxam ._GRz6q{position:absolute;top:8px;right:3px;fill:#515559}._t20Ts{padding:8px;border-bottom:1px solid #e8e8e8;border-radius:4px 4px 0 0;position:-webkit-sticky;position:sticky;top:0;z-index:20;background-color:#fff}._Q0qGq{position:absolute;top:13px;left:13px}._-8t3-._-8t3-{padding-left:32px}._lf4dZ{margin:2px 12px 2px 0;flex-shrink:0}._lf4dZ._H6cIc>svg{border-color:#0b6ed0}._qdK0X{display:flex;justify-self:center;margin:8px}";
|
|
4
|
+
var styles = {"menuBtn":"_uaHp5","menuBtnLabel":"_Kl8V2","small":"_OJk05","selected":"_BoI6f","unlabelledButton":"_-ALaB","formLabelled":"_zMmmO","rightIcon":"_GRz6q","open":"_jCKPP","contentPane":"_oAkKe","menuItem":"_B6QlX","active":"_cF-8s","focus":"_VKfrU","noMenuItems":"_rYZld","subMenu":"_Yxxam","searchBox":"_t20Ts","searchBoxIcon":"_Q0qGq","searchBoxInput":"_-8t3-","checkbox":"_lf4dZ","highlighted":"_H6cIc","menuSpinner":"_qdK0X"};
|
|
5
|
+
var stylesheet="._uaHp5._uaHp5{min-width:0;max-width:100%;padding:0 4px 0 12px;white-space:nowrap;line-height:20px;font-size:14px;cursor:pointer;justify-content:space-between;text-align:left;outline:none;background-color:#fafafa;border:none;box-shadow:inset 0 0 0 1px #898989;border-radius:4px;height:36px;color:#515559;fill:#515559}._uaHp5._uaHp5,._uaHp5._uaHp5 ._Kl8V2{display:inline-flex;align-items:center}._uaHp5._uaHp5 ._Kl8V2{overflow:hidden;text-overflow:ellipsis}._uaHp5._uaHp5._OJk05{min-height:26px;height:26px}._uaHp5._uaHp5._BoI6f{color:#32363a}._uaHp5._uaHp5:hover:not([aria-disabled=true]){background-color:#f5f5f5}._uaHp5._uaHp5:focus{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._uaHp5._uaHp5[aria-disabled=true]{box-shadow:inset 0 0 0 1px #e5e5e5;color:#74777a;cursor:not-allowed}._uaHp5._uaHp5[aria-disabled=true]>svg{fill:#515559;opacity:.4}._uaHp5._uaHp5[aria-disabled=true]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._uaHp5._uaHp5._-ALaB{padding-left:0}._uaHp5._uaHp5._zMmmO{margin-top:4px}._uaHp5._uaHp5 ._GRz6q{fill:#515559}._uaHp5._uaHp5 ._GRz6q._OJk05{top:0}._uaHp5._uaHp5 ._GRz6q._jCKPP{transform:rotate(-180deg)}._oAkKe{margin:0;font-size:14px;color:#32363a;fill:#32363a;list-style:none;min-width:160px;max-width:350px;min-height:10px;max-height:99%;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._oAkKe::-webkit-scrollbar,._oAkKe::-webkit-scrollbar-thumb{visibility:hidden;width:8px;border-radius:4px}._oAkKe::-webkit-scrollbar{background-color:rgba(0,0,0,.06)}._oAkKe::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.4)}._oAkKe:hover::-webkit-scrollbar,._oAkKe:hover::-webkit-scrollbar-thumb,._oAkKe[focus-within]::-webkit-scrollbar,._oAkKe[focus-within]::-webkit-scrollbar-thumb{visibility:visible}._oAkKe:focus-within::-webkit-scrollbar,._oAkKe:focus-within::-webkit-scrollbar-thumb,._oAkKe:hover::-webkit-scrollbar,._oAkKe:hover::-webkit-scrollbar-thumb{visibility:visible}._B6QlX{position:relative;padding:10px 12px;min-height:40px;display:flex;flex-direction:row;align-items:center;cursor:pointer;outline:none;word-break:break-word}._B6QlX[aria-disabled=true]{cursor:not-allowed;color:rgba(50,54,58,.65);fill:rgba(50,54,58,.65)}._B6QlX._cF-8s{background-color:#efefef}._B6QlX._VKfrU{box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._B6QlX._BoI6f{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._B6QlX._BoI6f._cF-8s{background-color:#e4effa}._B6QlX._rYZld{cursor:default}._B6QlX:active:not(._Yxxam):not(._BoI6f):not([aria-disabled=true]):not(._rYZld){background-color:#e8e9e9}._Yxxam{padding-right:32px}._Yxxam ._GRz6q{position:absolute;top:8px;right:3px;fill:#515559}._t20Ts{padding:8px;border-bottom:1px solid #e8e8e8;border-radius:4px 4px 0 0;position:-webkit-sticky;position:sticky;top:0;z-index:20;background-color:#fff}._Q0qGq{position:absolute;top:13px;left:13px}._-8t3-._-8t3-{padding-left:32px}._lf4dZ{margin:2px 12px 2px 0;flex-shrink:0}._lf4dZ._H6cIc>svg{border-color:#0b6ed0}._qdK0X{display:flex;justify-self:center;margin:8px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,35 +1,19 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
-
import React__default, { useRef, useEffect } from 'react';
|
|
2
|
+
import React__default, { useRef, useState, useCallback, useMemo, useEffect } from 'react';
|
|
3
3
|
import { useFocusVisible } from '@react-aria/interactions';
|
|
4
|
+
import { Virtuoso } from 'react-virtuoso';
|
|
5
|
+
import { ResizeObserver } from '@juggle/resize-observer';
|
|
4
6
|
import '../../../../utils/index.js';
|
|
5
7
|
import MenuSearchBox from '../MenuSearchBox.js';
|
|
6
8
|
import '../../../../hooks/index.js';
|
|
7
|
-
import
|
|
9
|
+
import { VIRTUOSO_PROPS } from '../../../../next/Menu/constants.js';
|
|
8
10
|
import useId from '../../../../hooks/useId/useId.js';
|
|
9
11
|
import wrapEvent from '../../../../utils/wrapEvent/wrapEvent.js';
|
|
12
|
+
import mergeRefs from '../../../../utils/mergeRefs/mergeRefs.js';
|
|
10
13
|
import { SUBMENU_POPPER_OFFSET, FLYOUT_POPPER_OFFSET } from '../../../../utils/constants.js';
|
|
11
14
|
|
|
12
|
-
function useChildrenRefs(children, getAdditionalProps, isNavItem, searchable) {
|
|
13
|
-
const refs = useRef({});
|
|
14
|
-
// eslint-disable-next-line no-return-assign
|
|
15
|
-
const createRefCallback = index => node => refs.current[index] = node;
|
|
16
|
-
let refIndex = searchable ? 1 : 0;
|
|
17
|
-
const allChildren = React__default.Children.map(children, child => {
|
|
18
|
-
if (isNavItem(child)) {
|
|
19
|
-
const myIndex = refIndex;
|
|
20
|
-
refIndex += 1;
|
|
21
|
-
const additionalProps = getAdditionalProps(child, myIndex);
|
|
22
|
-
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
23
|
-
ref: mergeRefs(createRefCallback(myIndex), child.ref),
|
|
24
|
-
...additionalProps
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return child;
|
|
28
|
-
});
|
|
29
|
-
refs.current.length = refIndex;
|
|
30
|
-
return [refs, allChildren];
|
|
31
|
-
}
|
|
32
15
|
const ArrowNav = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
16
|
+
var _process$env, _childRefs$current$le, _containerRef$current3;
|
|
33
17
|
let {
|
|
34
18
|
role,
|
|
35
19
|
tabIndex = -1,
|
|
@@ -46,6 +30,7 @@ const ArrowNav = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
46
30
|
searchable,
|
|
47
31
|
searchTerm,
|
|
48
32
|
setSearchTerm,
|
|
33
|
+
isVirtualized = false,
|
|
49
34
|
'data-popper-ready': isPopperReady,
|
|
50
35
|
// comes from Popper.js where ArrowNav is cloned
|
|
51
36
|
style,
|
|
@@ -53,35 +38,87 @@ const ArrowNav = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
53
38
|
...rest
|
|
54
39
|
} = _ref;
|
|
55
40
|
const containerRef = useRef(null);
|
|
41
|
+
const virtuosoRef = useRef(null);
|
|
42
|
+
const childRefs = useRef({});
|
|
43
|
+
const [virtualRange, setVirtualRange] = useState({
|
|
44
|
+
startIndex: -1,
|
|
45
|
+
endIndex: -1
|
|
46
|
+
});
|
|
56
47
|
const menuId = useId();
|
|
57
48
|
const {
|
|
58
49
|
isFocusVisible
|
|
59
|
-
} = useFocusVisible(
|
|
60
|
-
|
|
61
|
-
});
|
|
62
|
-
const [refs, allChildren] = useChildrenRefs(children, (child, index) => ({
|
|
50
|
+
} = useFocusVisible();
|
|
51
|
+
const getAdditionalProps = useCallback((child, index) => ({
|
|
63
52
|
tabIndex: -1,
|
|
64
53
|
onMouseEnter: wrapEvent(child.props.onMouseEnter, () => {
|
|
65
54
|
onHighlightedIndexChange(index);
|
|
66
55
|
})
|
|
67
|
-
}),
|
|
56
|
+
}), [onHighlightedIndexChange]);
|
|
57
|
+
const createRefCallback = useCallback(
|
|
58
|
+
// eslint-disable-next-line no-return-assign
|
|
59
|
+
index => node => childRefs.current[index] = node, []);
|
|
60
|
+
|
|
61
|
+
// Fixes ResizeObserver error that appears in jest when running tests with a virtualized Menu
|
|
62
|
+
if (typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.NODE_ENV) === 'test' && window) {
|
|
63
|
+
var _window$ResizeObserve;
|
|
64
|
+
window.ResizeObserver = (_window$ResizeObserve = window.ResizeObserver) !== null && _window$ResizeObserve !== void 0 ? _window$ResizeObserve : ResizeObserver;
|
|
65
|
+
}
|
|
66
|
+
const allChildren = useMemo(() => {
|
|
67
|
+
let refIndex = searchable ? 1 : 0;
|
|
68
|
+
const result = React__default.Children.map(children, child => {
|
|
69
|
+
if (isNavItem(child)) {
|
|
70
|
+
const myIndex = refIndex;
|
|
71
|
+
refIndex += 1;
|
|
72
|
+
const additionalProps = getAdditionalProps(child, myIndex);
|
|
73
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
74
|
+
ref: mergeRefs(createRefCallback(myIndex), child.ref),
|
|
75
|
+
...additionalProps
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return child;
|
|
79
|
+
});
|
|
80
|
+
childRefs.current.length = refIndex;
|
|
81
|
+
return result;
|
|
82
|
+
}, [children, getAdditionalProps, isNavItem, searchable, createRefCallback]);
|
|
68
83
|
|
|
69
84
|
// Update the focused menu item when the highlighted index changes
|
|
70
85
|
useEffect(() => {
|
|
71
86
|
if (isPopperReady) {
|
|
72
|
-
|
|
87
|
+
const searchInputHeight = searchable ? 53 : 0;
|
|
88
|
+
const paddingSize = 4;
|
|
89
|
+
if (isFocusVisible && isVirtualized && virtuosoRef.current && (highlightedIndex > virtualRange.endIndex || highlightedIndex < virtualRange.startIndex)) {
|
|
90
|
+
virtuosoRef.current.scrollToIndex({
|
|
91
|
+
index: highlightedIndex,
|
|
92
|
+
offset: -1 * searchInputHeight - paddingSize
|
|
93
|
+
});
|
|
94
|
+
} else if (childRefs.current[highlightedIndex]) {
|
|
73
95
|
// Scroll the item into view when navigating with a keyboard
|
|
74
|
-
const element =
|
|
75
|
-
const searchInputSize = searchable ? 53 : 0;
|
|
96
|
+
const element = childRefs.current[highlightedIndex];
|
|
76
97
|
if (containerRef.current && isFocusVisible) {
|
|
77
98
|
const scrollBottom = containerRef.current.clientHeight + containerRef.current.scrollTop;
|
|
78
99
|
const elementBottom = element.offsetTop + element.offsetHeight;
|
|
79
|
-
if (elementBottom > scrollBottom) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
if (elementBottom > scrollBottom - searchInputHeight) {
|
|
101
|
+
if (isVirtualized && virtuosoRef.current) {
|
|
102
|
+
virtuosoRef.current.scrollToIndex({
|
|
103
|
+
index: highlightedIndex - (searchable ? 1 : 0),
|
|
104
|
+
align: 'end',
|
|
105
|
+
offset: paddingSize
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
containerRef.current.scrollTop = elementBottom - containerRef.current.clientHeight;
|
|
109
|
+
}
|
|
110
|
+
} else if (element.offsetTop < containerRef.current.scrollTop) {
|
|
111
|
+
if (isVirtualized && virtuosoRef.current) {
|
|
112
|
+
virtuosoRef.current.scrollToIndex({
|
|
113
|
+
index: highlightedIndex - (searchable ? 1 : 0),
|
|
114
|
+
offset: -1 * searchInputHeight - paddingSize
|
|
115
|
+
});
|
|
116
|
+
} else {
|
|
117
|
+
containerRef.current.scrollTop = element.offsetTop - searchInputHeight;
|
|
118
|
+
}
|
|
83
119
|
}
|
|
84
120
|
}
|
|
121
|
+
|
|
85
122
|
/* preventScroll isn't strictly needed.
|
|
86
123
|
* For keyboard users it makes no difference since the item is already in view when .focus() is called.
|
|
87
124
|
* For mouse users, it prevents scrolling from occurring when hovering over a menu item that is partially out of view.
|
|
@@ -96,10 +133,10 @@ const ArrowNav = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
96
133
|
anchorRef === null || anchorRef === void 0 || (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 || _anchorRef$current.focus();
|
|
97
134
|
}
|
|
98
135
|
}
|
|
99
|
-
}, [highlightedIndex,
|
|
136
|
+
}, [highlightedIndex, childRefs, virtualRange, searchable, allChildren === null || allChildren === void 0 ? void 0 : allChildren.length,
|
|
100
137
|
// Needed to prevent QuickSearch from losing focus in some cases when items are loaded asynchronously while the user is navigating
|
|
101
|
-
isPopperReady, searchBoxRef, anchorRef]);
|
|
102
|
-
const numChildren =
|
|
138
|
+
isPopperReady, searchBoxRef, anchorRef, isVirtualized, isFocusVisible]);
|
|
139
|
+
const numChildren = (_childRefs$current$le = childRefs.current.length) !== null && _childRefs$current$le !== void 0 ? _childRefs$current$le : 1;
|
|
103
140
|
const handleKeyDown = e => {
|
|
104
141
|
if (e.key === 'ArrowDown') {
|
|
105
142
|
e.preventDefault(); // prevent scroll
|
|
@@ -162,7 +199,13 @@ const ArrowNav = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
162
199
|
style: {
|
|
163
200
|
padding: '4px 0'
|
|
164
201
|
}
|
|
165
|
-
},
|
|
202
|
+
}, isVirtualized ? /*#__PURE__*/React__default.createElement(Virtuoso, _extends({
|
|
203
|
+
customScrollParent: (_containerRef$current3 = containerRef.current) !== null && _containerRef$current3 !== void 0 ? _containerRef$current3 : undefined,
|
|
204
|
+
data: React__default.Children.toArray(allChildren),
|
|
205
|
+
itemContent: (_, child) => ! /*#__PURE__*/React__default.isValidElement(child) ? null : child,
|
|
206
|
+
rangeChanged: setVirtualRange,
|
|
207
|
+
ref: virtuosoRef
|
|
208
|
+
}, VIRTUOSO_PROPS)) : allChildren))
|
|
166
209
|
);
|
|
167
210
|
});
|
|
168
211
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
-
import React__default from 'react';
|
|
2
|
+
import React__default, { useRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import styles from '../NewMenu.js';
|
|
5
5
|
import '../../../utils/index.js';
|
|
6
6
|
import Check from '../../Checkbox/Check.js';
|
|
7
|
+
import mergeRefs from '../../../utils/mergeRefs/mergeRefs.js';
|
|
7
8
|
import wrapEvent from '../../../utils/wrapEvent/wrapEvent.js';
|
|
8
9
|
|
|
9
10
|
const MenuItem = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
@@ -23,17 +24,28 @@ const MenuItem = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
23
24
|
isSelectable = false,
|
|
24
25
|
...rest
|
|
25
26
|
} = _ref;
|
|
27
|
+
const itemRef = useRef();
|
|
26
28
|
const defaultRole = isSelectable ? isMultiSelect ? 'menuitemcheckbox' : 'menuitemradio' : 'menuitem';
|
|
27
|
-
const handleSelect = e => {
|
|
29
|
+
const handleSelect = useCallback(e => {
|
|
28
30
|
if (typeof onSelect === 'function' && !disabled) {
|
|
29
31
|
onSelect(e);
|
|
30
32
|
}
|
|
31
|
-
};
|
|
33
|
+
}, [disabled, onSelect]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
var _itemRef$current;
|
|
36
|
+
/* preventScroll isn't strictly needed.
|
|
37
|
+
* For keyboard users it makes no difference since the item is already in view when .focus() is called.
|
|
38
|
+
* For mouse users, it prevents scrolling from occurring when hovering over a menu item that is partially out of view.
|
|
39
|
+
*/
|
|
40
|
+
if (isHighlighted) (_itemRef$current = itemRef.current) === null || _itemRef$current === void 0 || _itemRef$current.focus({
|
|
41
|
+
preventScroll: true
|
|
42
|
+
});
|
|
43
|
+
}, [isHighlighted]);
|
|
32
44
|
return (
|
|
33
45
|
/*#__PURE__*/
|
|
34
46
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
35
47
|
React__default.createElement("div", _extends({}, rest, {
|
|
36
|
-
ref: ref,
|
|
48
|
+
ref: mergeRefs(itemRef, ref),
|
|
37
49
|
role: role !== null && role !== void 0 ? role : defaultRole,
|
|
38
50
|
tabIndex: tabIndex,
|
|
39
51
|
"aria-disabled": disabled,
|