react-stately 3.46.0 → 3.47.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/Color.cjs.map +1 -1
- package/dist/exports/Color.js.map +1 -1
- package/dist/exports/Color.mjs.map +1 -1
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.js.map +1 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/private/autocomplete/useAutocompleteState.cjs.map +1 -1
- package/dist/exports/private/autocomplete/useAutocompleteState.js.map +1 -1
- package/dist/exports/private/autocomplete/useAutocompleteState.mjs.map +1 -1
- package/dist/exports/private/collections/getChildNodes.cjs.map +1 -1
- package/dist/exports/private/collections/getChildNodes.js.map +1 -1
- package/dist/exports/private/collections/getChildNodes.mjs.map +1 -1
- package/dist/exports/private/flags/flags.cjs.map +1 -1
- package/dist/exports/private/flags/flags.js.map +1 -1
- package/dist/exports/private/flags/flags.mjs.map +1 -1
- package/dist/exports/private/form/useFormValidationState.cjs.map +1 -1
- package/dist/exports/private/form/useFormValidationState.js.map +1 -1
- package/dist/exports/private/form/useFormValidationState.mjs.map +1 -1
- package/dist/exports/private/grid/GridCollection.cjs.map +1 -1
- package/dist/exports/private/grid/GridCollection.js.map +1 -1
- package/dist/exports/private/grid/GridCollection.mjs.map +1 -1
- package/dist/exports/private/steplist/useStepListState.cjs.map +1 -1
- package/dist/exports/private/steplist/useStepListState.js.map +1 -1
- package/dist/exports/private/steplist/useStepListState.mjs.map +1 -1
- package/dist/exports/private/table/TableCollection.cjs.map +1 -1
- package/dist/exports/private/table/TableCollection.js.map +1 -1
- package/dist/exports/private/table/TableCollection.mjs.map +1 -1
- package/dist/exports/private/table/useTreeGridState.cjs.map +1 -1
- package/dist/exports/private/table/useTreeGridState.js.map +1 -1
- package/dist/exports/private/table/useTreeGridState.mjs.map +1 -1
- package/dist/exports/useAsyncList.cjs.map +1 -1
- package/dist/exports/useAsyncList.js.map +1 -1
- package/dist/exports/useAsyncList.mjs.map +1 -1
- package/dist/exports/useCalendarState.cjs.map +1 -1
- package/dist/exports/useCalendarState.js.map +1 -1
- package/dist/exports/useCalendarState.mjs.map +1 -1
- package/dist/exports/useColorAreaState.cjs.map +1 -1
- package/dist/exports/useColorAreaState.js.map +1 -1
- package/dist/exports/useColorAreaState.mjs.map +1 -1
- package/dist/exports/useColorFieldState.cjs.map +1 -1
- package/dist/exports/useColorFieldState.js.map +1 -1
- package/dist/exports/useColorFieldState.mjs.map +1 -1
- package/dist/exports/useColorPickerState.cjs.map +1 -1
- package/dist/exports/useColorPickerState.js.map +1 -1
- package/dist/exports/useColorPickerState.mjs.map +1 -1
- package/dist/exports/useColorSliderState.cjs.map +1 -1
- package/dist/exports/useColorSliderState.js.map +1 -1
- package/dist/exports/useColorSliderState.mjs.map +1 -1
- package/dist/exports/useColorWheelState.cjs.map +1 -1
- package/dist/exports/useColorWheelState.js.map +1 -1
- package/dist/exports/useColorWheelState.mjs.map +1 -1
- package/dist/exports/useComboBoxState.cjs +1 -1
- package/dist/exports/useComboBoxState.cjs.map +1 -1
- package/dist/exports/useComboBoxState.js +1 -1
- package/dist/exports/useComboBoxState.js.map +1 -1
- package/dist/exports/useComboBoxState.mjs +1 -1
- package/dist/exports/useComboBoxState.mjs.map +1 -1
- package/dist/exports/useDateFieldState.cjs.map +1 -1
- package/dist/exports/useDateFieldState.js.map +1 -1
- package/dist/exports/useDateFieldState.mjs.map +1 -1
- package/dist/exports/useDatePickerState.cjs.map +1 -1
- package/dist/exports/useDatePickerState.js.map +1 -1
- package/dist/exports/useDatePickerState.mjs.map +1 -1
- package/dist/exports/useDateRangePickerState.cjs.map +1 -1
- package/dist/exports/useDateRangePickerState.js.map +1 -1
- package/dist/exports/useDateRangePickerState.mjs.map +1 -1
- package/dist/exports/useDisclosureGroupState.cjs.map +1 -1
- package/dist/exports/useDisclosureGroupState.js.map +1 -1
- package/dist/exports/useDisclosureGroupState.mjs.map +1 -1
- package/dist/exports/useDraggableCollectionState.cjs.map +1 -1
- package/dist/exports/useDraggableCollectionState.js.map +1 -1
- package/dist/exports/useDraggableCollectionState.mjs.map +1 -1
- package/dist/exports/useDroppableCollectionState.cjs.map +1 -1
- package/dist/exports/useDroppableCollectionState.js.map +1 -1
- package/dist/exports/useDroppableCollectionState.mjs.map +1 -1
- package/dist/exports/useMenuTriggerState.cjs.map +1 -1
- package/dist/exports/useMenuTriggerState.js.map +1 -1
- package/dist/exports/useMenuTriggerState.mjs.map +1 -1
- package/dist/exports/useMultipleSelectionState.cjs.map +1 -1
- package/dist/exports/useMultipleSelectionState.js.map +1 -1
- package/dist/exports/useMultipleSelectionState.mjs.map +1 -1
- package/dist/exports/useOverlayTriggerState.cjs.map +1 -1
- package/dist/exports/useOverlayTriggerState.js.map +1 -1
- package/dist/exports/useOverlayTriggerState.mjs.map +1 -1
- package/dist/exports/useRangeCalendarState.cjs.map +1 -1
- package/dist/exports/useRangeCalendarState.js.map +1 -1
- package/dist/exports/useRangeCalendarState.mjs.map +1 -1
- package/dist/exports/useSelectState.cjs.map +1 -1
- package/dist/exports/useSelectState.js.map +1 -1
- package/dist/exports/useSelectState.mjs.map +1 -1
- package/dist/exports/useSingleSelectListState.cjs.map +1 -1
- package/dist/exports/useSingleSelectListState.js.map +1 -1
- package/dist/exports/useSingleSelectListState.mjs.map +1 -1
- package/dist/exports/useTableState.cjs.map +1 -1
- package/dist/exports/useTableState.js.map +1 -1
- package/dist/exports/useTableState.mjs.map +1 -1
- package/dist/exports/useTimeFieldState.cjs.map +1 -1
- package/dist/exports/useTimeFieldState.js.map +1 -1
- package/dist/exports/useTimeFieldState.mjs.map +1 -1
- package/dist/exports/useToastState.cjs.map +1 -1
- package/dist/exports/useToastState.js.map +1 -1
- package/dist/exports/useToastState.mjs.map +1 -1
- package/dist/private/autocomplete/useAutocompleteState.cjs.map +1 -1
- package/dist/private/autocomplete/useAutocompleteState.js.map +1 -1
- package/dist/private/autocomplete/useAutocompleteState.mjs.map +1 -1
- package/dist/private/calendar/useCalendarState.cjs +82 -30
- package/dist/private/calendar/useCalendarState.cjs.map +1 -1
- package/dist/private/calendar/useCalendarState.js +85 -32
- package/dist/private/calendar/useCalendarState.js.map +1 -1
- package/dist/private/calendar/useCalendarState.mjs +84 -32
- package/dist/private/calendar/useCalendarState.mjs.map +1 -1
- package/dist/private/calendar/useRangeCalendarState.cjs +53 -40
- package/dist/private/calendar/useRangeCalendarState.cjs.map +1 -1
- package/dist/private/calendar/useRangeCalendarState.js +55 -43
- package/dist/private/calendar/useRangeCalendarState.js.map +1 -1
- package/dist/private/calendar/useRangeCalendarState.mjs +55 -42
- package/dist/private/calendar/useRangeCalendarState.mjs.map +1 -1
- package/dist/private/calendar/utils.cjs +6 -1
- package/dist/private/calendar/utils.cjs.map +1 -1
- package/dist/private/calendar/utils.js +6 -2
- package/dist/private/calendar/utils.js.map +1 -1
- package/dist/private/calendar/utils.mjs +6 -2
- package/dist/private/calendar/utils.mjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupState.cjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupState.js.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupState.mjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.cjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.js.map +1 -1
- package/dist/private/collections/CollectionBuilder.mjs.map +1 -1
- package/dist/private/collections/Item.cjs +1 -0
- package/dist/private/collections/Item.cjs.map +1 -1
- package/dist/private/collections/Item.js +1 -0
- package/dist/private/collections/Item.js.map +1 -1
- package/dist/private/collections/Item.mjs +1 -0
- package/dist/private/collections/Item.mjs.map +1 -1
- package/dist/private/collections/Section.cjs +1 -0
- package/dist/private/collections/Section.cjs.map +1 -1
- package/dist/private/collections/Section.js +1 -0
- package/dist/private/collections/Section.js.map +1 -1
- package/dist/private/collections/Section.mjs +1 -0
- package/dist/private/collections/Section.mjs.map +1 -1
- package/dist/private/collections/getChildNodes.cjs.map +1 -1
- package/dist/private/collections/getChildNodes.js.map +1 -1
- package/dist/private/collections/getChildNodes.mjs.map +1 -1
- package/dist/private/collections/useCollection.cjs.map +1 -1
- package/dist/private/collections/useCollection.js.map +1 -1
- package/dist/private/collections/useCollection.mjs.map +1 -1
- package/dist/private/color/Color.cjs +15 -9
- package/dist/private/color/Color.cjs.map +1 -1
- package/dist/private/color/Color.js +15 -9
- package/dist/private/color/Color.js.map +1 -1
- package/dist/private/color/Color.mjs +15 -9
- package/dist/private/color/Color.mjs.map +1 -1
- package/dist/private/color/useColorAreaState.cjs.map +1 -1
- package/dist/private/color/useColorAreaState.js.map +1 -1
- package/dist/private/color/useColorAreaState.mjs.map +1 -1
- package/dist/private/color/useColorChannelFieldState.cjs.map +1 -1
- package/dist/private/color/useColorChannelFieldState.js.map +1 -1
- package/dist/private/color/useColorChannelFieldState.mjs.map +1 -1
- package/dist/private/color/useColorFieldState.cjs.map +1 -1
- package/dist/private/color/useColorFieldState.js.map +1 -1
- package/dist/private/color/useColorFieldState.mjs.map +1 -1
- package/dist/private/color/useColorPickerState.cjs.map +1 -1
- package/dist/private/color/useColorPickerState.js.map +1 -1
- package/dist/private/color/useColorPickerState.mjs.map +1 -1
- package/dist/private/color/useColorSliderState.cjs +5 -3
- package/dist/private/color/useColorSliderState.cjs.map +1 -1
- package/dist/private/color/useColorSliderState.js +5 -3
- package/dist/private/color/useColorSliderState.js.map +1 -1
- package/dist/private/color/useColorSliderState.mjs +5 -3
- package/dist/private/color/useColorSliderState.mjs.map +1 -1
- package/dist/private/color/useColorWheelState.cjs.map +1 -1
- package/dist/private/color/useColorWheelState.js.map +1 -1
- package/dist/private/color/useColorWheelState.mjs.map +1 -1
- package/dist/private/combobox/useComboBoxState.cjs +8 -2
- package/dist/private/combobox/useComboBoxState.cjs.map +1 -1
- package/dist/private/combobox/useComboBoxState.js +8 -2
- package/dist/private/combobox/useComboBoxState.js.map +1 -1
- package/dist/private/combobox/useComboBoxState.mjs +8 -2
- package/dist/private/combobox/useComboBoxState.mjs.map +1 -1
- package/dist/private/data/useAsyncList.cjs.map +1 -1
- package/dist/private/data/useAsyncList.js.map +1 -1
- package/dist/private/data/useAsyncList.mjs.map +1 -1
- package/dist/private/data/useListData.cjs.map +1 -1
- package/dist/private/data/useListData.js.map +1 -1
- package/dist/private/data/useListData.mjs.map +1 -1
- package/dist/private/data/useTreeData.cjs.map +1 -1
- package/dist/private/data/useTreeData.js.map +1 -1
- package/dist/private/data/useTreeData.mjs.map +1 -1
- package/dist/private/datepicker/IncompleteDate.cjs +8 -2
- package/dist/private/datepicker/IncompleteDate.cjs.map +1 -1
- package/dist/private/datepicker/IncompleteDate.js +8 -2
- package/dist/private/datepicker/IncompleteDate.js.map +1 -1
- package/dist/private/datepicker/IncompleteDate.mjs +8 -2
- package/dist/private/datepicker/IncompleteDate.mjs.map +1 -1
- package/dist/private/datepicker/placeholders.cjs +5 -0
- package/dist/private/datepicker/placeholders.cjs.map +1 -1
- package/dist/private/datepicker/placeholders.js +5 -0
- package/dist/private/datepicker/placeholders.js.map +1 -1
- package/dist/private/datepicker/placeholders.mjs +5 -0
- package/dist/private/datepicker/placeholders.mjs.map +1 -1
- package/dist/private/datepicker/useDateFieldState.cjs.map +1 -1
- package/dist/private/datepicker/useDateFieldState.js.map +1 -1
- package/dist/private/datepicker/useDateFieldState.mjs.map +1 -1
- package/dist/private/datepicker/useDatePickerState.cjs.map +1 -1
- package/dist/private/datepicker/useDatePickerState.js.map +1 -1
- package/dist/private/datepicker/useDatePickerState.mjs.map +1 -1
- package/dist/private/datepicker/useDateRangePickerState.cjs +1 -1
- package/dist/private/datepicker/useDateRangePickerState.cjs.map +1 -1
- package/dist/private/datepicker/useDateRangePickerState.js +1 -1
- package/dist/private/datepicker/useDateRangePickerState.js.map +1 -1
- package/dist/private/datepicker/useDateRangePickerState.mjs +1 -1
- package/dist/private/datepicker/useDateRangePickerState.mjs.map +1 -1
- package/dist/private/datepicker/useTimeFieldState.cjs.map +1 -1
- package/dist/private/datepicker/useTimeFieldState.js.map +1 -1
- package/dist/private/datepicker/useTimeFieldState.mjs.map +1 -1
- package/dist/private/datepicker/utils.cjs +2 -2
- package/dist/private/datepicker/utils.cjs.map +1 -1
- package/dist/private/datepicker/utils.js +2 -2
- package/dist/private/datepicker/utils.js.map +1 -1
- package/dist/private/datepicker/utils.mjs +2 -2
- package/dist/private/datepicker/utils.mjs.map +1 -1
- package/dist/private/disclosure/useDisclosureGroupState.cjs.map +1 -1
- package/dist/private/disclosure/useDisclosureGroupState.js.map +1 -1
- package/dist/private/disclosure/useDisclosureGroupState.mjs.map +1 -1
- package/dist/private/disclosure/useDisclosureState.cjs.map +1 -1
- package/dist/private/disclosure/useDisclosureState.js.map +1 -1
- package/dist/private/disclosure/useDisclosureState.mjs.map +1 -1
- package/dist/private/dnd/useDraggableCollectionState.cjs.map +1 -1
- package/dist/private/dnd/useDraggableCollectionState.js.map +1 -1
- package/dist/private/dnd/useDraggableCollectionState.mjs.map +1 -1
- package/dist/private/dnd/useDroppableCollectionState.cjs.map +1 -1
- package/dist/private/dnd/useDroppableCollectionState.js.map +1 -1
- package/dist/private/dnd/useDroppableCollectionState.mjs.map +1 -1
- package/dist/private/form/useFormValidationState.cjs.map +1 -1
- package/dist/private/form/useFormValidationState.js.map +1 -1
- package/dist/private/form/useFormValidationState.mjs.map +1 -1
- package/dist/private/grid/GridCollection.cjs.map +1 -1
- package/dist/private/grid/GridCollection.js.map +1 -1
- package/dist/private/grid/GridCollection.mjs.map +1 -1
- package/dist/private/grid/useGridState.cjs.map +1 -1
- package/dist/private/grid/useGridState.js.map +1 -1
- package/dist/private/grid/useGridState.mjs.map +1 -1
- package/dist/private/layout/GridLayout.cjs +8 -3
- package/dist/private/layout/GridLayout.cjs.map +1 -1
- package/dist/private/layout/GridLayout.js +8 -3
- package/dist/private/layout/GridLayout.js.map +1 -1
- package/dist/private/layout/GridLayout.mjs +8 -3
- package/dist/private/layout/GridLayout.mjs.map +1 -1
- package/dist/private/layout/ListLayout.cjs +1 -1
- package/dist/private/layout/ListLayout.cjs.map +1 -1
- package/dist/private/layout/ListLayout.js +2 -1
- package/dist/private/layout/ListLayout.js.map +1 -1
- package/dist/private/layout/ListLayout.mjs +1 -1
- package/dist/private/layout/ListLayout.mjs.map +1 -1
- package/dist/private/layout/TableLayout.cjs +60 -35
- package/dist/private/layout/TableLayout.cjs.map +1 -1
- package/dist/private/layout/TableLayout.js +65 -38
- package/dist/private/layout/TableLayout.js.map +1 -1
- package/dist/private/layout/TableLayout.mjs +61 -36
- package/dist/private/layout/TableLayout.mjs.map +1 -1
- package/dist/private/layout/WaterfallLayout.cjs.map +1 -1
- package/dist/private/layout/WaterfallLayout.js.map +1 -1
- package/dist/private/layout/WaterfallLayout.mjs.map +1 -1
- package/dist/private/list/ListCollection.cjs.map +1 -1
- package/dist/private/list/ListCollection.js.map +1 -1
- package/dist/private/list/ListCollection.mjs.map +1 -1
- package/dist/private/list/useListState.cjs.map +1 -1
- package/dist/private/list/useListState.js.map +1 -1
- package/dist/private/list/useListState.mjs.map +1 -1
- package/dist/private/list/useSingleSelectListState.cjs.map +1 -1
- package/dist/private/list/useSingleSelectListState.js.map +1 -1
- package/dist/private/list/useSingleSelectListState.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.map +1 -1
- package/dist/private/menu/useSubmenuTriggerState.js.map +1 -1
- package/dist/private/menu/useSubmenuTriggerState.mjs.map +1 -1
- package/dist/private/numberfield/useNumberFieldState.cjs +13 -1
- package/dist/private/numberfield/useNumberFieldState.cjs.map +1 -1
- package/dist/private/numberfield/useNumberFieldState.js +13 -1
- package/dist/private/numberfield/useNumberFieldState.js.map +1 -1
- package/dist/private/numberfield/useNumberFieldState.mjs +13 -1
- package/dist/private/numberfield/useNumberFieldState.mjs.map +1 -1
- package/dist/private/overlays/useOverlayTriggerState.cjs.map +1 -1
- package/dist/private/overlays/useOverlayTriggerState.js.map +1 -1
- package/dist/private/overlays/useOverlayTriggerState.mjs.map +1 -1
- package/dist/private/radio/useRadioGroupState.cjs.map +1 -1
- package/dist/private/radio/useRadioGroupState.js.map +1 -1
- package/dist/private/radio/useRadioGroupState.mjs.map +1 -1
- package/dist/private/searchfield/useSearchFieldState.cjs.map +1 -1
- package/dist/private/searchfield/useSearchFieldState.js.map +1 -1
- package/dist/private/searchfield/useSearchFieldState.mjs.map +1 -1
- package/dist/private/select/useSelectState.cjs.map +1 -1
- package/dist/private/select/useSelectState.js.map +1 -1
- package/dist/private/select/useSelectState.mjs.map +1 -1
- package/dist/private/selection/SelectionManager.cjs +2 -1
- package/dist/private/selection/SelectionManager.cjs.map +1 -1
- package/dist/private/selection/SelectionManager.js +3 -2
- package/dist/private/selection/SelectionManager.js.map +1 -1
- package/dist/private/selection/SelectionManager.mjs +2 -1
- package/dist/private/selection/SelectionManager.mjs.map +1 -1
- package/dist/private/selection/useMultipleSelectionState.cjs.map +1 -1
- package/dist/private/selection/useMultipleSelectionState.js.map +1 -1
- package/dist/private/selection/useMultipleSelectionState.mjs.map +1 -1
- package/dist/private/slider/useSliderState.cjs +22 -2
- package/dist/private/slider/useSliderState.cjs.map +1 -1
- package/dist/private/slider/useSliderState.js +22 -2
- package/dist/private/slider/useSliderState.js.map +1 -1
- package/dist/private/slider/useSliderState.mjs +22 -2
- package/dist/private/slider/useSliderState.mjs.map +1 -1
- package/dist/private/steplist/useStepListState.cjs.map +1 -1
- package/dist/private/steplist/useStepListState.js.map +1 -1
- package/dist/private/steplist/useStepListState.mjs.map +1 -1
- package/dist/private/table/Cell.cjs +2 -1
- package/dist/private/table/Cell.cjs.map +1 -1
- package/dist/private/table/Cell.js +2 -1
- package/dist/private/table/Cell.js.map +1 -1
- package/dist/private/table/Cell.mjs +2 -1
- package/dist/private/table/Cell.mjs.map +1 -1
- package/dist/private/table/Column.cjs +1 -0
- package/dist/private/table/Column.cjs.map +1 -1
- package/dist/private/table/Column.js +1 -0
- package/dist/private/table/Column.js.map +1 -1
- package/dist/private/table/Column.mjs +1 -0
- package/dist/private/table/Column.mjs.map +1 -1
- package/dist/private/table/Row.cjs +2 -1
- package/dist/private/table/Row.cjs.map +1 -1
- package/dist/private/table/Row.js +2 -1
- package/dist/private/table/Row.js.map +1 -1
- package/dist/private/table/Row.mjs +2 -1
- package/dist/private/table/Row.mjs.map +1 -1
- package/dist/private/table/TableBody.cjs +4 -2
- package/dist/private/table/TableBody.cjs.map +1 -1
- package/dist/private/table/TableBody.js +4 -2
- package/dist/private/table/TableBody.js.map +1 -1
- package/dist/private/table/TableBody.mjs +4 -2
- package/dist/private/table/TableBody.mjs.map +1 -1
- package/dist/private/table/TableCollection.cjs +1 -1
- package/dist/private/table/TableCollection.cjs.map +1 -1
- package/dist/private/table/TableCollection.js +1 -1
- package/dist/private/table/TableCollection.js.map +1 -1
- package/dist/private/table/TableCollection.mjs +1 -1
- package/dist/private/table/TableCollection.mjs.map +1 -1
- package/dist/private/table/TableColumnLayout.cjs +4 -1
- package/dist/private/table/TableColumnLayout.cjs.map +1 -1
- package/dist/private/table/TableColumnLayout.js +4 -1
- package/dist/private/table/TableColumnLayout.js.map +1 -1
- package/dist/private/table/TableColumnLayout.mjs +4 -1
- package/dist/private/table/TableColumnLayout.mjs.map +1 -1
- package/dist/private/table/TableHeader.cjs +4 -2
- package/dist/private/table/TableHeader.cjs.map +1 -1
- package/dist/private/table/TableHeader.js +4 -2
- package/dist/private/table/TableHeader.js.map +1 -1
- package/dist/private/table/TableHeader.mjs +4 -2
- package/dist/private/table/TableHeader.mjs.map +1 -1
- package/dist/private/table/TableUtils.cjs +1 -1
- package/dist/private/table/TableUtils.cjs.map +1 -1
- package/dist/private/table/TableUtils.js +1 -1
- package/dist/private/table/TableUtils.js.map +1 -1
- package/dist/private/table/TableUtils.mjs +1 -1
- package/dist/private/table/TableUtils.mjs.map +1 -1
- package/dist/private/table/useTableColumnResizeState.cjs.map +1 -1
- package/dist/private/table/useTableColumnResizeState.js.map +1 -1
- package/dist/private/table/useTableColumnResizeState.mjs.map +1 -1
- package/dist/private/table/useTableState.cjs +2 -1
- package/dist/private/table/useTableState.cjs.map +1 -1
- package/dist/private/table/useTableState.js +2 -1
- package/dist/private/table/useTableState.js.map +1 -1
- package/dist/private/table/useTableState.mjs +2 -1
- package/dist/private/table/useTableState.mjs.map +1 -1
- package/dist/private/table/useTreeGridState.cjs +2 -1
- package/dist/private/table/useTreeGridState.cjs.map +1 -1
- package/dist/private/table/useTreeGridState.js +2 -1
- package/dist/private/table/useTreeGridState.js.map +1 -1
- package/dist/private/table/useTreeGridState.mjs +2 -1
- package/dist/private/table/useTreeGridState.mjs.map +1 -1
- package/dist/private/tabs/useTabListState.cjs.map +1 -1
- package/dist/private/tabs/useTabListState.js.map +1 -1
- package/dist/private/tabs/useTabListState.mjs.map +1 -1
- package/dist/private/toast/useToastState.cjs.map +1 -1
- package/dist/private/toast/useToastState.js.map +1 -1
- package/dist/private/toast/useToastState.mjs.map +1 -1
- package/dist/private/toggle/useToggleGroupState.cjs.map +1 -1
- package/dist/private/toggle/useToggleGroupState.js.map +1 -1
- package/dist/private/toggle/useToggleGroupState.mjs.map +1 -1
- package/dist/private/toggle/useToggleState.cjs.map +1 -1
- package/dist/private/toggle/useToggleState.js.map +1 -1
- package/dist/private/toggle/useToggleState.mjs.map +1 -1
- package/dist/private/tooltip/useTooltipTriggerState.cjs.map +1 -1
- package/dist/private/tooltip/useTooltipTriggerState.js.map +1 -1
- package/dist/private/tooltip/useTooltipTriggerState.mjs.map +1 -1
- package/dist/private/tree/TreeCollection.cjs.map +1 -1
- package/dist/private/tree/TreeCollection.js.map +1 -1
- package/dist/private/tree/TreeCollection.mjs.map +1 -1
- package/dist/private/tree/useTreeState.cjs.map +1 -1
- package/dist/private/tree/useTreeState.js.map +1 -1
- package/dist/private/tree/useTreeState.mjs.map +1 -1
- package/dist/private/utils/number.cjs +2 -1
- package/dist/private/utils/number.cjs.map +1 -1
- package/dist/private/utils/number.js +2 -1
- package/dist/private/utils/number.js.map +1 -1
- package/dist/private/utils/number.mjs +2 -1
- package/dist/private/utils/number.mjs.map +1 -1
- package/dist/private/utils/useControlledState.cjs.map +1 -1
- package/dist/private/utils/useControlledState.js.map +1 -1
- package/dist/private/utils/useControlledState.mjs.map +1 -1
- package/dist/private/virtualizer/Layout.cjs.map +1 -1
- package/dist/private/virtualizer/Layout.js.map +1 -1
- package/dist/private/virtualizer/Layout.mjs.map +1 -1
- package/dist/private/virtualizer/LayoutInfo.cjs +4 -2
- package/dist/private/virtualizer/LayoutInfo.cjs.map +1 -1
- package/dist/private/virtualizer/LayoutInfo.js +4 -2
- package/dist/private/virtualizer/LayoutInfo.js.map +1 -1
- package/dist/private/virtualizer/LayoutInfo.mjs +4 -2
- package/dist/private/virtualizer/LayoutInfo.mjs.map +1 -1
- package/dist/private/virtualizer/Rect.cjs +4 -0
- package/dist/private/virtualizer/Rect.cjs.map +1 -1
- package/dist/private/virtualizer/Rect.js +4 -0
- package/dist/private/virtualizer/Rect.js.map +1 -1
- package/dist/private/virtualizer/Rect.mjs +4 -0
- package/dist/private/virtualizer/Rect.mjs.map +1 -1
- package/dist/private/virtualizer/ReusableView.cjs.map +1 -1
- package/dist/private/virtualizer/ReusableView.js.map +1 -1
- package/dist/private/virtualizer/ReusableView.mjs.map +1 -1
- package/dist/private/virtualizer/Size.cjs.map +1 -1
- package/dist/private/virtualizer/Size.js.map +1 -1
- package/dist/private/virtualizer/Size.mjs.map +1 -1
- package/dist/private/virtualizer/Virtualizer.cjs +4 -4
- package/dist/private/virtualizer/Virtualizer.cjs.map +1 -1
- package/dist/private/virtualizer/Virtualizer.js +4 -4
- package/dist/private/virtualizer/Virtualizer.js.map +1 -1
- package/dist/private/virtualizer/Virtualizer.mjs +4 -4
- package/dist/private/virtualizer/Virtualizer.mjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerState.cjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerState.js.map +1 -1
- package/dist/private/virtualizer/useVirtualizerState.mjs.map +1 -1
- package/dist/types/exports/useCalendarState.d.ts +1 -1
- package/dist/types/src/autocomplete/useAutocompleteState.d.ts +4 -1
- package/dist/types/src/calendar/types.d.ts +50 -14
- package/dist/types/src/calendar/useCalendarState.d.ts +20 -6
- package/dist/types/src/calendar/useRangeCalendarState.d.ts +14 -5
- package/dist/types/src/calendar/utils.d.ts +1 -0
- package/dist/types/src/checkbox/useCheckboxGroupState.d.ts +1 -0
- package/dist/types/src/collections/useCollection.d.ts +1 -1
- package/dist/types/src/color/useColorAreaState.d.ts +21 -8
- package/dist/types/src/color/useColorFieldState.d.ts +2 -3
- package/dist/types/src/color/useColorSliderState.d.ts +4 -1
- package/dist/types/src/color/useColorWheelState.d.ts +5 -1
- package/dist/types/src/combobox/useComboBoxState.d.ts +19 -6
- package/dist/types/src/data/useAsyncList.d.ts +2 -2
- package/dist/types/src/data/useListData.d.ts +13 -1
- package/dist/types/src/data/useTreeData.d.ts +11 -0
- package/dist/types/src/datepicker/IncompleteDate.d.ts +11 -5
- package/dist/types/src/datepicker/types.d.ts +37 -11
- package/dist/types/src/datepicker/useDateFieldState.d.ts +13 -4
- package/dist/types/src/datepicker/useDatePickerState.d.ts +10 -4
- package/dist/types/src/datepicker/useDateRangePickerState.d.ts +12 -3
- package/dist/types/src/dnd/useDraggableCollectionState.d.ts +4 -1
- package/dist/types/src/form/useFormValidationState.d.ts +4 -1
- package/dist/types/src/grid/GridCollection.d.ts +2 -1
- package/dist/types/src/grid/useGridState.d.ts +7 -3
- package/dist/types/src/layout/GridLayout.d.ts +18 -2
- package/dist/types/src/layout/ListLayout.d.ts +34 -12
- package/dist/types/src/layout/TableLayout.d.ts +11 -4
- package/dist/types/src/layout/WaterfallLayout.d.ts +9 -2
- package/dist/types/src/list/useListState.d.ts +2 -2
- package/dist/types/src/menu/useMenuTriggerState.d.ts +3 -1
- package/dist/types/src/menu/useSubmenuTriggerState.d.ts +2 -2
- package/dist/types/src/numberfield/useNumberFieldState.d.ts +15 -11
- package/dist/types/src/radio/useRadioGroupState.d.ts +4 -1
- package/dist/types/src/select/useSelectState.d.ts +13 -2
- package/dist/types/src/selection/types.d.ts +4 -1
- package/dist/types/src/selection/useMultipleSelectionState.d.ts +2 -0
- package/dist/types/src/slider/useSliderState.d.ts +22 -2
- package/dist/types/src/table/Column.d.ts +4 -1
- package/dist/types/src/table/Row.d.ts +5 -3
- package/dist/types/src/table/TableBody.d.ts +3 -2
- package/dist/types/src/table/TableCollection.d.ts +4 -1
- package/dist/types/src/table/TableColumnLayout.d.ts +4 -1
- package/dist/types/src/table/TableHeader.d.ts +7 -3
- package/dist/types/src/table/TableUtils.d.ts +19 -16
- package/dist/types/src/table/useTableColumnResizeState.d.ts +5 -3
- package/dist/types/src/table/useTableState.d.ts +15 -6
- package/dist/types/src/table/useTreeGridState.d.ts +3 -2
- package/dist/types/src/toggle/useToggleGroupState.d.ts +1 -0
- package/dist/types/src/toggle/useToggleState.d.ts +2 -1
- package/dist/types/src/tooltip/useTooltipTriggerState.d.ts +8 -2
- package/dist/types/src/tree/useTreeState.d.ts +1 -1
- package/dist/types/src/utils/number.d.ts +2 -1
- package/dist/types/src/virtualizer/Layout.d.ts +5 -2
- package/dist/types/src/virtualizer/LayoutInfo.d.ts +10 -3
- package/dist/types/src/virtualizer/Rect.d.ts +4 -0
- package/dist/types/src/virtualizer/Virtualizer.d.ts +5 -4
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAyFD,MAAM,uCAAiB;AAOhB,MAAM,kDAAuE,CAAA,GAAA,gCAAK;IAoBvF;;;GAGC,GACD,YAAY,UAA6B,CAAC,CAAC,CAAE;QAC3C,KAAK;QACL,IAAI,CAAC,OAAO,GAAG,SAAS,WAAW,SAAS,aAAa;QACzD,IAAI,CAAC,WAAW,GAAG,QAAQ,WAAW,IAAI;QAC1C,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AK,MAAM,QAAQ,WACjB,IAAI,UAAU,OACZ,OAAO,IAAI,CAAC;IAGhB,OAAO;AACT","sources":["packages/react-stately/src/layout/ListLayout.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 {Collection, DropTarget, DropTargetDelegate, ItemDropTarget, Key, Node, Orientation} from '@react-types/shared';\nimport {getChildNodes} from '../collections/getChildNodes';\nimport {InvalidationContext} from '../virtualizer/types';\nimport {Layout} from '../virtualizer/Layout';\nimport {LayoutInfo} from '../virtualizer/LayoutInfo';\nimport {Rect} from '../virtualizer/Rect';\nimport {Size} from '../virtualizer/Size';\n\nexport interface ListLayoutOptions {\n /**\n * The primary orientation of the items. Usually this is the direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The fixed size of a row in px with respect to the applied orientation.\n * @default 48\n */\n rowSize?: number,\n /** The estimated size of a row in px with respect to the applied orientation, when row sizes are variable. */\n estimatedRowSize?: number,\n /**\n * The fixed size of a section header in px with respect to the applied orientation.\n * @default 48\n */\n headingSize?: number,\n /** The estimated size of a section header in px with respect to the applied orientation, when heading sizes are variable. */\n estimatedHeadingSize?: number,\n /**\n * The fixed size of a loader element in px with respect to the applied orientation. This loader is specifically for\n * \"load more\" elements rendered when loading more rows at the root level or inside nested row/sections.\n * @default 48\n */\n loaderSize?: number,\n /**\n * The thickness of the drop indicator.\n * @default 2\n */\n dropIndicatorThickness?: number,\n /**\n * The gap between items.\n * @default 0\n */\n gap?: number,\n /**\n * The padding around the list.\n * @default 0\n */\n padding?: number,\n /**\n * The fixed height of a row in px.\n * @default 48\n * @deprecated Use `rowSize` instead.\n */\n rowHeight?: number,\n /** The estimated height of a row, when row heights are variable.\n * @deprecated Use `estimatedRowSize` instead.\n */\n estimatedRowHeight?: number,\n /**\n * The fixed height of a section header in px.\n * @default 48\n * @deprecated Use `headingSize` instead.\n */\n headingHeight?: number,\n /** The estimated height of a section header, when the height is variable.\n * @deprecated Use `estimatedHeadingSize` instead.\n */\n estimatedHeadingHeight?: number,\n /**\n * The fixed height of a loader element in px. This loader is specifically for\n * \"load more\" elements rendered when loading more rows at the root level or inside nested row/sections.\n * @default 48\n * @deprecated Use `loaderSize` instead.\n */\n loaderHeight?: number\n}\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect,\n index?: number\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * ListLayout is a virtualizer Layout implementation\n * that arranges its items in a stack along its applied orientation.\n * It supports both fixed and variable size items.\n */\nexport class ListLayout<T, O extends ListLayoutOptions = ListLayoutOptions> extends Layout<Node<T>, O> implements DropTargetDelegate {\n protected rowSize: number | null;\n protected orientation: Orientation;\n protected estimatedRowSize: number | null;\n protected headingSize: number | null;\n protected estimatedHeadingSize: number | null;\n protected loaderSize: number | null;\n protected dropIndicatorThickness: number;\n protected gap: number;\n protected padding: number;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n protected lastCollection: Collection<Node<T>> | null;\n protected rootNodes: LayoutNode[];\n private invalidateEverything: boolean;\n /** The rectangle containing currently valid layout infos. */\n protected validRect: Rect;\n /** The rectangle of requested layout infos so far. */\n protected requestedRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions = {}) {\n super();\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? null;\n this.orientation = options.orientation ?? 'vertical';\n this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? null;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? null;\n this.estimatedHeadingSize = options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? null;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? null;\n this.dropIndicatorThickness = options.dropIndicatorThickness || 2;\n this.gap = options.gap || 0;\n this.padding = options.padding || 0;\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastCollection = null;\n this.invalidateEverything = false;\n this.validRect = new Rect();\n this.requestedRect = new Rect();\n this.contentSize = new Size();\n }\n\n // Backward compatibility for subclassing.\n protected get collection(): Collection<Node<T>> {\n return this.virtualizer!.collection;\n }\n\n /** @deprecated Use `rowSize` instead. */\n protected get rowHeight(): number | null {\n return this.rowSize;\n }\n\n /** @deprecated Use `estimatedRowSize` instead. */\n protected get estimatedRowHeight(): number | null {\n return this.estimatedRowSize;\n }\n\n /** @deprecated Use `headingSize` instead. */\n protected get headingHeight(): number | null {\n return this.headingSize;\n\n }\n /** @deprecated Use `estimatedHeadingSize` instead. */\n protected get estimatedHeadingHeight(): number | null {\n return this.estimatedHeadingSize;\n }\n\n /** @deprecated Use `loaderSize` instead. */\n protected get loaderHeight(): number | null {\n return this.loaderSize;\n }\n\n getLayoutInfo(key: Key): LayoutInfo | null {\n this.ensureLayoutInfo(key);\n return this.layoutNodes.get(key)?.layoutInfo || null;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 or width > 1 for getDropTargetFromPoint)\n if (rect[heightProperty] > 1) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Clone only before mutating\n rect = rect.copy();\n let offset = Math.floor(rect[offsetProperty] / rowHeight) * rowHeight;\n let height = rect[heightProperty] + rect[offsetProperty] - offset;\n rect[offsetProperty] = offset;\n rect[heightProperty] = Math.ceil(height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n protected layoutIfNeeded(rect: Rect): void {\n if (!this.lastCollection) {\n return;\n }\n\n if (!this.requestedRect.containsRect(rect)) {\n this.requestedRect = this.requestedRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n // Ensure all of the persisted keys are available.\n for (let key of this.virtualizer!.persistedKeys) {\n if (this.ensureLayoutInfo(key)) {\n return;\n }\n }\n }\n\n private ensureLayoutInfo(key: Key) {\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!this.layoutNodes.has(key) && this.requestedRect.area < this.contentSize.area && this.lastCollection) {\n this.requestedRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.requestedRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n return true;\n }\n\n return false;\n }\n\n protected isVisible(node: LayoutNode, rect: Rect): boolean {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || node.layoutInfo.type === 'header' || node.layoutInfo.type === 'loader' || this.virtualizer!.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<O>): boolean {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n // Also invalidate if fixed sizes/gaps change.\n let options = invalidationContext.layoutOptions;\n return invalidationContext.sizeChanged\n || this.rowSize !== (options?.rowSize ?? options?.rowHeight ?? this.rowSize)\n || this.orientation !== (options?.orientation ?? this.orientation)\n || this.headingSize !== (options?.headingSize ?? options?.headingHeight ?? this.headingSize)\n || this.loaderSize !== (options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize)\n || this.gap !== (options?.gap ?? this.gap)\n || this.padding !== (options?.padding ?? this.padding);\n }\n\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return (newOptions?.rowSize ?? newOptions?.rowHeight) !== (oldOptions?.rowSize ?? oldOptions?.rowHeight)\n || newOptions.orientation !== oldOptions.orientation\n || (newOptions?.estimatedRowSize ?? newOptions?.estimatedRowHeight) !== (oldOptions?.estimatedRowSize ?? oldOptions?.estimatedRowHeight)\n || (newOptions?.headingSize ?? newOptions?.headingHeight) !== (oldOptions?.headingSize ?? oldOptions?.headingHeight)\n || (newOptions?.estimatedHeadingSize ?? newOptions?.estimatedHeadingHeight) !== (oldOptions?.estimatedHeadingSize ?? oldOptions?.estimatedHeadingHeight)\n || (newOptions?.loaderSize ?? newOptions?.loaderHeight) !== (oldOptions?.loaderSize ?? oldOptions?.loaderHeight)\n || newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness\n || newOptions.gap !== oldOptions.gap\n || newOptions.padding !== oldOptions.padding;\n }\n\n update(invalidationContext: InvalidationContext<O>): void {\n let collection = this.virtualizer!.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.requestedRect = this.virtualizer!.visibleRect.copy();\n this.layoutNodes.clear();\n }\n\n let options = invalidationContext.layoutOptions;\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? this.rowSize;\n this.orientation = options?.orientation ?? this.orientation;\n this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? this.estimatedRowSize;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? this.headingSize;\n this.estimatedHeadingSize = options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? this.estimatedHeadingSize;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize;\n this.dropIndicatorThickness = options?.dropIndicatorThickness ?? this.dropIndicatorThickness;\n this.gap = options?.gap ?? this.gap;\n this.padding = options?.padding ?? this.padding;\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastCollection = collection;\n this.invalidateEverything = false;\n this.validRect = this.requestedRect.copy();\n }\n\n protected buildCollection(offset: number = this.padding): LayoutNode[] {\n let collection = this.virtualizer!.collection;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n\n // filter out content nodes since we don't want them to affect the height\n // Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n let collectionNodes = toArray(collection, (node) => node.type !== 'content');\n let loaderNodes = collectionNodes.filter(node => node.type === 'loader');\n let nodes: LayoutNode[] = [];\n let isEmptyOrLoading = collection?.size === 0;\n if (isEmptyOrLoading) {\n offset = 0;\n }\n\n for (let node of collectionNodes) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && offset + rowHeight < this.requestedRect[offsetProperty] && !this.isValid(node, offset)) {\n offset += rowHeight;\n continue;\n }\n\n let layoutNode = this.orientation === 'horizontal' ? this.buildChild(node, offset, this.padding, null) : this.buildChild(node, this.padding, offset, null);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n nodes.push(layoutNode);\n if (node.type === 'loader') {\n let index = loaderNodes.indexOf(node);\n loaderNodes.splice(index, 1);\n }\n\n // Build each loader that exists in the collection that is outside the visible rect so that they are persisted\n // at the proper estimated location. If the node.type is \"section\" then we don't do this shortcut since we have to\n // build the sections to see how tall they are.\n if ((node.type === 'item' || node.type === 'loader') && offset > this.requestedRect[maxOffsetProperty]) {\n let lastProcessedIndex = collectionNodes.indexOf(node);\n for (let loaderNode of loaderNodes) {\n let loaderNodeIndex = collectionNodes.indexOf(loaderNode);\n // Subtract by an additional 1 since we've already added the current item's height to y\n offset += (loaderNodeIndex - lastProcessedIndex - 1) * rowHeight;\n let loader = this.orientation === 'horizontal' ? this.buildChild(loaderNode, offset, this.padding, null) : this.buildChild(loaderNode, this.padding, offset, null);\n nodes.push(loader);\n offset = loader.layoutInfo.rect[maxOffsetProperty];\n lastProcessedIndex = loaderNodeIndex;\n }\n\n // Account for the rest of the items after the last loader spinner, subtract by 1 since we've processed the current node's height already\n offset += (collectionNodes.length - lastProcessedIndex - 1) * rowHeight;\n break;\n }\n }\n\n offset = Math.max(offset - this.gap, 0);\n offset += isEmptyOrLoading ? 0 : this.padding;\n this.contentSize = this.orientation === 'horizontal' ? new Size(offset, this.virtualizer!.size.height) : new Size(this.virtualizer!.size.width, offset);\n return nodes;\n }\n\n protected isValid(node: Node<T>, offset: number): boolean {\n let cached = this.layoutNodes.get(node.key);\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n return (\n !this.invalidateEverything &&\n !!cached &&\n cached.node === node &&\n offset === cached.layoutInfo.rect[offsetProperty] &&\n cached.layoutInfo.rect.intersects(this.validRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.requestedRect))\n );\n }\n\n protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {\n if (this.isValid(node, this.orientation === 'horizontal' ? x : y)) {\n return this.layoutNodes.get(node.key)!;\n }\n\n let layoutNode = this.buildNode(node, x, y);\n\n layoutNode.layoutInfo.parentKey = parentKey ?? null;\n layoutNode.layoutInfo.allowOverflow = true;\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n case 'header':\n return this.buildSectionHeader(node, x, y);\n case 'loader':\n return this.buildLoader(node, x, y);\n case 'separator':\n return this.buildItem(node, x, y);\n default:\n throw new Error('Unsupported node type: ' + node.type);\n }\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, this.padding, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n // Note that if the user provides isLoading to their sentinel during a case where they only want to render the emptyState, this will reserve\n // room for the loader alongside rendering the emptyState\n if (this.orientation === 'horizontal') {\n rect.height = this.virtualizer!.contentSize.height - this.padding - y;\n rect.width = node.props.isLoading ? this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT : 0;\n } else {\n rect.width = this.virtualizer!.contentSize.width - this.padding - x;\n rect.height = node.props.isLoading ? this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT : 0;\n }\n\n return {\n layoutInfo,\n validRect: rect.intersection(this.requestedRect)\n };\n }\n\n protected buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let collection = this.virtualizer!.collection;\n let width = this.virtualizer!.size.width - this.padding - x;\n let height = this.virtualizer!.size.height - this.padding - y;\n let rect = this.orientation === 'horizontal' ? new Rect(x, y, 0, height) : new Rect(x, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let offset = this.orientation === 'horizontal' ? x : y;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let skipped = 0;\n let children: LayoutNode[] = [];\n for (let child of getChildNodes(node, collection)) {\n // skip if it is a content node, Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n if (child.type === 'content') {\n continue;\n }\n\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (offset + rowHeight < this.requestedRect[offsetProperty] && !this.isValid(node, offset)) {\n offset += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.orientation === 'horizontal' ? this.buildChild(child, offset, y, layoutInfo.key) : this.buildChild(child, x, offset, layoutInfo.key);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n children.push(layoutNode);\n\n if (offset > this.requestedRect[maxOffsetProperty]) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n offset += ([...getChildNodes(node, collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n offset -= this.gap;\n rect[heightProperty] = offset - (this.orientation === 'horizontal' ? x : y);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n let width = this.virtualizer!.size[widthProperty] - this.padding - (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.headingSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n let previousLayoutInfo = previousLayoutNode?.layoutInfo;\n if (previousLayoutInfo) {\n let curNode = this.virtualizer!.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode!.layoutInfo.rect[heightProperty];\n isEstimated = width !== previousLayoutInfo.rect[widthProperty] || curNode !== lastNode || previousLayoutInfo.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingSize : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = this.orientation === 'horizontal' ? new Rect(x, y, rectHeight, width - y) : new Rect(x, y, width - x, rectHeight);\n let header = new LayoutInfo('header', node.key, headerRect);\n header.estimatedSize = isEstimated;\n return {\n layoutInfo: header,\n children: [],\n validRect: header.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let width = this.virtualizer!.size[widthProperty] - this.padding - (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.rowSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect[heightProperty];\n isEstimated = width !== previousLayoutNode.layoutInfo.rect[widthProperty] || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowSize;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let rect = this.orientation === 'horizontal' ? new Rect(x, y, rectHeight, width) : new Rect(x, y, width, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n children: [],\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n updateItemSize(key: Key, size: Size): boolean {\n let layoutNode = this.layoutNodes.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutNode) {\n return false;\n }\n\n let collection = this.virtualizer!.collection;\n let layoutInfo = layoutNode.layoutInfo;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect[heightProperty] !== size[heightProperty]) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect[heightProperty] = size[heightProperty];\n layoutNode.layoutInfo = newLayoutInfo;\n\n // Items after this layoutInfo will need to be repositioned to account for the new height.\n // Adjust the validRect so that only items above remain valid.\n this.validRect[heightProperty] = Math.min(this.validRect[heightProperty], layoutInfo.rect[offsetProperty] - this.validRect[offsetProperty]);\n\n // The requestedRect also needs to be adjusted to account for the height difference.\n this.requestedRect[heightProperty] += newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = node.parentKey != null ? collection.getItem(node.parentKey) : null;\n }\n\n return true;\n }\n\n return false;\n }\n\n private updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by intersecting the validRect of this node with the overall validRect.\n n.validRect = n.validRect.intersection(this.validRect);\n\n // Replace layout info in LayoutNode\n if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null {\n x += this.virtualizer!.visibleRect.x;\n y += this.virtualizer!.visibleRect.y;\n\n // Find the closest item within on either side of the point using the gap width.\n let searchRect = new Rect(x, Math.max(0, y - this.gap), 1, Math.max(1, this.gap * 2));\n let candidates = this.getVisibleLayoutInfos(searchRect);\n let key: Key | null = null;\n let minDistance = Infinity;\n for (let candidate of candidates) {\n // Ignore items outside the search rect, e.g. persisted keys.\n if (!candidate.rect.intersects(searchRect)) {\n continue;\n }\n\n let yDist = Math.abs(candidate.rect.y - y);\n let maxYDist = Math.abs(candidate.rect.maxY - y);\n let dist = Math.min(yDist, maxYDist);\n if (dist < minDistance) {\n minDistance = dist;\n key = candidate.key;\n }\n }\n\n if (key == null || this.virtualizer!.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n\n getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n let layoutInfo = this.getLayoutInfo(target.key)!;\n let rect: Rect;\n if (target.dropPosition === 'before') {\n rect = this.orientation === 'horizontal' ?\n new Rect(Math.max(0, layoutInfo.rect.x - this.dropIndicatorThickness / 2), layoutInfo.rect.y, this.dropIndicatorThickness, layoutInfo.rect.height)\n : new Rect(layoutInfo.rect.x, Math.max(0, layoutInfo.rect.y - this.dropIndicatorThickness / 2), layoutInfo.rect.width, this.dropIndicatorThickness);\n } else if (target.dropPosition === 'after') {\n // Render after last visible descendant of the drop target.\n let targetNode = this.collection.getItem(target.key);\n if (targetNode) {\n let targetLevel = targetNode.level ?? 0;\n let currentKey = this.collection.getKeyAfter(target.key);\n\n while (currentKey != null) {\n let node = this.collection.getItem(currentKey);\n if (!node || node.level <= targetLevel) {\n break;\n }\n\n layoutInfo = this.getLayoutInfo(currentKey) || layoutInfo;\n currentKey = this.collection.getKeyAfter(currentKey);\n }\n }\n rect = this.orientation === 'horizontal' ?\n new Rect(layoutInfo.rect.maxX - this.dropIndicatorThickness / 2, layoutInfo.rect.y, this.dropIndicatorThickness, layoutInfo.rect.height)\n : new Rect(layoutInfo.rect.x, layoutInfo.rect.maxY - this.dropIndicatorThickness / 2, layoutInfo.rect.width, this.dropIndicatorThickness);\n } else {\n rect = layoutInfo.rect;\n }\n\n return new LayoutInfo('dropIndicator', target.key + ':' + target.dropPosition, rect);\n }\n}\n\nfunction toArray<T>(collection: Collection<Node<T>>, predicate: (node: Node<T>) => boolean): Node<T>[] {\n const result: Node<T>[] = [];\n for (const node of collection) {\n if (predicate(node)) {\n result.push(node);\n }\n }\n return result;\n}\n"],"names":[],"version":3,"file":"ListLayout.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuHD,MAAM,uCAAiB;AAOhB,MAAM,kDACH,CAAA,GAAA,gCAAK;IAsBb;;;GAGC,GACD,YAAY,UAA6B,CAAC,CAAC,CAAE;QAC3C,KAAK;QACL,IAAI,CAAC,OAAO,GAAG,SAAS,WAAW,SAAS,aAAa;QACzD,IAAI,CAAC,WAAW,GAAG,QAAQ,WAAW,IAAI;QAC1C,IAAI,CAAC,gBAAgB,GAAG,SAAS,oBAAoB,SAAS,sBAAsB;QACpF,IAAI,CAAC,WAAW,GAAG,SAAS,eAAe,SAAS,iBAAiB;QACrE,IAAI,CAAC,oBAAoB,GACvB,SAAS,wBAAwB,SAAS,0BAA0B;QACtE,IAAI,CAAC,UAAU,GAAG,SAAS,cAAc,SAAS,gBAAgB;QAClE,IAAI,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CAAC,OAAO,GAAG;YACnD,IAAI,YAAY;gBACd,IAAI,cAAc,WAAW,KAAK,IAAI;gBACtC,IAAI,aAAa,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,GAAG;gBAEvD,MAAO,cAAc,KAAM;oBACzB,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;oBACnC,IAAI,CAAC,QAAQ,KAAK,KAAK,IAAI,aACzB;oBAGF,aAAa,IAAI,CAAC,aAAa,CAAC,eAAe;oBAC/C,aAAa,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;gBAC3C;YACF;YACA,OACE,IAAI,CAAC,WAAW,KAAK,eACjB,IAAI,CAAA,GAAA,8BAAG,EACL,WAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,sBAAsB,GAAG,GACrD,WAAW,IAAI,CAAC,CAAC,EACjB,IAAI,CAAC,sBAAsB,EAC3B,WAAW,IAAI,CAAC,MAAM,IAExB,IAAI,CAAA,GAAA,8BAAG,EACL,WAAW,IAAI,CAAC,CAAC,EACjB,WAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,sBAAsB,GAAG,GACrD,WAAW,IAAI,CAAC,KAAK,EACrB,IAAI,CAAC,sBAAsB;QAErC,OACE,OAAO,WAAW,IAAI;QAGxB,OAAO,IAAI,CAAA,GAAA,oCAAS,EAAE,iBAAiB,OAAO,GAAG,GAAG,MAAM,OAAO,YAAY,EAAE;IACjF;AACF;AAEA,SAAS,8BACP,UAA+B,EAC/B,SAAqC;IAErC,MAAM,SAAoB,EAAE;IAC5B,KAAK,MAAM,QAAQ,WACjB,IAAI,UAAU,OACZ,OAAO,IAAI,CAAC;IAGhB,OAAO;AACT","sources":["packages/react-stately/src/layout/ListLayout.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 DropTarget,\n DropTargetDelegate,\n ItemDropTarget,\n Key,\n Node,\n Orientation\n} from '@react-types/shared';\nimport {getChildNodes} from '../collections/getChildNodes';\nimport {InvalidationContext} from '../virtualizer/types';\nimport {Layout} from '../virtualizer/Layout';\nimport {LayoutInfo} from '../virtualizer/LayoutInfo';\nimport {Rect} from '../virtualizer/Rect';\nimport {Size} from '../virtualizer/Size';\n\nexport interface ListLayoutOptions {\n /**\n * The primary orientation of the items. Usually this is the direction that the collection\n * scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n /**\n * The fixed size of a row in px with respect to the applied orientation.\n *\n * @default 48\n */\n rowSize?: number;\n /**\n * The estimated size of a row in px with respect to the applied orientation, when row sizes are\n * variable.\n */\n estimatedRowSize?: number;\n /**\n * The fixed size of a section header in px with respect to the applied orientation.\n *\n * @default 48\n */\n headingSize?: number;\n /**\n * The estimated size of a section header in px with respect to the applied orientation, when\n * heading sizes are variable.\n */\n estimatedHeadingSize?: number;\n /**\n * The fixed size of a loader element in px with respect to the applied orientation. This loader\n * is specifically for \"load more\" elements rendered when loading more rows at the root level or\n * inside nested row/sections.\n *\n * @default 48\n */\n loaderSize?: number;\n /**\n * The thickness of the drop indicator.\n *\n * @default 2\n */\n dropIndicatorThickness?: number;\n /**\n * The gap between items.\n *\n * @default 0\n */\n gap?: number;\n /**\n * The padding around the list.\n *\n * @default 0\n */\n padding?: number;\n /**\n * The fixed height of a row in px.\n *\n * @deprecated Use `rowSize` instead.\n * @default 48\n */\n rowHeight?: number;\n /**\n * The estimated height of a row, when row heights are variable.\n *\n * @deprecated Use `estimatedRowSize` instead.\n */\n estimatedRowHeight?: number;\n /**\n * The fixed height of a section header in px.\n *\n * @deprecated Use `headingSize` instead.\n * @default 48\n */\n headingHeight?: number;\n /**\n * The estimated height of a section header, when the height is variable.\n *\n * @deprecated Use `estimatedHeadingSize` instead.\n */\n estimatedHeadingHeight?: number;\n /**\n * The fixed height of a loader element in px. This loader is specifically for \"load more\"\n * elements rendered when loading more rows at the root level or inside nested row/sections.\n *\n * @deprecated Use `loaderSize` instead.\n * @default 48\n */\n loaderHeight?: number;\n}\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>;\n layoutInfo: LayoutInfo;\n children?: LayoutNode[];\n validRect: Rect;\n index?: number;\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * ListLayout is a virtualizer Layout implementation\n * that arranges its items in a stack along its applied orientation.\n * It supports both fixed and variable size items.\n */\nexport class ListLayout<T, O extends ListLayoutOptions = ListLayoutOptions>\n extends Layout<Node<T>, O>\n implements DropTargetDelegate\n{\n protected rowSize: number | null;\n protected orientation: Orientation;\n protected estimatedRowSize: number | null;\n protected headingSize: number | null;\n protected estimatedHeadingSize: number | null;\n protected loaderSize: number | null;\n protected dropIndicatorThickness: number;\n protected gap: number;\n protected padding: number;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n protected lastCollection: Collection<Node<T>> | null;\n protected rootNodes: LayoutNode[];\n private invalidateEverything: boolean;\n /** The rectangle containing currently valid layout infos. */\n protected validRect: Rect;\n /** The rectangle of requested layout infos so far. */\n protected requestedRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions = {}) {\n super();\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? null;\n this.orientation = options.orientation ?? 'vertical';\n this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? null;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? null;\n this.estimatedHeadingSize =\n options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? null;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? null;\n this.dropIndicatorThickness = options.dropIndicatorThickness || 2;\n this.gap = options.gap || 0;\n this.padding = options.padding || 0;\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastCollection = null;\n this.invalidateEverything = false;\n this.validRect = new Rect();\n this.requestedRect = new Rect();\n this.contentSize = new Size();\n }\n\n // Backward compatibility for subclassing.\n protected get collection(): Collection<Node<T>> {\n return this.virtualizer!.collection;\n }\n\n /** @deprecated Use `rowSize` instead. */\n protected get rowHeight(): number | null {\n return this.rowSize;\n }\n\n /** @deprecated Use `estimatedRowSize` instead. */\n protected get estimatedRowHeight(): number | null {\n return this.estimatedRowSize;\n }\n\n /** @deprecated Use `headingSize` instead. */\n protected get headingHeight(): number | null {\n return this.headingSize;\n }\n /** @deprecated Use `estimatedHeadingSize` instead. */\n protected get estimatedHeadingHeight(): number | null {\n return this.estimatedHeadingSize;\n }\n\n /** @deprecated Use `loaderSize` instead. */\n protected get loaderHeight(): number | null {\n return this.loaderSize;\n }\n\n getLayoutInfo(key: Key): LayoutInfo | null {\n this.ensureLayoutInfo(key);\n return this.layoutNodes.get(key)?.layoutInfo || null;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 or width > 1 for getDropTargetFromPoint)\n if (rect[heightProperty] > 1) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Clone only before mutating\n rect = rect.copy();\n let offset = Math.floor(rect[offsetProperty] / rowHeight) * rowHeight;\n let height = rect[heightProperty] + rect[offsetProperty] - offset;\n rect[offsetProperty] = offset;\n rect[heightProperty] = Math.ceil(height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n protected layoutIfNeeded(rect: Rect): void {\n if (!this.lastCollection) {\n return;\n }\n\n if (!this.requestedRect.containsRect(rect)) {\n this.requestedRect = this.requestedRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n // Ensure all of the persisted keys are available.\n for (let key of this.virtualizer!.persistedKeys) {\n if (this.ensureLayoutInfo(key)) {\n return;\n }\n }\n }\n\n private ensureLayoutInfo(key: Key) {\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (\n !this.layoutNodes.has(key) &&\n this.requestedRect.area < this.contentSize.area &&\n this.lastCollection\n ) {\n this.requestedRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.requestedRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n return true;\n }\n\n return false;\n }\n\n protected isVisible(node: LayoutNode, rect: Rect): boolean {\n return (\n node.layoutInfo.rect.intersects(rect) ||\n node.layoutInfo.isSticky ||\n node.layoutInfo.type === 'header' ||\n node.layoutInfo.type === 'loader' ||\n this.virtualizer!.isPersistedKey(node.layoutInfo.key)\n );\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<O>): boolean {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n // Also invalidate if fixed sizes/gaps change.\n let options = invalidationContext.layoutOptions;\n return (\n invalidationContext.sizeChanged ||\n this.rowSize !== (options?.rowSize ?? options?.rowHeight ?? this.rowSize) ||\n this.orientation !== (options?.orientation ?? this.orientation) ||\n this.headingSize !== (options?.headingSize ?? options?.headingHeight ?? this.headingSize) ||\n this.loaderSize !== (options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize) ||\n this.gap !== (options?.gap ?? this.gap) ||\n this.padding !== (options?.padding ?? this.padding)\n );\n }\n\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return (\n (newOptions?.rowSize ?? newOptions?.rowHeight) !==\n (oldOptions?.rowSize ?? oldOptions?.rowHeight) ||\n newOptions.orientation !== oldOptions.orientation ||\n (newOptions?.estimatedRowSize ?? newOptions?.estimatedRowHeight) !==\n (oldOptions?.estimatedRowSize ?? oldOptions?.estimatedRowHeight) ||\n (newOptions?.headingSize ?? newOptions?.headingHeight) !==\n (oldOptions?.headingSize ?? oldOptions?.headingHeight) ||\n (newOptions?.estimatedHeadingSize ?? newOptions?.estimatedHeadingHeight) !==\n (oldOptions?.estimatedHeadingSize ?? oldOptions?.estimatedHeadingHeight) ||\n (newOptions?.loaderSize ?? newOptions?.loaderHeight) !==\n (oldOptions?.loaderSize ?? oldOptions?.loaderHeight) ||\n newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness ||\n newOptions.gap !== oldOptions.gap ||\n newOptions.padding !== oldOptions.padding\n );\n }\n\n update(invalidationContext: InvalidationContext<O>): void {\n let collection = this.virtualizer!.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.requestedRect = this.virtualizer!.visibleRect.copy();\n this.layoutNodes.clear();\n }\n\n let options = invalidationContext.layoutOptions;\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? this.rowSize;\n this.orientation = options?.orientation ?? this.orientation;\n this.estimatedRowSize =\n options?.estimatedRowSize ?? options?.estimatedRowHeight ?? this.estimatedRowSize;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? this.headingSize;\n this.estimatedHeadingSize =\n options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? this.estimatedHeadingSize;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize;\n this.dropIndicatorThickness = options?.dropIndicatorThickness ?? this.dropIndicatorThickness;\n this.gap = options?.gap ?? this.gap;\n this.padding = options?.padding ?? this.padding;\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastCollection = collection;\n this.invalidateEverything = false;\n this.validRect = this.requestedRect.copy();\n }\n\n protected buildCollection(offset: number = this.padding): LayoutNode[] {\n let collection = this.virtualizer!.collection;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n\n // filter out content nodes since we don't want them to affect the height\n // Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n let collectionNodes = toArray(collection, node => node.type !== 'content');\n let loaderNodes = collectionNodes.filter(node => node.type === 'loader');\n let nodes: LayoutNode[] = [];\n let isEmptyOrLoading = collection?.size === 0;\n if (isEmptyOrLoading) {\n offset = 0;\n }\n\n for (let node of collectionNodes) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Skip rows before the valid rectangle unless they are already cached.\n if (\n node.type === 'item' &&\n offset + rowHeight < this.requestedRect[offsetProperty] &&\n !this.isValid(node, offset)\n ) {\n offset += rowHeight;\n continue;\n }\n\n let layoutNode =\n this.orientation === 'horizontal'\n ? this.buildChild(node, offset, this.padding, null)\n : this.buildChild(node, this.padding, offset, null);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n nodes.push(layoutNode);\n if (node.type === 'loader') {\n let index = loaderNodes.indexOf(node);\n loaderNodes.splice(index, 1);\n }\n\n // Build each loader that exists in the collection that is outside the visible rect so that they are persisted\n // at the proper estimated location. If the node.type is \"section\" then we don't do this shortcut since we have to\n // build the sections to see how tall they are.\n if (\n (node.type === 'item' || node.type === 'loader') &&\n offset > this.requestedRect[maxOffsetProperty]\n ) {\n let lastProcessedIndex = collectionNodes.indexOf(node);\n for (let loaderNode of loaderNodes) {\n let loaderNodeIndex = collectionNodes.indexOf(loaderNode);\n // Subtract by an additional 1 since we've already added the current item's height to y\n offset += (loaderNodeIndex - lastProcessedIndex - 1) * rowHeight;\n let loader =\n this.orientation === 'horizontal'\n ? this.buildChild(loaderNode, offset, this.padding, null)\n : this.buildChild(loaderNode, this.padding, offset, null);\n nodes.push(loader);\n offset = loader.layoutInfo.rect[maxOffsetProperty];\n lastProcessedIndex = loaderNodeIndex;\n }\n\n // Account for the rest of the items after the last loader spinner, subtract by 1 since we've processed the current node's height already\n offset += (collectionNodes.length - lastProcessedIndex - 1) * rowHeight;\n break;\n }\n }\n\n offset = Math.max(offset - this.gap, 0);\n offset += isEmptyOrLoading ? 0 : this.padding;\n this.contentSize =\n this.orientation === 'horizontal'\n ? new Size(offset, this.virtualizer!.size.height)\n : new Size(this.virtualizer!.size.width, offset);\n return nodes;\n }\n\n protected isValid(node: Node<T>, offset: number): boolean {\n let cached = this.layoutNodes.get(node.key);\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n return (\n !this.invalidateEverything &&\n !!cached &&\n cached.node === node &&\n offset === cached.layoutInfo.rect[offsetProperty] &&\n cached.layoutInfo.rect.intersects(this.validRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.requestedRect))\n );\n }\n\n protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {\n if (this.isValid(node, this.orientation === 'horizontal' ? x : y)) {\n return this.layoutNodes.get(node.key)!;\n }\n\n let layoutNode = this.buildNode(node, x, y);\n\n layoutNode.layoutInfo.parentKey = parentKey ?? null;\n layoutNode.layoutInfo.allowOverflow = true;\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n case 'header':\n return this.buildSectionHeader(node, x, y);\n case 'loader':\n return this.buildLoader(node, x, y);\n case 'separator':\n return this.buildItem(node, x, y);\n default:\n throw new Error('Unsupported node type: ' + node.type);\n }\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, this.padding, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n // Note that if the user provides isLoading to their sentinel during a case where they only want to render the emptyState, this will reserve\n // room for the loader alongside rendering the emptyState\n if (this.orientation === 'horizontal') {\n rect.height = this.virtualizer!.contentSize.height - this.padding - y;\n rect.width = node.props.isLoading\n ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT)\n : 0;\n } else {\n rect.width = this.virtualizer!.contentSize.width - this.padding - x;\n rect.height = node.props.isLoading\n ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT)\n : 0;\n }\n\n return {\n layoutInfo,\n validRect: rect.intersection(this.requestedRect)\n };\n }\n\n protected buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let collection = this.virtualizer!.collection;\n let width = this.virtualizer!.size.width - this.padding - x;\n let height = this.virtualizer!.size.height - this.padding - y;\n let rect =\n this.orientation === 'horizontal' ? new Rect(x, y, 0, height) : new Rect(x, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let offset = this.orientation === 'horizontal' ? x : y;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let skipped = 0;\n let children: LayoutNode[] = [];\n for (let child of getChildNodes(node, collection)) {\n // skip if it is a content node, Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n if (child.type === 'content') {\n continue;\n }\n\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (offset + rowHeight < this.requestedRect[offsetProperty] && !this.isValid(node, offset)) {\n offset += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode =\n this.orientation === 'horizontal'\n ? this.buildChild(child, offset, y, layoutInfo.key)\n : this.buildChild(child, x, offset, layoutInfo.key);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n children.push(layoutNode);\n\n if (offset > this.requestedRect[maxOffsetProperty]) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n offset +=\n ([...getChildNodes(node, collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n offset -= this.gap;\n rect[heightProperty] = offset - (this.orientation === 'horizontal' ? x : y);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n let width =\n this.virtualizer!.size[widthProperty] -\n this.padding -\n (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.headingSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n let previousLayoutInfo = previousLayoutNode?.layoutInfo;\n if (previousLayoutInfo) {\n let curNode = this.virtualizer!.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode!.layoutInfo.rect[heightProperty];\n isEstimated =\n width !== previousLayoutInfo.rect[widthProperty] ||\n curNode !== lastNode ||\n previousLayoutInfo.estimatedSize;\n } else {\n rectHeight = node.rendered ? this.estimatedHeadingSize : 0;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect =\n this.orientation === 'horizontal'\n ? new Rect(x, y, rectHeight, width - y)\n : new Rect(x, y, width - x, rectHeight);\n let header = new LayoutInfo('header', node.key, headerRect);\n header.estimatedSize = isEstimated;\n return {\n layoutInfo: header,\n children: [],\n validRect: header.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let width =\n this.virtualizer!.size[widthProperty] -\n this.padding -\n (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.rowSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect[heightProperty];\n isEstimated =\n width !== previousLayoutNode.layoutInfo.rect[widthProperty] ||\n node !== previousLayoutNode.node ||\n previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowSize;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let rect =\n this.orientation === 'horizontal'\n ? new Rect(x, y, rectHeight, width)\n : new Rect(x, y, width, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n children: [],\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n updateItemSize(key: Key, size: Size): boolean {\n let layoutNode = this.layoutNodes.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutNode) {\n return false;\n }\n\n let collection = this.virtualizer!.collection;\n let layoutInfo = layoutNode.layoutInfo;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect[heightProperty] !== size[heightProperty]) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect[heightProperty] = size[heightProperty];\n layoutNode.layoutInfo = newLayoutInfo;\n\n // Items after this layoutInfo will need to be repositioned to account for the new height.\n // Adjust the validRect so that only items above remain valid.\n this.validRect[heightProperty] = Math.min(\n this.validRect[heightProperty],\n layoutInfo.rect[offsetProperty] - this.validRect[offsetProperty]\n );\n\n // The requestedRect also needs to be adjusted to account for the height difference.\n if (layoutNode.node?.type === 'item') {\n this.requestedRect[heightProperty] +=\n newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];\n }\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = node.parentKey != null ? collection.getItem(node.parentKey) : null;\n }\n\n return true;\n }\n\n return false;\n }\n\n private updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by intersecting the validRect of this node with the overall validRect.\n n.validRect = n.validRect.intersection(this.validRect);\n\n // Replace layout info in LayoutNode\n if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean\n ): DropTarget | null {\n x += this.virtualizer!.visibleRect.x;\n y += this.virtualizer!.visibleRect.y;\n\n // Find the closest item within on either side of the point using the gap width.\n let searchRect = new Rect(x, Math.max(0, y - this.gap), 1, Math.max(1, this.gap * 2));\n let candidates = this.getVisibleLayoutInfos(searchRect);\n let key: Key | null = null;\n let minDistance = Infinity;\n for (let candidate of candidates) {\n // Ignore items outside the search rect, e.g. persisted keys.\n if (!candidate.rect.intersects(searchRect)) {\n continue;\n }\n\n let yDist = Math.abs(candidate.rect.y - y);\n let maxYDist = Math.abs(candidate.rect.maxY - y);\n let dist = Math.min(yDist, maxYDist);\n if (dist < minDistance) {\n minDistance = dist;\n key = candidate.key;\n }\n }\n\n if (key == null || this.virtualizer!.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n\n getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n let layoutInfo = this.getLayoutInfo(target.key)!;\n let rect: Rect;\n if (target.dropPosition === 'before') {\n rect =\n this.orientation === 'horizontal'\n ? new Rect(\n Math.max(0, layoutInfo.rect.x - this.dropIndicatorThickness / 2),\n layoutInfo.rect.y,\n this.dropIndicatorThickness,\n layoutInfo.rect.height\n )\n : new Rect(\n layoutInfo.rect.x,\n Math.max(0, layoutInfo.rect.y - this.dropIndicatorThickness / 2),\n layoutInfo.rect.width,\n this.dropIndicatorThickness\n );\n } else if (target.dropPosition === 'after') {\n // Render after last visible descendant of the drop target.\n let targetNode = this.collection.getItem(target.key);\n if (targetNode) {\n let targetLevel = targetNode.level ?? 0;\n let currentKey = this.collection.getKeyAfter(target.key);\n\n while (currentKey != null) {\n let node = this.collection.getItem(currentKey);\n if (!node || node.level <= targetLevel) {\n break;\n }\n\n layoutInfo = this.getLayoutInfo(currentKey) || layoutInfo;\n currentKey = this.collection.getKeyAfter(currentKey);\n }\n }\n rect =\n this.orientation === 'horizontal'\n ? new Rect(\n layoutInfo.rect.maxX - this.dropIndicatorThickness / 2,\n layoutInfo.rect.y,\n this.dropIndicatorThickness,\n layoutInfo.rect.height\n )\n : new Rect(\n layoutInfo.rect.x,\n layoutInfo.rect.maxY - this.dropIndicatorThickness / 2,\n layoutInfo.rect.width,\n this.dropIndicatorThickness\n );\n } else {\n rect = layoutInfo.rect;\n }\n\n return new LayoutInfo('dropIndicator', target.key + ':' + target.dropPosition, rect);\n }\n}\n\nfunction toArray<T>(\n collection: Collection<Node<T>>,\n predicate: (node: Node<T>) => boolean\n): Node<T>[] {\n const result: Node<T>[] = [];\n for (const node of collection) {\n if (predicate(node)) {\n result.push(node);\n }\n }\n return result;\n}\n"],"names":[],"version":3,"file":"ListLayout.cjs.map"}
|
|
@@ -367,6 +367,7 @@ class $f46b9da090161919$export$cacbb3924155d68e extends (0, $bcf18cb0a16f75f6$ex
|
|
|
367
367
|
let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';
|
|
368
368
|
layoutInfo.estimatedSize = false;
|
|
369
369
|
if (layoutInfo.rect[heightProperty] !== size[heightProperty]) {
|
|
370
|
+
var _layoutNode_node;
|
|
370
371
|
// Copy layout info rather than mutating so that later caches are invalidated.
|
|
371
372
|
let newLayoutInfo = layoutInfo.copy();
|
|
372
373
|
newLayoutInfo.rect[heightProperty] = size[heightProperty];
|
|
@@ -375,7 +376,7 @@ class $f46b9da090161919$export$cacbb3924155d68e extends (0, $bcf18cb0a16f75f6$ex
|
|
|
375
376
|
// Adjust the validRect so that only items above remain valid.
|
|
376
377
|
this.validRect[heightProperty] = Math.min(this.validRect[heightProperty], layoutInfo.rect[offsetProperty] - this.validRect[offsetProperty]);
|
|
377
378
|
// The requestedRect also needs to be adjusted to account for the height difference.
|
|
378
|
-
this.requestedRect[heightProperty] += newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];
|
|
379
|
+
if (((_layoutNode_node = layoutNode.node) === null || _layoutNode_node === void 0 ? void 0 : _layoutNode_node.type) === 'item') this.requestedRect[heightProperty] += newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];
|
|
379
380
|
// Invalidate layout for this layout node and all parents
|
|
380
381
|
this.updateLayoutNode(key, layoutInfo, newLayoutInfo);
|
|
381
382
|
let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAyFD,MAAM,uCAAiB;AAOhB,MAAM,kDAAuE,CAAA,GAAA,wCAAK;IA4CvF,0CAA0C;IAC1C,IAAc,aAAkC;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAE,UAAU;IACrC;IAEA,uCAAuC,GACvC,IAAc,YAA2B;QACvC,OAAO,IAAI,CAAC,OAAO;IACrB;IAEA,gDAAgD,GAChD,IAAc,qBAAoC;QAChD,OAAO,IAAI,CAAC,gBAAgB;IAC9B;IAEA,2CAA2C,GAC3C,IAAc,gBAA+B;QAC3C,OAAO,IAAI,CAAC,WAAW;IAEzB;IACA,oDAAoD,GACpD,IAAc,yBAAwC;QACpD,OAAO,IAAI,CAAC,oBAAoB;IAClC;IAEA,0CAA0C,GAC1C,IAAc,eAA8B;QAC1C,OAAO,IAAI,CAAC,UAAU;IACxB;IAEA,cAAc,GAAQ,EAAqB;YAElC;QADP,IAAI,C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AAI,CAAC,OAAO,GAAG,QAAQ,OAAO,IAAI;QAClC,IAAI,CAAC,WAAW,GAAG,IAAI;QACvB,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,GAAG;QACtB,IAAI,CAAC,oBAAoB,GAAG;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA,GAAA,yCAAG;QACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA,GAAA,yCAAG;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA,GAAA,yCAAG;IAC5B;AAgkBF;AAEA,SAAS,8BAAW,UAA+B,EAAE,SAAqC;IACxF,MAAM,SAAoB,EAAE;IAC5B,KAAK,MAAM,QAAQ,WACjB,IAAI,UAAU,OACZ,OAAO,IAAI,CAAC;IAGhB,OAAO;AACT","sources":["packages/react-stately/src/layout/ListLayout.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 {Collection, DropTarget, DropTargetDelegate, ItemDropTarget, Key, Node, Orientation} from '@react-types/shared';\nimport {getChildNodes} from '../collections/getChildNodes';\nimport {InvalidationContext} from '../virtualizer/types';\nimport {Layout} from '../virtualizer/Layout';\nimport {LayoutInfo} from '../virtualizer/LayoutInfo';\nimport {Rect} from '../virtualizer/Rect';\nimport {Size} from '../virtualizer/Size';\n\nexport interface ListLayoutOptions {\n /**\n * The primary orientation of the items. Usually this is the direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The fixed size of a row in px with respect to the applied orientation.\n * @default 48\n */\n rowSize?: number,\n /** The estimated size of a row in px with respect to the applied orientation, when row sizes are variable. */\n estimatedRowSize?: number,\n /**\n * The fixed size of a section header in px with respect to the applied orientation.\n * @default 48\n */\n headingSize?: number,\n /** The estimated size of a section header in px with respect to the applied orientation, when heading sizes are variable. */\n estimatedHeadingSize?: number,\n /**\n * The fixed size of a loader element in px with respect to the applied orientation. This loader is specifically for\n * \"load more\" elements rendered when loading more rows at the root level or inside nested row/sections.\n * @default 48\n */\n loaderSize?: number,\n /**\n * The thickness of the drop indicator.\n * @default 2\n */\n dropIndicatorThickness?: number,\n /**\n * The gap between items.\n * @default 0\n */\n gap?: number,\n /**\n * The padding around the list.\n * @default 0\n */\n padding?: number,\n /**\n * The fixed height of a row in px.\n * @default 48\n * @deprecated Use `rowSize` instead.\n */\n rowHeight?: number,\n /** The estimated height of a row, when row heights are variable.\n * @deprecated Use `estimatedRowSize` instead.\n */\n estimatedRowHeight?: number,\n /**\n * The fixed height of a section header in px.\n * @default 48\n * @deprecated Use `headingSize` instead.\n */\n headingHeight?: number,\n /** The estimated height of a section header, when the height is variable.\n * @deprecated Use `estimatedHeadingSize` instead.\n */\n estimatedHeadingHeight?: number,\n /**\n * The fixed height of a loader element in px. This loader is specifically for\n * \"load more\" elements rendered when loading more rows at the root level or inside nested row/sections.\n * @default 48\n * @deprecated Use `loaderSize` instead.\n */\n loaderHeight?: number\n}\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect,\n index?: number\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * ListLayout is a virtualizer Layout implementation\n * that arranges its items in a stack along its applied orientation.\n * It supports both fixed and variable size items.\n */\nexport class ListLayout<T, O extends ListLayoutOptions = ListLayoutOptions> extends Layout<Node<T>, O> implements DropTargetDelegate {\n protected rowSize: number | null;\n protected orientation: Orientation;\n protected estimatedRowSize: number | null;\n protected headingSize: number | null;\n protected estimatedHeadingSize: number | null;\n protected loaderSize: number | null;\n protected dropIndicatorThickness: number;\n protected gap: number;\n protected padding: number;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n protected lastCollection: Collection<Node<T>> | null;\n protected rootNodes: LayoutNode[];\n private invalidateEverything: boolean;\n /** The rectangle containing currently valid layout infos. */\n protected validRect: Rect;\n /** The rectangle of requested layout infos so far. */\n protected requestedRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions = {}) {\n super();\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? null;\n this.orientation = options.orientation ?? 'vertical';\n this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? null;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? null;\n this.estimatedHeadingSize = options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? null;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? null;\n this.dropIndicatorThickness = options.dropIndicatorThickness || 2;\n this.gap = options.gap || 0;\n this.padding = options.padding || 0;\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastCollection = null;\n this.invalidateEverything = false;\n this.validRect = new Rect();\n this.requestedRect = new Rect();\n this.contentSize = new Size();\n }\n\n // Backward compatibility for subclassing.\n protected get collection(): Collection<Node<T>> {\n return this.virtualizer!.collection;\n }\n\n /** @deprecated Use `rowSize` instead. */\n protected get rowHeight(): number | null {\n return this.rowSize;\n }\n\n /** @deprecated Use `estimatedRowSize` instead. */\n protected get estimatedRowHeight(): number | null {\n return this.estimatedRowSize;\n }\n\n /** @deprecated Use `headingSize` instead. */\n protected get headingHeight(): number | null {\n return this.headingSize;\n\n }\n /** @deprecated Use `estimatedHeadingSize` instead. */\n protected get estimatedHeadingHeight(): number | null {\n return this.estimatedHeadingSize;\n }\n\n /** @deprecated Use `loaderSize` instead. */\n protected get loaderHeight(): number | null {\n return this.loaderSize;\n }\n\n getLayoutInfo(key: Key): LayoutInfo | null {\n this.ensureLayoutInfo(key);\n return this.layoutNodes.get(key)?.layoutInfo || null;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 or width > 1 for getDropTargetFromPoint)\n if (rect[heightProperty] > 1) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Clone only before mutating\n rect = rect.copy();\n let offset = Math.floor(rect[offsetProperty] / rowHeight) * rowHeight;\n let height = rect[heightProperty] + rect[offsetProperty] - offset;\n rect[offsetProperty] = offset;\n rect[heightProperty] = Math.ceil(height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n protected layoutIfNeeded(rect: Rect): void {\n if (!this.lastCollection) {\n return;\n }\n\n if (!this.requestedRect.containsRect(rect)) {\n this.requestedRect = this.requestedRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n // Ensure all of the persisted keys are available.\n for (let key of this.virtualizer!.persistedKeys) {\n if (this.ensureLayoutInfo(key)) {\n return;\n }\n }\n }\n\n private ensureLayoutInfo(key: Key) {\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!this.layoutNodes.has(key) && this.requestedRect.area < this.contentSize.area && this.lastCollection) {\n this.requestedRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.requestedRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n return true;\n }\n\n return false;\n }\n\n protected isVisible(node: LayoutNode, rect: Rect): boolean {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || node.layoutInfo.type === 'header' || node.layoutInfo.type === 'loader' || this.virtualizer!.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<O>): boolean {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n // Also invalidate if fixed sizes/gaps change.\n let options = invalidationContext.layoutOptions;\n return invalidationContext.sizeChanged\n || this.rowSize !== (options?.rowSize ?? options?.rowHeight ?? this.rowSize)\n || this.orientation !== (options?.orientation ?? this.orientation)\n || this.headingSize !== (options?.headingSize ?? options?.headingHeight ?? this.headingSize)\n || this.loaderSize !== (options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize)\n || this.gap !== (options?.gap ?? this.gap)\n || this.padding !== (options?.padding ?? this.padding);\n }\n\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return (newOptions?.rowSize ?? newOptions?.rowHeight) !== (oldOptions?.rowSize ?? oldOptions?.rowHeight)\n || newOptions.orientation !== oldOptions.orientation\n || (newOptions?.estimatedRowSize ?? newOptions?.estimatedRowHeight) !== (oldOptions?.estimatedRowSize ?? oldOptions?.estimatedRowHeight)\n || (newOptions?.headingSize ?? newOptions?.headingHeight) !== (oldOptions?.headingSize ?? oldOptions?.headingHeight)\n || (newOptions?.estimatedHeadingSize ?? newOptions?.estimatedHeadingHeight) !== (oldOptions?.estimatedHeadingSize ?? oldOptions?.estimatedHeadingHeight)\n || (newOptions?.loaderSize ?? newOptions?.loaderHeight) !== (oldOptions?.loaderSize ?? oldOptions?.loaderHeight)\n || newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness\n || newOptions.gap !== oldOptions.gap\n || newOptions.padding !== oldOptions.padding;\n }\n\n update(invalidationContext: InvalidationContext<O>): void {\n let collection = this.virtualizer!.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.requestedRect = this.virtualizer!.visibleRect.copy();\n this.layoutNodes.clear();\n }\n\n let options = invalidationContext.layoutOptions;\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? this.rowSize;\n this.orientation = options?.orientation ?? this.orientation;\n this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? this.estimatedRowSize;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? this.headingSize;\n this.estimatedHeadingSize = options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? this.estimatedHeadingSize;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize;\n this.dropIndicatorThickness = options?.dropIndicatorThickness ?? this.dropIndicatorThickness;\n this.gap = options?.gap ?? this.gap;\n this.padding = options?.padding ?? this.padding;\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastCollection = collection;\n this.invalidateEverything = false;\n this.validRect = this.requestedRect.copy();\n }\n\n protected buildCollection(offset: number = this.padding): LayoutNode[] {\n let collection = this.virtualizer!.collection;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n\n // filter out content nodes since we don't want them to affect the height\n // Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n let collectionNodes = toArray(collection, (node) => node.type !== 'content');\n let loaderNodes = collectionNodes.filter(node => node.type === 'loader');\n let nodes: LayoutNode[] = [];\n let isEmptyOrLoading = collection?.size === 0;\n if (isEmptyOrLoading) {\n offset = 0;\n }\n\n for (let node of collectionNodes) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && offset + rowHeight < this.requestedRect[offsetProperty] && !this.isValid(node, offset)) {\n offset += rowHeight;\n continue;\n }\n\n let layoutNode = this.orientation === 'horizontal' ? this.buildChild(node, offset, this.padding, null) : this.buildChild(node, this.padding, offset, null);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n nodes.push(layoutNode);\n if (node.type === 'loader') {\n let index = loaderNodes.indexOf(node);\n loaderNodes.splice(index, 1);\n }\n\n // Build each loader that exists in the collection that is outside the visible rect so that they are persisted\n // at the proper estimated location. If the node.type is \"section\" then we don't do this shortcut since we have to\n // build the sections to see how tall they are.\n if ((node.type === 'item' || node.type === 'loader') && offset > this.requestedRect[maxOffsetProperty]) {\n let lastProcessedIndex = collectionNodes.indexOf(node);\n for (let loaderNode of loaderNodes) {\n let loaderNodeIndex = collectionNodes.indexOf(loaderNode);\n // Subtract by an additional 1 since we've already added the current item's height to y\n offset += (loaderNodeIndex - lastProcessedIndex - 1) * rowHeight;\n let loader = this.orientation === 'horizontal' ? this.buildChild(loaderNode, offset, this.padding, null) : this.buildChild(loaderNode, this.padding, offset, null);\n nodes.push(loader);\n offset = loader.layoutInfo.rect[maxOffsetProperty];\n lastProcessedIndex = loaderNodeIndex;\n }\n\n // Account for the rest of the items after the last loader spinner, subtract by 1 since we've processed the current node's height already\n offset += (collectionNodes.length - lastProcessedIndex - 1) * rowHeight;\n break;\n }\n }\n\n offset = Math.max(offset - this.gap, 0);\n offset += isEmptyOrLoading ? 0 : this.padding;\n this.contentSize = this.orientation === 'horizontal' ? new Size(offset, this.virtualizer!.size.height) : new Size(this.virtualizer!.size.width, offset);\n return nodes;\n }\n\n protected isValid(node: Node<T>, offset: number): boolean {\n let cached = this.layoutNodes.get(node.key);\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n return (\n !this.invalidateEverything &&\n !!cached &&\n cached.node === node &&\n offset === cached.layoutInfo.rect[offsetProperty] &&\n cached.layoutInfo.rect.intersects(this.validRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.requestedRect))\n );\n }\n\n protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {\n if (this.isValid(node, this.orientation === 'horizontal' ? x : y)) {\n return this.layoutNodes.get(node.key)!;\n }\n\n let layoutNode = this.buildNode(node, x, y);\n\n layoutNode.layoutInfo.parentKey = parentKey ?? null;\n layoutNode.layoutInfo.allowOverflow = true;\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n case 'header':\n return this.buildSectionHeader(node, x, y);\n case 'loader':\n return this.buildLoader(node, x, y);\n case 'separator':\n return this.buildItem(node, x, y);\n default:\n throw new Error('Unsupported node type: ' + node.type);\n }\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, this.padding, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n // Note that if the user provides isLoading to their sentinel during a case where they only want to render the emptyState, this will reserve\n // room for the loader alongside rendering the emptyState\n if (this.orientation === 'horizontal') {\n rect.height = this.virtualizer!.contentSize.height - this.padding - y;\n rect.width = node.props.isLoading ? this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT : 0;\n } else {\n rect.width = this.virtualizer!.contentSize.width - this.padding - x;\n rect.height = node.props.isLoading ? this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT : 0;\n }\n\n return {\n layoutInfo,\n validRect: rect.intersection(this.requestedRect)\n };\n }\n\n protected buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let collection = this.virtualizer!.collection;\n let width = this.virtualizer!.size.width - this.padding - x;\n let height = this.virtualizer!.size.height - this.padding - y;\n let rect = this.orientation === 'horizontal' ? new Rect(x, y, 0, height) : new Rect(x, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let offset = this.orientation === 'horizontal' ? x : y;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let skipped = 0;\n let children: LayoutNode[] = [];\n for (let child of getChildNodes(node, collection)) {\n // skip if it is a content node, Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n if (child.type === 'content') {\n continue;\n }\n\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (offset + rowHeight < this.requestedRect[offsetProperty] && !this.isValid(node, offset)) {\n offset += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.orientation === 'horizontal' ? this.buildChild(child, offset, y, layoutInfo.key) : this.buildChild(child, x, offset, layoutInfo.key);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n children.push(layoutNode);\n\n if (offset > this.requestedRect[maxOffsetProperty]) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n offset += ([...getChildNodes(node, collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n offset -= this.gap;\n rect[heightProperty] = offset - (this.orientation === 'horizontal' ? x : y);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n let width = this.virtualizer!.size[widthProperty] - this.padding - (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.headingSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n let previousLayoutInfo = previousLayoutNode?.layoutInfo;\n if (previousLayoutInfo) {\n let curNode = this.virtualizer!.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode!.layoutInfo.rect[heightProperty];\n isEstimated = width !== previousLayoutInfo.rect[widthProperty] || curNode !== lastNode || previousLayoutInfo.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingSize : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = this.orientation === 'horizontal' ? new Rect(x, y, rectHeight, width - y) : new Rect(x, y, width - x, rectHeight);\n let header = new LayoutInfo('header', node.key, headerRect);\n header.estimatedSize = isEstimated;\n return {\n layoutInfo: header,\n children: [],\n validRect: header.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let width = this.virtualizer!.size[widthProperty] - this.padding - (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.rowSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect[heightProperty];\n isEstimated = width !== previousLayoutNode.layoutInfo.rect[widthProperty] || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowSize;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let rect = this.orientation === 'horizontal' ? new Rect(x, y, rectHeight, width) : new Rect(x, y, width, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n children: [],\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n updateItemSize(key: Key, size: Size): boolean {\n let layoutNode = this.layoutNodes.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutNode) {\n return false;\n }\n\n let collection = this.virtualizer!.collection;\n let layoutInfo = layoutNode.layoutInfo;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect[heightProperty] !== size[heightProperty]) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect[heightProperty] = size[heightProperty];\n layoutNode.layoutInfo = newLayoutInfo;\n\n // Items after this layoutInfo will need to be repositioned to account for the new height.\n // Adjust the validRect so that only items above remain valid.\n this.validRect[heightProperty] = Math.min(this.validRect[heightProperty], layoutInfo.rect[offsetProperty] - this.validRect[offsetProperty]);\n\n // The requestedRect also needs to be adjusted to account for the height difference.\n this.requestedRect[heightProperty] += newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = node.parentKey != null ? collection.getItem(node.parentKey) : null;\n }\n\n return true;\n }\n\n return false;\n }\n\n private updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by intersecting the validRect of this node with the overall validRect.\n n.validRect = n.validRect.intersection(this.validRect);\n\n // Replace layout info in LayoutNode\n if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null {\n x += this.virtualizer!.visibleRect.x;\n y += this.virtualizer!.visibleRect.y;\n\n // Find the closest item within on either side of the point using the gap width.\n let searchRect = new Rect(x, Math.max(0, y - this.gap), 1, Math.max(1, this.gap * 2));\n let candidates = this.getVisibleLayoutInfos(searchRect);\n let key: Key | null = null;\n let minDistance = Infinity;\n for (let candidate of candidates) {\n // Ignore items outside the search rect, e.g. persisted keys.\n if (!candidate.rect.intersects(searchRect)) {\n continue;\n }\n\n let yDist = Math.abs(candidate.rect.y - y);\n let maxYDist = Math.abs(candidate.rect.maxY - y);\n let dist = Math.min(yDist, maxYDist);\n if (dist < minDistance) {\n minDistance = dist;\n key = candidate.key;\n }\n }\n\n if (key == null || this.virtualizer!.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n\n getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n let layoutInfo = this.getLayoutInfo(target.key)!;\n let rect: Rect;\n if (target.dropPosition === 'before') {\n rect = this.orientation === 'horizontal' ?\n new Rect(Math.max(0, layoutInfo.rect.x - this.dropIndicatorThickness / 2), layoutInfo.rect.y, this.dropIndicatorThickness, layoutInfo.rect.height)\n : new Rect(layoutInfo.rect.x, Math.max(0, layoutInfo.rect.y - this.dropIndicatorThickness / 2), layoutInfo.rect.width, this.dropIndicatorThickness);\n } else if (target.dropPosition === 'after') {\n // Render after last visible descendant of the drop target.\n let targetNode = this.collection.getItem(target.key);\n if (targetNode) {\n let targetLevel = targetNode.level ?? 0;\n let currentKey = this.collection.getKeyAfter(target.key);\n\n while (currentKey != null) {\n let node = this.collection.getItem(currentKey);\n if (!node || node.level <= targetLevel) {\n break;\n }\n\n layoutInfo = this.getLayoutInfo(currentKey) || layoutInfo;\n currentKey = this.collection.getKeyAfter(currentKey);\n }\n }\n rect = this.orientation === 'horizontal' ?\n new Rect(layoutInfo.rect.maxX - this.dropIndicatorThickness / 2, layoutInfo.rect.y, this.dropIndicatorThickness, layoutInfo.rect.height)\n : new Rect(layoutInfo.rect.x, layoutInfo.rect.maxY - this.dropIndicatorThickness / 2, layoutInfo.rect.width, this.dropIndicatorThickness);\n } else {\n rect = layoutInfo.rect;\n }\n\n return new LayoutInfo('dropIndicator', target.key + ':' + target.dropPosition, rect);\n }\n}\n\nfunction toArray<T>(collection: Collection<Node<T>>, predicate: (node: Node<T>) => boolean): Node<T>[] {\n const result: Node<T>[] = [];\n for (const node of collection) {\n if (predicate(node)) {\n result.push(node);\n }\n }\n return result;\n}\n"],"names":[],"version":3,"file":"ListLayout.js.map"}
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuHD,MAAM,uCAAiB;AAOhB,MAAM,kDACH,CAAA,GAA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kCAAA,uBAAwB,oBAAA,8BAAA,QAAS,aAAa,cAA9C,mBAAA,QAAkD;YAEnE,+BAAA;QADF,IAAI,CAAC,oBAAoB,GACvB,CAAA,QAAA,CAAA,gCAAA,oBAAA,8BAAA,QAAS,oBAAoB,cAA7B,2CAAA,gCAAiC,oBAAA,8BAAA,QAAS,sBAAsB,cAAhE,mBAAA,QAAoE;YACpD,qBAAA;QAAlB,IAAI,CAAC,UAAU,GAAG,CAAA,QAAA,CAAA,sBAAA,oBAAA,8BAAA,QAAS,UAAU,cAAnB,iCAAA,sBAAuB,oBAAA,8BAAA,QAAS,YAAY,cAA5C,mBAAA,QAAgD;QAClE,IAAI,CAAC,sBAAsB,GAAG,QAAQ,sBAAsB,IAAI;QAChE,IAAI,CAAC,GAAG,GAAG,QAAQ,GAAG,IAAI;QAC1B,IAAI,CAAC,OAAO,GAAG,QAAQ,OAAO,IAAI;QAClC,IAAI,CAAC,WAAW,GAAG,IAAI;QACvB,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,GAAG;QACtB,IAAI,CAAC,oBAAoB,GAAG;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA,GAAA,yCAAG;QACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA,GAAA,yCAAG;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA,GAAA,yCAAG;IAC5B;AA+pBF;AAEA,SAAS,8BACP,UAA+B,EAC/B,SAAqC;IAErC,MAAM,SAAoB,EAAE;IAC5B,KAAK,MAAM,QAAQ,WACjB,IAAI,UAAU,OACZ,OAAO,IAAI,CAAC;IAGhB,OAAO;AACT","sources":["packages/react-stately/src/layout/ListLayout.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 DropTarget,\n DropTargetDelegate,\n ItemDropTarget,\n Key,\n Node,\n Orientation\n} from '@react-types/shared';\nimport {getChildNodes} from '../collections/getChildNodes';\nimport {InvalidationContext} from '../virtualizer/types';\nimport {Layout} from '../virtualizer/Layout';\nimport {LayoutInfo} from '../virtualizer/LayoutInfo';\nimport {Rect} from '../virtualizer/Rect';\nimport {Size} from '../virtualizer/Size';\n\nexport interface ListLayoutOptions {\n /**\n * The primary orientation of the items. Usually this is the direction that the collection\n * scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n /**\n * The fixed size of a row in px with respect to the applied orientation.\n *\n * @default 48\n */\n rowSize?: number;\n /**\n * The estimated size of a row in px with respect to the applied orientation, when row sizes are\n * variable.\n */\n estimatedRowSize?: number;\n /**\n * The fixed size of a section header in px with respect to the applied orientation.\n *\n * @default 48\n */\n headingSize?: number;\n /**\n * The estimated size of a section header in px with respect to the applied orientation, when\n * heading sizes are variable.\n */\n estimatedHeadingSize?: number;\n /**\n * The fixed size of a loader element in px with respect to the applied orientation. This loader\n * is specifically for \"load more\" elements rendered when loading more rows at the root level or\n * inside nested row/sections.\n *\n * @default 48\n */\n loaderSize?: number;\n /**\n * The thickness of the drop indicator.\n *\n * @default 2\n */\n dropIndicatorThickness?: number;\n /**\n * The gap between items.\n *\n * @default 0\n */\n gap?: number;\n /**\n * The padding around the list.\n *\n * @default 0\n */\n padding?: number;\n /**\n * The fixed height of a row in px.\n *\n * @deprecated Use `rowSize` instead.\n * @default 48\n */\n rowHeight?: number;\n /**\n * The estimated height of a row, when row heights are variable.\n *\n * @deprecated Use `estimatedRowSize` instead.\n */\n estimatedRowHeight?: number;\n /**\n * The fixed height of a section header in px.\n *\n * @deprecated Use `headingSize` instead.\n * @default 48\n */\n headingHeight?: number;\n /**\n * The estimated height of a section header, when the height is variable.\n *\n * @deprecated Use `estimatedHeadingSize` instead.\n */\n estimatedHeadingHeight?: number;\n /**\n * The fixed height of a loader element in px. This loader is specifically for \"load more\"\n * elements rendered when loading more rows at the root level or inside nested row/sections.\n *\n * @deprecated Use `loaderSize` instead.\n * @default 48\n */\n loaderHeight?: number;\n}\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>;\n layoutInfo: LayoutInfo;\n children?: LayoutNode[];\n validRect: Rect;\n index?: number;\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * ListLayout is a virtualizer Layout implementation\n * that arranges its items in a stack along its applied orientation.\n * It supports both fixed and variable size items.\n */\nexport class ListLayout<T, O extends ListLayoutOptions = ListLayoutOptions>\n extends Layout<Node<T>, O>\n implements DropTargetDelegate\n{\n protected rowSize: number | null;\n protected orientation: Orientation;\n protected estimatedRowSize: number | null;\n protected headingSize: number | null;\n protected estimatedHeadingSize: number | null;\n protected loaderSize: number | null;\n protected dropIndicatorThickness: number;\n protected gap: number;\n protected padding: number;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n protected lastCollection: Collection<Node<T>> | null;\n protected rootNodes: LayoutNode[];\n private invalidateEverything: boolean;\n /** The rectangle containing currently valid layout infos. */\n protected validRect: Rect;\n /** The rectangle of requested layout infos so far. */\n protected requestedRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions = {}) {\n super();\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? null;\n this.orientation = options.orientation ?? 'vertical';\n this.estimatedRowSize = options?.estimatedRowSize ?? options?.estimatedRowHeight ?? null;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? null;\n this.estimatedHeadingSize =\n options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? null;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? null;\n this.dropIndicatorThickness = options.dropIndicatorThickness || 2;\n this.gap = options.gap || 0;\n this.padding = options.padding || 0;\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastCollection = null;\n this.invalidateEverything = false;\n this.validRect = new Rect();\n this.requestedRect = new Rect();\n this.contentSize = new Size();\n }\n\n // Backward compatibility for subclassing.\n protected get collection(): Collection<Node<T>> {\n return this.virtualizer!.collection;\n }\n\n /** @deprecated Use `rowSize` instead. */\n protected get rowHeight(): number | null {\n return this.rowSize;\n }\n\n /** @deprecated Use `estimatedRowSize` instead. */\n protected get estimatedRowHeight(): number | null {\n return this.estimatedRowSize;\n }\n\n /** @deprecated Use `headingSize` instead. */\n protected get headingHeight(): number | null {\n return this.headingSize;\n }\n /** @deprecated Use `estimatedHeadingSize` instead. */\n protected get estimatedHeadingHeight(): number | null {\n return this.estimatedHeadingSize;\n }\n\n /** @deprecated Use `loaderSize` instead. */\n protected get loaderHeight(): number | null {\n return this.loaderSize;\n }\n\n getLayoutInfo(key: Key): LayoutInfo | null {\n this.ensureLayoutInfo(key);\n return this.layoutNodes.get(key)?.layoutInfo || null;\n }\n\n getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 or width > 1 for getDropTargetFromPoint)\n if (rect[heightProperty] > 1) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Clone only before mutating\n rect = rect.copy();\n let offset = Math.floor(rect[offsetProperty] / rowHeight) * rowHeight;\n let height = rect[heightProperty] + rect[offsetProperty] - offset;\n rect[offsetProperty] = offset;\n rect[heightProperty] = Math.ceil(height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n protected layoutIfNeeded(rect: Rect): void {\n if (!this.lastCollection) {\n return;\n }\n\n if (!this.requestedRect.containsRect(rect)) {\n this.requestedRect = this.requestedRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n // Ensure all of the persisted keys are available.\n for (let key of this.virtualizer!.persistedKeys) {\n if (this.ensureLayoutInfo(key)) {\n return;\n }\n }\n }\n\n private ensureLayoutInfo(key: Key) {\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (\n !this.layoutNodes.has(key) &&\n this.requestedRect.area < this.contentSize.area &&\n this.lastCollection\n ) {\n this.requestedRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.requestedRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n return true;\n }\n\n return false;\n }\n\n protected isVisible(node: LayoutNode, rect: Rect): boolean {\n return (\n node.layoutInfo.rect.intersects(rect) ||\n node.layoutInfo.isSticky ||\n node.layoutInfo.type === 'header' ||\n node.layoutInfo.type === 'loader' ||\n this.virtualizer!.isPersistedKey(node.layoutInfo.key)\n );\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<O>): boolean {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n // Also invalidate if fixed sizes/gaps change.\n let options = invalidationContext.layoutOptions;\n return (\n invalidationContext.sizeChanged ||\n this.rowSize !== (options?.rowSize ?? options?.rowHeight ?? this.rowSize) ||\n this.orientation !== (options?.orientation ?? this.orientation) ||\n this.headingSize !== (options?.headingSize ?? options?.headingHeight ?? this.headingSize) ||\n this.loaderSize !== (options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize) ||\n this.gap !== (options?.gap ?? this.gap) ||\n this.padding !== (options?.padding ?? this.padding)\n );\n }\n\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return (\n (newOptions?.rowSize ?? newOptions?.rowHeight) !==\n (oldOptions?.rowSize ?? oldOptions?.rowHeight) ||\n newOptions.orientation !== oldOptions.orientation ||\n (newOptions?.estimatedRowSize ?? newOptions?.estimatedRowHeight) !==\n (oldOptions?.estimatedRowSize ?? oldOptions?.estimatedRowHeight) ||\n (newOptions?.headingSize ?? newOptions?.headingHeight) !==\n (oldOptions?.headingSize ?? oldOptions?.headingHeight) ||\n (newOptions?.estimatedHeadingSize ?? newOptions?.estimatedHeadingHeight) !==\n (oldOptions?.estimatedHeadingSize ?? oldOptions?.estimatedHeadingHeight) ||\n (newOptions?.loaderSize ?? newOptions?.loaderHeight) !==\n (oldOptions?.loaderSize ?? oldOptions?.loaderHeight) ||\n newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness ||\n newOptions.gap !== oldOptions.gap ||\n newOptions.padding !== oldOptions.padding\n );\n }\n\n update(invalidationContext: InvalidationContext<O>): void {\n let collection = this.virtualizer!.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.requestedRect = this.virtualizer!.visibleRect.copy();\n this.layoutNodes.clear();\n }\n\n let options = invalidationContext.layoutOptions;\n this.rowSize = options?.rowSize ?? options?.rowHeight ?? this.rowSize;\n this.orientation = options?.orientation ?? this.orientation;\n this.estimatedRowSize =\n options?.estimatedRowSize ?? options?.estimatedRowHeight ?? this.estimatedRowSize;\n this.headingSize = options?.headingSize ?? options?.headingHeight ?? this.headingSize;\n this.estimatedHeadingSize =\n options?.estimatedHeadingSize ?? options?.estimatedHeadingHeight ?? this.estimatedHeadingSize;\n this.loaderSize = options?.loaderSize ?? options?.loaderHeight ?? this.loaderSize;\n this.dropIndicatorThickness = options?.dropIndicatorThickness ?? this.dropIndicatorThickness;\n this.gap = options?.gap ?? this.gap;\n this.padding = options?.padding ?? this.padding;\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastCollection = collection;\n this.invalidateEverything = false;\n this.validRect = this.requestedRect.copy();\n }\n\n protected buildCollection(offset: number = this.padding): LayoutNode[] {\n let collection = this.virtualizer!.collection;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n\n // filter out content nodes since we don't want them to affect the height\n // Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n let collectionNodes = toArray(collection, node => node.type !== 'content');\n let loaderNodes = collectionNodes.filter(node => node.type === 'loader');\n let nodes: LayoutNode[] = [];\n let isEmptyOrLoading = collection?.size === 0;\n if (isEmptyOrLoading) {\n offset = 0;\n }\n\n for (let node of collectionNodes) {\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n // Skip rows before the valid rectangle unless they are already cached.\n if (\n node.type === 'item' &&\n offset + rowHeight < this.requestedRect[offsetProperty] &&\n !this.isValid(node, offset)\n ) {\n offset += rowHeight;\n continue;\n }\n\n let layoutNode =\n this.orientation === 'horizontal'\n ? this.buildChild(node, offset, this.padding, null)\n : this.buildChild(node, this.padding, offset, null);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n nodes.push(layoutNode);\n if (node.type === 'loader') {\n let index = loaderNodes.indexOf(node);\n loaderNodes.splice(index, 1);\n }\n\n // Build each loader that exists in the collection that is outside the visible rect so that they are persisted\n // at the proper estimated location. If the node.type is \"section\" then we don't do this shortcut since we have to\n // build the sections to see how tall they are.\n if (\n (node.type === 'item' || node.type === 'loader') &&\n offset > this.requestedRect[maxOffsetProperty]\n ) {\n let lastProcessedIndex = collectionNodes.indexOf(node);\n for (let loaderNode of loaderNodes) {\n let loaderNodeIndex = collectionNodes.indexOf(loaderNode);\n // Subtract by an additional 1 since we've already added the current item's height to y\n offset += (loaderNodeIndex - lastProcessedIndex - 1) * rowHeight;\n let loader =\n this.orientation === 'horizontal'\n ? this.buildChild(loaderNode, offset, this.padding, null)\n : this.buildChild(loaderNode, this.padding, offset, null);\n nodes.push(loader);\n offset = loader.layoutInfo.rect[maxOffsetProperty];\n lastProcessedIndex = loaderNodeIndex;\n }\n\n // Account for the rest of the items after the last loader spinner, subtract by 1 since we've processed the current node's height already\n offset += (collectionNodes.length - lastProcessedIndex - 1) * rowHeight;\n break;\n }\n }\n\n offset = Math.max(offset - this.gap, 0);\n offset += isEmptyOrLoading ? 0 : this.padding;\n this.contentSize =\n this.orientation === 'horizontal'\n ? new Size(offset, this.virtualizer!.size.height)\n : new Size(this.virtualizer!.size.width, offset);\n return nodes;\n }\n\n protected isValid(node: Node<T>, offset: number): boolean {\n let cached = this.layoutNodes.get(node.key);\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n return (\n !this.invalidateEverything &&\n !!cached &&\n cached.node === node &&\n offset === cached.layoutInfo.rect[offsetProperty] &&\n cached.layoutInfo.rect.intersects(this.validRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.requestedRect))\n );\n }\n\n protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {\n if (this.isValid(node, this.orientation === 'horizontal' ? x : y)) {\n return this.layoutNodes.get(node.key)!;\n }\n\n let layoutNode = this.buildNode(node, x, y);\n\n layoutNode.layoutInfo.parentKey = parentKey ?? null;\n layoutNode.layoutInfo.allowOverflow = true;\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n case 'header':\n return this.buildSectionHeader(node, x, y);\n case 'loader':\n return this.buildLoader(node, x, y);\n case 'separator':\n return this.buildItem(node, x, y);\n default:\n throw new Error('Unsupported node type: ' + node.type);\n }\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, this.padding, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n // Note that if the user provides isLoading to their sentinel during a case where they only want to render the emptyState, this will reserve\n // room for the loader alongside rendering the emptyState\n if (this.orientation === 'horizontal') {\n rect.height = this.virtualizer!.contentSize.height - this.padding - y;\n rect.width = node.props.isLoading\n ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT)\n : 0;\n } else {\n rect.width = this.virtualizer!.contentSize.width - this.padding - x;\n rect.height = node.props.isLoading\n ? (this.loaderSize ?? this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT)\n : 0;\n }\n\n return {\n layoutInfo,\n validRect: rect.intersection(this.requestedRect)\n };\n }\n\n protected buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let collection = this.virtualizer!.collection;\n let width = this.virtualizer!.size.width - this.padding - x;\n let height = this.virtualizer!.size.height - this.padding - y;\n let rect =\n this.orientation === 'horizontal' ? new Rect(x, y, 0, height) : new Rect(x, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let offset = this.orientation === 'horizontal' ? x : y;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let maxOffsetProperty = this.orientation === 'horizontal' ? 'maxX' : 'maxY';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let skipped = 0;\n let children: LayoutNode[] = [];\n for (let child of getChildNodes(node, collection)) {\n // skip if it is a content node, Tree specific for now, if we add content nodes to other collection items, we might need to reconsider this\n if (child.type === 'content') {\n continue;\n }\n\n let rowHeight = (this.rowSize ?? this.estimatedRowSize ?? DEFAULT_HEIGHT) + this.gap;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (offset + rowHeight < this.requestedRect[offsetProperty] && !this.isValid(node, offset)) {\n offset += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode =\n this.orientation === 'horizontal'\n ? this.buildChild(child, offset, y, layoutInfo.key)\n : this.buildChild(child, x, offset, layoutInfo.key);\n offset = layoutNode.layoutInfo.rect[maxOffsetProperty] + this.gap;\n children.push(layoutNode);\n\n if (offset > this.requestedRect[maxOffsetProperty]) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n offset +=\n ([...getChildNodes(node, collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n offset -= this.gap;\n rect[heightProperty] = offset - (this.orientation === 'horizontal' ? x : y);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n let width =\n this.virtualizer!.size[widthProperty] -\n this.padding -\n (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.headingSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n let previousLayoutInfo = previousLayoutNode?.layoutInfo;\n if (previousLayoutInfo) {\n let curNode = this.virtualizer!.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode!.layoutInfo.rect[heightProperty];\n isEstimated =\n width !== previousLayoutInfo.rect[widthProperty] ||\n curNode !== lastNode ||\n previousLayoutInfo.estimatedSize;\n } else {\n rectHeight = node.rendered ? this.estimatedHeadingSize : 0;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect =\n this.orientation === 'horizontal'\n ? new Rect(x, y, rectHeight, width - y)\n : new Rect(x, y, width - x, rectHeight);\n let header = new LayoutInfo('header', node.key, headerRect);\n header.estimatedSize = isEstimated;\n return {\n layoutInfo: header,\n children: [],\n validRect: header.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let widthProperty = this.orientation === 'horizontal' ? 'height' : 'width';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n\n let width =\n this.virtualizer!.size[widthProperty] -\n this.padding -\n (this.orientation === 'horizontal' ? y : x);\n let rectHeight = this.rowSize;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect[heightProperty];\n isEstimated =\n width !== previousLayoutNode.layoutInfo.rect[widthProperty] ||\n node !== previousLayoutNode.node ||\n previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowSize;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let rect =\n this.orientation === 'horizontal'\n ? new Rect(x, y, rectHeight, width)\n : new Rect(x, y, width, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n children: [],\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n updateItemSize(key: Key, size: Size): boolean {\n let layoutNode = this.layoutNodes.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutNode) {\n return false;\n }\n\n let collection = this.virtualizer!.collection;\n let layoutInfo = layoutNode.layoutInfo;\n let offsetProperty = this.orientation === 'horizontal' ? 'x' : 'y';\n let heightProperty = this.orientation === 'horizontal' ? 'width' : 'height';\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect[heightProperty] !== size[heightProperty]) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect[heightProperty] = size[heightProperty];\n layoutNode.layoutInfo = newLayoutInfo;\n\n // Items after this layoutInfo will need to be repositioned to account for the new height.\n // Adjust the validRect so that only items above remain valid.\n this.validRect[heightProperty] = Math.min(\n this.validRect[heightProperty],\n layoutInfo.rect[offsetProperty] - this.validRect[offsetProperty]\n );\n\n // The requestedRect also needs to be adjusted to account for the height difference.\n if (layoutNode.node?.type === 'item') {\n this.requestedRect[heightProperty] +=\n newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];\n }\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = node.parentKey != null ? collection.getItem(node.parentKey) : null;\n }\n\n return true;\n }\n\n return false;\n }\n\n private updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by intersecting the validRect of this node with the overall validRect.\n n.validRect = n.validRect.intersection(this.validRect);\n\n // Replace layout info in LayoutNode\n if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize(): Size {\n return this.contentSize;\n }\n\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean\n ): DropTarget | null {\n x += this.virtualizer!.visibleRect.x;\n y += this.virtualizer!.visibleRect.y;\n\n // Find the closest item within on either side of the point using the gap width.\n let searchRect = new Rect(x, Math.max(0, y - this.gap), 1, Math.max(1, this.gap * 2));\n let candidates = this.getVisibleLayoutInfos(searchRect);\n let key: Key | null = null;\n let minDistance = Infinity;\n for (let candidate of candidates) {\n // Ignore items outside the search rect, e.g. persisted keys.\n if (!candidate.rect.intersects(searchRect)) {\n continue;\n }\n\n let yDist = Math.abs(candidate.rect.y - y);\n let maxYDist = Math.abs(candidate.rect.maxY - y);\n let dist = Math.min(yDist, maxYDist);\n if (dist < minDistance) {\n minDistance = dist;\n key = candidate.key;\n }\n }\n\n if (key == null || this.virtualizer!.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n\n getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n let layoutInfo = this.getLayoutInfo(target.key)!;\n let rect: Rect;\n if (target.dropPosition === 'before') {\n rect =\n this.orientation === 'horizontal'\n ? new Rect(\n Math.max(0, layoutInfo.rect.x - this.dropIndicatorThickness / 2),\n layoutInfo.rect.y,\n this.dropIndicatorThickness,\n layoutInfo.rect.height\n )\n : new Rect(\n layoutInfo.rect.x,\n Math.max(0, layoutInfo.rect.y - this.dropIndicatorThickness / 2),\n layoutInfo.rect.width,\n this.dropIndicatorThickness\n );\n } else if (target.dropPosition === 'after') {\n // Render after last visible descendant of the drop target.\n let targetNode = this.collection.getItem(target.key);\n if (targetNode) {\n let targetLevel = targetNode.level ?? 0;\n let currentKey = this.collection.getKeyAfter(target.key);\n\n while (currentKey != null) {\n let node = this.collection.getItem(currentKey);\n if (!node || node.level <= targetLevel) {\n break;\n }\n\n layoutInfo = this.getLayoutInfo(currentKey) || layoutInfo;\n currentKey = this.collection.getKeyAfter(currentKey);\n }\n }\n rect =\n this.orientation === 'horizontal'\n ? new Rect(\n layoutInfo.rect.maxX - this.dropIndicatorThickness / 2,\n layoutInfo.rect.y,\n this.dropIndicatorThickness,\n layoutInfo.rect.height\n )\n : new Rect(\n layoutInfo.rect.x,\n layoutInfo.rect.maxY - this.dropIndicatorThickness / 2,\n layoutInfo.rect.width,\n this.dropIndicatorThickness\n );\n } else {\n rect = layoutInfo.rect;\n }\n\n return new LayoutInfo('dropIndicator', target.key + ':' + target.dropPosition, rect);\n }\n}\n\nfunction toArray<T>(\n collection: Collection<Node<T>>,\n predicate: (node: Node<T>) => boolean\n): Node<T>[] {\n const result: Node<T>[] = [];\n for (const node of collection) {\n if (predicate(node)) {\n result.push(node);\n }\n }\n return result;\n}\n"],"names":[],"version":3,"file":"ListLayout.js.map"}
|
|
@@ -380,7 +380,7 @@ class $942f06a693c162e2$export$cacbb3924155d68e extends (0, $85410e0c3cc54f1d$ex
|
|
|
380
380
|
// Adjust the validRect so that only items above remain valid.
|
|
381
381
|
this.validRect[heightProperty] = Math.min(this.validRect[heightProperty], layoutInfo.rect[offsetProperty] - this.validRect[offsetProperty]);
|
|
382
382
|
// The requestedRect also needs to be adjusted to account for the height difference.
|
|
383
|
-
this.requestedRect[heightProperty] += newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];
|
|
383
|
+
if (layoutNode.node?.type === 'item') this.requestedRect[heightProperty] += newLayoutInfo.rect[heightProperty] - layoutInfo.rect[heightProperty];
|
|
384
384
|
// Invalidate layout for this layout node and all parents
|
|
385
385
|
this.updateLayoutNode(key, layoutInfo, newLayoutInfo);
|
|
386
386
|
let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;
|