@fluentui/react-combobox 9.5.8 → 9.5.10
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.json +121 -1
- package/CHANGELOG.md +35 -2
- package/lib/components/Combobox/Combobox.js.map +1 -1
- package/lib/components/Combobox/renderCombobox.js +15 -7
- package/lib/components/Combobox/renderCombobox.js.map +1 -1
- package/lib/components/Combobox/useCombobox.js +17 -13
- package/lib/components/Combobox/useCombobox.js.map +1 -1
- package/lib/components/Combobox/useComboboxStyles.styles.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/renderDropdown.js +19 -7
- package/lib/components/Dropdown/renderDropdown.js.map +1 -1
- package/lib/components/Dropdown/useDropdown.js +4 -3
- package/lib/components/Dropdown/useDropdown.js.map +1 -1
- package/lib/components/Dropdown/useDropdownStyles.styles.js.map +1 -1
- package/lib/components/Listbox/Listbox.js.map +1 -1
- package/lib/components/Listbox/renderListbox.js +5 -4
- package/lib/components/Listbox/renderListbox.js.map +1 -1
- package/lib/components/Listbox/useListbox.js +5 -4
- package/lib/components/Listbox/useListbox.js.map +1 -1
- package/lib/components/Option/Option.js.map +1 -1
- package/lib/components/Option/renderOption.js +7 -2
- package/lib/components/Option/renderOption.js.map +1 -1
- package/lib/components/Option/useOption.js +5 -4
- package/lib/components/Option/useOption.js.map +1 -1
- package/lib/components/Option/useOptionStyles.styles.js.map +1 -1
- package/lib/components/OptionGroup/OptionGroup.js.map +1 -1
- package/lib/components/OptionGroup/renderOptionGroup.js +9 -2
- package/lib/components/OptionGroup/renderOptionGroup.js.map +1 -1
- package/lib/components/OptionGroup/useOptionGroup.js +1 -1
- package/lib/components/OptionGroup/useOptionGroup.js.map +1 -1
- package/lib/contexts/ComboboxContext.js.map +1 -1
- package/lib/contexts/ListboxContext.js.map +1 -1
- package/lib/contexts/useComboboxContextValues.js +1 -1
- package/lib/contexts/useComboboxContextValues.js.map +1 -1
- package/lib/contexts/useListboxContextValues.js +1 -1
- package/lib/contexts/useListboxContextValues.js.map +1 -1
- package/lib/utils/dropdownKeyActions.js +2 -2
- package/lib/utils/dropdownKeyActions.js.map +1 -1
- package/lib/utils/useComboboxBaseState.js +5 -4
- package/lib/utils/useComboboxBaseState.js.map +1 -1
- package/lib/utils/useComboboxPopup.js +5 -4
- package/lib/utils/useComboboxPopup.js.map +1 -1
- package/lib/utils/useOptionCollection.js +2 -1
- package/lib/utils/useOptionCollection.js.map +1 -1
- package/lib/utils/useScrollOptionsIntoView.js +3 -3
- package/lib/utils/useScrollOptionsIntoView.js.map +1 -1
- package/lib/utils/useSelection.js +5 -3
- package/lib/utils/useSelection.js.map +1 -1
- package/lib/utils/useTriggerListboxSlots.js +11 -9
- package/lib/utils/useTriggerListboxSlots.js.map +1 -1
- package/lib-commonjs/Combobox.js +2 -2
- package/lib-commonjs/Combobox.js.map +1 -1
- package/lib-commonjs/Dropdown.js +2 -2
- package/lib-commonjs/Dropdown.js.map +1 -1
- package/lib-commonjs/Listbox.js +2 -2
- package/lib-commonjs/Listbox.js.map +1 -1
- package/lib-commonjs/Option.js +2 -2
- package/lib-commonjs/Option.js.map +1 -1
- package/lib-commonjs/OptionGroup.js +2 -2
- package/lib-commonjs/OptionGroup.js.map +1 -1
- package/lib-commonjs/Selection.js +2 -2
- package/lib-commonjs/Selection.js.map +1 -1
- package/lib-commonjs/components/Combobox/Combobox.js +9 -7
- package/lib-commonjs/components/Combobox/Combobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/Combobox.types.js +2 -2
- package/lib-commonjs/components/Combobox/Combobox.types.js.map +1 -1
- package/lib-commonjs/components/Combobox/index.js +6 -6
- package/lib-commonjs/components/Combobox/index.js.map +1 -1
- package/lib-commonjs/components/Combobox/renderCombobox.js +22 -12
- package/lib-commonjs/components/Combobox/renderCombobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/useCombobox.js +43 -38
- package/lib-commonjs/components/Combobox/useCombobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/useComboboxStyles.styles.js +10 -6
- package/lib-commonjs/components/Combobox/useComboboxStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Dropdown/Dropdown.js +9 -7
- package/lib-commonjs/components/Dropdown/Dropdown.js.map +1 -1
- package/lib-commonjs/components/Dropdown/index.js +6 -6
- package/lib-commonjs/components/Dropdown/index.js.map +1 -1
- package/lib-commonjs/components/Dropdown/renderDropdown.js +26 -12
- package/lib-commonjs/components/Dropdown/renderDropdown.js.map +1 -1
- package/lib-commonjs/components/Dropdown/useDropdown.js +24 -21
- package/lib-commonjs/components/Dropdown/useDropdown.js.map +1 -1
- package/lib-commonjs/components/Dropdown/useDropdownStyles.styles.js +9 -5
- package/lib-commonjs/components/Dropdown/useDropdownStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Listbox/Listbox.js +9 -7
- package/lib-commonjs/components/Listbox/Listbox.js.map +1 -1
- package/lib-commonjs/components/Listbox/index.js +6 -6
- package/lib-commonjs/components/Listbox/index.js.map +1 -1
- package/lib-commonjs/components/Listbox/renderListbox.js +12 -9
- package/lib-commonjs/components/Listbox/renderListbox.js.map +1 -1
- package/lib-commonjs/components/Listbox/useListbox.js +23 -20
- package/lib-commonjs/components/Listbox/useListbox.js.map +1 -1
- package/lib-commonjs/components/Listbox/useListboxStyles.styles.js +7 -3
- package/lib-commonjs/components/Listbox/useListboxStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Option/Option.js +9 -7
- package/lib-commonjs/components/Option/Option.js.map +1 -1
- package/lib-commonjs/components/Option/Option.types.js +2 -2
- package/lib-commonjs/components/Option/Option.types.js.map +1 -1
- package/lib-commonjs/components/Option/index.js +6 -6
- package/lib-commonjs/components/Option/index.js.map +1 -1
- package/lib-commonjs/components/Option/renderOption.js +13 -6
- package/lib-commonjs/components/Option/renderOption.js.map +1 -1
- package/lib-commonjs/components/Option/useOption.js +29 -26
- package/lib-commonjs/components/Option/useOption.js.map +1 -1
- package/lib-commonjs/components/Option/useOptionStyles.styles.js +8 -4
- package/lib-commonjs/components/Option/useOptionStyles.styles.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/OptionGroup.js +9 -7
- package/lib-commonjs/components/OptionGroup/OptionGroup.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/index.js +6 -6
- package/lib-commonjs/components/OptionGroup/index.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/renderOptionGroup.js +15 -6
- package/lib-commonjs/components/OptionGroup/renderOptionGroup.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/useOptionGroup.js +10 -8
- package/lib-commonjs/components/OptionGroup/useOptionGroup.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/useOptionGroupStyles.styles.js +7 -3
- package/lib-commonjs/components/OptionGroup/useOptionGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/ComboboxContext.js +8 -4
- package/lib-commonjs/contexts/ComboboxContext.js.map +1 -1
- package/lib-commonjs/contexts/ListboxContext.js +8 -4
- package/lib-commonjs/contexts/ListboxContext.js.map +1 -1
- package/lib-commonjs/contexts/useComboboxContextValues.js +4 -2
- package/lib-commonjs/contexts/useComboboxContextValues.js.map +1 -1
- package/lib-commonjs/contexts/useListboxContextValues.js +8 -6
- package/lib-commonjs/contexts/useListboxContextValues.js.map +1 -1
- package/lib-commonjs/index.js +94 -36
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/ComboboxBase.types.js +2 -2
- package/lib-commonjs/utils/ComboboxBase.types.js.map +1 -1
- package/lib-commonjs/utils/Selection.types.js +2 -2
- package/lib-commonjs/utils/Selection.types.js.map +1 -1
- package/lib-commonjs/utils/dropdownKeyActions.js +23 -19
- package/lib-commonjs/utils/dropdownKeyActions.js.map +1 -1
- package/lib-commonjs/utils/internalTokens.js +3 -1
- package/lib-commonjs/utils/internalTokens.js.map +1 -1
- package/lib-commonjs/utils/useComboboxBaseState.js +14 -11
- package/lib-commonjs/utils/useComboboxBaseState.js.map +1 -1
- package/lib-commonjs/utils/useComboboxPopup.js +11 -8
- package/lib-commonjs/utils/useComboboxPopup.js.map +1 -1
- package/lib-commonjs/utils/useOptionCollection.js +7 -4
- package/lib-commonjs/utils/useOptionCollection.js.map +1 -1
- package/lib-commonjs/utils/useScrollOptionsIntoView.js +10 -8
- package/lib-commonjs/utils/useScrollOptionsIntoView.js.map +1 -1
- package/lib-commonjs/utils/useSelection.js +10 -6
- package/lib-commonjs/utils/useSelection.js.map +1 -1
- package/lib-commonjs/utils/useTriggerListboxSlots.js +25 -21
- package/lib-commonjs/utils/useTriggerListboxSlots.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["internalTokens.js"],"sourcesContent":["export const iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px'\n};\n"],"names":["iconSizes","small","medium","large"],"mappings":";;;;+BAAaA
|
|
1
|
+
{"version":3,"sources":["internalTokens.js"],"sourcesContent":["export const iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px'\n};\n"],"names":["iconSizes","small","medium","large"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,YAAY;IACrBC,OAAO;IACPC,QAAQ;IACRC,OAAO;AACX"}
|
|
@@ -4,17 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useComboboxBaseState", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useComboboxBaseState;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
12
14
|
const _useOptionCollection = require("../utils/useOptionCollection");
|
|
13
15
|
const _useSelection = require("../utils/useSelection");
|
|
14
16
|
const useComboboxBaseState = (props)=>{
|
|
15
|
-
const { appearance ='outline'
|
|
17
|
+
const { appearance = 'outline', children, editable = false, inlinePopup = false, mountNode = undefined, multiselect, onOpenChange, size = 'medium' } = props;
|
|
16
18
|
const optionCollection = (0, _useOptionCollection.useOptionCollection)();
|
|
17
|
-
const { getOptionAtIndex
|
|
19
|
+
const { getOptionAtIndex, getOptionsMatchingValue } = optionCollection;
|
|
18
20
|
const [activeOption, setActiveOption] = _react.useState();
|
|
19
21
|
// track whether keyboard focus outline should be shown
|
|
20
22
|
// tabster/keyborg doesn't work here, since the actual keyboard focus target doesn't move
|
|
@@ -23,10 +25,10 @@ const useComboboxBaseState = (props)=>{
|
|
|
23
25
|
const [hasFocus, setHasFocus] = _react.useState(false);
|
|
24
26
|
const ignoreNextBlur = _react.useRef(false);
|
|
25
27
|
const selectionState = (0, _useSelection.useSelection)(props);
|
|
26
|
-
const { selectedOptions
|
|
28
|
+
const { selectedOptions } = selectionState;
|
|
27
29
|
// calculate value based on props, internal value changes, and selected options
|
|
28
|
-
const isFirstMount = (0,
|
|
29
|
-
const [controllableValue, setValue] = (0,
|
|
30
|
+
const isFirstMount = (0, _reactutilities.useFirstMount)();
|
|
31
|
+
const [controllableValue, setValue] = (0, _reactutilities.useControllableState)({
|
|
30
32
|
state: props.value,
|
|
31
33
|
initialState: undefined
|
|
32
34
|
});
|
|
@@ -60,13 +62,14 @@ const useComboboxBaseState = (props)=>{
|
|
|
60
62
|
selectedOptions
|
|
61
63
|
]);
|
|
62
64
|
// Handle open state, which is shared with options in context
|
|
63
|
-
const [open, setOpenState] = (0,
|
|
65
|
+
const [open, setOpenState] = (0, _reactutilities.useControllableState)({
|
|
64
66
|
state: props.open,
|
|
65
67
|
defaultState: props.defaultOpen,
|
|
66
68
|
initialState: false
|
|
67
69
|
});
|
|
68
70
|
const setOpen = _react.useCallback((event, newState)=>{
|
|
69
|
-
|
|
71
|
+
var _onOpenChange;
|
|
72
|
+
(_onOpenChange = onOpenChange) === null || _onOpenChange === void 0 ? void 0 : _onOpenChange(event, {
|
|
70
73
|
open: newState
|
|
71
74
|
});
|
|
72
75
|
setOpenState(newState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useComboboxBaseState.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useFirstMount } from '@fluentui/react-utilities';\nimport { useOptionCollection } from '../utils/useOptionCollection';\nimport { useSelection } from '../utils/useSelection';\n/**\n * State shared between Combobox and Dropdown components\n */ export const useComboboxBaseState = (props)=>{\n const { appearance ='outline'
|
|
1
|
+
{"version":3,"sources":["useComboboxBaseState.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useFirstMount } from '@fluentui/react-utilities';\nimport { useOptionCollection } from '../utils/useOptionCollection';\nimport { useSelection } from '../utils/useSelection';\n/**\n * State shared between Combobox and Dropdown components\n */ export const useComboboxBaseState = (props)=>{\n const { appearance = 'outline', children, editable = false, inlinePopup = false, mountNode = undefined, multiselect, onOpenChange, size = 'medium' } = props;\n const optionCollection = useOptionCollection();\n const { getOptionAtIndex, getOptionsMatchingValue } = optionCollection;\n const [activeOption, setActiveOption] = React.useState();\n // track whether keyboard focus outline should be shown\n // tabster/keyborg doesn't work here, since the actual keyboard focus target doesn't move\n const [focusVisible, setFocusVisible] = React.useState(false);\n // track focused state to conditionally render collapsed listbox\n const [hasFocus, setHasFocus] = React.useState(false);\n const ignoreNextBlur = React.useRef(false);\n const selectionState = useSelection(props);\n const { selectedOptions } = selectionState;\n // calculate value based on props, internal value changes, and selected options\n const isFirstMount = useFirstMount();\n const [controllableValue, setValue] = useControllableState({\n state: props.value,\n initialState: undefined\n });\n const value = React.useMemo(()=>{\n // don't compute the value if it is defined through props or setValue,\n if (controllableValue !== undefined) {\n return controllableValue;\n }\n // handle defaultValue here, so it is overridden by selection\n if (isFirstMount && props.defaultValue !== undefined) {\n return props.defaultValue;\n }\n const selectedOptionsText = getOptionsMatchingValue((optionValue)=>{\n return selectedOptions.includes(optionValue);\n }).map((option)=>option.text);\n if (multiselect) {\n // editable inputs should not display multiple selected options in the input as text\n return editable ? '' : selectedOptionsText.join(', ');\n }\n return selectedOptionsText[0];\n // do not change value after isFirstMount changes,\n // we do not want to accidentally override defaultValue on a second render\n // unless another value is intentionally set\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n controllableValue,\n editable,\n getOptionsMatchingValue,\n multiselect,\n props.defaultValue,\n selectedOptions\n ]);\n // Handle open state, which is shared with options in context\n const [open, setOpenState] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false\n });\n const setOpen = React.useCallback((event, newState)=>{\n var _onOpenChange;\n (_onOpenChange = onOpenChange) === null || _onOpenChange === void 0 ? void 0 : _onOpenChange(event, {\n open: newState\n });\n setOpenState(newState);\n }, [\n onOpenChange,\n setOpenState\n ]);\n // update active option based on change in open state or children\n React.useEffect(()=>{\n if (open && !activeOption) {\n // if it is single-select and there is a selected option, start at the selected option\n if (!multiselect && selectedOptions.length > 0) {\n const selectedOption = getOptionsMatchingValue((v)=>v === selectedOptions[0]).pop();\n selectedOption && setActiveOption(selectedOption);\n } else {\n setActiveOption(getOptionAtIndex(0));\n }\n } else if (!open) {\n // reset the active option when closing\n setActiveOption(undefined);\n }\n // this should only be run in response to changes in the open state or children\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n open,\n children\n ]);\n return {\n ...optionCollection,\n ...selectionState,\n activeOption,\n appearance,\n focusVisible,\n hasFocus,\n ignoreNextBlur,\n inlinePopup,\n mountNode,\n open,\n setActiveOption,\n setFocusVisible,\n setHasFocus,\n setOpen,\n setValue,\n size,\n value\n };\n};\n"],"names":["useComboboxBaseState","props","appearance","children","editable","inlinePopup","mountNode","undefined","multiselect","onOpenChange","size","optionCollection","useOptionCollection","getOptionAtIndex","getOptionsMatchingValue","activeOption","setActiveOption","React","useState","focusVisible","setFocusVisible","hasFocus","setHasFocus","ignoreNextBlur","useRef","selectionState","useSelection","selectedOptions","isFirstMount","useFirstMount","controllableValue","setValue","useControllableState","state","value","initialState","useMemo","defaultValue","selectedOptionsText","optionValue","includes","map","option","text","join","open","setOpenState","defaultState","defaultOpen","setOpen","useCallback","event","newState","_onOpenChange","useEffect","length","selectedOption","v","pop"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iEANM;gCAC6B;qCAChB;8BACP;AAGlB,MAAMA,uBAAuB,CAACC;IACrC,MAAM,EAAEC,aAAa,SAAS,EAAEC,QAAQ,EAAEC,WAAW,KAAK,EAAEC,cAAc,KAAK,EAAEC,YAAYC,SAAS,EAAEC,WAAW,EAAEC,YAAY,EAAEC,OAAO,QAAQ,EAAE,GAAGT;IACvJ,MAAMU,mBAAmBC,IAAAA,wCAAmB;IAC5C,MAAM,EAAEC,gBAAgB,EAAEC,uBAAuB,EAAE,GAAGH;IACtD,MAAM,CAACI,cAAcC,gBAAgB,GAAGC,OAAMC,QAAQ;IACtD,uDAAuD;IACvD,yFAAyF;IACzF,MAAM,CAACC,cAAcC,gBAAgB,GAAGH,OAAMC,QAAQ,CAAC;IACvD,gEAAgE;IAChE,MAAM,CAACG,UAAUC,YAAY,GAAGL,OAAMC,QAAQ,CAAC;IAC/C,MAAMK,iBAAiBN,OAAMO,MAAM,CAAC;IACpC,MAAMC,iBAAiBC,IAAAA,0BAAY,EAACzB;IACpC,MAAM,EAAE0B,eAAe,EAAE,GAAGF;IAC5B,+EAA+E;IAC/E,MAAMG,eAAeC,IAAAA,6BAAa;IAClC,MAAM,CAACC,mBAAmBC,SAAS,GAAGC,IAAAA,oCAAoB,EAAC;QACvDC,OAAOhC,MAAMiC,KAAK;QAClBC,cAAc5B;IAClB;IACA,MAAM2B,QAAQjB,OAAMmB,OAAO,CAAC;QACxB,sEAAsE;QACtE,IAAIN,sBAAsBvB,WAAW;YACjC,OAAOuB;QACX;QACA,6DAA6D;QAC7D,IAAIF,gBAAgB3B,MAAMoC,YAAY,KAAK9B,WAAW;Y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H;IACD,OAAO;QACH,GAAGQ,gBAAgB;QACnB,GAAGc,cAAc;QACjBV;QACAb;QACAiB;QACAE;QACAE;QACAlB;QACAC;QACAuC;QACA7B;QACAI;QACAE;QACA2B;QACAlB;QACArB;QACAwB;IACJ;AACJ"}
|
|
@@ -4,12 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useComboboxPopup", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useComboboxPopup;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
+
const _reactpositioning = require("@fluentui/react-positioning");
|
|
12
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
11
13
|
function useComboboxPopup(props, triggerShorthand, listboxShorthand) {
|
|
12
|
-
|
|
14
|
+
var _listboxShorthand, _triggerShorthand;
|
|
15
|
+
const { positioning } = props;
|
|
13
16
|
// Set a default set of fallback positions to try if the dropdown does not fit on screen
|
|
14
17
|
const fallbackPositions = [
|
|
15
18
|
'above',
|
|
@@ -27,10 +30,10 @@ function useComboboxPopup(props, triggerShorthand, listboxShorthand) {
|
|
|
27
30
|
mainAxis: 2
|
|
28
31
|
},
|
|
29
32
|
fallbackPositions,
|
|
30
|
-
...(0,
|
|
33
|
+
...(0, _reactpositioning.resolvePositioningShorthand)(positioning)
|
|
31
34
|
};
|
|
32
|
-
const { targetRef
|
|
33
|
-
const listboxRef = (0,
|
|
35
|
+
const { targetRef, containerRef } = (0, _reactpositioning.usePositioning)(popperOptions);
|
|
36
|
+
const listboxRef = (0, _reactutilities.useMergedRefs)((_listboxShorthand = listboxShorthand) === null || _listboxShorthand === void 0 ? void 0 : _listboxShorthand.ref, containerRef);
|
|
34
37
|
const listbox = listboxShorthand && {
|
|
35
38
|
...listboxShorthand,
|
|
36
39
|
ref: listboxRef
|
|
@@ -38,7 +41,7 @@ function useComboboxPopup(props, triggerShorthand, listboxShorthand) {
|
|
|
38
41
|
return [
|
|
39
42
|
{
|
|
40
43
|
...triggerShorthand,
|
|
41
|
-
ref: (0,
|
|
44
|
+
ref: (0, _reactutilities.useMergedRefs)((_triggerShorthand = triggerShorthand) === null || _triggerShorthand === void 0 ? void 0 : _triggerShorthand.ref, targetRef)
|
|
42
45
|
},
|
|
43
46
|
listbox
|
|
44
47
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useComboboxPopup.js"],"sourcesContent":["import { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport { useMergedRefs } from '@fluentui/react-utilities';\nexport function useComboboxPopup(props, triggerShorthand, listboxShorthand) {\n const { positioning
|
|
1
|
+
{"version":3,"sources":["useComboboxPopup.js"],"sourcesContent":["import { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport { useMergedRefs } from '@fluentui/react-utilities';\nexport function useComboboxPopup(props, triggerShorthand, listboxShorthand) {\n var _listboxShorthand, _triggerShorthand;\n const { positioning } = props;\n // Set a default set of fallback positions to try if the dropdown does not fit on screen\n const fallbackPositions = [\n 'above',\n 'after',\n 'after-top',\n 'before',\n 'before-top'\n ];\n // popper options\n const popperOptions = {\n position: 'below',\n align: 'start',\n offset: {\n crossAxis: 0,\n mainAxis: 2\n },\n fallbackPositions,\n ...resolvePositioningShorthand(positioning)\n };\n const { targetRef, containerRef } = usePositioning(popperOptions);\n const listboxRef = useMergedRefs((_listboxShorthand = listboxShorthand) === null || _listboxShorthand === void 0 ? void 0 : _listboxShorthand.ref, containerRef);\n const listbox = listboxShorthand && {\n ...listboxShorthand,\n ref: listboxRef\n };\n return [\n {\n ...triggerShorthand,\n ref: useMergedRefs((_triggerShorthand = triggerShorthand) === null || _triggerShorthand === void 0 ? void 0 : _triggerShorthand.ref, targetRef)\n },\n listbox\n ];\n}\n"],"names":["useComboboxPopup","props","triggerShorthand","listboxShorthand","_listboxShorthand","_triggerShorthand","positioning","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","resolvePositioningShorthand","targetRef","containerRef","usePositioning","listboxRef","useMergedRefs","ref","listbox"],"mappings":";;;;+BAEgBA;;;eAAAA;;;kCAF4C;gCAC9B;AACvB,SAASA,iBAAiBC,KAAK,EAAEC,gBAAgB,EAAEC,gBAAgB;IACtE,IAAIC,mBAAmBC;IACvB,MAAM,EAAEC,WAAW,EAAE,GAAGL;IACxB,wFAAwF;IACxF,MAAMM,oBAAoB;QACtB;QACA;QACA;QACA;QACA;KACH;IACD,iBAAiB;IACjB,MAAMC,gBAAgB;QAClBC,UAAU;QACVC,OAAO;QACPC,QAAQ;YACJC,WAAW;YACXC,UAAU;QACd;QACAN;QACA,GAAGO,IAAAA,6CAA2B,EAACR,YAAY;IAC/C;IACA,MAAM,EAAES,SAAS,EAAEC,YAAY,EAAE,GAAGC,IAAAA,gCAAc,EAACT;IACnD,MAAMU,aAAaC,IAAAA,6BAAa,EAAC,AAACf,CAAAA,oBAAoBD,gBAAe,MAAO,QAAQC,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBgB,GAAG,EAAEJ;IACnJ,MAAMK,UAAUlB,oBAAoB;QAChC,GAAGA,gBAAgB;QACnBiB,KAAKF;IACT;IACA,OAAO;QACH;YACI,GAAGhB,gBAAgB;YACnBkB,KAAKD,IAAAA,6BAAa,EAAC,AAACd,CAAAA,oBAAoBH,gBAAe,MAAO,QAAQG,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBe,GAAG,EAAEL;QACzI;QACAM;KACH;AACL"}
|
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useOptionCollection", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useOptionCollection;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
11
13
|
const useOptionCollection = ()=>{
|
|
12
14
|
const nodes = _react.useRef([]);
|
|
13
15
|
const collectionAPI = _react.useMemo(()=>{
|
|
@@ -18,8 +20,9 @@ const useOptionCollection = ()=>{
|
|
|
18
20
|
};
|
|
19
21
|
const getIndexOfId = (id)=>nodes.current.findIndex((node)=>node.option.id === id);
|
|
20
22
|
const getOptionById = (id)=>{
|
|
23
|
+
var _item;
|
|
21
24
|
const item = nodes.current.find((node)=>node.option.id === id);
|
|
22
|
-
return item === null ||
|
|
25
|
+
return (_item = item) === null || _item === void 0 ? void 0 : _item.option;
|
|
23
26
|
};
|
|
24
27
|
const getOptionsMatchingText = (matcher)=>{
|
|
25
28
|
return nodes.current.filter((node)=>matcher(node.option.text)).map((node)=>node.option);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useOptionCollection.js"],"sourcesContent":["import * as React from 'react';\n/**\n * A hook for managing a collection of child Options\n */ export const useOptionCollection = ()=>{\n const nodes = React.useRef([]);\n const collectionAPI = React.useMemo(()=>{\n const getCount = ()=>nodes.current.length;\n const getOptionAtIndex = (index)=>{\n var _nodes_current_index;\n return (_nodes_current_index = nodes.current[index]) === null || _nodes_current_index === void 0 ? void 0 : _nodes_current_index.option;\n };\n const getIndexOfId = (id)=>nodes.current.findIndex((node)=>node.option.id === id);\n const getOptionById = (id)=>{\n const item = nodes.current.find((node)=>node.option.id === id);\n return item === null ||
|
|
1
|
+
{"version":3,"sources":["useOptionCollection.js"],"sourcesContent":["import * as React from 'react';\n/**\n * A hook for managing a collection of child Options\n */ export const useOptionCollection = ()=>{\n const nodes = React.useRef([]);\n const collectionAPI = React.useMemo(()=>{\n const getCount = ()=>nodes.current.length;\n const getOptionAtIndex = (index)=>{\n var _nodes_current_index;\n return (_nodes_current_index = nodes.current[index]) === null || _nodes_current_index === void 0 ? void 0 : _nodes_current_index.option;\n };\n const getIndexOfId = (id)=>nodes.current.findIndex((node)=>node.option.id === id);\n const getOptionById = (id)=>{\n var _item;\n const item = nodes.current.find((node)=>node.option.id === id);\n return (_item = item) === null || _item === void 0 ? void 0 : _item.option;\n };\n const getOptionsMatchingText = (matcher)=>{\n return nodes.current.filter((node)=>matcher(node.option.text)).map((node)=>node.option);\n };\n const getOptionsMatchingValue = (matcher)=>{\n return nodes.current.filter((node)=>matcher(node.option.value)).map((node)=>node.option);\n };\n return {\n getCount,\n getOptionAtIndex,\n getIndexOfId,\n getOptionById,\n getOptionsMatchingText,\n getOptionsMatchingValue\n };\n }, []);\n const registerOption = React.useCallback((option, element)=>{\n var _nodes_current_index;\n const index = nodes.current.findIndex((node)=>{\n if (!node.element || !element) {\n return false;\n }\n if (node.option.id === option.id) {\n return true;\n }\n // use the DOM method compareDocumentPosition to order the current node against registered nodes\n // eslint-disable-next-line no-bitwise\n return node.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING;\n });\n // do not register the option if it already exists\n if (((_nodes_current_index = nodes.current[index]) === null || _nodes_current_index === void 0 ? void 0 : _nodes_current_index.option.id) !== option.id) {\n const newItem = {\n element,\n option\n };\n // If an index is not found we will push the element to the end.\n if (index === -1) {\n nodes.current = [\n ...nodes.current,\n newItem\n ];\n } else {\n nodes.current.splice(index, 0, newItem);\n }\n }\n // return the unregister function\n return ()=>{\n nodes.current = nodes.current.filter((node)=>node.option.id !== option.id);\n };\n }, []);\n return {\n ...collectionAPI,\n options: nodes.current.map((node)=>node.option),\n registerOption\n };\n};\n"],"names":["useOptionCollection","nodes","React","useRef","collectionAPI","useMemo","getCount","current","length","getOptionAtIndex","index","_nodes_current_index","option","getIndexOfId","id","findIndex","node","getOptionById","_item","item","find","getOptionsMatchingText","matcher","filter","text","map","getOptionsMatchingValue","value","registerOption","useCallback","element","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","newItem","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C,IAAInB;QACJ,MAAMD,QAAQT,MAAMM,OAAO,CAACQ,SAAS,CAAC,CAACC;YACnC,IAAI,CAACA,KAAKc,OAAO,IAAI,CAACA,SAAS;gBAC3B,OAAO;YACX;YACA,IAAId,KAAKJ,MAAM,CAACE,EAAE,KAAKF,OAAOE,EAAE,EAAE;gBAC9B,OAAO;YACX;YACA,gGAAgG;YAChG,sCAAsC;YACtC,OAAOE,KAAKc,OAAO,CAACC,uBAAuB,CAACD,WAAWE,KAAKC,2BAA2B;QAC3F;QACA,kDAAkD;QAClD,IAAI,AAAC,CAAA,AAACtB,CAAAA,uBAAuBV,MAAMM,OAAO,CAACG,MAAM,AAAD,MAAO,QAAQC,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBC,MAAM,CAACE,EAAE,AAAD,MAAOF,OAAOE,EAAE,EAAE;YACrJ,MAAMoB,UAAU;gBACZJ;gBACAlB;YACJ;YACA,gEAAgE;YAChE,IAAIF,UAAU,CAAC,GAAG;gBACdT,MAAMM,OAAO,GAAG;uBACTN,MAAMM,OAAO;oBAChB2B;iBACH;YACL,OAAO;gBACHjC,MAAMM,OAAO,CAAC4B,MAAM,CAACzB,OAAO,GAAGwB;YACnC;QACJ;QACA,iCAAiC;QACjC,OAAO;YACHjC,MAAMM,OAAO,GAAGN,MAAMM,OAAO,CAACgB,MAAM,CAAC,CAACP,OAAOA,KAAKJ,MAAM,CAACE,EAAE,KAAKF,OAAOE,EAAE;QAC7E;IACJ,GAAG,EAAE;IACL,OAAO;QACH,GAAGV,aAAa;QAChBgC,SAASnC,MAAMM,OAAO,CAACkB,GAAG,CAAC,CAACT,OAAOA,KAAKJ,MAAM;QAC9CgB;IACJ;AACJ"}
|
|
@@ -4,22 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useScrollOptionsIntoView", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useScrollOptionsIntoView;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
12
14
|
function useScrollOptionsIntoView(state) {
|
|
13
|
-
const { activeOption
|
|
15
|
+
const { activeOption } = state;
|
|
14
16
|
const scrollContainerRef = _react.useRef(null);
|
|
15
17
|
_react.useEffect(()=>{
|
|
16
|
-
if (scrollContainerRef.current && activeOption && (0,
|
|
18
|
+
if (scrollContainerRef.current && activeOption && (0, _reactutilities.canUseDOM)()) {
|
|
17
19
|
const activeOptionElement = scrollContainerRef.current.querySelector(`#${activeOption.id}`);
|
|
18
20
|
if (!activeOptionElement) {
|
|
19
21
|
return;
|
|
20
22
|
}
|
|
21
|
-
const { offsetHeight
|
|
22
|
-
const { offsetHeight: parentOffsetHeight
|
|
23
|
+
const { offsetHeight, offsetTop } = activeOptionElement;
|
|
24
|
+
const { offsetHeight: parentOffsetHeight, scrollTop } = scrollContainerRef.current;
|
|
23
25
|
const isAbove = offsetTop < scrollTop;
|
|
24
26
|
const isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;
|
|
25
27
|
// add a small buffer for general visual nicety
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useScrollOptionsIntoView.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nexport function useScrollOptionsIntoView(state) {\n const { activeOption
|
|
1
|
+
{"version":3,"sources":["useScrollOptionsIntoView.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nexport function useScrollOptionsIntoView(state) {\n const { activeOption } = state;\n const scrollContainerRef = React.useRef(null);\n React.useEffect(()=>{\n if (scrollContainerRef.current && activeOption && canUseDOM()) {\n const activeOptionElement = scrollContainerRef.current.querySelector(`#${activeOption.id}`);\n if (!activeOptionElement) {\n return;\n }\n const { offsetHeight, offsetTop } = activeOptionElement;\n const { offsetHeight: parentOffsetHeight, scrollTop } = scrollContainerRef.current;\n const isAbove = offsetTop < scrollTop;\n const isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;\n // add a small buffer for general visual nicety\n // it looks slightly better if the option has some space from the top/bottom while arrowing\n const buffer = 2;\n if (isAbove) {\n scrollContainerRef.current.scrollTo(0, offsetTop - buffer);\n } else if (isBelow) {\n scrollContainerRef.current.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight + buffer);\n }\n }\n }, [\n activeOption\n ]);\n return scrollContainerRef;\n}\n"],"names":["useScrollOptionsIntoView","state","activeOption","scrollContainerRef","React","useRef","useEffect","current","canUseDOM","activeOptionElement","querySelector","id","offsetHeight","offsetTop","parentOffsetHeight","scrollTop","isAbove","isBelow","buffer","scrollTo"],"mappings":";;;;+BAEgBA;;;eAAAA;;;;iEAFO;gCACG;AACnB,SAASA,yBAAyBC,KAAK;IAC1C,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,qBAAqBC,OAAMC,MAAM,CAAC;IACxCD,OAAME,SAAS,CAAC;QACZ,IAAIH,mBAAmBI,OAAO,IAAIL,gBAAgBM,IAAAA,yBAAS,KAAI;YAC3D,MAAMC,sBAAsBN,mBAAmBI,OAAO,CAACG,aAAa,CAAC,CAAC,CAAC,EAAER,aAAaS,EAAE,CAAC,CAAC;YAC1F,IAAI,CAACF,qBAAqB;gBACtB;YACJ;YACA,MAAM,EAAEG,YAAY,EAAEC,SAAS,EAAE,GAAGJ;YACpC,MAAM,EAAEG,cAAcE,kBAAkB,EAAEC,SAAS,EAAE,GAAGZ,mBAAmBI,OAAO;YAClF,MAAMS,UAAUH,YAAYE;YAC5B,MAAME,UAAUJ,YAAYD,eAAeG,YAAYD;YACvD,+CAA+C;YAC/C,2FAA2F;YAC3F,MAAMI,SAAS;YACf,IAAIF,SAAS;gBACTb,mBAAmBI,OAAO,CAACY,QAAQ,CAAC,GAAGN,YAAYK;YACvD,OAAO,IAAID,SAAS;gBAChBd,mBAAmBI,OAAO,CAACY,QAAQ,CAAC,GAAGN,YAAYC,qBAAqBF,eAAeM;YAC3F;QACJ;IACJ,GAAG;QACChB;KACH;IACD,OAAOC;AACX"}
|
|
@@ -4,18 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useSelection", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useSelection;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _react = require("react");
|
|
10
|
-
const
|
|
12
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
11
13
|
const useSelection = (props)=>{
|
|
12
|
-
const { defaultSelectedOptions
|
|
13
|
-
const [selectedOptions, setSelectedOptions] = (0,
|
|
14
|
+
const { defaultSelectedOptions, multiselect, onOptionSelect } = props;
|
|
15
|
+
const [selectedOptions, setSelectedOptions] = (0, _reactutilities.useControllableState)({
|
|
14
16
|
state: props.selectedOptions,
|
|
15
17
|
defaultState: defaultSelectedOptions,
|
|
16
18
|
initialState: []
|
|
17
19
|
});
|
|
18
20
|
const selectOption = (0, _react.useCallback)((event, option)=>{
|
|
21
|
+
var _onOptionSelect;
|
|
19
22
|
// if the option is disabled, do nothing
|
|
20
23
|
if (option.disabled) {
|
|
21
24
|
return;
|
|
@@ -42,7 +45,7 @@ const useSelection = (props)=>{
|
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
setSelectedOptions(newSelection);
|
|
45
|
-
onOptionSelect === null ||
|
|
48
|
+
(_onOptionSelect = onOptionSelect) === null || _onOptionSelect === void 0 ? void 0 : _onOptionSelect(event, {
|
|
46
49
|
optionValue: option.value,
|
|
47
50
|
optionText: option.text,
|
|
48
51
|
selectedOptions: newSelection
|
|
@@ -54,8 +57,9 @@ const useSelection = (props)=>{
|
|
|
54
57
|
setSelectedOptions
|
|
55
58
|
]);
|
|
56
59
|
const clearSelection = (event)=>{
|
|
60
|
+
var _onOptionSelect;
|
|
57
61
|
setSelectedOptions([]);
|
|
58
|
-
onOptionSelect === null ||
|
|
62
|
+
(_onOptionSelect = onOptionSelect) === null || _onOptionSelect === void 0 ? void 0 : _onOptionSelect(event, {
|
|
59
63
|
optionValue: undefined,
|
|
60
64
|
optionText: undefined,
|
|
61
65
|
selectedOptions: []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSelection.js"],"sourcesContent":["import { useCallback } from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nexport const useSelection = (props)=>{\n const { defaultSelectedOptions
|
|
1
|
+
{"version":3,"sources":["useSelection.js"],"sourcesContent":["import { useCallback } from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nexport const useSelection = (props)=>{\n const { defaultSelectedOptions, multiselect, onOptionSelect } = props;\n const [selectedOptions, setSelectedOptions] = useControllableState({\n state: props.selectedOptions,\n defaultState: defaultSelectedOptions,\n initialState: []\n });\n const selectOption = useCallback((event, option)=>{\n var _onOptionSelect;\n // if the option is disabled, do nothing\n if (option.disabled) {\n return;\n }\n // for single-select, always return the selected option\n let newSelection = [\n option.value\n ];\n // toggle selected state of the option for multiselect\n if (multiselect) {\n const selectedIndex = selectedOptions.findIndex((o)=>o === option.value);\n if (selectedIndex > -1) {\n // deselect option\n newSelection = [\n ...selectedOptions.slice(0, selectedIndex),\n ...selectedOptions.slice(selectedIndex + 1)\n ];\n } else {\n // select option\n newSelection = [\n ...selectedOptions,\n option.value\n ];\n }\n }\n setSelectedOptions(newSelection);\n (_onOptionSelect = onOptionSelect) === null || _onOptionSelect === void 0 ? void 0 : _onOptionSelect(event, {\n optionValue: option.value,\n optionText: option.text,\n selectedOptions: newSelection\n });\n }, [\n onOptionSelect,\n multiselect,\n selectedOptions,\n setSelectedOptions\n ]);\n const clearSelection = (event)=>{\n var _onOptionSelect;\n setSelectedOptions([]);\n (_onOptionSelect = onOptionSelect) === null || _onOptionSelect === void 0 ? void 0 : _onOptionSelect(event, {\n optionValue: undefined,\n optionText: undefined,\n selectedOptions: []\n });\n };\n return {\n clearSelection,\n selectOption,\n selectedOptions\n };\n};\n"],"names":["useSelection","props","defaultSelectedOptions","multiselect","onOptionSelect","selectedOptions","setSelectedOptions","useControllableState","state","defaultState","initialState","selectOption","useCallback","event","option","_onOptionSelect","disabled","newSelection","value","selectedIndex","findIndex","o","slice","optionValue","optionText","text","clearSelection","undefined"],"mappings":";;;;+BAEaA;;;eAAAA;;;uBAFe;gCACS;AAC9B,MAAMA,eAAe,CAACC;IACzB,MAAM,EAAEC,sBAAsB,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGH;IAChE,MAAM,CAACI,iBAAiBC,mBAAmB,GAAGC,IAAAA,oCAAoB,EAAC;QAC/DC,OAAOP,MAAMI,eAAe;QAC5BI,cAAcP;QACdQ,cAAc,EAAE;IACpB;IACA,MAAMC,eAAeC,IAAAA,kBAAW,EAAC,CAACC,OAAOC;QACrC,IAAIC;QACJ,wCAAwC;QACxC,IAAID,OAAOE,QAAQ,EAAE;YACjB;QACJ;QACA,uDAAuD;QACvD,IAAIC,eAAe;YACfH,OAAOI,KAAK;SACf;QACD,sDAAsD;QACtD,IAAIf,aAAa;YACb,MAAMgB,gBAAgBd,gBAAgBe,SAAS,CAAC,CAACC,IAAIA,MAAMP,OAAOI,KAAK;YACvE,IAAIC,gBAAgB,CAAC,GAAG;gBACpB,kBAAkB;gBAClBF,eAAe;uBACRZ,gBAAgBiB,KAAK,CAAC,GAAGH;uBACzBd,gBAAgBiB,KAAK,CAACH,gBAAgB;iBAC5C;YACL,OAAO;gBACH,gBAAgB;gBAChBF,eAAe;uBACRZ;oBACHS,OAAOI,KAAK;iBACf;YACL;QACJ;QACAZ,mBAAmBW;QAClBF,CAAAA,kBAAkBX,cAAa,MAAO,QAAQW,oBAAoB,KAAK,IAAI,KAAK,IAAIA,gBAAgBF,OAAO;YACxGU,aAAaT,OAAOI,KAAK;YACzBM,YAAYV,OAAOW,IAAI;YACvBpB,iBAAiBY;QACrB;IACJ,GAAG;QACCb;QACAD;QACAE;QACAC;KACH;IACD,MAAMoB,iBAAiB,CAACb;QACpB,IAAIE;QACJT,mBAAmB,EAAE;QACpBS,CAAAA,kBAAkBX,cAAa,MAAO,QAAQW,oBAAoB,KAAK,IAAI,KAAK,IAAIA,gBAAgBF,OAAO;YACxGU,aAAaI;YACbH,YAAYG;YACZtB,iBAAiB,EAAE;QACvB;IACJ;IACA,OAAO;QACHqB;QACAf;QACAN;IACJ;AACJ"}
|
|
@@ -4,19 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useTriggerListboxSlots", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useTriggerListboxSlots;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
12
14
|
const _dropdownKeyActions = require("../utils/dropdownKeyActions");
|
|
13
15
|
function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {
|
|
14
|
-
|
|
15
|
-
const {
|
|
16
|
+
var _listboxSlot, _activeOption, _triggerSlot, _listbox, _listbox1, _listbox2;
|
|
17
|
+
const { multiselect } = props;
|
|
18
|
+
const { activeOption, getCount, getIndexOfId, getOptionAtIndex, ignoreNextBlur, open, selectOption, setActiveOption, setFocusVisible, setHasFocus, setOpen } = state;
|
|
16
19
|
// handle trigger focus/blur
|
|
17
20
|
const triggerRef = _react.useRef(null);
|
|
18
21
|
// resolve listbox shorthand props
|
|
19
|
-
const listboxId = (0,
|
|
22
|
+
const listboxId = (0, _reactutilities.useId)('fluent-listbox', (_listboxSlot = listboxSlot) === null || _listboxSlot === void 0 ? void 0 : _listboxSlot.id);
|
|
20
23
|
const listbox = listboxSlot && {
|
|
21
24
|
id: listboxId,
|
|
22
25
|
multiselect,
|
|
@@ -26,28 +29,28 @@ function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {
|
|
|
26
29
|
// resolve trigger shorthand props
|
|
27
30
|
const trigger = {
|
|
28
31
|
'aria-expanded': open,
|
|
29
|
-
'aria-activedescendant': open ? activeOption === null ||
|
|
32
|
+
'aria-activedescendant': open ? (_activeOption = activeOption) === null || _activeOption === void 0 ? void 0 : _activeOption.id : undefined,
|
|
30
33
|
role: 'combobox',
|
|
31
34
|
...triggerSlot,
|
|
32
35
|
// explicitly type the ref as an intersection here to prevent type errors
|
|
33
36
|
// since the `children` prop has mutually incompatible types between input/button
|
|
34
37
|
// functionally both ref and triggerRef will always be the same element type
|
|
35
|
-
ref: (0,
|
|
38
|
+
ref: (0, _reactutilities.useMergedRefs)(ref, (_triggerSlot = triggerSlot) === null || _triggerSlot === void 0 ? void 0 : _triggerSlot.ref, triggerRef)
|
|
36
39
|
};
|
|
37
40
|
/*
|
|
38
41
|
* Handle focus when clicking the listbox popup:
|
|
39
42
|
* 1. Move focus back to the button/input when the listbox is clicked (otherwise it goes to body)
|
|
40
43
|
* 2. Do not close the listbox on button/input blur when clicking into the listbox
|
|
41
|
-
*/ const listboxOnClick = (0,
|
|
44
|
+
*/ const listboxOnClick = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((event)=>{
|
|
42
45
|
var _triggerRef_current;
|
|
43
46
|
(_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
|
|
44
|
-
}, listbox === null ||
|
|
45
|
-
const listboxOnMouseOver = (0,
|
|
47
|
+
}, (_listbox = listbox) === null || _listbox === void 0 ? void 0 : _listbox.onClick));
|
|
48
|
+
const listboxOnMouseOver = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((event)=>{
|
|
46
49
|
setFocusVisible(false);
|
|
47
|
-
}, listbox === null ||
|
|
48
|
-
const listboxOnMouseDown = (0,
|
|
50
|
+
}, (_listbox1 = listbox) === null || _listbox1 === void 0 ? void 0 : _listbox1.onMouseOver));
|
|
51
|
+
const listboxOnMouseDown = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((event)=>{
|
|
49
52
|
ignoreNextBlur.current = true;
|
|
50
|
-
}, listbox === null ||
|
|
53
|
+
}, (_listbox2 = listbox) === null || _listbox2 === void 0 ? void 0 : _listbox2.onMouseDown));
|
|
51
54
|
// listbox is nullable, only add event handlers if it exists
|
|
52
55
|
if (listbox) {
|
|
53
56
|
listbox.onClick = listboxOnClick;
|
|
@@ -55,21 +58,21 @@ function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {
|
|
|
55
58
|
listbox.onMouseDown = listboxOnMouseDown;
|
|
56
59
|
}
|
|
57
60
|
// the trigger should open/close the popup on click or blur
|
|
58
|
-
trigger.onBlur = (0,
|
|
61
|
+
trigger.onBlur = (0, _reactutilities.mergeCallbacks)((event)=>{
|
|
59
62
|
if (!ignoreNextBlur.current) {
|
|
60
63
|
setOpen(event, false);
|
|
61
64
|
}
|
|
62
65
|
ignoreNextBlur.current = false;
|
|
63
66
|
setHasFocus(false);
|
|
64
67
|
}, trigger.onBlur);
|
|
65
|
-
trigger.onClick = (0,
|
|
68
|
+
trigger.onClick = (0, _reactutilities.mergeCallbacks)((event)=>{
|
|
66
69
|
setOpen(event, !open);
|
|
67
70
|
}, trigger.onClick);
|
|
68
|
-
trigger.onFocus = (0,
|
|
71
|
+
trigger.onFocus = (0, _reactutilities.mergeCallbacks)((event)=>{
|
|
69
72
|
setHasFocus(true);
|
|
70
73
|
}, trigger.onFocus);
|
|
71
74
|
// handle combobox keyboard interaction
|
|
72
|
-
trigger.onKeyDown = (0,
|
|
75
|
+
trigger.onKeyDown = (0, _reactutilities.mergeCallbacks)((event)=>{
|
|
73
76
|
const action = (0, _dropdownKeyActions.getDropdownActionFromKey)(event, {
|
|
74
77
|
open,
|
|
75
78
|
multiselect
|
|
@@ -90,7 +93,8 @@ function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {
|
|
|
90
93
|
setOpen(event, false);
|
|
91
94
|
break;
|
|
92
95
|
case 'CloseSelect':
|
|
93
|
-
|
|
96
|
+
var _activeOption;
|
|
97
|
+
!multiselect && !((_activeOption = activeOption) === null || _activeOption === void 0 ? void 0 : _activeOption.disabled) && setOpen(event, false);
|
|
94
98
|
// fallthrough
|
|
95
99
|
case 'Select':
|
|
96
100
|
activeOption && selectOption(event, activeOption);
|
|
@@ -109,7 +113,7 @@ function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {
|
|
|
109
113
|
setFocusVisible(true);
|
|
110
114
|
}
|
|
111
115
|
}, trigger.onKeyDown);
|
|
112
|
-
trigger.onMouseOver = (0,
|
|
116
|
+
trigger.onMouseOver = (0, _reactutilities.mergeCallbacks)((event)=>{
|
|
113
117
|
setFocusVisible(false);
|
|
114
118
|
}, trigger.onMouseOver);
|
|
115
119
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTriggerListboxSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useId, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey, getIndexFromAction } from '../utils/dropdownKeyActions';\n/*\n * useTriggerListboxSlots returns a tuple of trigger/listbox shorthand,\n * with the semantics and event handlers needed for the Combobox and Dropdown components.\n * The element type of the ref should always match the element type used in the trigger shorthand.\n */ export function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {\n const { multiselect
|
|
1
|
+
{"version":3,"sources":["useTriggerListboxSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useId, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey, getIndexFromAction } from '../utils/dropdownKeyActions';\n/*\n * useTriggerListboxSlots returns a tuple of trigger/listbox shorthand,\n * with the semantics and event handlers needed for the Combobox and Dropdown components.\n * The element type of the ref should always match the element type used in the trigger shorthand.\n */ export function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {\n var _listboxSlot, _activeOption, _triggerSlot, _listbox, _listbox1, _listbox2;\n const { multiselect } = props;\n const { activeOption, getCount, getIndexOfId, getOptionAtIndex, ignoreNextBlur, open, selectOption, setActiveOption, setFocusVisible, setHasFocus, setOpen } = state;\n // handle trigger focus/blur\n const triggerRef = React.useRef(null);\n // resolve listbox shorthand props\n const listboxId = useId('fluent-listbox', (_listboxSlot = listboxSlot) === null || _listboxSlot === void 0 ? void 0 : _listboxSlot.id);\n const listbox = listboxSlot && {\n id: listboxId,\n multiselect,\n tabIndex: undefined,\n ...listboxSlot\n };\n // resolve trigger shorthand props\n const trigger = {\n 'aria-expanded': open,\n 'aria-activedescendant': open ? (_activeOption = activeOption) === null || _activeOption === void 0 ? void 0 : _activeOption.id : undefined,\n role: 'combobox',\n ...triggerSlot,\n // explicitly type the ref as an intersection here to prevent type errors\n // since the `children` prop has mutually incompatible types between input/button\n // functionally both ref and triggerRef will always be the same element type\n ref: useMergedRefs(ref, (_triggerSlot = triggerSlot) === null || _triggerSlot === void 0 ? void 0 : _triggerSlot.ref, triggerRef)\n };\n /*\n * Handle focus when clicking the listbox popup:\n * 1. Move focus back to the button/input when the listbox is clicked (otherwise it goes to body)\n * 2. Do not close the listbox on button/input blur when clicking into the listbox\n */ const listboxOnClick = useEventCallback(mergeCallbacks((event)=>{\n var _triggerRef_current;\n (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();\n }, (_listbox = listbox) === null || _listbox === void 0 ? void 0 : _listbox.onClick));\n const listboxOnMouseOver = useEventCallback(mergeCallbacks((event)=>{\n setFocusVisible(false);\n }, (_listbox1 = listbox) === null || _listbox1 === void 0 ? void 0 : _listbox1.onMouseOver));\n const listboxOnMouseDown = useEventCallback(mergeCallbacks((event)=>{\n ignoreNextBlur.current = true;\n }, (_listbox2 = listbox) === null || _listbox2 === void 0 ? void 0 : _listbox2.onMouseDown));\n // listbox is nullable, only add event handlers if it exists\n if (listbox) {\n listbox.onClick = listboxOnClick;\n listbox.onMouseOver = listboxOnMouseOver;\n listbox.onMouseDown = listboxOnMouseDown;\n }\n // the trigger should open/close the popup on click or blur\n trigger.onBlur = mergeCallbacks((event)=>{\n if (!ignoreNextBlur.current) {\n setOpen(event, false);\n }\n ignoreNextBlur.current = false;\n setHasFocus(false);\n }, trigger.onBlur);\n trigger.onClick = mergeCallbacks((event)=>{\n setOpen(event, !open);\n }, trigger.onClick);\n trigger.onFocus = mergeCallbacks((event)=>{\n setHasFocus(true);\n }, trigger.onFocus);\n // handle combobox keyboard interaction\n trigger.onKeyDown = mergeCallbacks((event)=>{\n const action = getDropdownActionFromKey(event, {\n open,\n multiselect\n });\n const maxIndex = getCount() - 1;\n const activeIndex = activeOption ? getIndexOfId(activeOption.id) : -1;\n let newIndex = activeIndex;\n switch(action){\n case 'Open':\n event.preventDefault();\n setFocusVisible(true);\n setOpen(event, true);\n break;\n case 'Close':\n // stop propagation for escape key to avoid dismissing any parent popups\n event.stopPropagation();\n event.preventDefault();\n setOpen(event, false);\n break;\n case 'CloseSelect':\n var _activeOption;\n !multiselect && !((_activeOption = activeOption) === null || _activeOption === void 0 ? void 0 : _activeOption.disabled) && setOpen(event, false);\n // fallthrough\n case 'Select':\n activeOption && selectOption(event, activeOption);\n event.preventDefault();\n break;\n case 'Tab':\n !multiselect && activeOption && selectOption(event, activeOption);\n break;\n default:\n newIndex = getIndexFromAction(action, activeIndex, maxIndex);\n }\n if (newIndex !== activeIndex) {\n // prevent default page scroll/keyboard action if the index changed\n event.preventDefault();\n setActiveOption(getOptionAtIndex(newIndex));\n setFocusVisible(true);\n }\n }, trigger.onKeyDown);\n trigger.onMouseOver = mergeCallbacks((event)=>{\n setFocusVisible(false);\n }, trigger.onMouseOver);\n return [\n trigger,\n listbox\n ];\n}\n"],"names":["useTriggerListboxSlots","props","state","ref","triggerSlot","listboxSlot","_listboxSlot","_activeOption","_triggerSlot","_listbox","_listbox1","_listbox2","multiselect","activeOption","getCount","getIndexOfId","getOptionAtIndex","ignoreNextBlur","open","selectOption","setActiveOption","setFocusVisible","setHasFocus","setOpen","triggerRef","React","useRef","listboxId","useId","id","listbox","tabIndex","undefined","trigger","role","useMergedRefs","listboxOnClick","useEventCallback","mergeCallbacks","event","_triggerRef_current","current","focus","onClick","listboxOnMouseOver","onMouseOver","listboxOnMouseDown","onMouseDown","onBlur","onFocus","onKeyDown","action","getDropdownActionFromKey","maxIndex","activeIndex","newIndex","preventDefault","stopPropagation","disabled","getIndexFromAction"],"mappings":";;;;+BAOoBA;;;eAAAA;;;;iEAPG;gCACgD;oCACV;AAKlD,SAASA,uBAAuBC,KAAK,EAAEC,KAAK,EAAEC,GAAG,EAAEC,WAAW,EAAEC,WAAW;IAClF,IAAIC,cAAcC,eAAeC,cAAcC,UAAUC,WAAWC;IACpE,MAAM,EAAEC,WAAW,EAAE,GAAGX;IACxB,MAAM,EAAEY,YAAY,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,YAAY,EAAEC,eAAe,EAAEC,eAAe,EAAEC,WAAW,EAAEC,OAAO,EAAE,GAAGrB;IAC/J,4BAA4B;IAC5B,MAAMsB,aAAaC,OAAMC,MAAM,CAAC;IAChC,kCAAkC;IAClC,MAAMC,YAAYC,IAAAA,qBAAK,EAAC,kBAAkB,AAACtB,CAAAA,eAAeD,WAAU,MAAO,QAAQC,iBAAiB,KAAK,IAAI,KAAK,IAAIA,aAAauB,EAAE;IAC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eC,gBAAgBM,aAAaoB,OAAO1B;gBACpD;YACJ;gBACI0C,WAAWI,IAAAA,sCAAkB,EAACR,QAAQG,aAAaD;QAC3D;QACA,IAAIE,aAAaD,aAAa;YAC1B,mEAAmE;YACnEf,MAAMiB,cAAc;YACpBpC,gBAAgBJ,iBAAiBuC;YACjClC,gBAAgB;QACpB;IACJ,GAAGY,QAAQiB,SAAS;IACpBjB,QAAQY,WAAW,GAAGP,IAAAA,8BAAc,EAAC,CAACC;QAClClB,gBAAgB;IACpB,GAAGY,QAAQY,WAAW;IACtB,OAAO;QACHZ;QACAH;KACH;AACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-combobox",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.10",
|
|
4
4
|
"description": "Fluent UI React Combobox component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
"@fluentui/scripts-tasks": "*"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@fluentui/keyboard-keys": "^9.0.
|
|
37
|
-
"@fluentui/react-context-selector": "^9.1.
|
|
38
|
-
"@fluentui/react-field": "^9.1.
|
|
36
|
+
"@fluentui/keyboard-keys": "^9.0.4",
|
|
37
|
+
"@fluentui/react-context-selector": "^9.1.32",
|
|
38
|
+
"@fluentui/react-field": "^9.1.23",
|
|
39
39
|
"@fluentui/react-icons": "^2.0.207",
|
|
40
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
41
|
-
"@fluentui/react-portal": "^9.3.
|
|
42
|
-
"@fluentui/react-positioning": "^9.9.
|
|
43
|
-
"@fluentui/react-shared-contexts": "^9.7.
|
|
44
|
-
"@fluentui/react-theme": "^9.1.
|
|
45
|
-
"@fluentui/react-utilities": "^9.
|
|
40
|
+
"@fluentui/react-jsx-runtime": "^9.0.4",
|
|
41
|
+
"@fluentui/react-portal": "^9.3.11",
|
|
42
|
+
"@fluentui/react-positioning": "^9.9.9",
|
|
43
|
+
"@fluentui/react-shared-contexts": "^9.7.3",
|
|
44
|
+
"@fluentui/react-theme": "^9.1.12",
|
|
45
|
+
"@fluentui/react-utilities": "^9.13.1",
|
|
46
46
|
"@griffel/react": "^1.5.14",
|
|
47
|
-
"@swc/helpers": "^0.
|
|
47
|
+
"@swc/helpers": "^0.5.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@types/react": ">=16.
|
|
51
|
-
"@types/react-dom": ">=16.
|
|
52
|
-
"react": ">=16.
|
|
53
|
-
"react-dom": ">=16.
|
|
50
|
+
"@types/react": ">=16.14.0 <19.0.0",
|
|
51
|
+
"@types/react-dom": ">=16.14.0 <19.0.0",
|
|
52
|
+
"react": ">=16.14.0 <19.0.0",
|
|
53
|
+
"react-dom": ">=16.14.0 <19.0.0",
|
|
54
54
|
"scheduler": "^0.19.0 || ^0.20.0"
|
|
55
55
|
},
|
|
56
56
|
"beachball": {
|