@fluentui/react-combobox 9.5.28 → 9.5.29
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 +21 -2
- package/lib/components/Combobox/useCombobox.js +16 -28
- package/lib/components/Combobox/useCombobox.js.map +1 -1
- package/lib/components/Dropdown/useDropdown.js +17 -25
- package/lib/components/Dropdown/useDropdown.js.map +1 -1
- package/lib/utils/{useComboboxPopup.js → useComboboxPositioning.js} +5 -12
- package/lib/utils/useComboboxPositioning.js.map +1 -0
- package/lib-commonjs/components/Combobox/useCombobox.js +16 -28
- package/lib-commonjs/components/Combobox/useCombobox.js.map +1 -1
- package/lib-commonjs/components/Dropdown/useDropdown.js +17 -25
- package/lib-commonjs/components/Dropdown/useDropdown.js.map +1 -1
- package/lib-commonjs/utils/{useComboboxPopup.js → useComboboxPositioning.js} +8 -14
- package/lib-commonjs/utils/useComboboxPositioning.js.map +1 -0
- package/package.json +17 -11
- package/CHANGELOG.json +0 -4238
- package/lib/utils/useComboboxPopup.js.map +0 -1
- package/lib-commonjs/utils/useComboboxPopup.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["useComboboxPopup.ts"],"sourcesContent":["import { PositioningShorthandValue, resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport { ExtractSlotProps, Slot, useMergedRefs } from '@fluentui/react-utilities';\nimport type { ComboboxBaseProps } from './ComboboxBase.types';\nimport { Listbox } from '../components/Listbox/Listbox';\n\nexport function useComboboxPopup(\n props: ComboboxBaseProps,\n triggerShorthand?: ExtractSlotProps<Slot<'button'>>,\n listboxShorthand?: ExtractSlotProps<Slot<typeof Listbox>>,\n): [trigger: ExtractSlotProps<Slot<'button'>>, listbox?: ExtractSlotProps<Slot<typeof Listbox>>];\nexport function useComboboxPopup(\n props: ComboboxBaseProps,\n triggerShorthand?: ExtractSlotProps<Slot<'input'>>,\n listboxShorthand?: ExtractSlotProps<Slot<typeof Listbox>>,\n): [trigger: ExtractSlotProps<Slot<'input'>>, listbox?: ExtractSlotProps<Slot<typeof Listbox>>];\n\nexport function useComboboxPopup(\n props: ComboboxBaseProps,\n triggerShorthand?: ExtractSlotProps<Slot<'input'>> | ExtractSlotProps<Slot<'button'>>,\n listboxShorthand?: ExtractSlotProps<Slot<typeof Listbox>>,\n): [\n trigger: ExtractSlotProps<Slot<'input'>> | ExtractSlotProps<Slot<'button'>>,\n listbox?: ExtractSlotProps<Slot<typeof Listbox>>,\n] {\n const { positioning } = props;\n\n // Set a default set of fallback positions to try if the dropdown does not fit on screen\n const fallbackPositions: PositioningShorthandValue[] = ['above', 'after', 'after-top', 'before', 'before-top'];\n\n // popper options\n const popperOptions = {\n position: 'below' as const,\n align: 'start' as const,\n offset: { crossAxis: 0, mainAxis: 2 },\n fallbackPositions,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { targetRef, containerRef } = usePositioning(popperOptions);\n\n const listboxRef = useMergedRefs(listboxShorthand?.ref, containerRef);\n const listbox = listboxShorthand && { ...listboxShorthand, ref: listboxRef };\n\n return [{ ...triggerShorthand, ref: useMergedRefs(triggerShorthand?.ref, targetRef) }, listbox];\n}\n"],"names":["resolvePositioningShorthand","usePositioning","useMergedRefs","useComboboxPopup","props","triggerShorthand","listboxShorthand","positioning","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","targetRef","containerRef","listboxRef","ref","listbox"],"mappings":"AAAA,SAAoCA,2BAA2B,EAAEC,cAAc,QAAQ,8BAA8B;AACrH,SAAiCC,aAAa,QAAQ,4BAA4B;AAelF,OAAO,SAASC,iBACdC,KAAwB,EACxBC,gBAAqF,EACrFC,gBAAyD;IAKzD,MAAM,EAAEC,WAAW,EAAE,GAAGH;IAExB,wFAAwF;IACxF,MAAMI,oBAAiD;QAAC;QAAS;QAAS;QAAa;QAAU;KAAa;IAE9G,iBAAiB;IACjB,MAAMC,gBAAgB;QACpBC,UAAU;QACVC,OAAO;QACPC,QAAQ;YAAEC,WAAW;YAAGC,UAAU;QAAE;QACpCN;QACA,GAAGR,4BAA4BO,YAAY;IAC7C;IAEA,MAAM,EAAEQ,SAAS,EAAEC,YAAY,EAAE,GAAGf,eAAeQ;IAEnD,MAAMQ,aAAaf,cAAcI,6BAAAA,uCAAAA,iBAAkBY,GAAG,EAAEF;IACxD,MAAMG,UAAUb,oBAAoB;QAAE,GAAGA,gBAAgB;QAAEY,KAAKD;IAAW;IAE3E,OAAO;QAAC;YAAE,GAAGZ,gBAAgB;YAAEa,KAAKhB,cAAcG,6BAAAA,uCAAAA,iBAAkBa,GAAG,EAAEH;QAAW;QAAGI;KAAQ;AACjG"}
|
|
@@ -1 +0,0 @@
|
|
|
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 } = 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 === 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 === null || triggerShorthand === void 0 ? void 0 : triggerShorthand.ref, targetRef)\n },\n listbox\n ];\n}\n"],"names":["useComboboxPopup","props","triggerShorthand","listboxShorthand","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,MAAM,EAAEC,WAAW,EAAE,GAAGH;IACxB,wFAAwF;IACxF,MAAMI,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,EAACd,qBAAqB,QAAQA,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBe,GAAG,EAAEJ;IAC3H,MAAMK,UAAUhB,oBAAoB;QAChC,GAAGA,gBAAgB;QACnBe,KAAKF;IACT;IACA,OAAO;QACH;YACI,GAAGd,gBAAgB;YACnBgB,KAAKD,IAAAA,6BAAa,EAACf,qBAAqB,QAAQA,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBgB,GAAG,EAAEL;QACjH;QACAM;KACH;AACL"}
|