@razorpay/blade 12.111.0 → 12.120.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/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/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 +1 -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 +1 -1
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js.map +1 -1
- 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/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/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/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 +7 -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/useControlledDropdownInput/useControlledDropdownInput.js +1 -1
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/_virtual/cloneDeep.js +1 -1
- package/build/lib/web/development/_virtual/cloneDeep3.js +1 -1
- 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 +20 -0
- 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/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/FilterChipSelectInput.web.js +20 -12
- 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 +15 -1
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js.map +1 -1
- 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/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/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/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 +9 -2
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- 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 +4 -0
- 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/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 +20 -0
- 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/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/FilterChipSelectInput.web.js +20 -12
- 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 +15 -1
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js.map +1 -1
- 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/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/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/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 +9 -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 +4 -0
- 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 +557 -18
- package/build/types/components/index.native.d.ts +463 -16
- 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
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
5
5
|
|
|
6
|
-
var _excluded=["formatter"];dayjs.extend(customParseFormat);var dayjs_locales=['af','ar','ar-dz','ar-kw','ar-ly','ar-ma','ar-sa','ar-tn','az','be','bg','bm','bn','bo','br','bs','ca','cs','cv','cy','da','de','de-at','de-ch','dv','el','en','en-au','en-ca','en-gb','en-ie','en-il','en-nz','en-SG','eo','es','es-do','es-us','et','eu','fa','fi','fo','fr','fr-ca','fr-ch','fy','ga','gd','gl','gom-latn','gu','he','hi','hr','hu','hy-am','id','is','it','it-ch','ja','jv','ka','kk','km','kn','ko','ku','ky','lb','lo','lt','lv','me','mi','mk','ml','mn','mr','ms','ms-my','mt','my','nb','ne','nl','nl-be','nn','oc-lnc','pa-in','pl','pt','pt-br','ro','ru','sd','se','si','sk','sl','sq','sr','sr-cyrl','ss','sv','sw','ta','te','tet','tg','th','tl-ph','tlh','tr','tzl','tzm','tzm-latn','ug-cn','uk','ur','uz','uz-latn','vi','x-pseudo','yo','zh-cn','zh-hk','zh-tw'];var MONTH_NAMES=['January','February','March','April','May','June','July','August','September','October','November','December'];function patchLocale(locale){if(['en','en-us'].includes(locale))return 'en';if(locale==='zn')return 'zh-cn';if(locale==='no')return 'nb';if(dayjs_locales.includes(locale))return locale;return false;}function convertIntlToDayjsLocale(lang){lang=lang.toLowerCase();var locale=patchLocale(lang)||lang.includes('-')&&patchLocale(lang.split('-')[0]);if(!locale)return 'en';return `${locale}`;}function isScriptLoaded(src){return Boolean(document.querySelector(`script[src="${src}"]`));}function loadScript(src,callback){if(isScriptLoaded(src)){callback==null?void 0:callback();return;}var localeScript=document.createElement('script');localeScript.async=true;localeScript.src=src;localeScript.onload=function(){return callback==null?void 0:callback();};document.head.appendChild(localeScript);}function defaultDateFormatter(_ref){var type=_ref.type,date=_ref.date,locale=_ref.locale,format=_ref.format,labelSeparator=_ref.labelSeparator;var formatDate=function formatDate(value){return dayjs(value).locale(locale).format(format);};if(type==='default'){return date===null?'':formatDate(date);}if(type==='range'&&Array.isArray(date)){if(date[0]&&date[1]){return `${formatDate(date[0])} ${labelSeparator} ${formatDate(date[1])}`;}if(date[0]){return `${formatDate(date[0])} ${labelSeparator} `;}return '';}return '';}function getFormattedDate(_ref2){var formatter=_ref2.formatter,others=_objectWithoutProperties(_ref2,_excluded);return (formatter||defaultDateFormatter)(others);}var rangeFormattedValue=function rangeFormattedValue(startValue,endValue){if(startValue&&endValue){if(startValue===endValue){return startValue;}return `${startValue} – ${endValue}`;}if(startValue){return `${startValue} – `;}if(endValue){return ` – ${endValue}`;}return '';};var rangeInputPlaceHolder=function rangeInputPlaceHolder(placeholder,format){if(placeholder){return `${placeholder} – ${placeholder}`;}return `${format} – ${format}`;};var finalInputFormat=function finalInputFormat(startValue,endValue,format){if(startValue===endValue&&(startValue||endValue)){return format;}return `${format} – ${format}`;};var getTextInputFormat=function getTextInputFormat(formatStr,isRangeInput){if(!formatStr){return isRangeInput?'##/##/#### – ##/##/####':'##/##/####';}else if(formatStr==='MMMM'){return formatStr.replace(/MMMM/g,'#########');}return formatStr.replace(/[YMD]/g,'#');};var validateDateComponents=function validateDateComponents(dateStr){if(!(dateStr!=null&&dateStr.trim())){return {isValid:true};}var parsed=dayjs(dateStr,'DD/MM/YYYY',true);if(!parsed.isValid()){return {isValid:false,error:'Please enter a valid date'};}var year=parsed.year();if(year<1000||year>3000){return {isValid:false,error:'Year must be between 1000 and 3000'};}return {isValid:true,parsedDate:parsed.toDate()};};var parseSpecialSingleFormat=function parseSpecialSingleFormat(inputValue,format){if(!format)return {isSpecialFormat:false,shouldBlock:false};var trimmedInput=inputValue.trim();var today=new Date();if(format==='YYYY'&&/^\d{4}$/.test(trimmedInput)){var year=parseInt(trimmedInput,10);if(year>=1000&&year<=3000){return {isSpecialFormat:true,parsedDate:new Date(year,today.getMonth(),today.getDate()),shouldBlock:false};}else {return {isSpecialFormat:true,shouldBlock:true};}}if((format==='MMM'||format==='MMMM')&&trimmedInput.length>=3){var monthDate=dayjs(trimmedInput,format==='MMM'?'MMM':'MMMM',true);if(!monthDate.isValid()){return {isSpecialFormat:true,shouldBlock:true};}return {isSpecialFormat:true,parsedDate:new Date(today.getFullYear(),monthDate.month(),today.getDate()),shouldBlock:false};}return {isSpecialFormat:false,shouldBlock:false};};var validateAndParseDateInput=function validateAndParseDateInput(inputValue,isRange,format,options){if(!(inputValue!=null&&inputValue.trim()))return {shouldBlock:false};if(!isRange&&format){var specialParse=parseSpecialSingleFormat(inputValue,format);if(specialParse.isSpecialFormat&&!specialParse.shouldBlock){return {shouldBlock:false,parsedValue:specialParse.parsedDate||null};}else if(specialParse.shouldBlock){return {shouldBlock:true,error:'Please enter a valid date'};}}if(isRange){var _parts$,_parts$2,_parts$5,_parts$6;var parts=inputValue.split(/\s*–\s*/);if((_parts$=parts[0])!=null&&_parts$.trim()&&parts[0].trim().length<10||(_parts$2=parts[1])!=null&&_parts$2.trim()&&parts[1].trim().length<10){var _parts$3,_parts$4;if((_parts$3=parts[0])!=null&&_parts$3.trim()){var startPartialValidation=validatePartialDateSimple(parts[0].trim());if(!startPartialValidation.isValid){return {shouldBlock:true,error:`Start date: ${startPartialValidation.error}`};}}if((_parts$4=parts[1])!=null&&_parts$4.trim()){var endPartialValidation=validatePartialDateSimple(parts[1].trim());if(!endPartialValidation.isValid){return {shouldBlock:true,error:`End date: ${endPartialValidation.error}`};}}return {shouldBlock:false};}var startDate=null;var endDate=null;if((_parts$5=parts[0])!=null&&_parts$5.trim()&&parts[0].trim().length>=10){var startValidation=validateDateComponents(parts[0].trim());if(!startValidation.isValid){return {shouldBlock:true,error:`Start date: ${startValidation.error}`};}startDate=startValidation.parsedDate||null;}if((_parts$6=parts[1])!=null&&_parts$6.trim()&&parts[1].trim().length>=10){var endValidation=validateDateComponents(parts[1].trim());if(!endValidation.isValid){return {shouldBlock:true,error:`End date: ${endValidation.error}`};}endDate=endValidation.parsedDate||null;}if(startDate&&endDate&&startDate>endDate){return {shouldBlock:true,error:'Start date cannot be greater than end date'};}if(options){if(startDate&&options.minDate&&dayjs(startDate).isBefore(dayjs(options.minDate))){return {shouldBlock:true,error:'Start date is before the minimum allowed date'};}if(startDate&&options.maxDate&&dayjs(startDate).isAfter(dayjs(options.maxDate))){return {shouldBlock:true,error:'Start date is after the maximum allowed date'};}if(endDate&&options.minDate&&dayjs(endDate).isBefore(dayjs(options.minDate))){return {shouldBlock:true,error:'End date is before the minimum allowed date'};}if(endDate&&options.maxDate&&dayjs(endDate).isAfter(dayjs(options.maxDate))){return {shouldBlock:true,error:'End date is after the maximum allowed date'};}}return {shouldBlock:false,parsedValue:[startDate,endDate]};}else if(inputValue.length>=10){var validation=validateDateComponents(inputValue);if(!validation.isValid){return {shouldBlock:true,error:validation.error};}var parsedDate=validation.parsedDate;if(options&&parsedDate){if(options.excludeDate!=null&&options.excludeDate(parsedDate)){return {shouldBlock:true,error:'This date is not available for selection'};}if(options.minDate&&dayjs(parsedDate).isBefore(dayjs(options.minDate))){return {shouldBlock:true,error:'Date is before the minimum allowed date'};}if(options.maxDate&&dayjs(parsedDate).isAfter(dayjs(options.maxDate))){return {shouldBlock:true,error:'Date is after the maximum allowed date'};}}return {shouldBlock:false,parsedValue:parsedDate||null};}else {var partialValidation=validatePartialDateSimple(inputValue);if(!partialValidation.isValid){return {shouldBlock:true,error:partialValidation.error};}return {shouldBlock:false};}return {shouldBlock:false};};function validatePartialDateSimple(input){var _parts$7,_parts$8;if(!(input!=null&&input.trim())){return {isValid:true};}var parts=input.split('/');if(((_parts$7=parts[0])==null?void 0:_parts$7.length)>=2){var dayStr=parts[0].trim();if(dayStr.length>0){var day=parseInt(dayStr,10);if(isNaN(day)){return {isValid:false,error:'Please enter a valid day (01-31)'};}if(day>31){return {isValid:false,error:'Day cannot be greater than 31'};}if(day===0){return {isValid:false,error:'Day cannot be 00, please enter 01-31'};}}}if(((_parts$8=parts[1])==null?void 0:_parts$8.length)>=2){var monthStr=parts[1].trim();if(monthStr.length>0){var _parts$9;var month=parseInt(monthStr,10);if(isNaN(month)){return {isValid:false,error:'Please enter a valid month (01-12)'};}if(month>12){return {isValid:false,error:'Month cannot be greater than 12'};}if(month===0){return {isValid:false,error:'Month cannot be 00, please enter 01-12'};}var _day=(_parts$9=parts[0])!=null&&_parts$9.trim()?parseInt(parts[0].trim(),10):NaN;if(!isNaN(_day)){if(month===2&&_day>29){return {isValid:false,error:'February cannot have more than 29 days'};}if([4,6,9,11].includes(month)&&_day>30){return {isValid:false,error:`${MONTH_NAMES[month-1]} cannot have more than 30 days`};}}}}return {isValid:true};}var stripDelimiters=function stripDelimiters(str){var _str$replace;return (_str$replace=str==null?void 0:str.replace(/\//g,''))!=null?_str$replace:'';};var getHumanizedDate=function getHumanizedDate(_ref3){var date=_ref3.date,locale=_ref3.locale,selectionType=_ref3.selectionType;if(!date)return '';var withYear=function withYear(value){return dayjs(value).locale(locale).format('D MMM YYYY');};var withoutYear=function withoutYear(value){return dayjs(value).locale(locale).format('D MMM');};var dayOnly=function dayOnly(value){return dayjs(value).locale(locale).format('D');};var monthYear=function monthYear(value){return dayjs(value).locale(locale).format('MMM YYYY');};if(selectionType==='single'&&date instanceof Date){return withYear(date);}if(Array.isArray(date)){var _date=_slicedToArray(date,2),startDate=_date[0],endDate=_date[1];if(startDate&&endDate){var start=dayjs(startDate);var end=dayjs(endDate);var isSameYear=start.year()===end.year();var isSameMonth=isSameYear&&start.month()===end.month();if(isSameMonth){return `${dayOnly(startDate)}-${dayOnly(endDate)} ${monthYear(endDate)}`;}return `${isSameYear?withoutYear(startDate):withYear(startDate)} - ${withYear(endDate)}`;}if(startDate){return withYear(startDate);}}return '';};
|
|
6
|
+
var _excluded=["formatter"];dayjs.extend(customParseFormat);var dayjs_locales=['af','ar','ar-dz','ar-kw','ar-ly','ar-ma','ar-sa','ar-tn','az','be','bg','bm','bn','bo','br','bs','ca','cs','cv','cy','da','de','de-at','de-ch','dv','el','en','en-au','en-ca','en-gb','en-ie','en-il','en-nz','en-SG','eo','es','es-do','es-us','et','eu','fa','fi','fo','fr','fr-ca','fr-ch','fy','ga','gd','gl','gom-latn','gu','he','hi','hr','hu','hy-am','id','is','it','it-ch','ja','jv','ka','kk','km','kn','ko','ku','ky','lb','lo','lt','lv','me','mi','mk','ml','mn','mr','ms','ms-my','mt','my','nb','ne','nl','nl-be','nn','oc-lnc','pa-in','pl','pt','pt-br','ro','ru','sd','se','si','sk','sl','sq','sr','sr-cyrl','ss','sv','sw','ta','te','tet','tg','th','tl-ph','tlh','tr','tzl','tzm','tzm-latn','ug-cn','uk','ur','uz','uz-latn','vi','x-pseudo','yo','zh-cn','zh-hk','zh-tw'];var MONTH_NAMES=['January','February','March','April','May','June','July','August','September','October','November','December'];function patchLocale(locale){if(['en','en-us'].includes(locale))return 'en';if(locale==='zn')return 'zh-cn';if(locale==='no')return 'nb';if(dayjs_locales.includes(locale))return locale;return false;}function convertIntlToDayjsLocale(lang){lang=lang.toLowerCase();var locale=patchLocale(lang)||lang.includes('-')&&patchLocale(lang.split('-')[0]);if(!locale)return 'en';return `${locale}`;}function isScriptLoaded(src){return Boolean(document.querySelector(`script[src="${src}"]`));}function loadScript(src,callback){if(isScriptLoaded(src)){callback==null?void 0:callback();return;}var localeScript=document.createElement('script');localeScript.async=true;localeScript.src=src;localeScript.onload=function(){return callback==null?void 0:callback();};document.head.appendChild(localeScript);}function defaultDateFormatter(_ref){var type=_ref.type,date=_ref.date,locale=_ref.locale,format=_ref.format,labelSeparator=_ref.labelSeparator;var formatDate=function formatDate(value){return dayjs(value).locale(locale).format(format);};if(type==='default'){return date===null?'':formatDate(date);}if(type==='range'&&Array.isArray(date)){if(date[0]&&date[1]){return `${formatDate(date[0])} ${labelSeparator} ${formatDate(date[1])}`;}if(date[0]){return `${formatDate(date[0])} ${labelSeparator} `;}return '';}return '';}function getFormattedDate(_ref2){var formatter=_ref2.formatter,others=_objectWithoutProperties(_ref2,_excluded);return (formatter||defaultDateFormatter)(others);}var rangeFormattedValue=function rangeFormattedValue(startValue,endValue){if(startValue&&endValue){if(startValue===endValue){return startValue;}return `${startValue} – ${endValue}`;}if(startValue){return `${startValue} – `;}if(endValue){return ` – ${endValue}`;}return '';};var rangeInputPlaceHolder=function rangeInputPlaceHolder(placeholder,format){if(placeholder){return `${placeholder} – ${placeholder}`;}return `${format} – ${format}`;};var finalInputFormat=function finalInputFormat(startValue,endValue,format){if(startValue===endValue&&(startValue||endValue)){return format;}return `${format} – ${format}`;};var getTextInputFormat=function getTextInputFormat(formatStr,isRangeInput){if(!formatStr){return isRangeInput?'##/##/#### – ##/##/####':'##/##/####';}else if(formatStr==='MMMM'){return formatStr.replace(/MMMM/g,'#########');}return formatStr.replace(/[YMD]/g,'#');};var validateDateComponents=function validateDateComponents(dateStr){if(!(dateStr!=null&&dateStr.trim())){return {isValid:true};}var parsed=dayjs(dateStr,'DD/MM/YYYY',true);if(!parsed.isValid()){return {isValid:false,error:'Please enter a valid date'};}var year=parsed.year();if(year<1000||year>3000){return {isValid:false,error:'Year must be between 1000 and 3000'};}return {isValid:true,parsedDate:parsed.toDate()};};var parseSpecialSingleFormat=function parseSpecialSingleFormat(inputValue,format){if(!format)return {isSpecialFormat:false,shouldBlock:false};var trimmedInput=inputValue.trim();var today=new Date();if(format==='YYYY'&&/^\d{4}$/.test(trimmedInput)){var year=parseInt(trimmedInput,10);if(year>=1000&&year<=3000){return {isSpecialFormat:true,parsedDate:new Date(year,today.getMonth(),today.getDate()),shouldBlock:false};}else {return {isSpecialFormat:true,shouldBlock:true};}}if((format==='MMM'||format==='MMMM')&&trimmedInput.length>=3){var monthDate=dayjs(trimmedInput,format==='MMM'?'MMM':'MMMM',true);if(!monthDate.isValid()){return {isSpecialFormat:true,shouldBlock:true};}return {isSpecialFormat:true,parsedDate:new Date(today.getFullYear(),monthDate.month(),today.getDate()),shouldBlock:false};}return {isSpecialFormat:false,shouldBlock:false};};var validateAndParseDateInput=function validateAndParseDateInput(inputValue,isRange,format,options){if(!(inputValue!=null&&inputValue.trim()))return {shouldBlock:false};if(!isRange&&format){var specialParse=parseSpecialSingleFormat(inputValue,format);if(specialParse.isSpecialFormat&&!specialParse.shouldBlock){return {shouldBlock:false,parsedValue:specialParse.parsedDate||null};}else if(specialParse.shouldBlock){return {shouldBlock:true,error:'Please enter a valid date'};}}if(isRange){var _parts$,_parts$2,_parts$5,_parts$6;var parts=inputValue.split(/\s*–\s*/);if((_parts$=parts[0])!=null&&_parts$.trim()&&parts[0].trim().length<10||(_parts$2=parts[1])!=null&&_parts$2.trim()&&parts[1].trim().length<10){var _parts$3,_parts$4;if((_parts$3=parts[0])!=null&&_parts$3.trim()){var startPartialValidation=validatePartialDateSimple(parts[0].trim());if(!startPartialValidation.isValid){return {shouldBlock:true,error:`Start date: ${startPartialValidation.error}`};}}if((_parts$4=parts[1])!=null&&_parts$4.trim()){var endPartialValidation=validatePartialDateSimple(parts[1].trim());if(!endPartialValidation.isValid){return {shouldBlock:true,error:`End date: ${endPartialValidation.error}`};}}return {shouldBlock:false};}var startDate=null;var endDate=null;if((_parts$5=parts[0])!=null&&_parts$5.trim()&&parts[0].trim().length>=10){var startValidation=validateDateComponents(parts[0].trim());if(!startValidation.isValid){return {shouldBlock:true,error:`Start date: ${startValidation.error}`};}startDate=startValidation.parsedDate||null;}if((_parts$6=parts[1])!=null&&_parts$6.trim()&&parts[1].trim().length>=10){var endValidation=validateDateComponents(parts[1].trim());if(!endValidation.isValid){return {shouldBlock:true,error:`End date: ${endValidation.error}`};}endDate=endValidation.parsedDate||null;}if(startDate&&endDate&&startDate>endDate){return {shouldBlock:true,error:'Start date cannot be greater than end date'};}if(options){if(startDate&&options.minDate&&dayjs(startDate).isBefore(dayjs(options.minDate))){return {shouldBlock:true,error:'Start date is before the minimum allowed date'};}if(startDate&&options.maxDate&&dayjs(startDate).isAfter(dayjs(options.maxDate))){return {shouldBlock:true,error:'Start date is after the maximum allowed date'};}if(endDate&&options.minDate&&dayjs(endDate).isBefore(dayjs(options.minDate))){return {shouldBlock:true,error:'End date is before the minimum allowed date'};}if(endDate&&options.maxDate&&dayjs(endDate).isAfter(dayjs(options.maxDate))){return {shouldBlock:true,error:'End date is after the maximum allowed date'};}}return {shouldBlock:false,parsedValue:[startDate,endDate]};}else if(inputValue.length>=10){var validation=validateDateComponents(inputValue);if(!validation.isValid){return {shouldBlock:true,error:validation.error};}var parsedDate=validation.parsedDate;if(options&&parsedDate){if(options.excludeDate!=null&&options.excludeDate(parsedDate)){return {shouldBlock:true,error:'This date is not available for selection'};}if(options.minDate&&dayjs(parsedDate).isBefore(dayjs(options.minDate))){return {shouldBlock:true,error:'Date is before the minimum allowed date'};}if(options.maxDate&&dayjs(parsedDate).isAfter(dayjs(options.maxDate))){return {shouldBlock:true,error:'Date is after the maximum allowed date'};}}return {shouldBlock:false,parsedValue:parsedDate||null};}else {var partialValidation=validatePartialDateSimple(inputValue);if(!partialValidation.isValid){return {shouldBlock:true,error:partialValidation.error};}return {shouldBlock:false};}return {shouldBlock:false};};function validatePartialDateSimple(input){var _parts$7,_parts$8;if(!(input!=null&&input.trim())){return {isValid:true};}var parts=input.split('/');if(((_parts$7=parts[0])==null?void 0:_parts$7.length)>=2){var dayStr=parts[0].trim();if(dayStr.length>0){var day=parseInt(dayStr,10);if(isNaN(day)){return {isValid:false,error:'Please enter a valid day (01-31)'};}if(day>31){return {isValid:false,error:'Day cannot be greater than 31'};}if(day===0){return {isValid:false,error:'Day cannot be 00, please enter 01-31'};}}}if(((_parts$8=parts[1])==null?void 0:_parts$8.length)>=2){var monthStr=parts[1].trim();if(monthStr.length>0){var _parts$9;var month=parseInt(monthStr,10);if(isNaN(month)){return {isValid:false,error:'Please enter a valid month (01-12)'};}if(month>12){return {isValid:false,error:'Month cannot be greater than 12'};}if(month===0){return {isValid:false,error:'Month cannot be 00, please enter 01-12'};}var _day=(_parts$9=parts[0])!=null&&_parts$9.trim()?parseInt(parts[0].trim(),10):NaN;if(!isNaN(_day)){if(month===2&&_day>29){return {isValid:false,error:'February cannot have more than 29 days'};}if([4,6,9,11].includes(month)&&_day>30){return {isValid:false,error:`${MONTH_NAMES[month-1]} cannot have more than 30 days`};}}}}return {isValid:true};}var stripDelimiters=function stripDelimiters(str){var _str$replace;return (_str$replace=str==null?void 0:str.replace(/\//g,''))!=null?_str$replace:'';};var getHumanizedDate=function getHumanizedDate(_ref3){var date=_ref3.date,locale=_ref3.locale,selectionType=_ref3.selectionType;if(!date)return '';var withYear=function withYear(value){return dayjs(value).locale(locale).format('D MMM YYYY');};var withoutYear=function withoutYear(value){return dayjs(value).locale(locale).format('D MMM');};var dayOnly=function dayOnly(value){return dayjs(value).locale(locale).format('D');};var monthYear=function monthYear(value){return dayjs(value).locale(locale).format('MMM YYYY');};if(selectionType==='single'&&date instanceof Date){return withYear(date);}if(Array.isArray(date)){var _date=_slicedToArray(date,2),startDate=_date[0],endDate=_date[1];if(startDate&&endDate){var start=dayjs(startDate);var end=dayjs(endDate);var isSameYear=start.year()===end.year();var isSameMonth=isSameYear&&start.month()===end.month();if(isSameMonth){return `${dayOnly(startDate)}-${dayOnly(endDate)} ${monthYear(endDate)}`;}return `${isSameYear?withoutYear(startDate):withYear(startDate)} - ${withYear(endDate)}`;}if(startDate){return withYear(startDate);}}return '';};var clampDateToRange=function clampDateToRange(_ref4){var date=_ref4.date,minDate=_ref4.minDate,maxDate=_ref4.maxDate;if(maxDate&&dayjs(date).isAfter(dayjs(maxDate),'day')){return maxDate;}if(minDate&&dayjs(date).isBefore(dayjs(minDate),'day')){return minDate;}return date;};
|
|
7
7
|
|
|
8
|
-
export { convertIntlToDayjsLocale, finalInputFormat, getFormattedDate, getHumanizedDate, getTextInputFormat, loadScript, rangeFormattedValue, rangeInputPlaceHolder, stripDelimiters, validateAndParseDateInput, validateDateComponents, validatePartialDateSimple };
|
|
8
|
+
export { clampDateToRange, convertIntlToDayjsLocale, finalInputFormat, getFormattedDate, getHumanizedDate, getTextInputFormat, loadScript, rangeFormattedValue, rangeInputPlaceHolder, stripDelimiters, validateAndParseDateInput, validateDateComponents, validatePartialDateSimple };
|
|
9
9
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../src/components/DatePicker/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { DatePickerType, DatePickerValue } from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\ndayjs.extend(customParseFormat);\n\nconst dayjs_locales = [\n 'af',\n 'ar',\n 'ar-dz',\n 'ar-kw',\n 'ar-ly',\n 'ar-ma',\n 'ar-sa',\n 'ar-tn',\n 'az',\n 'be',\n 'bg',\n 'bm',\n 'bn',\n 'bo',\n 'br',\n 'bs',\n 'ca',\n 'cs',\n 'cv',\n 'cy',\n 'da',\n 'de',\n 'de-at',\n 'de-ch',\n 'dv',\n 'el',\n 'en',\n 'en-au',\n 'en-ca',\n 'en-gb',\n 'en-ie',\n 'en-il',\n 'en-nz',\n 'en-SG',\n 'eo',\n 'es',\n 'es-do',\n 'es-us',\n 'et',\n 'eu',\n 'fa',\n 'fi',\n 'fo',\n 'fr',\n 'fr-ca',\n 'fr-ch',\n 'fy',\n 'ga',\n 'gd',\n 'gl',\n 'gom-latn',\n 'gu',\n 'he',\n 'hi',\n 'hr',\n 'hu',\n 'hy-am',\n 'id',\n 'is',\n 'it',\n 'it-ch',\n 'ja',\n 'jv',\n 'ka',\n 'kk',\n 'km',\n 'kn',\n 'ko',\n 'ku',\n 'ky',\n 'lb',\n 'lo',\n 'lt',\n 'lv',\n 'me',\n 'mi',\n 'mk',\n 'ml',\n 'mn',\n 'mr',\n 'ms',\n 'ms-my',\n 'mt',\n 'my',\n 'nb',\n 'ne',\n 'nl',\n 'nl-be',\n 'nn',\n 'oc-lnc',\n 'pa-in',\n 'pl',\n 'pt',\n 'pt-br',\n 'ro',\n 'ru',\n 'sd',\n 'se',\n 'si',\n 'sk',\n 'sl',\n 'sq',\n 'sr',\n 'sr-cyrl',\n 'ss',\n 'sv',\n 'sw',\n 'ta',\n 'te',\n 'tet',\n 'tg',\n 'th',\n 'tl-ph',\n 'tlh',\n 'tr',\n 'tzl',\n 'tzm',\n 'tzm-latn',\n 'ug-cn',\n 'uk',\n 'ur',\n 'uz',\n 'uz-latn',\n 'vi',\n 'x-pseudo',\n 'yo',\n 'zh-cn',\n 'zh-hk',\n 'zh-tw',\n];\n\nconst MONTH_NAMES = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\n// https://github.com/iamkun/dayjs/issues/732#issuecomment-554383261\nfunction patchLocale(locale: string): string | boolean {\n if (['en', 'en-us'].includes(locale)) return 'en';\n if (locale === 'zn') return 'zh-cn';\n if (locale === 'no') return 'nb';\n if (dayjs_locales.includes(locale)) return locale;\n return false;\n}\n\nfunction convertIntlToDayjsLocale(lang: string): string {\n lang = lang.toLowerCase();\n const locale = patchLocale(lang) || (lang.includes('-') && patchLocale(lang.split('-')[0]));\n if (!locale) return 'en';\n\n return `${locale}`;\n}\n\nfunction isScriptLoaded(src: string): boolean {\n return Boolean(document.querySelector(`script[src=\"${src}\"]`));\n}\n\n/**\n * Used to dynamically load a script\n */\nfunction loadScript(src: string, callback?: () => void): void {\n if (isScriptLoaded(src)) {\n callback?.();\n return;\n }\n const localeScript = document.createElement('script');\n localeScript.async = true;\n localeScript.src = src;\n localeScript.onload = () => callback?.();\n document.head.appendChild(localeScript);\n}\n\ninterface DateFormatterInput {\n type: DatePickerType;\n date: DatePickerValue<DatePickerType>;\n locale: string;\n format: string;\n labelSeparator: string;\n}\n\ntype DateFormatter = (input: DateFormatterInput) => string;\n\nfunction defaultDateFormatter({ type, date, locale, format, labelSeparator }: DateFormatterInput) {\n const formatDate = (value: Date) => dayjs(value).locale(locale).format(format);\n\n if (type === 'default') {\n return date === null ? '' : formatDate(date as Date);\n }\n\n if (type === 'range' && Array.isArray(date)) {\n if (date[0] && date[1]) {\n return `${formatDate(date[0])} ${labelSeparator} ${formatDate(date[1])}`;\n }\n\n if (date[0]) {\n return `${formatDate(date[0])} ${labelSeparator} `;\n }\n\n return '';\n }\n\n return '';\n}\n\ninterface GetFormattedDateInput extends DateFormatterInput {\n formatter?: DateFormatter;\n}\n\nfunction getFormattedDate({ formatter, ...others }: GetFormattedDateInput) {\n return (formatter || defaultDateFormatter)(others);\n}\n\nconst rangeFormattedValue = (startValue: string, endValue: string) => {\n // Both values exist\n if (startValue && endValue) {\n if (startValue === endValue) {\n return startValue; // Same date, show single value\n }\n return `${startValue} – ${endValue}`; // Different dates, show range\n }\n\n // Only start value exists\n if (startValue) {\n return `${startValue} – `;\n }\n\n // Only end value exists\n if (endValue) {\n return ` – ${endValue}`;\n }\n\n // No values\n return '';\n};\n\nconst rangeInputPlaceHolder = (placeholder: string | undefined, format: string) => {\n if (placeholder) {\n return `${placeholder} – ${placeholder}`;\n }\n return `${format} – ${format}`;\n};\n\nconst finalInputFormat = (startValue: string, endValue: string, format: string | undefined) => {\n // For case: when start and end are the same, return the format\n if (startValue === endValue && (startValue || endValue)) {\n return format;\n }\n return `${format} – ${format}`;\n};\n\n/**\n * Converts date format string to TextInput pattern for masking.\n * TextInput format only recognizes # as input placeholder, so we replace\n * date characters (Y,M,D) with # while preserving delimiters.\n *\n * @example \"DD/MM/YYYY\" – \"##/##/####\"\n * @example \"MMMM\" – \"################\" (longest month: \"September\")\n * @example \"MMM\" – \"###\"\n */\nconst getTextInputFormat = (formatStr?: string, isRangeInput?: boolean): string => {\n if (!formatStr) {\n return isRangeInput ? '##/##/#### – ##/##/####' : '##/##/####';\n } else if (formatStr === 'MMMM') {\n return formatStr.replace(/MMMM/g, '#########');\n }\n return formatStr.replace(/[YMD]/g, '#');\n};\n\n/**\n * Validates date string using DayJS strict parsing and business rules\n *\n * @param dateStr - The date string to validate in DD/MM/YYYY format\n * @returns Object with validation result, error message if invalid, and parsed Date if valid\n *\n * @example\n * // Valid date\n * validateDateComponents(\"25/12/2024\")\n * // → { isValid: true, parsedDate: Date(2024, 11, 25) }\n *\n * @example\n * // Invalid date (non-existent)\n * validateDateComponents(\"31/02/2024\")\n * // → { isValid: false, error: \"Please enter a valid date\" }\n *\n * @example\n * // Invalid year range\n * validateDateComponents(\"25/12/999\")\n * // → { isValid: false, error: \"Year must be between 1000 and 3000\" }\n *\n * @example\n * // Empty input\n * validateDateComponents(\"\")\n * // → { isValid: true }\n */\nconst validateDateComponents = (\n dateStr: string,\n): {\n isValid: boolean;\n error?: string;\n parsedDate?: Date;\n} => {\n // Empty strings are considered valid (user hasn't started typing)\n if (!dateStr?.trim()) {\n return { isValid: true };\n }\n\n // Use DayJS strict parsing to validate DD/MM/YYYY format and date existence\n const parsed = dayjs(dateStr, 'DD/MM/YYYY', true);\n\n // DayJS strict mode catches invalid days/months and non-existent dates (e.g., Feb 30th)\n if (!parsed.isValid()) {\n return { isValid: false, error: 'Please enter a valid date' };\n }\n\n // Business rule: restrict year range to reasonable values for most applications\n const year = parsed.year();\n if (year < 1000 || year > 3000) {\n return { isValid: false, error: 'Year must be between 1000 and 3000' };\n }\n\n // Return both validation result AND parsed date to avoid double parsing\n return { isValid: true, parsedDate: parsed.toDate() };\n};\n\n/**\n * Detects and parses special single date formats (MMM, MMMM, YYYY)\n * These formats preserve current date/month/year and only change the specified component\n *\n * @param inputValue - The input string to parse\n * @param format - The expected format ('MMM', 'MMMM', or 'YYYY')\n * @returns Object with special format detection, parsed date, and validation result\n *\n * @example\n * // Year format - preserves current month/day, changes year\n * parseSpecialSingleFormat(\"2024\", \"YYYY\")\n * // → { isSpecialFormat: true, parsedDate: Date(2024, currentMonth, currentDay), shouldBlock: false }\n *\n * @example\n * // Short month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"Aug\", \"MMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Full month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"August\", \"MMMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Invalid year\n * parseSpecialSingleFormat(\"999\", \"YYYY\")\n * // → { isSpecialFormat: true, shouldBlock: true }\n *\n * @example\n * // Not a special format\n * parseSpecialSingleFormat(\"25/12/2024\", \"DD/MM/YYYY\")\n * // → { isSpecialFormat: false, shouldBlock: false }\n */\nconst parseSpecialSingleFormat = (\n inputValue: string,\n format?: string,\n): { isSpecialFormat: boolean; parsedDate?: Date; shouldBlock: boolean } => {\n if (!format) return { isSpecialFormat: false, shouldBlock: false };\n\n const trimmedInput = inputValue.trim();\n const today = new Date();\n\n // Handle year-only format (YYYY) - keep current month and day, change year\n if (format === 'YYYY' && /^\\d{4}$/.test(trimmedInput)) {\n const year = parseInt(trimmedInput, 10);\n if (year >= 1000 && year <= 3000) {\n return {\n isSpecialFormat: true,\n parsedDate: new Date(year, today.getMonth(), today.getDate()),\n shouldBlock: false,\n };\n } else {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n }\n\n // Handle month formats (MMM, MMMM) - keep current day and year, change month\n if ((format === 'MMM' || format === 'MMMM') && trimmedInput.length >= 3) {\n // Using DayJS to parse month names (handles both short \"Aug\" and full \"August\")\n const monthDate = dayjs(trimmedInput, format === 'MMM' ? 'MMM' : 'MMMM', true);\n\n if (!monthDate.isValid()) {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n return {\n isSpecialFormat: true,\n parsedDate: new Date(today.getFullYear(), monthDate.month(), today.getDate()),\n shouldBlock: false,\n };\n }\n\n return { isSpecialFormat: false, shouldBlock: false };\n};\n\n/**\n * Validates and parses date input with comprehensive error handling and constraint checking\n * Combines validation + parsing to avoid redundant operations and supports both single dates and ranges\n *\n * @param inputValue - The input string to validate and parse\n * @param isRange - Whether this is a range input (true) or single date (false)\n * @param format - The expected date format ('DD/MM/YYYY', 'MMM', 'MMMM', 'YYYY')\n * @param options - Additional validation constraints\n * @param options.excludeDate - Function to exclude specific dates (single dates only)\n * @param options.minDate - Minimum allowed date\n * @param options.maxDate - Maximum allowed date\n * @returns Object with shouldBlock flag, optional error message, and parsed values if valid\n *\n * @example\n * // Valid single date\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, 11, 25) }\n *\n * @example\n * // Valid range input\n * validateAndParseDateInput(\"25/12/2024 – 31/12/2024\", true, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: [Date(2024, 11, 25), Date(2024, 11, 31)] }\n *\n * @example\n * // Invalid date with error\n * validateAndParseDateInput(\"31/02/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: true, error: \"Please enter a valid date in DD/MM/YYYY format\" }\n *\n * @example\n * // Date excluded by constraint\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\", {\n * excludeDate: (date) => date.getDay() === 0 // No Sundays\n * })\n * // → { shouldBlock: true, error: \"This date is not available for selection\" }\n *\n * @example\n * // Special format - year only\n * validateAndParseDateInput(\"2024\", false, \"YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, currentMonth, currentDay) }\n *\n * @example\n * // Incomplete input - allow continued typing\n * validateAndParseDateInput(\"25/12\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false } (no parsedValue, allows user to continue typing)\n */\nconst validateAndParseDateInput = (\n inputValue: string,\n isRange: boolean,\n format?: string,\n options?: {\n excludeDate?: (date: Date) => boolean;\n minDate?: Date;\n maxDate?: Date;\n },\n): {\n shouldBlock: boolean;\n error?: string;\n parsedValue?: Date | null | [Date | null, Date | null];\n} => {\n // Allow empty input - user hasn't started typing yet\n if (!inputValue?.trim()) return { shouldBlock: false };\n\n // Handle special single date formats (MMM, MMMM, YYYY) - skip normal validation\n if (!isRange && format) {\n const specialParse = parseSpecialSingleFormat(inputValue, format);\n if (specialParse.isSpecialFormat && !specialParse.shouldBlock) {\n return { shouldBlock: false, parsedValue: specialParse.parsedDate || null };\n } else if (specialParse.shouldBlock) {\n return { shouldBlock: true, error: 'Please enter a valid date' };\n }\n }\n\n if (isRange) {\n // Split range input on en dash separator (e.g., \"25/12/2024 – 31/12/2024\")\n const parts = inputValue.split(/\\s*–\\s*/);\n\n // Enhanced: Block incomplete input with partial validation\n if (\n (parts[0]?.trim() && parts[0].trim().length < 10) ||\n (parts[1]?.trim() && parts[1].trim().length < 10)\n ) {\n // Check start date part if it exists and has content\n if (parts[0]?.trim()) {\n const startPartialValidation = validatePartialDateSimple(parts[0].trim());\n if (!startPartialValidation.isValid) {\n return { shouldBlock: true, error: `Start date: ${startPartialValidation.error}` };\n }\n }\n\n // Check end date part if it exists and has content\n if (parts[1]?.trim()) {\n const endPartialValidation = validatePartialDateSimple(parts[1].trim());\n if (!endPartialValidation.isValid) {\n return { shouldBlock: true, error: `End date: ${endPartialValidation.error}` };\n }\n }\n\n // If partial validation passes, allow continued typing\n return { shouldBlock: false };\n }\n\n let startDate: Date | null = null;\n let endDate: Date | null = null;\n\n // Validate and parse start date if it looks complete (10+ chars = DD/MM/YYYY)\n if (parts[0]?.trim() && parts[0].trim().length >= 10) {\n const startValidation = validateDateComponents(parts[0].trim());\n if (!startValidation.isValid) {\n return { shouldBlock: true, error: `Start date: ${startValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n startDate = startValidation.parsedDate || null;\n }\n\n // Validate and parse end date if it looks complete\n if (parts[1]?.trim() && parts[1].trim().length >= 10) {\n const endValidation = validateDateComponents(parts[1].trim());\n if (!endValidation.isValid) {\n return { shouldBlock: true, error: `End date: ${endValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n endDate = endValidation.parsedDate || null;\n }\n\n // Business logic: start date cannot be after end date\n if (startDate && endDate && startDate > endDate) {\n return { shouldBlock: true, error: 'Start date cannot be greater than end date' };\n }\n\n // Additional validation for date range constraints\n if (options) {\n if (startDate && options.minDate && dayjs(startDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Start date is before the minimum allowed date' };\n }\n if (startDate && options.maxDate && dayjs(startDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Start date is after the maximum allowed date' };\n }\n if (endDate && options.minDate && dayjs(endDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'End date is before the minimum allowed date' };\n }\n if (endDate && options.maxDate && dayjs(endDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'End date is after the maximum allowed date' };\n }\n }\n\n // Return parsed dates ready for setControlledValue\n return { shouldBlock: false, parsedValue: [startDate, endDate] };\n } else if (inputValue.length >= 10) {\n // Single date: validate and parse if it looks complete\n const validation = validateDateComponents(inputValue);\n if (!validation.isValid) {\n return { shouldBlock: true, error: validation.error };\n }\n\n const parsedDate = validation.parsedDate;\n\n // Additional validation for single date constraints\n if (options && parsedDate) {\n if (options.excludeDate?.(parsedDate)) {\n return { shouldBlock: true, error: 'This date is not available for selection' };\n }\n if (options.minDate && dayjs(parsedDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Date is before the minimum allowed date' };\n }\n if (options.maxDate && dayjs(parsedDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Date is after the maximum allowed date' };\n }\n }\n\n // Return parsed date ready for setControlledValue\n return { shouldBlock: false, parsedValue: parsedDate || null };\n } else {\n // Partial validation for incomplete single date\n const partialValidation = validatePartialDateSimple(inputValue);\n if (!partialValidation.isValid) {\n return { shouldBlock: true, error: partialValidation.error };\n }\n\n // If partial validation passes, allow continued typing\n return { shouldBlock: false };\n }\n\n // This line should not be reached, but keeping for safety\n return { shouldBlock: false };\n};\n\n/**\n * Simple partial date validation using / splitting\n * Since special formats (MMM, MMMM, YYYY) are handled before this function\n *\n * @param input - The partial date input to validate\n * @returns Object with validation result and optional error message\n *\n * @example\n * // Valid partial input\n * validatePartialDateSimple(\"15\")\n * // → { isValid: true }\n *\n * @example\n * // Invalid day\n * validatePartialDateSimple(\"35\")\n * // → { isValid: false, error: \"Day cannot be greater than 31\" }\n *\n * @example\n * // Invalid month\n * validatePartialDateSimple(\"15/13\")\n * // → { isValid: false, error: \"Month cannot be greater than 12\" }\n *\n * @example\n * // Invalid day-month combination\n * validatePartialDateSimple(\"30/02\")\n * // → { isValid: false, error: \"February cannot have more than 29 days\" }\n */\nfunction validatePartialDateSimple(input: string): { isValid: boolean; error?: string } {\n // Don't validate empty input - let user start typing\n if (!input?.trim()) {\n return { isValid: true };\n }\n\n // Split by / to get day, month parts\n const parts = input.split('/');\n\n // Validate day part (first part)\n if (parts[0]?.length >= 2) {\n const dayStr = parts[0].trim();\n if (dayStr.length > 0) {\n const day = parseInt(dayStr, 10);\n\n // Day must be valid number\n if (isNaN(day)) {\n return { isValid: false, error: 'Please enter a valid day (01-31)' };\n }\n\n // Day cannot be greater than 31\n if (day > 31) {\n return { isValid: false, error: 'Day cannot be greater than 31' };\n }\n\n // Day cannot be 00\n if (day === 0) {\n return { isValid: false, error: 'Day cannot be 00, please enter 01-31' };\n }\n }\n }\n\n // Validate month part (second part)\n if (parts[1]?.length >= 2) {\n const monthStr = parts[1].trim();\n if (monthStr.length > 0) {\n const month = parseInt(monthStr, 10);\n\n // Month must be valid number\n if (isNaN(month)) {\n return { isValid: false, error: 'Please enter a valid month (01-12)' };\n }\n\n // Month cannot be greater than 12\n if (month > 12) {\n return { isValid: false, error: 'Month cannot be greater than 12' };\n }\n\n // Month cannot be 00\n if (month === 0) {\n return { isValid: false, error: 'Month cannot be 00, please enter 01-12' };\n }\n\n // Basic day-month validation (no DayJS needed)\n const day = parts[0]?.trim() ? parseInt(parts[0].trim(), 10) : NaN;\n if (!isNaN(day)) {\n // February cannot have more than 29 days\n if (month === 2 && day > 29) {\n return { isValid: false, error: 'February cannot have more than 29 days' };\n }\n\n // Months with 30 days: April(4), June(6), September(9), November(11)\n if ([4, 6, 9, 11].includes(month) && day > 30) {\n return {\n isValid: false,\n error: `${MONTH_NAMES[month - 1]} cannot have more than 30 days`,\n };\n }\n }\n }\n }\n\n // If we get here, partial input is valid\n return { isValid: true };\n}\n\n/**\n * Removes date delimiters (slashes) from formatted date strings for internal processing\n * Used to convert external formatted values to internal state for easier validation and length checks\n *\n * @param str - The date string with delimiters\n * @returns String without delimiters, or empty string if input is null/undefined\n *\n * @example\n * // Remove slashes from single date\n * stripDelimiters(\"25/12/2024\")\n * // → \"25122024\"\n *\n * @example\n * // Handle null/undefined input\n * stripDelimiters(undefined)\n * // → \"\"\n *\n * @example\n * // Used for internal state conversion\n * stripDelimiters(\"31/12/2024\")\n * // → \"31122024\" (easier for length checks: inputValue.length === 8)\n */\nconst stripDelimiters = (str?: string): string => str?.replace(/\\//g, '') ?? '';\n\n/**\n * Formats a date / date-range into a humanised, easy-to-read format used by the\n * `displayFormat=\"compact\"` mode (e.g. \"7 Jun 2026\", \"1-23 Jun 2026\", or \"7 Jun - 12 Jul 2026\").\n *\n * - Same month & year: only the day is repeated on the start date, e.g. \"1-23 Jun 2026\".\n * - Same year, different month: the year is only repeated on the end date, e.g. \"7 Jun - 12 Jul 2026\".\n * - Different years: the year is repeated on both dates, e.g. \"28 Dec 2025 - 3 Jan 2026\".\n * This intentionally uses a fixed `D MMM YYYY` format (locale-aware) since it is only\n * used for the read-only compact display and not for editable input parsing.\n */\nconst getHumanizedDate = ({\n date,\n locale,\n selectionType,\n}: {\n date: Date | [Date | null, Date | null] | null;\n locale: string;\n selectionType: 'single' | 'range';\n}): string => {\n if (!date) return '';\n\n const withYear = (value: Date): string => dayjs(value).locale(locale).format('D MMM YYYY');\n const withoutYear = (value: Date): string => dayjs(value).locale(locale).format('D MMM');\n const dayOnly = (value: Date): string => dayjs(value).locale(locale).format('D');\n const monthYear = (value: Date): string => dayjs(value).locale(locale).format('MMM YYYY');\n\n if (selectionType === 'single' && date instanceof Date) {\n return withYear(date);\n }\n\n if (Array.isArray(date)) {\n const [startDate, endDate] = date;\n if (startDate && endDate) {\n const start = dayjs(startDate);\n const end = dayjs(endDate);\n const isSameYear = start.year() === end.year();\n const isSameMonth = isSameYear && start.month() === end.month();\n\n if (isSameMonth) {\n return `${dayOnly(startDate)}-${dayOnly(endDate)} ${monthYear(endDate)}`;\n }\n\n return `${isSameYear ? withoutYear(startDate) : withYear(startDate)} - ${withYear(endDate)}`;\n }\n if (startDate) {\n return withYear(startDate);\n }\n }\n\n return '';\n};\n\nexport {\n convertIntlToDayjsLocale,\n loadScript,\n getFormattedDate,\n getHumanizedDate,\n rangeFormattedValue,\n rangeInputPlaceHolder,\n finalInputFormat,\n getTextInputFormat,\n validateDateComponents,\n validateAndParseDateInput,\n validatePartialDateSimple,\n stripDelimiters,\n};\n"],"names":["dayjs","extend","customParseFormat","dayjs_locales","MONTH_NAMES","patchLocale","locale","includes","convertIntlToDayjsLocale","lang","toLowerCase","split","isScriptLoaded","src","Boolean","document","querySelector","loadScript","callback","localeScript","createElement","async","onload","head","appendChild","defaultDateFormatter","_ref","type","date","format","labelSeparator","formatDate","value","Array","isArray","getFormattedDate","_ref2","formatter","others","_objectWithoutProperties","_excluded","rangeFormattedValue","startValue","endValue","rangeInputPlaceHolder","placeholder","finalInputFormat","getTextInputFormat","formatStr","isRangeInput","replace","validateDateComponents","dateStr","trim","isValid","parsed","error","year","parsedDate","toDate","parseSpecialSingleFormat","inputValue","isSpecialFormat","shouldBlock","trimmedInput","today","Date","test","parseInt","getMonth","getDate","length","monthDate","getFullYear","month","validateAndParseDateInput","isRange","options","specialParse","parsedValue","_parts$","_parts$2","_parts$5","_parts$6","parts","_parts$3","_parts$4","startPartialValidation","validatePartialDateSimple","endPartialValidation","startDate","endDate","startValidation","endValidation","minDate","isBefore","maxDate","isAfter","validation","excludeDate","partialValidation","input","_parts$7","_parts$8","dayStr","day","isNaN","monthStr","_parts$9","NaN","stripDelimiters","str","_str$replace","getHumanizedDate","_ref3","selectionType","withYear","withoutYear","dayOnly","monthYear","_date","_slicedToArray","start","end","isSameYear","isSameMonth"],"mappings":";;;;;AAGA,IAAA,SAAA,CAAA,CAAA,WAAA,CAAA,CAGAA,KAAK,CAACC,MAAM,CAACC,iBAAiB,CAAC,CAE/B,IAAMC,aAAa,CAAG,CACpB,IAAI,CACJ,IAAI,CACJ,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,OAAO,CACP,OAAO,CACP,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,IAAI,CACJ,I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CAC1E,CAEA,OAAO,CAAA,EAAGiC,UAAU,CAAGP,WAAW,CAAC3B,SAAS,CAAC,CAAG0B,QAAQ,CAAC1B,SAAS,CAAC,MAAM0B,QAAQ,CAACzB,OAAO,CAAC,CAAA,CAAE,CAC9F,CACA,GAAID,SAAS,CAAE,CACb,OAAO0B,QAAQ,CAAC1B,SAAS,CAAC,CAC5B,CACF,CAEA,OAAO,EAAE,CACX;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../src/components/DatePicker/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { DatePickerType, DatePickerValue } from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\ndayjs.extend(customParseFormat);\n\nconst dayjs_locales = [\n 'af',\n 'ar',\n 'ar-dz',\n 'ar-kw',\n 'ar-ly',\n 'ar-ma',\n 'ar-sa',\n 'ar-tn',\n 'az',\n 'be',\n 'bg',\n 'bm',\n 'bn',\n 'bo',\n 'br',\n 'bs',\n 'ca',\n 'cs',\n 'cv',\n 'cy',\n 'da',\n 'de',\n 'de-at',\n 'de-ch',\n 'dv',\n 'el',\n 'en',\n 'en-au',\n 'en-ca',\n 'en-gb',\n 'en-ie',\n 'en-il',\n 'en-nz',\n 'en-SG',\n 'eo',\n 'es',\n 'es-do',\n 'es-us',\n 'et',\n 'eu',\n 'fa',\n 'fi',\n 'fo',\n 'fr',\n 'fr-ca',\n 'fr-ch',\n 'fy',\n 'ga',\n 'gd',\n 'gl',\n 'gom-latn',\n 'gu',\n 'he',\n 'hi',\n 'hr',\n 'hu',\n 'hy-am',\n 'id',\n 'is',\n 'it',\n 'it-ch',\n 'ja',\n 'jv',\n 'ka',\n 'kk',\n 'km',\n 'kn',\n 'ko',\n 'ku',\n 'ky',\n 'lb',\n 'lo',\n 'lt',\n 'lv',\n 'me',\n 'mi',\n 'mk',\n 'ml',\n 'mn',\n 'mr',\n 'ms',\n 'ms-my',\n 'mt',\n 'my',\n 'nb',\n 'ne',\n 'nl',\n 'nl-be',\n 'nn',\n 'oc-lnc',\n 'pa-in',\n 'pl',\n 'pt',\n 'pt-br',\n 'ro',\n 'ru',\n 'sd',\n 'se',\n 'si',\n 'sk',\n 'sl',\n 'sq',\n 'sr',\n 'sr-cyrl',\n 'ss',\n 'sv',\n 'sw',\n 'ta',\n 'te',\n 'tet',\n 'tg',\n 'th',\n 'tl-ph',\n 'tlh',\n 'tr',\n 'tzl',\n 'tzm',\n 'tzm-latn',\n 'ug-cn',\n 'uk',\n 'ur',\n 'uz',\n 'uz-latn',\n 'vi',\n 'x-pseudo',\n 'yo',\n 'zh-cn',\n 'zh-hk',\n 'zh-tw',\n];\n\nconst MONTH_NAMES = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\n// https://github.com/iamkun/dayjs/issues/732#issuecomment-554383261\nfunction patchLocale(locale: string): string | boolean {\n if (['en', 'en-us'].includes(locale)) return 'en';\n if (locale === 'zn') return 'zh-cn';\n if (locale === 'no') return 'nb';\n if (dayjs_locales.includes(locale)) return locale;\n return false;\n}\n\nfunction convertIntlToDayjsLocale(lang: string): string {\n lang = lang.toLowerCase();\n const locale = patchLocale(lang) || (lang.includes('-') && patchLocale(lang.split('-')[0]));\n if (!locale) return 'en';\n\n return `${locale}`;\n}\n\nfunction isScriptLoaded(src: string): boolean {\n return Boolean(document.querySelector(`script[src=\"${src}\"]`));\n}\n\n/**\n * Used to dynamically load a script\n */\nfunction loadScript(src: string, callback?: () => void): void {\n if (isScriptLoaded(src)) {\n callback?.();\n return;\n }\n const localeScript = document.createElement('script');\n localeScript.async = true;\n localeScript.src = src;\n localeScript.onload = () => callback?.();\n document.head.appendChild(localeScript);\n}\n\ninterface DateFormatterInput {\n type: DatePickerType;\n date: DatePickerValue<DatePickerType>;\n locale: string;\n format: string;\n labelSeparator: string;\n}\n\ntype DateFormatter = (input: DateFormatterInput) => string;\n\nfunction defaultDateFormatter({ type, date, locale, format, labelSeparator }: DateFormatterInput) {\n const formatDate = (value: Date) => dayjs(value).locale(locale).format(format);\n\n if (type === 'default') {\n return date === null ? '' : formatDate(date as Date);\n }\n\n if (type === 'range' && Array.isArray(date)) {\n if (date[0] && date[1]) {\n return `${formatDate(date[0])} ${labelSeparator} ${formatDate(date[1])}`;\n }\n\n if (date[0]) {\n return `${formatDate(date[0])} ${labelSeparator} `;\n }\n\n return '';\n }\n\n return '';\n}\n\ninterface GetFormattedDateInput extends DateFormatterInput {\n formatter?: DateFormatter;\n}\n\nfunction getFormattedDate({ formatter, ...others }: GetFormattedDateInput) {\n return (formatter || defaultDateFormatter)(others);\n}\n\nconst rangeFormattedValue = (startValue: string, endValue: string) => {\n // Both values exist\n if (startValue && endValue) {\n if (startValue === endValue) {\n return startValue; // Same date, show single value\n }\n return `${startValue} – ${endValue}`; // Different dates, show range\n }\n\n // Only start value exists\n if (startValue) {\n return `${startValue} – `;\n }\n\n // Only end value exists\n if (endValue) {\n return ` – ${endValue}`;\n }\n\n // No values\n return '';\n};\n\nconst rangeInputPlaceHolder = (placeholder: string | undefined, format: string) => {\n if (placeholder) {\n return `${placeholder} – ${placeholder}`;\n }\n return `${format} – ${format}`;\n};\n\nconst finalInputFormat = (startValue: string, endValue: string, format: string | undefined) => {\n // For case: when start and end are the same, return the format\n if (startValue === endValue && (startValue || endValue)) {\n return format;\n }\n return `${format} – ${format}`;\n};\n\n/**\n * Converts date format string to TextInput pattern for masking.\n * TextInput format only recognizes # as input placeholder, so we replace\n * date characters (Y,M,D) with # while preserving delimiters.\n *\n * @example \"DD/MM/YYYY\" – \"##/##/####\"\n * @example \"MMMM\" – \"################\" (longest month: \"September\")\n * @example \"MMM\" – \"###\"\n */\nconst getTextInputFormat = (formatStr?: string, isRangeInput?: boolean): string => {\n if (!formatStr) {\n return isRangeInput ? '##/##/#### – ##/##/####' : '##/##/####';\n } else if (formatStr === 'MMMM') {\n return formatStr.replace(/MMMM/g, '#########');\n }\n return formatStr.replace(/[YMD]/g, '#');\n};\n\n/**\n * Validates date string using DayJS strict parsing and business rules\n *\n * @param dateStr - The date string to validate in DD/MM/YYYY format\n * @returns Object with validation result, error message if invalid, and parsed Date if valid\n *\n * @example\n * // Valid date\n * validateDateComponents(\"25/12/2024\")\n * // → { isValid: true, parsedDate: Date(2024, 11, 25) }\n *\n * @example\n * // Invalid date (non-existent)\n * validateDateComponents(\"31/02/2024\")\n * // → { isValid: false, error: \"Please enter a valid date\" }\n *\n * @example\n * // Invalid year range\n * validateDateComponents(\"25/12/999\")\n * // → { isValid: false, error: \"Year must be between 1000 and 3000\" }\n *\n * @example\n * // Empty input\n * validateDateComponents(\"\")\n * // → { isValid: true }\n */\nconst validateDateComponents = (\n dateStr: string,\n): {\n isValid: boolean;\n error?: string;\n parsedDate?: Date;\n} => {\n // Empty strings are considered valid (user hasn't started typing)\n if (!dateStr?.trim()) {\n return { isValid: true };\n }\n\n // Use DayJS strict parsing to validate DD/MM/YYYY format and date existence\n const parsed = dayjs(dateStr, 'DD/MM/YYYY', true);\n\n // DayJS strict mode catches invalid days/months and non-existent dates (e.g., Feb 30th)\n if (!parsed.isValid()) {\n return { isValid: false, error: 'Please enter a valid date' };\n }\n\n // Business rule: restrict year range to reasonable values for most applications\n const year = parsed.year();\n if (year < 1000 || year > 3000) {\n return { isValid: false, error: 'Year must be between 1000 and 3000' };\n }\n\n // Return both validation result AND parsed date to avoid double parsing\n return { isValid: true, parsedDate: parsed.toDate() };\n};\n\n/**\n * Detects and parses special single date formats (MMM, MMMM, YYYY)\n * These formats preserve current date/month/year and only change the specified component\n *\n * @param inputValue - The input string to parse\n * @param format - The expected format ('MMM', 'MMMM', or 'YYYY')\n * @returns Object with special format detection, parsed date, and validation result\n *\n * @example\n * // Year format - preserves current month/day, changes year\n * parseSpecialSingleFormat(\"2024\", \"YYYY\")\n * // → { isSpecialFormat: true, parsedDate: Date(2024, currentMonth, currentDay), shouldBlock: false }\n *\n * @example\n * // Short month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"Aug\", \"MMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Full month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"August\", \"MMMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Invalid year\n * parseSpecialSingleFormat(\"999\", \"YYYY\")\n * // → { isSpecialFormat: true, shouldBlock: true }\n *\n * @example\n * // Not a special format\n * parseSpecialSingleFormat(\"25/12/2024\", \"DD/MM/YYYY\")\n * // → { isSpecialFormat: false, shouldBlock: false }\n */\nconst parseSpecialSingleFormat = (\n inputValue: string,\n format?: string,\n): { isSpecialFormat: boolean; parsedDate?: Date; shouldBlock: boolean } => {\n if (!format) return { isSpecialFormat: false, shouldBlock: false };\n\n const trimmedInput = inputValue.trim();\n const today = new Date();\n\n // Handle year-only format (YYYY) - keep current month and day, change year\n if (format === 'YYYY' && /^\\d{4}$/.test(trimmedInput)) {\n const year = parseInt(trimmedInput, 10);\n if (year >= 1000 && year <= 3000) {\n return {\n isSpecialFormat: true,\n parsedDate: new Date(year, today.getMonth(), today.getDate()),\n shouldBlock: false,\n };\n } else {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n }\n\n // Handle month formats (MMM, MMMM) - keep current day and year, change month\n if ((format === 'MMM' || format === 'MMMM') && trimmedInput.length >= 3) {\n // Using DayJS to parse month names (handles both short \"Aug\" and full \"August\")\n const monthDate = dayjs(trimmedInput, format === 'MMM' ? 'MMM' : 'MMMM', true);\n\n if (!monthDate.isValid()) {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n return {\n isSpecialFormat: true,\n parsedDate: new Date(today.getFullYear(), monthDate.month(), today.getDate()),\n shouldBlock: false,\n };\n }\n\n return { isSpecialFormat: false, shouldBlock: false };\n};\n\n/**\n * Validates and parses date input with comprehensive error handling and constraint checking\n * Combines validation + parsing to avoid redundant operations and supports both single dates and ranges\n *\n * @param inputValue - The input string to validate and parse\n * @param isRange - Whether this is a range input (true) or single date (false)\n * @param format - The expected date format ('DD/MM/YYYY', 'MMM', 'MMMM', 'YYYY')\n * @param options - Additional validation constraints\n * @param options.excludeDate - Function to exclude specific dates (single dates only)\n * @param options.minDate - Minimum allowed date\n * @param options.maxDate - Maximum allowed date\n * @returns Object with shouldBlock flag, optional error message, and parsed values if valid\n *\n * @example\n * // Valid single date\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, 11, 25) }\n *\n * @example\n * // Valid range input\n * validateAndParseDateInput(\"25/12/2024 – 31/12/2024\", true, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: [Date(2024, 11, 25), Date(2024, 11, 31)] }\n *\n * @example\n * // Invalid date with error\n * validateAndParseDateInput(\"31/02/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: true, error: \"Please enter a valid date in DD/MM/YYYY format\" }\n *\n * @example\n * // Date excluded by constraint\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\", {\n * excludeDate: (date) => date.getDay() === 0 // No Sundays\n * })\n * // → { shouldBlock: true, error: \"This date is not available for selection\" }\n *\n * @example\n * // Special format - year only\n * validateAndParseDateInput(\"2024\", false, \"YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, currentMonth, currentDay) }\n *\n * @example\n * // Incomplete input - allow continued typing\n * validateAndParseDateInput(\"25/12\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false } (no parsedValue, allows user to continue typing)\n */\nconst validateAndParseDateInput = (\n inputValue: string,\n isRange: boolean,\n format?: string,\n options?: {\n excludeDate?: (date: Date) => boolean;\n minDate?: Date;\n maxDate?: Date;\n },\n): {\n shouldBlock: boolean;\n error?: string;\n parsedValue?: Date | null | [Date | null, Date | null];\n} => {\n // Allow empty input - user hasn't started typing yet\n if (!inputValue?.trim()) return { shouldBlock: false };\n\n // Handle special single date formats (MMM, MMMM, YYYY) - skip normal validation\n if (!isRange && format) {\n const specialParse = parseSpecialSingleFormat(inputValue, format);\n if (specialParse.isSpecialFormat && !specialParse.shouldBlock) {\n return { shouldBlock: false, parsedValue: specialParse.parsedDate || null };\n } else if (specialParse.shouldBlock) {\n return { shouldBlock: true, error: 'Please enter a valid date' };\n }\n }\n\n if (isRange) {\n // Split range input on en dash separator (e.g., \"25/12/2024 – 31/12/2024\")\n const parts = inputValue.split(/\\s*–\\s*/);\n\n // Enhanced: Block incomplete input with partial validation\n if (\n (parts[0]?.trim() && parts[0].trim().length < 10) ||\n (parts[1]?.trim() && parts[1].trim().length < 10)\n ) {\n // Check start date part if it exists and has content\n if (parts[0]?.trim()) {\n const startPartialValidation = validatePartialDateSimple(parts[0].trim());\n if (!startPartialValidation.isValid) {\n return { shouldBlock: true, error: `Start date: ${startPartialValidation.error}` };\n }\n }\n\n // Check end date part if it exists and has content\n if (parts[1]?.trim()) {\n const endPartialValidation = validatePartialDateSimple(parts[1].trim());\n if (!endPartialValidation.isValid) {\n return { shouldBlock: true, error: `End date: ${endPartialValidation.error}` };\n }\n }\n\n // If partial validation passes, allow continued typing\n return { shouldBlock: false };\n }\n\n let startDate: Date | null = null;\n let endDate: Date | null = null;\n\n // Validate and parse start date if it looks complete (10+ chars = DD/MM/YYYY)\n if (parts[0]?.trim() && parts[0].trim().length >= 10) {\n const startValidation = validateDateComponents(parts[0].trim());\n if (!startValidation.isValid) {\n return { shouldBlock: true, error: `Start date: ${startValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n startDate = startValidation.parsedDate || null;\n }\n\n // Validate and parse end date if it looks complete\n if (parts[1]?.trim() && parts[1].trim().length >= 10) {\n const endValidation = validateDateComponents(parts[1].trim());\n if (!endValidation.isValid) {\n return { shouldBlock: true, error: `End date: ${endValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n endDate = endValidation.parsedDate || null;\n }\n\n // Business logic: start date cannot be after end date\n if (startDate && endDate && startDate > endDate) {\n return { shouldBlock: true, error: 'Start date cannot be greater than end date' };\n }\n\n // Additional validation for date range constraints\n if (options) {\n if (startDate && options.minDate && dayjs(startDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Start date is before the minimum allowed date' };\n }\n if (startDate && options.maxDate && dayjs(startDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Start date is after the maximum allowed date' };\n }\n if (endDate && options.minDate && dayjs(endDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'End date is before the minimum allowed date' };\n }\n if (endDate && options.maxDate && dayjs(endDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'End date is after the maximum allowed date' };\n }\n }\n\n // Return parsed dates ready for setControlledValue\n return { shouldBlock: false, parsedValue: [startDate, endDate] };\n } else if (inputValue.length >= 10) {\n // Single date: validate and parse if it looks complete\n const validation = validateDateComponents(inputValue);\n if (!validation.isValid) {\n return { shouldBlock: true, error: validation.error };\n }\n\n const parsedDate = validation.parsedDate;\n\n // Additional validation for single date constraints\n if (options && parsedDate) {\n if (options.excludeDate?.(parsedDate)) {\n return { shouldBlock: true, error: 'This date is not available for selection' };\n }\n if (options.minDate && dayjs(parsedDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Date is before the minimum allowed date' };\n }\n if (options.maxDate && dayjs(parsedDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Date is after the maximum allowed date' };\n }\n }\n\n // Return parsed date ready for setControlledValue\n return { shouldBlock: false, parsedValue: parsedDate || null };\n } else {\n // Partial validation for incomplete single date\n const partialValidation = validatePartialDateSimple(inputValue);\n if (!partialValidation.isValid) {\n return { shouldBlock: true, error: partialValidation.error };\n }\n\n // If partial validation passes, allow continued typing\n return { shouldBlock: false };\n }\n\n // This line should not be reached, but keeping for safety\n return { shouldBlock: false };\n};\n\n/**\n * Simple partial date validation using / splitting\n * Since special formats (MMM, MMMM, YYYY) are handled before this function\n *\n * @param input - The partial date input to validate\n * @returns Object with validation result and optional error message\n *\n * @example\n * // Valid partial input\n * validatePartialDateSimple(\"15\")\n * // → { isValid: true }\n *\n * @example\n * // Invalid day\n * validatePartialDateSimple(\"35\")\n * // → { isValid: false, error: \"Day cannot be greater than 31\" }\n *\n * @example\n * // Invalid month\n * validatePartialDateSimple(\"15/13\")\n * // → { isValid: false, error: \"Month cannot be greater than 12\" }\n *\n * @example\n * // Invalid day-month combination\n * validatePartialDateSimple(\"30/02\")\n * // → { isValid: false, error: \"February cannot have more than 29 days\" }\n */\nfunction validatePartialDateSimple(input: string): { isValid: boolean; error?: string } {\n // Don't validate empty input - let user start typing\n if (!input?.trim()) {\n return { isValid: true };\n }\n\n // Split by / to get day, month parts\n const parts = input.split('/');\n\n // Validate day part (first part)\n if (parts[0]?.length >= 2) {\n const dayStr = parts[0].trim();\n if (dayStr.length > 0) {\n const day = parseInt(dayStr, 10);\n\n // Day must be valid number\n if (isNaN(day)) {\n return { isValid: false, error: 'Please enter a valid day (01-31)' };\n }\n\n // Day cannot be greater than 31\n if (day > 31) {\n return { isValid: false, error: 'Day cannot be greater than 31' };\n }\n\n // Day cannot be 00\n if (day === 0) {\n return { isValid: false, error: 'Day cannot be 00, please enter 01-31' };\n }\n }\n }\n\n // Validate month part (second part)\n if (parts[1]?.length >= 2) {\n const monthStr = parts[1].trim();\n if (monthStr.length > 0) {\n const month = parseInt(monthStr, 10);\n\n // Month must be valid number\n if (isNaN(month)) {\n return { isValid: false, error: 'Please enter a valid month (01-12)' };\n }\n\n // Month cannot be greater than 12\n if (month > 12) {\n return { isValid: false, error: 'Month cannot be greater than 12' };\n }\n\n // Month cannot be 00\n if (month === 0) {\n return { isValid: false, error: 'Month cannot be 00, please enter 01-12' };\n }\n\n // Basic day-month validation (no DayJS needed)\n const day = parts[0]?.trim() ? parseInt(parts[0].trim(), 10) : NaN;\n if (!isNaN(day)) {\n // February cannot have more than 29 days\n if (month === 2 && day > 29) {\n return { isValid: false, error: 'February cannot have more than 29 days' };\n }\n\n // Months with 30 days: April(4), June(6), September(9), November(11)\n if ([4, 6, 9, 11].includes(month) && day > 30) {\n return {\n isValid: false,\n error: `${MONTH_NAMES[month - 1]} cannot have more than 30 days`,\n };\n }\n }\n }\n }\n\n // If we get here, partial input is valid\n return { isValid: true };\n}\n\n/**\n * Removes date delimiters (slashes) from formatted date strings for internal processing\n * Used to convert external formatted values to internal state for easier validation and length checks\n *\n * @param str - The date string with delimiters\n * @returns String without delimiters, or empty string if input is null/undefined\n *\n * @example\n * // Remove slashes from single date\n * stripDelimiters(\"25/12/2024\")\n * // → \"25122024\"\n *\n * @example\n * // Handle null/undefined input\n * stripDelimiters(undefined)\n * // → \"\"\n *\n * @example\n * // Used for internal state conversion\n * stripDelimiters(\"31/12/2024\")\n * // → \"31122024\" (easier for length checks: inputValue.length === 8)\n */\nconst stripDelimiters = (str?: string): string => str?.replace(/\\//g, '') ?? '';\n\n/**\n * Formats a date / date-range into a humanised, easy-to-read format used by the\n * `displayFormat=\"compact\"` mode (e.g. \"7 Jun 2026\", \"1-23 Jun 2026\", or \"7 Jun - 12 Jul 2026\").\n *\n * - Same month & year: only the day is repeated on the start date, e.g. \"1-23 Jun 2026\".\n * - Same year, different month: the year is only repeated on the end date, e.g. \"7 Jun - 12 Jul 2026\".\n * - Different years: the year is repeated on both dates, e.g. \"28 Dec 2025 - 3 Jan 2026\".\n * This intentionally uses a fixed `D MMM YYYY` format (locale-aware) since it is only\n * used for the read-only compact display and not for editable input parsing.\n */\nconst getHumanizedDate = ({\n date,\n locale,\n selectionType,\n}: {\n date: Date | [Date | null, Date | null] | null;\n locale: string;\n selectionType: 'single' | 'range';\n}): string => {\n if (!date) return '';\n\n const withYear = (value: Date): string => dayjs(value).locale(locale).format('D MMM YYYY');\n const withoutYear = (value: Date): string => dayjs(value).locale(locale).format('D MMM');\n const dayOnly = (value: Date): string => dayjs(value).locale(locale).format('D');\n const monthYear = (value: Date): string => dayjs(value).locale(locale).format('MMM YYYY');\n\n if (selectionType === 'single' && date instanceof Date) {\n return withYear(date);\n }\n\n if (Array.isArray(date)) {\n const [startDate, endDate] = date;\n if (startDate && endDate) {\n const start = dayjs(startDate);\n const end = dayjs(endDate);\n const isSameYear = start.year() === end.year();\n const isSameMonth = isSameYear && start.month() === end.month();\n\n if (isSameMonth) {\n return `${dayOnly(startDate)}-${dayOnly(endDate)} ${monthYear(endDate)}`;\n }\n\n return `${isSameYear ? withoutYear(startDate) : withYear(startDate)} - ${withYear(endDate)}`;\n }\n if (startDate) {\n return withYear(startDate);\n }\n }\n\n return '';\n};\n\n/**\n * Clamps a date into the `[minDate, maxDate]` range so the calendar opens on a month\n * that actually contains selectable dates. When the anchor (usually today) is after\n * `maxDate`, the last selectable date (`maxDate`) is returned; when it is before\n * `minDate`, the first selectable date (`minDate`) is returned. Otherwise the anchor is\n * returned unchanged. `excludeDate` gaps are intentionally not considered here.\n */\nconst clampDateToRange = ({\n date,\n minDate,\n maxDate,\n}: {\n date: Date;\n minDate?: Date;\n maxDate?: Date;\n}): Date => {\n if (maxDate && dayjs(date).isAfter(dayjs(maxDate), 'day')) {\n return maxDate;\n }\n if (minDate && dayjs(date).isBefore(dayjs(minDate), 'day')) {\n return minDate;\n }\n return date;\n};\n\nexport {\n convertIntlToDayjsLocale,\n loadScript,\n clampDateToRange,\n getFormattedDate,\n getHumanizedDate,\n rangeFormattedValue,\n rangeInputPlaceHolder,\n finalInputFormat,\n getTextInputFormat,\n validateDateComponents,\n validateAndParseDateInput,\n validatePartialDateSimple,\n stripDelimiters,\n};\n"],"names":["dayjs","extend","customParseFormat","dayjs_locales","MONTH_NAMES","patchLocale","locale","includes","convertIntlToDayjsLocale","lang","toLowerCase","split","isScriptLoaded","src","Boolean","document","querySelector","loadScript","callback","localeScript","createElement","async","onload","head","appendChild","defaultDateFormatter","_ref","type","date","format","labelSeparator","formatDate","value","Array","isArray","getFormattedDate","_ref2","formatter","others","_objectWithoutProperties","_excluded","rangeFormattedValue","startValue","endValue","rangeInputPlaceHolder","placeholder","finalInputFormat","getTextInputFormat","formatStr","isRangeInput","replace","validateDateComponents","dateStr","trim","isValid","parsed","error","year","parsedDate","toDate","parseSpecialSingleFormat","inputValue","isSpecialFormat","shouldBlock","trimmedInput","today","Date","test","parseInt","getMonth","getDate","length","monthDate","getFullYear","month","validateAndParseDateInput","isRange","options","specialParse","parsedValue","_parts$","_parts$2","_parts$5","_parts$6","parts","_parts$3","_parts$4","startPartialValidation","validatePartialDateSimple","endPartialValidation","startDate","endDate","startValidation","endValidation","minDate","isBefore","maxDate","isAfter","validation","excludeDate","partialValidation","input","_parts$7","_parts$8","dayStr","day","isNaN","monthStr","_parts$9","NaN","stripDelimiters","str","_str$replace","getHumanizedDate","_ref3","selectionType","withYear","withoutYear","dayOnly","monthYear","_date","_slicedToArray","start","end","isSameYear","isSameMonth","clampDateToRange","_ref4"],"mappings":";;;;;AAGA,IAAA,SAAA,CAAA,CAAA,WAAA,CAAA,CAGAA,KAAK,CAACC,MAAM,CAACC,iBAAiB,CAAC,CAE/B,IAAMC,aAAa,CAAG,CACpB,IAAI,CACJ,IAAI,CACJ,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,OAAO,CACP,OAAO,CACP,IAAI,CACJ,IAAI,CACJ,IAAI,CACJ,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,OAAO,CACP,IAAI,CACJ,IAAI,CACJ,OAAO,CACP,OAAO,CACP,IA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CAAG0B,QAAQ,CAAC1B,SAAS,CAAC,CAAA,GAAA,EAAM0B,QAAQ,CAACzB,OAAO,CAAC,CAAE,CAAA,CAC9F,CACA,GAAID,SAAS,CAAE,CACb,OAAO0B,QAAQ,CAAC1B,SAAS,CAAC,CAC5B,CACF,CAEA,OAAO,EAAE,CACX,EASM,IAAAoC,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,KAAA,CAQV,KAPVnG,IAAI,CAAAmG,KAAA,CAAJnG,IAAI,CACJkE,OAAO,CAAAiC,KAAA,CAAPjC,OAAO,CACPE,OAAO,CAAA+B,KAAA,CAAP/B,OAAO,CAMP,GAAIA,OAAO,EAAIhG,KAAK,CAAC4B,IAAI,CAAC,CAACqE,OAAO,CAACjG,KAAK,CAACgG,OAAO,CAAC,CAAE,KAAK,CAAC,CAAE,CACzD,OAAOA,OAAO,CAChB,CACA,GAAIF,OAAO,EAAI9F,KAAK,CAAC4B,IAAI,CAAC,CAACmE,QAAQ,CAAC/F,KAAK,CAAC8F,OAAO,CAAC,CAAE,KAAK,CAAC,CAAE,CAC1D,OAAOA,OAAO,CAChB,CACA,OAAOlE,IAAI,CACb;;;;"}
|
|
@@ -28,7 +28,7 @@ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeA
|
|
|
28
28
|
import { isReactNative } from '../../utils/platform/isReactNative.js';
|
|
29
29
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
30
30
|
|
|
31
|
-
var _excluded=["children","isOpen","onOpenChange","selectionType","testID","_width"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Dropdown/Dropdown.tsx";var validDropdownChildren=[dropdownComponentIds.BaseBox,dropdownComponentIds.triggers.SelectInput,dropdownComponentIds.triggers.SearchInput,dropdownComponentIds.triggers.DropdownButton,dropdownComponentIds.triggers.DropdownIconButton,dropdownComponentIds.triggers.DropdownLink,dropdownComponentIds.DropdownOverlay,dropdownComponentIds.triggers.AutoComplete,ComponentIds.BottomSheet,dropdownComponentIds.triggers.FilterChipSelectInput,dropdownComponentIds.triggers.InputDropdownButton];var _Dropdown=function _Dropdown(_ref,ref){var children=_ref.children,isOpenControlled=_ref.isOpen,onOpenChange=_ref.onOpenChange,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,testID=_ref.testID,_width=_ref._width,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),options=_React$useState2[0],setOptions=_React$useState2[1];var _React$useState3=React__default.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),filteredValues=_React$useState4[0],setFilteredValues=_React$useState4[1];var _React$useState5=React__default.useState([]),_React$useState6=_slicedToArray(_React$useState5,2),selectedIndices=_React$useState6[0],setSelectedIndices=_React$useState6[1];var _React$useState7=React__default.useState([]),_React$useState8=_slicedToArray(_React$useState7,2),controlledValueIndices=_React$useState8[0],setControlledValueIndices=_React$useState8[1];var _React$useState9=React__default.useState(-1),_React$useState0=_slicedToArray(_React$useState9,2),activeIndex=_React$useState0[0],setActiveIndex=_React$useState0[1];var _React$useState1=React__default.useState(-1),_React$useState10=_slicedToArray(_React$useState1,2),activeTagIndex=_React$useState10[0],setActiveTagIndex=_React$useState10[1];var _React$useState11=React__default.useState(false),_React$useState12=_slicedToArray(_React$useState11,2),shouldIgnoreBlurAnimation=_React$useState12[0],setShouldIgnoreBlurAnimation=_React$useState12[1];var _React$useState13=React__default.useState(false),_React$useState14=_slicedToArray(_React$useState13,2),hasFooterAction=_React$useState14[0],setHasFooterAction=_React$useState14[1];var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),hasAutoCompleteInHeader=_React$useState16[0],setHasAutoCompleteInHeader=_React$useState16[1];var _React$useState17=React__default.useState(false),_React$useState18=_slicedToArray(_React$useState17,2),isKeydownPressed=_React$useState18[0],setIsKeydownPressed=_React$useState18[1];var _React$useState19=React__default.useState(0),_React$useState20=_slicedToArray(_React$useState19,2),changeCallbackTriggerer=_React$useState20[0],setChangeCallbackTriggerer=_React$useState20[1];var _React$useState21=React__default.useState(false),_React$useState22=_slicedToArray(_React$useState21,2),isControlled=_React$useState22[0],setIsControlled=_React$useState22[1];var _React$useState23=React__default.useState(false),_React$useState24=_slicedToArray(_React$useState23,2),dropdownHasBottomSheet=_React$useState24[0],setDropdownHasBottomSheet=_React$useState24[1];var triggererWrapperRef=React__default.useRef(null);var triggererRef=React__default.useRef(null);var headerAutoCompleteRef=React__default.useRef(null);var actionListItemRef=React__default.useRef(null);var dropdownTriggerer=React__default.useRef();var isTagDismissedRef=React__default.useRef({value:false});var visibleTagsCountRef=React__default.useRef({value:0});var dropdownContainerRef=React__default.useRef(null);var dropdownBaseId=useId('dropdown');var isDropdownOpenRef=React__default.useRef(isOpenControlled);var _useControllableState=useControllableState({value:isOpenControlled,defaultValue:false,onChange:function onChange(isOpenControlledValue){isDropdownOpenRef.current=isOpenControlledValue;onOpenChange==null?void 0:onOpenChange(isOpenControlledValue);}}),_useControllableState2=_slicedToArray(_useControllableState,2),isDropdownOpen=_useControllableState2[0],setIsDropdownOpen=_useControllableState2[1];isDropdownOpenRef.current=isDropdownOpen;var setIsOpen=function setIsOpen(isOpenValue){isDropdownOpenRef.current=isOpenValue;setIsDropdownOpen(function(){return isOpenValue;});};var close=React__default.useCallback(function(){setActiveTagIndex(-1);setIsOpen(false);},[]);React__default.Children.map(children,function(child){if(React__default.isValidElement(child)){if(__DEV__){var _getComponentId;if(!validDropdownChildren.includes((_getComponentId=getComponentId(child))!=null?_getComponentId:'')){throwBladeError({message:`Dropdown can only have one of following elements as children - \n\n ${validDropdownChildren.join(', ')} \n\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,moduleName:'Dropdown'});}}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SelectInput)){dropdownTriggerer.current='SelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SearchInput)){dropdownTriggerer.current='SearchInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownButton)){dropdownTriggerer.current='DropdownButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownIconButton)){dropdownTriggerer.current='DropdownIconButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.AutoComplete)){dropdownTriggerer.current='AutoComplete';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.FilterChipSelectInput)){dropdownTriggerer.current='FilterChipSelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.InputDropdownButton)){dropdownTriggerer.current='InputDropdownButton';}}});var contextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,controlledValueIndices:controlledValueIndices,setControlledValueIndices:setControlledValueIndices,options:options,setOptions:setOptions,filteredValues:filteredValues,setFilteredValues:setFilteredValues,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,dropdownBaseId:dropdownBaseId,triggererRef:triggererRef,headerAutoCompleteRef:headerAutoCompleteRef,triggererWrapperRef:triggererWrapperRef,actionListItemRef:actionListItemRef,selectionType:selectionType,hasFooterAction:hasFooterAction,setHasFooterAction:setHasFooterAction,hasAutoCompleteInHeader:hasAutoCompleteInHeader,setHasAutoCompleteInHeader:setHasAutoCompleteInHeader,dropdownTriggerer:dropdownTriggerer.current,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,setIsControlled:setIsControlled,isTagDismissedRef:isTagDismissedRef};},[isDropdownOpen,isOpenControlled,selectedIndices,controlledValueIndices,options,filteredValues,activeIndex,activeTagIndex,shouldIgnoreBlurAnimation,selectionType,hasFooterAction,isKeydownPressed,changeCallbackTriggerer,isControlled]);var BottomSheetAndDropdownGlueContextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,dropdownHasBottomSheet:dropdownHasBottomSheet,hasAutoCompleteInHeader:hasAutoCompleteInHeader,setDropdownHasBottomSheet:setDropdownHasBottomSheet,onBottomSheetDismiss:close};},[dropdownHasBottomSheet,hasAutoCompleteInHeader,isDropdownOpen,close]);var buttonGroupProps=useButtonGroupContext();var isInsideButtonGroup=Boolean(buttonGroupProps.isInsideButtonGroup);return jsx(BottomSheetAndDropdownGlueContext.Provider,{value:BottomSheetAndDropdownGlueContextValue,children:jsx(DropdownContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:mergeRefs(ref,dropdownContainerRef)},metaAttribute({name:MetaConstants.Dropdown,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{width:_width,children:jsx(BaseBox,Object.assign({position:"relative",textAlign:'left'},isReactNative()&&isInsideButtonGroup?{}:{height:'100%'},{children:children}))}))})});};var Dropdown=assignWithoutSideEffects(React__default.forwardRef(_Dropdown),{componentId:dropdownComponentIds.Dropdown});
|
|
31
|
+
var _excluded=["children","isOpen","onOpenChange","selectionType","testID","_width"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Dropdown/Dropdown.tsx";var validDropdownChildren=[dropdownComponentIds.BaseBox,dropdownComponentIds.triggers.SelectInput,dropdownComponentIds.triggers.SearchInput,dropdownComponentIds.triggers.DropdownButton,dropdownComponentIds.triggers.DropdownIconButton,dropdownComponentIds.triggers.DropdownLink,dropdownComponentIds.DropdownOverlay,dropdownComponentIds.triggers.AutoComplete,ComponentIds.BottomSheet,dropdownComponentIds.triggers.FilterChipSelectInput,dropdownComponentIds.triggers.InputDropdownButton];var _Dropdown=function _Dropdown(_ref,ref){var children=_ref.children,isOpenControlled=_ref.isOpen,onOpenChange=_ref.onOpenChange,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,testID=_ref.testID,_width=_ref._width,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),options=_React$useState2[0],setOptions=_React$useState2[1];var _React$useState3=React__default.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),filteredValues=_React$useState4[0],setFilteredValues=_React$useState4[1];var _React$useState5=React__default.useState([]),_React$useState6=_slicedToArray(_React$useState5,2),selectedIndices=_React$useState6[0],setSelectedIndices=_React$useState6[1];var _React$useState7=React__default.useState([]),_React$useState8=_slicedToArray(_React$useState7,2),controlledValueIndices=_React$useState8[0],setControlledValueIndices=_React$useState8[1];var _React$useState9=React__default.useState(-1),_React$useState0=_slicedToArray(_React$useState9,2),activeIndex=_React$useState0[0],setActiveIndex=_React$useState0[1];var _React$useState1=React__default.useState(-1),_React$useState10=_slicedToArray(_React$useState1,2),activeTagIndex=_React$useState10[0],setActiveTagIndex=_React$useState10[1];var _React$useState11=React__default.useState(false),_React$useState12=_slicedToArray(_React$useState11,2),shouldIgnoreBlurAnimation=_React$useState12[0],setShouldIgnoreBlurAnimation=_React$useState12[1];var _React$useState13=React__default.useState(false),_React$useState14=_slicedToArray(_React$useState13,2),hasFooterAction=_React$useState14[0],setHasFooterAction=_React$useState14[1];var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),hasAutoCompleteInHeader=_React$useState16[0],setHasAutoCompleteInHeader=_React$useState16[1];var _React$useState17=React__default.useState(false),_React$useState18=_slicedToArray(_React$useState17,2),isKeydownPressed=_React$useState18[0],setIsKeydownPressed=_React$useState18[1];var _React$useState19=React__default.useState(0),_React$useState20=_slicedToArray(_React$useState19,2),changeCallbackTriggerer=_React$useState20[0],setChangeCallbackTriggerer=_React$useState20[1];var _React$useState21=React__default.useState(false),_React$useState22=_slicedToArray(_React$useState21,2),isControlled=_React$useState22[0],setIsControlled=_React$useState22[1];var _React$useState23=React__default.useState(false),_React$useState24=_slicedToArray(_React$useState23,2),dropdownHasBottomSheet=_React$useState24[0],setDropdownHasBottomSheet=_React$useState24[1];var triggererWrapperRef=React__default.useRef(null);var triggererRef=React__default.useRef(null);var headerAutoCompleteRef=React__default.useRef(null);var actionListItemRef=React__default.useRef(null);var dropdownTriggerer=React__default.useRef();var isTagDismissedRef=React__default.useRef({value:false});var visibleTagsCountRef=React__default.useRef({value:0});var dropdownContainerRef=React__default.useRef(null);var treeViewControllerRef=React__default.useRef(null);var dropdownBaseId=useId('dropdown');var isDropdownOpenRef=React__default.useRef(isOpenControlled);var _useControllableState=useControllableState({value:isOpenControlled,defaultValue:false,onChange:function onChange(isOpenControlledValue){isDropdownOpenRef.current=isOpenControlledValue;onOpenChange==null?void 0:onOpenChange(isOpenControlledValue);}}),_useControllableState2=_slicedToArray(_useControllableState,2),isDropdownOpen=_useControllableState2[0],setIsDropdownOpen=_useControllableState2[1];isDropdownOpenRef.current=isDropdownOpen;var setIsOpen=function setIsOpen(isOpenValue){isDropdownOpenRef.current=isOpenValue;setIsDropdownOpen(function(){return isOpenValue;});};var close=React__default.useCallback(function(){setActiveTagIndex(-1);setIsOpen(false);},[]);React__default.Children.map(children,function(child){if(React__default.isValidElement(child)){if(__DEV__){var _getComponentId;if(!validDropdownChildren.includes((_getComponentId=getComponentId(child))!=null?_getComponentId:'')){throwBladeError({message:`Dropdown can only have one of following elements as children - \n\n ${validDropdownChildren.join(', ')} \n\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,moduleName:'Dropdown'});}}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SelectInput)){dropdownTriggerer.current='SelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SearchInput)){dropdownTriggerer.current='SearchInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownButton)){dropdownTriggerer.current='DropdownButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownIconButton)){dropdownTriggerer.current='DropdownIconButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.AutoComplete)){dropdownTriggerer.current='AutoComplete';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.FilterChipSelectInput)){dropdownTriggerer.current='FilterChipSelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.InputDropdownButton)){dropdownTriggerer.current='InputDropdownButton';}}});var contextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,controlledValueIndices:controlledValueIndices,setControlledValueIndices:setControlledValueIndices,options:options,setOptions:setOptions,filteredValues:filteredValues,setFilteredValues:setFilteredValues,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,dropdownBaseId:dropdownBaseId,triggererRef:triggererRef,headerAutoCompleteRef:headerAutoCompleteRef,triggererWrapperRef:triggererWrapperRef,actionListItemRef:actionListItemRef,selectionType:selectionType,hasFooterAction:hasFooterAction,setHasFooterAction:setHasFooterAction,hasAutoCompleteInHeader:hasAutoCompleteInHeader,setHasAutoCompleteInHeader:setHasAutoCompleteInHeader,dropdownTriggerer:dropdownTriggerer.current,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,setIsControlled:setIsControlled,isTagDismissedRef:isTagDismissedRef,treeViewControllerRef:treeViewControllerRef};},[isDropdownOpen,isOpenControlled,selectedIndices,controlledValueIndices,options,filteredValues,activeIndex,activeTagIndex,shouldIgnoreBlurAnimation,selectionType,hasFooterAction,isKeydownPressed,changeCallbackTriggerer,isControlled]);var BottomSheetAndDropdownGlueContextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,dropdownHasBottomSheet:dropdownHasBottomSheet,hasAutoCompleteInHeader:hasAutoCompleteInHeader,setDropdownHasBottomSheet:setDropdownHasBottomSheet,onBottomSheetDismiss:close};},[dropdownHasBottomSheet,hasAutoCompleteInHeader,isDropdownOpen,close]);var buttonGroupProps=useButtonGroupContext();var isInsideButtonGroup=Boolean(buttonGroupProps.isInsideButtonGroup);return jsx(BottomSheetAndDropdownGlueContext.Provider,{value:BottomSheetAndDropdownGlueContextValue,children:jsx(DropdownContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:mergeRefs(ref,dropdownContainerRef)},metaAttribute({name:MetaConstants.Dropdown,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{width:_width,children:jsx(BaseBox,Object.assign({position:"relative",textAlign:'left'},isReactNative()&&isInsideButtonGroup?{}:{height:'100%'},{children:children}))}))})});};var Dropdown=assignWithoutSideEffects(React__default.forwardRef(_Dropdown),{componentId:dropdownComponentIds.Dropdown});
|
|
32
32
|
|
|
33
33
|
export { Dropdown };
|
|
34
34
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../../../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownContext } from './useDropdown';\nimport type { DropdownContextType } from './useDropdown';\nimport type { DropdownProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { useId } from '~utils/useId';\nimport { ComponentIds as bottomSheetComponentIds } from '~components/BottomSheet/componentIds';\nimport { BottomSheetAndDropdownGlueContext } from '~components/BottomSheet/BottomSheetContext';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { throwBladeError } from '~utils/logger';\nimport type { BladeElementRef, ContainerElementType } from '~utils/types';\nimport { useControllableState } from '~utils/useControllable';\nimport { mergeRefs } from '~utils/useMergeRefs';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useButtonGroupContext } from '~components/ButtonGroup/ButtonGroupContext';\nimport { isReactNative } from '~utils';\n\nconst validDropdownChildren = [\n // TODO: Remove Box once CountrySelector's button sizing is fixed\n dropdownComponentIds.BaseBox,\n dropdownComponentIds.triggers.SelectInput,\n dropdownComponentIds.triggers.SearchInput,\n dropdownComponentIds.triggers.DropdownButton,\n dropdownComponentIds.triggers.DropdownIconButton,\n dropdownComponentIds.triggers.DropdownLink,\n dropdownComponentIds.DropdownOverlay,\n dropdownComponentIds.triggers.AutoComplete,\n bottomSheetComponentIds.BottomSheet,\n dropdownComponentIds.triggers.FilterChipSelectInput,\n dropdownComponentIds.triggers.InputDropdownButton,\n];\n\n/**\n * ### Dropdown component\n *\n * Dropdown component is generic component that controls the dropdown functionality.\n * It can be used with multiple triggers and mostly contains ActionList component inside it\n *\n * ---\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown selectionType=\"single\">\n * <SelectInput />\n * <DropdownOverlay>\n * <ActionList>\n * <ActionListItem />\n * <ActionListItem />\n * </ActionList>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-dropdown-with-select--with-single-select Dropdown Documentation}\n */\nconst _Dropdown = (\n {\n children,\n isOpen: isOpenControlled,\n onOpenChange,\n selectionType = 'single',\n testID,\n _width,\n ...rest\n }: DropdownProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const [options, setOptions] = React.useState<DropdownContextType['options']>([]);\n const [filteredValues, setFilteredValues] = React.useState<string[]>([]);\n const [selectedIndices, setSelectedIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [controlledValueIndices, setControlledValueIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [activeIndex, setActiveIndex] = React.useState(-1);\n const [activeTagIndex, setActiveTagIndex] = React.useState(-1);\n const [shouldIgnoreBlurAnimation, setShouldIgnoreBlurAnimation] = React.useState(false);\n const [hasFooterAction, setHasFooterAction] = React.useState(false);\n const [hasAutoCompleteInHeader, setHasAutoCompleteInHeader] = React.useState(false);\n const [isKeydownPressed, setIsKeydownPressed] = React.useState(false);\n const [changeCallbackTriggerer, setChangeCallbackTriggerer] = React.useState<\n DropdownContextType['changeCallbackTriggerer']\n >(0);\n const [isControlled, setIsControlled] = React.useState(false);\n // keep track if dropdown contains bottomsheet\n const [dropdownHasBottomSheet, setDropdownHasBottomSheet] = React.useState(false);\n\n /**\n * In inputs, actual input is smaller than the visible input wrapper.\n * You can set this reference in such cases so floating ui calculations happen correctly\n * */\n const triggererWrapperRef = React.useRef<ContainerElementType>(null);\n const triggererRef = React.useRef<HTMLButtonElement>(null);\n const headerAutoCompleteRef = React.useRef<HTMLButtonElement>(null);\n const actionListItemRef = React.useRef<HTMLDivElement>(null);\n const dropdownTriggerer = React.useRef<DropdownContextType['dropdownTriggerer']>();\n const isTagDismissedRef = React.useRef<{ value: boolean } | null>({ value: false });\n const visibleTagsCountRef = React.useRef<{ value: number }>({ value: 0 });\n const dropdownContainerRef = React.useRef<HTMLDivElement>(null);\n\n const dropdownBaseId = useId('dropdown');\n const isDropdownOpenRef = React.useRef(isOpenControlled);\n\n const [isDropdownOpen, setIsDropdownOpen] = useControllableState({\n value: isOpenControlled,\n defaultValue: false,\n onChange: (isOpenControlledValue) => {\n isDropdownOpenRef.current = isOpenControlledValue;\n onOpenChange?.(isOpenControlledValue);\n },\n });\n\n isDropdownOpenRef.current = isDropdownOpen;\n\n const setIsOpen = (isOpenValue: boolean): void => {\n isDropdownOpenRef.current = isOpenValue;\n setIsDropdownOpen(() => isOpenValue);\n };\n\n const close = React.useCallback(() => {\n setActiveTagIndex(-1);\n setIsOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n if (__DEV__) {\n if (!validDropdownChildren.includes(getComponentId(child) ?? '')) {\n throwBladeError({\n message: `Dropdown can only have one of following elements as children - \\n\\n ${validDropdownChildren.join(\n ', ',\n )} \\n\\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,\n moduleName: 'Dropdown',\n });\n }\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SelectInput)) {\n dropdownTriggerer.current = 'SelectInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SearchInput)) {\n dropdownTriggerer.current = 'SearchInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownButton)) {\n dropdownTriggerer.current = 'DropdownButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownIconButton)) {\n dropdownTriggerer.current = 'DropdownIconButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.AutoComplete)) {\n dropdownTriggerer.current = 'AutoComplete';\n }\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.FilterChipSelectInput)) {\n dropdownTriggerer.current = 'FilterChipSelectInput';\n }\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.InputDropdownButton)) {\n dropdownTriggerer.current = 'InputDropdownButton';\n }\n }\n });\n\n const contextValue = React.useMemo<DropdownContextType>(\n () => ({\n isOpen: isDropdownOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n controlledValueIndices,\n setControlledValueIndices,\n options,\n setOptions,\n filteredValues,\n setFilteredValues,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n isKeydownPressed,\n setIsKeydownPressed,\n dropdownBaseId,\n triggererRef,\n headerAutoCompleteRef,\n triggererWrapperRef,\n actionListItemRef,\n selectionType,\n hasFooterAction,\n setHasFooterAction,\n hasAutoCompleteInHeader,\n setHasAutoCompleteInHeader,\n dropdownTriggerer: dropdownTriggerer.current,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setIsControlled,\n isTagDismissedRef,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n isDropdownOpen,\n isOpenControlled,\n selectedIndices,\n controlledValueIndices,\n options,\n filteredValues,\n activeIndex,\n activeTagIndex,\n shouldIgnoreBlurAnimation,\n selectionType,\n hasFooterAction,\n isKeydownPressed,\n changeCallbackTriggerer,\n isControlled,\n ],\n );\n\n const BottomSheetAndDropdownGlueContextValue = React.useMemo((): BottomSheetAndDropdownGlueContext => {\n return {\n isOpen: isDropdownOpen,\n dropdownHasBottomSheet,\n hasAutoCompleteInHeader,\n setDropdownHasBottomSheet,\n // This is the dismiss function which will be injected into the BottomSheet\n // Basically <BottomSheet onDismiss={onBottomSheetDismiss} />\n onBottomSheetDismiss: close,\n };\n }, [dropdownHasBottomSheet, hasAutoCompleteInHeader, isDropdownOpen, close]);\n\n // Inside ButtonGroup (split-button), `height: 100%` resolves against the\n // Storybook/screen parent on React Native and stretches the whole group\n // into a tall vertical strip. Keep content-sized height in that case.\n const buttonGroupProps = useButtonGroupContext();\n const isInsideButtonGroup = Boolean(buttonGroupProps.isInsideButtonGroup);\n\n return (\n <BottomSheetAndDropdownGlueContext.Provider value={BottomSheetAndDropdownGlueContextValue}>\n <DropdownContext.Provider value={contextValue}>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={mergeRefs(ref, dropdownContainerRef as any)}\n {...metaAttribute({ name: MetaConstants.Dropdown, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n width={_width}\n >\n <BaseBox\n position=\"relative\"\n textAlign={'left' as never}\n {...(isReactNative() && isInsideButtonGroup ? {} : { height: '100%' })}\n >\n {children}\n </BaseBox>\n </BaseBox>\n </DropdownContext.Provider>\n </BottomSheetAndDropdownGlueContext.Provider>\n );\n};\n\nconst Dropdown = assignWithoutSideEffects(React.forwardRef(_Dropdown), {\n componentId: dropdownComponentIds.Dropdown,\n});\n\nexport { Dropdown };\n"],"names":["this","validDropdownChildren","dropdownComponentIds","BaseBox","triggers","SelectInput","SearchInput","DropdownButton","DropdownIconButton","DropdownLink","DropdownOverlay","AutoComplete","bottomSheetComponentIds","BottomSheet","FilterChipSelectInput","InputDropdownButton","_Dropdown","_ref","ref","children","isOpenControlled","isOpen","onOpenChange","_ref$selectionType","selectionType","testID","_width","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","options","setOptions","_React$useState3","_React$useState4","filteredValues","setFilteredValues","_React$useState5","_React$useState6","selectedIndices","setSelectedIndices","_React$useState7","_React$useState8","controlledValueIndices","setControlledValueIndices","_React$useState9","_React$useState0","activeIndex","setActiveIndex","_React$useState1","_React$useState10","activeTagIndex","setActiveTagIndex","_React$useState11","_React$useState12","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","_React$useState13","_React$useState14","hasFooterAction","setHasFooterAction","_React$useState15","_React$useState16","hasAutoCompleteInHeader","setHasAutoCompleteInHeader","_React$useState17","_React$useState18","isKeydownPressed","setIsKeydownPressed","_React$useState19","_React$useState20","changeCallbackTriggerer","setChangeCallbackTriggerer","_React$useState21","_React$useState22","isControlled","setIsControlled","_React$useState23","_React$useState24","dropdownHasBottomSheet","setDropdownHasBottomSheet","triggererWrapperRef","useRef","triggererRef","headerAutoCompleteRef","actionListItemRef","dropdownTriggerer","isTagDismissedRef","value","visibleTagsCountRef","dropdownContainerRef","dropdownBaseId","useId","isDropdownOpenRef","_useControllableState","useControllableState","defaultValue","onChange","isOpenControlledValue","current","_useControllableState2","isDropdownOpen","setIsDropdownOpen","setIsOpen","isOpenValue","close","useCallback","Children","map","child","isValidElement","__DEV__","_getComponentId","includes","getComponentId","throwBladeError","message","join","moduleName","isValidAllowedChildren","contextValue","useMemo","BottomSheetAndDropdownGlueContextValue","onBottomSheetDismiss","buttonGroupProps","useButtonGroupContext","isInsideButtonGroup","Boolean","_jsx","BottomSheetAndDropdownGlueContext","Provider","DropdownContext","Object","assign","mergeRefs","metaAttribute","name","MetaConstants","Dropdown","getStyledProps","makeAnalyticsAttribute","width","position","textAlign","isReactNative","height","assignWithoutSideEffects","forwardRef","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,QAAA,CAAA,cAAA,CAAA,eAAA,CAAA,QAAA,CAAA,QAAA,CAAA,CAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,mFAAA,CAqBA,IAAMC,qBAAqB,CAAG,CAE5BC,oBAAoB,CAACC,OAAO,CAC5BD,oBAAoB,CAACE,QAAQ,CAACC,WAAW,CACzCH,oBAAoB,CAACE,QAAQ,CAACE,WAAW,CACzCJ,oBAAoB,CAACE,QAAQ,CAACG,cAAc,CAC5CL,oBAAoB,CAACE,QAAQ,CAACI,kBAAkB,CAChDN,oBAAoB,CAACE,QAAQ,CAACK,YAAY,CAC1CP,oBAAoB,CAACQ,eAAe,CACpCR,oBAAoB,CAACE,QAAQ,CAACO,YAAY,CAC1CC,YAAuB,CAACC,WAAW,CACnCX,oBAAoB,CAACE,QAAQ,CAACU,qBAAqB,CACnDZ,oBAAoB,CAACE,QAAQ,CAACW,mBAAmB,CAClD,CA4BD,IAAMC,SAAS,CAAG,SAAZA,SAASA,CAAAC,IAAA,CAUbC,GAA+B,CACR,CAAA,IATrBC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACAC,gBAAgB,CAAAH,IAAA,CAAxBI,MAAM,CACNC,YAAY,CAAAL,IAAA,CAAZK,YAAY,CAAAC,kBAAA,CAAAN,IAAA,CACZO,aAAa,CAAbA,aAAa,CAAAD,kBAAA,UAAG,QAAQ,CAAAA,kBAAA,CACxBE,MAAM,CAAAR,IAAA,CAANQ,MAAM,CACNC,MAAM,CAAAT,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,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../../../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownContext } from './useDropdown';\nimport type { DropdownContextType } from './useDropdown';\nimport type { DropdownProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { useId } from '~utils/useId';\nimport { ComponentIds as bottomSheetComponentIds } from '~components/BottomSheet/componentIds';\nimport { BottomSheetAndDropdownGlueContext } from '~components/BottomSheet/BottomSheetContext';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { throwBladeError } from '~utils/logger';\nimport type { BladeElementRef, ContainerElementType } from '~utils/types';\nimport { useControllableState } from '~utils/useControllable';\nimport { mergeRefs } from '~utils/useMergeRefs';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useButtonGroupContext } from '~components/ButtonGroup/ButtonGroupContext';\nimport { isReactNative } from '~utils';\n\nconst validDropdownChildren = [\n // TODO: Remove Box once CountrySelector's button sizing is fixed\n dropdownComponentIds.BaseBox,\n dropdownComponentIds.triggers.SelectInput,\n dropdownComponentIds.triggers.SearchInput,\n dropdownComponentIds.triggers.DropdownButton,\n dropdownComponentIds.triggers.DropdownIconButton,\n dropdownComponentIds.triggers.DropdownLink,\n dropdownComponentIds.DropdownOverlay,\n dropdownComponentIds.triggers.AutoComplete,\n bottomSheetComponentIds.BottomSheet,\n dropdownComponentIds.triggers.FilterChipSelectInput,\n dropdownComponentIds.triggers.InputDropdownButton,\n];\n\n/**\n * ### Dropdown component\n *\n * Dropdown component is generic component that controls the dropdown functionality.\n * It can be used with multiple triggers and mostly contains ActionList component inside it\n *\n * ---\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown selectionType=\"single\">\n * <SelectInput />\n * <DropdownOverlay>\n * <ActionList>\n * <ActionListItem />\n * <ActionListItem />\n * </ActionList>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-dropdown-with-select--with-single-select Dropdown Documentation}\n */\nconst _Dropdown = (\n {\n children,\n isOpen: isOpenControlled,\n onOpenChange,\n selectionType = 'single',\n testID,\n _width,\n ...rest\n }: DropdownProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const [options, setOptions] = React.useState<DropdownContextType['options']>([]);\n const [filteredValues, setFilteredValues] = React.useState<string[]>([]);\n const [selectedIndices, setSelectedIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [controlledValueIndices, setControlledValueIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [activeIndex, setActiveIndex] = React.useState(-1);\n const [activeTagIndex, setActiveTagIndex] = React.useState(-1);\n const [shouldIgnoreBlurAnimation, setShouldIgnoreBlurAnimation] = React.useState(false);\n const [hasFooterAction, setHasFooterAction] = React.useState(false);\n const [hasAutoCompleteInHeader, setHasAutoCompleteInHeader] = React.useState(false);\n const [isKeydownPressed, setIsKeydownPressed] = React.useState(false);\n const [changeCallbackTriggerer, setChangeCallbackTriggerer] = React.useState<\n DropdownContextType['changeCallbackTriggerer']\n >(0);\n const [isControlled, setIsControlled] = React.useState(false);\n // keep track if dropdown contains bottomsheet\n const [dropdownHasBottomSheet, setDropdownHasBottomSheet] = React.useState(false);\n\n /**\n * In inputs, actual input is smaller than the visible input wrapper.\n * You can set this reference in such cases so floating ui calculations happen correctly\n * */\n const triggererWrapperRef = React.useRef<ContainerElementType>(null);\n const triggererRef = React.useRef<HTMLButtonElement>(null);\n const headerAutoCompleteRef = React.useRef<HTMLButtonElement>(null);\n const actionListItemRef = React.useRef<HTMLDivElement>(null);\n const dropdownTriggerer = React.useRef<DropdownContextType['dropdownTriggerer']>();\n const isTagDismissedRef = React.useRef<{ value: boolean } | null>({ value: false });\n const visibleTagsCountRef = React.useRef<{ value: number }>({ value: 0 });\n const dropdownContainerRef = React.useRef<HTMLDivElement>(null);\n // set by TreeView when it is the overlay content; stays null for every other content\n const treeViewControllerRef = React.useRef<\n DropdownContextType['treeViewControllerRef']['current']\n >(null);\n\n const dropdownBaseId = useId('dropdown');\n const isDropdownOpenRef = React.useRef(isOpenControlled);\n\n const [isDropdownOpen, setIsDropdownOpen] = useControllableState({\n value: isOpenControlled,\n defaultValue: false,\n onChange: (isOpenControlledValue) => {\n isDropdownOpenRef.current = isOpenControlledValue;\n onOpenChange?.(isOpenControlledValue);\n },\n });\n\n isDropdownOpenRef.current = isDropdownOpen;\n\n const setIsOpen = (isOpenValue: boolean): void => {\n isDropdownOpenRef.current = isOpenValue;\n setIsDropdownOpen(() => isOpenValue);\n };\n\n const close = React.useCallback(() => {\n setActiveTagIndex(-1);\n setIsOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n if (__DEV__) {\n if (!validDropdownChildren.includes(getComponentId(child) ?? '')) {\n throwBladeError({\n message: `Dropdown can only have one of following elements as children - \\n\\n ${validDropdownChildren.join(\n ', ',\n )} \\n\\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,\n moduleName: 'Dropdown',\n });\n }\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SelectInput)) {\n dropdownTriggerer.current = 'SelectInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SearchInput)) {\n dropdownTriggerer.current = 'SearchInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownButton)) {\n dropdownTriggerer.current = 'DropdownButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownIconButton)) {\n dropdownTriggerer.current = 'DropdownIconButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.AutoComplete)) {\n dropdownTriggerer.current = 'AutoComplete';\n }\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.FilterChipSelectInput)) {\n dropdownTriggerer.current = 'FilterChipSelectInput';\n }\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.InputDropdownButton)) {\n dropdownTriggerer.current = 'InputDropdownButton';\n }\n }\n });\n\n const contextValue = React.useMemo<DropdownContextType>(\n () => ({\n isOpen: isDropdownOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n controlledValueIndices,\n setControlledValueIndices,\n options,\n setOptions,\n filteredValues,\n setFilteredValues,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n isKeydownPressed,\n setIsKeydownPressed,\n dropdownBaseId,\n triggererRef,\n headerAutoCompleteRef,\n triggererWrapperRef,\n actionListItemRef,\n selectionType,\n hasFooterAction,\n setHasFooterAction,\n hasAutoCompleteInHeader,\n setHasAutoCompleteInHeader,\n dropdownTriggerer: dropdownTriggerer.current,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setIsControlled,\n isTagDismissedRef,\n treeViewControllerRef,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n isDropdownOpen,\n isOpenControlled,\n selectedIndices,\n controlledValueIndices,\n options,\n filteredValues,\n activeIndex,\n activeTagIndex,\n shouldIgnoreBlurAnimation,\n selectionType,\n hasFooterAction,\n isKeydownPressed,\n changeCallbackTriggerer,\n isControlled,\n ],\n );\n\n const BottomSheetAndDropdownGlueContextValue = React.useMemo((): BottomSheetAndDropdownGlueContext => {\n return {\n isOpen: isDropdownOpen,\n dropdownHasBottomSheet,\n hasAutoCompleteInHeader,\n setDropdownHasBottomSheet,\n // This is the dismiss function which will be injected into the BottomSheet\n // Basically <BottomSheet onDismiss={onBottomSheetDismiss} />\n onBottomSheetDismiss: close,\n };\n }, [dropdownHasBottomSheet, hasAutoCompleteInHeader, isDropdownOpen, close]);\n\n // Inside ButtonGroup (split-button), `height: 100%` resolves against the\n // Storybook/screen parent on React Native and stretches the whole group\n // into a tall vertical strip. Keep content-sized height in that case.\n const buttonGroupProps = useButtonGroupContext();\n const isInsideButtonGroup = Boolean(buttonGroupProps.isInsideButtonGroup);\n\n return (\n <BottomSheetAndDropdownGlueContext.Provider value={BottomSheetAndDropdownGlueContextValue}>\n <DropdownContext.Provider value={contextValue}>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={mergeRefs(ref, dropdownContainerRef as any)}\n {...metaAttribute({ name: MetaConstants.Dropdown, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n width={_width}\n >\n <BaseBox\n position=\"relative\"\n textAlign={'left' as never}\n {...(isReactNative() && isInsideButtonGroup ? {} : { height: '100%' })}\n >\n {children}\n </BaseBox>\n </BaseBox>\n </DropdownContext.Provider>\n </BottomSheetAndDropdownGlueContext.Provider>\n );\n};\n\nconst Dropdown = assignWithoutSideEffects(React.forwardRef(_Dropdown), {\n componentId: dropdownComponentIds.Dropdown,\n});\n\nexport { Dropdown };\n"],"names":["this","validDropdownChildren","dropdownComponentIds","BaseBox","triggers","SelectInput","SearchInput","DropdownButton","DropdownIconButton","DropdownLink","DropdownOverlay","AutoComplete","bottomSheetComponentIds","BottomSheet","FilterChipSelectInput","InputDropdownButton","_Dropdown","_ref","ref","children","isOpenControlled","isOpen","onOpenChange","_ref$selectionType","selectionType","testID","_width","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","options","setOptions","_React$useState3","_React$useState4","filteredValues","setFilteredValues","_React$useState5","_React$useState6","selectedIndices","setSelectedIndices","_React$useState7","_React$useState8","controlledValueIndices","setControlledValueIndices","_React$useState9","_React$useState0","activeIndex","setActiveIndex","_React$useState1","_React$useState10","activeTagIndex","setActiveTagIndex","_React$useState11","_React$useState12","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","_React$useState13","_React$useState14","hasFooterAction","setHasFooterAction","_React$useState15","_React$useState16","hasAutoCompleteInHeader","setHasAutoCompleteInHeader","_React$useState17","_React$useState18","isKeydownPressed","setIsKeydownPressed","_React$useState19","_React$useState20","changeCallbackTriggerer","setChangeCallbackTriggerer","_React$useState21","_React$useState22","isControlled","setIsControlled","_React$useState23","_React$useState24","dropdownHasBottomSheet","setDropdownHasBottomSheet","triggererWrapperRef","useRef","triggererRef","headerAutoCompleteRef","actionListItemRef","dropdownTriggerer","isTagDismissedRef","value","visibleTagsCountRef","dropdownContainerRef","treeViewControllerRef","dropdownBaseId","useId","isDropdownOpenRef","_useControllableState","useControllableState","defaultValue","onChange","isOpenControlledValue","current","_useControllableState2","isDropdownOpen","setIsDropdownOpen","setIsOpen","isOpenValue","close","useCallback","Children","map","child","isValidElement","__DEV__","_getComponentId","includes","getComponentId","throwBladeError","message","join","moduleName","isValidAllowedChildren","contextValue","useMemo","BottomSheetAndDropdownGlueContextValue","onBottomSheetDismiss","buttonGroupProps","useButtonGroupContext","isInsideButtonGroup","Boolean","_jsx","BottomSheetAndDropdownGlueContext","Provider","DropdownContext","Object","assign","mergeRefs","metaAttribute","name","MetaConstants","Dropdown","getStyledProps","makeAnalyticsAttribute","width","position","textAlign","isReactNative","height","assignWithoutSideEffects","forwardRef","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,QAAA,CAAA,cAAA,CAAA,eAAA,CAAA,QAAA,CAAA,QAAA,CAAA,CAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,mFAAA,CAqBA,IAAMC,qBAAqB,CAAG,CAE5BC,oBAAoB,CAACC,OAAO,CAC5BD,oBAAoB,CAACE,QAAQ,CAACC,WAAW,CACzCH,oBAAoB,CAACE,QAAQ,CAACE,WAAW,CACzCJ,oBAAoB,CAACE,QAAQ,CAACG,cAAc,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A,CAAAC,MAAA,EAENxH,GAAG,CAAEyH,SAAS,CAACzH,GAAG,CAAE4E,oBAA2B,CAAE,CAC7C8C,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,QAAQ,CAAEtH,MAAM,CAANA,MAAO,CAAC,CAAC,CACvDuH,cAAc,CAACrH,IAAI,CAAC,CACpBsH,sBAAsB,CAACtH,IAAI,CAAC,CAAA,CAChCuH,KAAK,CAAExH,MAAO,CAAAP,QAAA,CAEdkH,GAAA,CAAClI,OAAO,CAAAsI,MAAA,CAAAC,MAAA,EACNS,QAAQ,CAAC,UAAU,CACnBC,SAAS,CAAE,MAAgB,CAAA,CACtBC,aAAa,EAAE,EAAIlB,mBAAmB,CAAG,EAAE,CAAG,CAAEmB,MAAM,CAAE,MAAO,CAAC,CAAAnI,CAAAA,QAAA,CAEpEA,QAAQ,EACF,CAAC,CAAA,CACH,CAAC,CACc,CAAC,CACe,CAAC,CAEjD,CAAC,CAEK,IAAA4H,QAAQ,CAAGQ,wBAAwB,CAACxH,cAAK,CAACyH,UAAU,CAACxI,SAAS,CAAC,CAAE,CACrEyI,WAAW,CAAEvJ,oBAAoB,CAAC6I,QACpC,CAAC;;;;"}
|
|
@@ -16,7 +16,7 @@ import { useFirstRender } from '../../utils/useFirstRender.js';
|
|
|
16
16
|
import { jsx } from 'react/jsx-runtime';
|
|
17
17
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
18
18
|
|
|
19
|
-
var _excluded=["onClick","onBlur","onKeyDown","accessibilityLabel","testID","value","onClearButtonClick","label","onChange","name","isDisabled","showClearButton"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Dropdown/FilterChipSelectInput.native.tsx";function _toPropertyKey(t){var i=_toPrimitive(t,"string");return "symbol"==typeof i?i:i+"";}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string"===r?String:Number)(t);}var _FilterChipSelectInput=function _FilterChipSelectInput(props){var idBase=useId('filter-chip-select-input');var _onClick=props.onClick,_onBlur=props.onBlur,onKeyDown=props.onKeyDown,accessibilityLabel=props.accessibilityLabel,testID=props.testID,value=props.value,onClearButtonClick=props.onClearButtonClick,label=props.label,onChange=props.onChange,name=props.name,isDisabled=props.isDisabled,_props$showClearButto=props.showClearButton,showClearButton=_props$showClearButto===void 0?true:_props$showClearButto,rest=_objectWithoutProperties(props,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),uncontrolledInputValue=_React$useState2[0],setUncontrolledInputValue=_React$useState2[1];var isFirstRender=useFirstRender();var _useDropdown=useDropdown(),options=_useDropdown.options,selectedIndices=_useDropdown.selectedIndices,onTriggerClick=_useDropdown.onTriggerClick,onTriggerKeydown=_useDropdown.onTriggerKeydown,dropdownBaseId=_useDropdown.dropdownBaseId,isOpen=_useDropdown.isOpen,activeIndex=_useDropdown.activeIndex,hasFooterAction=_useDropdown.hasFooterAction,triggererRef=_useDropdown.triggererRef,selectionType=_useDropdown.selectionType,isControlled=_useDropdown.isControlled,setSelectedIndices=_useDropdown.setSelectedIndices,controlledValueIndices=_useDropdown.controlledValueIndices,changeCallbackTriggerer=_useDropdown.changeCallbackTriggerer;var isUnControlled=options.length>0&&props.value===undefined;var _useListViewFilterCon=useListViewFilterContext(),listViewSelectedFilters=_useListViewFilterCon.listViewSelectedFilters,setListViewSelectedFilters=_useListViewFilterCon.setListViewSelectedFilters;var _useFilterChipGroupCo=useFilterChipGroupContext(),clearFilterCallbackTriggerer=_useFilterChipGroupCo.clearFilterCallbackTriggerer,setFilterChipGroupSelectedFilters=_useFilterChipGroupCo.setFilterChipGroupSelectedFilters;var getValuesArrayFromIndices=function getValuesArrayFromIndices(){var indices=[];if(isControlled){indices=controlledValueIndices;}else {indices=selectedIndices;}return indices.map(function(i){var _options$i;return (_options$i=options[i])==null?void 0:_options$i.value;}).filter(function(v){return v!==undefined;});};useEffect(function(){var valueNotEmpty=typeof value==='string'&&value.trim()!==''||Array.isArray(value)&&value.length>0;var currentSelectedValues=selectedIndices.map(function(i){var _options$i2;return (_options$i2=options[i])==null?void 0:_options$i2.value;});var isSingleValueSynced=typeof value==='string'&¤tSelectedValues.length===1&¤tSelectedValues[0]===value;var isMultiValueSynced=Array.isArray(value)&&value.length===currentSelectedValues.length&&value.every(function(v){return currentSelectedValues.includes(v);});var isValueAndSelectedIndicesSynced=isSingleValueSynced||isMultiValueSynced;if(isUnControlled){if(listViewSelectedFilters[label]){var savedIndices=listViewSelectedFilters[label];setSelectedIndices(savedIndices);var inputValue=savedIndices.map(function(i){var _options$i3;return (_options$i3=options[i])==null?void 0:_options$i3.value;}).filter(function(v){return v!==undefined;});setUncontrolledInputValue(inputValue);setFilterChipGroupSelectedFilters(function(prev){return prev.includes(label)?prev:[].concat(_toConsumableArray(prev),[label]);});}else {setSelectedIndices([]);}}else if(listViewSelectedFilters[label]){var _savedIndices=listViewSelectedFilters[label];setSelectedIndices(_savedIndices);}else if(
|
|
19
|
+
var _excluded=["onClick","onBlur","onKeyDown","accessibilityLabel","testID","value","onClearButtonClick","label","onChange","name","isDisabled","showClearButton"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Dropdown/FilterChipSelectInput.native.tsx";function _toPropertyKey(t){var i=_toPrimitive(t,"string");return "symbol"==typeof i?i:i+"";}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string"===r?String:Number)(t);}var _FilterChipSelectInput=function _FilterChipSelectInput(props){var idBase=useId('filter-chip-select-input');var _onClick=props.onClick,_onBlur=props.onBlur,onKeyDown=props.onKeyDown,accessibilityLabel=props.accessibilityLabel,testID=props.testID,value=props.value,onClearButtonClick=props.onClearButtonClick,label=props.label,onChange=props.onChange,name=props.name,isDisabled=props.isDisabled,_props$showClearButto=props.showClearButton,showClearButton=_props$showClearButto===void 0?true:_props$showClearButto,rest=_objectWithoutProperties(props,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),uncontrolledInputValue=_React$useState2[0],setUncontrolledInputValue=_React$useState2[1];var isFirstRender=useFirstRender();var _useDropdown=useDropdown(),options=_useDropdown.options,selectedIndices=_useDropdown.selectedIndices,onTriggerClick=_useDropdown.onTriggerClick,onTriggerKeydown=_useDropdown.onTriggerKeydown,dropdownBaseId=_useDropdown.dropdownBaseId,isOpen=_useDropdown.isOpen,activeIndex=_useDropdown.activeIndex,hasFooterAction=_useDropdown.hasFooterAction,triggererRef=_useDropdown.triggererRef,selectionType=_useDropdown.selectionType,isControlled=_useDropdown.isControlled,setSelectedIndices=_useDropdown.setSelectedIndices,controlledValueIndices=_useDropdown.controlledValueIndices,changeCallbackTriggerer=_useDropdown.changeCallbackTriggerer;var isUnControlled=options.length>0&&props.value===undefined;var _useListViewFilterCon=useListViewFilterContext(),listViewSelectedFilters=_useListViewFilterCon.listViewSelectedFilters,setListViewSelectedFilters=_useListViewFilterCon.setListViewSelectedFilters;var _useFilterChipGroupCo=useFilterChipGroupContext(),clearFilterCallbackTriggerer=_useFilterChipGroupCo.clearFilterCallbackTriggerer,setFilterChipGroupSelectedFilters=_useFilterChipGroupCo.setFilterChipGroupSelectedFilters;var getValuesArrayFromIndices=function getValuesArrayFromIndices(){var indices=[];if(isControlled){indices=controlledValueIndices;}else {indices=selectedIndices;}return indices.map(function(i){var _options$i;return (_options$i=options[i])==null?void 0:_options$i.value;}).filter(function(v){return v!==undefined;});};useEffect(function(){var valueNotEmpty=typeof value==='string'&&value.trim()!==''||Array.isArray(value)&&value.length>0;var currentSelectedValues=selectedIndices.map(function(i){var _options$i2;return (_options$i2=options[i])==null?void 0:_options$i2.value;});var isSingleValueSynced=typeof value==='string'&¤tSelectedValues.length===1&¤tSelectedValues[0]===value;var isMultiValueSynced=Array.isArray(value)&&value.length===currentSelectedValues.length&&value.every(function(v){return currentSelectedValues.includes(v);});var isValueAndSelectedIndicesSynced=isSingleValueSynced||isMultiValueSynced;if(isUnControlled){if(listViewSelectedFilters[label]){var savedIndices=listViewSelectedFilters[label];setSelectedIndices(savedIndices);var inputValue=savedIndices.map(function(i){var _options$i3;return (_options$i3=options[i])==null?void 0:_options$i3.value;}).filter(function(v){return v!==undefined;});setUncontrolledInputValue(inputValue);setFilterChipGroupSelectedFilters(function(prev){return prev.includes(label)?prev:[].concat(_toConsumableArray(prev),[label]);});}else {setSelectedIndices([]);}}else if(listViewSelectedFilters[label]){var _savedIndices=listViewSelectedFilters[label];setSelectedIndices(_savedIndices);}else if(!isValueAndSelectedIndicesSynced&&options.length>0){var newSelectedIndices=!valueNotEmpty?[]:options.map(function(option,index){var isSelected=typeof value==='string'?option.value===value:Array.isArray(value)&&value.includes(option.value);return isSelected?index:-1;}).filter(function(index){return index!==-1;});setSelectedIndices(newSelectedIndices);}},[isUnControlled,options,value]);var handleClearButtonClick=function handleClearButtonClick(){var currentValues=getValuesArrayFromIndices();onClearButtonClick==null?void 0:onClearButtonClick({name:name!=null?name:idBase,values:currentValues});onChange==null?void 0:onChange({name:name!=null?name:idBase,values:[]});setFilterChipGroupSelectedFilters(function(prev){return prev.filter(function(filter){return filter!==label;});});setListViewSelectedFilters(function(prev){var _=prev[label],updatedFilters=_objectWithoutProperties(prev,[label].map(_toPropertyKey));return updatedFilters;});setUncontrolledInputValue([]);setSelectedIndices([]);};useEffect(function(){if(clearFilterCallbackTriggerer){handleClearButtonClick();}},[clearFilterCallbackTriggerer]);useEffect(function(){if(!isFirstRender){props.onChange==null?void 0:props.onChange({name:props.name||idBase,values:getValuesArrayFromIndices()});if(isUnControlled){setUncontrolledInputValue(getValuesArrayFromIndices());}}},[changeCallbackTriggerer]);useEffect(function(){var isValueEmpty=selectedIndices.length===0;if(!isFirstRender&&!isValueEmpty){setFilterChipGroupSelectedFilters(function(prev){return prev.includes(label)?prev:[].concat(_toConsumableArray(prev),[label]);});setListViewSelectedFilters(function(prev){return Object.assign({},prev,_defineProperty({},label,selectedIndices));});}else if(!isFirstRender&&isValueEmpty){setFilterChipGroupSelectedFilters(function(prev){return prev.filter(function(filter){return filter!==label;});});setListViewSelectedFilters(function(prev){var _=prev[label],updatedFilters=_objectWithoutProperties(prev,[label].map(_toPropertyKey));return updatedFilters;});}},[changeCallbackTriggerer]);var handleKeyDown=function handleKeyDown(e){onKeyDown==null?void 0:onKeyDown(e);onTriggerKeydown==null?void 0:onTriggerKeydown({event:e});if(e.key==='Escape'){e.preventDefault();e.stopPropagation();}if((e.key==='Enter'||e.key===' ')&&!isOpen){e.preventDefault();e.stopPropagation();onTriggerClick();}};return jsx(BaseFilterChip,Object.assign({label:label,value:getFilterChipDisplayValue({value:props.value,options:options,selectionType:selectionType,uncontrolledInputValue:uncontrolledInputValue}),onClearButtonClick:handleClearButtonClick,showClearButton:showClearButton,selectionType:selectionType},rest,{testID:testID,ref:triggererRef,onKeyDown:handleKeyDown,accessibilityProps:{label:accessibilityLabel!=null?accessibilityLabel:label,hasPopup:getActionListContainerRole(hasFooterAction,'FilterChipSelectInput'),expanded:isOpen,controls:`${dropdownBaseId}-actionlist`,activeDescendant:activeIndex>=0?`${dropdownBaseId}-${activeIndex}`:undefined},onClick:function onClick(e){onTriggerClick();_onClick==null?void 0:_onClick(e);},onBlur:function onBlur(e){_onBlur==null?void 0:_onBlur(e);},isDisabled:isDisabled}));};var FilterChipSelectInput=assignWithoutSideEffects(_FilterChipSelectInput,{componentId:dropdownComponentIds.triggers.FilterChipSelectInput});
|
|
20
20
|
|
|
21
21
|
export { FilterChipSelectInput };
|
|
22
22
|
//# sourceMappingURL=FilterChipSelectInput.native.js.map
|