@razorpay/blade 12.110.0 → 12.119.1
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/assets/spark/colorama-center-gradient-map-dark.jpg +0 -0
- package/assets/spark/colorama-gradient-map-dark.png +0 -0
- package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js +5 -5
- package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js.map +1 -1
- package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js +6 -0
- package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -0
- package/build/lib/native/components/BaseMotion/BaseMotion.native.js +22 -0
- package/build/lib/native/components/BaseMotion/BaseMotion.native.js.map +1 -0
- package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js +11 -0
- package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js.map +1 -0
- package/build/lib/native/components/BaseMotion/baseMotionUtils.js +4 -0
- package/build/lib/native/components/BaseMotion/baseMotionUtils.js.map +1 -0
- package/build/lib/native/components/BaseMotion/index.js +3 -0
- package/build/lib/native/components/BaseMotion/index.js.map +1 -0
- package/build/lib/native/components/BaseMotion/types.js +2 -0
- package/build/lib/native/components/BaseMotion/types.js.map +1 -0
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +3 -3
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Charts/AreaChart/AreaChart.native.js +2 -1
- package/build/lib/native/components/Charts/AreaChart/AreaChart.native.js.map +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponents.native.js +2 -2
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponents.native.js.map +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js +2 -2
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/native/components/Charts/LineChart/LineChart.native.js +4 -2
- package/build/lib/native/components/Charts/LineChart/LineChart.native.js.map +1 -1
- package/build/lib/native/components/Charts/utils/nullBridgeUtils.js +4 -0
- package/build/lib/native/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/native/components/Charts/utils/referenceBandUtils.js +6 -0
- package/build/lib/native/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/native/components/CounterInput/CounterInput.native.js +3 -2
- package/build/lib/native/components/CounterInput/CounterInput.native.js.map +1 -1
- package/build/lib/native/components/CounterInput/token.js +2 -2
- package/build/lib/native/components/CounterInput/token.js.map +1 -1
- package/build/lib/native/components/DatePicker/Calendar.native.js +2 -2
- package/build/lib/native/components/DatePicker/Calendar.native.js.map +1 -1
- package/build/lib/native/components/DatePicker/utils.js +2 -2
- package/build/lib/native/components/DatePicker/utils.js.map +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/native/components/Dropdown/FilterChipSelectInput.native.js +2 -1
- package/build/lib/native/components/Dropdown/FilterChipSelectInput.native.js.map +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js +4 -0
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/native/components/Dropdown/useDropdown.js +1 -1
- package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/native/components/Fade/Fade.native.js +7 -5
- package/build/lib/native/components/Fade/Fade.native.js.map +1 -1
- package/build/lib/native/components/FilterChip/BaseFilterChip.native.js +2 -2
- package/build/lib/native/components/FilterChip/BaseFilterChip.native.js.map +1 -1
- package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js +14 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js +20 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js.map +1 -0
- package/build/lib/native/components/FloatingActionButton/index.js +2 -0
- package/build/lib/native/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/native/components/GenUI/GenUIContext.native.js +2 -2
- package/build/lib/native/components/GenUI/GenUIContext.native.js.map +1 -1
- package/build/lib/native/components/GenUI/index.js +1 -1
- package/build/lib/native/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +14 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/native/components/Icons/index.js +1 -0
- package/build/lib/native/components/Icons/index.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Morph/Morph.native.js +9 -5
- package/build/lib/native/components/Morph/Morph.native.js.map +1 -1
- package/build/lib/native/components/Move/Move.native.js +8 -5
- package/build/lib/native/components/Move/Move.native.js.map +1 -1
- package/build/lib/native/components/Scale/Scale.native.js +7 -5
- package/build/lib/native/components/Scale/Scale.native.js.map +1 -1
- package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js +27 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js +8 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js +18 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/index.js +3 -0
- package/build/lib/native/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js +4 -0
- package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/native/components/Slide/Slide.native.js +7 -5
- package/build/lib/native/components/Slide/Slide.native.js.map +1 -1
- package/build/lib/native/components/Spark/RzpGlass/utils.native.js +1 -1
- package/build/lib/native/components/Spark/RzpGlass/utils.native.js.map +1 -1
- package/build/lib/native/components/Stagger/Stagger.native.js +10 -5
- package/build/lib/native/components/Stagger/Stagger.native.js.map +1 -1
- package/build/lib/native/components/Stagger/StaggerProvider.js +6 -0
- package/build/lib/native/components/Stagger/StaggerProvider.js.map +1 -0
- package/build/lib/native/components/TreeView/TreeView.native.js +4 -0
- package/build/lib/native/components/TreeView/TreeView.native.js.map +1 -0
- package/build/lib/native/components/TreeView/index.native.js +2 -0
- package/build/lib/native/components/TreeView/index.native.js.map +1 -0
- package/build/lib/native/components/index.js +10 -2
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/tokens/global/colors.js +1 -1
- package/build/lib/native/tokens/global/colors.js.map +1 -1
- package/build/lib/native/tokens/index.js +1 -0
- package/build/lib/native/tokens/index.js.map +1 -1
- package/build/lib/native/tokens/theme/bladeNeutralTheme.js +15 -0
- package/build/lib/native/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/native/tokens/theme/bladeTheme.js +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/index.js +1 -0
- package/build/lib/native/tokens/theme/index.js.map +1 -1
- package/build/lib/native/tokens/theme/theme.js.map +1 -1
- package/build/lib/native/utils/componentZIndices.js +1 -1
- package/build/lib/native/utils/componentZIndices.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/native/utils/msToSeconds.js +4 -0
- package/build/lib/native/utils/msToSeconds.js.map +1 -0
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js +1 -1
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/_virtual/flatten.js +1 -1
- package/build/lib/web/development/_virtual/flatten3.js +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
- package/build/lib/web/development/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +124 -73
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +68 -2
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js +206 -18
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js +159 -43
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js +15 -2
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js +272 -15
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/LineChart/useReferenceBand.js +195 -0
- package/build/lib/web/development/components/Charts/LineChart/useReferenceBand.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/nullBridgeUtils.js +175 -0
- package/build/lib/web/development/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/referenceBandUtils.js +66 -0
- package/build/lib/web/development/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/web/development/components/CounterInput/CounterInput.web.js +29 -5
- package/build/lib/web/development/components/CounterInput/CounterInput.web.js.map +1 -1
- package/build/lib/web/development/components/CounterInput/StyledCounterInput.js +20 -4
- package/build/lib/web/development/components/CounterInput/StyledCounterInput.js.map +1 -1
- package/build/lib/web/development/components/CounterInput/token.js +6 -1
- package/build/lib/web/development/components/CounterInput/token.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +28 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/Calendar.web.js +9 -2
- package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
- package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/utils.js +21 -1
- package/build/lib/web/development/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +40 -5
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js +30 -32
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/dropdownUtils.js +28 -2
- package/build/lib/web/development/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js +60 -0
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/web/development/components/Dropdown/useDropdown.js +91 -5
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +35 -11
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js +126 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButtonContainer.web.js +45 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButtonContainer.web.js.map +1 -0
- package/build/lib/web/development/components/FloatingActionButton/index.js +2 -0
- package/build/lib/web/development/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/web/development/components/GenUI/GenUIComponents.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUIContext.web.js +9 -1
- package/build/lib/web/development/components/GenUI/GenUIContext.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUIProvider.web.js +17 -0
- package/build/lib/web/development/components/GenUI/GenUIProvider.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUISchemaRenderer.web.js +31 -6
- package/build/lib/web/development/components/GenUI/GenUISchemaRenderer.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/index.js +1 -1
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +44 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/web/development/components/Icons/index.js +1 -0
- package/build/lib/web/development/components/Icons/index.js.map +1 -1
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +3 -0
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/development/components/PopupArrow/PopupArrow.web.js +7 -1
- package/build/lib/web/development/components/PopupArrow/PopupArrow.web.js.map +1 -1
- package/build/lib/web/development/components/RollingText/RollingText.web.js +27 -20
- package/build/lib/web/development/components/RollingText/RollingText.web.js.map +1 -1
- package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js +196 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js +18 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/index.js +3 -0
- package/build/lib/web/development/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js +53 -0
- package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js +16 -7
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js +24 -6
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js +30 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/utils.js +26 -10
- package/build/lib/web/development/components/Spark/RzpGlass/utils.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js +31 -18
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +14 -3
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +23 -4
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/utils.js +58 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/utils.js.map +1 -1
- package/build/lib/web/development/components/Stagger/StaggerProvider.js.map +1 -1
- package/build/lib/web/development/components/TreeView/StyledTreeViewRow.web.js +41 -0
- package/build/lib/web/development/components/TreeView/StyledTreeViewRow.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeView.web.js +696 -0
- package/build/lib/web/development/components/TreeView/TreeView.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewAnimator.web.js +184 -0
- package/build/lib/web/development/components/TreeView/TreeViewAnimator.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewChevron.web.js +73 -0
- package/build/lib/web/development/components/TreeView/TreeViewChevron.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewItem.web.js +295 -0
- package/build/lib/web/development/components/TreeView/TreeViewItem.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewLoadMore.web.js +173 -0
- package/build/lib/web/development/components/TreeView/TreeViewLoadMore.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/componentIds.js +8 -0
- package/build/lib/web/development/components/TreeView/componentIds.js.map +1 -0
- package/build/lib/web/development/components/TreeView/index.web.js +4 -0
- package/build/lib/web/development/components/TreeView/index.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/treeViewUtils.js +475 -0
- package/build/lib/web/development/components/TreeView/treeViewUtils.js.map +1 -0
- package/build/lib/web/development/components/TreeView/useTreeView.js +24 -0
- package/build/lib/web/development/components/TreeView/useTreeView.js.map +1 -0
- package/build/lib/web/development/components/index.js +12 -2
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/development/tokens/global/colors.js +2 -2
- package/build/lib/web/development/tokens/global/colors.js.map +1 -1
- package/build/lib/web/development/tokens/index.js +1 -0
- package/build/lib/web/development/tokens/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/development/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/development/tokens/theme/index.js +1 -0
- package/build/lib/web/development/tokens/theme/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/development/utils/componentZIndices.js +2 -0
- package/build/lib/web/development/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +7 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/lib/web/production/_virtual/flatten.js +1 -1
- package/build/lib/web/production/_virtual/flatten3.js +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
- package/build/lib/web/production/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +124 -73
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +68 -2
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js +206 -18
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js +159 -43
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js +15 -2
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js +272 -15
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js +195 -0
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js +175 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js +66 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js +29 -5
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js +20 -4
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/token.js +6 -1
- package/build/lib/web/production/components/CounterInput/token.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +28 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +9 -2
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
- package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js +21 -1
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +40 -5
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +30 -32
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js +28 -2
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js +60 -0
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/web/production/components/Dropdown/useDropdown.js +91 -5
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +35 -11
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js +126 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js +45 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js +2 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/web/production/components/GenUI/GenUIComponents.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js +9 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js +17 -0
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js +31 -6
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/index.js +1 -1
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +44 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/web/production/components/Icons/index.js +1 -0
- package/build/lib/web/production/components/Icons/index.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +3 -0
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js +7 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js.map +1 -1
- package/build/lib/web/production/components/RollingText/RollingText.web.js +27 -20
- package/build/lib/web/production/components/RollingText/RollingText.web.js.map +1 -1
- package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js +196 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js +18 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/index.js +3 -0
- package/build/lib/web/production/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js +53 -0
- package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js +16 -7
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js +24 -6
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js +30 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js +26 -10
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js +31 -18
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +14 -3
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +23 -4
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js +58 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js.map +1 -1
- package/build/lib/web/production/components/Stagger/StaggerProvider.js.map +1 -1
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js +41 -0
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js +696 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js +184 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js +73 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js +295 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js +173 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/componentIds.js +8 -0
- package/build/lib/web/production/components/TreeView/componentIds.js.map +1 -0
- package/build/lib/web/production/components/TreeView/index.web.js +4 -0
- package/build/lib/web/production/components/TreeView/index.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js +475 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js.map +1 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js +24 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js.map +1 -0
- package/build/lib/web/production/components/index.js +12 -2
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js.map +1 -1
- package/build/lib/web/production/tokens/index.js +1 -0
- package/build/lib/web/production/tokens/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/production/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/production/tokens/theme/index.js +1 -0
- package/build/lib/web/production/tokens/theme/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/production/utils/componentZIndices.js +2 -0
- package/build/lib/web/production/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +7 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/types/components/index.d.ts +794 -25
- package/build/types/components/index.native.d.ts +872 -29
- package/build/types/tokens/index.d.ts +11 -4
- package/build/types/tokens/index.native.d.ts +11 -4
- package/build/types/utils/index.d.ts +8 -3
- package/build/types/utils/index.native.d.ts +8 -3
- package/package.json +2 -2
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js.map +0 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js.map +0 -1
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { componentIds } from './componentIds.js';
|
|
8
|
+
import { TreeViewContext } from './useTreeView.js';
|
|
9
|
+
import { getTreeViewProperties, getSelectedLeafValues, getSelectedGroups, getSelectionOnNodeToggle, getSelectionAfterLoad, getVisibleOptionIndices, getBranchSelectionState, getDisplayOverride, getVisibleValues } from './treeViewUtils.js';
|
|
10
|
+
import { useTreeViewMountScopeRef, TreeViewMountScopeContext } from './TreeViewAnimator.web.js';
|
|
11
|
+
import { useDropdown } from '../Dropdown/useDropdown.js';
|
|
12
|
+
import { useBottomSheetContext } from '../BottomSheet/BottomSheetContext.js';
|
|
13
|
+
import { getBaseListBoxWrapperStyles } from '../ActionList/styles/getBaseListBoxWrapperStyles.js';
|
|
14
|
+
import '../Box/BaseBox/index.js';
|
|
15
|
+
import '../../utils/assignWithoutSideEffects/index.js';
|
|
16
|
+
import '../../utils/makeAccessible/index.js';
|
|
17
|
+
import '../../utils/metaAttribute/index.js';
|
|
18
|
+
import '../../utils/makeAnalyticsAttribute/index.js';
|
|
19
|
+
import '../../utils/logger/index.js';
|
|
20
|
+
import { useId } from '../../utils/useId.js';
|
|
21
|
+
import { jsx } from 'react/jsx-runtime';
|
|
22
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
23
|
+
import { throwBladeError, logger } from '../../utils/logger/logger.js';
|
|
24
|
+
import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
|
|
25
|
+
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
|
|
26
|
+
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
27
|
+
import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
28
|
+
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
29
|
+
|
|
30
|
+
var _excluded = ["children", "selectionType", "value", "defaultValue", "onChange", "name", "testID"];
|
|
31
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
32
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
33
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
34
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
|
+
var StyledTreeViewListBoxWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
37
|
+
displayName: "TreeViewweb__StyledTreeViewListBoxWrapper",
|
|
38
|
+
componentId: "kz3iog-0"
|
|
39
|
+
})(function (props) {
|
|
40
|
+
return _objectSpread({
|
|
41
|
+
overflowY: 'auto'
|
|
42
|
+
}, getBaseListBoxWrapperStyles({
|
|
43
|
+
theme: props.theme,
|
|
44
|
+
isInBottomSheet: false
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
var _TreeView = function _TreeView(_ref) {
|
|
48
|
+
var _dropdown$selectionTy, _visibleValues$;
|
|
49
|
+
var children = _ref.children,
|
|
50
|
+
selectionType = _ref.selectionType,
|
|
51
|
+
value = _ref.value,
|
|
52
|
+
defaultValue = _ref.defaultValue,
|
|
53
|
+
onChange = _ref.onChange,
|
|
54
|
+
name = _ref.name,
|
|
55
|
+
testID = _ref.testID,
|
|
56
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
+
var dropdown = useDropdown();
|
|
58
|
+
var _useBottomSheetContex = useBottomSheetContext(),
|
|
59
|
+
isInBottomSheet = _useBottomSheetContex.isInBottomSheet;
|
|
60
|
+
var isInsideDropdown = dropdown.dropdownBaseId !== '';
|
|
61
|
+
var baseId = useId('treeview');
|
|
62
|
+
if (true && isInBottomSheet) {
|
|
63
|
+
// §6.9: BottomSheet is explicitly out of scope for TreeView v1
|
|
64
|
+
throwBladeError({
|
|
65
|
+
message: 'TreeView is not supported inside BottomSheet',
|
|
66
|
+
moduleName: 'TreeView'
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
React__default.useEffect(function () {
|
|
70
|
+
if (true && isInsideDropdown) {
|
|
71
|
+
if (value !== undefined || defaultValue !== undefined || onChange !== undefined) {
|
|
72
|
+
logger({
|
|
73
|
+
type: 'warn',
|
|
74
|
+
moduleName: 'TreeView',
|
|
75
|
+
message: 'value, defaultValue, and onChange props of TreeView are ignored inside Dropdown. Use them on the Dropdown trigger (SelectInput / FilterChipSelectInput) instead'
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (selectionType !== undefined && dropdown.selectionType !== undefined && selectionType !== dropdown.selectionType) {
|
|
79
|
+
logger({
|
|
80
|
+
type: 'warn',
|
|
81
|
+
moduleName: 'TreeView',
|
|
82
|
+
message: "selectionType=\"".concat(selectionType, "\" on TreeView conflicts with selectionType=\"").concat(dropdown.selectionType, "\" on Dropdown. Dropdown's selectionType wins")
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
+
}, [isInsideDropdown]);
|
|
88
|
+
|
|
89
|
+
// §2.1 dual-mode rule: inside Dropdown, selection is owned by Dropdown state and its trigger
|
|
90
|
+
var effectiveSelectionType = isInsideDropdown ? (_dropdown$selectionTy = dropdown.selectionType) !== null && _dropdown$selectionTy !== void 0 ? _dropdown$selectionTy : 'single' : selectionType !== null && selectionType !== void 0 ? selectionType : 'single';
|
|
91
|
+
var properties = React__default.useMemo(function () {
|
|
92
|
+
return getTreeViewProperties(children);
|
|
93
|
+
}, [children]);
|
|
94
|
+
var orderedNodes = properties.orderedNodes,
|
|
95
|
+
nodeMap = properties.nodeMap,
|
|
96
|
+
rootValues = properties.rootValues,
|
|
97
|
+
options = properties.options;
|
|
98
|
+
|
|
99
|
+
// ---------------- expansion ----------------
|
|
100
|
+
var _React$useState = React__default.useState(function () {
|
|
101
|
+
return new Set(properties.orderedNodes.filter(function (node) {
|
|
102
|
+
return node.kind === 'item' && node.isBranch && node.defaultIsExpanded;
|
|
103
|
+
}).map(function (node) {
|
|
104
|
+
return node.value;
|
|
105
|
+
}));
|
|
106
|
+
}),
|
|
107
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
108
|
+
uncontrolledExpandedValues = _React$useState2[0],
|
|
109
|
+
setUncontrolledExpandedValues = _React$useState2[1];
|
|
110
|
+
var expandedValues = React__default.useMemo(function () {
|
|
111
|
+
var merged = new Set();
|
|
112
|
+
var _iterator = _createForOfIteratorHelper(orderedNodes),
|
|
113
|
+
_step;
|
|
114
|
+
try {
|
|
115
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
116
|
+
var _node$controlledIsExp;
|
|
117
|
+
var node = _step.value;
|
|
118
|
+
if (!node.isBranch) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
var isExpanded = (_node$controlledIsExp = node.controlledIsExpanded) !== null && _node$controlledIsExp !== void 0 ? _node$controlledIsExp : uncontrolledExpandedValues.has(node.value);
|
|
122
|
+
if (isExpanded) {
|
|
123
|
+
merged.add(node.value);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} catch (err) {
|
|
127
|
+
_iterator.e(err);
|
|
128
|
+
} finally {
|
|
129
|
+
_iterator.f();
|
|
130
|
+
}
|
|
131
|
+
return merged;
|
|
132
|
+
}, [orderedNodes, uncontrolledExpandedValues]);
|
|
133
|
+
var onNodeExpandToggle = function onNodeExpandToggle(nodeValue) {
|
|
134
|
+
var _node$onExpandChange;
|
|
135
|
+
var node = nodeMap[nodeValue];
|
|
136
|
+
if (!(node !== null && node !== void 0 && node.isBranch) || node.isDisabled) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
var isExpanded = expandedValues.has(nodeValue);
|
|
140
|
+
if (node.controlledIsExpanded === undefined) {
|
|
141
|
+
setUncontrolledExpandedValues(function (previous) {
|
|
142
|
+
var next = new Set(previous);
|
|
143
|
+
if (isExpanded) {
|
|
144
|
+
next["delete"](nodeValue);
|
|
145
|
+
} else {
|
|
146
|
+
next.add(nodeValue);
|
|
147
|
+
}
|
|
148
|
+
return next;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
(_node$onExpandChange = node.onExpandChange) === null || _node$onExpandChange === void 0 || _node$onExpandChange.call(node, {
|
|
152
|
+
isExpanded: !isExpanded
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// ---------------- selection (standalone: B11 - a Set of selected leaf values) ----------------
|
|
157
|
+
var isControlledSelection = !isInsideDropdown && value !== undefined;
|
|
158
|
+
var _React$useState3 = React__default.useState(function () {
|
|
159
|
+
return new Set(defaultValue !== null && defaultValue !== void 0 ? defaultValue : []);
|
|
160
|
+
}),
|
|
161
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
162
|
+
uncontrolledSelectedValues = _React$useState4[0],
|
|
163
|
+
setUncontrolledSelectedValues = _React$useState4[1];
|
|
164
|
+
var standaloneSelectedValues = React__default.useMemo(function () {
|
|
165
|
+
return isControlledSelection ? new Set(value) : uncontrolledSelectedValues;
|
|
166
|
+
}, [isControlledSelection, value, uncontrolledSelectedValues]);
|
|
167
|
+
|
|
168
|
+
// dropdown mode: B11 - no TreeView-owned selection state, everything derives from Dropdown's indices
|
|
169
|
+
var dropdownSelectedValues = React__default.useMemo(function () {
|
|
170
|
+
var selected = new Set();
|
|
171
|
+
if (!isInsideDropdown) {
|
|
172
|
+
return selected;
|
|
173
|
+
}
|
|
174
|
+
var _iterator2 = _createForOfIteratorHelper(dropdown.selectedIndices),
|
|
175
|
+
_step2;
|
|
176
|
+
try {
|
|
177
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
178
|
+
var _dropdown$options$sel;
|
|
179
|
+
var selectedIndex = _step2.value;
|
|
180
|
+
var optionValue = (_dropdown$options$sel = dropdown.options[selectedIndex]) === null || _dropdown$options$sel === void 0 ? void 0 : _dropdown$options$sel.value;
|
|
181
|
+
if (optionValue !== undefined) {
|
|
182
|
+
selected.add(optionValue);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} catch (err) {
|
|
186
|
+
_iterator2.e(err);
|
|
187
|
+
} finally {
|
|
188
|
+
_iterator2.f();
|
|
189
|
+
}
|
|
190
|
+
return selected;
|
|
191
|
+
}, [isInsideDropdown, dropdown.selectedIndices, dropdown.options]);
|
|
192
|
+
var selectedValuesSet = isInsideDropdown ? dropdownSelectedValues : standaloneSelectedValues;
|
|
193
|
+
var emitStandaloneChange = function emitStandaloneChange(next) {
|
|
194
|
+
if (effectiveSelectionType === 'single') {
|
|
195
|
+
onChange === null || onChange === void 0 || onChange({
|
|
196
|
+
name: name,
|
|
197
|
+
values: _toConsumableArray(next),
|
|
198
|
+
selectedGroups: []
|
|
199
|
+
});
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
onChange === null || onChange === void 0 || onChange({
|
|
203
|
+
name: name,
|
|
204
|
+
values: getSelectedLeafValues(orderedNodes, next),
|
|
205
|
+
selectedGroups: getSelectedGroups({
|
|
206
|
+
rootValues: rootValues,
|
|
207
|
+
nodeMap: nodeMap,
|
|
208
|
+
selectedValues: next
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
var onNodeSelect = function onNodeSelect(nodeValue) {
|
|
213
|
+
var node = nodeMap[nodeValue];
|
|
214
|
+
if (!node || node.isDisabled || node.kind === 'loadMore') {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// a branch that opted out of selection toggles expansion instead (row click / Enter / Space)
|
|
219
|
+
if (node.isBranch && !node.isSelectable) {
|
|
220
|
+
onNodeExpandToggle(nodeValue);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
var next;
|
|
224
|
+
if (effectiveSelectionType === 'single') {
|
|
225
|
+
// radio semantics (B1) - reselecting the current selection is a no-op
|
|
226
|
+
if (standaloneSelectedValues.has(nodeValue) && standaloneSelectedValues.size === 1) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
next = new Set([nodeValue]);
|
|
230
|
+
} else {
|
|
231
|
+
if (node.isBranch && node.selectableLeafValues.length === 0) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
next = getSelectionOnNodeToggle({
|
|
235
|
+
node: node,
|
|
236
|
+
selectedValues: standaloneSelectedValues
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
if (!isControlledSelection) {
|
|
240
|
+
setUncontrolledSelectedValues(next);
|
|
241
|
+
}
|
|
242
|
+
emitStandaloneChange(next);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// ---------------- dropdown mode: selection routing (§6.2) ----------------
|
|
246
|
+
var toggleBranchInDropdown = function toggleBranchInDropdown(node) {
|
|
247
|
+
// multiple mode invariant: branch indices never enter selectedIndices
|
|
248
|
+
var leafIndices = node.selectableLeafValues.map(function (leafValue) {
|
|
249
|
+
var _nodeMap$leafValue$op, _nodeMap$leafValue;
|
|
250
|
+
return (_nodeMap$leafValue$op = (_nodeMap$leafValue = nodeMap[leafValue]) === null || _nodeMap$leafValue === void 0 ? void 0 : _nodeMap$leafValue.optionIndex) !== null && _nodeMap$leafValue$op !== void 0 ? _nodeMap$leafValue$op : -1;
|
|
251
|
+
}).filter(function (optionIndex) {
|
|
252
|
+
return optionIndex >= 0;
|
|
253
|
+
});
|
|
254
|
+
if (leafIndices.length === 0) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
var areAllSelected = leafIndices.every(function (optionIndex) {
|
|
258
|
+
return dropdown.selectedIndices.includes(optionIndex);
|
|
259
|
+
});
|
|
260
|
+
dropdown.selectOptionsBatch(leafIndices, areAllSelected ? 'deselect' : 'select');
|
|
261
|
+
};
|
|
262
|
+
var onDropdownNodeClick = function onDropdownNodeClick(event, clickedValue) {
|
|
263
|
+
var node = nodeMap[clickedValue];
|
|
264
|
+
if (!node || node.isDisabled || node.optionIndex < 0) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (node.kind === 'loadMore') {
|
|
268
|
+
var _options$node$optionI, _options$node$optionI2, _dropdown$triggererRe;
|
|
269
|
+
(_options$node$optionI = (_options$node$optionI2 = options[node.optionIndex]).onClickTrigger) === null || _options$node$optionI === void 0 || _options$node$optionI.call(_options$node$optionI2, true);
|
|
270
|
+
dropdown.setActiveIndex(node.optionIndex);
|
|
271
|
+
(_dropdown$triggererRe = dropdown.triggererRef.current) === null || _dropdown$triggererRe === void 0 || _dropdown$triggererRe.focus();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// non-selectable branch: toggle expansion, keep the overlay open, never enter selectedIndices
|
|
276
|
+
if (node.isBranch && !node.isSelectable) {
|
|
277
|
+
var _dropdown$triggererRe2;
|
|
278
|
+
onNodeExpandToggle(node.value);
|
|
279
|
+
dropdown.setActiveIndex(node.optionIndex);
|
|
280
|
+
(_dropdown$triggererRe2 = dropdown.triggererRef.current) === null || _dropdown$triggererRe2 === void 0 || _dropdown$triggererRe2.focus();
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (effectiveSelectionType === 'multiple' && node.isBranch) {
|
|
284
|
+
var _dropdown$triggererRe3;
|
|
285
|
+
toggleBranchInDropdown(node);
|
|
286
|
+
dropdown.setActiveIndex(node.optionIndex);
|
|
287
|
+
(_dropdown$triggererRe3 = dropdown.triggererRef.current) === null || _dropdown$triggererRe3 === void 0 || _dropdown$triggererRe3.focus();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// leaf click (and branch click in single mode) goes through the standard path
|
|
292
|
+
dropdown.onOptionClick(event, node.optionIndex);
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// ---------------- registration (§6.1) + uncontrolled remap + B6 inheritance ----------------
|
|
296
|
+
var previousPropertiesRef = React__default.useRef(properties);
|
|
297
|
+
React__default.useEffect(function () {
|
|
298
|
+
var previousProperties = previousPropertiesRef.current;
|
|
299
|
+
previousPropertiesRef.current = properties;
|
|
300
|
+
if (isInsideDropdown) {
|
|
301
|
+
dropdown.setOptions(options);
|
|
302
|
+
if (previousProperties !== properties && !dropdown.isControlled) {
|
|
303
|
+
// indices are positional: when the registered list changes (async children, loadMore),
|
|
304
|
+
// remap uncontrolled selection by value and apply B6 inheritance.
|
|
305
|
+
// Controlled mode re-syncs through useControlledDropdownInput on [value, options] - not duplicated here
|
|
306
|
+
var previousSelectedValues = new Set(dropdown.selectedIndices.map(function (selectedIndex) {
|
|
307
|
+
var _previousProperties$o;
|
|
308
|
+
return (_previousProperties$o = previousProperties.options[selectedIndex]) === null || _previousProperties$o === void 0 ? void 0 : _previousProperties$o.value;
|
|
309
|
+
}).filter(function (optionValue) {
|
|
310
|
+
return optionValue !== undefined;
|
|
311
|
+
}));
|
|
312
|
+
var inherited = getSelectionAfterLoad({
|
|
313
|
+
previousNodeMap: previousProperties.nodeMap,
|
|
314
|
+
nodeMap: nodeMap,
|
|
315
|
+
orderedNodes: orderedNodes,
|
|
316
|
+
selectedValues: previousSelectedValues
|
|
317
|
+
});
|
|
318
|
+
var nextIndices = _toConsumableArray(inherited).map(function (selectedValue) {
|
|
319
|
+
return options.findIndex(function (option) {
|
|
320
|
+
return option.value === selectedValue;
|
|
321
|
+
});
|
|
322
|
+
}).filter(function (optionIndex) {
|
|
323
|
+
return optionIndex >= 0;
|
|
324
|
+
});
|
|
325
|
+
var hasChanged = nextIndices.length !== dropdown.selectedIndices.length || nextIndices.some(function (optionIndex, i) {
|
|
326
|
+
return optionIndex !== dropdown.selectedIndices[i];
|
|
327
|
+
});
|
|
328
|
+
if (hasChanged) {
|
|
329
|
+
dropdown.setSelectedIndices(nextIndices);
|
|
330
|
+
if (inherited.size !== previousSelectedValues.size) {
|
|
331
|
+
// selection actually grew through inheritance - let the trigger fire onChange
|
|
332
|
+
dropdown.setChangeCallbackTriggerer(dropdown.changeCallbackTriggerer + 1);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// standalone B6 inheritance (uncontrolled multiple selection only;
|
|
340
|
+
// in controlled mode the consumer owns `value` and can react to loads themselves)
|
|
341
|
+
if (previousProperties !== properties && !isControlledSelection && effectiveSelectionType === 'multiple') {
|
|
342
|
+
var _inherited = getSelectionAfterLoad({
|
|
343
|
+
previousNodeMap: previousProperties.nodeMap,
|
|
344
|
+
nodeMap: nodeMap,
|
|
345
|
+
orderedNodes: orderedNodes,
|
|
346
|
+
selectedValues: uncontrolledSelectedValues
|
|
347
|
+
});
|
|
348
|
+
if (_inherited.size !== uncontrolledSelectedValues.size) {
|
|
349
|
+
setUncontrolledSelectedValues(_inherited);
|
|
350
|
+
emitStandaloneChange(_inherited);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
354
|
+
}, [properties]);
|
|
355
|
+
|
|
356
|
+
// ---------------- dropdown keyboard controller (§6.4) ----------------
|
|
357
|
+
var getNodeAtIndex = function getNodeAtIndex(optionIndex) {
|
|
358
|
+
var _options$optionIndex;
|
|
359
|
+
var optionValue = (_options$optionIndex = options[optionIndex]) === null || _options$optionIndex === void 0 ? void 0 : _options$optionIndex.value;
|
|
360
|
+
return optionValue === undefined ? undefined : nodeMap[optionValue];
|
|
361
|
+
};
|
|
362
|
+
if (isInsideDropdown && dropdown.treeViewControllerRef) {
|
|
363
|
+
// Published during render (not in an effect): the trigger's effects
|
|
364
|
+
// (e.g. useControlledDropdownInput's onChange effect reading getSelectedGroups) run
|
|
365
|
+
// before this component's effects would re-assign the controller, so an effect-based
|
|
366
|
+
// assignment with a cleanup leaves a null window on every commit
|
|
367
|
+
dropdown.treeViewControllerRef.current = {
|
|
368
|
+
getVisibleOptionIndices: function getVisibleOptionIndices$1() {
|
|
369
|
+
return getVisibleOptionIndices({
|
|
370
|
+
orderedNodes: orderedNodes,
|
|
371
|
+
nodeMap: nodeMap,
|
|
372
|
+
expandedValues: expandedValues
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
onArrowRightKeydown: function onArrowRightKeydown(currentActiveIndex) {
|
|
376
|
+
var node = getNodeAtIndex(currentActiveIndex);
|
|
377
|
+
if (!(node !== null && node !== void 0 && node.isBranch)) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (!expandedValues.has(node.value)) {
|
|
381
|
+
onNodeExpandToggle(node.value);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
// already expanded: move to the first traversable child
|
|
385
|
+
var firstChildIndex = node.childValues.map(function (childValue) {
|
|
386
|
+
return nodeMap[childValue];
|
|
387
|
+
}).filter(function (childNode) {
|
|
388
|
+
return childNode && !childNode.isDisabled;
|
|
389
|
+
}).map(function (childNode) {
|
|
390
|
+
return childNode.optionIndex;
|
|
391
|
+
}).find(function (optionIndex) {
|
|
392
|
+
return optionIndex >= 0;
|
|
393
|
+
});
|
|
394
|
+
if (firstChildIndex !== undefined) {
|
|
395
|
+
dropdown.setActiveIndex(firstChildIndex);
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
onArrowLeftKeydown: function onArrowLeftKeydown(currentActiveIndex) {
|
|
399
|
+
var node = getNodeAtIndex(currentActiveIndex);
|
|
400
|
+
if (!node) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (node.isBranch && expandedValues.has(node.value)) {
|
|
404
|
+
onNodeExpandToggle(node.value);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
if (node.parentValue !== null) {
|
|
408
|
+
var _nodeMap$node$parentV, _nodeMap$node$parentV2;
|
|
409
|
+
var parentIndex = (_nodeMap$node$parentV = (_nodeMap$node$parentV2 = nodeMap[node.parentValue]) === null || _nodeMap$node$parentV2 === void 0 ? void 0 : _nodeMap$node$parentV2.optionIndex) !== null && _nodeMap$node$parentV !== void 0 ? _nodeMap$node$parentV : -1;
|
|
410
|
+
if (parentIndex >= 0) {
|
|
411
|
+
dropdown.setActiveIndex(parentIndex);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
handleOptionSelect: function handleOptionSelect(optionIndex) {
|
|
416
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
417
|
+
key = _ref2.key;
|
|
418
|
+
var node = getNodeAtIndex(optionIndex);
|
|
419
|
+
if (!node) {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
if (node.kind === 'loadMore') {
|
|
423
|
+
// B7: Enter activates, Space is a no-op
|
|
424
|
+
if (key !== ' ') {
|
|
425
|
+
var _options$optionIndex$, _options$optionIndex2;
|
|
426
|
+
(_options$optionIndex$ = (_options$optionIndex2 = options[optionIndex]).onClickTrigger) === null || _options$optionIndex$ === void 0 || _options$optionIndex$.call(_options$optionIndex2, true);
|
|
427
|
+
}
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
if (node.isBranch && !node.isSelectable) {
|
|
431
|
+
var _options$optionIndex$2, _options$optionIndex3;
|
|
432
|
+
// non-selectable branch: Enter/Space toggle expansion, never select
|
|
433
|
+
onNodeExpandToggle(node.value);
|
|
434
|
+
(_options$optionIndex$2 = (_options$optionIndex3 = options[optionIndex]).onClickTrigger) === null || _options$optionIndex$2 === void 0 || _options$optionIndex$2.call(_options$optionIndex3, false);
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
if (effectiveSelectionType === 'multiple' && node.isBranch) {
|
|
438
|
+
var _options$optionIndex$3, _options$optionIndex4;
|
|
439
|
+
// §6.2: branch toggle routes through the batch setter - exactly one onChange
|
|
440
|
+
var branchSelected = getBranchSelectionState(node, selectedValuesSet) === 'all';
|
|
441
|
+
toggleBranchInDropdown(node);
|
|
442
|
+
(_options$optionIndex$3 = (_options$optionIndex4 = options[optionIndex]).onClickTrigger) === null || _options$optionIndex$3 === void 0 || _options$optionIndex$3.call(_options$optionIndex4, !branchSelected);
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
// leaf (and branch in single mode): default selectOption path
|
|
446
|
+
return false;
|
|
447
|
+
},
|
|
448
|
+
getSelectedGroups: function getSelectedGroups$1(selectedIndices) {
|
|
449
|
+
var selected = new Set(selectedIndices.map(function (selectedIndex) {
|
|
450
|
+
var _options$selectedInde;
|
|
451
|
+
return (_options$selectedInde = options[selectedIndex]) === null || _options$selectedInde === void 0 ? void 0 : _options$selectedInde.value;
|
|
452
|
+
}).filter(function (optionValue) {
|
|
453
|
+
return optionValue !== undefined;
|
|
454
|
+
}));
|
|
455
|
+
return getSelectedGroups({
|
|
456
|
+
rootValues: rootValues,
|
|
457
|
+
nodeMap: nodeMap,
|
|
458
|
+
selectedValues: selected
|
|
459
|
+
});
|
|
460
|
+
},
|
|
461
|
+
getDisplayOverride: function getDisplayOverride$1(selectedIndices) {
|
|
462
|
+
var selected = new Set(selectedIndices.map(function (selectedIndex) {
|
|
463
|
+
var _options$selectedInde2;
|
|
464
|
+
return (_options$selectedInde2 = options[selectedIndex]) === null || _options$selectedInde2 === void 0 ? void 0 : _options$selectedInde2.value;
|
|
465
|
+
}).filter(function (optionValue) {
|
|
466
|
+
return optionValue !== undefined;
|
|
467
|
+
}));
|
|
468
|
+
return getDisplayOverride({
|
|
469
|
+
orderedNodes: orderedNodes,
|
|
470
|
+
rootValues: rootValues,
|
|
471
|
+
nodeMap: nodeMap,
|
|
472
|
+
selectedValues: selected
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
var treeViewControllerRef = dropdown.treeViewControllerRef;
|
|
478
|
+
React__default.useEffect(function () {
|
|
479
|
+
return function () {
|
|
480
|
+
if (treeViewControllerRef) {
|
|
481
|
+
treeViewControllerRef.current = null;
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
}, [treeViewControllerRef]);
|
|
485
|
+
|
|
486
|
+
// ---------------- focus management ----------------
|
|
487
|
+
var rowRefs = React__default.useRef({});
|
|
488
|
+
var registerRowRef = function registerRowRef(nodeValue, element) {
|
|
489
|
+
rowRefs.current[nodeValue] = element;
|
|
490
|
+
};
|
|
491
|
+
var _React$useState5 = React__default.useState(null),
|
|
492
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
493
|
+
focusedValue = _React$useState6[0],
|
|
494
|
+
setFocusedValue = _React$useState6[1];
|
|
495
|
+
var visibleValues = React__default.useMemo(function () {
|
|
496
|
+
return getVisibleValues({
|
|
497
|
+
orderedNodes: orderedNodes,
|
|
498
|
+
nodeMap: nodeMap,
|
|
499
|
+
expandedValues: expandedValues
|
|
500
|
+
});
|
|
501
|
+
}, [orderedNodes, nodeMap, expandedValues]);
|
|
502
|
+
// roving tabindex (standalone): the focused row is tabbable, falling back to the first visible row
|
|
503
|
+
var tabbableValue = isInsideDropdown ? null : focusedValue && visibleValues.includes(focusedValue) ? focusedValue : (_visibleValues$ = visibleValues[0]) !== null && _visibleValues$ !== void 0 ? _visibleValues$ : null;
|
|
504
|
+
|
|
505
|
+
// dropdown mode: keep the active row scrolled into view (focus stays on the trigger)
|
|
506
|
+
React__default.useEffect(function () {
|
|
507
|
+
var _options$dropdown$act;
|
|
508
|
+
if (!isInsideDropdown || dropdown.activeIndex < 0) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
var activeValue = (_options$dropdown$act = options[dropdown.activeIndex]) === null || _options$dropdown$act === void 0 ? void 0 : _options$dropdown$act.value;
|
|
512
|
+
if (activeValue !== undefined) {
|
|
513
|
+
var _rowRefs$current$acti, _rowRefs$current$acti2;
|
|
514
|
+
(_rowRefs$current$acti = rowRefs.current[activeValue]) === null || _rowRefs$current$acti === void 0 || (_rowRefs$current$acti2 = _rowRefs$current$acti.scrollIntoView) === null || _rowRefs$current$acti2 === void 0 || _rowRefs$current$acti2.call(_rowRefs$current$acti, {
|
|
515
|
+
block: 'nearest'
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
519
|
+
}, [dropdown.activeIndex]);
|
|
520
|
+
|
|
521
|
+
// ---------------- standalone keyboard map (§5) ----------------
|
|
522
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
523
|
+
var _closest, _ref3;
|
|
524
|
+
if (isInsideDropdown) {
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
var rowElement = (_closest = (_ref3 = event.target).closest) === null || _closest === void 0 ? void 0 : _closest.call(_ref3, '[data-tree-node-value]');
|
|
528
|
+
var currentValue = rowElement === null || rowElement === void 0 ? void 0 : rowElement.getAttribute('data-tree-node-value');
|
|
529
|
+
if (!currentValue) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
var node = nodeMap[currentValue];
|
|
533
|
+
if (!node) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
var currentVisibleIndex = visibleValues.indexOf(currentValue);
|
|
537
|
+
var focusRow = function focusRow(nodeValue) {
|
|
538
|
+
if (nodeValue !== undefined) {
|
|
539
|
+
var _rowRefs$current$node;
|
|
540
|
+
(_rowRefs$current$node = rowRefs.current[nodeValue]) === null || _rowRefs$current$node === void 0 || _rowRefs$current$node.focus();
|
|
541
|
+
setFocusedValue(nodeValue);
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
switch (event.key) {
|
|
545
|
+
case 'ArrowDown':
|
|
546
|
+
event.preventDefault();
|
|
547
|
+
focusRow(visibleValues[currentVisibleIndex + 1]);
|
|
548
|
+
break;
|
|
549
|
+
case 'ArrowUp':
|
|
550
|
+
event.preventDefault();
|
|
551
|
+
focusRow(visibleValues[currentVisibleIndex - 1]);
|
|
552
|
+
break;
|
|
553
|
+
case 'Home':
|
|
554
|
+
event.preventDefault();
|
|
555
|
+
focusRow(visibleValues[0]);
|
|
556
|
+
break;
|
|
557
|
+
case 'End':
|
|
558
|
+
event.preventDefault();
|
|
559
|
+
focusRow(visibleValues[visibleValues.length - 1]);
|
|
560
|
+
break;
|
|
561
|
+
case 'ArrowRight':
|
|
562
|
+
event.preventDefault();
|
|
563
|
+
if (!node.isBranch) {
|
|
564
|
+
break;
|
|
565
|
+
}
|
|
566
|
+
if (!expandedValues.has(currentValue)) {
|
|
567
|
+
onNodeExpandToggle(currentValue);
|
|
568
|
+
} else {
|
|
569
|
+
focusRow(node.childValues.find(function (childValue) {
|
|
570
|
+
return visibleValues.includes(childValue);
|
|
571
|
+
}));
|
|
572
|
+
}
|
|
573
|
+
break;
|
|
574
|
+
case 'ArrowLeft':
|
|
575
|
+
event.preventDefault();
|
|
576
|
+
if (node.isBranch && expandedValues.has(currentValue)) {
|
|
577
|
+
onNodeExpandToggle(currentValue);
|
|
578
|
+
} else if (node.parentValue !== null) {
|
|
579
|
+
focusRow(node.parentValue);
|
|
580
|
+
}
|
|
581
|
+
break;
|
|
582
|
+
case 'Enter':
|
|
583
|
+
event.preventDefault();
|
|
584
|
+
if (node.kind === 'loadMore') {
|
|
585
|
+
if (node.optionIndex >= 0) {
|
|
586
|
+
var _options$node$optionI3, _options$node$optionI4;
|
|
587
|
+
(_options$node$optionI3 = (_options$node$optionI4 = options[node.optionIndex]).onClickTrigger) === null || _options$node$optionI3 === void 0 || _options$node$optionI3.call(_options$node$optionI4, true);
|
|
588
|
+
}
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
{
|
|
592
|
+
var isNodeSelected = node.isSelectable && (effectiveSelectionType === 'multiple' ? node.isBranch ? getBranchSelectionState(node, selectedValuesSet) === 'all' : selectedValuesSet.has(currentValue) : selectedValuesSet.has(currentValue));
|
|
593
|
+
onNodeSelect(currentValue);
|
|
594
|
+
if (node.optionIndex >= 0) {
|
|
595
|
+
var _options$node$optionI5, _options$node$optionI6;
|
|
596
|
+
(_options$node$optionI5 = (_options$node$optionI6 = options[node.optionIndex]).onClickTrigger) === null || _options$node$optionI5 === void 0 || _options$node$optionI5.call(_options$node$optionI6, isNodeSelected);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
break;
|
|
600
|
+
case ' ':
|
|
601
|
+
event.preventDefault();
|
|
602
|
+
// B7: Space is a no-op on LoadMore
|
|
603
|
+
if (node.kind === 'loadMore') {
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
{
|
|
607
|
+
var _isNodeSelected = node.isSelectable && (effectiveSelectionType === 'multiple' ? node.isBranch ? getBranchSelectionState(node, selectedValuesSet) === 'all' : selectedValuesSet.has(currentValue) : selectedValuesSet.has(currentValue));
|
|
608
|
+
onNodeSelect(currentValue);
|
|
609
|
+
if (node.optionIndex >= 0) {
|
|
610
|
+
var _options$node$optionI7, _options$node$optionI8;
|
|
611
|
+
(_options$node$optionI7 = (_options$node$optionI8 = options[node.optionIndex]).onClickTrigger) === null || _options$node$optionI7 === void 0 || _options$node$optionI7.call(_options$node$optionI8, _isNodeSelected);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
break;
|
|
615
|
+
default:
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
// ---------------- context ----------------
|
|
621
|
+
var contextValue = React__default.useMemo(function () {
|
|
622
|
+
return {
|
|
623
|
+
selectionType: effectiveSelectionType,
|
|
624
|
+
isInsideDropdown: isInsideDropdown,
|
|
625
|
+
baseId: baseId,
|
|
626
|
+
nodeMap: nodeMap,
|
|
627
|
+
selectedValuesSet: selectedValuesSet,
|
|
628
|
+
expandedValues: expandedValues,
|
|
629
|
+
tabbableValue: tabbableValue,
|
|
630
|
+
onNodeSelect: onNodeSelect,
|
|
631
|
+
onNodeExpandToggle: onNodeExpandToggle,
|
|
632
|
+
onDropdownNodeClick: onDropdownNodeClick,
|
|
633
|
+
registerRowRef: registerRowRef,
|
|
634
|
+
setFocusedValue: setFocusedValue
|
|
635
|
+
};
|
|
636
|
+
},
|
|
637
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
638
|
+
[effectiveSelectionType, isInsideDropdown, baseId, nodeMap, selectedValuesSet, expandedValues, tabbableValue, dropdown.selectedIndices, dropdown.activeIndex, dropdown.isKeydownPressed]);
|
|
639
|
+
|
|
640
|
+
// root mount scope: rows appended at the root after the initial mount
|
|
641
|
+
// (e.g. through a root-level TreeViewLoadMore) animate their own mount
|
|
642
|
+
var isTreeFirstRenderRef = useTreeViewMountScopeRef();
|
|
643
|
+
var treeContent = /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
644
|
+
id: isInsideDropdown ? "".concat(dropdown.dropdownBaseId, "-actionlist") : undefined,
|
|
645
|
+
onKeyDown: handleKeyDown
|
|
646
|
+
}, makeAccessible({
|
|
647
|
+
role: 'tree',
|
|
648
|
+
multiSelectable: effectiveSelectionType === 'multiple' ? true : undefined,
|
|
649
|
+
labelledBy: isInsideDropdown ? "".concat(dropdown.dropdownBaseId, "-label") : undefined
|
|
650
|
+
})), {}, {
|
|
651
|
+
children: /*#__PURE__*/jsx(TreeViewMountScopeContext.Provider, {
|
|
652
|
+
value: isTreeFirstRenderRef,
|
|
653
|
+
children: children
|
|
654
|
+
})
|
|
655
|
+
}));
|
|
656
|
+
return /*#__PURE__*/jsx(TreeViewContext.Provider, {
|
|
657
|
+
value: contextValue,
|
|
658
|
+
children: /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread(_objectSpread({}, metaAttribute({
|
|
659
|
+
name: MetaConstants.TreeView,
|
|
660
|
+
testID: testID
|
|
661
|
+
})), makeAnalyticsAttribute(rest)), {}, {
|
|
662
|
+
children: isInsideDropdown ? /*#__PURE__*/jsx(StyledTreeViewListBoxWrapper, {
|
|
663
|
+
children: treeContent
|
|
664
|
+
}) : treeContent
|
|
665
|
+
}))
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* ### TreeView
|
|
671
|
+
*
|
|
672
|
+
* Hierarchical list of expandable, selectable items. Works standalone on a page,
|
|
673
|
+
* or inside `Dropdown` (in place of `ActionList`) where selection is controlled
|
|
674
|
+
* through the trigger's `value` / `onChange` (SelectInput, FilterChipSelectInput).
|
|
675
|
+
*
|
|
676
|
+
* #### Usage
|
|
677
|
+
*
|
|
678
|
+
* ```jsx
|
|
679
|
+
* <TreeView selectionType="multiple" onChange={({ values, selectedGroups }) => {}}>
|
|
680
|
+
* <TreeViewItem title="India" value="india">
|
|
681
|
+
* <TreeViewItem title="Karnataka" value="karnataka">
|
|
682
|
+
* <TreeViewItem title="Bengaluru" value="bengaluru" />
|
|
683
|
+
* <TreeViewItem title="Mysuru" value="mysuru" />
|
|
684
|
+
* </TreeViewItem>
|
|
685
|
+
* <TreeViewItem title="Goa" value="goa" />
|
|
686
|
+
* </TreeViewItem>
|
|
687
|
+
* </TreeView>
|
|
688
|
+
* ```
|
|
689
|
+
*/
|
|
690
|
+
var TreeView = /*#__PURE__*/assignWithoutSideEffects(_TreeView, {
|
|
691
|
+
componentId: componentIds.TreeView,
|
|
692
|
+
displayName: componentIds.TreeView
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
export { TreeView };
|
|
696
|
+
//# sourceMappingURL=TreeView.web.js.map
|