@fluentui/react-tag-picker 9.0.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 +165 -0
- package/LICENSE +15 -0
- package/README.md +68 -0
- package/Spec.md +208 -0
- package/dist/index.d.ts +453 -0
- package/lib/TagPicker.js +1 -0
- package/lib/TagPicker.js.map +1 -0
- package/lib/TagPickerButton.js +1 -0
- package/lib/TagPickerButton.js.map +1 -0
- package/lib/TagPickerControl.js +1 -0
- package/lib/TagPickerControl.js.map +1 -0
- package/lib/TagPickerGroup.js +1 -0
- package/lib/TagPickerGroup.js.map +1 -0
- package/lib/TagPickerInput.js +1 -0
- package/lib/TagPickerInput.js.map +1 -0
- package/lib/TagPickerList.js +1 -0
- package/lib/TagPickerList.js.map +1 -0
- package/lib/TagPickerOption.js +1 -0
- package/lib/TagPickerOption.js.map +1 -0
- package/lib/TagPickerOptionGroup.js +1 -0
- package/lib/TagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPicker/TagPicker.js +13 -0
- package/lib/components/TagPicker/TagPicker.js.map +1 -0
- package/lib/components/TagPicker/TagPicker.types.js +1 -0
- package/lib/components/TagPicker/TagPicker.types.js.map +1 -0
- package/lib/components/TagPicker/index.js +4 -0
- package/lib/components/TagPicker/index.js.map +1 -0
- package/lib/components/TagPicker/renderTagPicker.js +20 -0
- package/lib/components/TagPicker/renderTagPicker.js.map +1 -0
- package/lib/components/TagPicker/useTagPicker.js +123 -0
- package/lib/components/TagPicker/useTagPicker.js.map +1 -0
- package/lib/components/TagPicker/useTagPickerContextValues.js +41 -0
- package/lib/components/TagPicker/useTagPickerContextValues.js.map +1 -0
- package/lib/components/TagPickerButton/TagPickerButton.js +15 -0
- package/lib/components/TagPickerButton/TagPickerButton.js.map +1 -0
- package/lib/components/TagPickerButton/TagPickerButton.types.js +1 -0
- package/lib/components/TagPickerButton/TagPickerButton.types.js.map +1 -0
- package/lib/components/TagPickerButton/index.js +5 -0
- package/lib/components/TagPickerButton/index.js.map +1 -0
- package/lib/components/TagPickerButton/renderTagPickerButton.js +8 -0
- package/lib/components/TagPickerButton/renderTagPickerButton.js.map +1 -0
- package/lib/components/TagPickerButton/useTagPickerButton.js +54 -0
- package/lib/components/TagPickerButton/useTagPickerButton.js.map +1 -0
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.js +191 -0
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.js.map +1 -0
- package/lib/components/TagPickerControl/TagPickerControl.js +15 -0
- package/lib/components/TagPickerControl/TagPickerControl.js.map +1 -0
- package/lib/components/TagPickerControl/TagPickerControl.types.js +1 -0
- package/lib/components/TagPickerControl/TagPickerControl.types.js.map +1 -0
- package/lib/components/TagPickerControl/index.js +5 -0
- package/lib/components/TagPickerControl/index.js.map +1 -0
- package/lib/components/TagPickerControl/renderTagPickerControl.js +18 -0
- package/lib/components/TagPickerControl/renderTagPickerControl.js.map +1 -0
- package/lib/components/TagPickerControl/useTagPickerControl.js +101 -0
- package/lib/components/TagPickerControl/useTagPickerControl.js.map +1 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.js +262 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.js.map +1 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.js +16 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.js.map +1 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.types.js +1 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.types.js.map +1 -0
- package/lib/components/TagPickerGroup/index.js +5 -0
- package/lib/components/TagPickerGroup/index.js.map +1 -0
- package/lib/components/TagPickerGroup/renderTagPickerGroup.js +7 -0
- package/lib/components/TagPickerGroup/renderTagPickerGroup.js.map +1 -0
- package/lib/components/TagPickerGroup/useTagPickerGroup.js +62 -0
- package/lib/components/TagPickerGroup/useTagPickerGroup.js.map +1 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.js +53 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.js.map +1 -0
- package/lib/components/TagPickerInput/TagPickerInput.js +15 -0
- package/lib/components/TagPickerInput/TagPickerInput.js.map +1 -0
- package/lib/components/TagPickerInput/TagPickerInput.types.js +1 -0
- package/lib/components/TagPickerInput/TagPickerInput.types.js.map +1 -0
- package/lib/components/TagPickerInput/index.js +5 -0
- package/lib/components/TagPickerInput/index.js.map +1 -0
- package/lib/components/TagPickerInput/renderTagPickerInput.js +8 -0
- package/lib/components/TagPickerInput/renderTagPickerInput.js.map +1 -0
- package/lib/components/TagPickerInput/useTagPickerInput.js +137 -0
- package/lib/components/TagPickerInput/useTagPickerInput.js.map +1 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.js +60 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.js.map +1 -0
- package/lib/components/TagPickerList/TagPickerList.js +15 -0
- package/lib/components/TagPickerList/TagPickerList.js.map +1 -0
- package/lib/components/TagPickerList/TagPickerList.types.js +1 -0
- package/lib/components/TagPickerList/TagPickerList.types.js.map +1 -0
- package/lib/components/TagPickerList/index.js +5 -0
- package/lib/components/TagPickerList/index.js.map +1 -0
- package/lib/components/TagPickerList/renderTagPickerList.js +8 -0
- package/lib/components/TagPickerList/renderTagPickerList.js.map +1 -0
- package/lib/components/TagPickerList/useTagPickerList.js +39 -0
- package/lib/components/TagPickerList/useTagPickerList.js.map +1 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.js +33 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.js.map +1 -0
- package/lib/components/TagPickerOption/TagPickerOption.js +15 -0
- package/lib/components/TagPickerOption/TagPickerOption.js.map +1 -0
- package/lib/components/TagPickerOption/TagPickerOption.types.js +1 -0
- package/lib/components/TagPickerOption/TagPickerOption.types.js.map +1 -0
- package/lib/components/TagPickerOption/index.js +5 -0
- package/lib/components/TagPickerOption/index.js.map +1 -0
- package/lib/components/TagPickerOption/renderTagPickerOption.js +14 -0
- package/lib/components/TagPickerOption/renderTagPickerOption.js.map +1 -0
- package/lib/components/TagPickerOption/useTagPickerOption.js +35 -0
- package/lib/components/TagPickerOption/useTagPickerOption.js.map +1 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.js +49 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.js +15 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js +1 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/index.js +5 -0
- package/lib/components/TagPickerOptionGroup/index.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js +4 -0
- package/lib/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroup.js +11 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js +18 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map +1 -0
- package/lib/contexts/TagPickerContext.js +27 -0
- package/lib/contexts/TagPickerContext.js.map +1 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/tagPicker2Tag.js +32 -0
- package/lib/utils/tagPicker2Tag.js.map +1 -0
- package/lib/utils/tokens.js +6 -0
- package/lib/utils/tokens.js.map +1 -0
- package/lib/utils/useResizeObserverRef.js +22 -0
- package/lib/utils/useResizeObserverRef.js.map +1 -0
- package/lib/utils/useTagPickerFilter.js +35 -0
- package/lib/utils/useTagPickerFilter.js.map +1 -0
- package/lib-commonjs/TagPicker.js +6 -0
- package/lib-commonjs/TagPicker.js.map +1 -0
- package/lib-commonjs/TagPickerButton.js +6 -0
- package/lib-commonjs/TagPickerButton.js.map +1 -0
- package/lib-commonjs/TagPickerControl.js +6 -0
- package/lib-commonjs/TagPickerControl.js.map +1 -0
- package/lib-commonjs/TagPickerGroup.js +6 -0
- package/lib-commonjs/TagPickerGroup.js.map +1 -0
- package/lib-commonjs/TagPickerInput.js +6 -0
- package/lib-commonjs/TagPickerInput.js.map +1 -0
- package/lib-commonjs/TagPickerList.js +6 -0
- package/lib-commonjs/TagPickerList.js.map +1 -0
- package/lib-commonjs/TagPickerOption.js +6 -0
- package/lib-commonjs/TagPickerOption.js.map +1 -0
- package/lib-commonjs/TagPickerOptionGroup.js +6 -0
- package/lib-commonjs/TagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPicker/TagPicker.js +21 -0
- package/lib-commonjs/components/TagPicker/TagPicker.js.map +1 -0
- package/lib-commonjs/components/TagPicker/TagPicker.types.js +4 -0
- package/lib-commonjs/components/TagPicker/TagPicker.types.js.map +1 -0
- package/lib-commonjs/components/TagPicker/index.js +9 -0
- package/lib-commonjs/components/TagPicker/index.js.map +1 -0
- package/lib-commonjs/components/TagPicker/renderTagPicker.js +29 -0
- package/lib-commonjs/components/TagPicker/renderTagPicker.js.map +1 -0
- package/lib-commonjs/components/TagPicker/useTagPicker.js +126 -0
- package/lib-commonjs/components/TagPicker/useTagPicker.js.map +1 -0
- package/lib-commonjs/components/TagPicker/useTagPickerContextValues.js +52 -0
- package/lib-commonjs/components/TagPicker/useTagPickerContextValues.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.js +23 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.types.js +4 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/index.js +10 -0
- package/lib-commonjs/components/TagPickerButton/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/renderTagPickerButton.js +16 -0
- package/lib-commonjs/components/TagPickerButton/renderTagPickerButton.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButton.js +57 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButton.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.js +453 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.js +23 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.types.js +6 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/index.js +10 -0
- package/lib-commonjs/components/TagPickerControl/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/renderTagPickerControl.js +26 -0
- package/lib-commonjs/components/TagPickerControl/renderTagPickerControl.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControl.js +104 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControl.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.js +579 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.js +24 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.types.js +4 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/index.js +10 -0
- package/lib-commonjs/components/TagPickerGroup/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/renderTagPickerGroup.js +17 -0
- package/lib-commonjs/components/TagPickerGroup/renderTagPickerGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroup.js +65 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.js +97 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.js +23 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.types.js +4 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/index.js +10 -0
- package/lib-commonjs/components/TagPickerInput/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/renderTagPickerInput.js +16 -0
- package/lib-commonjs/components/TagPickerInput/renderTagPickerInput.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInput.js +140 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInput.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.js +122 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.js +23 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.types.js +4 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/index.js +10 -0
- package/lib-commonjs/components/TagPickerList/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/renderTagPickerList.js +16 -0
- package/lib-commonjs/components/TagPickerList/renderTagPickerList.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerList.js +41 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerList.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.js +66 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.js +23 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.types.js +6 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/index.js +10 -0
- package/lib-commonjs/components/TagPickerOption/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/renderTagPickerOption.js +22 -0
- package/lib-commonjs/components/TagPickerOption/renderTagPickerOption.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOption.js +38 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOption.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.js +69 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.js +23 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js +4 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/index.js +10 -0
- package/lib-commonjs/components/TagPickerOptionGroup/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js +12 -0
- package/lib-commonjs/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroup.js +14 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js +32 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/TagPickerContext.js +47 -0
- package/lib-commonjs/contexts/TagPickerContext.js.map +1 -0
- package/lib-commonjs/index.js +138 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utils/tagPicker2Tag.js +53 -0
- package/lib-commonjs/utils/tagPicker2Tag.js.map +1 -0
- package/lib-commonjs/utils/tokens.js +24 -0
- package/lib-commonjs/utils/tokens.js.map +1 -0
- package/lib-commonjs/utils/useResizeObserverRef.js +33 -0
- package/lib-commonjs/utils/useResizeObserverRef.js.map +1 -0
- package/lib-commonjs/utils/useTagPickerFilter.js +46 -0
- package/lib-commonjs/utils/useTagPickerFilter.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useTagPicker.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback, useId, useMergedRefs } from '@fluentui/react-utilities';\nimport { optionClassNames } from '@fluentui/react-combobox';\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport { useActiveDescendant } from '@fluentui/react-aria';\nimport { useComboboxBaseState } from '@fluentui/react-combobox';\n// Set a default set of fallback positions to try if the dropdown does not fit on screen\nconst fallbackPositions = [\n 'above',\n 'after',\n 'after-top',\n 'before',\n 'before-top'\n];\n/**\n * Create the state required to render Picker.\n *\n * The returned state can be modified with hooks such as usePickerStyles_unstable,\n * before being passed to renderPicker_unstable.\n *\n * @param props - props from this instance of Picker\n */ export const useTagPicker_unstable = (props)=>{\n const popoverId = useId('picker-listbox');\n const triggerInnerRef = React.useRef(null);\n const secondaryActionRef = React.useRef(null);\n const tagPickerGroupRef = React.useRef(null);\n const { positioning, size = 'medium', inline = false } = props;\n const { targetRef, containerRef } = usePositioning({\n position: 'below',\n align: 'start',\n offset: {\n crossAxis: 0,\n mainAxis: 2\n },\n fallbackPositions,\n matchTargetSize: 'width',\n ...resolvePositioningShorthand(positioning)\n });\n const { controller: activeDescendantController, activeParentRef, listboxRef } = useActiveDescendant({\n matchOption: (el)=>el.classList.contains(optionClassNames.root)\n });\n const comboboxState = useComboboxBaseState({\n ...props,\n onOptionSelect: useEventCallback((event, data)=>{\n var _props_onOptionSelect;\n return (_props_onOptionSelect = props.onOptionSelect) === null || _props_onOptionSelect === void 0 ? void 0 : _props_onOptionSelect.call(props, event, {\n selectedOptions: data.selectedOptions,\n value: data.optionValue,\n type: event.type,\n event\n });\n }),\n onOpenChange: useEventCallback((event, data)=>{\n var _props_onOpenChange;\n return (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, event, {\n ...data,\n type: event.type,\n event\n });\n }),\n activeDescendantController,\n editable: true,\n multiselect: true,\n size: 'medium'\n });\n const { trigger, popover } = childrenToTriggerAndPopover(props.children);\n return {\n activeDescendantController,\n components: {},\n trigger,\n popover: comboboxState.open || comboboxState.hasFocus ? popover : undefined,\n popoverId,\n disabled: comboboxState.disabled,\n triggerRef: useMergedRefs(triggerInnerRef, activeParentRef),\n popoverRef: useMergedRefs(listboxRef, containerRef),\n secondaryActionRef,\n tagPickerGroupRef,\n targetRef,\n size,\n inline,\n open: comboboxState.open,\n mountNode: comboboxState.mountNode,\n onOptionClick: useEventCallback((event)=>{\n comboboxState.onOptionClick(event);\n comboboxState.setOpen(event, false);\n }),\n appearance: comboboxState.appearance,\n clearSelection: comboboxState.clearSelection,\n getOptionById: comboboxState.getOptionById,\n registerOption: comboboxState.registerOption,\n selectedOptions: comboboxState.selectedOptions,\n selectOption: comboboxState.selectOption,\n setHasFocus: comboboxState.setHasFocus,\n setOpen: comboboxState.setOpen,\n setValue: comboboxState.setValue,\n value: comboboxState.value\n };\n};\nconst childrenToTriggerAndPopover = (children)=>{\n const childrenArray = React.Children.toArray(children);\n if (process.env.NODE_ENV !== 'production') {\n if (childrenArray.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Picker must contain at least one child');\n }\n if (childrenArray.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Picker must contain at most two children');\n }\n }\n let trigger = undefined;\n let popover = undefined;\n if (childrenArray.length === 2) {\n trigger = childrenArray[0];\n popover = childrenArray[1];\n } else if (childrenArray.length === 1) {\n popover = childrenArray[0];\n }\n return {\n trigger,\n popover\n };\n};\n"],"names":["useTagPicker_unstable","fallbackPositions","props","popoverId","useId","triggerInnerRef","React","useRef","secondaryActionRef","tagPickerGroupRef","positioning","size","inline","targetRef","containerRef","usePositioning","position","align","offset","crossAxis","mainAxis","matchTargetSize","resolvePositioningShorthand","controller","activeDescendantController","activeParentRef","listboxRef","useActiveDescendant","matchOption","el","classList","contains","optionClassNames","root","comboboxState","useComboboxBaseState","onOptionSelect","useEventCallback","event","data","_props_onOptionSelect","call","selectedOptions","value","optionValue","type","onOpenChange","_props_onOpenChange","editable","multiselect","trigger","popover","childrenToTriggerAndPopover","children","components","open","hasFocus","undefined","disabled","triggerRef","useMergedRefs","popoverRef","mountNode","onOptionClick","setOpen","appearance","clearSelection","getOptionById","registerOption","selectOption","setHasFocus","setValue","childrenArray","Children","toArray","process","env","NODE_ENV","length","console","warn"],"mappings":";;;;+BAqBiBA;;;eAAAA;;;;iEArBM;gCACgC;+BACtB;kCAC2B;2BACxB;AAEpC,wFAAwF;AACxF,MAAMC,oBAAoB;IACtB;IACA;IACA;IACA;IACA;CACH;AAQU,MAAMD,wBAAwB,CAACE;IACtC,MAAMC,YAAYC,IAAAA,qBAAK,EAAC;IACxB,MAAMC,kBAAkBC,OAAMC,MAAM,CAAC;IACrC,MAAMC,qBAAqBF,OAAMC,MAAM,CAAC;IACxC,MAAME,oBAAoBH,OAAMC,MAAM,CAAC;IACvC,MAAM,EAAEG,WAAW,EAAEC,OAAO,QAAQ,EAAEC,SAAS,KAAK,EAAE,GAAGV;IACzD,MAAM,EAAEW,SAAS,EAAEC,YAAY,EAAE,GAAGC,IAAAA,gCAAc,EAAC;QAC/CC,UAAU;QACVC,OAAO;QACPC,QAAQ;YACJC,WAAW;YACXC,UAAU;QACd;QACAnB;QACAoB,iBAAiB;QACjB,GAAGC,IAAAA,6CAA2B,EAACZ,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
|
5
|
+
Object.defineProperty(exports, "useTagPickerContextValues", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useTagPickerContextValues;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
function useTagPickerContextValues(state) {
|
|
14
|
+
const { onOptionClick, registerOption, selectedOptions, selectOption, value, triggerRef, secondaryActionRef, tagPickerGroupRef, targetRef, size, setValue, setOpen, setHasFocus, popoverRef, appearance, clearSelection, getOptionById, open, popoverId, disabled } = state;
|
|
15
|
+
return {
|
|
16
|
+
activeDescendant: _react.useMemo(()=>({
|
|
17
|
+
controller: state.activeDescendantController
|
|
18
|
+
}), [
|
|
19
|
+
state.activeDescendantController
|
|
20
|
+
]),
|
|
21
|
+
listbox: {
|
|
22
|
+
onOptionClick,
|
|
23
|
+
registerOption,
|
|
24
|
+
selectedOptions,
|
|
25
|
+
selectOption,
|
|
26
|
+
focusVisible: false,
|
|
27
|
+
setActiveOption: noop
|
|
28
|
+
},
|
|
29
|
+
picker: {
|
|
30
|
+
value,
|
|
31
|
+
triggerRef,
|
|
32
|
+
targetRef,
|
|
33
|
+
secondaryActionRef,
|
|
34
|
+
tagPickerGroupRef,
|
|
35
|
+
size,
|
|
36
|
+
setValue,
|
|
37
|
+
setOpen,
|
|
38
|
+
setHasFocus,
|
|
39
|
+
selectOption,
|
|
40
|
+
popoverRef,
|
|
41
|
+
selectedOptions,
|
|
42
|
+
appearance,
|
|
43
|
+
clearSelection,
|
|
44
|
+
getOptionById,
|
|
45
|
+
open,
|
|
46
|
+
popoverId,
|
|
47
|
+
disabled
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const noop = ()=>{
|
|
52
|
+
/** noop */ };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useTagPickerContextValues.js"],"sourcesContent":["import * as React from 'react';\nexport function useTagPickerContextValues(state) {\n const { onOptionClick, registerOption, selectedOptions, selectOption, value, triggerRef, secondaryActionRef, tagPickerGroupRef, targetRef, size, setValue, setOpen, setHasFocus, popoverRef, appearance, clearSelection, getOptionById, open, popoverId, disabled } = state;\n return {\n activeDescendant: React.useMemo(()=>({\n controller: state.activeDescendantController\n }), [\n state.activeDescendantController\n ]),\n listbox: {\n onOptionClick,\n registerOption,\n selectedOptions,\n selectOption,\n focusVisible: false,\n setActiveOption: noop\n },\n picker: {\n value,\n triggerRef,\n targetRef,\n secondaryActionRef,\n tagPickerGroupRef,\n size,\n setValue,\n setOpen,\n setHasFocus,\n selectOption,\n popoverRef,\n selectedOptions,\n appearance,\n clearSelection,\n getOptionById,\n open,\n popoverId,\n disabled\n }\n };\n}\nconst noop = ()=>{\n/** noop */ };\n"],"names":["useTagPickerContextValues","state","onOptionClick","registerOption","selectedOptions","selectOption","value","triggerRef","secondaryActionRef","tagPickerGroupRef","targetRef","size","setValue","setOpen","setHasFocus","popoverRef","appearance","clearSelection","getOptionById","open","popoverId","disabled","activeDescendant","React","useMemo","controller","activeDescendantController","listbox","focusVisible","setActiveOption","noop","picker"],"mappings":";;;;+BACgBA;;;eAAAA;;;;iEADO;AAChB,SAASA,0BAA0BC,KAAK;IAC3C,MAAM,EAAEC,aAAa,EAAEC,cAAc,EAAEC,eAAe,EAAEC,YAAY,EAAEC,KAAK,EAAEC,UAAU,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,UAAU,EAAEC,UAAU,EAAEC,cAAc,EAAEC,aAAa,EAAEC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGpB;IACtQ,OAAO;QACHqB,kBAAkBC,OAAMC,OAAO,CAAC,IAAK,CAAA;gBAC7BC,YAAYxB,MAAMyB,0BAA0B;YAChD,CAAA,GAAI;YACJzB,MAAMyB,0BAA0B;SACnC;QACDC,SAAS;YACLzB;YACAC;YACAC;YACAC;YACAuB,cAAc;YACdC,iBAAiBC;QACrB;QACAC,QAAQ;YACJzB;YACAC;YACAG;YACAF;YACAC;YACAE;YACAC;YACAC;YACAC;YACAT;YACAU;YACAX;YACAY;YACAC;YACAC;YACAC;YACAC;YACAC;QACJ;IACJ;AACJ;AACA,MAAMS,OAAO;AACb,SAAS,GAAG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "TagPickerButton", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return TagPickerButton;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useTagPickerButton = require("./useTagPickerButton");
|
|
14
|
+
const _renderTagPickerButton = require("./renderTagPickerButton");
|
|
15
|
+
const _useTagPickerButtonStylesstyles = require("./useTagPickerButtonStyles.styles");
|
|
16
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
17
|
+
const TagPickerButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _useTagPickerButton.useTagPickerButton_unstable)(props, ref);
|
|
19
|
+
(0, _useTagPickerButtonStylesstyles.useTagPickerButtonStyles_unstable)(state);
|
|
20
|
+
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useTagPickerButtonStyles_unstable')(state);
|
|
21
|
+
return (0, _renderTagPickerButton.renderTagPickerButton_unstable)(state);
|
|
22
|
+
});
|
|
23
|
+
TagPickerButton.displayName = 'TagPickerButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useTagPickerButton_unstable } from './useTagPickerButton';\nimport { renderTagPickerButton_unstable } from './renderTagPickerButton';\nimport { useTagPickerButtonStyles_unstable } from './useTagPickerButtonStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * TagPickerButton component -\n * A TagPickerButton is an alternative to TagPickerInput that does not include an input field.\n */ export const TagPickerButton = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useTagPickerButton_unstable(props, ref);\n useTagPickerButtonStyles_unstable(state);\n useCustomStyleHook_unstable('useTagPickerButtonStyles_unstable')(state);\n return renderTagPickerButton_unstable(state);\n});\nTagPickerButton.displayName = 'TagPickerButton';\n"],"names":["TagPickerButton","React","forwardRef","props","ref","state","useTagPickerButton_unstable","useTagPickerButtonStyles_unstable","useCustomStyleHook_unstable","renderTagPickerButton_unstable","displayName"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;oCACqB;uCACG;gDACG;qCACN;AAIjC,MAAMA,kBAAkB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACtE,MAAMC,QAAQC,IAAAA,+CAA2B,EAACH,OAAOC;IACjDG,IAAAA,iEAAiC,EAACF;IAClCG,IAAAA,gDAA2B,EAAC,qCAAqCH;IACjE,OAAOI,IAAAA,qDAA8B,EAACJ;AAC1C;AACAL,gBAAgBU,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./TagPickerButton"), exports);
|
|
7
|
+
_export_star._(require("./TagPickerButton.types"), exports);
|
|
8
|
+
_export_star._(require("./renderTagPickerButton"), exports);
|
|
9
|
+
_export_star._(require("./useTagPickerButton"), exports);
|
|
10
|
+
_export_star._(require("./useTagPickerButtonStyles.styles"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './TagPickerButton';\nexport * from './TagPickerButton.types';\nexport * from './renderTagPickerButton';\nexport * from './useTagPickerButton';\nexport * from './useTagPickerButtonStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderTagPickerButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderTagPickerButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
|
+
const renderTagPickerButton_unstable = (state)=>{
|
|
14
|
+
(0, _reactutilities.assertSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderTagPickerButton.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of PickerButton\n */ export const renderTagPickerButton_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderTagPickerButton_unstable","state","assertSlots","_jsx","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,iCAAiC,CAACC;IAC/CC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AAC3C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useTagPickerButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useTagPickerButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactaria = require("@fluentui/react-aria");
|
|
14
|
+
const _TagPickerContext = require("../../contexts/TagPickerContext");
|
|
15
|
+
const _reactcombobox = require("@fluentui/react-combobox");
|
|
16
|
+
const useTagPickerButton_unstable = (props, ref)=>{
|
|
17
|
+
const { controller: activeDescendantController } = (0, _reactaria.useActiveDescendantContext)();
|
|
18
|
+
const triggerRef = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.triggerRef);
|
|
19
|
+
const open = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.open);
|
|
20
|
+
const value = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.value);
|
|
21
|
+
const hasSelectedOption = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.selectedOptions.length > 0);
|
|
22
|
+
const popoverId = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.popoverId);
|
|
23
|
+
const getOptionById = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.getOptionById);
|
|
24
|
+
const selectOption = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.selectOption);
|
|
25
|
+
const setHasFocus = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.setHasFocus);
|
|
26
|
+
const setOpen = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.setOpen);
|
|
27
|
+
// casting is required here as triggerRef can either be button or input,
|
|
28
|
+
// but in this case we can assure it's a button
|
|
29
|
+
const root = (0, _reactcombobox.useButtonTriggerSlot)(props, triggerRef, {
|
|
30
|
+
activeDescendantController,
|
|
31
|
+
defaultProps: {
|
|
32
|
+
type: 'button',
|
|
33
|
+
tabIndex: 0,
|
|
34
|
+
children: value || props.placeholder,
|
|
35
|
+
'aria-controls': open ? popoverId : undefined,
|
|
36
|
+
ref
|
|
37
|
+
},
|
|
38
|
+
state: {
|
|
39
|
+
getOptionById,
|
|
40
|
+
open,
|
|
41
|
+
selectOption,
|
|
42
|
+
setHasFocus,
|
|
43
|
+
setOpen,
|
|
44
|
+
multiselect: true
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const size = (0, _TagPickerContext.useTagPickerContext_unstable)((ctx)=>ctx.size);
|
|
48
|
+
const state = {
|
|
49
|
+
components: {
|
|
50
|
+
root: 'button'
|
|
51
|
+
},
|
|
52
|
+
root,
|
|
53
|
+
size,
|
|
54
|
+
hasSelectedOption
|
|
55
|
+
};
|
|
56
|
+
return state;
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useTagPickerButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useActiveDescendantContext } from '@fluentui/react-aria';\nimport { useTagPickerContext_unstable } from '../../contexts/TagPickerContext';\nimport { useButtonTriggerSlot } from '@fluentui/react-combobox';\n/**\n * Create the state required to render PickerButton.\n *\n * The returned state can be modified with hooks such as usePickerButtonStyles_unstable,\n * before being passed to renderPickerButton_unstable.\n *\n * @param props - props from this instance of PickerButton\n * @param ref - reference to root HTMLDivElement of PickerButton\n */ export const useTagPickerButton_unstable = (props, ref)=>{\n const { controller: activeDescendantController } = useActiveDescendantContext();\n const triggerRef = useTagPickerContext_unstable((ctx)=>ctx.triggerRef);\n const open = useTagPickerContext_unstable((ctx)=>ctx.open);\n const value = useTagPickerContext_unstable((ctx)=>ctx.value);\n const hasSelectedOption = useTagPickerContext_unstable((ctx)=>ctx.selectedOptions.length > 0);\n const popoverId = useTagPickerContext_unstable((ctx)=>ctx.popoverId);\n const getOptionById = useTagPickerContext_unstable((ctx)=>ctx.getOptionById);\n const selectOption = useTagPickerContext_unstable((ctx)=>ctx.selectOption);\n const setHasFocus = useTagPickerContext_unstable((ctx)=>ctx.setHasFocus);\n const setOpen = useTagPickerContext_unstable((ctx)=>ctx.setOpen);\n // casting is required here as triggerRef can either be button or input,\n // but in this case we can assure it's a button\n const root = useButtonTriggerSlot(props, triggerRef, {\n activeDescendantController,\n defaultProps: {\n type: 'button',\n tabIndex: 0,\n children: value || props.placeholder,\n 'aria-controls': open ? popoverId : undefined,\n ref\n },\n state: {\n getOptionById,\n open,\n selectOption,\n setHasFocus,\n setOpen,\n multiselect: true\n }\n });\n const size = useTagPickerContext_unstable((ctx)=>ctx.size);\n const state = {\n components: {\n root: 'button'\n },\n root,\n size,\n hasSelectedOption\n };\n return state;\n};\n"],"names":["useTagPickerButton_unstable","props","ref","controller","activeDescendantController","useActiveDescendantContext","triggerRef","useTagPickerContext_unstable","ctx","open","value","hasSelectedOption","selectedOptions","length","popoverId","getOptionById","selectOption","setHasFocus","setOpen","root","useButtonTriggerSlot","defaultProps","type","tabIndex","children","placeholder","undefined","state","multiselect","size","components"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;2BACoB;kCACE;+BACR;AAS1B,MAAMA,8BAA8B,CAACC,OAAOC;IACnD,MAAM,EAAEC,YAAYC,0BAA0B,EAAE,GAAGC,IAAAA,qCAA0B;IAC7E,MAAMC,aAAaC,IAAAA,8CAA4B,EAAC,CAACC,MAAMA,IAAIF,UAAU;IACrE,MAAMG,OAAOF,IAAAA,8CAA4B,EAAC,CAACC,MAAMA,IAAIC,IAAI;IACzD,MAAMC,QAAQH,IAAAA,8CAA4B,EAAC,CAACC,MAAMA,I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