@tamagui/select 3.0.7 → 3.0.9

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.
Files changed (57) hide show
  1. package/dist/cjs/Select.native.cjs +9 -9
  2. package/dist/cjs/Select.native.js +9 -9
  3. package/dist/cjs/Select.native.js.map +1 -1
  4. package/dist/cjs/SelectContent.native.cjs +1 -1
  5. package/dist/cjs/SelectContent.native.js +1 -1
  6. package/dist/cjs/SelectContent.native.js.map +1 -1
  7. package/dist/cjs/SelectImpl.native.cjs +1 -1
  8. package/dist/cjs/SelectImpl.native.js +1 -1
  9. package/dist/cjs/SelectImpl.native.js.map +1 -1
  10. package/dist/cjs/SelectItem.native.cjs +3 -3
  11. package/dist/cjs/SelectItem.native.js +3 -3
  12. package/dist/cjs/SelectItem.native.js.map +1 -1
  13. package/dist/cjs/SelectTrigger.native.cjs +1 -1
  14. package/dist/cjs/SelectTrigger.native.js +1 -1
  15. package/dist/cjs/SelectTrigger.native.js.map +1 -1
  16. package/dist/cjs/context.native.cjs +1 -1
  17. package/dist/cjs/context.native.js +1 -1
  18. package/dist/cjs/context.native.js.map +1 -1
  19. package/dist/cjs/selectionController.native.cjs +27 -27
  20. package/dist/cjs/selectionController.native.js +27 -27
  21. package/dist/cjs/selectionController.native.js.map +1 -1
  22. package/dist/esm/Select.native.js +9 -9
  23. package/dist/esm/Select.native.js.map +1 -1
  24. package/dist/esm/SelectContent.native.js +1 -1
  25. package/dist/esm/SelectContent.native.js.map +1 -1
  26. package/dist/esm/SelectImpl.native.js +1 -1
  27. package/dist/esm/SelectImpl.native.js.map +1 -1
  28. package/dist/esm/SelectItem.native.js +3 -3
  29. package/dist/esm/SelectItem.native.js.map +1 -1
  30. package/dist/esm/SelectTrigger.native.js +1 -1
  31. package/dist/esm/SelectTrigger.native.js.map +1 -1
  32. package/dist/esm/context.native.js +1 -1
  33. package/dist/esm/context.native.js.map +1 -1
  34. package/dist/esm/selectionController.native.js +27 -27
  35. package/dist/esm/selectionController.native.js.map +1 -1
  36. package/dist/jsx/Select.native.cjs +9 -9
  37. package/dist/jsx/Select.native.js +9 -9
  38. package/dist/jsx/Select.native.js.map +1 -1
  39. package/dist/jsx/SelectContent.native.cjs +1 -1
  40. package/dist/jsx/SelectContent.native.js +1 -1
  41. package/dist/jsx/SelectContent.native.js.map +1 -1
  42. package/dist/jsx/SelectImpl.native.cjs +1 -1
  43. package/dist/jsx/SelectImpl.native.js +1 -1
  44. package/dist/jsx/SelectImpl.native.js.map +1 -1
  45. package/dist/jsx/SelectItem.native.cjs +3 -3
  46. package/dist/jsx/SelectItem.native.js +3 -3
  47. package/dist/jsx/SelectItem.native.js.map +1 -1
  48. package/dist/jsx/SelectTrigger.native.cjs +1 -1
  49. package/dist/jsx/SelectTrigger.native.js +1 -1
  50. package/dist/jsx/SelectTrigger.native.js.map +1 -1
  51. package/dist/jsx/context.native.cjs +1 -1
  52. package/dist/jsx/context.native.js +1 -1
  53. package/dist/jsx/context.native.js.map +1 -1
  54. package/dist/jsx/selectionController.native.cjs +27 -27
  55. package/dist/jsx/selectionController.native.js +27 -27
  56. package/dist/jsx/selectionController.native.js.map +1 -1
  57. package/package.json +27 -27
@@ -1 +1 @@
1
- {"version":3,"file":"Select.native.js","names":[],"sources":["esm/Select.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { Adapt, AdaptParent, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { Text, View, createChangeEventDetails, createStyledContext, createStyledHOC, styled } from \"@tamagui/core\";\nimport { FocusScopeController } from \"@tamagui/focus-scope\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { SelectItemParentProvider, SelectNativeComponentContext, SelectProvider, SelectZIndexContext, useSelectContext, useSelectItemParentContext } from \"./context\";\nimport { SelectContent } from \"./SelectContent\";\nimport { SelectInlineImpl } from \"./SelectImpl\";\nimport { SelectItem, useSelectItemContext } from \"./SelectItem\";\nimport { SelectItemText } from \"./SelectItemText\";\nimport { SelectScrollDownButton, SelectScrollUpButton } from \"./SelectScrollButton\";\nimport { SelectTrigger } from \"./SelectTrigger\";\nimport { SelectViewport } from \"./SelectViewport\";\nimport { createSelectItemRegistry, createSelectSelectionController, selectedValuesFromSelection } from \"./selectionController\";\n\nvar SelectValueFrame = styled(Text, { displayName: \"SelectValue\" });\nvar SelectValue = createStyledHOC(SelectValueFrame, function SelectValue2(param, forwardedRef) {\n\tvar { scope, children: childrenProp, placeholder, ...props } = param;\n\tvar _itemParentContext_registry_getItem;\n\tvar context = useSelectContext(scope);\n\tvar itemParentContext = useSelectItemParentContext(scope);\n\tvar composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n\tvar isEmptyValue = context.selectedValues.length === 0;\n\tvar [, rerender] = React.useReducer(function(version) {\n\t\treturn version + 1;\n\t}, 0);\n\tuseIsomorphicLayoutEffect(function() {\n\t\treturn itemParentContext.registry.subscribe(rerender);\n\t}, [itemParentContext.registry]);\n\tvar _itemParentContext_registry_getItem_label;\n\tvar registeredValue = context.mode === \"multiple\" ? context.selectedValues.map(function(value, index) {\n\t\tvar _itemParentContext_registry_getItem2;\n\t\tvar _itemParentContext_registry_getItem_label2;\n\t\treturn /* @__PURE__ */ jsxs(React.Fragment, { children: [index > 0 ? \", \" : null, (_itemParentContext_registry_getItem_label2 = (_itemParentContext_registry_getItem2 = itemParentContext.registry.getItem(value)) === null || _itemParentContext_registry_getItem2 === void 0 ? void 0 : _itemParentContext_registry_getItem2.label) !== null && _itemParentContext_registry_getItem_label2 !== void 0 ? _itemParentContext_registry_getItem_label2 : value] }, value);\n\t}) : (_itemParentContext_registry_getItem_label = (_itemParentContext_registry_getItem = itemParentContext.registry.getItem(context.selectedValues[0])) === null || _itemParentContext_registry_getItem === void 0 ? void 0 : _itemParentContext_registry_getItem.label) !== null && _itemParentContext_registry_getItem_label !== void 0 ? _itemParentContext_registry_getItem_label : context.value;\n\tvar children = childrenProp !== void 0 ? childrenProp : context.renderValue ? context.renderValue(context.value) : registeredValue;\n\tvar selectValueChildren = isEmptyValue ? placeholder !== null && placeholder !== void 0 ? placeholder : children : children;\n\treturn /* @__PURE__ */ jsx(SelectValueFrame, {\n\t\tpointerEvents: \"none\",\n\t\tref: composedRefs,\n\t\t...props,\n\t\tchildren: selectValueChildren\n\t});\n});\nvar SelectIcon = styled(View, {\n\tdisplayName: \"SelectIcon\",\n\t\"aria-hidden\": true\n});\nvar SelectItemIndicatorFrame = styled(View, { displayName: \"SelectItemIndicator\" });\nvar SelectItemIndicator = createStyledHOC(SelectItemIndicatorFrame, function SelectItemIndicator2(props, forwardedRef) {\n\tvar { scope, ...itemIndicatorProps } = props;\n\tvar context = useSelectItemParentContext(scope);\n\tvar itemContext = useSelectItemContext(scope);\n\tif (context.shouldRenderWebNative) return null;\n\treturn itemContext.isSelected ? /* @__PURE__ */ jsx(SelectItemIndicatorFrame, {\n\t\t\"aria-hidden\": true,\n\t\t...itemIndicatorProps,\n\t\tref: forwardedRef\n\t}) : null;\n});\nvar SelectIndicatorFrame = styled(View, {\n\tdisplayName: \"SelectIndicator\",\n\tposition: \"absolute\",\n\ttop: 0,\n\tleft: 0,\n\tpointerEvents: \"none\",\n\tzIndex: 10\n});\nvar SelectIndicator = createStyledHOC(SelectIndicatorFrame, function SelectIndicator2(param, forwardedRef) {\n\tvar { scope, ...props } = param;\n\tvar itemContext = useSelectItemParentContext(scope);\n\tvar context = useSelectContext(scope);\n\tvar [layout, setLayout] = React.useState(null);\n\tvar rafRef = React.useRef(0);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tvar update = function(index) {\n\t\t\tif (typeof index !== \"number\") return;\n\t\t\tcancelAnimationFrame(rafRef.current);\n\t\t\trafRef.current = requestAnimationFrame(function() {\n\t\t\t\tvar _itemContext_listRef_current, _itemContext_listRef;\n\t\t\t\tvar node = (_itemContext_listRef = itemContext.listRef) === null || _itemContext_listRef === void 0 ? void 0 : (_itemContext_listRef_current = _itemContext_listRef.current) === null || _itemContext_listRef_current === void 0 ? void 0 : _itemContext_listRef_current[index];\n\t\t\t\tif (node) setLayout({\n\t\t\t\t\twidth: Math.round(node.offsetWidth),\n\t\t\t\t\theight: Math.round(node.offsetHeight),\n\t\t\t\t\tx: Math.round(node.offsetLeft),\n\t\t\t\t\ty: Math.round(node.offsetTop)\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\t\tif (context.open && context.activeIndexRef.current !== null) update(context.activeIndexRef.current);\n\t\treturn itemContext.activeIndexSubscribe(update);\n\t}, [context.open, itemContext.listRef]);\n\tif (!layout) return null;\n\treturn /* @__PURE__ */ jsx(SelectIndicatorFrame, {\n\t\tref: forwardedRef,\n\t\t...props,\n\t\twidth: layout.width,\n\t\theight: layout.height,\n\t\tx: layout.x,\n\t\ty: layout.y\n\t});\n});\nvar GROUP_NAME = \"SelectGroup\";\nvar { Provider: SelectGroupContextProvider, useStyledContext: useSelectGroupContext } = createStyledContext({ id: \"\" }, \"SelectGroup\");\nvar SelectGroupFrame = styled(View, { displayName: GROUP_NAME });\nvar NativeSelect = styled(Text, {\n\tdisplayName: \"NativeSelect\",\n\trender: \"select\"\n});\nvar SelectGroup = createStyledHOC(SelectGroupFrame, function(props, forwardedRef) {\n\tvar { scope, ...groupProps } = props;\n\tvar groupId = React.useId();\n\tvar context = useSelectContext(scope);\n\tvar itemParentContext = useSelectItemParentContext(scope);\n\tvar StyledNativeSelect = React.useContext(SelectNativeComponentContext);\n\tvar nativeSelectRef = React.useRef(null);\n\tvar content = (function() {\n\t\tif (itemParentContext.shouldRenderWebNative) return /* @__PURE__ */ jsx(NativeSelect, {\n\t\t\t...StyledNativeSelect && {\n\t\t\t\trender: StyledNativeSelect,\n\t\t\t\tsize: itemParentContext.size,\n\t\t\t\tstyle: { appearance: \"none\" }\n\t\t\t},\n\t\t\t...groupProps,\n\t\t\tvalue: context.value,\n\t\t\tmultiple: context.mode === \"multiple\",\n\t\t\tname: itemParentContext.name,\n\t\t\tform: itemParentContext.form,\n\t\t\tid: itemParentContext.id,\n\t\t\tonChange: function(event) {\n\t\t\t\tvar value = context.mode === \"multiple\" ? Array.from(event.currentTarget.selectedOptions, function(option) {\n\t\t\t\t\treturn option.value;\n\t\t\t\t}) : event.currentTarget.value;\n\t\t\t\titemParentContext.changeNativeValue(value, event.nativeEvent);\n\t\t\t},\n\t\t\tref: nativeSelectRef,\n\t\t\tchildren: props.children\n\t\t});\n\t\treturn /* @__PURE__ */ jsx(SelectGroupFrame, {\n\t\t\trole: \"group\",\n\t\t\t\"aria-labelledby\": groupId,\n\t\t\t...groupProps,\n\t\t\tref: forwardedRef\n\t\t});\n\t})();\n\treturn /* @__PURE__ */ jsx(SelectGroupContextProvider, {\n\t\tscope,\n\t\tid: groupId || \"\",\n\t\tchildren: content\n\t});\n});\nSelectGroup.displayName = GROUP_NAME;\nvar SelectLabelFrame = styled(Text, { displayName: \"SelectLabel\" });\nvar SelectLabel = createStyledHOC(SelectLabelFrame, function(props, forwardedRef) {\n\tvar { scope, ...labelProps } = props;\n\tvar context = useSelectItemParentContext(scope);\n\tvar groupContext = useSelectGroupContext(scope);\n\tif (context.shouldRenderWebNative) return null;\n\treturn /* @__PURE__ */ jsx(SelectLabelFrame, {\n\t\trender: \"div\",\n\t\tid: groupContext.id,\n\t\t...labelProps,\n\t\tref: forwardedRef\n\t});\n});\nvar SelectSeparator = styled(View, { displayName: \"SelectSeparator\" });\nvar SelectSheetImpl = function(props) {\n\treturn /* @__PURE__ */ jsx(Fragment, { children: props.children });\n};\nfunction SelectRoot(props) {\n\tvar adaptScope = `AdaptSelect${props.scope || \"\"}`;\n\tvar [open, requestOpenChange] = useControllableState({\n\t\tprop: props.open,\n\t\tdefaultProp: props.defaultOpen || false,\n\t\tonChange: props.onOpenChange\n\t});\n\tvar handleAdaptOpenChange = React.useCallback(function(nextOpen) {\n\t\trequestOpenChange(nextOpen, createChangeEventDetails(nextOpen ? \"trigger-press\" : \"outside-press\"));\n\t}, [requestOpenChange]);\n\treturn /* @__PURE__ */ jsx(AdaptParent, {\n\t\tscope: adaptScope,\n\t\tadaptChildren: props.children,\n\t\topen,\n\t\tonOpenChange: handleAdaptOpenChange,\n\t\tchildren: /* @__PURE__ */ jsx(SelectInner, {\n\t\t\t...props,\n\t\t\tscope: props.scope,\n\t\t\tadaptScope,\n\t\t\topen,\n\t\t\trequestOpenChange\n\t\t})\n\t});\n}\nvar Select = withStaticProperties(SelectRoot, {\n\tRoot: SelectRoot,\n\tAdapt,\n\tContent: SelectContent,\n\tGroup: SelectGroup,\n\tIcon: SelectIcon,\n\tItem: SelectItem,\n\tItemIndicator: SelectItemIndicator,\n\tItemText: SelectItemText,\n\tLabel: SelectLabel,\n\tScrollDownButton: SelectScrollDownButton,\n\tScrollUpButton: SelectScrollUpButton,\n\tSeparator: SelectSeparator,\n\tTrigger: SelectTrigger,\n\tValue: SelectValue,\n\tViewport: SelectViewport,\n\tIndicator: SelectIndicator,\n\tFocusScope: FocusScopeController\n});\nfunction useEmitter() {\n\tvar listenersRef = React.useRef(/* @__PURE__ */ new Set());\n\treturn [React.useCallback(function(value) {\n\t\tlistenersRef.current.forEach(function(l) {\n\t\t\treturn l(value);\n\t\t});\n\t}, []), React.useCallback(function(listener) {\n\t\tlistenersRef.current.add(listener);\n\t\treturn function() {\n\t\t\tlistenersRef.current.delete(listener);\n\t\t};\n\t}, [])];\n}\nfunction SelectInner(props) {\n\tvar { scope = \"\", adaptScope, native, children, open, requestOpenChange, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, value: valueProp, defaultValue, onValueChange, multiple = false, name, form, disablePreventBodyScroll, size: sizeProp = true, onActiveChange, dir, id, renderValue, lazyMount, zIndex } = props;\n\tvar SelectImpl = useAdaptIsActive(adaptScope) ? SelectSheetImpl : SelectInlineImpl;\n\tvar mode = multiple ? \"multiple\" : \"single\";\n\tvar [valueState, requestValueChange] = useControllableState({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue !== null && defaultValue !== void 0 ? defaultValue : mode === \"multiple\" ? [] : \"\",\n\t\tonChange: onValueChange,\n\t\ttransition: true\n\t});\n\tvar value = React.useMemo(function() {\n\t\treturn mode === \"multiple\" ? selectedValuesFromSelection(mode, valueState) : typeof valueState === \"string\" ? valueState : \"\";\n\t}, [mode, valueState]);\n\tvar selectedValues = React.useMemo(function() {\n\t\treturn selectedValuesFromSelection(mode, value);\n\t}, [mode, value]);\n\tvar [, rerenderRegistry] = React.useReducer(function(version) {\n\t\treturn version + 1;\n\t}, 0);\n\tvar registryRef = React.useRef(null);\n\tif (!registryRef.current) registryRef.current = createSelectItemRegistry(rerenderRegistry);\n\tvar registry = registryRef.current;\n\tvar controllerRef = React.useRef(null);\n\tif (!controllerRef.current) controllerRef.current = createSelectSelectionController({\n\t\tmode,\n\t\tvalue,\n\t\tregistry\n\t});\n\tvar controller = controllerRef.current;\n\tcontroller.setMode(mode);\n\tcontroller.setValue(value);\n\tReact.useEffect(function() {\n\t\tif (!props.id) return;\n\t\treturn registerFocusable(props.id, {\n\t\t\tfocusAndSelect: function() {\n\t\t\t\trequestOpenChange(function(current) {\n\t\t\t\t\treturn !current;\n\t\t\t\t}, createChangeEventDetails(\"trigger-press\"));\n\t\t\t},\n\t\t\tfocus: function() {}\n\t\t});\n\t}, [props.id, requestOpenChange]);\n\tvar activeIndexRef = React.useRef(null);\n\tvar [emitActiveIndex, activeIndexSubscribe] = useEmitter();\n\tvar selectedIndexRef = React.useRef(null);\n\tvar lastPointerRef = React.useRef({\n\t\tx: -1,\n\t\ty: -1\n\t});\n\tvar listContentRef = React.useRef([]);\n\tvar listRef = React.useRef([]);\n\tvar [valueNode, setValueNode] = React.useState(null);\n\tvar selectedIndex = Math.max(0, controller.selectionAnchorIndex());\n\tlistContentRef.current = registry.getTypeaheadLabels();\n\tvar itemNodes = registry.getNodes();\n\tlistRef.current.length = itemNodes.length;\n\tfor (var i = 0; i < itemNodes.length; i++) listRef.current[i] = itemNodes[i];\n\tuseIsomorphicLayoutEffect(function() {\n\t\tselectedIndexRef.current = selectedIndex;\n\t});\n\tvar shouldRenderWebNative = isWeb && (native === true || native === \"web\" || Array.isArray(native) && native.includes(\"web\"));\n\tvar setActiveIndex = React.useCallback(function(index, details) {\n\t\tif (activeIndexRef.current === index) return;\n\t\tactiveIndexRef.current = index;\n\t\tcontroller.setActiveIndex(index);\n\t\temitActiveIndex(index);\n\t\tif (typeof index === \"number\") {\n\t\t\tvar item = registry.getItems()[index];\n\t\t\tif (item && details) onActiveChange === null || onActiveChange === void 0 || onActiveChange(item.value, details);\n\t\t}\n\t}, [\n\t\tcontroller,\n\t\temitActiveIndex,\n\t\tonActiveChange,\n\t\tregistry\n\t]);\n\tvar activeDetails = React.useCallback(function(reason, index, event) {\n\t\treturn {\n\t\t\treason,\n\t\t\tevent,\n\t\t\ttrigger: void 0,\n\t\t\tindex\n\t\t};\n\t}, []);\n\tvar moveActive = React.useCallback(function(direction, event) {\n\t\tvar nextIndex = registry.nextEnabledIndex(activeIndexRef.current, direction);\n\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"keyboard\", nextIndex, event));\n\t}, [\n\t\tactiveDetails,\n\t\tregistry,\n\t\tsetActiveIndex\n\t]);\n\tvar typeaheadRef = React.useRef({\n\t\ttext: \"\",\n\t\ttimeout: null\n\t});\n\tvar search = React.useCallback(function(text, event) {\n\t\tclearTimeout(typeaheadRef.current.timeout);\n\t\ttypeaheadRef.current.text += text;\n\t\tvar nextIndex = registry.findTypeaheadIndex(typeaheadRef.current.text, activeIndexRef.current);\n\t\tif (nextIndex < 0 && typeaheadRef.current.text.length > 1) {\n\t\t\ttypeaheadRef.current.text = text;\n\t\t\tnextIndex = registry.findTypeaheadIndex(text, activeIndexRef.current);\n\t\t}\n\t\ttypeaheadRef.current.timeout = setTimeout(function() {\n\t\t\ttypeaheadRef.current.text = \"\";\n\t\t}, 750);\n\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"keyboard\", nextIndex, event));\n\t}, [\n\t\tactiveDetails,\n\t\tregistry,\n\t\tsetActiveIndex\n\t]);\n\tReact.useEffect(function() {\n\t\treturn function() {\n\t\t\treturn clearTimeout(typeaheadRef.current.timeout);\n\t\t};\n\t}, []);\n\tReact.useEffect(function() {\n\t\tif (open) {\n\t\t\tvar nextIndex = controller.initialActiveIndex();\n\t\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"list-navigation\", nextIndex));\n\t\t} else setActiveIndex(null);\n\t}, [\n\t\topen,\n\t\tselectedIndex,\n\t\tregistry.getItems().length\n\t]);\n\tvar content = /* @__PURE__ */ jsxs(SelectItemParentProvider, {\n\t\tscopeName: scope,\n\t\tscope,\n\t\tadaptScope,\n\t\tmode,\n\t\tselectedValues,\n\t\tregistry,\n\t\tsize: sizeProp,\n\t\tactiveIndexSubscribe,\n\t\tactiveIndexRef,\n\t\trequestOpenChange,\n\t\tid,\n\t\tname,\n\t\tform,\n\t\tselectValue: React.useCallback(function(nextItemValue, details) {\n\t\t\tvar item = registry.getItem(nextItemValue);\n\t\t\tif (!item || item.disabled) return;\n\t\t\tcontroller.setMode(mode);\n\t\t\tcontroller.setValue(value);\n\t\t\tvar previousValue = controller.value;\n\t\t\trequestValueChange(controller.toggle(nextItemValue), details);\n\t\t\tif (details.isCanceled) {\n\t\t\t\tcontroller.setValue(previousValue);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (controller.shouldCloseOnSelect) requestOpenChange(false, createChangeEventDetails(details.reason === \"keyboard\" ? \"keyboard\" : \"item-press\", details.event, details.trigger));\n\t\t}, [\n\t\t\tcontroller,\n\t\t\tmode,\n\t\t\tregistry,\n\t\t\trequestOpenChange,\n\t\t\trequestValueChange,\n\t\t\tvalue\n\t\t]),\n\t\tchangeNativeValue: React.useCallback(function(nextValue, event) {\n\t\t\tvar details = createChangeEventDetails(\"native-change\", event);\n\t\t\trequestValueChange(nextValue, details);\n\t\t\tif (!details.isCanceled) controller.setValue(nextValue);\n\t\t}, [controller, requestValueChange]),\n\t\tshouldRenderWebNative,\n\t\tsetActiveIndex,\n\t\tselectedIndex,\n\t\tlastPointerRef,\n\t\tlistRef,\n\t\tmoveActive,\n\t\tsearch,\n\t\tchildren: [/* @__PURE__ */ jsx(SelectProvider, {\n\t\t\tscope,\n\t\t\tscopeName: scope,\n\t\t\tadaptScope,\n\t\t\tdisablePreventBodyScroll,\n\t\t\tdir,\n\t\t\tblockSelection: false,\n\t\t\tfallback: false,\n\t\t\tvalueNode,\n\t\t\tonValueNodeChange: setValueNode,\n\t\t\tactiveIndexRef,\n\t\t\tselectedIndex,\n\t\t\tsetActiveIndex,\n\t\t\tvalue,\n\t\t\tmode,\n\t\t\tselectedValues,\n\t\t\topen,\n\t\t\tnative,\n\t\t\trenderValue,\n\t\t\tlazyMount,\n\t\t\tchildren: shouldRenderWebNative ? children : /* @__PURE__ */ jsx(SelectImpl, {\n\t\t\t\tactiveIndexRef,\n\t\t\t\tlistContentRef,\n\t\t\t\tselectedIndexRef,\n\t\t\t\t...props,\n\t\t\t\topen,\n\t\t\t\tvalue,\n\t\t\t\tchildren\n\t\t\t})\n\t\t}), isWeb && !shouldRenderWebNative && name ? (mode === \"multiple\" ? selectedValues : [value]).map(function(inputValue) {\n\t\t\treturn /* @__PURE__ */ jsx(\"input\", {\n\t\t\t\ttype: \"hidden\",\n\t\t\t\tname,\n\t\t\t\tform,\n\t\t\t\tvalue: inputValue\n\t\t\t}, inputValue);\n\t\t}) : null]\n\t});\n\tif (zIndex !== void 0) return /* @__PURE__ */ jsx(SelectZIndexContext.Provider, {\n\t\tvalue: zIndex,\n\t\tchildren: content\n\t});\n\treturn content;\n}\n\nexport { Select, SelectGroup, SelectGroupFrame, SelectIcon, SelectIndicator, SelectIndicatorFrame, SelectItemIndicator, SelectItemIndic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mB,WAAW,OAAO,aAAa,GAAG,OAAO;GAC5D,IAAI,QAAQ,YAAY;IACvB,WAAW,SAAS,aAAa;IACjC;GACD;GACA,IAAI,WAAW,qBAAqB,kBAAkB,OAAO,yBAAyB,QAAQ,WAAW,aAAa,aAAa,cAAc,QAAQ,OAAO,QAAQ,OAAO,CAAC;EACjL,GAAG;GACF;GACA;GACA;GACA;GACA;GACA;EACD,CAAC;EACD,mBAAmB,MAAM,YAAY,SAAS,WAAW,OAAO;GAC/D,IAAI,UAAU,yBAAyB,iBAAiB,KAAK;GAC7D,mBAAmB,WAAW,OAAO;GACrC,IAAI,CAAC,QAAQ,YAAY,WAAW,SAAS,SAAS;EACvD,GAAG,CAAC,YAAY,kBAAkB,CAAC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU,CAAiB,oBAAI,gBAAgB;GAC9C;GACA,WAAW;GACX;GACA;GACA;GACA,gBAAgB;GAChB,UAAU;GACV;GACA,mBAAmB;GACnB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,UAAU,wBAAwB,WAA2B,oBAAI,YAAY;IAC5E;IACA;IACA;IACA,GAAG;IACH;IACA;IACA;GACD,CAAC;EACF,CAAC,GAAG,SAAS,CAAC,yBAAyB,QAAQ,SAAS,aAAa,iBAAiB,CAAC,KAAK,EAAC,CAAE,IAAI,SAAS,YAAY;GACvH,OAAuB,oBAAI,SAAS;IACnC,MAAM;IACN;IACA;IACA,OAAO;GACR,GAAG,UAAU;EACd,CAAC,IAAI,IAAI;CACV,CAAC;CACD,IAAI,WAAW,KAAK,GAAG,OAAuB,oBAAI,oBAAoB,UAAU;EAC/E,OAAO;EACP,UAAU;CACX,CAAC;CACD,OAAO;AACR"}
1
+ {"version":3,"file":"Select.native.js","names":[],"sources":["esm/Select.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { Adapt, AdaptParent, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { Text, View, createChangeEventDetails, createStyledContext, createStyledHOC, styled } from \"@tamagui/core\";\nimport { FocusScopeController } from \"@tamagui/focus-scope\";\nimport { registerFocusable } from \"@tamagui/focusable\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport * as React from \"react\";\nimport { SelectItemParentProvider, SelectNativeComponentContext, SelectProvider, SelectZIndexContext, useSelectContext, useSelectItemParentContext } from \"./context\";\nimport { SelectContent } from \"./SelectContent\";\nimport { SelectInlineImpl } from \"./SelectImpl\";\nimport { SelectItem, useSelectItemContext } from \"./SelectItem\";\nimport { SelectItemText } from \"./SelectItemText\";\nimport { SelectScrollDownButton, SelectScrollUpButton } from \"./SelectScrollButton\";\nimport { SelectTrigger } from \"./SelectTrigger\";\nimport { SelectViewport } from \"./SelectViewport\";\nimport { createSelectItemRegistry, createSelectSelectionController, selectedValuesFromSelection } from \"./selectionController\";\n\nvar SelectValueFrame = styled(Text, { displayName: \"SelectValue\" });\nvar SelectValue = createStyledHOC(SelectValueFrame, function SelectValue2(param, forwardedRef) {\n\tvar { scope, children: childrenProp, placeholder, ...props } = param;\n\tvar _ref;\n\tvar _itemParentContext_registry_getItem;\n\tvar context = useSelectContext(scope);\n\tvar itemParentContext = useSelectItemParentContext(scope);\n\tvar composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n\tvar isEmptyValue = context.selectedValues.length === 0;\n\tvar [, rerender] = React.useReducer(function(version) {\n\t\treturn version + 1;\n\t}, 0);\n\tuseIsomorphicLayoutEffect(function() {\n\t\treturn itemParentContext.registry.subscribe(rerender);\n\t}, [itemParentContext.registry]);\n\tvar registeredValue = context.mode === \"multiple\" ? context.selectedValues.map(function(value, index) {\n\t\tvar _ref2;\n\t\tvar _itemParentContext_registry_getItem2;\n\t\treturn /* @__PURE__ */ jsxs(React.Fragment, { children: [index > 0 ? \", \" : null, (_ref2 = (_itemParentContext_registry_getItem2 = itemParentContext.registry.getItem(value)) === null || _itemParentContext_registry_getItem2 === void 0 ? void 0 : _itemParentContext_registry_getItem2.label) !== null && _ref2 !== void 0 ? _ref2 : value] }, value);\n\t}) : (_ref = (_itemParentContext_registry_getItem = itemParentContext.registry.getItem(context.selectedValues[0])) === null || _itemParentContext_registry_getItem === void 0 ? void 0 : _itemParentContext_registry_getItem.label) !== null && _ref !== void 0 ? _ref : context.value;\n\tvar children = childrenProp !== void 0 ? childrenProp : context.renderValue ? context.renderValue(context.value) : registeredValue;\n\tvar selectValueChildren = isEmptyValue ? placeholder !== null && placeholder !== void 0 ? placeholder : children : children;\n\treturn /* @__PURE__ */ jsx(SelectValueFrame, {\n\t\tpointerEvents: \"none\",\n\t\tref: composedRefs,\n\t\t...props,\n\t\tchildren: selectValueChildren\n\t});\n});\nvar SelectIcon = styled(View, {\n\tdisplayName: \"SelectIcon\",\n\t\"aria-hidden\": true\n});\nvar SelectItemIndicatorFrame = styled(View, { displayName: \"SelectItemIndicator\" });\nvar SelectItemIndicator = createStyledHOC(SelectItemIndicatorFrame, function SelectItemIndicator2(props, forwardedRef) {\n\tvar { scope, ...itemIndicatorProps } = props;\n\tvar context = useSelectItemParentContext(scope);\n\tvar itemContext = useSelectItemContext(scope);\n\tif (context.shouldRenderWebNative) return null;\n\treturn itemContext.isSelected ? /* @__PURE__ */ jsx(SelectItemIndicatorFrame, {\n\t\t\"aria-hidden\": true,\n\t\t...itemIndicatorProps,\n\t\tref: forwardedRef\n\t}) : null;\n});\nvar SelectIndicatorFrame = styled(View, {\n\tdisplayName: \"SelectIndicator\",\n\tposition: \"absolute\",\n\ttop: 0,\n\tleft: 0,\n\tpointerEvents: \"none\",\n\tzIndex: 10\n});\nvar SelectIndicator = createStyledHOC(SelectIndicatorFrame, function SelectIndicator2(param, forwardedRef) {\n\tvar { scope, ...props } = param;\n\tvar itemContext = useSelectItemParentContext(scope);\n\tvar context = useSelectContext(scope);\n\tvar [layout, setLayout] = React.useState(null);\n\tvar rafRef = React.useRef(0);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tvar update = function update2(index) {\n\t\t\tif (typeof index !== \"number\") return;\n\t\t\tcancelAnimationFrame(rafRef.current);\n\t\t\trafRef.current = requestAnimationFrame(function() {\n\t\t\t\tvar _itemContext_listRef_current, _itemContext_listRef;\n\t\t\t\tvar node = (_itemContext_listRef = itemContext.listRef) === null || _itemContext_listRef === void 0 ? void 0 : (_itemContext_listRef_current = _itemContext_listRef.current) === null || _itemContext_listRef_current === void 0 ? void 0 : _itemContext_listRef_current[index];\n\t\t\t\tif (node) setLayout({\n\t\t\t\t\twidth: Math.round(node.offsetWidth),\n\t\t\t\t\theight: Math.round(node.offsetHeight),\n\t\t\t\t\tx: Math.round(node.offsetLeft),\n\t\t\t\t\ty: Math.round(node.offsetTop)\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\t\tif (context.open && context.activeIndexRef.current !== null) update(context.activeIndexRef.current);\n\t\treturn itemContext.activeIndexSubscribe(update);\n\t}, [context.open, itemContext.listRef]);\n\tif (!layout) return null;\n\treturn /* @__PURE__ */ jsx(SelectIndicatorFrame, {\n\t\tref: forwardedRef,\n\t\t...props,\n\t\twidth: layout.width,\n\t\theight: layout.height,\n\t\tx: layout.x,\n\t\ty: layout.y\n\t});\n});\nvar GROUP_NAME = \"SelectGroup\";\nvar { Provider: SelectGroupContextProvider, useStyledContext: useSelectGroupContext } = createStyledContext({ id: \"\" }, \"SelectGroup\");\nvar SelectGroupFrame = styled(View, { displayName: GROUP_NAME });\nvar NativeSelect = styled(Text, {\n\tdisplayName: \"NativeSelect\",\n\trender: \"select\"\n});\nvar SelectGroup = createStyledHOC(SelectGroupFrame, function(props, forwardedRef) {\n\tvar { scope, ...groupProps } = props;\n\tvar groupId = React.useId();\n\tvar context = useSelectContext(scope);\n\tvar itemParentContext = useSelectItemParentContext(scope);\n\tvar StyledNativeSelect = React.useContext(SelectNativeComponentContext);\n\tvar nativeSelectRef = React.useRef(null);\n\tvar content = (function() {\n\t\tif (itemParentContext.shouldRenderWebNative) return /* @__PURE__ */ jsx(NativeSelect, {\n\t\t\t...StyledNativeSelect && {\n\t\t\t\trender: StyledNativeSelect,\n\t\t\t\tsize: itemParentContext.size,\n\t\t\t\tstyle: { appearance: \"none\" }\n\t\t\t},\n\t\t\t...groupProps,\n\t\t\tvalue: context.value,\n\t\t\tmultiple: context.mode === \"multiple\",\n\t\t\tname: itemParentContext.name,\n\t\t\tform: itemParentContext.form,\n\t\t\tid: itemParentContext.id,\n\t\t\tonChange: function onChange(event) {\n\t\t\t\tvar value = context.mode === \"multiple\" ? Array.from(event.currentTarget.selectedOptions, function(option) {\n\t\t\t\t\treturn option.value;\n\t\t\t\t}) : event.currentTarget.value;\n\t\t\t\titemParentContext.changeNativeValue(value, event.nativeEvent);\n\t\t\t},\n\t\t\tref: nativeSelectRef,\n\t\t\tchildren: props.children\n\t\t});\n\t\treturn /* @__PURE__ */ jsx(SelectGroupFrame, {\n\t\t\trole: \"group\",\n\t\t\t\"aria-labelledby\": groupId,\n\t\t\t...groupProps,\n\t\t\tref: forwardedRef\n\t\t});\n\t})();\n\treturn /* @__PURE__ */ jsx(SelectGroupContextProvider, {\n\t\tscope,\n\t\tid: groupId || \"\",\n\t\tchildren: content\n\t});\n});\nSelectGroup.displayName = GROUP_NAME;\nvar SelectLabelFrame = styled(Text, { displayName: \"SelectLabel\" });\nvar SelectLabel = createStyledHOC(SelectLabelFrame, function(props, forwardedRef) {\n\tvar { scope, ...labelProps } = props;\n\tvar context = useSelectItemParentContext(scope);\n\tvar groupContext = useSelectGroupContext(scope);\n\tif (context.shouldRenderWebNative) return null;\n\treturn /* @__PURE__ */ jsx(SelectLabelFrame, {\n\t\trender: \"div\",\n\t\tid: groupContext.id,\n\t\t...labelProps,\n\t\tref: forwardedRef\n\t});\n});\nvar SelectSeparator = styled(View, { displayName: \"SelectSeparator\" });\nvar SelectSheetImpl = function SelectSheetImpl2(props) {\n\treturn /* @__PURE__ */ jsx(Fragment, { children: props.children });\n};\nfunction SelectRoot(props) {\n\tvar adaptScope = `AdaptSelect${props.scope || \"\"}`;\n\tvar [open, requestOpenChange] = useControllableState({\n\t\tprop: props.open,\n\t\tdefaultProp: props.defaultOpen || false,\n\t\tonChange: props.onOpenChange\n\t});\n\tvar handleAdaptOpenChange = React.useCallback(function(nextOpen) {\n\t\trequestOpenChange(nextOpen, createChangeEventDetails(nextOpen ? \"trigger-press\" : \"outside-press\"));\n\t}, [requestOpenChange]);\n\treturn /* @__PURE__ */ jsx(AdaptParent, {\n\t\tscope: adaptScope,\n\t\tadaptChildren: props.children,\n\t\topen,\n\t\tonOpenChange: handleAdaptOpenChange,\n\t\tchildren: /* @__PURE__ */ jsx(SelectInner, {\n\t\t\t...props,\n\t\t\tscope: props.scope,\n\t\t\tadaptScope,\n\t\t\topen,\n\t\t\trequestOpenChange\n\t\t})\n\t});\n}\nvar Select = withStaticProperties(SelectRoot, {\n\tRoot: SelectRoot,\n\tAdapt,\n\tContent: SelectContent,\n\tGroup: SelectGroup,\n\tIcon: SelectIcon,\n\tItem: SelectItem,\n\tItemIndicator: SelectItemIndicator,\n\tItemText: SelectItemText,\n\tLabel: SelectLabel,\n\tScrollDownButton: SelectScrollDownButton,\n\tScrollUpButton: SelectScrollUpButton,\n\tSeparator: SelectSeparator,\n\tTrigger: SelectTrigger,\n\tValue: SelectValue,\n\tViewport: SelectViewport,\n\tIndicator: SelectIndicator,\n\tFocusScope: FocusScopeController\n});\nfunction useEmitter() {\n\tvar listenersRef = React.useRef(/* @__PURE__ */ new Set());\n\treturn [React.useCallback(function(value) {\n\t\tlistenersRef.current.forEach(function(l) {\n\t\t\treturn l(value);\n\t\t});\n\t}, []), React.useCallback(function(listener) {\n\t\tlistenersRef.current.add(listener);\n\t\treturn function() {\n\t\t\tlistenersRef.current.delete(listener);\n\t\t};\n\t}, [])];\n}\nfunction SelectInner(props) {\n\tvar { scope = \"\", adaptScope, native, children, open, requestOpenChange, defaultOpen: _defaultOpen, onOpenChange: _onOpenChange, value: valueProp, defaultValue, onValueChange, multiple = false, name, form, disablePreventBodyScroll, size: sizeProp = true, onActiveChange, dir, id, renderValue, lazyMount, zIndex } = props;\n\tvar SelectImpl = useAdaptIsActive(adaptScope) ? SelectSheetImpl : SelectInlineImpl;\n\tvar mode = multiple ? \"multiple\" : \"single\";\n\tvar [valueState, requestValueChange] = useControllableState({\n\t\tprop: valueProp,\n\t\tdefaultProp: defaultValue !== null && defaultValue !== void 0 ? defaultValue : mode === \"multiple\" ? [] : \"\",\n\t\tonChange: onValueChange,\n\t\ttransition: true\n\t});\n\tvar value = React.useMemo(function() {\n\t\treturn mode === \"multiple\" ? selectedValuesFromSelection(mode, valueState) : typeof valueState === \"string\" ? valueState : \"\";\n\t}, [mode, valueState]);\n\tvar selectedValues = React.useMemo(function() {\n\t\treturn selectedValuesFromSelection(mode, value);\n\t}, [mode, value]);\n\tvar [, rerenderRegistry] = React.useReducer(function(version) {\n\t\treturn version + 1;\n\t}, 0);\n\tvar registryRef = React.useRef(null);\n\tif (!registryRef.current) registryRef.current = createSelectItemRegistry(rerenderRegistry);\n\tvar registry = registryRef.current;\n\tvar controllerRef = React.useRef(null);\n\tif (!controllerRef.current) controllerRef.current = createSelectSelectionController({\n\t\tmode,\n\t\tvalue,\n\t\tregistry\n\t});\n\tvar controller = controllerRef.current;\n\tcontroller.setMode(mode);\n\tcontroller.setValue(value);\n\tReact.useEffect(function() {\n\t\tif (!props.id) return;\n\t\treturn registerFocusable(props.id, {\n\t\t\tfocusAndSelect: function focusAndSelect() {\n\t\t\t\trequestOpenChange(function(current) {\n\t\t\t\t\treturn !current;\n\t\t\t\t}, createChangeEventDetails(\"trigger-press\"));\n\t\t\t},\n\t\t\tfocus: function focus() {}\n\t\t});\n\t}, [props.id, requestOpenChange]);\n\tvar activeIndexRef = React.useRef(null);\n\tvar [emitActiveIndex, activeIndexSubscribe] = useEmitter();\n\tvar selectedIndexRef = React.useRef(null);\n\tvar lastPointerRef = React.useRef({\n\t\tx: -1,\n\t\ty: -1\n\t});\n\tvar listContentRef = React.useRef([]);\n\tvar listRef = React.useRef([]);\n\tvar [valueNode, setValueNode] = React.useState(null);\n\tvar selectedIndex = Math.max(0, controller.selectionAnchorIndex());\n\tlistContentRef.current = registry.getTypeaheadLabels();\n\tvar itemNodes = registry.getNodes();\n\tlistRef.current.length = itemNodes.length;\n\tfor (var i = 0; i < itemNodes.length; i++) listRef.current[i] = itemNodes[i];\n\tuseIsomorphicLayoutEffect(function() {\n\t\tselectedIndexRef.current = selectedIndex;\n\t});\n\tvar shouldRenderWebNative = isWeb && (native === true || native === \"web\" || Array.isArray(native) && native.includes(\"web\"));\n\tvar setActiveIndex = React.useCallback(function(index, details) {\n\t\tif (activeIndexRef.current === index) return;\n\t\tactiveIndexRef.current = index;\n\t\tcontroller.setActiveIndex(index);\n\t\temitActiveIndex(index);\n\t\tif (typeof index === \"number\") {\n\t\t\tvar item = registry.getItems()[index];\n\t\t\tif (item && details) onActiveChange === null || onActiveChange === void 0 || onActiveChange(item.value, details);\n\t\t}\n\t}, [\n\t\tcontroller,\n\t\temitActiveIndex,\n\t\tonActiveChange,\n\t\tregistry\n\t]);\n\tvar activeDetails = React.useCallback(function(reason, index, event) {\n\t\treturn {\n\t\t\treason,\n\t\t\tevent,\n\t\t\ttrigger: void 0,\n\t\t\tindex\n\t\t};\n\t}, []);\n\tvar moveActive = React.useCallback(function(direction, event) {\n\t\tvar nextIndex = registry.nextEnabledIndex(activeIndexRef.current, direction);\n\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"keyboard\", nextIndex, event));\n\t}, [\n\t\tactiveDetails,\n\t\tregistry,\n\t\tsetActiveIndex\n\t]);\n\tvar typeaheadRef = React.useRef({\n\t\ttext: \"\",\n\t\ttimeout: null\n\t});\n\tvar search = React.useCallback(function(text, event) {\n\t\tclearTimeout(typeaheadRef.current.timeout);\n\t\ttypeaheadRef.current.text += text;\n\t\tvar nextIndex = registry.findTypeaheadIndex(typeaheadRef.current.text, activeIndexRef.current);\n\t\tif (nextIndex < 0 && typeaheadRef.current.text.length > 1) {\n\t\t\ttypeaheadRef.current.text = text;\n\t\t\tnextIndex = registry.findTypeaheadIndex(text, activeIndexRef.current);\n\t\t}\n\t\ttypeaheadRef.current.timeout = setTimeout(function() {\n\t\t\ttypeaheadRef.current.text = \"\";\n\t\t}, 750);\n\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"keyboard\", nextIndex, event));\n\t}, [\n\t\tactiveDetails,\n\t\tregistry,\n\t\tsetActiveIndex\n\t]);\n\tReact.useEffect(function() {\n\t\treturn function() {\n\t\t\treturn clearTimeout(typeaheadRef.current.timeout);\n\t\t};\n\t}, []);\n\tReact.useEffect(function() {\n\t\tif (open) {\n\t\t\tvar nextIndex = controller.initialActiveIndex();\n\t\t\tif (nextIndex >= 0) setActiveIndex(nextIndex, activeDetails(\"list-navigation\", nextIndex));\n\t\t} else setActiveIndex(null);\n\t}, [\n\t\topen,\n\t\tselectedIndex,\n\t\tregistry.getItems().length\n\t]);\n\tvar content = /* @__PURE__ */ jsxs(SelectItemParentProvider, {\n\t\tscopeName: scope,\n\t\tscope,\n\t\tadaptScope,\n\t\tmode,\n\t\tselectedValues,\n\t\tregistry,\n\t\tsize: sizeProp,\n\t\tactiveIndexSubscribe,\n\t\tactiveIndexRef,\n\t\trequestOpenChange,\n\t\tid,\n\t\tname,\n\t\tform,\n\t\tselectValue: React.useCallback(function(nextItemValue, details) {\n\t\t\tvar item = registry.getItem(nextItemValue);\n\t\t\tif (!item || item.disabled) return;\n\t\t\tcontroller.setMode(mode);\n\t\t\tcontroller.setValue(value);\n\t\t\tvar previousValue = controller.value;\n\t\t\trequestValueChange(controller.toggle(nextItemValue), details);\n\t\t\tif (details.isCanceled) {\n\t\t\t\tcontroller.setValue(previousValue);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (controller.shouldCloseOnSelect) requestOpenChange(false, createChangeEventDetails(details.reason === \"keyboard\" ? \"keyboard\" : \"item-press\", details.event, details.trigger));\n\t\t}, [\n\t\t\tcontroller,\n\t\t\tmode,\n\t\t\tregistry,\n\t\t\trequestOpenChange,\n\t\t\trequestValueChange,\n\t\t\tvalue\n\t\t]),\n\t\tchangeNativeValue: React.useCallback(function(nextValue, event) {\n\t\t\tvar details = createChangeEventDetails(\"native-change\", event);\n\t\t\trequestValueChange(nextValue, details);\n\t\t\tif (!details.isCanceled) controller.setValue(nextValue);\n\t\t}, [controller, requestValueChange]),\n\t\tshouldRenderWebNative,\n\t\tsetActiveIndex,\n\t\tselectedIndex,\n\t\tlastPointerRef,\n\t\tlistRef,\n\t\tmoveActive,\n\t\tsearch,\n\t\tchildren: [/* @__PURE__ */ jsx(SelectProvider, {\n\t\t\tscope,\n\t\t\tscopeName: scope,\n\t\t\tadaptScope,\n\t\t\tdisablePreventBodyScroll,\n\t\t\tdir,\n\t\t\tblockSelection: false,\n\t\t\tfallback: false,\n\t\t\tvalueNode,\n\t\t\tonValueNodeChange: setValueNode,\n\t\t\tactiveIndexRef,\n\t\t\tselectedIndex,\n\t\t\tsetActiveIndex,\n\t\t\tvalue,\n\t\t\tmode,\n\t\t\tselectedValues,\n\t\t\topen,\n\t\t\tnative,\n\t\t\trenderValue,\n\t\t\tlazyMount,\n\t\t\tchildren: shouldRenderWebNative ? children : /* @__PURE__ */ jsx(SelectImpl, {\n\t\t\t\tactiveIndexRef,\n\t\t\t\tlistContentRef,\n\t\t\t\tselectedIndexRef,\n\t\t\t\t...props,\n\t\t\t\topen,\n\t\t\t\tvalue,\n\t\t\t\tchildren\n\t\t\t})\n\t\t}), isWeb && !shouldRenderWebNative && name ? (mode === \"multiple\" ? selectedValues : [value]).map(function(inputValue) {\n\t\t\treturn /* @__PURE__ */ jsx(\"input\", {\n\t\t\t\ttype: \"hidden\",\n\t\t\t\tname,\n\t\t\t\tform,\n\t\t\t\tvalue: inputValue\n\t\t\t}, inputValue);\n\t\t}) : null]\n\t});\n\tif (zIndex !== void 0) return /* @__PURE__ */ jsx(SelectZIndexContext.Provider, {\n\t\tvalue: zIndex,\n\t\tchildren: content\n\t});\n\treturn content;\n}\n\nexport { Select, SelectGroup, SelectGroupFrame, SelectIcon, SelectIndicator, SelectIndicatorFrame, SelectItemIndicator, SelectItemIndicatorFrame, SelectLabel, SelectLabelFrame, SelectRoot, SelectSeparator, SelectValue, SelectValueFrame };"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI,mBAAmB,OAAO,MAAM,EAAE,aAAa,cAAc,CAAC;AAClE,IAAI,cAAc,gBAAgB,kBAAkB,SAAS,aAAa,OAAO,cAAc;CAC9F,IAAI,EAAE,OAAO,UAAU,cAAc,aAAa,GAAG,UAAU;CAC/D,IAAI;CACJ,IAAI;CACJ,IAAI,UAAU,iBAAiB,KAAK;CACpC,IAAI,oBAAoB,2BAA2B,KAAK;CACxD,IAAI,eAAe,gBAAgB,cAAc,QAAQ,iBAAiB;CAC1E,IAAI,eAAe,QAAQ,eAAe,WAAW;CACrD,IAAI,GAAG,YAAY,MAAM,WAAW,SAAS,SAAS;EACrD,OAAO,UAAU;CAClB,GAAG,CAAC;CACJ,0BAA0B,WAAW;EACpC,OAAO,kBAAkB,SAAS,UAAU,QAAQ;CACrD,GAAG,CAAC,kBAAkB,QAAQ,CAAC;CAC/B,IAAI,kBAAkB,QAAQ,SAAS,aAAa,QAAQ,eAAe,IAAI,SAAS,OAAO,OAAO;EACrG,IAAI;EACJ,IAAI;EACJ,OAAuB,qBAAK,MAAM,UAAU,EAAE,UAAU,CAAC,QAAQ,IAAI,OAAO,OAAO,SAAS,uCAAuC,kBAAkB,SAAS,QAAQ,KAAK,OAAO,QAAQ,yCAAyC,KAAK,IAAI,KAAK,IAAI,qCAAqC,WAAW,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK,EAAE,GAAG,KAAK;CACxV,CAAC,KAAK,QAAQ,sCAAsC,kBAAkB,SA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,OAAuB,oBAAI,oBAAoB,UAAU;EAC/E,OAAO;EACP,UAAU;CACX,CAAC;CACD,OAAO;AACR"}
@@ -1,4 +1,4 @@
1
- var SelectContent = function(param) {
1
+ var SelectContent = function SelectContent2(param) {
2
2
  var { children } = param;
3
3
  return children;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SelectContent.native.js","names":[],"sources":["esm/SelectContent.native.js"],"sourcesContent":["var SelectContent = function(param) {\n var { children } = param;\n return children;\n};\nexport {\n SelectContent\n};\n//# sourceMappingURL=SelectContent.native.js.map\n"],"mappings":";AAAA,IAAI,gBAAgB,SAAS,OAAO;CAClC,IAAI,EAAE,aAAa;CACnB,OAAO;AACT"}
1
+ {"version":3,"file":"SelectContent.native.js","names":[],"sources":["esm/SelectContent.native.js"],"sourcesContent":["var SelectContent = function SelectContent2(param) {\n var { children } = param;\n return children;\n};\nexport {\n SelectContent\n};\n//# sourceMappingURL=SelectContent.native.js.map\n"],"mappings":";AAAA,IAAI,gBAAgB,SAAS,eAAe,OAAO;CACjD,IAAI,EAAE,aAAa;CACnB,OAAO;AACT"}
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx } from "react/jsx-runtime";
2
2
 
3
- var SelectInlineImpl = function(props) {
3
+ var SelectInlineImpl = function SelectInlineImpl2(props) {
4
4
  return /* @__PURE__ */ jsx(Fragment, { children: props.children });
5
5
  };
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"SelectImpl.native.js","names":["_Fragment"],"sources":["esm/SelectImpl.native.js"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nvar SelectInlineImpl = function(props) {\n return /* @__PURE__ */ _jsx(_Fragment, {\n children: props.children\n });\n};\nexport {\n SelectInlineImpl\n};\n//# sourceMappingURL=SelectImpl.native.js.map\n"],"mappings":";;;AACA,IAAI,mBAAmB,SAAS,OAAO;CACrC,OAAuB,oBAAKA,UAAW,EACrC,UAAU,MAAM,SAClB,CAAC;AACH"}
1
+ {"version":3,"file":"SelectImpl.native.js","names":["_Fragment"],"sources":["esm/SelectImpl.native.js"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nvar SelectInlineImpl = function SelectInlineImpl2(props) {\n return /* @__PURE__ */ _jsx(_Fragment, {\n children: props.children\n });\n};\nexport {\n SelectInlineImpl\n};\n//# sourceMappingURL=SelectImpl.native.js.map\n"],"mappings":";;;AACA,IAAI,mBAAmB,SAAS,kBAAkB,OAAO;CACvD,OAAuB,oBAAKA,UAAW,EACrC,UAAU,MAAM,SAClB,CAAC;AACH"}
@@ -58,7 +58,8 @@ var SelectItem = createStyledHOC(SelectItemFrame, function SelectItem2(props, fo
58
58
  var [isActive, setIsActive] = React.useState(false);
59
59
  var isActiveRef = React.useRef(false);
60
60
  React.useEffect(function() {
61
- var handleActiveIndex = function(i) {
61
+ var _ref;
62
+ var handleActiveIndex = function handleActiveIndex2(i) {
62
63
  var next = i != null && registry.getIndex(value) === i;
63
64
  if (next !== isActiveRef.current) {
64
65
  isActiveRef.current = next;
@@ -71,8 +72,7 @@ var SelectItem = createStyledHOC(SelectItemFrame, function SelectItem2(props, fo
71
72
  });
72
73
  }
73
74
  };
74
- var _activeIndexRef_current;
75
- handleActiveIndex((_activeIndexRef_current = activeIndexRef === null || activeIndexRef === void 0 ? void 0 : activeIndexRef.current) !== null && _activeIndexRef_current !== void 0 ? _activeIndexRef_current : null);
75
+ handleActiveIndex((_ref = activeIndexRef === null || activeIndexRef === void 0 ? void 0 : activeIndexRef.current) !== null && _ref !== void 0 ? _ref : null);
76
76
  return activeIndexSubscribe(handleActiveIndex);
77
77
  }, [
78
78
  activeIndexRef,
@@ -1 +1 @@
1
- {"version":3,"file":"SelectItem.native.js","names":[],"sources":["esm/SelectItem.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { useAdaptIsActive } from \"@tamagui/adapt\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createChangeEventDetails, createStyledHOC, createStyledContext, styled, View } from \"@tamagui/core\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { useSelectItemParentContext } from \"./context\";\nimport { getSelectOptionProps } from \"./selectionController\";\nvar ITEM_NAME = \"SelectItem\";\nvar { Provider: SelectItemContextProvider, useStyledContext: useSelectItemContext } = createStyledContext(null, ITEM_NAME);\nvar SelectItemFrame = styled(View, {\n displayName: ITEM_NAME,\n alignItems: \"center\",\n flexDirection: \"row\"\n});\nvar SelectItem = createStyledHOC(SelectItemFrame, function SelectItem2(props, forwardedRef) {\n var { scope, value, disabled: disabledProp, \"aria-disabled\": ariaDisabled, textValue: textValueProp, ...restProps } = props;\n var disabled = disabledProp !== null && disabledProp !== void 0 ? disabledProp : ariaDisabled === true;\n var context = useSelectItemParentContext(scope);\n var isAdapted = useAdaptIsActive(context.adaptScope);\n var { registry, mode, selectedValues, selectValue, activeIndexSubscribe, activeIndexRef, allowMouseUpRef, allowSelectRef, selectTimeoutRef, getItemProps, shouldRenderWebNative, setActiveIndex, lastPointerRef, moveActive, search } = context;\n var isSelected = selectedValues.includes(value);\n var pendingMouseUpSelectionRef = React.useRef(false);\n var itemNodeRef = React.useRef(null);\n var registrationRef = React.useRef(null);\n var initialRegistration = React.useRef({\n value,\n disabled,\n textValue: textValueProp\n });\n useIsomorphicLayoutEffect(function() {\n var registration = registry.registerItem(initialRegistration.current);\n registrationRef.current = registration;\n registration.setNode(itemNodeRef.current);\n return function() {\n registrationRef.current = null;\n registration.unregister();\n };\n }, [\n registry\n ]);\n useIsomorphicLayoutEffect(function() {\n var _registrationRef_current;\n (_registrationRef_current = registrationRef.current) === null || _registrationRef_current === void 0 ? void 0 : _registrationRef_current.update({\n value,\n disabled,\n textValue: textValueProp\n });\n }, [\n disabled,\n textValueProp,\n value\n ]);\n useIsomorphicLayoutEffect(function() {\n var _registrationRef_current;\n (_registrationRef_current = registrationRef.current) === null || _registrationRef_current === void 0 ? void 0 : _registrationRef_current.setNode(itemNodeRef.current);\n });\n var [isActive, setIsActive] = React.useState(false);\n var isActiveRef = React.useRef(false);\n React.useEffect(function() {\n var handleActiveIndex = function(i) {\n var next = i != null && registry.getIndex(value) === i;\n if (next !== isActiveRef.current) {\n isActiveRef.current = next;\n setIsActive(next);\n }\n if (next && isWeb) {\n requestAnimationFrame(function() {\n var _itemNodeRef_current_focus, _itemNodeRef_current;\n (_itemNodeRef_current = itemNodeRef.current) === null || _itemNodeRef_current === void 0 ? void 0 : (_itemNodeRef_current_focus = _itemNodeRef_current.focus) === null || _itemNodeRef_current_focus === void 0 ? void 0 : _itemNodeRef_current_focus.call(_itemNodeRef_current);\n });\n }\n };\n var _activeIndexRef_current;\n handleActiveIndex((_activeIndexRef_current = activeIndexRef === null || activeIndexRef === void 0 ? void 0 : activeIndexRef.current) !== null && _activeIndexRef_current !== void 0 ? _activeIndexRef_current : null);\n return activeIndexSubscribe(handleActiveIndex);\n }, [\n activeIndexRef,\n activeIndexSubscribe,\n registry,\n value\n ]);\n var textId = React.useId();\n var refCallback = React.useCallback(function(node) {\n var _registrationRef_current;\n itemNodeRef.current = node;\n (_registrationRef_current = registrationRef.current) === null || _registrationRef_current === void 0 ? void 0 : _registrationRef_current.setNode(node);\n }, []);\n var composedRefs = useComposedRefs(forwardedRef, refCallback);\n var handleSelect = React.useCallback(function(event) {\n var reason = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"item-press\";\n if (disabled) return;\n var nativeEvent = (event === null || event === void 0 ? void 0 : event.nativeEvent) || event;\n selectValue(value, createChangeEventDetails(reason, nativeEvent, event === null || event === void 0 ? void 0 : event.currentTarget));\n }, [\n disabled,\n selectValue,\n value\n ]);\n var handleMouseMove = React.useCallback(function(event) {\n if (disabled) return;\n var index = registry.getIndex(value);\n if (index < 0) return;\n var last = lastPointerRef.current;\n if (event.clientX === last.x && event.clientY === last.y) return;\n last.x = event.clientX;\n last.y = event.clientY;\n setActiveIndex(index, {\n reason: \"item-hover\",\n event: event.nativeEvent || event,\n trigger: event.currentTarget,\n index\n });\n }, [\n disabled,\n lastPointerRef,\n registry,\n setActiveIndex,\n value\n ]);\n var handleKeyDown = React.useCallback(function(event) {\n var _event_key;\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n handleSelect(event, \"keyboard\");\n return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n event.stopPropagation();\n moveActive(event.key === \"ArrowDown\" ? 1 : -1, event.nativeEvent || event);\n return;\n }\n if (!getItemProps && ((_event_key = event.key) === null || _event_key === void 0 ? void 0 : _event_key.length) === 1 && !event.metaKey && !event.ctrlKey) {\n search(event.key, event.nativeEvent || event);\n }\n if (allowSelectRef) {\n allowSelectRef.current = true;\n }\n }, [\n allowSelectRef,\n disabled,\n handleSelect,\n getItemProps,\n moveActive,\n search\n ]);\n var selectItemProps = React.useMemo(function() {\n if (getItemProps) {\n var { onTouchMove, onTouchEnd, onKeyDown, onClick, onMouseUp, onMouseMove, onPress, ...itemProps } = restProps;\n var interactionProps = getItemProps({\n ...itemProps,\n onTouchMove() {\n allowSelectRef.current = true;\n allowMouseUpRef.current = false;\n },\n onTouchEnd() {\n allowSelectRef.current = false;\n allowMouseUpRef.current = true;\n },\n onMouseMove: handleMouseMove,\n onKeyDown: handleKeyDown,\n onClick(event) {\n if (disabled) return;\n var shouldSelect = pendingMouseUpSelectionRef.current || allowSelectRef.current;\n pendingMouseUpSelectionRef.current = false;\n clearTimeout(selectTimeoutRef.current);\n allowSelectRef.current = true;\n if (shouldSelect) {\n handleSelect(event);\n }\n },\n onMouseUp(event) {\n if (disabled) return;\n if (!allowMouseUpRef.current) {\n allowMouseUpRef.current = true;\n allowSelectRef.current = true;\n return;\n }\n pendingMouseUpSelectionRef.current = allowSelectRef.current;\n clearTimeout(selectTimeoutRef.current);\n selectTimeoutRef.current = setTimeout(function() {\n allowSelectRef.current = true;\n if (pendingMouseUpSelectionRef.current) {\n pendingMouseUpSelectionRef.current = false;\n handleSelect(event);\n }\n });\n }\n });\n return {\n ...interactionProps,\n onTouchMove: composeEventHandlers(onTouchMove, interactionProps.onTouchMove),\n onTouchEnd: composeEventHandlers(onTouchEnd, interactionProps.onTouchEnd),\n onKeyDown: composeEventHandlers(onKeyDown, interactionProps.onKeyDown),\n onClick(event) {\n var _interactionProps_onClick;\n onClick === null || onClick === void 0 ? void 0 : onClick(event);\n if (event.defaultPrevented) {\n pendingMouseUpSelectionRef.current = false;\n clearTimeout(selectTimeoutRef.current);\n allowSelectRef.current = true;\n return;\n }\n (_interactionProps_onClick = interactionProps.onClick) === null || _interactionProps_onClick === void 0 ? void 0 : _interactionProps_onClick.call(interactionProps, event);\n },\n onMouseUp: composeEventHandlers(onMouseUp, interactionProps.onMouseUp),\n onMouseMove: composeEventHandlers(onMouseMove, interactionProps.onMouseMove),\n onPress\n };\n }\n return {\n ...restProps,\n onKeyDown: composeEventHandlers(restProps.onKeyDown, handleKeyDown),\n onMouseMove: composeEventHandlers(restProps.onMouseMove, handleMouseMove),\n onPress: composeEventHandlers(restProps.onPress, handleSelect)\n };\n }, [\n allowMouseUpRef,\n allowSelectRef,\n disabled,\n handleKeyDown,\n handleMouseMove,\n handleSelect,\n getItemProps,\n restProps,\n selectTimeoutRef\n ]);\n var accessibilityProps = getSelectOptionProps(mode, isSelected, disabled, isWeb ? \"web\" : \"native\");\n return /* @__PURE__ */ _jsx(SelectItemContextProvider, {\n scope,\n value,\n textId: textId || \"\",\n textValue: textValueProp,\n isSelected,\n children: shouldRenderWebNative ? /* @__PURE__ */ _jsx(\"option\", {\n value,\n disabled,\n children: props.children\n }) : /* @__PURE__ */ _jsx(SelectItemFrame, {\n render: \"div\",\n ref: composedRefs,\n \"aria-labelledby\": textId,\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-disabled\": disabled ? \"\" : void 0,\n tabIndex: disabled ? void 0 : isWeb && isAdapted && (isActive || (activeIndexRef === null || activeIndexRef === void 0 ? void 0 : activeIndexRef.current) == null && isSelected) ? 0 : -1,\n zIndex: 100,\n ...selectItemProps,\n ...accessibilityProps\n })\n });\n}, {\n disableTheme: true\n});\nexport {\n SelectItem,\n SelectItemContextProvider,\n SelectItemFrame,\n useSelectItemContext\n};\n//# sourceMappingURL=SelectItem.js.map\n"],"mappings":";;;;;;;;;;;AASA,IAAI,YAAY;AAChB,IAAI,EAAE,UAAU,2BAA2B,kBAAkB,yBAAyB,oBAAoB,MAAM,SAAS;AACzH,IAAI,kBAAkB,OAAO,MAAM;CACjC,aAAa;CACb,YAAY;CACZ,eAAe;AACjB,CAAC;AACD,IAAI,aAAa,gBAAgB,iBAAiB,SAAS,YAAY,OAAO,cAAc;CAC1F,IAAI,EAAE,OAAO,OAAO,UAAU,cAAc,iBAAiB,cAAc,WAAW,eAAe,GAAG,cAAc;CACtH,IAAI,WAAW,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe,iBAAiB;CAClG,IAAI,UAAU,2BAA2B,KAAK;CAC9C,IAAI,YAAY,iBAAiB,QAAQ,UAAU;CACnD,IAAI,EAAE,UAAU,MAAM,gBAAgB,aAAa,sBAAsB,gBAAgB,iBAAiB,gBAAgB,kBAAkB,cAAc,uBAAuB,gBAAgB,gBAAgB,YAAY,WAAW;CACxO,IAAI,aAAa,eAAe,SAAS,KAAK;CAC9C,IAAI,6BAA6B,MAAM,OAAO,KAAK;CACnD,IAAI,cAAc,MAAM,OAAO,IAAI;CACnC,IAAI,kBAAkB,MAAM,OAAO,IAAI;CACvC,IAAI,sBAAsB,MAAM,OAAO;EACrC;EACA;EACA,WAAW;CACb,CAAC;CACD,0BAA0B,WAAW;EACnC,IAAI,eAAe,SAAS,aAAa,oBAAoB,OAAO;EACpE,gBAAgB,UAAU;EAC1B,aAAa,QAAQ,YAAY,OAAO;EACxC,OAAO,WAAW;GAChB,gBAAgB,UAAU;GAC1B,aAAa,WAAW;EAC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,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,KAAK;KAC/D,IAAI,MAAM,kBAAkB;MAC1B,2BAA2B,UAAU;MACrC,aAAa,iBAAiB,OAAO;MACrC,eAAe,UAAU;MACzB;KACF;KACA,CAAC,4BAA4B,iBAAiB,aAAa,QAAQ,8BAA8B,KAAK,IAAI,KAAK,IAAI,0BAA0B,KAAK,kBAAkB,KAAK;IAC3K;IACA,WAAW,qBAAqB,WAAW,iBAAiB,SAAS;IACrE,aAAa,qBAAqB,aAAa,iBAAiB,WAAW;IAC3E;GACF;EACF;EACA,OAAO;GACL,GAAG;GACH,WAAW,qBAAqB,UAAU,WAAW,aAAa;GAClE,aAAa,qBAAqB,UAAU,aAAa,eAAe;GACxE,SAAS,qBAAqB,UAAU,SAAS,YAAY;EAC/D;CACF,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,IAAI,qBAAqB,qBAAqB,MAAM,YAAY,UAAU,QAAQ,QAAQ,QAAQ;CAClG,OAAuB,oBAAK,2BAA2B;EACrD;EACA;EACA,QAAQ,UAAU;EAClB,WAAW;EACX;EACA,UAAU,wBAAwC,oBAAK,UAAU;GAC/D;GACA;GACA,UAAU,MAAM;EAClB,CAAC,IAAoB,oBAAK,iBAAiB;GACzC,QAAQ;GACR,KAAK;GACL,mBAAmB;GACnB,cAAc,aAAa,WAAW;GACtC,iBAAiB,WAAW,KAAK,KAAK;GACtC,UAAU,WAAW,KAAK,IAAI,SAAS,cAAc,aAAa,mBAAmB,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,YAAY,QAAQ,cAAc,IAAI,CAAC;GACxL,QAAQ;GACR,GAAG;GACH,GAAG;EACL,CAAC;CACH,CAAC;AACH,GAAG,EACD,cAAc,KAChB,CAAC"}
1
+ {"version":3,"file":"SelectItem.native.js","names":[],"sources":["esm/SelectItem.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { useAdaptIsActive } from \"@tamagui/adapt\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createChangeEventDetails, createStyledHOC, createStyledContext, styled, View } from \"@tamagui/core\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { useSelectItemParentContext } from \"./context\";\nimport { getSelectOptionProps } from \"./selectionController\";\nvar ITEM_NAME = \"SelectItem\";\nvar { Provider: SelectItemContextProvider, useStyledContext: useSelectItemContext } = createStyledContext(null, ITEM_NAME);\nvar SelectItemFrame = styled(View, {\n displayName: ITEM_NAME,\n alignItems: \"center\",\n flexDirection: \"row\"\n});\nvar SelectItem = createStyledHOC(SelectItemFrame, function SelectItem2(props, forwardedRef) {\n var { scope, value, disabled: disabledProp, \"aria-disabled\": ariaDisabled, textValue: textValueProp, ...restProps } = props;\n var disabled = disabledProp !== null && disabledProp !== void 0 ? disabledProp : ariaDisabled === true;\n var context = useSelectItemParentContext(scope);\n var isAdapted = useAdaptIsActive(context.adaptScope);\n var { registry, mode, selectedValues, selectValue, activeIndexSubscribe, activeIndexRef, allowMouseUpRef, allowSelectRef, selectTimeoutRef, getItemProps, shouldRenderWebNative, setActiveIndex, lastPointerRef, moveActive, search } = context;\n var isSelected = selectedValues.includes(value);\n var pendingMouseUpSelectionRef = React.useRef(false);\n var itemNodeRef = React.useRef(null);\n var registrationRef = React.useRef(null);\n var initialRegistration = React.useRef({\n value,\n disabled,\n textValue: textValueProp\n });\n useIsomorphicLayoutEffect(function() {\n var registration = registry.registerItem(initialRegistration.current);\n registrationRef.current = registration;\n registration.setNode(itemNodeRef.current);\n return function() {\n registrationRef.current = null;\n registration.unregister();\n };\n }, [\n registry\n ]);\n useIsomorphicLayoutEffect(function() {\n var _registrationRef_current;\n (_registrationRef_current = registrationRef.current) === null || _registrationRef_current === void 0 ? void 0 : _registrationRef_current.update({\n value,\n disabled,\n textValue: textValueProp\n });\n }, [\n disabled,\n textValueProp,\n value\n ]);\n useIsomorphicLayoutEffect(function() {\n var _registrationRef_current;\n (_registrationRef_current = registrationRef.current) === null || _registrationRef_current === void 0 ? void 0 : _registrationRef_current.setNode(itemNodeRef.current);\n });\n var [isActive, setIsActive] = React.useState(false);\n var isActiveRef = React.useRef(false);\n React.useEffect(function() {\n var _ref;\n var handleActiveIndex = function handleActiveIndex2(i) {\n var next = i != null && registry.getIndex(value) === i;\n if (next !== isActiveRef.current) {\n isActiveRef.current = next;\n setIsActive(next);\n }\n if (next && isWeb) {\n requestAnimationFrame(function() {\n var _itemNodeRef_current_focus, _itemNodeRef_current;\n (_itemNodeRef_current = itemNodeRef.current) === null || _itemNodeRef_current === void 0 ? void 0 : (_itemNodeRef_current_focus = _itemNodeRef_current.focus) === null || _itemNodeRef_current_focus === void 0 ? void 0 : _itemNodeRef_current_focus.call(_itemNodeRef_current);\n });\n }\n };\n handleActiveIndex((_ref = activeIndexRef === null || activeIndexRef === void 0 ? void 0 : activeIndexRef.current) !== null && _ref !== void 0 ? _ref : null);\n return activeIndexSubscribe(handleActiveIndex);\n }, [\n activeIndexRef,\n activeIndexSubscribe,\n registry,\n value\n ]);\n var textId = React.useId();\n var refCallback = React.useCallback(function(node) {\n var _registrationRef_current;\n itemNodeRef.current = node;\n (_registrationRef_current = registrationRef.current) === null || _registrationRef_current === void 0 ? void 0 : _registrationRef_current.setNode(node);\n }, []);\n var composedRefs = useComposedRefs(forwardedRef, refCallback);\n var handleSelect = React.useCallback(function(event) {\n var reason = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"item-press\";\n if (disabled) return;\n var nativeEvent = (event === null || event === void 0 ? void 0 : event.nativeEvent) || event;\n selectValue(value, createChangeEventDetails(reason, nativeEvent, event === null || event === void 0 ? void 0 : event.currentTarget));\n }, [\n disabled,\n selectValue,\n value\n ]);\n var handleMouseMove = React.useCallback(function(event) {\n if (disabled) return;\n var index = registry.getIndex(value);\n if (index < 0) return;\n var last = lastPointerRef.current;\n if (event.clientX === last.x && event.clientY === last.y) return;\n last.x = event.clientX;\n last.y = event.clientY;\n setActiveIndex(index, {\n reason: \"item-hover\",\n event: event.nativeEvent || event,\n trigger: event.currentTarget,\n index\n });\n }, [\n disabled,\n lastPointerRef,\n registry,\n setActiveIndex,\n value\n ]);\n var handleKeyDown = React.useCallback(function(event) {\n var _event_key;\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n handleSelect(event, \"keyboard\");\n return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n event.stopPropagation();\n moveActive(event.key === \"ArrowDown\" ? 1 : -1, event.nativeEvent || event);\n return;\n }\n if (!getItemProps && ((_event_key = event.key) === null || _event_key === void 0 ? void 0 : _event_key.length) === 1 && !event.metaKey && !event.ctrlKey) {\n search(event.key, event.nativeEvent || event);\n }\n if (allowSelectRef) {\n allowSelectRef.current = true;\n }\n }, [\n allowSelectRef,\n disabled,\n handleSelect,\n getItemProps,\n moveActive,\n search\n ]);\n var selectItemProps = React.useMemo(function() {\n if (getItemProps) {\n var { onTouchMove, onTouchEnd, onKeyDown, onClick, onMouseUp, onMouseMove, onPress, ...itemProps } = restProps;\n var interactionProps = getItemProps({\n ...itemProps,\n onTouchMove() {\n allowSelectRef.current = true;\n allowMouseUpRef.current = false;\n },\n onTouchEnd() {\n allowSelectRef.current = false;\n allowMouseUpRef.current = true;\n },\n onMouseMove: handleMouseMove,\n onKeyDown: handleKeyDown,\n onClick(event) {\n if (disabled) return;\n var shouldSelect = pendingMouseUpSelectionRef.current || allowSelectRef.current;\n pendingMouseUpSelectionRef.current = false;\n clearTimeout(selectTimeoutRef.current);\n allowSelectRef.current = true;\n if (shouldSelect) {\n handleSelect(event);\n }\n },\n onMouseUp(event) {\n if (disabled) return;\n if (!allowMouseUpRef.current) {\n allowMouseUpRef.current = true;\n allowSelectRef.current = true;\n return;\n }\n pendingMouseUpSelectionRef.current = allowSelectRef.current;\n clearTimeout(selectTimeoutRef.current);\n selectTimeoutRef.current = setTimeout(function() {\n allowSelectRef.current = true;\n if (pendingMouseUpSelectionRef.current) {\n pendingMouseUpSelectionRef.current = false;\n handleSelect(event);\n }\n });\n }\n });\n return {\n ...interactionProps,\n onTouchMove: composeEventHandlers(onTouchMove, interactionProps.onTouchMove),\n onTouchEnd: composeEventHandlers(onTouchEnd, interactionProps.onTouchEnd),\n onKeyDown: composeEventHandlers(onKeyDown, interactionProps.onKeyDown),\n onClick(event) {\n var _interactionProps_onClick;\n onClick === null || onClick === void 0 ? void 0 : onClick(event);\n if (event.defaultPrevented) {\n pendingMouseUpSelectionRef.current = false;\n clearTimeout(selectTimeoutRef.current);\n allowSelectRef.current = true;\n return;\n }\n (_interactionProps_onClick = interactionProps.onClick) === null || _interactionProps_onClick === void 0 ? void 0 : _interactionProps_onClick.call(interactionProps, event);\n },\n onMouseUp: composeEventHandlers(onMouseUp, interactionProps.onMouseUp),\n onMouseMove: composeEventHandlers(onMouseMove, interactionProps.onMouseMove),\n onPress\n };\n }\n return {\n ...restProps,\n onKeyDown: composeEventHandlers(restProps.onKeyDown, handleKeyDown),\n onMouseMove: composeEventHandlers(restProps.onMouseMove, handleMouseMove),\n onPress: composeEventHandlers(restProps.onPress, handleSelect)\n };\n }, [\n allowMouseUpRef,\n allowSelectRef,\n disabled,\n handleKeyDown,\n handleMouseMove,\n handleSelect,\n getItemProps,\n restProps,\n selectTimeoutRef\n ]);\n var accessibilityProps = getSelectOptionProps(mode, isSelected, disabled, isWeb ? \"web\" : \"native\");\n return /* @__PURE__ */ _jsx(SelectItemContextProvider, {\n scope,\n value,\n textId: textId || \"\",\n textValue: textValueProp,\n isSelected,\n children: shouldRenderWebNative ? /* @__PURE__ */ _jsx(\"option\", {\n value,\n disabled,\n children: props.children\n }) : /* @__PURE__ */ _jsx(SelectItemFrame, {\n render: \"div\",\n ref: composedRefs,\n \"aria-labelledby\": textId,\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-disabled\": disabled ? \"\" : void 0,\n tabIndex: disabled ? void 0 : isWeb && isAdapted && (isActive || (activeIndexRef === null || activeIndexRef === void 0 ? void 0 : activeIndexRef.current) == null && isSelected) ? 0 : -1,\n zIndex: 100,\n ...selectItemProps,\n ...accessibilityProps\n })\n });\n}, {\n disableTheme: true\n});\nexport {\n SelectItem,\n SelectItemContextProvider,\n SelectItemFrame,\n useSelectItemContext\n};\n//# sourceMappingURL=SelectItem.js.map\n"],"mappings":";;;;;;;;;;;AASA,IAAI,YAAY;AAChB,IAAI,EAAE,UAAU,2BAA2B,kBAAkB,yBAAyB,oBAAoB,MAAM,SAAS;AACzH,IAAI,kBAAkB,OAAO,MAAM;CACjC,aAAa;CACb,YAAY;CACZ,eAAe;AACjB,CAAC;AACD,IAAI,aAAa,gBAAgB,iBAAiB,SAAS,YAAY,OAAO,cAAc;CAC1F,IAAI,EAAE,OAAO,OAAO,UAAU,cAAc,iBAAiB,cAAc,WAAW,eAAe,GAAG,cAAc;CACtH,IAAI,WAAW,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe,iBAAiB;CAClG,IAAI,UAAU,2BAA2B,KAAK;CAC9C,IAAI,YAAY,iBAAiB,QAAQ,UAAU;CACnD,IAAI,EAAE,UAAU,MAAM,gBAAgB,aAAa,sBAAsB,gBAAgB,iBAAiB,gBAAgB,kBAAkB,cAAc,uBAAuB,gBAAgB,gBAAgB,YAAY,WAAW;CACxO,IAAI,aAAa,eAAe,SAAS,KAAK;CAC9C,IAAI,6BAA6B,MAAM,OAAO,KAAK;CACnD,IAAI,cAAc,MAAM,OAAO,IAAI;CACnC,IAAI,kBAAkB,MAAM,OAAO,IAAI;CACvC,IAAI,sBAAsB,MAAM,OAAO;EACrC;EACA;EACA,WAAW;CACb,CAAC;CACD,0BAA0B,WAAW;EACnC,IAAI,eAAe,SAAS,aAAa,oBAAoB,OAAO;EACpE,gBAAgB,UAAU;EAC1B,aAAa,QAAQ,YAAY,OAAO;EACxC,OA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erFrame, function SelectTrigger2(
20
20
  var composedRefs = useComposedRefs(forwardedRef, (_context_floatingContext = context.floatingContext) === null || _context_floatingContext === void 0 ? void 0 : _context_floatingContext.refs.setReference);
21
21
  var pressIsTouch = React.useRef(false);
22
22
  if (itemParentContext.shouldRenderWebNative) return null;
23
- var toggleOpen = function(event) {
23
+ var toggleOpen = function toggleOpen2(event) {
24
24
  var reason = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "trigger-press";
25
25
  if (!disabled) itemParentContext.requestOpenChange(!context.open, createChangeEventDetails(reason, (event === null || event === void 0 ? void 0 : event.nativeEvent) || event, event === null || event === void 0 ? void 0 : event.currentTarget));
26
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTrigger.native.js","names":[],"sources":["esm/SelectTrigger.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { View, createChangeEventDetails, createStyledHOC, styled } from \"@tamagui/core\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { useSelectContext, useSelectItemParentContext } from \"./context\";\n\nvar SelectTriggerFrame = styled(View, {\n\tdisplayName: \"SelectTrigger\",\n\talignItems: \"center\",\n\tflexDirection: \"row\",\n\trender: /* @__PURE__ */ jsx(\"button\", { type: \"button\" })\n});\nvar SelectTrigger = createStyledHOC(SelectTriggerFrame, function SelectTrigger2(props, forwardedRef) {\n\tvar _context_floatingContext;\n\tvar { scope, disabled = false, ...triggerProps } = props;\n\tvar context = useSelectContext(scope);\n\tvar itemParentContext = useSelectItemParentContext(scope);\n\tvar composedRefs = useComposedRefs(forwardedRef, (_context_floatingContext = context.floatingContext) === null || _context_floatingContext === void 0 ? void 0 : _context_floatingContext.refs.setReference);\n\tvar pressIsTouch = React.useRef(false);\n\tif (itemParentContext.shouldRenderWebNative) return null;\n\tvar toggleOpen = function(event) {\n\t\tvar reason = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"trigger-press\";\n\t\tif (!disabled) itemParentContext.requestOpenChange(!context.open, createChangeEventDetails(reason, (event === null || event === void 0 ? void 0 : event.nativeEvent) || event, event === null || event === void 0 ? void 0 : event.currentTarget));\n\t};\n\tvar interactionProps = {\n\t\t...triggerProps,\n\t\t...isWeb ? {\n\t\t\tonMouseDown: composeEventHandlers(triggerProps.onMouseDown, function(event) {\n\t\t\t\tpressIsTouch.current = event.type === \"touchstart\";\n\t\t\t\tif (pressIsTouch.current) return;\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleOpen(event);\n\t\t\t}),\n\t\t\tonPress: composeEventHandlers(triggerProps.onPress, function(event) {\n\t\t\t\tif (!pressIsTouch.current) return;\n\t\t\t\tpressIsTouch.current = false;\n\t\t\t\ttoggleOpen(event);\n\t\t\t})\n\t\t} : { onPress: composeEventHandlers(triggerProps.onPress, toggleOpen) },\n\t\tonKeyDown: composeEventHandlers(triggerProps.onKeyDown, function(event) {\n\t\t\tif (event.key === \"Enter\" || event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleOpen(event, \"keyboard\");\n\t\t\t}\n\t\t})\n\t};\n\treturn /* @__PURE__ */ jsx(SelectTriggerFrame, {\n\t\ttype: \"button\",\n\t\tid: itemParentContext.id,\n\t\trole: \"combobox\",\n\t\t\"aria-haspopup\": \"listbox\",\n\t\t\"aria-expanded\": context.open,\n\t\t\"aria-autocomplete\": \"none\",\n\t\taccessibilityRole: isWeb ? void 0 : \"button\",\n\t\taccessibilityState: isWeb ? void 0 : {\n\t\t\texpanded: context.open,\n\t\t\tdisabled\n\t\t},\n\t\tdir: context.dir,\n\t\tdisabled,\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...interactionProps,\n\t\tref: composedRefs\n\t});\n});\n\nexport { SelectTrigger, SelectTriggerFrame };"],"mappings":";;;;;;;;;AAQA,IAAI,qBAAqB,OAAO,MAAM;CACrC,aAAa;CACb,YA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AK;IAC/C,MAAM,eAAe;IACrB,WAAW,OAAO,UAAU;GAC7B;EACD,CAAC;CACF;CACA,OAAuB,oBAAI,oBAAoB;EAC9C,MAAM;EACN,IAAI,kBAAkB;EACtB,MAAM;EACN,iBAAiB;EACjB,iBAAiB,QAAQ;EACzB,qBAAqB;EACrB,mBAAmB,QAAQ,KAAK,IAAI;EACpC,oBAAoB,QAAQ,KAAK,IAAI;GACpC,UAAU,QAAQ;GAClB;EACD;EACA,KAAK,QAAQ;EACb;EACA,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;EACH,KAAK;CACN,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"SelectTrigger.native.js","names":[],"sources":["esm/SelectTrigger.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { View, createChangeEventDetails, createStyledHOC, styled } from \"@tamagui/core\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport * as React from \"react\";\nimport { useSelectContext, useSelectItemParentContext } from \"./context\";\n\nvar SelectTriggerFrame = styled(View, {\n\tdisplayName: \"SelectTrigger\",\n\talignItems: \"center\",\n\tflexDirection: \"row\",\n\trender: /* @__PURE__ */ jsx(\"button\", { type: \"button\" })\n});\nvar SelectTrigger = createStyledHOC(SelectTriggerFrame, function SelectTrigger2(props, forwardedRef) {\n\tvar _context_floatingContext;\n\tvar { scope, disabled = false, ...triggerProps } = props;\n\tvar context = useSelectContext(scope);\n\tvar itemParentContext = useSelectItemParentContext(scope);\n\tvar composedRefs = useComposedRefs(forwardedRef, (_context_floatingContext = context.floatingContext) === null || _context_floatingContext === void 0 ? void 0 : _context_floatingContext.refs.setReference);\n\tvar pressIsTouch = React.useRef(false);\n\tif (itemParentContext.shouldRenderWebNative) return null;\n\tvar toggleOpen = function toggleOpen2(event) {\n\t\tvar reason = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"trigger-press\";\n\t\tif (!disabled) itemParentContext.requestOpenChange(!context.open, createChangeEventDetails(reason, (event === null || event === void 0 ? void 0 : event.nativeEvent) || event, event === null || event === void 0 ? void 0 : event.currentTarget));\n\t};\n\tvar interactionProps = {\n\t\t...triggerProps,\n\t\t...isWeb ? {\n\t\t\tonMouseDown: composeEventHandlers(triggerProps.onMouseDown, function(event) {\n\t\t\t\tpressIsTouch.current = event.type === \"touchstart\";\n\t\t\t\tif (pressIsTouch.current) return;\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleOpen(event);\n\t\t\t}),\n\t\t\tonPress: composeEventHandlers(triggerProps.onPress, function(event) {\n\t\t\t\tif (!pressIsTouch.current) return;\n\t\t\t\tpressIsTouch.current = false;\n\t\t\t\ttoggleOpen(event);\n\t\t\t})\n\t\t} : { onPress: composeEventHandlers(triggerProps.onPress, toggleOpen) },\n\t\tonKeyDown: composeEventHandlers(triggerProps.onKeyDown, function(event) {\n\t\t\tif (event.key === \"Enter\" || event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleOpen(event, \"keyboard\");\n\t\t\t}\n\t\t})\n\t};\n\treturn /* @__PURE__ */ jsx(SelectTriggerFrame, {\n\t\ttype: \"button\",\n\t\tid: itemParentContext.id,\n\t\trole: \"combobox\",\n\t\t\"aria-haspopup\": \"listbox\",\n\t\t\"aria-expanded\": context.open,\n\t\t\"aria-autocomplete\": \"none\",\n\t\taccessibilityRole: isWeb ? void 0 : \"button\",\n\t\taccessibilityState: isWeb ? void 0 : {\n\t\t\texpanded: context.open,\n\t\t\tdisabled\n\t\t},\n\t\tdir: context.dir,\n\t\tdisabled,\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...interactionProps,\n\t\tref: composedRefs\n\t});\n});\n\nexport { SelectTrigger, SelectTriggerFrame };"],"mappings":";;;;;;;;;AAQA,IAAI,qBAAqB,OAAO,MAAM;CACrC,aAAa;CACb,YAAY;CACZ,eAAe;CACf,QAAwB,oBAAI,UA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AAW,OAAO,UAAU;GAC7B;EACD,CAAC;CACF;CACA,OAAuB,oBAAI,oBAAoB;EAC9C,MAAM;EACN,IAAI,kBAAkB;EACtB,MAAM;EACN,iBAAiB;EACjB,iBAAiB,QAAQ;EACzB,qBAAqB;EACrB,mBAAmB,QAAQ,KAAK,IAAI;EACpC,oBAAoB,QAAQ,KAAK,IAAI;GACpC,UAAU,QAAQ;GAClB;EACD;EACA,KAAK,QAAQ;EACb;EACA,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;EACH,KAAK;CACN,CAAC;AACF,CAAC"}
@@ -7,7 +7,7 @@ var SelectZIndexContext = /* @__PURE__ */ createContext(void 0);
7
7
  var SelectNativeComponentContext = /* @__PURE__ */ createContext(null);
8
8
  var { Provider: SelectProvider, useStyledContext: useSelectContext } = createStyledContext(null, "Select");
9
9
  var { Provider: SelectItemParentProvider, useStyledContext: useSelectItemParentContext } = createStyledContext(null, "SelectItem");
10
- var ForwardSelectContext = function(param) {
10
+ var ForwardSelectContext = function ForwardSelectContext2(param) {
11
11
  var { context, itemContext, children } = param;
12
12
  var portalState = getPortal().state;
13
13
  if (portalState.type === "teleport") {
@@ -1 +1 @@
1
- {"version":3,"file":"context.native.js","names":[],"sources":["esm/context.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createStyledContext } from \"@tamagui/core\";\nimport { getPortal } from \"@tamagui/native\";\nimport { createContext } from \"react\";\nvar SelectZIndexContext = /* @__PURE__ */ createContext(void 0);\nvar SelectNativeComponentContext = /* @__PURE__ */ createContext(null);\nvar { Provider: SelectProvider, useStyledContext: useSelectContext } = createStyledContext(null, \"Select\");\nvar { Provider: SelectItemParentProvider, useStyledContext: useSelectItemParentContext } = createStyledContext(null, \"SelectItem\");\nvar ForwardSelectContext = function(param) {\n var { context, itemContext, children } = param;\n var portalState = getPortal().state;\n if (portalState.type === \"teleport\") {\n return children;\n }\n return /* @__PURE__ */ _jsx(SelectProvider, {\n scope: context.scopeName,\n ...context,\n children: /* @__PURE__ */ _jsx(SelectItemParentProvider, {\n scope: context.scopeName,\n ...itemContext,\n children\n })\n });\n};\nexport {\n ForwardSelectContext,\n SelectItemParentProvider,\n SelectNativeComponentContext,\n SelectProvider,\n SelectZIndexContext,\n useSelectContext,\n useSelectItemParentContext\n};\n//# sourceMappingURL=context.js.map\n"],"mappings":";;;;;;AAIA,IAAI,sBAAsC,8BAAc,KAAK,CAAC;AAC9D,IAAI,+BAA+C,8BAAc,IAAI;AACrE,IAAI,EAAE,UAAU,gBAAgB,kBAAkB,qBAAqB,oBAAoB,MAAM,QAAQ;AACzG,IAAI,EAAE,UAAU,0BAA0B,kBAAkB,+BAA+B,oBAAoB,MAAM,YAAY;AACjI,IAAI,uBAAuB,SAAS,OAAO;CACzC,IAAI,EAAE,SAAS,aAAa,aAAa;CACzC,IAAI,cAAc,UAAU,CAAC,CAAC;CAC9B,IAAI,YAAY,SAAS,YAAY;EACnC,OAAO;CACT;CACA,OAAuB,oBAAK,gBAAgB;EAC1C,OAAO,QAAQ;EACf,GAAG;EACH,UAA0B,oBAAK,0BAA0B;GACvD,OAAO,QAAQ;GACf,GAAG;GACH;EACF,CAAC;CACH,CAAC;AACH"}
1
+ {"version":3,"file":"context.native.js","names":[],"sources":["esm/context.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createStyledContext } from \"@tamagui/core\";\nimport { getPortal } from \"@tamagui/native\";\nimport { createContext } from \"react\";\nvar SelectZIndexContext = /* @__PURE__ */ createContext(void 0);\nvar SelectNativeComponentContext = /* @__PURE__ */ createContext(null);\nvar { Provider: SelectProvider, useStyledContext: useSelectContext } = createStyledContext(null, \"Select\");\nvar { Provider: SelectItemParentProvider, useStyledContext: useSelectItemParentContext } = createStyledContext(null, \"SelectItem\");\nvar ForwardSelectContext = function ForwardSelectContext2(param) {\n var { context, itemContext, children } = param;\n var portalState = getPortal().state;\n if (portalState.type === \"teleport\") {\n return children;\n }\n return /* @__PURE__ */ _jsx(SelectProvider, {\n scope: context.scopeName,\n ...context,\n children: /* @__PURE__ */ _jsx(SelectItemParentProvider, {\n scope: context.scopeName,\n ...itemContext,\n children\n })\n });\n};\nexport {\n ForwardSelectContext,\n SelectItemParentProvider,\n SelectNativeComponentContext,\n SelectProvider,\n SelectZIndexContext,\n useSelectContext,\n useSelectItemParentContext\n};\n//# sourceMappingURL=context.js.map\n"],"mappings":";;;;;;AAIA,IAAI,sBAAsC,8BAAc,KAAK,CAAC;AAC9D,IAAI,+BAA+C,8BAAc,IAAI;AACrE,IAAI,EAAE,UAAU,gBAAgB,kBAAkB,qBAAqB,oBAAoB,MAAM,QAAQ;AACzG,IAAI,EAAE,UAAU,0BAA0B,kBAAkB,+BAA+B,oBAAoB,MAAM,YAAY;AACjI,IAAI,uBAAuB,SAAS,sBAAsB,OAAO;CAC/D,IAAI,EAAE,SAAS,aAAa,aAAa;CACzC,IAAI,cAAc,UAAU,CAAC,CAAC;CAC9B,IAAI,YAAY,SAAS,YAAY;EACnC,OAAO;CACT;CACA,OAAuB,oBAAK,gBAAgB;EAC1C,OAAO,QAAQ;EACf,GAAG;EACH,UAA0B,oBAAK,0BAA0B;GACvD,OAAO,QAAQ;GACf,GAAG;GACH;EACF,CAAC;CACH,CAAC;AACH"}
@@ -18,44 +18,44 @@ function createSelectItemRegistry(onChange) {
18
18
  var itemNodes = /* @__PURE__ */ new Map();
19
19
  var listeners = /* @__PURE__ */ new Set();
20
20
  var indexByValue = null;
21
- var notify = function() {
21
+ var notify = function notify2() {
22
22
  indexByValue = null;
23
23
  onChange === null || onChange === void 0 ? void 0 : onChange();
24
24
  listeners.forEach(function(listener) {
25
25
  return listener();
26
26
  });
27
27
  };
28
- var getItems = function() {
28
+ var getItems = function getItems2() {
29
29
  return items;
30
30
  };
31
- var getItem = function(value) {
31
+ var getItem = function getItem2(value) {
32
32
  return items.find(function(item) {
33
33
  return item.value === value;
34
34
  });
35
35
  };
36
- var getIndex = function(value) {
36
+ var getIndex = function getIndex2(value) {
37
+ var _indexByValue_get;
37
38
  if (!indexByValue) {
38
39
  indexByValue = /* @__PURE__ */ new Map();
39
40
  items.forEach(function(item, index) {
40
41
  if (!indexByValue.has(item.value)) indexByValue.set(item.value, index);
41
42
  });
42
43
  }
43
- var _indexByValue_get;
44
44
  return (_indexByValue_get = indexByValue.get(value)) !== null && _indexByValue_get !== void 0 ? _indexByValue_get : -1;
45
45
  };
46
- var getNodes = function() {
46
+ var getNodes = function getNodes2() {
47
47
  return items.map(function(item) {
48
48
  var _itemNodes_get;
49
49
  return (_itemNodes_get = itemNodes.get(item.id)) !== null && _itemNodes_get !== void 0 ? _itemNodes_get : null;
50
50
  });
51
51
  };
52
- var getRegisteredLabel = function(value) {
52
+ var getRegisteredLabel = function getRegisteredLabel2(value) {
53
53
  var registrations = labelRegistrations.get(value);
54
54
  if (!(registrations === null || registrations === void 0 ? void 0 : registrations.size)) return void 0;
55
55
  var values = Array.from(registrations.values());
56
56
  return values[values.length - 1];
57
57
  };
58
- var applyRegisteredLabel = function(value) {
58
+ var applyRegisteredLabel = function applyRegisteredLabel2(value) {
59
59
  var registeredLabel = getRegisteredLabel(value);
60
60
  var changed = false;
61
61
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
@@ -87,7 +87,7 @@ function createSelectItemRegistry(onChange) {
87
87
  }
88
88
  if (changed) notify();
89
89
  };
90
- var syncNodeOrder = function() {
90
+ var syncNodeOrder = function syncNodeOrder2() {
91
91
  items.sort(function(a, b) {
92
92
  var aNode = itemNodes.get(a.id);
93
93
  var bNode = itemNodes.get(b.id);
@@ -100,10 +100,10 @@ function createSelectItemRegistry(onChange) {
100
100
  return 0;
101
101
  });
102
102
  };
103
- var registerItem = function(item) {
103
+ var registerItem = function registerItem2(item) {
104
+ var _item_textValue;
104
105
  var id = Symbol(item.value);
105
106
  var registeredLabel = getRegisteredLabel(item.value);
106
- var _item_textValue;
107
107
  var registeredItem = {
108
108
  ...item,
109
109
  ...registeredLabel,
@@ -166,10 +166,10 @@ function createSelectItemRegistry(onChange) {
166
166
  }
167
167
  };
168
168
  };
169
- var registerLabel = function(value, label, textValue) {
169
+ var registerLabel = function registerLabel2(value, label, textValue) {
170
+ var _labelRegistrations_get;
170
171
  var id = Symbol(value);
171
172
  var normalizedTextValue = textValue || getSelectLabelText(label) || value;
172
- var _labelRegistrations_get;
173
173
  var registrations = (_labelRegistrations_get = labelRegistrations.get(value)) !== null && _labelRegistrations_get !== void 0 ? _labelRegistrations_get : (function() {
174
174
  var next = /* @__PURE__ */ new Map();
175
175
  labelRegistrations.set(value, next);
@@ -188,12 +188,12 @@ function createSelectItemRegistry(onChange) {
188
188
  applyRegisteredLabel(value);
189
189
  };
190
190
  };
191
- var firstEnabledIndex = function() {
191
+ var firstEnabledIndex = function firstEnabledIndex2() {
192
192
  return items.findIndex(function(item) {
193
193
  return !item.disabled;
194
194
  });
195
195
  };
196
- var nextEnabledIndex = function(fromIndex, direction) {
196
+ var nextEnabledIndex = function nextEnabledIndex2(fromIndex, direction) {
197
197
  if (!items.length) return -1;
198
198
  if (fromIndex == null || fromIndex < 0 || fromIndex >= items.length) {
199
199
  if (direction === 1) return firstEnabledIndex();
@@ -209,7 +209,7 @@ function createSelectItemRegistry(onChange) {
209
209
  }
210
210
  return -1;
211
211
  };
212
- var findTypeaheadIndex = function(search, fromIndex) {
212
+ var findTypeaheadIndex = function findTypeaheadIndex2(search, fromIndex) {
213
213
  var normalizedSearch = search.trim().toLocaleLowerCase();
214
214
  if (!normalizedSearch) return -1;
215
215
  var start = fromIndex == null || fromIndex < 0 ? -1 : fromIndex;
@@ -239,12 +239,12 @@ function createSelectItemRegistry(onChange) {
239
239
  firstEnabledIndex,
240
240
  nextEnabledIndex,
241
241
  findTypeaheadIndex,
242
- getDisabledIndices: function() {
242
+ getDisabledIndices: function getDisabledIndices() {
243
243
  return items.flatMap(function(item, index) {
244
244
  return item.disabled ? [index] : [];
245
245
  });
246
246
  },
247
- getTypeaheadLabels: function() {
247
+ getTypeaheadLabels: function getTypeaheadLabels() {
248
248
  return items.map(function(item) {
249
249
  return item.textValue || getSelectLabelText(item.label) || item.value;
250
250
  });
@@ -267,23 +267,23 @@ function createSelectSelectionController(param) {
267
267
  var mode = initialMode;
268
268
  var value = normalizeSelectSelection(mode, initialValue);
269
269
  var activeIndex = null;
270
- var selectedValues = function() {
270
+ var selectedValues = function selectedValues2() {
271
271
  return selectedValuesFromSelection(mode, value);
272
272
  };
273
- var setMode = function(nextMode) {
273
+ var setMode = function setMode2(nextMode) {
274
274
  if (mode === nextMode) return value;
275
275
  mode = nextMode;
276
276
  value = normalizeSelectSelection(mode, value);
277
277
  return value;
278
278
  };
279
- var setValue = function(nextValue) {
279
+ var setValue = function setValue2(nextValue) {
280
280
  value = normalizeSelectSelection(mode, nextValue);
281
281
  return value;
282
282
  };
283
- var isSelected = function(itemValue) {
283
+ var isSelected = function isSelected2(itemValue) {
284
284
  return selectedValues().includes(itemValue);
285
285
  };
286
- var toggle = function(itemValue) {
286
+ var toggle = function toggle2(itemValue) {
287
287
  var item = registry.getItem(itemValue);
288
288
  if (!item || item.disabled) return value;
289
289
  if (mode === "single") {
@@ -296,7 +296,7 @@ function createSelectSelectionController(param) {
296
296
  }) : [...current, itemValue];
297
297
  return value;
298
298
  };
299
- var selectionAnchor = function() {
299
+ var selectionAnchor = function selectionAnchor2() {
300
300
  var values = selectedValues();
301
301
  for (var index = values.length - 1; index >= 0; index--) {
302
302
  var item = registry.getItem(values[index]);
@@ -305,16 +305,16 @@ function createSelectSelectionController(param) {
305
305
  var firstEnabledIndex = registry.firstEnabledIndex();
306
306
  return firstEnabledIndex < 0 ? void 0 : registry.getItems()[firstEnabledIndex];
307
307
  };
308
- var selectionAnchorIndex = function() {
308
+ var selectionAnchorIndex = function selectionAnchorIndex2() {
309
309
  var anchor = selectionAnchor();
310
310
  return anchor ? registry.getIndex(anchor.value) : -1;
311
311
  };
312
- var initialActiveIndex = function() {
312
+ var initialActiveIndex = function initialActiveIndex2() {
313
313
  var anchorIndex = selectionAnchorIndex();
314
314
  var anchor = anchorIndex < 0 ? void 0 : registry.getItems()[anchorIndex];
315
315
  return anchor && !anchor.disabled ? anchorIndex : registry.firstEnabledIndex();
316
316
  };
317
- var moveActive = function(direction) {
317
+ var moveActive = function moveActive2(direction) {
318
318
  var nextIndex = registry.nextEnabledIndex(activeIndex, direction);
319
319
  activeIndex = nextIndex < 0 ? null : nextIndex;
320
320
  return activeIndex == null ? void 0 : registry.getItems()[activeIndex];
@@ -1 +1 @@
1
- {"version":3,"file":"selectionController.native.js","names":[],"sources":["esm/selectionController.native.js"],"sourcesContent":["function getSelectLabelText(label) {\n if (typeof label === \"string\" || typeof label === \"number\") {\n return String(label);\n }\n if (Array.isArray(label)) {\n return label.map(getSelectLabelText).join(\"\");\n }\n if (label && typeof label === \"object\" && \"props\" in label) {\n var _label_props;\n return getSelectLabelText((_label_props = label.props) === null || _label_props === void 0 ? void 0 : _label_props.children);\n }\n return \"\";\n}\nfunction createSelectItemRegistry(onChange) {\n var items = [];\n var labelRegistrations = /* @__PURE__ */ new Map();\n var explicitTextValues = /* @__PURE__ */ new Map();\n var itemNodes = /* @__PURE__ */ new Map();\n var listeners = /* @__PURE__ */ new Set();\n var indexByValue = null;\n var notify = function() {\n indexByValue = null;\n onChange === null || onChange === void 0 ? void 0 : onChange();\n listeners.forEach(function(listener) {\n return listener();\n });\n };\n var getItems = function() {\n return items;\n };\n var getItem = function(value) {\n return items.find(function(item) {\n return item.value === value;\n });\n };\n var getIndex = function(value) {\n if (!indexByValue) {\n indexByValue = /* @__PURE__ */ new Map();\n items.forEach(function(item, index) {\n if (!indexByValue.has(item.value)) indexByValue.set(item.value, index);\n });\n }\n var _indexByValue_get;\n return (_indexByValue_get = indexByValue.get(value)) !== null && _indexByValue_get !== void 0 ? _indexByValue_get : -1;\n };\n var getNodes = function() {\n return items.map(function(item) {\n var _itemNodes_get;\n return (_itemNodes_get = itemNodes.get(item.id)) !== null && _itemNodes_get !== void 0 ? _itemNodes_get : null;\n });\n };\n var getRegisteredLabel = function(value) {\n var registrations = labelRegistrations.get(value);\n if (!(registrations === null || registrations === void 0 ? void 0 : registrations.size)) return void 0;\n var values = Array.from(registrations.values());\n return values[values.length - 1];\n };\n var applyRegisteredLabel = function(value) {\n var registeredLabel = getRegisteredLabel(value);\n var changed = false;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n if (item.value !== value) continue;\n var nextLabel = registeredLabel === null || registeredLabel === void 0 ? void 0 : registeredLabel.label;\n var nextTextValue = explicitTextValues.get(item.id) || (registeredLabel === null || registeredLabel === void 0 ? void 0 : registeredLabel.textValue);\n if (item.label !== nextLabel || item.textValue !== nextTextValue) {\n item.label = nextLabel;\n item.textValue = nextTextValue;\n changed = true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (changed) notify();\n };\n var syncNodeOrder = function() {\n items.sort(function(a, b) {\n var aNode = itemNodes.get(a.id);\n var bNode = itemNodes.get(b.id);\n if (!aNode || !bNode || typeof aNode.compareDocumentPosition !== \"function\") {\n return 0;\n }\n var position = aNode.compareDocumentPosition(bNode);\n if (position & 4) return -1;\n if (position & 2) return 1;\n return 0;\n });\n };\n var registerItem = function(item) {\n var id = Symbol(item.value);\n var registeredLabel = getRegisteredLabel(item.value);\n var _item_textValue;\n var registeredItem = {\n ...item,\n ...registeredLabel,\n textValue: (_item_textValue = item.textValue) !== null && _item_textValue !== void 0 ? _item_textValue : registeredLabel === null || registeredLabel === void 0 ? void 0 : registeredLabel.textValue,\n id\n };\n explicitTextValues.set(id, item.textValue);\n items.push(registeredItem);\n notify();\n return {\n id,\n update(next) {\n var index = items.findIndex(function(current2) {\n return current2.id === id;\n });\n if (index < 0) return;\n var current = items[index];\n if (\"textValue\" in next) {\n explicitTextValues.set(id, next.textValue);\n }\n var nextItem = {\n ...current,\n ...next\n };\n if (next.value !== void 0 && next.value !== current.value) {\n var nextLabel = getRegisteredLabel(next.value);\n nextItem.label = nextLabel === null || nextLabel === void 0 ? void 0 : nextLabel.label;\n }\n var explicitTextValue = explicitTextValues.get(id);\n nextItem.textValue = explicitTextValue || getSelectLabelText(nextItem.label) || (nextItem.label ? nextItem.value : void 0);\n var changed = Object.entries(next).some(function(param) {\n var [key, value] = param;\n return current[key] !== value;\n });\n var textValueChanged = current.textValue !== nextItem.textValue;\n if (!changed && !textValueChanged) return;\n items[index] = nextItem;\n notify();\n },\n setNode(node) {\n var _itemNodes_get;\n if (((_itemNodes_get = itemNodes.get(id)) !== null && _itemNodes_get !== void 0 ? _itemNodes_get : null) === (node !== null && node !== void 0 ? node : null)) return;\n if (node) {\n itemNodes.set(id, node);\n syncNodeOrder();\n } else {\n itemNodes.delete(id);\n }\n notify();\n },\n unregister() {\n var index = items.findIndex(function(current) {\n return current.id === id;\n });\n if (index < 0) return;\n items.splice(index, 1);\n explicitTextValues.delete(id);\n itemNodes.delete(id);\n notify();\n }\n };\n };\n var registerLabel = function(value, label, textValue) {\n var id = Symbol(value);\n var normalizedTextValue = textValue || getSelectLabelText(label) || value;\n var _labelRegistrations_get;\n var registrations = (_labelRegistrations_get = labelRegistrations.get(value)) !== null && _labelRegistrations_get !== void 0 ? _labelRegistrations_get : (function() {\n var next = /* @__PURE__ */ new Map();\n labelRegistrations.set(value, next);\n return next;\n })();\n registrations.set(id, {\n label,\n textValue: normalizedTextValue\n });\n applyRegisteredLabel(value);\n return function() {\n registrations.delete(id);\n if (!registrations.size) {\n labelRegistrations.delete(value);\n }\n applyRegisteredLabel(value);\n };\n };\n var firstEnabledIndex = function() {\n return items.findIndex(function(item) {\n return !item.disabled;\n });\n };\n var nextEnabledIndex = function(fromIndex, direction) {\n if (!items.length) return -1;\n if (fromIndex == null || fromIndex < 0 || fromIndex >= items.length) {\n if (direction === 1) return firstEnabledIndex();\n for (var index = items.length - 1; index >= 0; index--) {\n if (!items[index].disabled) return index;\n }\n return -1;\n }\n for (var offset = 1; offset <= items.length; offset++) {\n var _items_index;\n var index1 = (fromIndex + direction * offset + items.length) % items.length;\n if (!((_items_index = items[index1]) === null || _items_index === void 0 ? void 0 : _items_index.disabled)) return index1;\n }\n return -1;\n };\n var findTypeaheadIndex = function(search, fromIndex) {\n var normalizedSearch = search.trim().toLocaleLowerCase();\n if (!normalizedSearch) return -1;\n var start = fromIndex == null || fromIndex < 0 ? -1 : fromIndex;\n for (var offset = 1; offset <= items.length; offset++) {\n var index = (start + offset) % items.length;\n var item = items[index];\n var label = item.textValue || getSelectLabelText(item.label) || item.value;\n if (!item.disabled && label.toLocaleLowerCase().startsWith(normalizedSearch)) {\n return index;\n }\n }\n return -1;\n };\n return {\n subscribe(listener) {\n listeners.add(listener);\n return function() {\n listeners.delete(listener);\n };\n },\n registerItem,\n registerLabel,\n getItems,\n getItem,\n getIndex,\n getNodes,\n firstEnabledIndex,\n nextEnabledIndex,\n findTypeaheadIndex,\n getDisabledIndices: function() {\n return items.flatMap(function(item, index) {\n return item.disabled ? [\n index\n ] : [];\n });\n },\n getTypeaheadLabels: function() {\n return items.map(function(item) {\n return item.textValue || getSelectLabelText(item.label) || item.value;\n });\n }\n };\n}\nfunction normalizeSelectSelection(mode, value) {\n if (mode === \"single\") {\n return typeof value === \"string\" ? value : \"\";\n }\n var values = Array.isArray(value) ? value : [];\n return [\n ...new Set(values)\n ];\n}\nfunction selectedValuesFromSelection(mode, value) {\n var normalized = normalizeSelectSelection(mode, value);\n return mode === \"multiple\" ? normalized : normalized ? [\n normalized\n ] : [];\n}\nfunction createSelectSelectionController(param) {\n var { mode: initialMode, value: initialValue, registry } = param;\n var mode = initialMode;\n var value = normalizeSelectSelection(mode, initialValue);\n var activeIndex = null;\n var selectedValues = function() {\n return selectedValuesFromSelection(mode, value);\n };\n var setMode = function(nextMode) {\n if (mode === nextMode) return value;\n mode = nextMode;\n value = normalizeSelectSelection(mode, value);\n return value;\n };\n var setValue = function(nextValue) {\n value = normalizeSelectSelection(mode, nextValue);\n return value;\n };\n var isSelected = function(itemValue) {\n return selectedValues().includes(itemValue);\n };\n var toggle = function(itemValue) {\n var item = registry.getItem(itemValue);\n if (!item || item.disabled) return value;\n if (mode === \"single\") {\n value = itemValue;\n return value;\n }\n var current = selectedValues();\n value = current.includes(itemValue) ? current.filter(function(currentValue) {\n return currentValue !== itemValue;\n }) : [\n ...current,\n itemValue\n ];\n return value;\n };\n var selectionAnchor = function() {\n var values = selectedValues();\n for (var index = values.length - 1; index >= 0; index--) {\n var item = registry.getItem(values[index]);\n if (item) return item;\n }\n var firstEnabledIndex = registry.firstEnabledIndex();\n return firstEnabledIndex < 0 ? void 0 : registry.getItems()[firstEnabledIndex];\n };\n var selectionAnchorIndex = function() {\n var anchor = selectionAnchor();\n return anchor ? registry.getIndex(anchor.value) : -1;\n };\n var initialActiveIndex = function() {\n var anchorIndex = selectionAnchorIndex();\n var anchor = anchorIndex < 0 ? void 0 : registry.getItems()[anchorIndex];\n return anchor && !anchor.disabled ? anchorIndex : registry.firstEnabledIndex();\n };\n var moveActive = function(direction) {\n var nextIndex = registry.nextEnabledIndex(activeIndex, direction);\n activeIndex = nextIndex < 0 ? null : nextIndex;\n return activeIndex == null ? void 0 : registry.getItems()[activeIndex];\n };\n return {\n registry,\n get mode() {\n return mode;\n },\n get value() {\n return value;\n },\n get activeIndex() {\n return activeIndex;\n },\n get activeItem() {\n return activeIndex == null ? void 0 : registry.getItems()[activeIndex];\n },\n get shouldCloseOnSelect() {\n return mode === \"single\";\n },\n setMode,\n setValue,\n isSelected,\n toggle,\n selectionAnchor,\n selectionAnchorIndex,\n initialActiveIndex,\n setActiveIndex(index) {\n activeIndex = index;\n },\n moveActive\n };\n}\nfunction getSelectListboxProps(mode) {\n return {\n role: \"listbox\",\n \"aria-multiselectable\": mode === \"multiple\" ? true : void 0\n };\n}\nfunction getSelectOptionProps(mode, selected, disabled, platform) {\n if (platform === \"native\") {\n return {\n accessibilityRole: mode === \"multiple\" ? \"checkbox\" : \"button\",\n accessibilityState: {\n selected: mode === \"single\" ? selected : void 0,\n checked: mode === \"multiple\" ? selected : void 0,\n disabled\n }\n };\n }\n return {\n role: \"option\",\n \"aria-selected\": selected,\n \"aria-disabled\": disabled || void 0\n };\n}\nexport {\n createSelectItemRegistry,\n createSelectSelectionController,\n getSelectLabelText,\n getSelectListboxProps,\n getSelectOptionProps,\n normalizeSelectSelection,\n selectedValuesFromSelection\n};\n//# sourceMappingURL=selectionController.js.map\n"],"mappings":";AAAA,SAAS,mBAAmB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;EAC1D,OAAO,OAAO,KAAK;CACrB;CACA,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,OAAO,MAAM,IAAI,kBAAkB,CAAC,CAAC,KAAK,EAAE;CAC9C;CACA,IAAI,SAAS,OAAO,UAAU,YAAY,WAAW,OAAO;EAC1D,IAAI;EACJ,OAAO,oBAAoB,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa,QAAQ;CAC7H;CACA,OAAO;AACT;AACA,SAAS,yBAAyB,UAAU;CAC1C,IAAI,QAAQ,CAAC;CACb,IAAI,qCAAqC,IAAI,IAAI;CACjD,IAAI,qCAAqC,IAAI,IAAI;CACjD,IAAI,4BAA4B,IAAI,IAAI;CACxC,IAAI,4BAA4B,IAAI,IAAI;CACxC,IAAI,eAAe;CACnB,IAAI,SAAS,WAAW;EACtB,eAAe;EACf,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS;EAC7D,UAAU,QAAQ,SAAS,UAAU;GACnC,OAAO,SAAS;EAClB,CAAC;CACH;CACA,IAAI,WAAW,WAAW;EACxB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,SAAS,SAAS,OAAO,KAAK,IAAI,CAAC;CACrD;CACA,IAAI,qBAAqB,WAAW;EAClC,IAAI,cAAc,qBAAqB;EACvC,IAAI,SAAS,cAAc,IAAI,KAAK,IAAI,SAAS,SAAS,CAAC,CAAC;EAC5D,OAAO,UAAU,CAAC,OAAO,WAAW,cAAc,SAAS,kBAAkB;CAC/E;CACA,IAAI,aAAa,SAAS,WAAW;EACnC,IAAI,YAAY,SAAS,iBAAiB,aAAa,SAAS;EAChE,cAAc,YAAY,IAAI,OAAO;EACrC,OAAO,eAAe,OAAO,KAAK,IAAI,SAAS,SAAS,CAAC,CAAC;CAC5D;CACA,OAAO;EACL;EACA,IAAI,OAAO;GACT,OAAO;EACT;EACA,IAAI,QAAQ;GACV,OAAO;EACT;EACA,IAAI,cAAc;GAChB,OAAO;EACT;EACA,IAAI,aAAa;GACf,OAAO,eAAe,OAAO,KAAK,IAAI,SAAS,SAAS,CAAC,CAAC;EAC5D;EACA,IAAI,sBAAsB;GACxB,OAAO,SAAS;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,eAAe,OAAO;GACpB,cAAc;EAChB;EACA;CACF;AACF;AACA,SAAS,sBAAsB,MAAM;CACnC,OAAO;EACL,MAAM;EACN,wBAAwB,SAAS,aAAa,OAAO,KAAK;CAC5D;AACF;AACA,SAAS,qBAAqB,MAAM,UAAU,UAAU,UAAU;CAChE,IAAI,aAAa,UAAU;EACzB,OAAO;GACL,mBAAmB,SAAS,aAAa,aAAa;GACtD,oBAAoB;IAClB,UAAU,SAAS,WAAW,WAAW,KAAK;IAC9C,SAAS,SAAS,aAAa,WAAW,KAAK;IAC/C;GACF;EACF;CACF;CACA,OAAO;EACL,MAAM;EACN,iBAAiB;EACjB,iBAAiB,YAAY,KAAK;CACpC;AACF"}
1
+ {"version":3,"file":"selectionController.native.js","names":[],"sources":["esm/selectionController.native.js"],"sourcesContent":["function getSelectLabelText(label) {\n if (typeof label === \"string\" || typeof label === \"number\") {\n return String(label);\n }\n if (Array.isArray(label)) {\n return label.map(getSelectLabelText).join(\"\");\n }\n if (label && typeof label === \"object\" && \"props\" in label) {\n var _label_props;\n return getSelectLabelText((_label_props = label.props) === null || _label_props === void 0 ? void 0 : _label_props.children);\n }\n return \"\";\n}\nfunction createSelectItemRegistry(onChange) {\n var items = [];\n var labelRegistrations = /* @__PURE__ */ new Map();\n var explicitTextValues = /* @__PURE__ */ new Map();\n var itemNodes = /* @__PURE__ */ new Map();\n var listeners = /* @__PURE__ */ new Set();\n var indexByValue = null;\n var notify = function notify2() {\n indexByValue = null;\n onChange === null || onChange === void 0 ? void 0 : onChange();\n listeners.forEach(function(listener) {\n return listener();\n });\n };\n var getItems = function getItems2() {\n return items;\n };\n var getItem = function getItem2(value) {\n return items.find(function(item) {\n return item.value === value;\n });\n };\n var getIndex = function getIndex2(value) {\n var _indexByValue_get;\n if (!indexByValue) {\n indexByValue = /* @__PURE__ */ new Map();\n items.forEach(function(item, index) {\n if (!indexByValue.has(item.value)) indexByValue.set(item.value, index);\n });\n }\n return (_indexByValue_get = indexByValue.get(value)) !== null && _indexByValue_get !== void 0 ? _indexByValue_get : -1;\n };\n var getNodes = function getNodes2() {\n return items.map(function(item) {\n var _itemNodes_get;\n return (_itemNodes_get = itemNodes.get(item.id)) !== null && _itemNodes_get !== void 0 ? _itemNodes_get : null;\n });\n };\n var getRegisteredLabel = function getRegisteredLabel2(value) {\n var registrations = labelRegistrations.get(value);\n if (!(registrations === null || registrations === void 0 ? void 0 : registrations.size)) return void 0;\n var values = Array.from(registrations.values());\n return values[values.length - 1];\n };\n var applyRegisteredLabel = function applyRegisteredLabel2(value) {\n var registeredLabel = getRegisteredLabel(value);\n var changed = false;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n if (item.value !== value) continue;\n var nextLabel = registeredLabel === null || registeredLabel === void 0 ? void 0 : registeredLabel.label;\n var nextTextValue = explicitTextValues.get(item.id) || (registeredLabel === null || registeredLabel === void 0 ? void 0 : registeredLabel.textValue);\n if (item.label !== nextLabel || item.textValue !== nextTextValue) {\n item.label = nextLabel;\n item.textValue = nextTextValue;\n changed = true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (changed) notify();\n };\n var syncNodeOrder = function syncNodeOrder2() {\n items.sort(function(a, b) {\n var aNode = itemNodes.get(a.id);\n var bNode = itemNodes.get(b.id);\n if (!aNode || !bNode || typeof aNode.compareDocumentPosition !== \"function\") {\n return 0;\n }\n var position = aNode.compareDocumentPosition(bNode);\n if (position & 4) return -1;\n if (position & 2) return 1;\n return 0;\n });\n };\n var registerItem = function registerItem2(item) {\n var _item_textValue;\n var id = Symbol(item.value);\n var registeredLabel = getRegisteredLabel(item.value);\n var registeredItem = {\n ...item,\n ...registeredLabel,\n textValue: (_item_textValue = item.textValue) !== null && _item_textValue !== void 0 ? _item_textValue : registeredLabel === null || registeredLabel === void 0 ? void 0 : registeredLabel.textValue,\n id\n };\n explicitTextValues.set(id, item.textValue);\n items.push(registeredItem);\n notify();\n return {\n id,\n update(next) {\n var index = items.findIndex(function(current2) {\n return current2.id === id;\n });\n if (index < 0) return;\n var current = items[index];\n if (\"textValue\" in next) {\n explicitTextValues.set(id, next.textValue);\n }\n var nextItem = {\n ...current,\n ...next\n };\n if (next.value !== void 0 && next.value !== current.value) {\n var nextLabel = getRegisteredLabel(next.value);\n nextItem.label = nextLabel === null || nextLabel === void 0 ? void 0 : nextLabel.label;\n }\n var explicitTextValue = explicitTextValues.get(id);\n nextItem.textValue = explicitTextValue || getSelectLabelText(nextItem.label) || (nextItem.label ? nextItem.value : void 0);\n var changed = Object.entries(next).some(function(param) {\n var [key, value] = param;\n return current[key] !== value;\n });\n var textValueChanged = current.textValue !== nextItem.textValue;\n if (!changed && !textValueChanged) return;\n items[index] = nextItem;\n notify();\n },\n setNode(node) {\n var _itemNodes_get;\n if (((_itemNodes_get = itemNodes.get(id)) !== null && _itemNodes_get !== void 0 ? _itemNodes_get : null) === (node !== null && node !== void 0 ? node : null)) return;\n if (node) {\n itemNodes.set(id, node);\n syncNodeOrder();\n } else {\n itemNodes.delete(id);\n }\n notify();\n },\n unregister() {\n var index = items.findIndex(function(current) {\n return current.id === id;\n });\n if (index < 0) return;\n items.splice(index, 1);\n explicitTextValues.delete(id);\n itemNodes.delete(id);\n notify();\n }\n };\n };\n var registerLabel = function registerLabel2(value, label, textValue) {\n var _labelRegistrations_get;\n var id = Symbol(value);\n var normalizedTextValue = textValue || getSelectLabelText(label) || value;\n var registrations = (_labelRegistrations_get = labelRegistrations.get(value)) !== null && _labelRegistrations_get !== void 0 ? _labelRegistrations_get : (function() {\n var next = /* @__PURE__ */ new Map();\n labelRegistrations.set(value, next);\n return next;\n })();\n registrations.set(id, {\n label,\n textValue: normalizedTextValue\n });\n applyRegisteredLabel(value);\n return function() {\n registrations.delete(id);\n if (!registrations.size) {\n labelRegistrations.delete(value);\n }\n applyRegisteredLabel(value);\n };\n };\n var firstEnabledIndex = function firstEnabledIndex2() {\n return items.findIndex(function(item) {\n return !item.disabled;\n });\n };\n var nextEnabledIndex = function nextEnabledIndex2(fromIndex, direction) {\n if (!items.length) return -1;\n if (fromIndex == null || fromIndex < 0 || fromIndex >= items.length) {\n if (direction === 1) return firstEnabledIndex();\n for (var index = items.length - 1; index >= 0; index--) {\n if (!items[index].disabled) return index;\n }\n return -1;\n }\n for (var offset = 1; offset <= items.length; offset++) {\n var _items_index;\n var index1 = (fromIndex + direction * offset + items.length) % items.length;\n if (!((_items_index = items[index1]) === null || _items_index === void 0 ? void 0 : _items_index.disabled)) return index1;\n }\n return -1;\n };\n var findTypeaheadIndex = function findTypeaheadIndex2(search, fromIndex) {\n var normalizedSearch = search.trim().toLocaleLowerCase();\n if (!normalizedSearch) return -1;\n var start = fromIndex == null || fromIndex < 0 ? -1 : fromIndex;\n for (var offset = 1; offset <= items.length; offset++) {\n var index = (start + offset) % items.length;\n var item = items[index];\n var label = item.textValue || getSelectLabelText(item.label) || item.value;\n if (!item.disabled && label.toLocaleLowerCase().startsWith(normalizedSearch)) {\n return index;\n }\n }\n return -1;\n };\n return {\n subscribe(listener) {\n listeners.add(listener);\n return function() {\n listeners.delete(listener);\n };\n },\n registerItem,\n registerLabel,\n getItems,\n getItem,\n getIndex,\n getNodes,\n firstEnabledIndex,\n nextEnabledIndex,\n findTypeaheadIndex,\n getDisabledIndices: function getDisabledIndices() {\n return items.flatMap(function(item, index) {\n return item.disabled ? [\n index\n ] : [];\n });\n },\n getTypeaheadLabels: function getTypeaheadLabels() {\n return items.map(function(item) {\n return item.textValue || getSelectLabelText(item.label) || item.value;\n });\n }\n };\n}\nfunction normalizeSelectSelection(mode, value) {\n if (mode === \"single\") {\n return typeof value === \"string\" ? value : \"\";\n }\n var values = Array.isArray(value) ? value : [];\n return [\n ...new Set(values)\n ];\n}\nfunction selectedValuesFromSelection(mode, value) {\n var normalized = normalizeSelectSelection(mode, value);\n return mode === \"multiple\" ? normalized : normalized ? [\n normalized\n ] : [];\n}\nfunction createSelectSelectionController(param) {\n var { mode: initialMode, value: initialValue, registry } = param;\n var mode = initialMode;\n var value = normalizeSelectSelection(mode, initialValue);\n var activeIndex = null;\n var selectedValues = function selectedValues2() {\n return selectedValuesFromSelection(mode, value);\n };\n var setMode = function setMode2(nextMode) {\n if (mode === nextMode) return value;\n mode = nextMode;\n value = normalizeSelectSelection(mode, value);\n return value;\n };\n var setValue = function setValue2(nextValue) {\n value = normalizeSelectSelection(mode, nextValue);\n return value;\n };\n var isSelected = function isSelected2(itemValue) {\n return selectedValues().includes(itemValue);\n };\n var toggle = function toggle2(itemValue) {\n var item = registry.getItem(itemValue);\n if (!item || item.disabled) return value;\n if (mode === \"single\") {\n value = itemValue;\n return value;\n }\n var current = selectedValues();\n value = current.includes(itemValue) ? current.filter(function(currentValue) {\n return currentValue !== itemValue;\n }) : [\n ...current,\n itemValue\n ];\n return value;\n };\n var selectionAnchor = function selectionAnchor2() {\n var values = selectedValues();\n for (var index = values.length - 1; index >= 0; index--) {\n var item = registry.getItem(values[index]);\n if (item) return item;\n }\n var firstEnabledIndex = registry.firstEnabledIndex();\n return firstEnabledIndex < 0 ? void 0 : registry.getItems()[firstEnabledIndex];\n };\n var selectionAnchorIndex = function selectionAnchorIndex2() {\n var anchor = selectionAnchor();\n return anchor ? registry.getIndex(anchor.value) : -1;\n };\n var initialActiveIndex = function initialActiveIndex2() {\n var anchorIndex = selectionAnchorIndex();\n var anchor = anchorIndex < 0 ? void 0 : registry.getItems()[anchorIndex];\n return anchor && !anchor.disabled ? anchorIndex : registry.firstEnabledIndex();\n };\n var moveActive = function moveActive2(direction) {\n var nextIndex = registry.nextEnabledIndex(activeIndex, direction);\n activeIndex = nextIndex < 0 ? null : nextIndex;\n return activeIndex == null ? void 0 : registry.getItems()[activeIndex];\n };\n return {\n registry,\n get mode() {\n return mode;\n },\n get value() {\n return value;\n },\n get activeIndex() {\n return activeIndex;\n },\n get activeItem() {\n return activeIndex == null ? void 0 : registry.getItems()[activeIndex];\n },\n get shouldCloseOnSelect() {\n return mode === \"single\";\n },\n setMode,\n setValue,\n isSelected,\n toggle,\n selectionAnchor,\n selectionAnchorIndex,\n initialActiveIndex,\n setActiveIndex(index) {\n activeIndex = index;\n },\n moveActive\n };\n}\nfunction getSelectListboxProps(mode) {\n return {\n role: \"listbox\",\n \"aria-multiselectable\": mode === \"multiple\" ? true : void 0\n };\n}\nfunction getSelectOptionProps(mode, selected, disabled, platform) {\n if (platform === \"native\") {\n return {\n accessibilityRole: mode === \"multiple\" ? \"checkbox\" : \"button\",\n accessibilityState: {\n selected: mode === \"single\" ? selected : void 0,\n checked: mode === \"multiple\" ? selected : void 0,\n disabled\n }\n };\n }\n return {\n role: \"option\",\n \"aria-selected\": selected,\n \"aria-disabled\": disabled || void 0\n };\n}\nexport {\n createSelectItemRegistry,\n createSelectSelectionController,\n getSelectLabelText,\n getSelectListboxProps,\n getSelectOptionProps,\n normalizeSelectSelection,\n selectedValuesFromSelection\n};\n//# sourceMappingURL=selectionController.js.map\n"],"mappings":";AAAA,SAAS,mBAAmB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;EAC1D,OAAO,OAAO,KAAK;CACrB;CACA,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,OAAO,MAAM,IAAI,kBAAkB,CAAC,CAAC,KAAK,EAAE;CAC9C;CACA,IAAI,SAAS,OAAO,UAAU,YAAY,WAAW,OAAO;EAC1D,IAAI;EACJ,OAAO,oBAAoB,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa,QAAQ;CAC7H;CACA,OAAO;AACT;AACA,SAAS,yBAAyB,UAAU;CAC1C,IAAI,QAAQ,CAAC;CACb,IAAI,qCAAqC,IAAI,IAAI;CACjD,IAAI,qCAAqC,IAAI,IAAI;CACjD,IAAI,4BAA4B,IAAI,IAAI;CACxC,IAAI,4BAA4B,IAAI,IAAI;CACxC,IAAI,eAAe;CACnB,IAAI,SAAS,SAAS,UAAU;EAC9B,eAAe;EACf,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS;EAC7D,UAAU,QAAQ,SAAS,UAAU;GACnC,OAAO,SAAS;EAClB,CAAC;CACH;CACA,IAAI,WAAW,SAAS,YAAY;EAClC,OAAO;CACT;CACA,IAAI,UAAU,SAAS,SAAS,OAAO;EACrC,OAAO,MAAM,KAAK,SAAS,MAAM;GAC/B,OAAO,KAAK,UAAU;EACxB,CAAC;CACH;CACA,IAAI,WAAW,SAAS,UAAU,OAAO;EACvC,IAAI;EACJ,IAAI,CAAC,cAAc;GACjB,+BAA+B,IAAI,IAAI;GACvC,MAA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