@fluentui/react-combobox 9.7.5 → 9.9.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 +44 -5
- package/dist/index.d.ts +79 -14
- package/lib/components/Combobox/Combobox.types.js.map +1 -1
- package/lib/components/Combobox/renderCombobox.js +19 -11
- package/lib/components/Combobox/renderCombobox.js.map +1 -1
- package/lib/components/Combobox/useCombobox.js +12 -4
- package/lib/components/Combobox/useCombobox.js.map +1 -1
- package/lib/components/Combobox/useInputTriggerSlot.js +14 -12
- package/lib/components/Combobox/useInputTriggerSlot.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.types.js.map +1 -1
- package/lib/components/Dropdown/renderDropdown.js +21 -13
- package/lib/components/Dropdown/renderDropdown.js.map +1 -1
- package/lib/components/Dropdown/useButtonTriggerSlot.js +51 -31
- package/lib/components/Dropdown/useButtonTriggerSlot.js.map +1 -1
- package/lib/components/Dropdown/useDropdown.js +14 -4
- package/lib/components/Dropdown/useDropdown.js.map +1 -1
- package/lib/components/Listbox/Listbox.types.js.map +1 -1
- package/lib/components/Listbox/renderListbox.js +7 -3
- package/lib/components/Listbox/renderListbox.js.map +1 -1
- package/lib/components/Listbox/useListbox.js +52 -44
- package/lib/components/Listbox/useListbox.js.map +1 -1
- package/lib/components/Option/Option.types.js.map +1 -1
- package/lib/components/Option/useOption.js +14 -24
- package/lib/components/Option/useOption.js.map +1 -1
- package/lib/components/Option/useOptionStyles.styles.js +27 -28
- package/lib/components/Option/useOptionStyles.styles.js.map +1 -1
- package/lib/contexts/ComboboxContext.js +9 -1
- package/lib/contexts/ComboboxContext.js.map +1 -1
- package/lib/contexts/ListboxContext.js +9 -4
- package/lib/contexts/ListboxContext.js.map +1 -1
- package/lib/contexts/useComboboxContextValues.js +22 -5
- package/lib/contexts/useComboboxContextValues.js.map +1 -1
- package/lib/contexts/useListboxContextValues.js +19 -10
- package/lib/contexts/useListboxContextValues.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/ComboboxBase.types.js.map +1 -1
- package/lib/utils/OptionCollection.types.js.map +1 -1
- package/lib/utils/Selection.types.js.map +1 -1
- package/lib/utils/dropdownKeyActions.js +0 -21
- package/lib/utils/dropdownKeyActions.js.map +1 -1
- package/lib/utils/useComboboxBaseState.js +60 -17
- package/lib/utils/useComboboxBaseState.js.map +1 -1
- package/lib/utils/useListboxSlot.js.map +1 -1
- package/lib/utils/useOptionCollection.js +18 -45
- package/lib/utils/useOptionCollection.js.map +1 -1
- package/lib/utils/useTriggerSlot.js +86 -33
- package/lib/utils/useTriggerSlot.js.map +1 -1
- package/lib-commonjs/components/Combobox/renderCombobox.js +19 -11
- package/lib-commonjs/components/Combobox/renderCombobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/useCombobox.js +12 -4
- package/lib-commonjs/components/Combobox/useCombobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/useInputTriggerSlot.js +14 -12
- package/lib-commonjs/components/Combobox/useInputTriggerSlot.js.map +1 -1
- package/lib-commonjs/components/Dropdown/renderDropdown.js +21 -13
- package/lib-commonjs/components/Dropdown/renderDropdown.js.map +1 -1
- package/lib-commonjs/components/Dropdown/useButtonTriggerSlot.js +51 -31
- package/lib-commonjs/components/Dropdown/useButtonTriggerSlot.js.map +1 -1
- package/lib-commonjs/components/Dropdown/useDropdown.js +14 -4
- package/lib-commonjs/components/Dropdown/useDropdown.js.map +1 -1
- package/lib-commonjs/components/Listbox/renderListbox.js +7 -3
- package/lib-commonjs/components/Listbox/renderListbox.js.map +1 -1
- package/lib-commonjs/components/Listbox/useListbox.js +49 -41
- package/lib-commonjs/components/Listbox/useListbox.js.map +1 -1
- package/lib-commonjs/components/Option/useOption.js +13 -23
- package/lib-commonjs/components/Option/useOption.js.map +1 -1
- package/lib-commonjs/components/Option/useOptionStyles.styles.js +85 -85
- package/lib-commonjs/components/Option/useOptionStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/ComboboxContext.js.map +1 -1
- package/lib-commonjs/contexts/ListboxContext.js +12 -2
- package/lib-commonjs/contexts/ListboxContext.js.map +1 -1
- package/lib-commonjs/contexts/useComboboxContextValues.js +23 -5
- package/lib-commonjs/contexts/useComboboxContextValues.js.map +1 -1
- package/lib-commonjs/contexts/useListboxContextValues.js +19 -9
- package/lib-commonjs/contexts/useListboxContextValues.js.map +1 -1
- package/lib-commonjs/index.js +4 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/dropdownKeyActions.js +3 -30
- package/lib-commonjs/utils/dropdownKeyActions.js.map +1 -1
- package/lib-commonjs/utils/useComboboxBaseState.js +59 -16
- package/lib-commonjs/utils/useComboboxBaseState.js.map +1 -1
- package/lib-commonjs/utils/useOptionCollection.js +18 -45
- package/lib-commonjs/utils/useOptionCollection.js.map +1 -1
- package/lib-commonjs/utils/useTriggerSlot.js +84 -31
- package/lib-commonjs/utils/useTriggerSlot.js.map +1 -1
- package/package.json +10 -9
- package/lib/utils/useScrollOptionsIntoView.js +0 -29
- package/lib/utils/useScrollOptionsIntoView.js.map +0 -1
- package/lib-commonjs/utils/useScrollOptionsIntoView.js +0 -40
- package/lib-commonjs/utils/useScrollOptionsIntoView.js.map +0 -1
|
@@ -10,11 +10,15 @@ Object.defineProperty(exports, "renderListbox_unstable", {
|
|
|
10
10
|
});
|
|
11
11
|
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
12
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _reactaria = require("@fluentui/react-aria");
|
|
13
14
|
const _ListboxContext = require("../../contexts/ListboxContext");
|
|
14
15
|
const renderListbox_unstable = (state, contextValues)=>{
|
|
15
16
|
(0, _reactutilities.assertSlots)(state);
|
|
16
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
17
|
-
value: contextValues.
|
|
18
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
17
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactaria.ActiveDescendantContextProvider, {
|
|
18
|
+
value: contextValues.activeDescendant,
|
|
19
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ListboxContext.ListboxContext.Provider, {
|
|
20
|
+
value: contextValues.listbox,
|
|
21
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
|
|
22
|
+
})
|
|
19
23
|
});
|
|
20
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderListbox.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { ListboxContext } from '../../contexts/ListboxContext';\n/**\n * Render the final JSX of Listbox\n */ export const renderListbox_unstable = (state, contextValues)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(ListboxContext.Provider, {\n
|
|
1
|
+
{"version":3,"sources":["renderListbox.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { ActiveDescendantContextProvider } from '@fluentui/react-aria';\nimport { ListboxContext } from '../../contexts/ListboxContext';\n/**\n * Render the final JSX of Listbox\n */ export const renderListbox_unstable = (state, contextValues)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(ActiveDescendantContextProvider, {\n value: contextValues.activeDescendant,\n children: /*#__PURE__*/ _jsx(ListboxContext.Provider, {\n value: contextValues.listbox,\n children: /*#__PURE__*/ _jsx(state.root, {})\n })\n });\n};\n"],"names":["renderListbox_unstable","state","contextValues","assertSlots","_jsx","ActiveDescendantContextProvider","value","activeDescendant","children","ListboxContext","Provider","listbox","root"],"mappings":";;;;+BAMiBA;;;eAAAA;;;4BANa;gCACF;2BACoB;gCACjB;AAGpB,MAAMA,yBAAyB,CAACC,OAAOC;IAC9CC,IAAAA,2BAAW,EAACF;IACZ,OAAO,WAAW,GAAGG,IAAAA,eAAI,EAACC,0CAA+B,EAAE;QACvDC,OAAOJ,cAAcK,gBAAgB;QACrCC,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACK,8BAAc,CAACC,QAAQ,EAAE;YAClDJ,OAAOJ,cAAcS,OAAO;YAC5BH,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACH,MAAMW,IAAI,EAAE,CAAC;QAC9C;IACJ;AACJ"}
|
|
@@ -12,65 +12,76 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
|
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
13
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
14
|
const _reactcontextselector = require("@fluentui/react-context-selector");
|
|
15
|
+
const _reactaria = require("@fluentui/react-aria");
|
|
15
16
|
const _dropdownKeyActions = require("../../utils/dropdownKeyActions");
|
|
16
17
|
const _useOptionCollection = require("../../utils/useOptionCollection");
|
|
17
|
-
const _useScrollOptionsIntoView = require("../../utils/useScrollOptionsIntoView");
|
|
18
18
|
const _useSelection = require("../../utils/useSelection");
|
|
19
|
-
const
|
|
19
|
+
const _useOptionStylesstyles = require("../Option/useOptionStyles.styles");
|
|
20
|
+
const _ListboxContext = require("../../contexts/ListboxContext");
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
22
|
+
const UNSAFE_noLongerUsed = {
|
|
23
|
+
activeOption: undefined,
|
|
24
|
+
focusVisible: false,
|
|
25
|
+
setActiveOption: ()=>null
|
|
26
|
+
};
|
|
20
27
|
const useListbox_unstable = (props, ref)=>{
|
|
21
28
|
const { multiselect } = props;
|
|
22
29
|
const optionCollection = (0, _useOptionCollection.useOptionCollection)();
|
|
23
|
-
const {
|
|
30
|
+
const { getOptionById } = optionCollection;
|
|
31
|
+
const { listboxRef: activeDescendantListboxRef, activeParentRef, controller } = (0, _reactaria.useActiveDescendant)({
|
|
32
|
+
matchOption: (el)=>el.classList.contains(_useOptionStylesstyles.optionClassNames.root)
|
|
33
|
+
});
|
|
34
|
+
const activeDescendantContext = (0, _reactaria.useActiveDescendantContext)();
|
|
35
|
+
const activeDescendantController = (0, _reactaria.useHasParentActiveDescendantContext)() ? activeDescendantContext.controller : controller;
|
|
24
36
|
const { clearSelection, selectedOptions, selectOption } = (0, _useSelection.useSelection)(props);
|
|
25
|
-
const [activeOption, setActiveOption] = _react.useState();
|
|
26
|
-
// track whether keyboard focus outline should be shown
|
|
27
|
-
// tabster/keyborg doesn't work here, since the actual keyboard focus target doesn't move
|
|
28
|
-
const [focusVisible, setFocusVisible] = _react.useState(false);
|
|
29
37
|
const onKeyDown = (event)=>{
|
|
30
38
|
const action = (0, _dropdownKeyActions.getDropdownActionFromKey)(event, {
|
|
31
39
|
open: true
|
|
32
40
|
});
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
let newIndex = activeIndex;
|
|
41
|
+
const activeOptionId = activeDescendantController.active();
|
|
42
|
+
const activeOption = activeOptionId ? getOptionById(activeOptionId) : null;
|
|
36
43
|
switch(action){
|
|
44
|
+
case 'Next':
|
|
45
|
+
if (activeOption) {
|
|
46
|
+
activeDescendantController.next();
|
|
47
|
+
} else {
|
|
48
|
+
activeDescendantController.first();
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case 'Previous':
|
|
52
|
+
if (activeOption) {
|
|
53
|
+
activeDescendantController.prev();
|
|
54
|
+
} else {
|
|
55
|
+
activeDescendantController.first();
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case 'PageUp':
|
|
59
|
+
case 'First':
|
|
60
|
+
activeDescendantController.first();
|
|
61
|
+
break;
|
|
62
|
+
case 'PageDown':
|
|
63
|
+
case 'Last':
|
|
64
|
+
activeDescendantController.last();
|
|
65
|
+
break;
|
|
37
66
|
case 'Select':
|
|
38
67
|
case 'CloseSelect':
|
|
39
68
|
activeOption && selectOption(event, activeOption);
|
|
40
69
|
break;
|
|
41
|
-
default:
|
|
42
|
-
newIndex = (0, _dropdownKeyActions.getIndexFromAction)(action, activeIndex, maxIndex);
|
|
43
|
-
}
|
|
44
|
-
if (newIndex !== activeIndex) {
|
|
45
|
-
// prevent default page scroll/keyboard action if the index changed
|
|
46
|
-
event.preventDefault();
|
|
47
|
-
setActiveOption(getOptionAtIndex(newIndex));
|
|
48
|
-
setFocusVisible(true);
|
|
49
70
|
}
|
|
50
71
|
};
|
|
51
|
-
const onMouseOver = (event)=>{
|
|
52
|
-
setFocusVisible(false);
|
|
53
|
-
};
|
|
54
72
|
// get state from parent combobox, if it exists
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const comboboxSelectedOptions = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.selectedOptions);
|
|
59
|
-
const comboboxSelectOption = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.selectOption);
|
|
60
|
-
const comboboxSetActiveOption = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.setActiveOption);
|
|
73
|
+
const hasListboxContext = (0, _reactcontextselector.useHasParentContext)(_ListboxContext.ListboxContext);
|
|
74
|
+
const contextSelectedOptions = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.selectedOptions);
|
|
75
|
+
const contextSelectOption = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.selectOption);
|
|
61
76
|
// without a parent combobox context, provide values directly from Listbox
|
|
62
|
-
const optionContextValues =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
selectOption: comboboxSelectOption,
|
|
67
|
-
setActiveOption: comboboxSetActiveOption
|
|
77
|
+
const optionContextValues = hasListboxContext ? {
|
|
78
|
+
selectedOptions: contextSelectedOptions,
|
|
79
|
+
selectOption: contextSelectOption,
|
|
80
|
+
...UNSAFE_noLongerUsed
|
|
68
81
|
} : {
|
|
69
|
-
activeOption,
|
|
70
|
-
focusVisible,
|
|
71
82
|
selectedOptions,
|
|
72
83
|
selectOption,
|
|
73
|
-
|
|
84
|
+
...UNSAFE_noLongerUsed
|
|
74
85
|
};
|
|
75
86
|
const state = {
|
|
76
87
|
components: {
|
|
@@ -80,9 +91,8 @@ const useListbox_unstable = (props, ref)=>{
|
|
|
80
91
|
// FIXME:
|
|
81
92
|
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
|
|
82
93
|
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
|
|
83
|
-
ref: ref,
|
|
94
|
+
ref: (0, _reactutilities.useMergedRefs)(ref, activeParentRef, activeDescendantListboxRef),
|
|
84
95
|
role: multiselect ? 'menu' : 'listbox',
|
|
85
|
-
'aria-activedescendant': hasComboboxContext ? undefined : activeOption === null || activeOption === void 0 ? void 0 : activeOption.id,
|
|
86
96
|
tabIndex: 0,
|
|
87
97
|
...props
|
|
88
98
|
}), {
|
|
@@ -90,12 +100,10 @@ const useListbox_unstable = (props, ref)=>{
|
|
|
90
100
|
}),
|
|
91
101
|
multiselect,
|
|
92
102
|
clearSelection,
|
|
103
|
+
activeDescendantController,
|
|
93
104
|
...optionCollection,
|
|
94
105
|
...optionContextValues
|
|
95
106
|
};
|
|
96
|
-
const scrollContainerRef = (0, _useScrollOptionsIntoView.useScrollOptionsIntoView)(state);
|
|
97
|
-
state.root.ref = (0, _reactutilities.useMergedRefs)(state.root.ref, scrollContainerRef);
|
|
98
107
|
state.root.onKeyDown = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(state.root.onKeyDown, onKeyDown));
|
|
99
|
-
state.root.onMouseOver = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(state.root.onMouseOver, onMouseOver));
|
|
100
108
|
return state;
|
|
101
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useListbox.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, useEventCallback,
|
|
1
|
+
{"version":3,"sources":["useListbox.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, useEventCallback, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useActiveDescendant, useActiveDescendantContext, useHasParentActiveDescendantContext } from '@fluentui/react-aria';\nimport { getDropdownActionFromKey } from '../../utils/dropdownKeyActions';\nimport { useOptionCollection } from '../../utils/useOptionCollection';\nimport { useSelection } from '../../utils/useSelection';\nimport { optionClassNames } from '../Option/useOptionStyles.styles';\nimport { ListboxContext, useListboxContext_unstable } from '../../contexts/ListboxContext';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst UNSAFE_noLongerUsed = {\n activeOption: undefined,\n focusVisible: false,\n setActiveOption: ()=>null\n};\n/**\n * Create the state required to render Listbox.\n *\n * The returned state can be modified with hooks such as useListboxStyles_unstable,\n * before being passed to renderListbox_unstable.\n *\n * @param props - props from this instance of Listbox\n * @param ref - reference to root HTMLElement of Listbox\n */ export const useListbox_unstable = (props, ref)=>{\n const { multiselect } = props;\n const optionCollection = useOptionCollection();\n const { getOptionById } = optionCollection;\n const { listboxRef: activeDescendantListboxRef, activeParentRef, controller } = useActiveDescendant({\n matchOption: (el)=>el.classList.contains(optionClassNames.root)\n });\n const activeDescendantContext = useActiveDescendantContext();\n const activeDescendantController = useHasParentActiveDescendantContext() ? activeDescendantContext.controller : controller;\n const { clearSelection, selectedOptions, selectOption } = useSelection(props);\n const onKeyDown = (event)=>{\n const action = getDropdownActionFromKey(event, {\n open: true\n });\n const activeOptionId = activeDescendantController.active();\n const activeOption = activeOptionId ? getOptionById(activeOptionId) : null;\n switch(action){\n case 'Next':\n if (activeOption) {\n activeDescendantController.next();\n } else {\n activeDescendantController.first();\n }\n break;\n case 'Previous':\n if (activeOption) {\n activeDescendantController.prev();\n } else {\n activeDescendantController.first();\n }\n break;\n case 'PageUp':\n case 'First':\n activeDescendantController.first();\n break;\n case 'PageDown':\n case 'Last':\n activeDescendantController.last();\n break;\n case 'Select':\n case 'CloseSelect':\n activeOption && selectOption(event, activeOption);\n break;\n }\n };\n // get state from parent combobox, if it exists\n const hasListboxContext = useHasParentContext(ListboxContext);\n const contextSelectedOptions = useListboxContext_unstable((ctx)=>ctx.selectedOptions);\n const contextSelectOption = useListboxContext_unstable((ctx)=>ctx.selectOption);\n // without a parent combobox context, provide values directly from Listbox\n const optionContextValues = hasListboxContext ? {\n selectedOptions: contextSelectedOptions,\n selectOption: contextSelectOption,\n ...UNSAFE_noLongerUsed\n } : {\n selectedOptions,\n selectOption,\n ...UNSAFE_noLongerUsed\n };\n const state = {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, activeParentRef, activeDescendantListboxRef),\n role: multiselect ? 'menu' : 'listbox',\n tabIndex: 0,\n ...props\n }), {\n elementType: 'div'\n }),\n multiselect,\n clearSelection,\n activeDescendantController,\n ...optionCollection,\n ...optionContextValues\n };\n state.root.onKeyDown = useEventCallback(mergeCallbacks(state.root.onKeyDown, onKeyDown));\n return state;\n};\n"],"names":["useListbox_unstable","UNSAFE_noLongerUsed","activeOption","undefined","focusVisible","setActiveOption","props","ref","multiselect","optionCollection","useOptionCollection","getOptionById","listboxRef","activeDescendantListboxRef","activeParentRef","controller","useActiveDescendant","matchOption","el","classList","contains","optionClassNames","root","activeDescendantContext","useActiveDescendantContext","activeDescendantController","useHasParentActiveDescendantContext","clearSelection","selectedOptions","selectOption","useSelection","onKeyDown","event","action","getDropdownActionFromKey","open","activeOptionId","active","next","first","prev","last","hasListboxContext","useHasParentContext","ListboxContext","contextSelectedOptions","useListboxContext_unstable","ctx","contextSelectOption","optionContextValues","state","components","slot","always","getIntrinsicElementProps","useMergedRefs","role","tabIndex","elementType","useEventCallback","mergeCallbacks"],"mappings":";;;;+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ACL,KAAK;gBACDvC,gBAAgB2B,aAAaG,OAAO9B;gBACpC;QACR;IACJ;IACA,+CAA+C;IAC/C,MAAMwC,oBAAoBC,IAAAA,yCAAmB,EAACC,8BAAc;IAC5D,MAAMC,yBAAyBC,IAAAA,0CAA0B,EAAC,CAACC,MAAMA,IAAInB,eAAe;IACpF,MAAMoB,sBAAsBF,IAAAA,0CAA0B,EAAC,CAACC,MAAMA,IAAIlB,YAAY;IAC9E,0EAA0E;IAC1E,MAAMoB,sBAAsBP,oBAAoB;QAC5Cd,iBAAiBiB;QACjBhB,cAAcmB;QACd,GAAG/C,mBAAmB;IAC1B,IAAI;QACA2B;QACAC;QACA,GAAG5B,mBAAmB;IAC1B;IACA,MAAMiD,QAAQ;QACVC,YAAY;YACR7B,MAAM;QACV;QACAA,MAAM8B,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5F/C,KAAKgD,IAAAA,6BAAa,EAAChD,KAAKO,iBAAiBD;YACzC2C,MAAMhD,cAAc,SAAS;YAC7BiD,UAAU;YACV,GAAGnD,KAAK;QACZ,IAAI;YACAoD,aAAa;QACjB;QACAlD;QACAmB;QACAF;QACA,GAAGhB,gBAAgB;QACnB,GAAGwC,mBAAmB;IAC1B;IACAC,MAAM5B,IAAI,CAACS,SAAS,GAAG4B,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACV,MAAM5B,IAAI,CAACS,SAAS,EAAEA;IAC7E,OAAOmB;AACX"}
|
|
@@ -11,9 +11,8 @@ Object.defineProperty(exports, "useOption_unstable", {
|
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
13
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
|
-
const
|
|
14
|
+
const _reactaria = require("@fluentui/react-aria");
|
|
15
15
|
const _reacticons = require("@fluentui/react-icons");
|
|
16
|
-
const _ComboboxContext = require("../../contexts/ComboboxContext");
|
|
17
16
|
const _ListboxContext = require("../../contexts/ListboxContext");
|
|
18
17
|
function getTextString(text, children) {
|
|
19
18
|
if (text !== undefined) {
|
|
@@ -55,21 +54,15 @@ const useOption_unstable = (props, ref)=>{
|
|
|
55
54
|
optionValue
|
|
56
55
|
]);
|
|
57
56
|
// context values
|
|
58
|
-
const
|
|
59
|
-
const multiselect = (0,
|
|
60
|
-
const registerOption = (0,
|
|
61
|
-
const selected = (0,
|
|
57
|
+
const { controller: activeDescendantController } = (0, _reactaria.useActiveDescendantContext)();
|
|
58
|
+
const multiselect = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.multiselect);
|
|
59
|
+
const registerOption = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.registerOption);
|
|
60
|
+
const selected = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>{
|
|
62
61
|
const selectedOptions = ctx.selectedOptions;
|
|
63
62
|
return !!optionValue && !!selectedOptions.find((o)=>o === optionValue);
|
|
64
63
|
});
|
|
65
|
-
const selectOption = (0,
|
|
66
|
-
const
|
|
67
|
-
const setOpen = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.setOpen);
|
|
68
|
-
// current active option?
|
|
69
|
-
const active = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>{
|
|
70
|
-
var _ctx_activeOption, _ctx_activeOption1;
|
|
71
|
-
return ((_ctx_activeOption = ctx.activeOption) === null || _ctx_activeOption === void 0 ? void 0 : _ctx_activeOption.id) !== undefined && ((_ctx_activeOption1 = ctx.activeOption) === null || _ctx_activeOption1 === void 0 ? void 0 : _ctx_activeOption1.id) === id;
|
|
72
|
-
});
|
|
64
|
+
const selectOption = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.selectOption);
|
|
65
|
+
const onOptionClick = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.onOptionClick);
|
|
73
66
|
// check icon
|
|
74
67
|
let CheckIcon = /*#__PURE__*/ _react.createElement(_reacticons.CheckmarkFilled, null);
|
|
75
68
|
if (multiselect) {
|
|
@@ -81,14 +74,10 @@ const useOption_unstable = (props, ref)=>{
|
|
|
81
74
|
event.preventDefault();
|
|
82
75
|
return;
|
|
83
76
|
}
|
|
84
|
-
|
|
85
|
-
setActiveOption(optionData);
|
|
86
|
-
// close on option click for single-select options in a combobox
|
|
87
|
-
if (!multiselect) {
|
|
88
|
-
setOpen === null || setOpen === void 0 ? void 0 : setOpen(event, false);
|
|
89
|
-
}
|
|
77
|
+
activeDescendantController.focus(id);
|
|
90
78
|
// handle selection change
|
|
91
79
|
selectOption(event, optionData);
|
|
80
|
+
onOptionClick(event);
|
|
92
81
|
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, event);
|
|
93
82
|
};
|
|
94
83
|
// register option data with context
|
|
@@ -134,10 +123,11 @@ const useOption_unstable = (props, ref)=>{
|
|
|
134
123
|
},
|
|
135
124
|
elementType: 'span'
|
|
136
125
|
}),
|
|
137
|
-
active,
|
|
138
126
|
disabled,
|
|
139
|
-
focusVisible,
|
|
140
127
|
multiselect,
|
|
141
|
-
selected
|
|
128
|
+
selected,
|
|
129
|
+
// no longer used
|
|
130
|
+
focusVisible: false,
|
|
131
|
+
active: false
|
|
142
132
|
};
|
|
143
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useOption.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport {
|
|
1
|
+
{"version":3,"sources":["useOption.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useActiveDescendantContext } from '@fluentui/react-aria';\nimport { CheckmarkFilled, Checkmark12Filled } from '@fluentui/react-icons';\nimport { useListboxContext_unstable } from '../../contexts/ListboxContext';\nfunction getTextString(text, children) {\n if (text !== undefined) {\n return text;\n }\n let textString = '';\n let hasNonStringChild = false;\n React.Children.forEach(children, (child)=>{\n if (typeof child === 'string') {\n textString += child;\n } else {\n hasNonStringChild = true;\n }\n });\n // warn if an Option has non-string children and no text prop\n if (hasNonStringChild) {\n // eslint-disable-next-line no-console\n console.warn('Provide a `text` prop to Option components when they contain non-string children.');\n }\n return textString;\n}\n/**\n * Create the state required to render Option.\n *\n * The returned state can be modified with hooks such as useOptionStyles_unstable,\n * before being passed to renderOption_unstable.\n *\n * @param props - props from this instance of Option\n * @param ref - reference to root HTMLElement of Option\n */ export const useOption_unstable = (props, ref)=>{\n const { children, disabled, text, value } = props;\n const optionRef = React.useRef(null);\n const optionText = getTextString(text, children);\n const optionValue = value !== null && value !== void 0 ? value : optionText;\n // use the id if provided, otherwise use a generated id\n const id = useId('fluent-option', props.id);\n // data used for context registration & events\n const optionData = React.useMemo(()=>({\n id,\n disabled,\n text: optionText,\n value: optionValue\n }), [\n id,\n disabled,\n optionText,\n optionValue\n ]);\n // context values\n const { controller: activeDescendantController } = useActiveDescendantContext();\n const multiselect = useListboxContext_unstable((ctx)=>ctx.multiselect);\n const registerOption = useListboxContext_unstable((ctx)=>ctx.registerOption);\n const selected = useListboxContext_unstable((ctx)=>{\n const selectedOptions = ctx.selectedOptions;\n return !!optionValue && !!selectedOptions.find((o)=>o === optionValue);\n });\n const selectOption = useListboxContext_unstable((ctx)=>ctx.selectOption);\n const onOptionClick = useListboxContext_unstable((ctx)=>ctx.onOptionClick);\n // check icon\n let CheckIcon = /*#__PURE__*/ React.createElement(CheckmarkFilled, null);\n if (multiselect) {\n CheckIcon = selected ? /*#__PURE__*/ React.createElement(Checkmark12Filled, null) : '';\n }\n const onClick = (event)=>{\n var _props_onClick;\n if (disabled) {\n event.preventDefault();\n return;\n }\n activeDescendantController.focus(id);\n // handle selection change\n selectOption(event, optionData);\n onOptionClick(event);\n (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, event);\n };\n // register option data with context\n React.useEffect(()=>{\n if (id && optionRef.current) {\n return registerOption(optionData, optionRef.current);\n }\n }, [\n id,\n optionData,\n registerOption\n ]);\n const semanticProps = multiselect ? {\n role: 'menuitemcheckbox',\n 'aria-checked': selected\n } : {\n role: 'option',\n 'aria-selected': selected\n };\n return {\n components: {\n root: 'div',\n checkIcon: 'span'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, optionRef),\n 'aria-disabled': disabled ? 'true' : undefined,\n id,\n ...semanticProps,\n ...props,\n onClick\n }), {\n elementType: 'div'\n }),\n checkIcon: slot.optional(props.checkIcon, {\n renderByDefault: true,\n defaultProps: {\n 'aria-hidden': 'true',\n children: CheckIcon\n },\n elementType: 'span'\n }),\n disabled,\n multiselect,\n selected,\n // no longer used\n focusVisible: false,\n active: false\n };\n};\n"],"names":["useOption_unstable","getTextString","text","children","undefined","textString","hasNonStringChild","React","Children","forEach","child","console","warn","props","ref","disabled","value","optionRef","useRef","optionText","optionValue","id","useId","optionData","useMemo","controller","activeDescendantController","useActiveDescendantContext","multiselect","useListboxContext_unstable","ctx","registerOption","selected","selectedOptions","find","o","selectOption","onOptionClick","CheckIcon","createElement","CheckmarkFilled","Checkmark12Filled","onClick","event","_props_onClick","preventDefault","focus","call","useEffect","current","semanticProps","role","components","root","checkIcon","slot","always","getIntrinsicElementProps","useMergedRefs","elementType","optional","renderByDefault","defaultProps","focusVisible","active"],"mappings":";;;;+BAiCiBA;;;eAAAA;;;;iEAjCM;gCAC8C;2BAC1B;4BACQ;gCACR;AAC3C,SAASC,cAAcC,IAAI,EAAEC,QAAQ;IACjC,IAAID,SAASE,WAAW;QACpB,OAAOF;IACX;IACA,IAAIG,aAAa;IACjB,IAAIC,oBAAoB;IAC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d;YACAqB,aAAa;QACjB;QACA5C;QACAa;QACAI;QACA,iBAAiB;QACjB+B,cAAc;QACdC,QAAQ;IACZ;AACJ"}
|
|
@@ -86,65 +86,65 @@ const optionClassNames = {
|
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
active: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
],
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
],
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
],
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
],
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
],
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
],
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
],
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
],
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
],
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
],
|
|
145
|
-
|
|
146
|
-
"
|
|
147
|
-
"
|
|
89
|
+
Bowz1zl: "f11vrvdw",
|
|
90
|
+
oxogb1: "f17hxjb7",
|
|
91
|
+
Ix2sn8: "f1dha69c",
|
|
92
|
+
q7v32p: "f1lm7500",
|
|
93
|
+
Btq9bd3: "fuyp35s",
|
|
94
|
+
Bertapg: [
|
|
95
|
+
"f1a9nstl",
|
|
96
|
+
"fhk0hgg"
|
|
97
|
+
],
|
|
98
|
+
b50fsz: "f1rdp6f1",
|
|
99
|
+
avt0cx: [
|
|
100
|
+
"fhk0hgg",
|
|
101
|
+
"f1a9nstl"
|
|
102
|
+
],
|
|
103
|
+
Bqfxd14: "f1tj24la",
|
|
104
|
+
B53xpsf: [
|
|
105
|
+
"f1td3xda",
|
|
106
|
+
"f73totv"
|
|
107
|
+
],
|
|
108
|
+
B1wzb3v: "f2ge7d1",
|
|
109
|
+
f0sref: [
|
|
110
|
+
"f73totv",
|
|
111
|
+
"f1td3xda"
|
|
112
|
+
],
|
|
113
|
+
Bttcd12: [
|
|
114
|
+
"ftb4b3e",
|
|
115
|
+
"f1scq65d"
|
|
116
|
+
],
|
|
117
|
+
Fffuxt: [
|
|
118
|
+
"f1scq65d",
|
|
119
|
+
"ftb4b3e"
|
|
120
|
+
],
|
|
121
|
+
Bqougee: [
|
|
122
|
+
"f2me9eq",
|
|
123
|
+
"fgk4qqi"
|
|
124
|
+
],
|
|
125
|
+
Beitzug: [
|
|
126
|
+
"fgk4qqi",
|
|
127
|
+
"f2me9eq"
|
|
128
|
+
],
|
|
129
|
+
B39dzdd: "ffd7rjx",
|
|
130
|
+
Be3o27t: [
|
|
131
|
+
"fobu5kn",
|
|
132
|
+
"f1dbet5w"
|
|
133
|
+
],
|
|
134
|
+
Bewtojm: "f1ap9jj5",
|
|
135
|
+
B37u8z8: [
|
|
136
|
+
"f1dbet5w",
|
|
137
|
+
"fobu5kn"
|
|
138
|
+
],
|
|
139
|
+
Bhijsxg: "fwq15dy",
|
|
140
|
+
kktds4: "f1pb3wry",
|
|
141
|
+
Bmau3bo: [
|
|
142
|
+
"ftjv2f4",
|
|
143
|
+
"f1flhb1f"
|
|
144
|
+
],
|
|
145
|
+
npektv: [
|
|
146
|
+
"f1flhb1f",
|
|
147
|
+
"ftjv2f4"
|
|
148
148
|
]
|
|
149
149
|
},
|
|
150
150
|
disabled: {
|
|
@@ -298,30 +298,30 @@ const optionClassNames = {
|
|
|
298
298
|
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
|
|
299
299
|
".f1tdddsa{padding-bottom:var(--spacingVerticalSNudge);}",
|
|
300
300
|
".f10pi13n{position:relative;}",
|
|
301
|
-
".
|
|
302
|
-
".
|
|
303
|
-
".
|
|
304
|
-
".
|
|
305
|
-
".
|
|
306
|
-
".
|
|
307
|
-
".
|
|
308
|
-
".
|
|
309
|
-
".
|
|
310
|
-
".
|
|
311
|
-
".
|
|
312
|
-
".
|
|
313
|
-
".
|
|
314
|
-
".
|
|
315
|
-
".
|
|
316
|
-
".
|
|
317
|
-
".
|
|
318
|
-
".
|
|
319
|
-
".
|
|
320
|
-
".
|
|
321
|
-
".
|
|
322
|
-
".
|
|
323
|
-
".
|
|
324
|
-
".
|
|
301
|
+
".f11vrvdw[data-activedescendant-focusvisible]::after{content:\"\";}",
|
|
302
|
+
".f17hxjb7[data-activedescendant-focusvisible]::after{position:absolute;}",
|
|
303
|
+
".f1dha69c[data-activedescendant-focusvisible]::after{pointer-events:none;}",
|
|
304
|
+
".f1lm7500[data-activedescendant-focusvisible]::after{z-index:1;}",
|
|
305
|
+
".fuyp35s[data-activedescendant-focusvisible]::after{border-top-style:solid;}",
|
|
306
|
+
".f1a9nstl[data-activedescendant-focusvisible]::after{border-right-style:solid;}",
|
|
307
|
+
".fhk0hgg[data-activedescendant-focusvisible]::after{border-left-style:solid;}",
|
|
308
|
+
".f1rdp6f1[data-activedescendant-focusvisible]::after{border-bottom-style:solid;}",
|
|
309
|
+
".f1tj24la[data-activedescendant-focusvisible]::after{border-top-width:2px;}",
|
|
310
|
+
".f1td3xda[data-activedescendant-focusvisible]::after{border-right-width:2px;}",
|
|
311
|
+
".f73totv[data-activedescendant-focusvisible]::after{border-left-width:2px;}",
|
|
312
|
+
".f2ge7d1[data-activedescendant-focusvisible]::after{border-bottom-width:2px;}",
|
|
313
|
+
".ftb4b3e[data-activedescendant-focusvisible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}",
|
|
314
|
+
".f1scq65d[data-activedescendant-focusvisible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}",
|
|
315
|
+
".f2me9eq[data-activedescendant-focusvisible]::after{border-top-right-radius:var(--borderRadiusMedium);}",
|
|
316
|
+
".fgk4qqi[data-activedescendant-focusvisible]::after{border-top-left-radius:var(--borderRadiusMedium);}",
|
|
317
|
+
".ffd7rjx[data-activedescendant-focusvisible]::after{border-top-color:var(--colorStrokeFocus2);}",
|
|
318
|
+
".fobu5kn[data-activedescendant-focusvisible]::after{border-right-color:var(--colorStrokeFocus2);}",
|
|
319
|
+
".f1dbet5w[data-activedescendant-focusvisible]::after{border-left-color:var(--colorStrokeFocus2);}",
|
|
320
|
+
".f1ap9jj5[data-activedescendant-focusvisible]::after{border-bottom-color:var(--colorStrokeFocus2);}",
|
|
321
|
+
".fwq15dy[data-activedescendant-focusvisible]::after{top:-2px;}",
|
|
322
|
+
".f1pb3wry[data-activedescendant-focusvisible]::after{bottom:-2px;}",
|
|
323
|
+
".ftjv2f4[data-activedescendant-focusvisible]::after{left:-2px;}",
|
|
324
|
+
".f1flhb1f[data-activedescendant-focusvisible]::after{right:-2px;}",
|
|
325
325
|
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
|
|
326
326
|
".fod5ikn{font-size:var(--fontSizeBase400);}",
|
|
327
327
|
".f18b9hdq{margin-left:calc(var(--spacingHorizontalXXS) * -1);}",
|
|
@@ -402,9 +402,9 @@ const optionClassNames = {
|
|
|
402
402
|
]
|
|
403
403
|
});
|
|
404
404
|
const useOptionStyles_unstable = (state)=>{
|
|
405
|
-
const {
|
|
405
|
+
const { disabled, multiselect, selected } = state;
|
|
406
406
|
const styles = useStyles();
|
|
407
|
-
state.root.className = (0, _react.mergeClasses)(optionClassNames.root, styles.root,
|
|
407
|
+
state.root.className = (0, _react.mergeClasses)(optionClassNames.root, styles.root, styles.active, disabled && styles.disabled, selected && styles.selected, state.root.className);
|
|
408
408
|
if (state.checkIcon) {
|
|
409
409
|
state.checkIcon.className = (0, _react.mergeClasses)(optionClassNames.checkIcon, styles.checkIcon, multiselect && styles.multiselectCheck, selected && styles.selectedCheck, selected && multiselect && styles.selectedMultiselectCheck, disabled && styles.checkDisabled, disabled && multiselect && styles.multiselectCheckDisabled, state.checkIcon.className);
|
|
410
410
|
}
|