react-stately 3.48.0 → 3.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/index.cjs +6 -0
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.js +5 -1
- package/dist/exports/index.js.map +1 -1
- package/dist/exports/index.mjs +5 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/useTokenFieldState.cjs +25 -0
- package/dist/exports/useTokenFieldState.cjs.map +1 -0
- package/dist/exports/useTokenFieldState.js +19 -0
- package/dist/exports/useTokenFieldState.js.map +1 -0
- package/dist/exports/useTokenFieldState.mjs +19 -0
- package/dist/exports/useTokenFieldState.mjs.map +1 -0
- package/dist/private/combobox/useComboBoxState.cjs +2 -1
- package/dist/private/combobox/useComboBoxState.cjs.map +1 -1
- package/dist/private/combobox/useComboBoxState.js +2 -1
- package/dist/private/combobox/useComboBoxState.js.map +1 -1
- package/dist/private/combobox/useComboBoxState.mjs +2 -1
- package/dist/private/combobox/useComboBoxState.mjs.map +1 -1
- package/dist/private/data/useTreeData.cjs +1 -0
- package/dist/private/data/useTreeData.cjs.map +1 -1
- package/dist/private/data/useTreeData.js +1 -0
- package/dist/private/data/useTreeData.js.map +1 -1
- package/dist/private/data/useTreeData.mjs +1 -0
- package/dist/private/data/useTreeData.mjs.map +1 -1
- package/dist/private/datepicker/useDateRangePickerState.cjs +1 -0
- package/dist/private/datepicker/useDateRangePickerState.cjs.map +1 -1
- package/dist/private/datepicker/useDateRangePickerState.js +1 -0
- package/dist/private/datepicker/useDateRangePickerState.js.map +1 -1
- package/dist/private/datepicker/useDateRangePickerState.mjs +1 -0
- package/dist/private/datepicker/useDateRangePickerState.mjs.map +1 -1
- package/dist/private/form/useFormValidationState.cjs +1 -1
- package/dist/private/form/useFormValidationState.cjs.map +1 -1
- package/dist/private/form/useFormValidationState.js +1 -1
- package/dist/private/form/useFormValidationState.js.map +1 -1
- package/dist/private/form/useFormValidationState.mjs +1 -1
- package/dist/private/form/useFormValidationState.mjs.map +1 -1
- package/dist/private/grid/useGridState.cjs +12 -10
- package/dist/private/grid/useGridState.cjs.map +1 -1
- package/dist/private/grid/useGridState.js +12 -10
- package/dist/private/grid/useGridState.js.map +1 -1
- package/dist/private/grid/useGridState.mjs +12 -10
- package/dist/private/grid/useGridState.mjs.map +1 -1
- package/dist/private/layout/ListLayout.cjs +0 -3
- package/dist/private/layout/ListLayout.cjs.map +1 -1
- package/dist/private/layout/ListLayout.js +0 -3
- package/dist/private/layout/ListLayout.js.map +1 -1
- package/dist/private/layout/ListLayout.mjs +0 -3
- package/dist/private/layout/ListLayout.mjs.map +1 -1
- package/dist/private/menu/useMenuTriggerState.cjs.map +1 -1
- package/dist/private/menu/useMenuTriggerState.js.map +1 -1
- package/dist/private/menu/useMenuTriggerState.mjs.map +1 -1
- package/dist/private/menu/useSubmenuTriggerState.cjs +3 -1
- package/dist/private/menu/useSubmenuTriggerState.cjs.map +1 -1
- package/dist/private/menu/useSubmenuTriggerState.js +3 -1
- package/dist/private/menu/useSubmenuTriggerState.js.map +1 -1
- package/dist/private/menu/useSubmenuTriggerState.mjs +3 -1
- package/dist/private/menu/useSubmenuTriggerState.mjs.map +1 -1
- package/dist/private/overlays/useOverlayTriggerState.cjs +4 -1
- package/dist/private/overlays/useOverlayTriggerState.cjs.map +1 -1
- package/dist/private/overlays/useOverlayTriggerState.js +5 -2
- package/dist/private/overlays/useOverlayTriggerState.js.map +1 -1
- package/dist/private/overlays/useOverlayTriggerState.mjs +5 -2
- package/dist/private/overlays/useOverlayTriggerState.mjs.map +1 -1
- package/dist/private/select/useSelectState.cjs +1 -0
- package/dist/private/select/useSelectState.cjs.map +1 -1
- package/dist/private/select/useSelectState.js +1 -0
- package/dist/private/select/useSelectState.js.map +1 -1
- package/dist/private/select/useSelectState.mjs +1 -0
- package/dist/private/select/useSelectState.mjs.map +1 -1
- package/dist/private/slider/useSliderState.cjs.map +1 -1
- package/dist/private/slider/useSliderState.js.map +1 -1
- package/dist/private/slider/useSliderState.mjs.map +1 -1
- package/dist/private/table/TableUtils.cjs +13 -1
- package/dist/private/table/TableUtils.cjs.map +1 -1
- package/dist/private/table/TableUtils.js +13 -1
- package/dist/private/table/TableUtils.js.map +1 -1
- package/dist/private/table/TableUtils.mjs +13 -1
- package/dist/private/table/TableUtils.mjs.map +1 -1
- package/dist/private/table/useTableState.cjs +1 -0
- package/dist/private/table/useTableState.cjs.map +1 -1
- package/dist/private/table/useTableState.js +1 -0
- package/dist/private/table/useTableState.js.map +1 -1
- package/dist/private/table/useTableState.mjs +1 -0
- package/dist/private/table/useTableState.mjs.map +1 -1
- package/dist/private/tokenfield/TokenFieldValue.cjs +287 -0
- package/dist/private/tokenfield/TokenFieldValue.cjs.map +1 -0
- package/dist/private/tokenfield/TokenFieldValue.js +285 -0
- package/dist/private/tokenfield/TokenFieldValue.js.map +1 -0
- package/dist/private/tokenfield/TokenFieldValue.mjs +282 -0
- package/dist/private/tokenfield/TokenFieldValue.mjs.map +1 -0
- package/dist/private/tokenfield/useTokenFieldState.cjs +37 -0
- package/dist/private/tokenfield/useTokenFieldState.cjs.map +1 -0
- package/dist/private/tokenfield/useTokenFieldState.js +32 -0
- package/dist/private/tokenfield/useTokenFieldState.js.map +1 -0
- package/dist/private/tokenfield/useTokenFieldState.mjs +32 -0
- package/dist/private/tokenfield/useTokenFieldState.mjs.map +1 -0
- package/dist/private/tooltip/useTooltipTriggerState.cjs +18 -6
- package/dist/private/tooltip/useTooltipTriggerState.cjs.map +1 -1
- package/dist/private/tooltip/useTooltipTriggerState.js +19 -7
- package/dist/private/tooltip/useTooltipTriggerState.js.map +1 -1
- package/dist/private/tooltip/useTooltipTriggerState.mjs +19 -7
- package/dist/private/tooltip/useTooltipTriggerState.mjs.map +1 -1
- package/dist/private/virtualizer/ScrollAnchor.cjs +136 -0
- package/dist/private/virtualizer/ScrollAnchor.cjs.map +1 -0
- package/dist/private/virtualizer/ScrollAnchor.js +132 -0
- package/dist/private/virtualizer/ScrollAnchor.js.map +1 -0
- package/dist/private/virtualizer/ScrollAnchor.mjs +131 -0
- package/dist/private/virtualizer/ScrollAnchor.mjs.map +1 -0
- package/dist/private/virtualizer/Virtualizer.cjs +50 -1
- package/dist/private/virtualizer/Virtualizer.cjs.map +1 -1
- package/dist/private/virtualizer/Virtualizer.js +54 -1
- package/dist/private/virtualizer/Virtualizer.js.map +1 -1
- package/dist/private/virtualizer/Virtualizer.mjs +50 -1
- package/dist/private/virtualizer/Virtualizer.mjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerState.cjs +2 -1
- package/dist/private/virtualizer/useVirtualizerState.cjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerState.js +2 -1
- package/dist/private/virtualizer/useVirtualizerState.js.map +1 -1
- package/dist/private/virtualizer/useVirtualizerState.mjs +2 -1
- package/dist/private/virtualizer/useVirtualizerState.mjs.map +1 -1
- package/dist/types/exports/index.d.ts +4 -0
- package/dist/types/exports/useTokenFieldState.d.ts +4 -0
- package/dist/types/src/combobox/useComboBoxState.d.ts +1 -1
- package/dist/types/src/menu/useMenuTriggerState.d.ts +1 -1
- package/dist/types/src/overlays/useOverlayTriggerState.d.ts +9 -0
- package/dist/types/src/table/useTableState.d.ts +7 -0
- package/dist/types/src/tokenfield/TokenFieldValue.d.ts +71 -0
- package/dist/types/src/tokenfield/useTokenFieldState.d.ts +19 -0
- package/dist/types/src/tooltip/useTooltipTriggerState.d.ts +5 -0
- package/dist/types/src/virtualizer/ScrollAnchor.d.ts +81 -0
- package/dist/types/src/virtualizer/Virtualizer.d.ts +1 -0
- package/dist/types/src/virtualizer/types.d.ts +2 -0
- package/package.json +5 -5
- package/useTokenFieldState/package.json +5 -0
package/dist/exports/index.cjs
CHANGED
|
@@ -59,6 +59,8 @@ var $bd1b03f208c6df73$exports = require("../private/layout/GridLayout.cjs");
|
|
|
59
59
|
var $d474db7fa4a60716$exports = require("../private/layout/ListLayout.cjs");
|
|
60
60
|
var $779e19dedce4578d$exports = require("../private/layout/TableLayout.cjs");
|
|
61
61
|
var $0853cb57bc04eeb3$exports = require("../private/layout/WaterfallLayout.cjs");
|
|
62
|
+
var $89e7d699d0a0abe4$exports = require("../private/tokenfield/useTokenFieldState.cjs");
|
|
63
|
+
var $8b1d61ca9a986fd4$exports = require("../private/tokenfield/TokenFieldValue.cjs");
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
function $parcel$export(e, n, v, s) {
|
|
@@ -131,6 +133,8 @@ $parcel$export(module.exports, "GridLayout", function () { return $bd1b03f208c6d
|
|
|
131
133
|
$parcel$export(module.exports, "ListLayout", function () { return $d474db7fa4a60716$exports.ListLayout; });
|
|
132
134
|
$parcel$export(module.exports, "TableLayout", function () { return $779e19dedce4578d$exports.TableLayout; });
|
|
133
135
|
$parcel$export(module.exports, "WaterfallLayout", function () { return $0853cb57bc04eeb3$exports.WaterfallLayout; });
|
|
136
|
+
$parcel$export(module.exports, "useTokenFieldState", function () { return $89e7d699d0a0abe4$exports.useTokenFieldState; });
|
|
137
|
+
$parcel$export(module.exports, "TokenFieldValue", function () { return $8b1d61ca9a986fd4$exports.TokenFieldValue; });
|
|
134
138
|
/*
|
|
135
139
|
* Copyright 2020 Adobe. All rights reserved.
|
|
136
140
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -201,6 +205,8 @@ $parcel$export(module.exports, "WaterfallLayout", function () { return $0853cb57
|
|
|
201
205
|
|
|
202
206
|
|
|
203
207
|
|
|
208
|
+
|
|
209
|
+
|
|
204
210
|
|
|
205
211
|
|
|
206
212
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {CalendarState, RangeCalendarState, DateValue} from '../src/calendar/types';\nexport type {CalendarStateOptions, CalendarProps} from '../src/calendar/useCalendarState';\nexport type {\n RangeCalendarStateOptions,\n DateRange,\n RangeCalendarProps\n} from '../src/calendar/useRangeCalendarState';\nexport type {CheckboxGroupProps, CheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport type {\n Color,\n ColorChannel,\n ColorFormat,\n ColorSpace,\n ColorAxes,\n ColorChannelRange\n} from '../src/color/types';\nexport type {ColorAreaProps, ColorAreaState} from '../src/color/useColorAreaState';\nexport type {\n ColorChannelFieldProps,\n ColorChannelFieldState,\n ColorChannelFieldStateOptions\n} from '../src/color/useColorChannelFieldState';\nexport type {ColorFieldProps, ColorFieldState} from '../src/color/useColorFieldState';\nexport type {ColorPickerProps, ColorPickerState} from '../src/color/useColorPickerState';\nexport type {\n ColorSliderState,\n ColorSliderStateOptions,\n ColorSliderProps\n} from '../src/color/useColorSliderState';\nexport type {ColorWheelProps, ColorWheelState} from '../src/color/useColorWheelState';\nexport type {\n ComboBoxState,\n ComboBoxStateOptions,\n ComboBoxProps,\n ComboBoxValidationValue\n} from '../src/combobox/useComboBoxState';\nexport type {\n DateFieldState,\n DateFieldStateOptions,\n DateSegment,\n DateSegmentType,\n DateSegmentType as SegmentType\n} from '../src/datepicker/useDateFieldState';\nexport type {DatePickerState, DatePickerStateOptions} from '../src/datepicker/useDatePickerState';\nexport type {\n DateRangePickerState,\n DateRangePickerStateOptions\n} from '../src/datepicker/useDateRangePickerState';\nexport type {TimeFieldStateOptions, TimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport type {\n DateFieldProps,\n DatePickerProps,\n DateRangePickerProps,\n TimePickerProps,\n TimeValue,\n MappedDateValue,\n MappedTimeValue\n} from '../src/datepicker/types';\nexport type {DisclosureState, DisclosureProps} from '../src/disclosure/useDisclosureState';\nexport type {\n DisclosureGroupState,\n DisclosureGroupProps\n} from '../src/disclosure/useDisclosureGroupState';\nexport type {\n DraggableCollectionStateOptions,\n DraggableCollectionState\n} from '../src/dnd/useDraggableCollectionState';\nexport type {\n DroppableCollectionStateOptions,\n DroppableCollectionState\n} from '../src/dnd/useDroppableCollectionState';\nexport type {\n AsyncListOptions,\n AsyncListData,\n AsyncListLoadFunction,\n AsyncListLoadOptions,\n AsyncListStateUpdate\n} from '../src/data/useAsyncList';\nexport type {ListData, ListOptions} from '../src/data/useListData';\nexport type {TreeData, TreeOptions} from '../src/data/useTreeData';\nexport type {ListProps, ListState} from '../src/list/useListState';\nexport type {\n SingleSelectListProps,\n SingleSelectListState\n} from '../src/list/useSingleSelectListState';\nexport type {\n MenuTriggerProps,\n MenuTriggerState,\n RootMenuTriggerState\n} from '../src/menu/useMenuTriggerState';\nexport type {SubmenuTriggerState, SubmenuTriggerProps} from '../src/menu/useSubmenuTriggerState';\nexport type {\n OverlayTriggerProps,\n OverlayTriggerState\n} from '../src/overlays/useOverlayTriggerState';\nexport type {RadioGroupProps, RadioGroupState} from '../src/radio/useRadioGroupState';\nexport type {SearchFieldProps, SearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport type {SelectProps, SelectState, SelectStateOptions} from '../src/select/useSelectState';\nexport type {SliderState, SliderStateOptions, SliderProps} from '../src/slider/useSliderState';\nexport type {\n MultipleSelectionManager,\n MultipleSelectionState,\n SingleSelectionState,\n FocusState\n} from '../src/selection/types';\nexport type {MultipleSelectionStateProps} from '../src/selection/useMultipleSelectionState';\nexport type {\n NumberFieldState,\n NumberFieldStateOptions,\n NumberFieldProps\n} from '../src/numberfield/useNumberFieldState';\nexport type {TableProps, TableState, TableStateProps} from '../src/table/useTableState';\nexport type {TableHeaderProps} from '../src/table/TableHeader';\nexport type {TableBodyProps} from '../src/table/TableBody';\nexport type {\n ColumnProps,\n ColumnSize,\n ColumnStaticSize,\n ColumnDynamicSize\n} from '../src/table/Column';\nexport type {RowProps} from '../src/table/Row';\nexport type {CellProps} from '../src/table/Cell';\nexport type {\n TableColumnResizeState,\n TableColumnResizeStateProps\n} from '../src/table/useTableColumnResizeState';\nexport type {ITableCollection} from '../src/table/TableCollection';\nexport type {TabListProps, TabListStateOptions, TabListState} from '../src/tabs/useTabListState';\nexport type {\n ToastState,\n QueuedToast,\n ToastStateProps,\n ToastOptions\n} from '../src/toast/useToastState';\nexport type {ToggleProps, ToggleState, ToggleStateOptions} from '../src/toggle/useToggleState';\nexport type {ToggleGroupProps, ToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport type {TooltipTriggerProps, TooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport type {TreeProps, TreeState} from '../src/tree/useTreeState';\nexport type {\n ItemProps,\n Key,\n SectionProps,\n Collection,\n Node,\n Orientation,\n DisabledBehavior,\n Selection,\n SelectionBehavior,\n SelectionMode,\n SortDescriptor,\n SortDirection,\n ValidationState\n} from '@react-types/shared';\nexport type {GridLayoutOptions} from '../src/layout/GridLayout';\nexport type {ListLayoutOptions, LayoutNode} from '../src/layout/ListLayout';\nexport type {TableLayoutProps} from '../src/layout/TableLayout';\nexport type {WaterfallLayoutOptions} from '../src/layout/WaterfallLayout';\nexport type {InvalidationContext} from '../src/virtualizer/types';\nexport type {RectCorner} from '../src/virtualizer/Rect';\nexport type {VirtualizerState} from '../src/virtualizer/useVirtualizerState';\n\nexport {useCalendarState} from '../src/calendar/useCalendarState';\nexport {useRangeCalendarState} from '../src/calendar/useRangeCalendarState';\nexport {useCheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport {getColorChannels, parseColor} from '../src/color/Color';\nexport {useColorAreaState} from '../src/color/useColorAreaState';\nexport {useColorChannelFieldState} from '../src/color/useColorChannelFieldState';\nexport {useColorFieldState} from '../src/color/useColorFieldState';\nexport {useColorPickerState} from '../src/color/useColorPickerState';\nexport {useColorSliderState} from '../src/color/useColorSliderState';\nexport {useColorWheelState} from '../src/color/useColorWheelState';\nexport {useComboBoxState} from '../src/combobox/useComboBoxState';\nexport {useDateFieldState} from '../src/datepicker/useDateFieldState';\nexport {useDatePickerState} from '../src/datepicker/useDatePickerState';\nexport {useDateRangePickerState} from '../src/datepicker/useDateRangePickerState';\nexport {useTimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport {useDisclosureState} from '../src/disclosure/useDisclosureState';\nexport {useDisclosureGroupState} from '../src/disclosure/useDisclosureGroupState';\nexport {useDraggableCollectionState} from '../src/dnd/useDraggableCollectionState';\nexport {useDroppableCollectionState} from '../src/dnd/useDroppableCollectionState';\nexport {Item} from '../src/collections/Item';\nexport {Section} from '../src/collections/Section';\nexport {useCollection} from '../src/collections/useCollection';\nexport {useAsyncList} from '../src/data/useAsyncList';\nexport {useListData} from '../src/data/useListData';\nexport {useTreeData} from '../src/data/useTreeData';\nexport {useListState, UNSTABLE_useFilteredListState} from '../src/list/useListState';\nexport {useSingleSelectListState} from '../src/list/useSingleSelectListState';\nexport {useMenuTriggerState} from '../src/menu/useMenuTriggerState';\nexport {useSubmenuTriggerState} from '../src/menu/useSubmenuTriggerState';\nexport {useNumberFieldState} from '../src/numberfield/useNumberFieldState';\nexport {useOverlayTriggerState} from '../src/overlays/useOverlayTriggerState';\nexport {useRadioGroupState} from '../src/radio/useRadioGroupState';\nexport {useSearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport {useSelectState} from '../src/select/useSelectState';\nexport {useSliderState} from '../src/slider/useSliderState';\nexport {useMultipleSelectionState} from '../src/selection/useMultipleSelectionState';\nexport {useTableState, UNSTABLE_useFilteredTableState} from '../src/table/useTableState';\nexport {TableHeader} from '../src/table/TableHeader';\nexport {TableBody} from '../src/table/TableBody';\nexport {Column} from '../src/table/Column';\nexport {Row} from '../src/table/Row';\nexport {Cell} from '../src/table/Cell';\nexport {useTableColumnResizeState} from '../src/table/useTableColumnResizeState';\nexport {useTabListState} from '../src/tabs/useTabListState';\nexport {useToastState, ToastQueue, useToastQueue} from '../src/toast/useToastState';\nexport {useToggleState} from '../src/toggle/useToggleState';\nexport {useToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport {useTooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport {useTreeState} from '../src/tree/useTreeState';\nexport {FormValidationContext} from '../src/form/useFormValidationState';\nexport {useVirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport {Layout} from '../src/virtualizer/Layout';\nexport {LayoutInfo} from '../src/virtualizer/LayoutInfo';\nexport {Point} from '../src/virtualizer/Point';\nexport {Rect} from '../src/virtualizer/Rect';\nexport {ReusableView} from '../src/virtualizer/ReusableView';\nexport {Size} from '../src/virtualizer/Size';\nexport {GridLayout} from '../src/layout/GridLayout';\nexport {ListLayout} from '../src/layout/ListLayout';\nexport {TableLayout} from '../src/layout/TableLayout';\nexport {WaterfallLayout} from '../src/layout/WaterfallLayout';\n"],"names":[],"version":3,"file":"index.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {CalendarState, RangeCalendarState, DateValue} from '../src/calendar/types';\nexport type {CalendarStateOptions, CalendarProps} from '../src/calendar/useCalendarState';\nexport type {\n RangeCalendarStateOptions,\n DateRange,\n RangeCalendarProps\n} from '../src/calendar/useRangeCalendarState';\nexport type {CheckboxGroupProps, CheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport type {\n Color,\n ColorChannel,\n ColorFormat,\n ColorSpace,\n ColorAxes,\n ColorChannelRange\n} from '../src/color/types';\nexport type {ColorAreaProps, ColorAreaState} from '../src/color/useColorAreaState';\nexport type {\n ColorChannelFieldProps,\n ColorChannelFieldState,\n ColorChannelFieldStateOptions\n} from '../src/color/useColorChannelFieldState';\nexport type {ColorFieldProps, ColorFieldState} from '../src/color/useColorFieldState';\nexport type {ColorPickerProps, ColorPickerState} from '../src/color/useColorPickerState';\nexport type {\n ColorSliderState,\n ColorSliderStateOptions,\n ColorSliderProps\n} from '../src/color/useColorSliderState';\nexport type {ColorWheelProps, ColorWheelState} from '../src/color/useColorWheelState';\nexport type {\n ComboBoxState,\n ComboBoxStateOptions,\n ComboBoxProps,\n ComboBoxValidationValue\n} from '../src/combobox/useComboBoxState';\nexport type {\n DateFieldState,\n DateFieldStateOptions,\n DateSegment,\n DateSegmentType,\n DateSegmentType as SegmentType\n} from '../src/datepicker/useDateFieldState';\nexport type {DatePickerState, DatePickerStateOptions} from '../src/datepicker/useDatePickerState';\nexport type {\n DateRangePickerState,\n DateRangePickerStateOptions\n} from '../src/datepicker/useDateRangePickerState';\nexport type {TimeFieldStateOptions, TimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport type {\n DateFieldProps,\n DatePickerProps,\n DateRangePickerProps,\n TimePickerProps,\n TimeValue,\n MappedDateValue,\n MappedTimeValue\n} from '../src/datepicker/types';\nexport type {DisclosureState, DisclosureProps} from '../src/disclosure/useDisclosureState';\nexport type {\n DisclosureGroupState,\n DisclosureGroupProps\n} from '../src/disclosure/useDisclosureGroupState';\nexport type {\n DraggableCollectionStateOptions,\n DraggableCollectionState\n} from '../src/dnd/useDraggableCollectionState';\nexport type {\n DroppableCollectionStateOptions,\n DroppableCollectionState\n} from '../src/dnd/useDroppableCollectionState';\nexport type {\n AsyncListOptions,\n AsyncListData,\n AsyncListLoadFunction,\n AsyncListLoadOptions,\n AsyncListStateUpdate\n} from '../src/data/useAsyncList';\nexport type {ListData, ListOptions} from '../src/data/useListData';\nexport type {TreeData, TreeOptions} from '../src/data/useTreeData';\nexport type {ListProps, ListState} from '../src/list/useListState';\nexport type {\n SingleSelectListProps,\n SingleSelectListState\n} from '../src/list/useSingleSelectListState';\nexport type {\n MenuTriggerProps,\n MenuTriggerState,\n RootMenuTriggerState\n} from '../src/menu/useMenuTriggerState';\nexport type {SubmenuTriggerState, SubmenuTriggerProps} from '../src/menu/useSubmenuTriggerState';\nexport type {\n OverlayTriggerProps,\n OverlayTriggerState\n} from '../src/overlays/useOverlayTriggerState';\nexport type {RadioGroupProps, RadioGroupState} from '../src/radio/useRadioGroupState';\nexport type {SearchFieldProps, SearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport type {SelectProps, SelectState, SelectStateOptions} from '../src/select/useSelectState';\nexport type {SliderState, SliderStateOptions, SliderProps} from '../src/slider/useSliderState';\nexport type {\n MultipleSelectionManager,\n MultipleSelectionState,\n SingleSelectionState,\n FocusState\n} from '../src/selection/types';\nexport type {MultipleSelectionStateProps} from '../src/selection/useMultipleSelectionState';\nexport type {\n NumberFieldState,\n NumberFieldStateOptions,\n NumberFieldProps\n} from '../src/numberfield/useNumberFieldState';\nexport type {TableProps, TableState, TableStateProps} from '../src/table/useTableState';\nexport type {TableHeaderProps} from '../src/table/TableHeader';\nexport type {TableBodyProps} from '../src/table/TableBody';\nexport type {\n ColumnProps,\n ColumnSize,\n ColumnStaticSize,\n ColumnDynamicSize\n} from '../src/table/Column';\nexport type {RowProps} from '../src/table/Row';\nexport type {CellProps} from '../src/table/Cell';\nexport type {\n TableColumnResizeState,\n TableColumnResizeStateProps\n} from '../src/table/useTableColumnResizeState';\nexport type {ITableCollection} from '../src/table/TableCollection';\nexport type {TabListProps, TabListStateOptions, TabListState} from '../src/tabs/useTabListState';\nexport type {\n ToastState,\n QueuedToast,\n ToastStateProps,\n ToastOptions\n} from '../src/toast/useToastState';\nexport type {ToggleProps, ToggleState, ToggleStateOptions} from '../src/toggle/useToggleState';\nexport type {ToggleGroupProps, ToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport type {TooltipTriggerProps, TooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport type {TreeProps, TreeState} from '../src/tree/useTreeState';\nexport type {\n ItemProps,\n Key,\n SectionProps,\n Collection,\n Node,\n Orientation,\n DisabledBehavior,\n Selection,\n SelectionBehavior,\n SelectionMode,\n SortDescriptor,\n SortDirection,\n ValidationState\n} from '@react-types/shared';\nexport type {GridLayoutOptions} from '../src/layout/GridLayout';\nexport type {ListLayoutOptions, LayoutNode} from '../src/layout/ListLayout';\nexport type {TableLayoutProps} from '../src/layout/TableLayout';\nexport type {WaterfallLayoutOptions} from '../src/layout/WaterfallLayout';\nexport type {InvalidationContext} from '../src/virtualizer/types';\nexport type {RectCorner} from '../src/virtualizer/Rect';\nexport type {VirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport type {TokenFieldProps, TokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport type {\n TokenFieldSegment,\n TextSegment,\n TokenSegment,\n Position,\n TokenFieldValueOptions\n} from '../src/tokenfield/TokenFieldValue';\n\nexport {useCalendarState} from '../src/calendar/useCalendarState';\nexport {useRangeCalendarState} from '../src/calendar/useRangeCalendarState';\nexport {useCheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport {getColorChannels, parseColor} from '../src/color/Color';\nexport {useColorAreaState} from '../src/color/useColorAreaState';\nexport {useColorChannelFieldState} from '../src/color/useColorChannelFieldState';\nexport {useColorFieldState} from '../src/color/useColorFieldState';\nexport {useColorPickerState} from '../src/color/useColorPickerState';\nexport {useColorSliderState} from '../src/color/useColorSliderState';\nexport {useColorWheelState} from '../src/color/useColorWheelState';\nexport {useComboBoxState} from '../src/combobox/useComboBoxState';\nexport {useDateFieldState} from '../src/datepicker/useDateFieldState';\nexport {useDatePickerState} from '../src/datepicker/useDatePickerState';\nexport {useDateRangePickerState} from '../src/datepicker/useDateRangePickerState';\nexport {useTimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport {useDisclosureState} from '../src/disclosure/useDisclosureState';\nexport {useDisclosureGroupState} from '../src/disclosure/useDisclosureGroupState';\nexport {useDraggableCollectionState} from '../src/dnd/useDraggableCollectionState';\nexport {useDroppableCollectionState} from '../src/dnd/useDroppableCollectionState';\nexport {Item} from '../src/collections/Item';\nexport {Section} from '../src/collections/Section';\nexport {useCollection} from '../src/collections/useCollection';\nexport {useAsyncList} from '../src/data/useAsyncList';\nexport {useListData} from '../src/data/useListData';\nexport {useTreeData} from '../src/data/useTreeData';\nexport {useListState, UNSTABLE_useFilteredListState} from '../src/list/useListState';\nexport {useSingleSelectListState} from '../src/list/useSingleSelectListState';\nexport {useMenuTriggerState} from '../src/menu/useMenuTriggerState';\nexport {useSubmenuTriggerState} from '../src/menu/useSubmenuTriggerState';\nexport {useNumberFieldState} from '../src/numberfield/useNumberFieldState';\nexport {useOverlayTriggerState} from '../src/overlays/useOverlayTriggerState';\nexport {useRadioGroupState} from '../src/radio/useRadioGroupState';\nexport {useSearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport {useSelectState} from '../src/select/useSelectState';\nexport {useSliderState} from '../src/slider/useSliderState';\nexport {useMultipleSelectionState} from '../src/selection/useMultipleSelectionState';\nexport {useTableState, UNSTABLE_useFilteredTableState} from '../src/table/useTableState';\nexport {TableHeader} from '../src/table/TableHeader';\nexport {TableBody} from '../src/table/TableBody';\nexport {Column} from '../src/table/Column';\nexport {Row} from '../src/table/Row';\nexport {Cell} from '../src/table/Cell';\nexport {useTableColumnResizeState} from '../src/table/useTableColumnResizeState';\nexport {useTabListState} from '../src/tabs/useTabListState';\nexport {useToastState, ToastQueue, useToastQueue} from '../src/toast/useToastState';\nexport {useToggleState} from '../src/toggle/useToggleState';\nexport {useToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport {useTooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport {useTreeState} from '../src/tree/useTreeState';\nexport {FormValidationContext} from '../src/form/useFormValidationState';\nexport {useVirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport {Layout} from '../src/virtualizer/Layout';\nexport {LayoutInfo} from '../src/virtualizer/LayoutInfo';\nexport {Point} from '../src/virtualizer/Point';\nexport {Rect} from '../src/virtualizer/Rect';\nexport {ReusableView} from '../src/virtualizer/ReusableView';\nexport {Size} from '../src/virtualizer/Size';\nexport {GridLayout} from '../src/layout/GridLayout';\nexport {ListLayout} from '../src/layout/ListLayout';\nexport {TableLayout} from '../src/layout/TableLayout';\nexport {WaterfallLayout} from '../src/layout/WaterfallLayout';\nexport {useTokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport {TokenFieldValue} from '../src/tokenfield/TokenFieldValue';\n"],"names":[],"version":3,"file":"index.cjs.map"}
|
package/dist/exports/index.js
CHANGED
|
@@ -59,6 +59,8 @@ import {GridLayout as $5600a6980c0f940d$export$7d2b12578154a735} from "../privat
|
|
|
59
59
|
import {ListLayout as $f46b9da090161919$export$cacbb3924155d68e} from "../private/layout/ListLayout.js";
|
|
60
60
|
import {TableLayout as $3b3982063797be09$export$62444c3c724b1b20} from "../private/layout/TableLayout.js";
|
|
61
61
|
import {WaterfallLayout as $5f92551cd3597eb4$export$e9f7cda058ba8df8} from "../private/layout/WaterfallLayout.js";
|
|
62
|
+
import {useTokenFieldState as $0cd81fae0bf3e1e8$export$f2f6e9a6aa7f62e7} from "../private/tokenfield/useTokenFieldState.js";
|
|
63
|
+
import {TokenFieldValue as $bb130d0e51bd3001$export$f3decd0c2cd2fe2e} from "../private/tokenfield/TokenFieldValue.js";
|
|
62
64
|
|
|
63
65
|
/*
|
|
64
66
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -133,5 +135,7 @@ import {WaterfallLayout as $5f92551cd3597eb4$export$e9f7cda058ba8df8} from "../p
|
|
|
133
135
|
|
|
134
136
|
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
export {$2ff2cc7e373be77a$export$6d095e787d2b5e1f as useCalendarState, $346f7b0e8cbbe0a3$export$9a987164d97ecc90 as useRangeCalendarState, $65c2b7d22e9bebb9$export$daff6da51032a415 as useCheckboxGroupState, $9be7d47340a9a2a9$export$1c0c08912582810c as getColorChannels, $9be7d47340a9a2a9$export$6e865ea70d7724f as parseColor, $4201442174d64b50$export$6df7f0e2cabc7eef as useColorAreaState, $2a6e4ba192d4a25d$export$b9fc0d69c9190c4a as useColorChannelFieldState, $2e5226d69ff54a9d$export$d52a01683abdfcd6 as useColorFieldState, $875b5a7eabc5c5bf$export$dc6b73b623f8645f as useColorPickerState, $a7195b2e78c1d0c1$export$57bc203e1c9c6d44 as useColorSliderState, $f535989a1003ed3e$export$f4301076d9336137 as useColorWheelState, $164529d83bfc5dce$export$b453a3bfd4a5fa9e as useComboBoxState, $8cbec91a0db21e26$export$60e84778edff6d26 as useDateFieldState, $320a0b92b4d89aaa$export$87194bb378cc3ac2 as useDatePickerState, $74e44fc0182e1a23$export$e50a61c1de9f574 as useDateRangePickerState, $2c2a3876ef5967f8$export$fd53cef0cc796101 as useTimeFieldState, $aeefd058ad35e63e$export$3fcbf6e4407997e0 as useDisclosureState, $eefe38461570519c$export$f36461af0ef4707d as useDisclosureGroupState, $17f1eecf4a5d8104$export$29efd034f1d79f81 as useDraggableCollectionState, $3271431a686e5d3c$export$926850f6ecef79d0 as useDroppableCollectionState, $ab13d866fce74c63$export$6d08773d2e66f8f2 as Item, $8ad228ba3ffca7a7$export$6e2c8f0811a474ce as Section, $70601b00a8062b25$export$6cd28814d92fa9c9 as useCollection, $ea3e5f1954bb0c9f$export$bc3384a35de93d66 as useAsyncList, $edd711f2f244e14b$export$762f73dccccd255d as useListData, $fed32bb7b9c8a2e7$export$d14e1352e21f4a16 as useTreeData, $9148925efdde78ec$export$2f645645f7bca764 as useListState, $9148925efdde78ec$export$ba9d38c0f1bf2b36 as UNSTABLE_useFilteredListState, $3273f0ec0a144ce7$export$e7f05e985daf4b5f as useSingleSelectListState, $521dae7892f4f7a6$export$79fefeb1c2091ac3 as useMenuTriggerState, $9e5f9ad8014b360c$export$cfc51cf86138bf98 as useSubmenuTriggerState, $350d668ac1240cb8$export$7f629e9dc1ecf37c as useNumberFieldState, $3b152ed05cfdb7e2$export$61c6a8c84e605fb6 as useOverlayTriggerState, $14031cfad4eebf54$export$bca9d026f8e704eb as useRadioGroupState, $9221e22059c906a3$export$3f8be18b0f41eaf2 as useSearchFieldState, $1b2568040b4efc20$export$5159ec8b34d4ec12 as useSelectState, $194316de6a67a627$export$e5fda3247f5d67f9 as useSliderState, $8696e7d7c3c9007a$export$253fe78d46329472 as useMultipleSelectionState, $d5cc3b32ccfc476f$export$907bcc6c48325fd6 as useTableState, $d5cc3b32ccfc476f$export$31447e17397b15c2 as UNSTABLE_useFilteredTableState, $f89faf6622679662$export$f850895b287ef28e as TableHeader, $d6a72f1213e17447$export$76ccd210b9029917 as TableBody, $eec6ba5badb1c380$export$816b5d811295e6bc as Column, $2dd4d7d2aced4cb1$export$b59bdbef9ce70de2 as Row, $865a862a32d3d395$export$f6f0c3fe4ec306ea as Cell, $a3a870bb5fb1c40c$export$cb895dcf85db1319 as useTableColumnResizeState, $e0c4cb193ea57829$export$4ba071daf4e486 as useTabListState, $4175972a06e8c575$export$c7b26b20d3ced9c5 as useToastState, $4175972a06e8c575$export$f1f8569633bbbec4 as ToastQueue, $4175972a06e8c575$export$84726ef35ca2129a as useToastQueue, $3e76379ccda9b6f6$export$8042c6c013fd5226 as useToggleState, $078dfae9a3d03e5d$export$8deac67f4addf270 as useToggleGroupState, $d881726242c7a389$export$4d40659c25ecb50b as useTooltipTriggerState, $aebfb5dfb6504297$export$728d6ba534403756 as useTreeState, $d085204f885ad67a$export$571b5131b7e65c11 as FormValidationContext, $29677272e2bb6105$export$1505db82fe357e65 as useVirtualizerState, $bcf18cb0a16f75f6$export$c84671f46d6a1ca as Layout, $dcdbc700dd92e06f$export$7e0eeb9da702a085 as LayoutInfo, $1bbfd9c42d9344e6$export$baf26146a414f24a as Point, $546350db2c358941$export$c79fc6492f3af13d as Rect, $c7620442287ad52a$export$1a5223887c560441 as ReusableView, $266cbd2785be3a2c$export$cb6da89c6af1a8ec as Size, $5600a6980c0f940d$export$7d2b12578154a735 as GridLayout, $f46b9da090161919$export$cacbb3924155d68e as ListLayout, $3b3982063797be09$export$62444c3c724b1b20 as TableLayout, $5f92551cd3597eb4$export$e9f7cda058ba8df8 as WaterfallLayout, $0cd81fae0bf3e1e8$export$f2f6e9a6aa7f62e7 as useTokenFieldState, $bb130d0e51bd3001$export$f3decd0c2cd2fe2e as TokenFieldValue};
|
|
137
141
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {CalendarState, RangeCalendarState, DateValue} from '../src/calendar/types';\nexport type {CalendarStateOptions, CalendarProps} from '../src/calendar/useCalendarState';\nexport type {\n RangeCalendarStateOptions,\n DateRange,\n RangeCalendarProps\n} from '../src/calendar/useRangeCalendarState';\nexport type {CheckboxGroupProps, CheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport type {\n Color,\n ColorChannel,\n ColorFormat,\n ColorSpace,\n ColorAxes,\n ColorChannelRange\n} from '../src/color/types';\nexport type {ColorAreaProps, ColorAreaState} from '../src/color/useColorAreaState';\nexport type {\n ColorChannelFieldProps,\n ColorChannelFieldState,\n ColorChannelFieldStateOptions\n} from '../src/color/useColorChannelFieldState';\nexport type {ColorFieldProps, ColorFieldState} from '../src/color/useColorFieldState';\nexport type {ColorPickerProps, ColorPickerState} from '../src/color/useColorPickerState';\nexport type {\n ColorSliderState,\n ColorSliderStateOptions,\n ColorSliderProps\n} from '../src/color/useColorSliderState';\nexport type {ColorWheelProps, ColorWheelState} from '../src/color/useColorWheelState';\nexport type {\n ComboBoxState,\n ComboBoxStateOptions,\n ComboBoxProps,\n ComboBoxValidationValue\n} from '../src/combobox/useComboBoxState';\nexport type {\n DateFieldState,\n DateFieldStateOptions,\n DateSegment,\n DateSegmentType,\n DateSegmentType as SegmentType\n} from '../src/datepicker/useDateFieldState';\nexport type {DatePickerState, DatePickerStateOptions} from '../src/datepicker/useDatePickerState';\nexport type {\n DateRangePickerState,\n DateRangePickerStateOptions\n} from '../src/datepicker/useDateRangePickerState';\nexport type {TimeFieldStateOptions, TimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport type {\n DateFieldProps,\n DatePickerProps,\n DateRangePickerProps,\n TimePickerProps,\n TimeValue,\n MappedDateValue,\n MappedTimeValue\n} from '../src/datepicker/types';\nexport type {DisclosureState, DisclosureProps} from '../src/disclosure/useDisclosureState';\nexport type {\n DisclosureGroupState,\n DisclosureGroupProps\n} from '../src/disclosure/useDisclosureGroupState';\nexport type {\n DraggableCollectionStateOptions,\n DraggableCollectionState\n} from '../src/dnd/useDraggableCollectionState';\nexport type {\n DroppableCollectionStateOptions,\n DroppableCollectionState\n} from '../src/dnd/useDroppableCollectionState';\nexport type {\n AsyncListOptions,\n AsyncListData,\n AsyncListLoadFunction,\n AsyncListLoadOptions,\n AsyncListStateUpdate\n} from '../src/data/useAsyncList';\nexport type {ListData, ListOptions} from '../src/data/useListData';\nexport type {TreeData, TreeOptions} from '../src/data/useTreeData';\nexport type {ListProps, ListState} from '../src/list/useListState';\nexport type {\n SingleSelectListProps,\n SingleSelectListState\n} from '../src/list/useSingleSelectListState';\nexport type {\n MenuTriggerProps,\n MenuTriggerState,\n RootMenuTriggerState\n} from '../src/menu/useMenuTriggerState';\nexport type {SubmenuTriggerState, SubmenuTriggerProps} from '../src/menu/useSubmenuTriggerState';\nexport type {\n OverlayTriggerProps,\n OverlayTriggerState\n} from '../src/overlays/useOverlayTriggerState';\nexport type {RadioGroupProps, RadioGroupState} from '../src/radio/useRadioGroupState';\nexport type {SearchFieldProps, SearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport type {SelectProps, SelectState, SelectStateOptions} from '../src/select/useSelectState';\nexport type {SliderState, SliderStateOptions, SliderProps} from '../src/slider/useSliderState';\nexport type {\n MultipleSelectionManager,\n MultipleSelectionState,\n SingleSelectionState,\n FocusState\n} from '../src/selection/types';\nexport type {MultipleSelectionStateProps} from '../src/selection/useMultipleSelectionState';\nexport type {\n NumberFieldState,\n NumberFieldStateOptions,\n NumberFieldProps\n} from '../src/numberfield/useNumberFieldState';\nexport type {TableProps, TableState, TableStateProps} from '../src/table/useTableState';\nexport type {TableHeaderProps} from '../src/table/TableHeader';\nexport type {TableBodyProps} from '../src/table/TableBody';\nexport type {\n ColumnProps,\n ColumnSize,\n ColumnStaticSize,\n ColumnDynamicSize\n} from '../src/table/Column';\nexport type {RowProps} from '../src/table/Row';\nexport type {CellProps} from '../src/table/Cell';\nexport type {\n TableColumnResizeState,\n TableColumnResizeStateProps\n} from '../src/table/useTableColumnResizeState';\nexport type {ITableCollection} from '../src/table/TableCollection';\nexport type {TabListProps, TabListStateOptions, TabListState} from '../src/tabs/useTabListState';\nexport type {\n ToastState,\n QueuedToast,\n ToastStateProps,\n ToastOptions\n} from '../src/toast/useToastState';\nexport type {ToggleProps, ToggleState, ToggleStateOptions} from '../src/toggle/useToggleState';\nexport type {ToggleGroupProps, ToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport type {TooltipTriggerProps, TooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport type {TreeProps, TreeState} from '../src/tree/useTreeState';\nexport type {\n ItemProps,\n Key,\n SectionProps,\n Collection,\n Node,\n Orientation,\n DisabledBehavior,\n Selection,\n SelectionBehavior,\n SelectionMode,\n SortDescriptor,\n SortDirection,\n ValidationState\n} from '@react-types/shared';\nexport type {GridLayoutOptions} from '../src/layout/GridLayout';\nexport type {ListLayoutOptions, LayoutNode} from '../src/layout/ListLayout';\nexport type {TableLayoutProps} from '../src/layout/TableLayout';\nexport type {WaterfallLayoutOptions} from '../src/layout/WaterfallLayout';\nexport type {InvalidationContext} from '../src/virtualizer/types';\nexport type {RectCorner} from '../src/virtualizer/Rect';\nexport type {VirtualizerState} from '../src/virtualizer/useVirtualizerState';\n\nexport {useCalendarState} from '../src/calendar/useCalendarState';\nexport {useRangeCalendarState} from '../src/calendar/useRangeCalendarState';\nexport {useCheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport {getColorChannels, parseColor} from '../src/color/Color';\nexport {useColorAreaState} from '../src/color/useColorAreaState';\nexport {useColorChannelFieldState} from '../src/color/useColorChannelFieldState';\nexport {useColorFieldState} from '../src/color/useColorFieldState';\nexport {useColorPickerState} from '../src/color/useColorPickerState';\nexport {useColorSliderState} from '../src/color/useColorSliderState';\nexport {useColorWheelState} from '../src/color/useColorWheelState';\nexport {useComboBoxState} from '../src/combobox/useComboBoxState';\nexport {useDateFieldState} from '../src/datepicker/useDateFieldState';\nexport {useDatePickerState} from '../src/datepicker/useDatePickerState';\nexport {useDateRangePickerState} from '../src/datepicker/useDateRangePickerState';\nexport {useTimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport {useDisclosureState} from '../src/disclosure/useDisclosureState';\nexport {useDisclosureGroupState} from '../src/disclosure/useDisclosureGroupState';\nexport {useDraggableCollectionState} from '../src/dnd/useDraggableCollectionState';\nexport {useDroppableCollectionState} from '../src/dnd/useDroppableCollectionState';\nexport {Item} from '../src/collections/Item';\nexport {Section} from '../src/collections/Section';\nexport {useCollection} from '../src/collections/useCollection';\nexport {useAsyncList} from '../src/data/useAsyncList';\nexport {useListData} from '../src/data/useListData';\nexport {useTreeData} from '../src/data/useTreeData';\nexport {useListState, UNSTABLE_useFilteredListState} from '../src/list/useListState';\nexport {useSingleSelectListState} from '../src/list/useSingleSelectListState';\nexport {useMenuTriggerState} from '../src/menu/useMenuTriggerState';\nexport {useSubmenuTriggerState} from '../src/menu/useSubmenuTriggerState';\nexport {useNumberFieldState} from '../src/numberfield/useNumberFieldState';\nexport {useOverlayTriggerState} from '../src/overlays/useOverlayTriggerState';\nexport {useRadioGroupState} from '../src/radio/useRadioGroupState';\nexport {useSearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport {useSelectState} from '../src/select/useSelectState';\nexport {useSliderState} from '../src/slider/useSliderState';\nexport {useMultipleSelectionState} from '../src/selection/useMultipleSelectionState';\nexport {useTableState, UNSTABLE_useFilteredTableState} from '../src/table/useTableState';\nexport {TableHeader} from '../src/table/TableHeader';\nexport {TableBody} from '../src/table/TableBody';\nexport {Column} from '../src/table/Column';\nexport {Row} from '../src/table/Row';\nexport {Cell} from '../src/table/Cell';\nexport {useTableColumnResizeState} from '../src/table/useTableColumnResizeState';\nexport {useTabListState} from '../src/tabs/useTabListState';\nexport {useToastState, ToastQueue, useToastQueue} from '../src/toast/useToastState';\nexport {useToggleState} from '../src/toggle/useToggleState';\nexport {useToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport {useTooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport {useTreeState} from '../src/tree/useTreeState';\nexport {FormValidationContext} from '../src/form/useFormValidationState';\nexport {useVirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport {Layout} from '../src/virtualizer/Layout';\nexport {LayoutInfo} from '../src/virtualizer/LayoutInfo';\nexport {Point} from '../src/virtualizer/Point';\nexport {Rect} from '../src/virtualizer/Rect';\nexport {ReusableView} from '../src/virtualizer/ReusableView';\nexport {Size} from '../src/virtualizer/Size';\nexport {GridLayout} from '../src/layout/GridLayout';\nexport {ListLayout} from '../src/layout/ListLayout';\nexport {TableLayout} from '../src/layout/TableLayout';\nexport {WaterfallLayout} from '../src/layout/WaterfallLayout';\n"],"names":[],"version":3,"file":"index.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {CalendarState, RangeCalendarState, DateValue} from '../src/calendar/types';\nexport type {CalendarStateOptions, CalendarProps} from '../src/calendar/useCalendarState';\nexport type {\n RangeCalendarStateOptions,\n DateRange,\n RangeCalendarProps\n} from '../src/calendar/useRangeCalendarState';\nexport type {CheckboxGroupProps, CheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport type {\n Color,\n ColorChannel,\n ColorFormat,\n ColorSpace,\n ColorAxes,\n ColorChannelRange\n} from '../src/color/types';\nexport type {ColorAreaProps, ColorAreaState} from '../src/color/useColorAreaState';\nexport type {\n ColorChannelFieldProps,\n ColorChannelFieldState,\n ColorChannelFieldStateOptions\n} from '../src/color/useColorChannelFieldState';\nexport type {ColorFieldProps, ColorFieldState} from '../src/color/useColorFieldState';\nexport type {ColorPickerProps, ColorPickerState} from '../src/color/useColorPickerState';\nexport type {\n ColorSliderState,\n ColorSliderStateOptions,\n ColorSliderProps\n} from '../src/color/useColorSliderState';\nexport type {ColorWheelProps, ColorWheelState} from '../src/color/useColorWheelState';\nexport type {\n ComboBoxState,\n ComboBoxStateOptions,\n ComboBoxProps,\n ComboBoxValidationValue\n} from '../src/combobox/useComboBoxState';\nexport type {\n DateFieldState,\n DateFieldStateOptions,\n DateSegment,\n DateSegmentType,\n DateSegmentType as SegmentType\n} from '../src/datepicker/useDateFieldState';\nexport type {DatePickerState, DatePickerStateOptions} from '../src/datepicker/useDatePickerState';\nexport type {\n DateRangePickerState,\n DateRangePickerStateOptions\n} from '../src/datepicker/useDateRangePickerState';\nexport type {TimeFieldStateOptions, TimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport type {\n DateFieldProps,\n DatePickerProps,\n DateRangePickerProps,\n TimePickerProps,\n TimeValue,\n MappedDateValue,\n MappedTimeValue\n} from '../src/datepicker/types';\nexport type {DisclosureState, DisclosureProps} from '../src/disclosure/useDisclosureState';\nexport type {\n DisclosureGroupState,\n DisclosureGroupProps\n} from '../src/disclosure/useDisclosureGroupState';\nexport type {\n DraggableCollectionStateOptions,\n DraggableCollectionState\n} from '../src/dnd/useDraggableCollectionState';\nexport type {\n DroppableCollectionStateOptions,\n DroppableCollectionState\n} from '../src/dnd/useDroppableCollectionState';\nexport type {\n AsyncListOptions,\n AsyncListData,\n AsyncListLoadFunction,\n AsyncListLoadOptions,\n AsyncListStateUpdate\n} from '../src/data/useAsyncList';\nexport type {ListData, ListOptions} from '../src/data/useListData';\nexport type {TreeData, TreeOptions} from '../src/data/useTreeData';\nexport type {ListProps, ListState} from '../src/list/useListState';\nexport type {\n SingleSelectListProps,\n SingleSelectListState\n} from '../src/list/useSingleSelectListState';\nexport type {\n MenuTriggerProps,\n MenuTriggerState,\n RootMenuTriggerState\n} from '../src/menu/useMenuTriggerState';\nexport type {SubmenuTriggerState, SubmenuTriggerProps} from '../src/menu/useSubmenuTriggerState';\nexport type {\n OverlayTriggerProps,\n OverlayTriggerState\n} from '../src/overlays/useOverlayTriggerState';\nexport type {RadioGroupProps, RadioGroupState} from '../src/radio/useRadioGroupState';\nexport type {SearchFieldProps, SearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport type {SelectProps, SelectState, SelectStateOptions} from '../src/select/useSelectState';\nexport type {SliderState, SliderStateOptions, SliderProps} from '../src/slider/useSliderState';\nexport type {\n MultipleSelectionManager,\n MultipleSelectionState,\n SingleSelectionState,\n FocusState\n} from '../src/selection/types';\nexport type {MultipleSelectionStateProps} from '../src/selection/useMultipleSelectionState';\nexport type {\n NumberFieldState,\n NumberFieldStateOptions,\n NumberFieldProps\n} from '../src/numberfield/useNumberFieldState';\nexport type {TableProps, TableState, TableStateProps} from '../src/table/useTableState';\nexport type {TableHeaderProps} from '../src/table/TableHeader';\nexport type {TableBodyProps} from '../src/table/TableBody';\nexport type {\n ColumnProps,\n ColumnSize,\n ColumnStaticSize,\n ColumnDynamicSize\n} from '../src/table/Column';\nexport type {RowProps} from '../src/table/Row';\nexport type {CellProps} from '../src/table/Cell';\nexport type {\n TableColumnResizeState,\n TableColumnResizeStateProps\n} from '../src/table/useTableColumnResizeState';\nexport type {ITableCollection} from '../src/table/TableCollection';\nexport type {TabListProps, TabListStateOptions, TabListState} from '../src/tabs/useTabListState';\nexport type {\n ToastState,\n QueuedToast,\n ToastStateProps,\n ToastOptions\n} from '../src/toast/useToastState';\nexport type {ToggleProps, ToggleState, ToggleStateOptions} from '../src/toggle/useToggleState';\nexport type {ToggleGroupProps, ToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport type {TooltipTriggerProps, TooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport type {TreeProps, TreeState} from '../src/tree/useTreeState';\nexport type {\n ItemProps,\n Key,\n SectionProps,\n Collection,\n Node,\n Orientation,\n DisabledBehavior,\n Selection,\n SelectionBehavior,\n SelectionMode,\n SortDescriptor,\n SortDirection,\n ValidationState\n} from '@react-types/shared';\nexport type {GridLayoutOptions} from '../src/layout/GridLayout';\nexport type {ListLayoutOptions, LayoutNode} from '../src/layout/ListLayout';\nexport type {TableLayoutProps} from '../src/layout/TableLayout';\nexport type {WaterfallLayoutOptions} from '../src/layout/WaterfallLayout';\nexport type {InvalidationContext} from '../src/virtualizer/types';\nexport type {RectCorner} from '../src/virtualizer/Rect';\nexport type {VirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport type {TokenFieldProps, TokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport type {\n TokenFieldSegment,\n TextSegment,\n TokenSegment,\n Position,\n TokenFieldValueOptions\n} from '../src/tokenfield/TokenFieldValue';\n\nexport {useCalendarState} from '../src/calendar/useCalendarState';\nexport {useRangeCalendarState} from '../src/calendar/useRangeCalendarState';\nexport {useCheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport {getColorChannels, parseColor} from '../src/color/Color';\nexport {useColorAreaState} from '../src/color/useColorAreaState';\nexport {useColorChannelFieldState} from '../src/color/useColorChannelFieldState';\nexport {useColorFieldState} from '../src/color/useColorFieldState';\nexport {useColorPickerState} from '../src/color/useColorPickerState';\nexport {useColorSliderState} from '../src/color/useColorSliderState';\nexport {useColorWheelState} from '../src/color/useColorWheelState';\nexport {useComboBoxState} from '../src/combobox/useComboBoxState';\nexport {useDateFieldState} from '../src/datepicker/useDateFieldState';\nexport {useDatePickerState} from '../src/datepicker/useDatePickerState';\nexport {useDateRangePickerState} from '../src/datepicker/useDateRangePickerState';\nexport {useTimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport {useDisclosureState} from '../src/disclosure/useDisclosureState';\nexport {useDisclosureGroupState} from '../src/disclosure/useDisclosureGroupState';\nexport {useDraggableCollectionState} from '../src/dnd/useDraggableCollectionState';\nexport {useDroppableCollectionState} from '../src/dnd/useDroppableCollectionState';\nexport {Item} from '../src/collections/Item';\nexport {Section} from '../src/collections/Section';\nexport {useCollection} from '../src/collections/useCollection';\nexport {useAsyncList} from '../src/data/useAsyncList';\nexport {useListData} from '../src/data/useListData';\nexport {useTreeData} from '../src/data/useTreeData';\nexport {useListState, UNSTABLE_useFilteredListState} from '../src/list/useListState';\nexport {useSingleSelectListState} from '../src/list/useSingleSelectListState';\nexport {useMenuTriggerState} from '../src/menu/useMenuTriggerState';\nexport {useSubmenuTriggerState} from '../src/menu/useSubmenuTriggerState';\nexport {useNumberFieldState} from '../src/numberfield/useNumberFieldState';\nexport {useOverlayTriggerState} from '../src/overlays/useOverlayTriggerState';\nexport {useRadioGroupState} from '../src/radio/useRadioGroupState';\nexport {useSearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport {useSelectState} from '../src/select/useSelectState';\nexport {useSliderState} from '../src/slider/useSliderState';\nexport {useMultipleSelectionState} from '../src/selection/useMultipleSelectionState';\nexport {useTableState, UNSTABLE_useFilteredTableState} from '../src/table/useTableState';\nexport {TableHeader} from '../src/table/TableHeader';\nexport {TableBody} from '../src/table/TableBody';\nexport {Column} from '../src/table/Column';\nexport {Row} from '../src/table/Row';\nexport {Cell} from '../src/table/Cell';\nexport {useTableColumnResizeState} from '../src/table/useTableColumnResizeState';\nexport {useTabListState} from '../src/tabs/useTabListState';\nexport {useToastState, ToastQueue, useToastQueue} from '../src/toast/useToastState';\nexport {useToggleState} from '../src/toggle/useToggleState';\nexport {useToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport {useTooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport {useTreeState} from '../src/tree/useTreeState';\nexport {FormValidationContext} from '../src/form/useFormValidationState';\nexport {useVirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport {Layout} from '../src/virtualizer/Layout';\nexport {LayoutInfo} from '../src/virtualizer/LayoutInfo';\nexport {Point} from '../src/virtualizer/Point';\nexport {Rect} from '../src/virtualizer/Rect';\nexport {ReusableView} from '../src/virtualizer/ReusableView';\nexport {Size} from '../src/virtualizer/Size';\nexport {GridLayout} from '../src/layout/GridLayout';\nexport {ListLayout} from '../src/layout/ListLayout';\nexport {TableLayout} from '../src/layout/TableLayout';\nexport {WaterfallLayout} from '../src/layout/WaterfallLayout';\nexport {useTokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport {TokenFieldValue} from '../src/tokenfield/TokenFieldValue';\n"],"names":[],"version":3,"file":"index.js.map"}
|
package/dist/exports/index.mjs
CHANGED
|
@@ -59,6 +59,8 @@ import {GridLayout as $fc34f5dff94ff74a$export$7d2b12578154a735} from "../privat
|
|
|
59
59
|
import {ListLayout as $942f06a693c162e2$export$cacbb3924155d68e} from "../private/layout/ListLayout.mjs";
|
|
60
60
|
import {TableLayout as $024b19c559603d56$export$62444c3c724b1b20} from "../private/layout/TableLayout.mjs";
|
|
61
61
|
import {WaterfallLayout as $71719b7c112ce40e$export$e9f7cda058ba8df8} from "../private/layout/WaterfallLayout.mjs";
|
|
62
|
+
import {useTokenFieldState as $df69ee4de894ef40$export$f2f6e9a6aa7f62e7} from "../private/tokenfield/useTokenFieldState.mjs";
|
|
63
|
+
import {TokenFieldValue as $4a46f1c4231e5dde$export$f3decd0c2cd2fe2e} from "../private/tokenfield/TokenFieldValue.mjs";
|
|
62
64
|
|
|
63
65
|
/*
|
|
64
66
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -133,5 +135,7 @@ import {WaterfallLayout as $71719b7c112ce40e$export$e9f7cda058ba8df8} from "../p
|
|
|
133
135
|
|
|
134
136
|
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
export {$ea0ea6e62ae0d7ca$export$6d095e787d2b5e1f as useCalendarState, $a0a87fb6fcfb22ec$export$9a987164d97ecc90 as useRangeCalendarState, $8cd68577ce0207f7$export$daff6da51032a415 as useCheckboxGroupState, $890783418b00a858$export$1c0c08912582810c as getColorChannels, $890783418b00a858$export$6e865ea70d7724f as parseColor, $1f22dbfd2b026cf2$export$6df7f0e2cabc7eef as useColorAreaState, $378fa61546b28d38$export$b9fc0d69c9190c4a as useColorChannelFieldState, $83c2160a93ad557c$export$d52a01683abdfcd6 as useColorFieldState, $f229ad6ed8947519$export$dc6b73b623f8645f as useColorPickerState, $e1eacc05b29dcc25$export$57bc203e1c9c6d44 as useColorSliderState, $40ea08f45638eac2$export$f4301076d9336137 as useColorWheelState, $120eca7b9c40f820$export$b453a3bfd4a5fa9e as useComboBoxState, $8e7461aabf74661f$export$60e84778edff6d26 as useDateFieldState, $28aae683a942e141$export$87194bb378cc3ac2 as useDatePickerState, $6de3e3f1a7663217$export$e50a61c1de9f574 as useDateRangePickerState, $b822555cf9fe955c$export$fd53cef0cc796101 as useTimeFieldState, $086b1fd51041276f$export$3fcbf6e4407997e0 as useDisclosureState, $29a18fa139197b5c$export$f36461af0ef4707d as useDisclosureGroupState, $b2d15a2f12e80349$export$29efd034f1d79f81 as useDraggableCollectionState, $e279703d7ed26e75$export$926850f6ecef79d0 as useDroppableCollectionState, $05678f3aee5e7d1a$export$6d08773d2e66f8f2 as Item, $246727c32dbcf285$export$6e2c8f0811a474ce as Section, $d03379b88399b8c5$export$6cd28814d92fa9c9 as useCollection, $c73d3f3d5ec90946$export$bc3384a35de93d66 as useAsyncList, $232f8dea1b0a4f2f$export$762f73dccccd255d as useListData, $48fd4b7af0dd022e$export$d14e1352e21f4a16 as useTreeData, $b14b6f590b50af39$export$2f645645f7bca764 as useListState, $b14b6f590b50af39$export$ba9d38c0f1bf2b36 as UNSTABLE_useFilteredListState, $0fdb127d377ffd84$export$e7f05e985daf4b5f as useSingleSelectListState, $e3403870bfb691da$export$79fefeb1c2091ac3 as useMenuTriggerState, $5b3242e27644e8f1$export$cfc51cf86138bf98 as useSubmenuTriggerState, $3d0ee518c6f3d04f$export$7f629e9dc1ecf37c as useNumberFieldState, $f11fb0bcf1b2687a$export$61c6a8c84e605fb6 as useOverlayTriggerState, $384704861d32dbed$export$bca9d026f8e704eb as useRadioGroupState, $56baeede9f35e022$export$3f8be18b0f41eaf2 as useSearchFieldState, $29256f53a2edafe9$export$5159ec8b34d4ec12 as useSelectState, $d806310b82f07e9d$export$e5fda3247f5d67f9 as useSliderState, $60f19cefd567a3e4$export$253fe78d46329472 as useMultipleSelectionState, $178a7f94e1b4b497$export$907bcc6c48325fd6 as useTableState, $178a7f94e1b4b497$export$31447e17397b15c2 as UNSTABLE_useFilteredTableState, $69c35e5665163bd0$export$f850895b287ef28e as TableHeader, $bf2d76ed9fa06f12$export$76ccd210b9029917 as TableBody, $6f60280352002908$export$816b5d811295e6bc as Column, $6d3258838ae978da$export$b59bdbef9ce70de2 as Row, $bf42fa5f8ac488ca$export$f6f0c3fe4ec306ea as Cell, $f6cebac1c03d2516$export$cb895dcf85db1319 as useTableColumnResizeState, $caeb030f09a278a1$export$4ba071daf4e486 as useTabListState, $ac6ee1e83ff78022$export$c7b26b20d3ced9c5 as useToastState, $ac6ee1e83ff78022$export$f1f8569633bbbec4 as ToastQueue, $ac6ee1e83ff78022$export$84726ef35ca2129a as useToastQueue, $fd3c5e01e837dc20$export$8042c6c013fd5226 as useToggleState, $3d8ad31c4c1725e9$export$8deac67f4addf270 as useToggleGroupState, $3834487504f4fc00$export$4d40659c25ecb50b as useTooltipTriggerState, $6b915bde6cd300dd$export$728d6ba534403756 as useTreeState, $fd2148440a13ec26$export$571b5131b7e65c11 as FormValidationContext, $51e619e0f141c3ec$export$1505db82fe357e65 as useVirtualizerState, $85410e0c3cc54f1d$export$c84671f46d6a1ca as Layout, $eb6255cbf080eb7d$export$7e0eeb9da702a085 as LayoutInfo, $b88f793813fc795e$export$baf26146a414f24a as Point, $af827553fd3cf456$export$c79fc6492f3af13d as Rect, $6bbafa22c92cc056$export$1a5223887c560441 as ReusableView, $cc8e610d5d6e3fe4$export$cb6da89c6af1a8ec as Size, $fc34f5dff94ff74a$export$7d2b12578154a735 as GridLayout, $942f06a693c162e2$export$cacbb3924155d68e as ListLayout, $024b19c559603d56$export$62444c3c724b1b20 as TableLayout, $71719b7c112ce40e$export$e9f7cda058ba8df8 as WaterfallLayout, $df69ee4de894ef40$export$f2f6e9a6aa7f62e7 as useTokenFieldState, $4a46f1c4231e5dde$export$f3decd0c2cd2fe2e as TokenFieldValue};
|
|
137
141
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {CalendarState, RangeCalendarState, DateValue} from '../src/calendar/types';\nexport type {CalendarStateOptions, CalendarProps} from '../src/calendar/useCalendarState';\nexport type {\n RangeCalendarStateOptions,\n DateRange,\n RangeCalendarProps\n} from '../src/calendar/useRangeCalendarState';\nexport type {CheckboxGroupProps, CheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport type {\n Color,\n ColorChannel,\n ColorFormat,\n ColorSpace,\n ColorAxes,\n ColorChannelRange\n} from '../src/color/types';\nexport type {ColorAreaProps, ColorAreaState} from '../src/color/useColorAreaState';\nexport type {\n ColorChannelFieldProps,\n ColorChannelFieldState,\n ColorChannelFieldStateOptions\n} from '../src/color/useColorChannelFieldState';\nexport type {ColorFieldProps, ColorFieldState} from '../src/color/useColorFieldState';\nexport type {ColorPickerProps, ColorPickerState} from '../src/color/useColorPickerState';\nexport type {\n ColorSliderState,\n ColorSliderStateOptions,\n ColorSliderProps\n} from '../src/color/useColorSliderState';\nexport type {ColorWheelProps, ColorWheelState} from '../src/color/useColorWheelState';\nexport type {\n ComboBoxState,\n ComboBoxStateOptions,\n ComboBoxProps,\n ComboBoxValidationValue\n} from '../src/combobox/useComboBoxState';\nexport type {\n DateFieldState,\n DateFieldStateOptions,\n DateSegment,\n DateSegmentType,\n DateSegmentType as SegmentType\n} from '../src/datepicker/useDateFieldState';\nexport type {DatePickerState, DatePickerStateOptions} from '../src/datepicker/useDatePickerState';\nexport type {\n DateRangePickerState,\n DateRangePickerStateOptions\n} from '../src/datepicker/useDateRangePickerState';\nexport type {TimeFieldStateOptions, TimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport type {\n DateFieldProps,\n DatePickerProps,\n DateRangePickerProps,\n TimePickerProps,\n TimeValue,\n MappedDateValue,\n MappedTimeValue\n} from '../src/datepicker/types';\nexport type {DisclosureState, DisclosureProps} from '../src/disclosure/useDisclosureState';\nexport type {\n DisclosureGroupState,\n DisclosureGroupProps\n} from '../src/disclosure/useDisclosureGroupState';\nexport type {\n DraggableCollectionStateOptions,\n DraggableCollectionState\n} from '../src/dnd/useDraggableCollectionState';\nexport type {\n DroppableCollectionStateOptions,\n DroppableCollectionState\n} from '../src/dnd/useDroppableCollectionState';\nexport type {\n AsyncListOptions,\n AsyncListData,\n AsyncListLoadFunction,\n AsyncListLoadOptions,\n AsyncListStateUpdate\n} from '../src/data/useAsyncList';\nexport type {ListData, ListOptions} from '../src/data/useListData';\nexport type {TreeData, TreeOptions} from '../src/data/useTreeData';\nexport type {ListProps, ListState} from '../src/list/useListState';\nexport type {\n SingleSelectListProps,\n SingleSelectListState\n} from '../src/list/useSingleSelectListState';\nexport type {\n MenuTriggerProps,\n MenuTriggerState,\n RootMenuTriggerState\n} from '../src/menu/useMenuTriggerState';\nexport type {SubmenuTriggerState, SubmenuTriggerProps} from '../src/menu/useSubmenuTriggerState';\nexport type {\n OverlayTriggerProps,\n OverlayTriggerState\n} from '../src/overlays/useOverlayTriggerState';\nexport type {RadioGroupProps, RadioGroupState} from '../src/radio/useRadioGroupState';\nexport type {SearchFieldProps, SearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport type {SelectProps, SelectState, SelectStateOptions} from '../src/select/useSelectState';\nexport type {SliderState, SliderStateOptions, SliderProps} from '../src/slider/useSliderState';\nexport type {\n MultipleSelectionManager,\n MultipleSelectionState,\n SingleSelectionState,\n FocusState\n} from '../src/selection/types';\nexport type {MultipleSelectionStateProps} from '../src/selection/useMultipleSelectionState';\nexport type {\n NumberFieldState,\n NumberFieldStateOptions,\n NumberFieldProps\n} from '../src/numberfield/useNumberFieldState';\nexport type {TableProps, TableState, TableStateProps} from '../src/table/useTableState';\nexport type {TableHeaderProps} from '../src/table/TableHeader';\nexport type {TableBodyProps} from '../src/table/TableBody';\nexport type {\n ColumnProps,\n ColumnSize,\n ColumnStaticSize,\n ColumnDynamicSize\n} from '../src/table/Column';\nexport type {RowProps} from '../src/table/Row';\nexport type {CellProps} from '../src/table/Cell';\nexport type {\n TableColumnResizeState,\n TableColumnResizeStateProps\n} from '../src/table/useTableColumnResizeState';\nexport type {ITableCollection} from '../src/table/TableCollection';\nexport type {TabListProps, TabListStateOptions, TabListState} from '../src/tabs/useTabListState';\nexport type {\n ToastState,\n QueuedToast,\n ToastStateProps,\n ToastOptions\n} from '../src/toast/useToastState';\nexport type {ToggleProps, ToggleState, ToggleStateOptions} from '../src/toggle/useToggleState';\nexport type {ToggleGroupProps, ToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport type {TooltipTriggerProps, TooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport type {TreeProps, TreeState} from '../src/tree/useTreeState';\nexport type {\n ItemProps,\n Key,\n SectionProps,\n Collection,\n Node,\n Orientation,\n DisabledBehavior,\n Selection,\n SelectionBehavior,\n SelectionMode,\n SortDescriptor,\n SortDirection,\n ValidationState\n} from '@react-types/shared';\nexport type {GridLayoutOptions} from '../src/layout/GridLayout';\nexport type {ListLayoutOptions, LayoutNode} from '../src/layout/ListLayout';\nexport type {TableLayoutProps} from '../src/layout/TableLayout';\nexport type {WaterfallLayoutOptions} from '../src/layout/WaterfallLayout';\nexport type {InvalidationContext} from '../src/virtualizer/types';\nexport type {RectCorner} from '../src/virtualizer/Rect';\nexport type {VirtualizerState} from '../src/virtualizer/useVirtualizerState';\n\nexport {useCalendarState} from '../src/calendar/useCalendarState';\nexport {useRangeCalendarState} from '../src/calendar/useRangeCalendarState';\nexport {useCheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport {getColorChannels, parseColor} from '../src/color/Color';\nexport {useColorAreaState} from '../src/color/useColorAreaState';\nexport {useColorChannelFieldState} from '../src/color/useColorChannelFieldState';\nexport {useColorFieldState} from '../src/color/useColorFieldState';\nexport {useColorPickerState} from '../src/color/useColorPickerState';\nexport {useColorSliderState} from '../src/color/useColorSliderState';\nexport {useColorWheelState} from '../src/color/useColorWheelState';\nexport {useComboBoxState} from '../src/combobox/useComboBoxState';\nexport {useDateFieldState} from '../src/datepicker/useDateFieldState';\nexport {useDatePickerState} from '../src/datepicker/useDatePickerState';\nexport {useDateRangePickerState} from '../src/datepicker/useDateRangePickerState';\nexport {useTimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport {useDisclosureState} from '../src/disclosure/useDisclosureState';\nexport {useDisclosureGroupState} from '../src/disclosure/useDisclosureGroupState';\nexport {useDraggableCollectionState} from '../src/dnd/useDraggableCollectionState';\nexport {useDroppableCollectionState} from '../src/dnd/useDroppableCollectionState';\nexport {Item} from '../src/collections/Item';\nexport {Section} from '../src/collections/Section';\nexport {useCollection} from '../src/collections/useCollection';\nexport {useAsyncList} from '../src/data/useAsyncList';\nexport {useListData} from '../src/data/useListData';\nexport {useTreeData} from '../src/data/useTreeData';\nexport {useListState, UNSTABLE_useFilteredListState} from '../src/list/useListState';\nexport {useSingleSelectListState} from '../src/list/useSingleSelectListState';\nexport {useMenuTriggerState} from '../src/menu/useMenuTriggerState';\nexport {useSubmenuTriggerState} from '../src/menu/useSubmenuTriggerState';\nexport {useNumberFieldState} from '../src/numberfield/useNumberFieldState';\nexport {useOverlayTriggerState} from '../src/overlays/useOverlayTriggerState';\nexport {useRadioGroupState} from '../src/radio/useRadioGroupState';\nexport {useSearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport {useSelectState} from '../src/select/useSelectState';\nexport {useSliderState} from '../src/slider/useSliderState';\nexport {useMultipleSelectionState} from '../src/selection/useMultipleSelectionState';\nexport {useTableState, UNSTABLE_useFilteredTableState} from '../src/table/useTableState';\nexport {TableHeader} from '../src/table/TableHeader';\nexport {TableBody} from '../src/table/TableBody';\nexport {Column} from '../src/table/Column';\nexport {Row} from '../src/table/Row';\nexport {Cell} from '../src/table/Cell';\nexport {useTableColumnResizeState} from '../src/table/useTableColumnResizeState';\nexport {useTabListState} from '../src/tabs/useTabListState';\nexport {useToastState, ToastQueue, useToastQueue} from '../src/toast/useToastState';\nexport {useToggleState} from '../src/toggle/useToggleState';\nexport {useToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport {useTooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport {useTreeState} from '../src/tree/useTreeState';\nexport {FormValidationContext} from '../src/form/useFormValidationState';\nexport {useVirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport {Layout} from '../src/virtualizer/Layout';\nexport {LayoutInfo} from '../src/virtualizer/LayoutInfo';\nexport {Point} from '../src/virtualizer/Point';\nexport {Rect} from '../src/virtualizer/Rect';\nexport {ReusableView} from '../src/virtualizer/ReusableView';\nexport {Size} from '../src/virtualizer/Size';\nexport {GridLayout} from '../src/layout/GridLayout';\nexport {ListLayout} from '../src/layout/ListLayout';\nexport {TableLayout} from '../src/layout/TableLayout';\nexport {WaterfallLayout} from '../src/layout/WaterfallLayout';\n"],"names":[],"version":3,"file":"index.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {CalendarState, RangeCalendarState, DateValue} from '../src/calendar/types';\nexport type {CalendarStateOptions, CalendarProps} from '../src/calendar/useCalendarState';\nexport type {\n RangeCalendarStateOptions,\n DateRange,\n RangeCalendarProps\n} from '../src/calendar/useRangeCalendarState';\nexport type {CheckboxGroupProps, CheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport type {\n Color,\n ColorChannel,\n ColorFormat,\n ColorSpace,\n ColorAxes,\n ColorChannelRange\n} from '../src/color/types';\nexport type {ColorAreaProps, ColorAreaState} from '../src/color/useColorAreaState';\nexport type {\n ColorChannelFieldProps,\n ColorChannelFieldState,\n ColorChannelFieldStateOptions\n} from '../src/color/useColorChannelFieldState';\nexport type {ColorFieldProps, ColorFieldState} from '../src/color/useColorFieldState';\nexport type {ColorPickerProps, ColorPickerState} from '../src/color/useColorPickerState';\nexport type {\n ColorSliderState,\n ColorSliderStateOptions,\n ColorSliderProps\n} from '../src/color/useColorSliderState';\nexport type {ColorWheelProps, ColorWheelState} from '../src/color/useColorWheelState';\nexport type {\n ComboBoxState,\n ComboBoxStateOptions,\n ComboBoxProps,\n ComboBoxValidationValue\n} from '../src/combobox/useComboBoxState';\nexport type {\n DateFieldState,\n DateFieldStateOptions,\n DateSegment,\n DateSegmentType,\n DateSegmentType as SegmentType\n} from '../src/datepicker/useDateFieldState';\nexport type {DatePickerState, DatePickerStateOptions} from '../src/datepicker/useDatePickerState';\nexport type {\n DateRangePickerState,\n DateRangePickerStateOptions\n} from '../src/datepicker/useDateRangePickerState';\nexport type {TimeFieldStateOptions, TimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport type {\n DateFieldProps,\n DatePickerProps,\n DateRangePickerProps,\n TimePickerProps,\n TimeValue,\n MappedDateValue,\n MappedTimeValue\n} from '../src/datepicker/types';\nexport type {DisclosureState, DisclosureProps} from '../src/disclosure/useDisclosureState';\nexport type {\n DisclosureGroupState,\n DisclosureGroupProps\n} from '../src/disclosure/useDisclosureGroupState';\nexport type {\n DraggableCollectionStateOptions,\n DraggableCollectionState\n} from '../src/dnd/useDraggableCollectionState';\nexport type {\n DroppableCollectionStateOptions,\n DroppableCollectionState\n} from '../src/dnd/useDroppableCollectionState';\nexport type {\n AsyncListOptions,\n AsyncListData,\n AsyncListLoadFunction,\n AsyncListLoadOptions,\n AsyncListStateUpdate\n} from '../src/data/useAsyncList';\nexport type {ListData, ListOptions} from '../src/data/useListData';\nexport type {TreeData, TreeOptions} from '../src/data/useTreeData';\nexport type {ListProps, ListState} from '../src/list/useListState';\nexport type {\n SingleSelectListProps,\n SingleSelectListState\n} from '../src/list/useSingleSelectListState';\nexport type {\n MenuTriggerProps,\n MenuTriggerState,\n RootMenuTriggerState\n} from '../src/menu/useMenuTriggerState';\nexport type {SubmenuTriggerState, SubmenuTriggerProps} from '../src/menu/useSubmenuTriggerState';\nexport type {\n OverlayTriggerProps,\n OverlayTriggerState\n} from '../src/overlays/useOverlayTriggerState';\nexport type {RadioGroupProps, RadioGroupState} from '../src/radio/useRadioGroupState';\nexport type {SearchFieldProps, SearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport type {SelectProps, SelectState, SelectStateOptions} from '../src/select/useSelectState';\nexport type {SliderState, SliderStateOptions, SliderProps} from '../src/slider/useSliderState';\nexport type {\n MultipleSelectionManager,\n MultipleSelectionState,\n SingleSelectionState,\n FocusState\n} from '../src/selection/types';\nexport type {MultipleSelectionStateProps} from '../src/selection/useMultipleSelectionState';\nexport type {\n NumberFieldState,\n NumberFieldStateOptions,\n NumberFieldProps\n} from '../src/numberfield/useNumberFieldState';\nexport type {TableProps, TableState, TableStateProps} from '../src/table/useTableState';\nexport type {TableHeaderProps} from '../src/table/TableHeader';\nexport type {TableBodyProps} from '../src/table/TableBody';\nexport type {\n ColumnProps,\n ColumnSize,\n ColumnStaticSize,\n ColumnDynamicSize\n} from '../src/table/Column';\nexport type {RowProps} from '../src/table/Row';\nexport type {CellProps} from '../src/table/Cell';\nexport type {\n TableColumnResizeState,\n TableColumnResizeStateProps\n} from '../src/table/useTableColumnResizeState';\nexport type {ITableCollection} from '../src/table/TableCollection';\nexport type {TabListProps, TabListStateOptions, TabListState} from '../src/tabs/useTabListState';\nexport type {\n ToastState,\n QueuedToast,\n ToastStateProps,\n ToastOptions\n} from '../src/toast/useToastState';\nexport type {ToggleProps, ToggleState, ToggleStateOptions} from '../src/toggle/useToggleState';\nexport type {ToggleGroupProps, ToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport type {TooltipTriggerProps, TooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport type {TreeProps, TreeState} from '../src/tree/useTreeState';\nexport type {\n ItemProps,\n Key,\n SectionProps,\n Collection,\n Node,\n Orientation,\n DisabledBehavior,\n Selection,\n SelectionBehavior,\n SelectionMode,\n SortDescriptor,\n SortDirection,\n ValidationState\n} from '@react-types/shared';\nexport type {GridLayoutOptions} from '../src/layout/GridLayout';\nexport type {ListLayoutOptions, LayoutNode} from '../src/layout/ListLayout';\nexport type {TableLayoutProps} from '../src/layout/TableLayout';\nexport type {WaterfallLayoutOptions} from '../src/layout/WaterfallLayout';\nexport type {InvalidationContext} from '../src/virtualizer/types';\nexport type {RectCorner} from '../src/virtualizer/Rect';\nexport type {VirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport type {TokenFieldProps, TokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport type {\n TokenFieldSegment,\n TextSegment,\n TokenSegment,\n Position,\n TokenFieldValueOptions\n} from '../src/tokenfield/TokenFieldValue';\n\nexport {useCalendarState} from '../src/calendar/useCalendarState';\nexport {useRangeCalendarState} from '../src/calendar/useRangeCalendarState';\nexport {useCheckboxGroupState} from '../src/checkbox/useCheckboxGroupState';\nexport {getColorChannels, parseColor} from '../src/color/Color';\nexport {useColorAreaState} from '../src/color/useColorAreaState';\nexport {useColorChannelFieldState} from '../src/color/useColorChannelFieldState';\nexport {useColorFieldState} from '../src/color/useColorFieldState';\nexport {useColorPickerState} from '../src/color/useColorPickerState';\nexport {useColorSliderState} from '../src/color/useColorSliderState';\nexport {useColorWheelState} from '../src/color/useColorWheelState';\nexport {useComboBoxState} from '../src/combobox/useComboBoxState';\nexport {useDateFieldState} from '../src/datepicker/useDateFieldState';\nexport {useDatePickerState} from '../src/datepicker/useDatePickerState';\nexport {useDateRangePickerState} from '../src/datepicker/useDateRangePickerState';\nexport {useTimeFieldState} from '../src/datepicker/useTimeFieldState';\nexport {useDisclosureState} from '../src/disclosure/useDisclosureState';\nexport {useDisclosureGroupState} from '../src/disclosure/useDisclosureGroupState';\nexport {useDraggableCollectionState} from '../src/dnd/useDraggableCollectionState';\nexport {useDroppableCollectionState} from '../src/dnd/useDroppableCollectionState';\nexport {Item} from '../src/collections/Item';\nexport {Section} from '../src/collections/Section';\nexport {useCollection} from '../src/collections/useCollection';\nexport {useAsyncList} from '../src/data/useAsyncList';\nexport {useListData} from '../src/data/useListData';\nexport {useTreeData} from '../src/data/useTreeData';\nexport {useListState, UNSTABLE_useFilteredListState} from '../src/list/useListState';\nexport {useSingleSelectListState} from '../src/list/useSingleSelectListState';\nexport {useMenuTriggerState} from '../src/menu/useMenuTriggerState';\nexport {useSubmenuTriggerState} from '../src/menu/useSubmenuTriggerState';\nexport {useNumberFieldState} from '../src/numberfield/useNumberFieldState';\nexport {useOverlayTriggerState} from '../src/overlays/useOverlayTriggerState';\nexport {useRadioGroupState} from '../src/radio/useRadioGroupState';\nexport {useSearchFieldState} from '../src/searchfield/useSearchFieldState';\nexport {useSelectState} from '../src/select/useSelectState';\nexport {useSliderState} from '../src/slider/useSliderState';\nexport {useMultipleSelectionState} from '../src/selection/useMultipleSelectionState';\nexport {useTableState, UNSTABLE_useFilteredTableState} from '../src/table/useTableState';\nexport {TableHeader} from '../src/table/TableHeader';\nexport {TableBody} from '../src/table/TableBody';\nexport {Column} from '../src/table/Column';\nexport {Row} from '../src/table/Row';\nexport {Cell} from '../src/table/Cell';\nexport {useTableColumnResizeState} from '../src/table/useTableColumnResizeState';\nexport {useTabListState} from '../src/tabs/useTabListState';\nexport {useToastState, ToastQueue, useToastQueue} from '../src/toast/useToastState';\nexport {useToggleState} from '../src/toggle/useToggleState';\nexport {useToggleGroupState} from '../src/toggle/useToggleGroupState';\nexport {useTooltipTriggerState} from '../src/tooltip/useTooltipTriggerState';\nexport {useTreeState} from '../src/tree/useTreeState';\nexport {FormValidationContext} from '../src/form/useFormValidationState';\nexport {useVirtualizerState} from '../src/virtualizer/useVirtualizerState';\nexport {Layout} from '../src/virtualizer/Layout';\nexport {LayoutInfo} from '../src/virtualizer/LayoutInfo';\nexport {Point} from '../src/virtualizer/Point';\nexport {Rect} from '../src/virtualizer/Rect';\nexport {ReusableView} from '../src/virtualizer/ReusableView';\nexport {Size} from '../src/virtualizer/Size';\nexport {GridLayout} from '../src/layout/GridLayout';\nexport {ListLayout} from '../src/layout/ListLayout';\nexport {TableLayout} from '../src/layout/TableLayout';\nexport {WaterfallLayout} from '../src/layout/WaterfallLayout';\nexport {useTokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport {TokenFieldValue} from '../src/tokenfield/TokenFieldValue';\n"],"names":[],"version":3,"file":"index.mjs.map"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var $89e7d699d0a0abe4$exports = require("../private/tokenfield/useTokenFieldState.cjs");
|
|
2
|
+
var $8b1d61ca9a986fd4$exports = require("../private/tokenfield/TokenFieldValue.cjs");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$parcel$export(module.exports, "useTokenFieldState", function () { return $89e7d699d0a0abe4$exports.useTokenFieldState; });
|
|
10
|
+
$parcel$export(module.exports, "TokenFieldValue", function () { return $8b1d61ca9a986fd4$exports.TokenFieldValue; });
|
|
11
|
+
/*
|
|
12
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
13
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
+
* governing permissions and limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=useTokenFieldState.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/useTokenFieldState.ts"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport {TokenFieldValue} from '../src/tokenfield/TokenFieldValue';\n\nexport type {TokenFieldProps, TokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport type {\n TokenFieldSegment,\n TokenSegment,\n TextSegment,\n Position,\n TokenFieldValueOptions\n} from '../src/tokenfield/TokenFieldValue';\n"],"names":[],"version":3,"file":"useTokenFieldState.cjs.map"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {useTokenFieldState as $0cd81fae0bf3e1e8$export$f2f6e9a6aa7f62e7} from "../private/tokenfield/useTokenFieldState.js";
|
|
2
|
+
import {TokenFieldValue as $bb130d0e51bd3001$export$f3decd0c2cd2fe2e} from "../private/tokenfield/TokenFieldValue.js";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export {$0cd81fae0bf3e1e8$export$f2f6e9a6aa7f62e7 as useTokenFieldState, $bb130d0e51bd3001$export$f3decd0c2cd2fe2e as TokenFieldValue};
|
|
19
|
+
//# sourceMappingURL=useTokenFieldState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/useTokenFieldState.ts"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport {TokenFieldValue} from '../src/tokenfield/TokenFieldValue';\n\nexport type {TokenFieldProps, TokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport type {\n TokenFieldSegment,\n TokenSegment,\n TextSegment,\n Position,\n TokenFieldValueOptions\n} from '../src/tokenfield/TokenFieldValue';\n"],"names":[],"version":3,"file":"useTokenFieldState.js.map"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {useTokenFieldState as $df69ee4de894ef40$export$f2f6e9a6aa7f62e7} from "../private/tokenfield/useTokenFieldState.mjs";
|
|
2
|
+
import {TokenFieldValue as $4a46f1c4231e5dde$export$f3decd0c2cd2fe2e} from "../private/tokenfield/TokenFieldValue.mjs";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export {$df69ee4de894ef40$export$f2f6e9a6aa7f62e7 as useTokenFieldState, $4a46f1c4231e5dde$export$f3decd0c2cd2fe2e as TokenFieldValue};
|
|
19
|
+
//# sourceMappingURL=useTokenFieldState.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC","sources":["packages/react-stately/exports/useTokenFieldState.ts"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport {TokenFieldValue} from '../src/tokenfield/TokenFieldValue';\n\nexport type {TokenFieldProps, TokenFieldState} from '../src/tokenfield/useTokenFieldState';\nexport type {\n TokenFieldSegment,\n TokenSegment,\n TextSegment,\n Position,\n TokenFieldValueOptions\n} from '../src/tokenfield/TokenFieldValue';\n"],"names":[],"version":3,"file":"useTokenFieldState.mjs.map"}
|
|
@@ -188,7 +188,8 @@ function $d4887b243094b5e1$export$b453a3bfd4a5fa9e(props) {
|
|
|
188
188
|
(0, $bjszJ$react.useEffect)(()=>{
|
|
189
189
|
// Open and close menu automatically when the input value changes if the input is focused,
|
|
190
190
|
// and there are items in the collection or allowEmptyCollection is true.
|
|
191
|
-
if (isFocused && (filteredCollection.size > 0 || allowsEmptyCollection) && !triggerState.isOpen && inputValue !== lastValue && menuTrigger !== 'manual')
|
|
191
|
+
if (isFocused && (filteredCollection.size > 0 || allowsEmptyCollection) && !triggerState.isOpen && inputValue !== lastValue && menuTrigger !== 'manual') // oxlint-disable-next-line react/react-compiler
|
|
192
|
+
open(null, 'input');
|
|
192
193
|
// Close the menu if the collection is empty. Don't close menu if filtered collection size is 0
|
|
193
194
|
// but we are currently showing all items via button press
|
|
194
195
|
if (!showAllItems && !allowsEmptyCollection && triggerState.isOpen && filteredCollection.size === 0) closeMenu();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuLM,SAAS,0CACd,KAAiC;IAEjC,IAAI,iBACF,aAAa,eACb,cAAc,gCACd,wBAAwB,0BACxB,iBAAiB,qBACjB,oBAAoB,qBACpB,gBAAgB,UACjB,GAAG;IAEJ,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC/C,IAAI,CAAC,WAAW,gBAAgB,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC5C,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,qBAAO,EAAwB;IAEvE,IAAI,eAAe,CAAA,GAAA,oBAAM,EAAE;QACzB,OAAO,MAAM,YAAY,KAAK,YAC1B,MAAM,YAAY,GAChB,kBAAkB,WAAY,MAAM,kBAAkB,IAAI,OAAQ,EAAE;IAC5E,GAAG;QAAC,MAAM,YAAY;QAAE,MAAM,kBAAkB;QAAE;KAAc;IAChE,IAAI,QAAQ,CAAA,GAAA,oBAAM,EAAE;QAClB,OAAO,MAAM,KAAK,KAAK,YACnB,MAAM,KAAK,GACT,kBAAkB,WAAW,MAAM,WAAW,GAAG;IACzD,GAAG;QAAC,MAAM,KAAK;QAAE,MAAM,WAAW;QAAE;KAAc;IAClD,IAAI,CAAC,iBAAiB,mBAAmB,GAAG,CAAA,GAAA,4CAAiB,EAC3D,OACA,cACA,MAAM,QAAQ;IAEhB,8FAA8F;IAC9F,IAAI,eACF,kBAAkB,YAAY,MAAM,OAAO,CAAC,mBACxC,eAAe,CAAC,EAAE,GAClB;IAEN,IAAI,WAAW,CAAC;QACd,IAAI,kBAAkB,UAAU;YAC9B,IAAI,MAAM,MAAM,OAAO,CAAC,SAAU,KAAK,CAAC,EAAE,IAAI,OAAQ;YACtD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IAAI,KAAK,IAAI,KAAK,UAAU,OAAO,KAAK,SAAS,EAAE,aACxD,aAAa,IAAI,CAAC;YAAC,GAAG,IAAI;QAAA;aACrB,IAAI,KAAK,IAAI,KAAK,QACvB,aAAa,IAAI,CAAC;YAAC,GAAG,IAAI;QAAA;IAE9B;IACA,OAAO;AACT;AAEA,SAAS,2CACP,iBAA4C,EAC5C,WAAuB,EACvB,UAAqC;IAErC,IAAI,qBAAqB,MAAM;QAC7B,IAAI,eAAe,MACjB,OAAO,WAAW,OAAO,CAAC,cAAc,aAAa;IAEzD;IAEA,OAAO;AACT;AAEA,SAAS,mCAAa,KAA8C;IAClE,IAAI,UAAU,WACZ,OAAO;IAET,IAAI,UAAU,MACZ,OAAO,EAAE;IAEX,OAAO,MAAM,OAAO,CAAC,SAAS,QAAQ;QAAC;KAAM;AAC/C","sources":["packages/react-stately/src/combobox/useComboBoxState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Collection,\n CollectionBase,\n CollectionStateBase,\n FocusableProps,\n FocusStrategy,\n HelpTextProps,\n InputBase,\n Key,\n LabelableProps,\n Node,\n Selection,\n TextInputBase,\n Validation,\n ValueBase\n} from '@react-types/shared';\nimport {FormValidationState, useFormValidationState} from '../form/useFormValidationState';\nimport {getChildNodes} from '../collections/getChildNodes';\nimport {ListCollection} from '../list/ListCollection';\nimport {ListState, useListState} from '../list/useListState';\nimport {OverlayTriggerState, useOverlayTriggerState} from '../overlays/useOverlayTriggerState';\nimport {useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {useControlledState} from '../utils/useControlledState';\n\nexport type MenuTriggerAction = 'focus' | 'input' | 'manual';\nexport type SelectionMode = 'single' | 'multiple';\nexport type ValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];\nexport type ChangeValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];\ntype ValidationType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];\n\nexport interface ComboBoxValidationValue<M extends SelectionMode = 'single'> {\n /**\n * The selected key in the ComboBox.\n *\n * @deprecated\n */\n selectedKey: Key | null;\n /** The keys of the currently selected items. */\n value: ValidationType<M>;\n /** The value of the ComboBox input. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T, M extends SelectionMode = 'single'>\n extends\n CollectionBase<T>,\n InputBase,\n ValueBase<ValueType<M>, ChangeValueType<M>>,\n TextInputBase,\n Validation<ComboBoxValidationValue<M>>,\n FocusableProps<HTMLInputElement>,\n LabelableProps,\n HelpTextProps {\n /** The list of ComboBox items (uncontrolled). */\n defaultItems?: Iterable<T>;\n /** The list of ComboBox items (controlled). */\n items?: Iterable<T>;\n /**\n * Method that is called when the open state of the menu changes. Returns the new open state and\n * the action that caused the opening of the menu.\n */\n onOpenChange?: (isOpen: boolean, menuTrigger?: MenuTriggerAction) => void;\n /**\n * Whether single or multiple selection is enabled.\n *\n * @default 'single'\n */\n selectionMode?: M;\n /**\n * The currently selected key in the collection (controlled).\n *\n * @deprecated\n */\n selectedKey?: Key | null;\n /**\n * The initial selected key in the collection (uncontrolled).\n *\n * @deprecated\n */\n defaultSelectedKey?: Key | null;\n /**\n * Handler that is called when the selection changes.\n *\n * @deprecated\n */\n onSelectionChange?: (key: Key | null) => void;\n /** The value of the ComboBox input (controlled). */\n inputValue?: string;\n /** The default value of the ComboBox input (uncontrolled). */\n defaultInputValue?: string;\n /** Handler that is called when the ComboBox input value changes. */\n onInputChange?: (value: string) => void;\n /** Whether the ComboBox allows a non-item matching input value to be set. */\n allowsCustomValue?: boolean;\n // /**\n // * Whether the Combobox should only suggest matching options or autocomplete the field with the nearest matching option.\n // * @default 'suggest'\n // */\n // completionMode?: 'suggest' | 'complete',\n /**\n * The interaction required to display the ComboBox menu.\n *\n * @default 'input'\n */\n menuTrigger?: MenuTriggerAction;\n}\n\nexport interface ComboBoxState<T, M extends SelectionMode = 'single'>\n extends ListState<T>, OverlayTriggerState, FormValidationState {\n /**\n * The key for the first selected item.\n *\n * @deprecated\n */\n readonly selectedKey: Key | null;\n\n /**\n * The default selected key.\n *\n * @deprecated\n */\n readonly defaultSelectedKey: Key | null;\n /**\n * Sets the selected key.\n *\n * @deprecated\n */\n setSelectedKey(key: Key | null): void;\n /** The current combobox value. */\n readonly value: ValueType<M>;\n /** The default combobox value. */\n readonly defaultValue: ValueType<M>;\n /** Sets the combobox value. */\n setValue(value: Key | readonly Key[] | null): void;\n /**\n * The value of the first selected item.\n *\n * @deprecated\n */\n readonly selectedItem: Node<T> | null;\n /** The value of the selected items. */\n readonly selectedItems: Node<T>[];\n /** The current value of the combo box input. */\n inputValue: string;\n /** The default value of the combo box input. */\n defaultInputValue: string;\n /** Sets the value of the combo box input. */\n setInputValue(value: string): void;\n /** Selects the currently focused item and updates the input value. */\n commit(): void;\n /** Controls which item will be auto focused when the menu opens. */\n readonly focusStrategy: FocusStrategy | null;\n /** Whether the select is currently focused. */\n readonly isFocused: boolean;\n /** Sets whether the select is focused. */\n setFocused(isFocused: boolean): void;\n /** Opens the menu. */\n open(focusStrategy?: FocusStrategy | null, trigger?: MenuTriggerAction): void;\n /** Toggles the menu. */\n toggle(focusStrategy?: FocusStrategy | null, trigger?: MenuTriggerAction): void;\n /** Resets the input value to the previously selected item's text if any and closes the menu. */\n revert(): void;\n}\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport interface ComboBoxStateOptions<T, M extends SelectionMode = 'single'>\n extends Omit<ComboBoxProps<T, M>, 'children'>, CollectionStateBase<T> {\n /** The filter function used to determine if a option should be included in the combo box list. */\n defaultFilter?: FilterFn;\n /** Whether the combo box allows the menu to be open when the collection is empty. */\n allowsEmptyCollection?: boolean;\n /** Whether the combo box menu should close on blur. */\n shouldCloseOnBlur?: boolean;\n}\n\n/**\n * Provides state management for a combo box component. Handles building a collection of items from\n * props and manages the option selection state of the combo box. In addition, it tracks the input\n * value, focus state, and other properties of the combo box.\n */\nexport function useComboBoxState<T, M extends SelectionMode = 'single'>(\n props: ComboBoxStateOptions<T, M>\n): ComboBoxState<T, M> {\n let {\n defaultFilter,\n menuTrigger = 'input',\n allowsEmptyCollection = false,\n allowsCustomValue,\n shouldCloseOnBlur = true,\n selectionMode = 'single' as SelectionMode\n } = props;\n\n let [showAllItems, setShowAllItems] = useState(false);\n let [isFocused, setFocusedState] = useState(false);\n let [focusStrategy, setFocusStrategy] = useState<FocusStrategy | null>(null);\n\n let defaultValue = useMemo(() => {\n return props.defaultValue !== undefined\n ? props.defaultValue\n : ((selectionMode === 'single' ? (props.defaultSelectedKey ?? null) : []) as ValueType<M>);\n }, [props.defaultValue, props.defaultSelectedKey, selectionMode]);\n let value = useMemo(() => {\n return props.value !== undefined\n ? props.value\n : ((selectionMode === 'single' ? props.selectedKey : undefined) as ValueType<M>);\n }, [props.value, props.selectedKey, selectionMode]);\n let [controlledValue, setControlledValue] = useControlledState<Key | readonly Key[] | null>(\n value,\n defaultValue,\n props.onChange as any\n );\n // Only display the first selected item if in single selection mode but the value is an array.\n let displayValue: ValueType<M> =\n selectionMode === 'single' && Array.isArray(controlledValue)\n ? controlledValue[0]\n : controlledValue;\n\n let setValue = (value: Key | Key[] | null) => {\n if (selectionMode === 'single') {\n let key = Array.isArray(value) ? (value[0] ?? null) : value;\n setControlledValue(key);\n if (key !== displayValue) {\n props.onSelectionChange?.(key);\n }\n } else {\n let keys: Key[] = [];\n if (Array.isArray(value)) {\n keys = value;\n } else if (value != null) {\n keys = [value];\n }\n\n setControlledValue(keys);\n }\n };\n\n let {collection, selectionManager, disabledKeys} = useListState({\n ...props,\n items: props.items ?? props.defaultItems,\n selectionMode,\n disallowEmptySelection: selectionMode === 'single',\n allowDuplicateSelectionEvents: true,\n selectedKeys: useMemo(() => convertValue(displayValue), [displayValue]),\n onSelectionChange: (keys: Selection) => {\n // impossible, but TS doesn't know that\n if (keys === 'all') {\n return;\n }\n\n if (selectionMode === 'single') {\n let key = keys.values().next().value ?? null;\n if (key === displayValue) {\n props.onSelectionChange?.(key);\n // If key is the same, reset the inputValue and close the menu\n // (scenario: user clicks on already selected option)\n resetInputValue();\n closeMenu();\n } else {\n setValue(key);\n }\n } else {\n setValue([...keys]);\n }\n }\n });\n\n let selectedKey = selectionMode === 'single' ? selectionManager.firstSelectedKey : null;\n let selectedItems = useMemo(() => {\n return [...selectionManager.selectedKeys]\n .map(key => collection.getItem(key))\n .filter(item => item != null);\n }, [selectionManager.selectedKeys, collection]);\n\n let [inputValue, setInputValue] = useControlledState(\n props.inputValue,\n getDefaultInputValue(props.defaultInputValue, selectedKey, collection) || '',\n props.onInputChange\n );\n let [initialValue] = useState(displayValue);\n let [initialInputValue] = useState(inputValue);\n\n // Preserve original collection so we can show all items on demand\n let originalCollection = collection;\n let filteredCollection = useMemo(\n () =>\n // No default filter if items are controlled.\n props.items != null || !defaultFilter\n ? collection\n : filterCollection(collection, inputValue, defaultFilter),\n [collection, inputValue, defaultFilter, props.items]\n );\n let [lastCollection, setLastCollection] = useState(filteredCollection);\n\n // Track what action is attempting to open the menu\n let menuOpenTrigger = useRef<MenuTriggerAction | undefined>('focus');\n let onOpenChange = (open: boolean) => {\n if (props.onOpenChange) {\n props.onOpenChange(open, open ? menuOpenTrigger.current : undefined);\n }\n\n selectionManager.setFocused(open);\n if (!open) {\n selectionManager.setFocusedKey(null);\n }\n };\n\n let triggerState = useOverlayTriggerState({\n ...props,\n onOpenChange,\n isOpen: undefined,\n defaultOpen: undefined\n });\n let open = (focusStrategy: FocusStrategy | null = null, trigger?: MenuTriggerAction) => {\n let displayAllItems = trigger === 'manual' || (trigger === 'focus' && menuTrigger === 'focus');\n // Prevent open operations from triggering if there is nothing to display\n // Also prevent open operations from triggering if items are uncontrolled but defaultItems is empty, even if displayAllItems is true.\n // This is to prevent comboboxes with empty defaultItems from opening but allow controlled items comboboxes to open even if the inital list is empty (assumption is user will provide swap the empty list with a base list via onOpenChange returning `menuTrigger` manual)\n if (\n allowsEmptyCollection ||\n filteredCollection.size > 0 ||\n (displayAllItems && originalCollection.size > 0) ||\n props.items\n ) {\n if (displayAllItems && !triggerState.isOpen && props.items === undefined) {\n // Show all items if menu is manually opened. Only care about this if items are undefined\n setShowAllItems(true);\n }\n\n menuOpenTrigger.current = trigger;\n setFocusStrategy(focusStrategy);\n triggerState.open();\n }\n };\n\n let toggle = (focusStrategy: FocusStrategy | null = null, trigger?: MenuTriggerAction) => {\n let displayAllItems = trigger === 'manual' || (trigger === 'focus' && menuTrigger === 'focus');\n // If the menu is closed and there is nothing to display, early return so toggle isn't called to prevent extraneous onOpenChange\n if (\n !(\n allowsEmptyCollection ||\n filteredCollection.size > 0 ||\n (displayAllItems && originalCollection.size > 0) ||\n props.items\n ) &&\n !triggerState.isOpen\n ) {\n return;\n }\n\n if (displayAllItems && !triggerState.isOpen && props.items === undefined) {\n // Show all items if menu is toggled open. Only care about this if items are undefined\n setShowAllItems(true);\n }\n\n // Only update the menuOpenTrigger if menu is currently closed\n if (!triggerState.isOpen) {\n menuOpenTrigger.current = trigger;\n }\n\n toggleMenu(focusStrategy);\n };\n\n let updateLastCollection = useCallback(() => {\n setLastCollection(showAllItems ? originalCollection : filteredCollection);\n }, [showAllItems, originalCollection, filteredCollection]);\n\n // If menu is going to close, save the current collection so we can freeze the displayed collection when the\n // user clicks outside the popover to close the menu. Prevents the menu contents from updating as the menu closes.\n let toggleMenu = useCallback(\n (focusStrategy: FocusStrategy | null = null) => {\n if (triggerState.isOpen) {\n updateLastCollection();\n }\n\n setFocusStrategy(focusStrategy);\n triggerState.toggle();\n },\n [triggerState, updateLastCollection]\n );\n\n let closeMenu = useCallback(() => {\n if (triggerState.isOpen) {\n updateLastCollection();\n triggerState.close();\n }\n }, [triggerState, updateLastCollection]);\n\n let [lastValue, setLastValue] = useState(inputValue);\n let resetInputValue = () => {\n let itemText = selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n setLastValue(itemText);\n setInputValue(itemText);\n };\n\n let lastValueRef = useRef(displayValue);\n let lastSelectedKeyText = useRef(\n selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : ''\n );\n // intentional omit dependency array, want this to happen on every render\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n // Open and close menu automatically when the input value changes if the input is focused,\n // and there are items in the collection or allowEmptyCollection is true.\n if (\n isFocused &&\n (filteredCollection.size > 0 || allowsEmptyCollection) &&\n !triggerState.isOpen &&\n inputValue !== lastValue &&\n menuTrigger !== 'manual'\n ) {\n open(null, 'input');\n }\n\n // Close the menu if the collection is empty. Don't close menu if filtered collection size is 0\n // but we are currently showing all items via button press\n if (\n !showAllItems &&\n !allowsEmptyCollection &&\n triggerState.isOpen &&\n filteredCollection.size === 0\n ) {\n closeMenu();\n }\n\n // Close when an item is selected.\n if (\n displayValue != null &&\n displayValue !== lastValueRef.current &&\n selectionMode === 'single'\n ) {\n closeMenu();\n }\n\n // Clear focused key when input value changes and display filtered collection again.\n if (inputValue !== lastValue) {\n selectionManager.setFocusedKey(null);\n setShowAllItems(false);\n\n // Set value to null when the user clears the input.\n // If controlled, this is the application developer's responsibility.\n if (\n selectionMode === 'single' &&\n inputValue === '' &&\n (props.inputValue === undefined || value === undefined)\n ) {\n setValue(null);\n }\n }\n\n // If the value changed, update the input value.\n // Do nothing if both inputValue and value are controlled.\n // In this case, it's the user's responsibility to update inputValue in onSelectionChange.\n if (\n displayValue !== lastValueRef.current &&\n (props.inputValue === undefined || value === undefined)\n ) {\n resetInputValue();\n } else if (lastValue !== inputValue) {\n setLastValue(inputValue);\n }\n\n // Update the inputValue if the selected item's text changes from its last tracked value.\n // This is to handle cases where a selectedKey is specified but the items aren't available (async loading) or the selected item's text value updates.\n // Only reset if the user isn't currently within the field so we don't erroneously modify user input.\n // If inputValue is controlled, it is the user's responsibility to update the inputValue when items change.\n let selectedItemText =\n selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n if (\n !isFocused &&\n selectedKey != null &&\n props.inputValue === undefined &&\n selectedKey === lastValueRef.current\n ) {\n if (lastSelectedKeyText.current !== selectedItemText) {\n setLastValue(selectedItemText);\n setInputValue(selectedItemText);\n }\n }\n\n lastValueRef.current = displayValue;\n lastSelectedKeyText.current = selectedItemText;\n });\n\n let validation = useFormValidationState({\n ...props,\n value: useMemo(\n () =>\n Array.isArray(displayValue) && displayValue.length === 0\n ? null\n : {inputValue, value: displayValue as any, selectedKey},\n [inputValue, selectedKey, displayValue]\n )\n });\n\n // Revert input value and close menu\n let revert = () => {\n if (allowsCustomValue && selectedKey == null) {\n commitCustomValue();\n } else {\n commitSelection();\n }\n };\n\n let commitCustomValue = () => {\n if (selectionMode === 'multiple') {\n // In multi-select mode, the input's custom text is independent from the selected items.\n // Closing or committing the field should not clear the existing selection.\n setLastValue(inputValue);\n closeMenu();\n return;\n }\n\n let value = null;\n lastValueRef.current = value as any;\n setValue(value);\n closeMenu();\n };\n\n let commitSelection = (shouldForceSelectionChange = false) => {\n // If multiple things are controlled, call onSelectionChange only when selecting the focused item,\n // or when inputValue needs to be synced back to the selected item on commit/blur.\n if (value !== undefined && props.inputValue !== undefined) {\n let itemText = selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n if (shouldForceSelectionChange || selectionMode === 'multiple' || inputValue !== itemText) {\n props.onSelectionChange?.(selectedKey);\n props.onChange?.(displayValue as ChangeValueType<M>);\n }\n\n // Stop menu from reopening from useEffect\n setLastValue(itemText);\n closeMenu();\n } else {\n // If only a single aspect of combobox is controlled, reset input value and close menu for the user\n resetInputValue();\n closeMenu();\n }\n };\n\n const commitValue = () => {\n if (allowsCustomValue) {\n const itemText =\n selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n inputValue === itemText ? commitSelection() : commitCustomValue();\n } else {\n // Reset inputValue and close menu\n commitSelection();\n }\n };\n\n let commit = () => {\n if (triggerState.isOpen && selectionManager.focusedKey != null) {\n // Reset inputValue and close menu here if the selected key is already the focused key. Otherwise\n // fire onSelectionChange to allow the application to control the closing.\n if (selectionManager.isSelected(selectionManager.focusedKey) && selectionMode === 'single') {\n commitSelection(true);\n } else {\n selectionManager.select(selectionManager.focusedKey);\n }\n } else {\n commitValue();\n }\n };\n\n let valueOnFocus = useRef([inputValue, displayValue]);\n let setFocused = (isFocused: boolean) => {\n if (isFocused) {\n valueOnFocus.current = [inputValue, displayValue];\n if (menuTrigger === 'focus' && !props.isReadOnly) {\n open(null, 'focus');\n }\n } else {\n if (shouldCloseOnBlur) {\n commitValue();\n }\n\n // Commit validation if the input value or selected items changed.\n if (inputValue !== valueOnFocus.current[0] || displayValue !== valueOnFocus.current[1]) {\n validation.commitValidation();\n }\n }\n\n setFocusedState(isFocused);\n };\n\n let displayedCollection = useMemo(() => {\n if (triggerState.isOpen) {\n if (showAllItems) {\n return originalCollection;\n } else {\n return filteredCollection;\n }\n } else {\n return lastCollection;\n }\n }, [triggerState.isOpen, originalCollection, filteredCollection, showAllItems, lastCollection]);\n\n let defaultSelectedKey =\n props.defaultSelectedKey ?? (selectionMode === 'single' ? (initialValue as Key) : null);\n\n return {\n ...validation,\n ...triggerState,\n focusStrategy,\n toggle,\n open,\n close: commitValue,\n selectionManager,\n value: displayValue as any,\n defaultValue: defaultValue ?? (initialValue as any),\n setValue,\n selectedKey,\n selectedItems,\n defaultSelectedKey,\n setSelectedKey: setValue,\n disabledKeys,\n isFocused,\n setFocused,\n selectedItem: selectedItems[0] ?? null,\n collection: displayedCollection,\n inputValue,\n defaultInputValue:\n getDefaultInputValue(props.defaultInputValue, defaultSelectedKey, collection) ??\n initialInputValue,\n setInputValue,\n commit,\n revert\n };\n}\n\nfunction filterCollection<T>(\n collection: Collection<Node<T>>,\n inputValue: string,\n filter: FilterFn\n): Collection<Node<T>> {\n return new ListCollection(filterNodes(collection, collection, inputValue, filter));\n}\n\nfunction filterNodes<T>(\n collection: Collection<Node<T>>,\n nodes: Iterable<Node<T>>,\n inputValue: string,\n filter: FilterFn\n): Iterable<Node<T>> {\n let filteredNode: Node<T>[] = [];\n for (let node of nodes) {\n if (node.type === 'section' && node.hasChildNodes) {\n let filtered = filterNodes(collection, getChildNodes(node, collection), inputValue, filter);\n if ([...filtered].some(node => node.type === 'item')) {\n filteredNode.push({...node, childNodes: filtered});\n }\n } else if (node.type === 'item' && filter(node.textValue, inputValue)) {\n filteredNode.push({...node});\n } else if (node.type !== 'item') {\n filteredNode.push({...node});\n }\n }\n return filteredNode;\n}\n\nfunction getDefaultInputValue(\n defaultInputValue: string | null | undefined,\n selectedKey: Key | null,\n collection: Collection<Node<unknown>>\n) {\n if (defaultInputValue == null) {\n if (selectedKey != null) {\n return collection.getItem(selectedKey)?.textValue ?? '';\n }\n }\n\n return defaultInputValue;\n}\n\nfunction convertValue(value: Key | readonly Key[] | null | undefined) {\n if (value === undefined) {\n return undefined;\n }\n if (value === null) {\n return [];\n }\n return Array.isArray(value) ? value : [value];\n}\n"],"names":[],"version":3,"file":"useComboBoxState.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuLM,SAAS,0CACd,KAAiC;IAEjC,IAAI,iBACF,aAAa,eACb,cAAc,gCACd,wBAAwB,0BACxB,iBAAiB,qBACjB,oBAAoB,qBACpB,gBAAgB,UACjB,GAAG;IAEJ,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC/C,IAAI,CAAC,WAAW,gBAAgB,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC5C,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,qBAAO,EAAwB;IAEvE,IAAI,eAAe,CAAA,GAAA,oBAAM,EAAE;Q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/useComboBoxState.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Collection,\n CollectionBase,\n CollectionStateBase,\n FocusableProps,\n FocusStrategy,\n HelpTextProps,\n InputBase,\n Key,\n LabelableProps,\n Node,\n Selection,\n TextInputBase,\n Validation,\n ValueBase\n} from '@react-types/shared';\nimport {FormValidationState, useFormValidationState} from '../form/useFormValidationState';\nimport {getChildNodes} from '../collections/getChildNodes';\nimport {ListCollection} from '../list/ListCollection';\nimport {ListState, useListState} from '../list/useListState';\nimport {OverlayTriggerState, useOverlayTriggerState} from '../overlays/useOverlayTriggerState';\nimport {useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {useControlledState} from '../utils/useControlledState';\n\nexport type MenuTriggerAction = 'focus' | 'input' | 'manual';\nexport type SelectionMode = 'single' | 'multiple';\nexport type ValueType<M extends SelectionMode> = M extends 'single' ? Key | null : readonly Key[];\nexport type ChangeValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];\ntype ValidationType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];\n\nexport interface ComboBoxValidationValue<M extends SelectionMode = 'single'> {\n /**\n * The selected key in the ComboBox.\n *\n * @deprecated\n */\n selectedKey: Key | null;\n /** The keys of the currently selected items. */\n value: ValidationType<M>;\n /** The value of the ComboBox input. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T, M extends SelectionMode = 'single'>\n extends\n CollectionBase<T>,\n InputBase,\n ValueBase<ValueType<M>, ChangeValueType<M>>,\n TextInputBase,\n Validation<ComboBoxValidationValue<M>>,\n FocusableProps<HTMLInputElement>,\n LabelableProps,\n HelpTextProps {\n /** The list of ComboBox items (uncontrolled). */\n defaultItems?: Iterable<T>;\n /** The list of ComboBox items (controlled). */\n items?: Iterable<T>;\n /**\n * Method that is called when the open state of the menu changes. Returns the new open state and\n * the action that caused the opening of the menu.\n */\n onOpenChange?: (isOpen: boolean, menuTrigger?: MenuTriggerAction) => void;\n /**\n * Whether single or multiple selection is enabled.\n *\n * @default 'single'\n */\n selectionMode?: M;\n /**\n * The currently selected key in the collection (controlled).\n *\n * @deprecated\n */\n selectedKey?: Key | null;\n /**\n * The initial selected key in the collection (uncontrolled).\n *\n * @deprecated\n */\n defaultSelectedKey?: Key | null;\n /**\n * Handler that is called when the selection changes.\n *\n * @deprecated\n */\n onSelectionChange?: (key: Key | null) => void;\n /** The value of the ComboBox input (controlled). */\n inputValue?: string;\n /** The default value of the ComboBox input (uncontrolled). */\n defaultInputValue?: string;\n /** Handler that is called when the ComboBox input value changes. */\n onInputChange?: (value: string) => void;\n /** Whether the ComboBox allows a non-item matching input value to be set. */\n allowsCustomValue?: boolean;\n // /**\n // * Whether the Combobox should only suggest matching options or autocomplete the field with the nearest matching option.\n // * @default 'suggest'\n // */\n // completionMode?: 'suggest' | 'complete',\n /**\n * The interaction required to display the ComboBox menu.\n *\n * @default 'input'\n */\n menuTrigger?: MenuTriggerAction;\n}\n\nexport interface ComboBoxState<T, M extends SelectionMode = 'single'>\n extends ListState<T>, OverlayTriggerState, FormValidationState {\n /**\n * The key for the first selected item.\n *\n * @deprecated\n */\n readonly selectedKey: Key | null;\n\n /**\n * The default selected key.\n *\n * @deprecated\n */\n readonly defaultSelectedKey: Key | null;\n /**\n * Sets the selected key.\n *\n * @deprecated\n */\n setSelectedKey(key: Key | null): void;\n /** The current combobox value. */\n readonly value: ValueType<M>;\n /** The default combobox value. */\n readonly defaultValue: ValueType<M>;\n /** Sets the combobox value. */\n setValue(value: Key | readonly Key[] | null): void;\n /**\n * The value of the first selected item.\n *\n * @deprecated\n */\n readonly selectedItem: Node<T> | null;\n /** The value of the selected items. */\n readonly selectedItems: Node<T>[];\n /** The current value of the combo box input. */\n inputValue: string;\n /** The default value of the combo box input. */\n defaultInputValue: string;\n /** Sets the value of the combo box input. */\n setInputValue(value: string): void;\n /** Selects the currently focused item and updates the input value. */\n commit(): void;\n /** Controls which item will be auto focused when the menu opens. */\n readonly focusStrategy: FocusStrategy | null;\n /** Whether the select is currently focused. */\n readonly isFocused: boolean;\n /** Sets whether the select is focused. */\n setFocused(isFocused: boolean): void;\n /** Opens the menu. */\n open(focusStrategy?: FocusStrategy | null, trigger?: MenuTriggerAction): void;\n /** Toggles the menu. */\n toggle(focusStrategy?: FocusStrategy | null, trigger?: MenuTriggerAction): void;\n /** Resets the input value to the previously selected item's text if any and closes the menu. */\n revert(): void;\n}\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport interface ComboBoxStateOptions<T, M extends SelectionMode = 'single'>\n extends Omit<ComboBoxProps<T, M>, 'children'>, CollectionStateBase<T> {\n /** The filter function used to determine if a option should be included in the combo box list. */\n defaultFilter?: FilterFn;\n /** Whether the combo box allows the menu to be open when the collection is empty. */\n allowsEmptyCollection?: boolean;\n /** Whether the combo box menu should close on blur. */\n shouldCloseOnBlur?: boolean;\n}\n\n/**\n * Provides state management for a combo box component. Handles building a collection of items from\n * props and manages the option selection state of the combo box. In addition, it tracks the input\n * value, focus state, and other properties of the combo box.\n */\nexport function useComboBoxState<T, M extends SelectionMode = 'single'>(\n props: ComboBoxStateOptions<T, M>\n): ComboBoxState<T, M> {\n let {\n defaultFilter,\n menuTrigger = 'input',\n allowsEmptyCollection = false,\n allowsCustomValue,\n shouldCloseOnBlur = true,\n selectionMode = 'single' as SelectionMode\n } = props;\n\n let [showAllItems, setShowAllItems] = useState(false);\n let [isFocused, setFocusedState] = useState(false);\n let [focusStrategy, setFocusStrategy] = useState<FocusStrategy | null>(null);\n\n let defaultValue = useMemo(() => {\n return props.defaultValue !== undefined\n ? props.defaultValue\n : ((selectionMode === 'single' ? (props.defaultSelectedKey ?? null) : []) as ValueType<M>);\n }, [props.defaultValue, props.defaultSelectedKey, selectionMode]);\n let value = useMemo(() => {\n return props.value !== undefined\n ? props.value\n : ((selectionMode === 'single' ? props.selectedKey : undefined) as ValueType<M>);\n }, [props.value, props.selectedKey, selectionMode]);\n let [controlledValue, setControlledValue] = useControlledState<Key | readonly Key[] | null>(\n value,\n defaultValue,\n props.onChange as any\n );\n // Only display the first selected item if in single selection mode but the value is an array.\n let displayValue: ValueType<M> =\n selectionMode === 'single' && Array.isArray(controlledValue)\n ? controlledValue[0]\n : controlledValue;\n\n let setValue = (value: Key | Key[] | null) => {\n if (selectionMode === 'single') {\n let key = Array.isArray(value) ? (value[0] ?? null) : value;\n setControlledValue(key);\n if (key !== displayValue) {\n props.onSelectionChange?.(key);\n }\n } else {\n let keys: Key[] = [];\n if (Array.isArray(value)) {\n keys = value;\n } else if (value != null) {\n keys = [value];\n }\n\n setControlledValue(keys);\n }\n };\n\n let {collection, selectionManager, disabledKeys} = useListState({\n ...props,\n items: props.items ?? props.defaultItems,\n selectionMode,\n disallowEmptySelection: selectionMode === 'single',\n allowDuplicateSelectionEvents: true,\n selectedKeys: useMemo(() => convertValue(displayValue), [displayValue]),\n onSelectionChange: (keys: Selection) => {\n // impossible, but TS doesn't know that\n if (keys === 'all') {\n return;\n }\n\n if (selectionMode === 'single') {\n let key = keys.values().next().value ?? null;\n if (key === displayValue) {\n props.onSelectionChange?.(key);\n // If key is the same, reset the inputValue and close the menu\n // (scenario: user clicks on already selected option)\n resetInputValue();\n closeMenu();\n } else {\n setValue(key);\n }\n } else {\n setValue([...keys]);\n }\n }\n });\n\n let selectedKey = selectionMode === 'single' ? selectionManager.firstSelectedKey : null;\n let selectedItems = useMemo(() => {\n return [...selectionManager.selectedKeys]\n .map(key => collection.getItem(key))\n .filter(item => item != null);\n }, [selectionManager.selectedKeys, collection]);\n\n let [inputValue, setInputValue] = useControlledState(\n props.inputValue,\n getDefaultInputValue(props.defaultInputValue, selectedKey, collection) || '',\n props.onInputChange\n );\n let [initialValue] = useState(displayValue);\n let [initialInputValue] = useState(inputValue);\n\n // Preserve original collection so we can show all items on demand\n let originalCollection = collection;\n let filteredCollection = useMemo(\n () =>\n // No default filter if items are controlled.\n props.items != null || !defaultFilter\n ? collection\n : filterCollection(collection, inputValue, defaultFilter),\n [collection, inputValue, defaultFilter, props.items]\n );\n let [lastCollection, setLastCollection] = useState(filteredCollection);\n\n // Track what action is attempting to open the menu\n let menuOpenTrigger = useRef<MenuTriggerAction | undefined>('focus');\n let onOpenChange = (open: boolean) => {\n if (props.onOpenChange) {\n props.onOpenChange(open, open ? menuOpenTrigger.current : undefined);\n }\n\n selectionManager.setFocused(open);\n if (!open) {\n selectionManager.setFocusedKey(null);\n }\n };\n\n let triggerState = useOverlayTriggerState({\n ...props,\n onOpenChange,\n isOpen: undefined,\n defaultOpen: undefined\n });\n let open = (focusStrategy: FocusStrategy | null = null, trigger?: MenuTriggerAction) => {\n let displayAllItems = trigger === 'manual' || (trigger === 'focus' && menuTrigger === 'focus');\n // Prevent open operations from triggering if there is nothing to display\n // Also prevent open operations from triggering if items are uncontrolled but defaultItems is empty, even if displayAllItems is true.\n // This is to prevent comboboxes with empty defaultItems from opening but allow controlled items comboboxes to open even if the inital list is empty (assumption is user will provide swap the empty list with a base list via onOpenChange returning `menuTrigger` manual)\n if (\n allowsEmptyCollection ||\n filteredCollection.size > 0 ||\n (displayAllItems && originalCollection.size > 0) ||\n props.items\n ) {\n if (displayAllItems && !triggerState.isOpen && props.items === undefined) {\n // Show all items if menu is manually opened. Only care about this if items are undefined\n setShowAllItems(true);\n }\n\n menuOpenTrigger.current = trigger;\n setFocusStrategy(focusStrategy);\n triggerState.open();\n }\n };\n\n let toggle = (focusStrategy: FocusStrategy | null = null, trigger?: MenuTriggerAction) => {\n let displayAllItems = trigger === 'manual' || (trigger === 'focus' && menuTrigger === 'focus');\n // If the menu is closed and there is nothing to display, early return so toggle isn't called to prevent extraneous onOpenChange\n if (\n !(\n allowsEmptyCollection ||\n filteredCollection.size > 0 ||\n (displayAllItems && originalCollection.size > 0) ||\n props.items\n ) &&\n !triggerState.isOpen\n ) {\n return;\n }\n\n if (displayAllItems && !triggerState.isOpen && props.items === undefined) {\n // Show all items if menu is toggled open. Only care about this if items are undefined\n setShowAllItems(true);\n }\n\n // Only update the menuOpenTrigger if menu is currently closed\n if (!triggerState.isOpen) {\n menuOpenTrigger.current = trigger;\n }\n\n toggleMenu(focusStrategy);\n };\n\n let updateLastCollection = useCallback(() => {\n setLastCollection(showAllItems ? originalCollection : filteredCollection);\n }, [showAllItems, originalCollection, filteredCollection]);\n\n // If menu is going to close, save the current collection so we can freeze the displayed collection when the\n // user clicks outside the popover to close the menu. Prevents the menu contents from updating as the menu closes.\n let toggleMenu = useCallback(\n (focusStrategy: FocusStrategy | null = null) => {\n if (triggerState.isOpen) {\n updateLastCollection();\n }\n\n setFocusStrategy(focusStrategy);\n triggerState.toggle();\n },\n [triggerState, updateLastCollection]\n );\n\n let closeMenu = useCallback(() => {\n if (triggerState.isOpen) {\n updateLastCollection();\n triggerState.close();\n }\n }, [triggerState, updateLastCollection]);\n\n let [lastValue, setLastValue] = useState(inputValue);\n let resetInputValue = () => {\n let itemText = selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n setLastValue(itemText);\n setInputValue(itemText);\n };\n\n let lastValueRef = useRef(displayValue);\n let lastSelectedKeyText = useRef(\n selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : ''\n );\n // intentional omit dependency array, want this to happen on every render\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n // Open and close menu automatically when the input value changes if the input is focused,\n // and there are items in the collection or allowEmptyCollection is true.\n if (\n isFocused &&\n (filteredCollection.size > 0 || allowsEmptyCollection) &&\n !triggerState.isOpen &&\n inputValue !== lastValue &&\n menuTrigger !== 'manual'\n ) {\n // oxlint-disable-next-line react/react-compiler\n open(null, 'input');\n }\n\n // Close the menu if the collection is empty. Don't close menu if filtered collection size is 0\n // but we are currently showing all items via button press\n if (\n !showAllItems &&\n !allowsEmptyCollection &&\n triggerState.isOpen &&\n filteredCollection.size === 0\n ) {\n closeMenu();\n }\n\n // Close when an item is selected.\n if (\n displayValue != null &&\n displayValue !== lastValueRef.current &&\n selectionMode === 'single'\n ) {\n closeMenu();\n }\n\n // Clear focused key when input value changes and display filtered collection again.\n if (inputValue !== lastValue) {\n selectionManager.setFocusedKey(null);\n setShowAllItems(false);\n\n // Set value to null when the user clears the input.\n // If controlled, this is the application developer's responsibility.\n if (\n selectionMode === 'single' &&\n inputValue === '' &&\n (props.inputValue === undefined || value === undefined)\n ) {\n setValue(null);\n }\n }\n\n // If the value changed, update the input value.\n // Do nothing if both inputValue and value are controlled.\n // In this case, it's the user's responsibility to update inputValue in onSelectionChange.\n if (\n displayValue !== lastValueRef.current &&\n (props.inputValue === undefined || value === undefined)\n ) {\n resetInputValue();\n } else if (lastValue !== inputValue) {\n setLastValue(inputValue);\n }\n\n // Update the inputValue if the selected item's text changes from its last tracked value.\n // This is to handle cases where a selectedKey is specified but the items aren't available (async loading) or the selected item's text value updates.\n // Only reset if the user isn't currently within the field so we don't erroneously modify user input.\n // If inputValue is controlled, it is the user's responsibility to update the inputValue when items change.\n let selectedItemText =\n selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n if (\n !isFocused &&\n selectedKey != null &&\n props.inputValue === undefined &&\n selectedKey === lastValueRef.current\n ) {\n if (lastSelectedKeyText.current !== selectedItemText) {\n setLastValue(selectedItemText);\n setInputValue(selectedItemText);\n }\n }\n\n lastValueRef.current = displayValue;\n lastSelectedKeyText.current = selectedItemText;\n });\n\n let validation = useFormValidationState({\n ...props,\n value: useMemo(\n () =>\n Array.isArray(displayValue) && displayValue.length === 0\n ? null\n : {inputValue, value: displayValue as any, selectedKey},\n [inputValue, selectedKey, displayValue]\n )\n });\n\n // Revert input value and close menu\n let revert = () => {\n if (allowsCustomValue && selectedKey == null) {\n commitCustomValue();\n } else {\n commitSelection();\n }\n };\n\n let commitCustomValue = () => {\n if (selectionMode === 'multiple') {\n // In multi-select mode, the input's custom text is independent from the selected items.\n // Closing or committing the field should not clear the existing selection.\n setLastValue(inputValue);\n closeMenu();\n return;\n }\n\n let value = null;\n lastValueRef.current = value as any;\n setValue(value);\n closeMenu();\n };\n\n let commitSelection = (shouldForceSelectionChange = false) => {\n // If multiple things are controlled, call onSelectionChange only when selecting the focused item,\n // or when inputValue needs to be synced back to the selected item on commit/blur.\n if (value !== undefined && props.inputValue !== undefined) {\n let itemText = selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n if (shouldForceSelectionChange || selectionMode === 'multiple' || inputValue !== itemText) {\n props.onSelectionChange?.(selectedKey);\n props.onChange?.(displayValue as ChangeValueType<M>);\n }\n\n // Stop menu from reopening from useEffect\n setLastValue(itemText);\n closeMenu();\n } else {\n // If only a single aspect of combobox is controlled, reset input value and close menu for the user\n resetInputValue();\n closeMenu();\n }\n };\n\n const commitValue = () => {\n if (allowsCustomValue) {\n const itemText =\n selectedKey != null ? (collection.getItem(selectedKey)?.textValue ?? '') : '';\n inputValue === itemText ? commitSelection() : commitCustomValue();\n } else {\n // Reset inputValue and close menu\n commitSelection();\n }\n };\n\n let commit = () => {\n if (triggerState.isOpen && selectionManager.focusedKey != null) {\n // Reset inputValue and close menu here if the selected key is already the focused key. Otherwise\n // fire onSelectionChange to allow the application to control the closing.\n if (selectionManager.isSelected(selectionManager.focusedKey) && selectionMode === 'single') {\n commitSelection(true);\n } else {\n selectionManager.select(selectionManager.focusedKey);\n }\n } else {\n commitValue();\n }\n };\n\n let valueOnFocus = useRef([inputValue, displayValue]);\n let setFocused = (isFocused: boolean) => {\n if (isFocused) {\n valueOnFocus.current = [inputValue, displayValue];\n if (menuTrigger === 'focus' && !props.isReadOnly) {\n open(null, 'focus');\n }\n } else {\n if (shouldCloseOnBlur) {\n commitValue();\n }\n\n // Commit validation if the input value or selected items changed.\n if (inputValue !== valueOnFocus.current[0] || displayValue !== valueOnFocus.current[1]) {\n validation.commitValidation();\n }\n }\n\n setFocusedState(isFocused);\n };\n\n let displayedCollection = useMemo(() => {\n if (triggerState.isOpen) {\n if (showAllItems) {\n return originalCollection;\n } else {\n return filteredCollection;\n }\n } else {\n return lastCollection;\n }\n }, [triggerState.isOpen, originalCollection, filteredCollection, showAllItems, lastCollection]);\n\n let defaultSelectedKey =\n props.defaultSelectedKey ?? (selectionMode === 'single' ? (initialValue as Key) : null);\n\n return {\n ...validation,\n ...triggerState,\n focusStrategy,\n toggle,\n open,\n close: commitValue,\n selectionManager,\n value: displayValue as any,\n defaultValue: defaultValue ?? (initialValue as any),\n setValue,\n selectedKey,\n selectedItems,\n defaultSelectedKey,\n setSelectedKey: setValue,\n disabledKeys,\n isFocused,\n setFocused,\n selectedItem: selectedItems[0] ?? null,\n collection: displayedCollection,\n inputValue,\n defaultInputValue:\n getDefaultInputValue(props.defaultInputValue, defaultSelectedKey, collection) ??\n initialInputValue,\n setInputValue,\n commit,\n revert\n };\n}\n\nfunction filterCollection<T>(\n collection: Collection<Node<T>>,\n inputValue: string,\n filter: FilterFn\n): Collection<Node<T>> {\n return new ListCollection(filterNodes(collection, collection, inputValue, filter));\n}\n\nfunction filterNodes<T>(\n collection: Collection<Node<T>>,\n nodes: Iterable<Node<T>>,\n inputValue: string,\n filter: FilterFn\n): Iterable<Node<T>> {\n let filteredNode: Node<T>[] = [];\n for (let node of nodes) {\n if (node.type === 'section' && node.hasChildNodes) {\n let filtered = filterNodes(collection, getChildNodes(node, collection), inputValue, filter);\n if ([...filtered].some(node => node.type === 'item')) {\n filteredNode.push({...node, childNodes: filtered});\n }\n } else if (node.type === 'item' && filter(node.textValue, inputValue)) {\n filteredNode.push({...node});\n } else if (node.type !== 'item') {\n filteredNode.push({...node});\n }\n }\n return filteredNode;\n}\n\nfunction getDefaultInputValue(\n defaultInputValue: string | null | undefined,\n selectedKey: Key | null,\n collection: Collection<Node<unknown>>\n) {\n if (defaultInputValue == null) {\n if (selectedKey != null) {\n return collection.getItem(selectedKey)?.textValue ?? '';\n }\n }\n\n return defaultInputValue;\n}\n\nfunction convertValue(value: Key | readonly Key[] | null | undefined) {\n if (value === undefined) {\n return undefined;\n }\n if (value === null) {\n return [];\n }\n return Array.isArray(value) ? value : [value];\n}\n"],"names":[],"version":3,"file":"useComboBoxState.cjs.map"}
|
|
@@ -193,7 +193,8 @@ function $164529d83bfc5dce$export$b453a3bfd4a5fa9e(props) {
|
|
|
193
193
|
var _collection_getItem;
|
|
194
194
|
// Open and close menu automatically when the input value changes if the input is focused,
|
|
195
195
|
// and there are items in the collection or allowEmptyCollection is true.
|
|
196
|
-
if (isFocused && (filteredCollection.size > 0 || allowsEmptyCollection) && !triggerState.isOpen && inputValue !== lastValue && menuTrigger !== 'manual')
|
|
196
|
+
if (isFocused && (filteredCollection.size > 0 || allowsEmptyCollection) && !triggerState.isOpen && inputValue !== lastValue && menuTrigger !== 'manual') // oxlint-disable-next-line react/react-compiler
|
|
197
|
+
open(null, 'input');
|
|
197
198
|
// Close the menu if the collection is empty. Don't close menu if filtered collection size is 0
|
|
198
199
|
// but we are currently showing all items via button press
|
|
199
200
|
if (!showAllItems && !allowsEmptyCollection && triggerState.isOpen && filteredCollection.size === 0) closeMenu();
|