@banyan_cloud/roots 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +217 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/esm/_virtual/index.js +8 -0
- package/dist/esm/_virtual/index.js.map +1 -0
- package/dist/esm/_virtual/index2.js +8 -0
- package/dist/esm/_virtual/index2.js.map +1 -0
- package/dist/esm/_virtual/react-is.development.js +4 -0
- package/dist/esm/_virtual/react-is.development.js.map +1 -0
- package/dist/esm/_virtual/react-is.production.min.js +4 -0
- package/dist/esm/_virtual/react-is.production.min.js.map +1 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/typeof.js +12 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -0
- package/dist/esm/node_modules/@floating-ui/core/dist/floating-ui.core.js +675 -0
- package/dist/esm/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/dist/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +722 -0
- package/dist/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/dist/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js +221 -0
- package/dist/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js.map +1 -0
- package/dist/esm/node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.esm.js +2183 -0
- package/dist/esm/node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.esm.js.map +1 -0
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +155 -0
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +136 -0
- package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/dist/esm/node_modules/aria-hidden/dist/es2015/index.js +137 -0
- package/dist/esm/node_modules/aria-hidden/dist/es2015/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/addLeadingZeros/index.js +11 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/addLeadingZeros/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/defaultLocale/index.js +6 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/defaultLocale/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/defaultOptions/index.js +7 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/defaultOptions/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/format/formatters/index.js +776 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/format/formatters/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js +84 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/format/longFormatters/index.js +83 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/format/longFormatters/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +19 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js +17 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +19 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +27 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +19 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCWeek/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +37 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/protectedTokens/index.js +22 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/protectedTokens/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/requiredArgs/index.js +8 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/requiredArgs/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/roundingMethods/index.js +16 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/roundingMethods/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +16 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +16 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +25 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +21 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/toInteger/index.js +13 -0
- package/dist/esm/node_modules/date-fns/esm/_lib/toInteger/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/addDays/index.js +39 -0
- package/dist/esm/node_modules/date-fns/esm/addDays/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/addHours/index.js +32 -0
- package/dist/esm/node_modules/date-fns/esm/addHours/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/addMilliseconds/index.js +31 -0
- package/dist/esm/node_modules/date-fns/esm/addMilliseconds/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/addMinutes/index.js +32 -0
- package/dist/esm/node_modules/date-fns/esm/addMinutes/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/addMonths/index.js +65 -0
- package/dist/esm/node_modules/date-fns/esm/addMonths/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/compareAsc/index.js +52 -0
- package/dist/esm/node_modules/date-fns/esm/compareAsc/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/constants/index.js +31 -0
- package/dist/esm/node_modules/date-fns/esm/constants/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInCalendarDays/index.js +51 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInCalendarDays/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +35 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInCalendarMonths/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInDays/index.js +86 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInDays/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInHours/index.js +36 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInHours/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInMilliseconds/index.js +32 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInMilliseconds/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInMinutes/index.js +44 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInMinutes/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInMonths/index.js +60 -0
- package/dist/esm/node_modules/date-fns/esm/differenceInMonths/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/endOfDay/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/endOfDay/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/endOfMonth/index.js +32 -0
- package/dist/esm/node_modules/date-fns/esm/endOfMonth/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/format/index.js +406 -0
- package/dist/esm/node_modules/date-fns/esm/format/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/fromUnixTime/index.js +29 -0
- package/dist/esm/node_modules/date-fns/esm/fromUnixTime/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/getTime/index.js +29 -0
- package/dist/esm/node_modules/date-fns/esm/getTime/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/getUnixTime/index.js +27 -0
- package/dist/esm/node_modules/date-fns/esm/getUnixTime/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isAfter/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/isAfter/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isBefore/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/isBefore/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isDate/index.js +42 -0
- package/dist/esm/node_modules/date-fns/esm/isDate/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isEqual/index.js +33 -0
- package/dist/esm/node_modules/date-fns/esm/isEqual/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isLastDayOfMonth/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/isLastDayOfMonth/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isSameDay/index.js +40 -0
- package/dist/esm/node_modules/date-fns/esm/isSameDay/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isToday/index.js +31 -0
- package/dist/esm/node_modules/date-fns/esm/isToday/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/isValid/index.js +46 -0
- package/dist/esm/node_modules/date-fns/esm/isValid/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js +12 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js +21 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js +45 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js +20 -0
- package/dist/esm/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js +86 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js +38 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js +15 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js +147 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js +102 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/index.js +31 -0
- package/dist/esm/node_modules/date-fns/esm/locale/en-US/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/startOfDay/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/startOfDay/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/sub/index.js +72 -0
- package/dist/esm/node_modules/date-fns/esm/sub/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/subDays/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/subDays/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/subHours/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/subHours/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/subMilliseconds/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/subMilliseconds/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/subMinutes/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/subMinutes/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/subMonths/index.js +30 -0
- package/dist/esm/node_modules/date-fns/esm/subMonths/index.js.map +1 -0
- package/dist/esm/node_modules/date-fns/esm/toDate/index.js +56 -0
- package/dist/esm/node_modules/date-fns/esm/toDate/index.js.map +1 -0
- package/dist/esm/node_modules/object-assign/index.js +100 -0
- package/dist/esm/node_modules/object-assign/index.js.map +1 -0
- package/dist/esm/node_modules/prop-types/checkPropTypes.js +116 -0
- package/dist/esm/node_modules/prop-types/checkPropTypes.js.map +1 -0
- package/dist/esm/node_modules/prop-types/factoryWithThrowingShims.js +75 -0
- package/dist/esm/node_modules/prop-types/factoryWithThrowingShims.js.map +1 -0
- package/dist/esm/node_modules/prop-types/factoryWithTypeCheckers.js +626 -0
- package/dist/esm/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -0
- package/dist/esm/node_modules/prop-types/index.js +26 -0
- package/dist/esm/node_modules/prop-types/index.js.map +1 -0
- package/dist/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +22 -0
- package/dist/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +1 -0
- package/dist/esm/node_modules/prop-types/lib/has.js +12 -0
- package/dist/esm/node_modules/prop-types/lib/has.js.map +1 -0
- package/dist/esm/node_modules/react-is/cjs/react-is.development.js +191 -0
- package/dist/esm/node_modules/react-is/cjs/react-is.development.js.map +1 -0
- package/dist/esm/node_modules/react-is/cjs/react-is.production.min.js +27 -0
- package/dist/esm/node_modules/react-is/cjs/react-is.production.min.js.map +1 -0
- package/dist/esm/node_modules/react-is/index.js +22 -0
- package/dist/esm/node_modules/react-is/index.js.map +1 -0
- package/dist/esm/node_modules/react-merge-refs/dist/index.js +4 -0
- package/dist/esm/node_modules/react-merge-refs/dist/index.js.map +1 -0
- package/dist/esm/node_modules/rollup-plugin-styles/dist/runtime/inject-css.js +4 -0
- package/dist/esm/node_modules/rollup-plugin-styles/dist/runtime/inject-css.js.map +1 -0
- package/dist/esm/src/components/Toggle/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/Toggle/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/Toggle/Skeleton/Toggle.skeleton.js +29 -0
- package/dist/esm/src/components/Toggle/Skeleton/Toggle.skeleton.js.map +1 -0
- package/dist/esm/src/components/Toggle/Toggle.js +205 -0
- package/dist/esm/src/components/Toggle/Toggle.js.map +1 -0
- package/dist/esm/src/components/Toggle/Toggle.module.css.js +8 -0
- package/dist/esm/src/components/Toggle/Toggle.module.css.js.map +1 -0
- package/dist/esm/src/components/Toggle/Togglev2.js +172 -0
- package/dist/esm/src/components/Toggle/Togglev2.js.map +1 -0
- package/dist/esm/src/components/Toggle/Togglev2.module.css.js +8 -0
- package/dist/esm/src/components/Toggle/Togglev2.module.css.js.map +1 -0
- package/dist/esm/src/components/accordion/Accordion.js +141 -0
- package/dist/esm/src/components/accordion/Accordion.js.map +1 -0
- package/dist/esm/src/components/accordion/Accordion.module.css.js +8 -0
- package/dist/esm/src/components/accordion/Accordion.module.css.js.map +1 -0
- package/dist/esm/src/components/alert/Alert.js +255 -0
- package/dist/esm/src/components/alert/Alert.js.map +1 -0
- package/dist/esm/src/components/alert/Alert.module.css.js +8 -0
- package/dist/esm/src/components/alert/Alert.module.css.js.map +1 -0
- package/dist/esm/src/components/alertV2/Alert.js +261 -0
- package/dist/esm/src/components/alertV2/Alert.js.map +1 -0
- package/dist/esm/src/components/alertV2/Alert.module.css.js +8 -0
- package/dist/esm/src/components/alertV2/Alert.module.css.js.map +1 -0
- package/dist/esm/src/components/breadcrumbs/Breadcrumbs.js +221 -0
- package/dist/esm/src/components/breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/esm/src/components/breadcrumbs/Breadcrumbs.module.css.js +8 -0
- package/dist/esm/src/components/breadcrumbs/Breadcrumbs.module.css.js.map +1 -0
- package/dist/esm/src/components/breadcrumbsv2/Breadcrumbs.js +148 -0
- package/dist/esm/src/components/breadcrumbsv2/Breadcrumbs.js.map +1 -0
- package/dist/esm/src/components/breadcrumbsv2/Breadcrumbs.module.css.js +8 -0
- package/dist/esm/src/components/breadcrumbsv2/Breadcrumbs.module.css.js.map +1 -0
- package/dist/esm/src/components/buttons/baseButton/BaseButton.js +70 -0
- package/dist/esm/src/components/buttons/baseButton/BaseButton.js.map +1 -0
- package/dist/esm/src/components/buttons/baseButton/BaseButton.module.css.js +8 -0
- package/dist/esm/src/components/buttons/baseButton/BaseButton.module.css.js.map +1 -0
- package/dist/esm/src/components/buttons/button/Button.js +57 -0
- package/dist/esm/src/components/buttons/button/Button.js.map +1 -0
- package/dist/esm/src/components/buttons/button/Button.module.css.js +8 -0
- package/dist/esm/src/components/buttons/button/Button.module.css.js.map +1 -0
- package/dist/esm/src/components/buttons/chip/Chip.js +54 -0
- package/dist/esm/src/components/buttons/chip/Chip.js.map +1 -0
- package/dist/esm/src/components/buttons/chip/Chip.module.css.js +8 -0
- package/dist/esm/src/components/buttons/chip/Chip.module.css.js.map +1 -0
- package/dist/esm/src/components/callout/Callout.js +122 -0
- package/dist/esm/src/components/callout/Callout.js.map +1 -0
- package/dist/esm/src/components/callout/Callout.module.css.js +8 -0
- package/dist/esm/src/components/callout/Callout.module.css.js.map +1 -0
- package/dist/esm/src/components/cell/BaseCell.js +58 -0
- package/dist/esm/src/components/cell/BaseCell.js.map +1 -0
- package/dist/esm/src/components/cell/BaseCell.module.css.js +8 -0
- package/dist/esm/src/components/cell/BaseCell.module.css.js.map +1 -0
- package/dist/esm/src/components/cell/BaseCell.types.js +28 -0
- package/dist/esm/src/components/cell/BaseCell.types.js.map +1 -0
- package/dist/esm/src/components/charts/areaChart/BaseAreaChart.js +329 -0
- package/dist/esm/src/components/charts/areaChart/BaseAreaChart.js.map +1 -0
- package/dist/esm/src/components/charts/areaChart/BaseAreaChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/areaChart/BaseAreaChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/capsuleChart/CapsuleChart.js +357 -0
- package/dist/esm/src/components/charts/capsuleChart/CapsuleChart.js.map +1 -0
- package/dist/esm/src/components/charts/capsuleChart/CapsuleChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/capsuleChart/CapsuleChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/heatMapChart/HeatMapChart.js +241 -0
- package/dist/esm/src/components/charts/heatMapChart/HeatMapChart.js.map +1 -0
- package/dist/esm/src/components/charts/heatMapChart/HeatMapChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/heatMapChart/HeatMapChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/heatMapChart/Skeleton/HeatMapChart.skeleton.js +26 -0
- package/dist/esm/src/components/charts/heatMapChart/Skeleton/HeatMapChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/charts/heatMapChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/charts/heatMapChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/horizontalBarChart/BaseHorizontalBarChart.js +286 -0
- package/dist/esm/src/components/charts/horizontalBarChart/BaseHorizontalBarChart.js.map +1 -0
- package/dist/esm/src/components/charts/horizontalBarChart/BaseHorizontalBarChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/horizontalBarChart/BaseHorizontalBarChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/horizontalBarChart/Skeleton/BaseHorizontalBarChart.skeleton.js +27 -0
- package/dist/esm/src/components/charts/horizontalBarChart/Skeleton/BaseHorizontalBarChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/charts/horizontalBarChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/charts/horizontalBarChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/nestedPieChart/NestedPieChart.js +204 -0
- package/dist/esm/src/components/charts/nestedPieChart/NestedPieChart.js.map +1 -0
- package/dist/esm/src/components/charts/nestedPieChart/NestedPieChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/nestedPieChart/NestedPieChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/pieChart/BasePieChart.js +239 -0
- package/dist/esm/src/components/charts/pieChart/BasePieChart.js.map +1 -0
- package/dist/esm/src/components/charts/pieChart/BasePieChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/pieChart/BasePieChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/pieChart/Skeleton/BasePieChart.skeleton.js +41 -0
- package/dist/esm/src/components/charts/pieChart/Skeleton/BasePieChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/charts/pieChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/charts/pieChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/regionChart/BaseRegionChart.js +101 -0
- package/dist/esm/src/components/charts/regionChart/BaseRegionChart.js.map +1 -0
- package/dist/esm/src/components/charts/regionChart/BaseRegionChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/regionChart/BaseRegionChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/stackedPieChart/StackedPieChart.js +268 -0
- package/dist/esm/src/components/charts/stackedPieChart/StackedPieChart.js.map +1 -0
- package/dist/esm/src/components/charts/stackedPieChart/StackedPieChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/stackedPieChart/StackedPieChart.module.css.js.map +1 -0
- package/dist/esm/src/components/charts/verticalBarChart/BaseVerticalBarChart.js +397 -0
- package/dist/esm/src/components/charts/verticalBarChart/BaseVerticalBarChart.js.map +1 -0
- package/dist/esm/src/components/charts/verticalBarChart/BaseVerticalBarChart.module.css.js +8 -0
- package/dist/esm/src/components/charts/verticalBarChart/BaseVerticalBarChart.module.css.js.map +1 -0
- package/dist/esm/src/components/chartsV2/BarChart/BaseVerticalBarChart.js +184 -0
- package/dist/esm/src/components/chartsV2/BarChart/BaseVerticalBarChart.js.map +1 -0
- package/dist/esm/src/components/chartsV2/BarChart/Skeleton/BaseVerticalBarChart.skeleton.js +30 -0
- package/dist/esm/src/components/chartsV2/BarChart/Skeleton/BaseVerticalBarChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/chartsV2/BarChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/chartsV2/BarChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/chartsV2/LineChart/BaseAreaChart.js +306 -0
- package/dist/esm/src/components/chartsV2/LineChart/BaseAreaChart.js.map +1 -0
- package/dist/esm/src/components/chartsV2/LineChart/Skeleton/BaseAreaChart.skeleton.js +52 -0
- package/dist/esm/src/components/chartsV2/LineChart/Skeleton/BaseAreaChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/chartsV2/LineChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/chartsV2/LineChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/chartsV2/capsuleChart/CapsuleChart.js +216 -0
- package/dist/esm/src/components/chartsV2/capsuleChart/CapsuleChart.js.map +1 -0
- package/dist/esm/src/components/chartsV2/capsuleChart/Skeleton/CapsuleChart.skeleton.js +30 -0
- package/dist/esm/src/components/chartsV2/capsuleChart/Skeleton/CapsuleChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/chartsV2/capsuleChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/chartsV2/capsuleChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/chartsV2/nestedPieChart/NestedPieChart.js +167 -0
- package/dist/esm/src/components/chartsV2/nestedPieChart/NestedPieChart.js.map +1 -0
- package/dist/esm/src/components/chartsV2/nestedPieChart/Skeleton/BasePieChart.skeleton.js +41 -0
- package/dist/esm/src/components/chartsV2/nestedPieChart/Skeleton/BasePieChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/chartsV2/nestedPieChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/chartsV2/nestedPieChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/chartsV2/pieChart/BasePieChart.js +380 -0
- package/dist/esm/src/components/chartsV2/pieChart/BasePieChart.js.map +1 -0
- package/dist/esm/src/components/chartsV2/pieChart/BasePieChart.module.css.js +8 -0
- package/dist/esm/src/components/chartsV2/pieChart/BasePieChart.module.css.js.map +1 -0
- package/dist/esm/src/components/chartsV2/pieChart/Skeleton/BasePieChart.skeleton.js +41 -0
- package/dist/esm/src/components/chartsV2/pieChart/Skeleton/BasePieChart.skeleton.js.map +1 -0
- package/dist/esm/src/components/chartsV2/pieChart/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/chartsV2/pieChart/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/codeSnippet/CodeSnippet.js +176 -0
- package/dist/esm/src/components/codeSnippet/CodeSnippet.js.map +1 -0
- package/dist/esm/src/components/codeSnippet/CodeSnippet.module.css.js +8 -0
- package/dist/esm/src/components/codeSnippet/CodeSnippet.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/DatePicker.js +370 -0
- package/dist/esm/src/components/datePicker/DatePicker.js.map +1 -0
- package/dist/esm/src/components/datePicker/DatePicker.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/DatePicker.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/Calender.js +250 -0
- package/dist/esm/src/components/datePicker/calender/Calender.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/Calender.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/calender/Calender.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/Body.js +15 -0
- package/dist/esm/src/components/datePicker/calender/body/Body.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/Body.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/calender/body/Body.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/Dates.js +178 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/Dates.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/Dates.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/Dates.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/assets/index.js +21 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/assets/index.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/utils/index.js +123 -0
- package/dist/esm/src/components/datePicker/calender/body/dates/utils/index.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/days/Days.js +18 -0
- package/dist/esm/src/components/datePicker/calender/body/days/Days.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/body/days/Days.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/calender/body/days/Days.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/footer/Footer.js +35 -0
- package/dist/esm/src/components/datePicker/calender/footer/Footer.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/footer/Footer.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/calender/footer/Footer.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/footer/utils/index.js +55 -0
- package/dist/esm/src/components/datePicker/calender/footer/utils/index.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/header/Header.js +118 -0
- package/dist/esm/src/components/datePicker/calender/header/Header.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/header/Header.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/calender/header/Header.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/header/dateAndTimeSelection/DateAndTimeSelection.js +89 -0
- package/dist/esm/src/components/datePicker/calender/header/dateAndTimeSelection/DateAndTimeSelection.js.map +1 -0
- package/dist/esm/src/components/datePicker/calender/header/dateAndTimeSelection/DateAndTimeSelection.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/calender/header/dateAndTimeSelection/DateAndTimeSelection.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/clockView/ClockView.js +158 -0
- package/dist/esm/src/components/datePicker/clockView/ClockView.js.map +1 -0
- package/dist/esm/src/components/datePicker/clockView/ClockView.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/clockView/ClockView.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/clockView/config/index.js +53 -0
- package/dist/esm/src/components/datePicker/clockView/config/index.js.map +1 -0
- package/dist/esm/src/components/datePicker/customRanges/CustomRanges.js +45 -0
- package/dist/esm/src/components/datePicker/customRanges/CustomRanges.js.map +1 -0
- package/dist/esm/src/components/datePicker/customRanges/CustomRanges.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/customRanges/CustomRanges.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/customRanges/utils/index.js +33 -0
- package/dist/esm/src/components/datePicker/customRanges/utils/index.js.map +1 -0
- package/dist/esm/src/components/datePicker/dateSwitcher/DateSwitcher.js +137 -0
- package/dist/esm/src/components/datePicker/dateSwitcher/DateSwitcher.js.map +1 -0
- package/dist/esm/src/components/datePicker/dateSwitcher/DateSwitcher.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/dateSwitcher/DateSwitcher.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/ranges/Ranges.js +39 -0
- package/dist/esm/src/components/datePicker/ranges/Ranges.js.map +1 -0
- package/dist/esm/src/components/datePicker/ranges/Ranges.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/ranges/Ranges.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/ranges/utils/index.js +33 -0
- package/dist/esm/src/components/datePicker/ranges/utils/index.js.map +1 -0
- package/dist/esm/src/components/datePicker/timeSwitcher/TimeSwitcher.js +96 -0
- package/dist/esm/src/components/datePicker/timeSwitcher/TimeSwitcher.js.map +1 -0
- package/dist/esm/src/components/datePicker/timeSwitcher/TimeSwitcher.module.css.js +8 -0
- package/dist/esm/src/components/datePicker/timeSwitcher/TimeSwitcher.module.css.js.map +1 -0
- package/dist/esm/src/components/datePicker/utils/index.js +129 -0
- package/dist/esm/src/components/datePicker/utils/index.js.map +1 -0
- package/dist/esm/src/components/displayPicture/DisplayPicture.js +31 -0
- package/dist/esm/src/components/displayPicture/DisplayPicture.js.map +1 -0
- package/dist/esm/src/components/displayPicture/DisplayPicture.module.css.js +8 -0
- package/dist/esm/src/components/displayPicture/DisplayPicture.module.css.js.map +1 -0
- package/dist/esm/src/components/errorBoundary/ErrorBoundaryWrapper.js +79 -0
- package/dist/esm/src/components/errorBoundary/ErrorBoundaryWrapper.js.map +1 -0
- package/dist/esm/src/components/errorBoundary/ErrorBoundaryWrapper.module.css.js +8 -0
- package/dist/esm/src/components/errorBoundary/ErrorBoundaryWrapper.module.css.js.map +1 -0
- package/dist/esm/src/components/errorBoundary/assets/index.js +89 -0
- package/dist/esm/src/components/errorBoundary/assets/index.js.map +1 -0
- package/dist/esm/src/components/hierarchy/browser/HierarchyBrowser.js +155 -0
- package/dist/esm/src/components/hierarchy/browser/HierarchyBrowser.js.map +1 -0
- package/dist/esm/src/components/hierarchy/browser/HierarchyBrowser.module.css.js +8 -0
- package/dist/esm/src/components/hierarchy/browser/HierarchyBrowser.module.css.js.map +1 -0
- package/dist/esm/src/components/hierarchy/item/HierarchyItem.js +131 -0
- package/dist/esm/src/components/hierarchy/item/HierarchyItem.js.map +1 -0
- package/dist/esm/src/components/hierarchy/item/HierarchyItem.module.css.js +8 -0
- package/dist/esm/src/components/hierarchy/item/HierarchyItem.module.css.js.map +1 -0
- package/dist/esm/src/components/icons/AlertIcon/AlertIcon.js +154 -0
- package/dist/esm/src/components/icons/AlertIcon/AlertIcon.js.map +1 -0
- package/dist/esm/src/components/icons/AngleDouble/AngleDouble.js +21 -0
- package/dist/esm/src/components/icons/AngleDouble/AngleDouble.js.map +1 -0
- package/dist/esm/src/components/icons/Arrow/Arrow.js +29 -0
- package/dist/esm/src/components/icons/Arrow/Arrow.js.map +1 -0
- package/dist/esm/src/components/icons/Arrow/Arrow.module.css.js +8 -0
- package/dist/esm/src/components/icons/Arrow/Arrow.module.css.js.map +1 -0
- package/dist/esm/src/components/icons/BreadcrumbSeperator/BreadcrumbSeperator.js +20 -0
- package/dist/esm/src/components/icons/BreadcrumbSeperator/BreadcrumbSeperator.js.map +1 -0
- package/dist/esm/src/components/icons/Calender/Calender.js +25 -0
- package/dist/esm/src/components/icons/Calender/Calender.js.map +1 -0
- package/dist/esm/src/components/icons/Caret/Caret.js +34 -0
- package/dist/esm/src/components/icons/Caret/Caret.js.map +1 -0
- package/dist/esm/src/components/icons/ChartsIcon/ChartsIcon.js +713 -0
- package/dist/esm/src/components/icons/ChartsIcon/ChartsIcon.js.map +1 -0
- package/dist/esm/src/components/icons/CheckboxIcon/CheckboxIcon.js +85 -0
- package/dist/esm/src/components/icons/CheckboxIcon/CheckboxIcon.js.map +1 -0
- package/dist/esm/src/components/icons/Chevron/Chevron.js +26 -0
- package/dist/esm/src/components/icons/Chevron/Chevron.js.map +1 -0
- package/dist/esm/src/components/icons/Chevron/Chevron.module.css.js +8 -0
- package/dist/esm/src/components/icons/Chevron/Chevron.module.css.js.map +1 -0
- package/dist/esm/src/components/icons/Clock/Clock.js +40 -0
- package/dist/esm/src/components/icons/Clock/Clock.js.map +1 -0
- package/dist/esm/src/components/icons/Close/Close.js +19 -0
- package/dist/esm/src/components/icons/Close/Close.js.map +1 -0
- package/dist/esm/src/components/icons/ColumnFilter/ColumnFilter.js +151 -0
- package/dist/esm/src/components/icons/ColumnFilter/ColumnFilter.js.map +1 -0
- package/dist/esm/src/components/icons/Columns/Columns.js +22 -0
- package/dist/esm/src/components/icons/Columns/Columns.js.map +1 -0
- package/dist/esm/src/components/icons/Copy/Copy.js +27 -0
- package/dist/esm/src/components/icons/Copy/Copy.js.map +1 -0
- package/dist/esm/src/components/icons/Cross/Cross.js +20 -0
- package/dist/esm/src/components/icons/Cross/Cross.js.map +1 -0
- package/dist/esm/src/components/icons/Delete/Delete.js +20 -0
- package/dist/esm/src/components/icons/Delete/Delete.js.map +1 -0
- package/dist/esm/src/components/icons/Download/Download.js +20 -0
- package/dist/esm/src/components/icons/Download/Download.js.map +1 -0
- package/dist/esm/src/components/icons/Dropdown/DropdownIcon.js +20 -0
- package/dist/esm/src/components/icons/Dropdown/DropdownIcon.js.map +1 -0
- package/dist/esm/src/components/icons/Edit/Edit.js +47 -0
- package/dist/esm/src/components/icons/Edit/Edit.js.map +1 -0
- package/dist/esm/src/components/icons/Email/Email.js +24 -0
- package/dist/esm/src/components/icons/Email/Email.js.map +1 -0
- package/dist/esm/src/components/icons/ExpandArrowAlt/ExpandArrowAlt.js +18 -0
- package/dist/esm/src/components/icons/ExpandArrowAlt/ExpandArrowAlt.js.map +1 -0
- package/dist/esm/src/components/icons/Filter/Filter.js +42 -0
- package/dist/esm/src/components/icons/Filter/Filter.js.map +1 -0
- package/dist/esm/src/components/icons/FilterIcon/FilterIcon.js +20 -0
- package/dist/esm/src/components/icons/FilterIcon/FilterIcon.js.map +1 -0
- package/dist/esm/src/components/icons/FlowChart/FlowChart.js +23 -0
- package/dist/esm/src/components/icons/FlowChart/FlowChart.js.map +1 -0
- package/dist/esm/src/components/icons/HalfShade/HalfShade.js +24 -0
- package/dist/esm/src/components/icons/HalfShade/HalfShade.js.map +1 -0
- package/dist/esm/src/components/icons/HidePassword/HidePassword.js +36 -0
- package/dist/esm/src/components/icons/HidePassword/HidePassword.js.map +1 -0
- package/dist/esm/src/components/icons/Home/Home.js +26 -0
- package/dist/esm/src/components/icons/Home/Home.js.map +1 -0
- package/dist/esm/src/components/icons/Info/Info.js +24 -0
- package/dist/esm/src/components/icons/Info/Info.js.map +1 -0
- package/dist/esm/src/components/icons/MagnifyingGlass/MagnifyingGlass.js +32 -0
- package/dist/esm/src/components/icons/MagnifyingGlass/MagnifyingGlass.js.map +1 -0
- package/dist/esm/src/components/icons/MarkerIcon/MarkerIcon.js +34 -0
- package/dist/esm/src/components/icons/MarkerIcon/MarkerIcon.js.map +1 -0
- package/dist/esm/src/components/icons/MaximizeIcon/Maximize.js +35 -0
- package/dist/esm/src/components/icons/MaximizeIcon/Maximize.js.map +1 -0
- package/dist/esm/src/components/icons/Nut/Nut.js +30 -0
- package/dist/esm/src/components/icons/Nut/Nut.js.map +1 -0
- package/dist/esm/src/components/icons/Password/Password.js +48 -0
- package/dist/esm/src/components/icons/Password/Password.js.map +1 -0
- package/dist/esm/src/components/icons/Plus/Plus.js +20 -0
- package/dist/esm/src/components/icons/Plus/Plus.js.map +1 -0
- package/dist/esm/src/components/icons/RadioIcon/RadioIcon.js +59 -0
- package/dist/esm/src/components/icons/RadioIcon/RadioIcon.js.map +1 -0
- package/dist/esm/src/components/icons/Refresh/Refresh.js +20 -0
- package/dist/esm/src/components/icons/Refresh/Refresh.js.map +1 -0
- package/dist/esm/src/components/icons/Reset/Reset.js +27 -0
- package/dist/esm/src/components/icons/Reset/Reset.js.map +1 -0
- package/dist/esm/src/components/icons/SearchIcon/SearchIcon.js +46 -0
- package/dist/esm/src/components/icons/SearchIcon/SearchIcon.js.map +1 -0
- package/dist/esm/src/components/icons/SelectAll/SelectAll.js +21 -0
- package/dist/esm/src/components/icons/SelectAll/SelectAll.js.map +1 -0
- package/dist/esm/src/components/icons/Server/Server.js +22 -0
- package/dist/esm/src/components/icons/Server/Server.js.map +1 -0
- package/dist/esm/src/components/icons/Settings/Settings.js +20 -0
- package/dist/esm/src/components/icons/Settings/Settings.js.map +1 -0
- package/dist/esm/src/components/icons/Sort/Sort.js +34 -0
- package/dist/esm/src/components/icons/Sort/Sort.js.map +1 -0
- package/dist/esm/src/components/icons/Tick/Tick.js +33 -0
- package/dist/esm/src/components/icons/Tick/Tick.js.map +1 -0
- package/dist/esm/src/components/icons/Trash/Trash.js +35 -0
- package/dist/esm/src/components/icons/Trash/Trash.js.map +1 -0
- package/dist/esm/src/components/icons/UnlockPassword/UnlockPassword.js +48 -0
- package/dist/esm/src/components/icons/UnlockPassword/UnlockPassword.js.map +1 -0
- package/dist/esm/src/components/icons/View/View.js +21 -0
- package/dist/esm/src/components/icons/View/View.js.map +1 -0
- package/dist/esm/src/components/icons/ViewPassword/ViewPassword.js +30 -0
- package/dist/esm/src/components/icons/ViewPassword/ViewPassword.js.map +1 -0
- package/dist/esm/src/components/icons/fullScreen/FullScreen.js +22 -0
- package/dist/esm/src/components/icons/fullScreen/FullScreen.js.map +1 -0
- package/dist/esm/src/components/input/checkbox/CheckBox.js +109 -0
- package/dist/esm/src/components/input/checkbox/CheckBox.js.map +1 -0
- package/dist/esm/src/components/input/checkbox/CheckBox.module.css.js +8 -0
- package/dist/esm/src/components/input/checkbox/CheckBox.module.css.js.map +1 -0
- package/dist/esm/src/components/input/dropdown/Dropdown.js +475 -0
- package/dist/esm/src/components/input/dropdown/Dropdown.js.map +1 -0
- package/dist/esm/src/components/input/dropdown/Dropdown.module.css.js +8 -0
- package/dist/esm/src/components/input/dropdown/Dropdown.module.css.js.map +1 -0
- package/dist/esm/src/components/input/dropdown/dropdown-item/DropdownItem.js +81 -0
- package/dist/esm/src/components/input/dropdown/dropdown-item/DropdownItem.js.map +1 -0
- package/dist/esm/src/components/input/dropdown/dropdown-item/DropdownItem.module.css.js +8 -0
- package/dist/esm/src/components/input/dropdown/dropdown-item/DropdownItem.module.css.js.map +1 -0
- package/dist/esm/src/components/input/dropdownv2/Dropdownv2.js +557 -0
- package/dist/esm/src/components/input/dropdownv2/Dropdownv2.js.map +1 -0
- package/dist/esm/src/components/input/dropdownv2/Dropdownv2.module.css.js +8 -0
- package/dist/esm/src/components/input/dropdownv2/Dropdownv2.module.css.js.map +1 -0
- package/dist/esm/src/components/input/dropdownv2/dropdown-itemv2/DropdownItemv2.js +127 -0
- package/dist/esm/src/components/input/dropdownv2/dropdown-itemv2/DropdownItemv2.js.map +1 -0
- package/dist/esm/src/components/input/dropdownv2/dropdown-itemv2/DropdownItemv2.module.css.js +8 -0
- package/dist/esm/src/components/input/dropdownv2/dropdown-itemv2/DropdownItemv2.module.css.js.map +1 -0
- package/dist/esm/src/components/input/radio/Radio.js +108 -0
- package/dist/esm/src/components/input/radio/Radio.js.map +1 -0
- package/dist/esm/src/components/input/radio/Radio.module.css.js +8 -0
- package/dist/esm/src/components/input/radio/Radio.module.css.js.map +1 -0
- package/dist/esm/src/components/input/richEditor/RichEditor.js +299 -0
- package/dist/esm/src/components/input/richEditor/RichEditor.js.map +1 -0
- package/dist/esm/src/components/input/richEditor/RichEditor.module.css.js +8 -0
- package/dist/esm/src/components/input/richEditor/RichEditor.module.css.js.map +1 -0
- package/dist/esm/src/components/input/richEditor/assets/index.js +156 -0
- package/dist/esm/src/components/input/richEditor/assets/index.js.map +1 -0
- package/dist/esm/src/components/input/slider/Slider.js +124 -0
- package/dist/esm/src/components/input/slider/Slider.js.map +1 -0
- package/dist/esm/src/components/input/slider/Slider.module.css.js +8 -0
- package/dist/esm/src/components/input/slider/Slider.module.css.js.map +1 -0
- package/dist/esm/src/components/input/slider/rangeslider/RangeSlider.js +176 -0
- package/dist/esm/src/components/input/slider/rangeslider/RangeSlider.js.map +1 -0
- package/dist/esm/src/components/input/slider/rangeslider/RangeSlider.module.css.js +8 -0
- package/dist/esm/src/components/input/slider/rangeslider/RangeSlider.module.css.js.map +1 -0
- package/dist/esm/src/components/input/switch/Switch.js +80 -0
- package/dist/esm/src/components/input/switch/Switch.js.map +1 -0
- package/dist/esm/src/components/input/switch/Switch.module.css.js +8 -0
- package/dist/esm/src/components/input/switch/Switch.module.css.js.map +1 -0
- package/dist/esm/src/components/input/textField/TextField.js +212 -0
- package/dist/esm/src/components/input/textField/TextField.js.map +1 -0
- package/dist/esm/src/components/input/textField/TextField.module.css.js +8 -0
- package/dist/esm/src/components/input/textField/TextField.module.css.js.map +1 -0
- package/dist/esm/src/components/input/textFieldv2/TextFieldv2.js +300 -0
- package/dist/esm/src/components/input/textFieldv2/TextFieldv2.js.map +1 -0
- package/dist/esm/src/components/input/textFieldv2/TextFieldv2.module.css.js +8 -0
- package/dist/esm/src/components/input/textFieldv2/TextFieldv2.module.css.js.map +1 -0
- package/dist/esm/src/components/link/Link.js +57 -0
- package/dist/esm/src/components/link/Link.js.map +1 -0
- package/dist/esm/src/components/link/Link.module.css.js +8 -0
- package/dist/esm/src/components/link/Link.module.css.js.map +1 -0
- package/dist/esm/src/components/modal/BaseModal.js +256 -0
- package/dist/esm/src/components/modal/BaseModal.js.map +1 -0
- package/dist/esm/src/components/modal/BaseModal.module.css.js +8 -0
- package/dist/esm/src/components/modal/BaseModal.module.css.js.map +1 -0
- package/dist/esm/src/components/modal/dialogBox/Dialog.module.css.js +8 -0
- package/dist/esm/src/components/modal/dialogBox/Dialog.module.css.js.map +1 -0
- package/dist/esm/src/components/modal/dialogBox/DialogBox.js +176 -0
- package/dist/esm/src/components/modal/dialogBox/DialogBox.js.map +1 -0
- package/dist/esm/src/components/pageHeader/PageHeader.js +52 -0
- package/dist/esm/src/components/pageHeader/PageHeader.js.map +1 -0
- package/dist/esm/src/components/pageHeader/PageHeader.module.css.js +8 -0
- package/dist/esm/src/components/pageHeader/PageHeader.module.css.js.map +1 -0
- package/dist/esm/src/components/pagination/Pagination.class.js +181 -0
- package/dist/esm/src/components/pagination/Pagination.class.js.map +1 -0
- package/dist/esm/src/components/pagination/Pagination.js +405 -0
- package/dist/esm/src/components/pagination/Pagination.js.map +1 -0
- package/dist/esm/src/components/pagination/Pagination.module.css.js +8 -0
- package/dist/esm/src/components/pagination/Pagination.module.css.js.map +1 -0
- package/dist/esm/src/components/paginationv2/Pagination.class.js +181 -0
- package/dist/esm/src/components/paginationv2/Pagination.class.js.map +1 -0
- package/dist/esm/src/components/paginationv2/Paginationv2.js +544 -0
- package/dist/esm/src/components/paginationv2/Paginationv2.js.map +1 -0
- package/dist/esm/src/components/paginationv2/Paginationv2.module.css.js +8 -0
- package/dist/esm/src/components/paginationv2/Paginationv2.module.css.js.map +1 -0
- package/dist/esm/src/components/popover/Popover.js +95 -0
- package/dist/esm/src/components/popover/Popover.js.map +1 -0
- package/dist/esm/src/components/popover/Popover.module.css.js +8 -0
- package/dist/esm/src/components/popover/Popover.module.css.js.map +1 -0
- package/dist/esm/src/components/popper/Popper.js +51 -0
- package/dist/esm/src/components/popper/Popper.js.map +1 -0
- package/dist/esm/src/components/popper/Popper.module.css.js +8 -0
- package/dist/esm/src/components/popper/Popper.module.css.js.map +1 -0
- package/dist/esm/src/components/sidePanel/BaseSidePanel.js +158 -0
- package/dist/esm/src/components/sidePanel/BaseSidePanel.js.map +1 -0
- package/dist/esm/src/components/sidePanel/BaseSidePanel.module.css.js +8 -0
- package/dist/esm/src/components/sidePanel/BaseSidePanel.module.css.js.map +1 -0
- package/dist/esm/src/components/skeleton/Skeleton.js +46 -0
- package/dist/esm/src/components/skeleton/Skeleton.js.map +1 -0
- package/dist/esm/src/components/skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/stepper/Stepper.js +36 -0
- package/dist/esm/src/components/stepper/Stepper.js.map +1 -0
- package/dist/esm/src/components/stepper/Stepper.module.css.js +8 -0
- package/dist/esm/src/components/stepper/Stepper.module.css.js.map +1 -0
- package/dist/esm/src/components/stepper/step/Step.js +129 -0
- package/dist/esm/src/components/stepper/step/Step.js.map +1 -0
- package/dist/esm/src/components/stepper/step/Step.module.css.js +8 -0
- package/dist/esm/src/components/stepper/step/Step.module.css.js.map +1 -0
- package/dist/esm/src/components/table/BaseTable.class.js +48 -0
- package/dist/esm/src/components/table/BaseTable.class.js.map +1 -0
- package/dist/esm/src/components/table/baseTable/BaseTable.js +103 -0
- package/dist/esm/src/components/table/baseTable/BaseTable.js.map +1 -0
- package/dist/esm/src/components/table/baseTable/BaseTable.module.css.js +8 -0
- package/dist/esm/src/components/table/baseTable/BaseTable.module.css.js.map +1 -0
- package/dist/esm/src/components/table/baseTable/Skeleton/BaseTable.skeleton.js +32 -0
- package/dist/esm/src/components/table/baseTable/Skeleton/BaseTable.skeleton.js.map +1 -0
- package/dist/esm/src/components/table/baseTable/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/table/baseTable/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/table/body/TableBody.js +102 -0
- package/dist/esm/src/components/table/body/TableBody.js.map +1 -0
- package/dist/esm/src/components/table/body/TableBody.module.css.js +8 -0
- package/dist/esm/src/components/table/body/TableBody.module.css.js.map +1 -0
- package/dist/esm/src/components/table/cell/TableCell.js +143 -0
- package/dist/esm/src/components/table/cell/TableCell.js.map +1 -0
- package/dist/esm/src/components/table/cell/TableCell.module.css.js +8 -0
- package/dist/esm/src/components/table/cell/TableCell.module.css.js.map +1 -0
- package/dist/esm/src/components/table/header/TableHeader.js +63 -0
- package/dist/esm/src/components/table/header/TableHeader.js.map +1 -0
- package/dist/esm/src/components/table/header/TableHeader.module.css.js +8 -0
- package/dist/esm/src/components/table/header/TableHeader.module.css.js.map +1 -0
- package/dist/esm/src/components/table/placeholders/noData/general/General.js +126 -0
- package/dist/esm/src/components/table/placeholders/noData/general/General.js.map +1 -0
- package/dist/esm/src/components/table/placeholders/noData/general/General.module.css.js +8 -0
- package/dist/esm/src/components/table/placeholders/noData/general/General.module.css.js.map +1 -0
- package/dist/esm/src/components/table/row/TableRow.js +146 -0
- package/dist/esm/src/components/table/row/TableRow.js.map +1 -0
- package/dist/esm/src/components/table/row/TableRow.module.css.js +8 -0
- package/dist/esm/src/components/table/row/TableRow.module.css.js.map +1 -0
- package/dist/esm/src/components/table/table/Table.js +248 -0
- package/dist/esm/src/components/table/table/Table.js.map +1 -0
- package/dist/esm/src/components/table/table/Table.module.css.js +8 -0
- package/dist/esm/src/components/table/table/Table.module.css.js.map +1 -0
- package/dist/esm/src/components/table/table/tableFilters/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/table/table/tableFilters/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/table/table/tableFilters/Skeleton/TableFilters.skeleton.js +40 -0
- package/dist/esm/src/components/table/table/tableFilters/Skeleton/TableFilters.skeleton.js.map +1 -0
- package/dist/esm/src/components/table/table/tableFilters/TableFilters.js +197 -0
- package/dist/esm/src/components/table/table/tableFilters/TableFilters.js.map +1 -0
- package/dist/esm/src/components/table/table/tableFilters/TableFilters.module.css.js +8 -0
- package/dist/esm/src/components/table/table/tableFilters/TableFilters.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/BaseTable.class.js +54 -0
- package/dist/esm/src/components/tableV2/BaseTable.class.js.map +1 -0
- package/dist/esm/src/components/tableV2/baseTable/BaseTable.js +129 -0
- package/dist/esm/src/components/tableV2/baseTable/BaseTable.js.map +1 -0
- package/dist/esm/src/components/tableV2/baseTable/BaseTable.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/baseTable/BaseTable.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/baseTable/Skeleton/BaseTable.skeleton.js +32 -0
- package/dist/esm/src/components/tableV2/baseTable/Skeleton/BaseTable.skeleton.js.map +1 -0
- package/dist/esm/src/components/tableV2/baseTable/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/baseTable/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/body/TableBody.js +116 -0
- package/dist/esm/src/components/tableV2/body/TableBody.js.map +1 -0
- package/dist/esm/src/components/tableV2/body/TableBody.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/body/TableBody.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/cell/TableCell.js +157 -0
- package/dist/esm/src/components/tableV2/cell/TableCell.js.map +1 -0
- package/dist/esm/src/components/tableV2/cell/TableCell.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/cell/TableCell.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/header/TableHeader.js +78 -0
- package/dist/esm/src/components/tableV2/header/TableHeader.js.map +1 -0
- package/dist/esm/src/components/tableV2/header/TableHeader.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/header/TableHeader.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/placeholders/noData/general/General.js +130 -0
- package/dist/esm/src/components/tableV2/placeholders/noData/general/General.js.map +1 -0
- package/dist/esm/src/components/tableV2/placeholders/noData/general/General.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/placeholders/noData/general/General.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/row/TableRow.js +266 -0
- package/dist/esm/src/components/tableV2/row/TableRow.js.map +1 -0
- package/dist/esm/src/components/tableV2/row/TableRow.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/row/TableRow.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/table/Table.js +340 -0
- package/dist/esm/src/components/tableV2/table/Table.js.map +1 -0
- package/dist/esm/src/components/tableV2/table/Table.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/table/Table.module.css.js.map +1 -0
- package/dist/esm/src/components/tableV2/table/tableFilters/TableFilters.js +266 -0
- package/dist/esm/src/components/tableV2/table/tableFilters/TableFilters.js.map +1 -0
- package/dist/esm/src/components/tableV2/table/tableFilters/TableFilters.module.css.js +8 -0
- package/dist/esm/src/components/tableV2/table/tableFilters/TableFilters.module.css.js.map +1 -0
- package/dist/esm/src/components/tabs/Skeleton/Skeleton.module.css.js +8 -0
- package/dist/esm/src/components/tabs/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/esm/src/components/tabs/Skeleton/Tabs.skeleton.js +27 -0
- package/dist/esm/src/components/tabs/Skeleton/Tabs.skeleton.js.map +1 -0
- package/dist/esm/src/components/tabs/Tabs.js +169 -0
- package/dist/esm/src/components/tabs/Tabs.js.map +1 -0
- package/dist/esm/src/components/tabs/Tabs.module.css.js +8 -0
- package/dist/esm/src/components/tabs/Tabs.module.css.js.map +1 -0
- package/dist/esm/src/components/text/Text.js +39 -0
- package/dist/esm/src/components/text/Text.js.map +1 -0
- package/dist/esm/src/components/text/Text.module.css.js +8 -0
- package/dist/esm/src/components/text/Text.module.css.js.map +1 -0
- package/dist/esm/src/components/tooltip/Tooltip.js +128 -0
- package/dist/esm/src/components/tooltip/Tooltip.js.map +1 -0
- package/dist/esm/src/components/tooltip/Tooltip.module.css.js +8 -0
- package/dist/esm/src/components/tooltip/Tooltip.module.css.js.map +1 -0
- package/dist/esm/src/components/widget/BaseV2Widget/BaseV2Widget.js +341 -0
- package/dist/esm/src/components/widget/BaseV2Widget/BaseV2Widget.js.map +1 -0
- package/dist/esm/src/components/widget/BaseV2Widget/BaseV2Widget.module.css.js +8 -0
- package/dist/esm/src/components/widget/BaseV2Widget/BaseV2Widget.module.css.js.map +1 -0
- package/dist/esm/src/components/widget/BaseWidget.js +302 -0
- package/dist/esm/src/components/widget/BaseWidget.js.map +1 -0
- package/dist/esm/src/components/widget/BaseWidget.module.css.js +8 -0
- package/dist/esm/src/components/widget/BaseWidget.module.css.js.map +1 -0
- package/dist/esm/src/components/widget/fallback/WidgetFallback.js +58 -0
- package/dist/esm/src/components/widget/fallback/WidgetFallback.js.map +1 -0
- package/dist/esm/src/components/widget/fallback/WidgetFallback.module.css.js +8 -0
- package/dist/esm/src/components/widget/fallback/WidgetFallback.module.css.js.map +1 -0
- package/dist/esm/src/constants/index.js +6 -0
- package/dist/esm/src/constants/index.js.map +1 -0
- package/dist/esm/src/hooks/useOutsideClickListener.js +18 -0
- package/dist/esm/src/hooks/useOutsideClickListener.js.map +1 -0
- package/dist/esm/src/hooks/useResize.js +49 -0
- package/dist/esm/src/hooks/useResize.js.map +1 -0
- package/dist/esm/src/index.js +119 -0
- package/dist/esm/src/index.js.map +1 -0
- package/dist/esm/src/styles/_colors.exports.module.scss.js +8 -0
- package/dist/esm/src/styles/_colors.exports.module.scss.js.map +1 -0
- package/dist/esm/src/styles/index.js +14 -0
- package/dist/esm/src/styles/index.js.map +1 -0
- package/dist/esm/src/utils/utils.js +479 -0
- package/dist/esm/src/utils/utils.js.map +1 -0
- package/package.json +12 -27
- package/dist/esm/components/displayPicture/DisplayPicture.d.ts +0 -9
- package/dist/esm/components/displayPicture/index.d.ts +0 -1
- package/dist/esm/components/index.d.ts +0 -33
- package/dist/esm/components/text/Text.d.ts +0 -18
- package/dist/esm/components/text/index.d.ts +0 -1
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/index.js +0 -26951
- package/dist/esm/index.js.map +0 -1
|
@@ -0,0 +1,2183 @@
|
|
|
1
|
+
import { useFloating as useFloating$1 } from '../../react-dom/dist/floating-ui.react-dom.esm.js';
|
|
2
|
+
export { arrow } from '../../react-dom/dist/floating-ui.react-dom.esm.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useLayoutEffect, useEffect, useRef } from 'react';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
6
|
+
import { hideOthers } from '../../../aria-hidden/dist/es2015/index.js';
|
|
7
|
+
import { getOverflowAncestors } from '../../utils/dist/floating-ui.utils.dom.js';
|
|
8
|
+
|
|
9
|
+
var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
|
|
10
|
+
|
|
11
|
+
function createPubSub() {
|
|
12
|
+
const map = new Map();
|
|
13
|
+
return {
|
|
14
|
+
emit(event, data) {
|
|
15
|
+
var _map$get;
|
|
16
|
+
|
|
17
|
+
(_map$get = map.get(event)) == null ? void 0 : _map$get.forEach(handler => handler(data));
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
on(event, listener) {
|
|
21
|
+
map.set(event, [...(map.get(event) || []), listener]);
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
off(event, listener) {
|
|
25
|
+
map.set(event, (map.get(event) || []).filter(l => l !== listener));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let serverHandoffComplete = false;
|
|
32
|
+
let count = 0;
|
|
33
|
+
|
|
34
|
+
const genId = () => "floating-ui-" + count++;
|
|
35
|
+
|
|
36
|
+
function useFloatingId() {
|
|
37
|
+
const [id, setId] = React.useState(() => serverHandoffComplete ? genId() : undefined);
|
|
38
|
+
index(() => {
|
|
39
|
+
if (id == null) {
|
|
40
|
+
setId(genId());
|
|
41
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
|
|
43
|
+
}, []);
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
if (!serverHandoffComplete) {
|
|
46
|
+
serverHandoffComplete = true;
|
|
47
|
+
}
|
|
48
|
+
}, []);
|
|
49
|
+
return id;
|
|
50
|
+
} // `toString()` prevents bundlers from trying to `import { useId } from 'react'`
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
const useReactId = React[/*#__PURE__*/'useId'.toString()];
|
|
54
|
+
/**
|
|
55
|
+
* Uses React 18's built-in `useId()` when available, or falls back to a
|
|
56
|
+
* slightly less performant (requiring a double render) implementation for
|
|
57
|
+
* earlier React versions.
|
|
58
|
+
* @see https://floating-ui.com/docs/useId
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
const useId = useReactId != null ? useReactId : useFloatingId;
|
|
62
|
+
|
|
63
|
+
const FloatingNodeContext = /*#__PURE__*/React.createContext(null);
|
|
64
|
+
const FloatingTreeContext = /*#__PURE__*/React.createContext(null);
|
|
65
|
+
const useFloatingParentNodeId = () => {
|
|
66
|
+
var _React$useContext$id, _React$useContext;
|
|
67
|
+
|
|
68
|
+
return (_React$useContext$id = (_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) != null ? _React$useContext$id : null;
|
|
69
|
+
};
|
|
70
|
+
const useFloatingTree = () => React.useContext(FloatingTreeContext);
|
|
71
|
+
|
|
72
|
+
function getDocument(floating) {
|
|
73
|
+
var _floating$ownerDocume;
|
|
74
|
+
|
|
75
|
+
return (_floating$ownerDocume = floating == null ? void 0 : floating.ownerDocument) != null ? _floating$ownerDocume : document;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getWindow(value) {
|
|
79
|
+
var _getDocument$defaultV;
|
|
80
|
+
|
|
81
|
+
return (_getDocument$defaultV = getDocument(value).defaultView) != null ? _getDocument$defaultV : window;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function isElement(value) {
|
|
85
|
+
return value ? value instanceof getWindow(value).Element : false;
|
|
86
|
+
}
|
|
87
|
+
function isHTMLElement(value) {
|
|
88
|
+
return value ? value instanceof getWindow(value).HTMLElement : false;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// `toString()` prevents bundlers from trying to `import { useInsertionEffect } from 'react'`
|
|
92
|
+
const useInsertionEffect = React[/*#__PURE__*/'useInsertionEffect'.toString()];
|
|
93
|
+
function useEvent(callback) {
|
|
94
|
+
const ref = React.useRef(() => {
|
|
95
|
+
if (process.env.NODE_ENV !== "production") {
|
|
96
|
+
throw new Error('Cannot call an event handler while rendering.');
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
if (useInsertionEffect) {
|
|
101
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
102
|
+
useInsertionEffect(() => {
|
|
103
|
+
ref.current = callback;
|
|
104
|
+
});
|
|
105
|
+
} else {
|
|
106
|
+
ref.current = callback;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return React.useCallback(function () {
|
|
110
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
111
|
+
args[_key] = arguments[_key];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return ref.current == null ? void 0 : ref.current(...args);
|
|
115
|
+
}, []);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function useFloating(_temp) {
|
|
119
|
+
let {
|
|
120
|
+
open = false,
|
|
121
|
+
onOpenChange: unstable_onOpenChange,
|
|
122
|
+
whileElementsMounted,
|
|
123
|
+
placement,
|
|
124
|
+
middleware,
|
|
125
|
+
strategy,
|
|
126
|
+
nodeId
|
|
127
|
+
} = _temp === void 0 ? {} : _temp;
|
|
128
|
+
const [domReference, setDomReference] = React.useState(null);
|
|
129
|
+
const tree = useFloatingTree();
|
|
130
|
+
const domReferenceRef = React.useRef(null);
|
|
131
|
+
const dataRef = React.useRef({});
|
|
132
|
+
const events = React.useState(() => createPubSub())[0];
|
|
133
|
+
const position = useFloating$1({
|
|
134
|
+
placement,
|
|
135
|
+
middleware,
|
|
136
|
+
strategy,
|
|
137
|
+
whileElementsMounted
|
|
138
|
+
});
|
|
139
|
+
const onOpenChange = useEvent(unstable_onOpenChange);
|
|
140
|
+
const refs = React.useMemo(() => ({ ...position.refs,
|
|
141
|
+
domReference: domReferenceRef
|
|
142
|
+
}), [position.refs]);
|
|
143
|
+
const context = React.useMemo(() => ({ ...position,
|
|
144
|
+
refs,
|
|
145
|
+
dataRef,
|
|
146
|
+
nodeId,
|
|
147
|
+
events,
|
|
148
|
+
open,
|
|
149
|
+
onOpenChange,
|
|
150
|
+
_: {
|
|
151
|
+
domReference
|
|
152
|
+
}
|
|
153
|
+
}), [position, nodeId, events, open, onOpenChange, refs, domReference]);
|
|
154
|
+
index(() => {
|
|
155
|
+
const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);
|
|
156
|
+
|
|
157
|
+
if (node) {
|
|
158
|
+
node.context = context;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const {
|
|
162
|
+
reference
|
|
163
|
+
} = position;
|
|
164
|
+
const setReference = React.useCallback(node => {
|
|
165
|
+
if (isElement(node) || node === null) {
|
|
166
|
+
context.refs.domReference.current = node;
|
|
167
|
+
setDomReference(node);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
reference(node);
|
|
171
|
+
}, [reference, context.refs]);
|
|
172
|
+
return React.useMemo(() => ({ ...position,
|
|
173
|
+
context,
|
|
174
|
+
refs,
|
|
175
|
+
reference: setReference
|
|
176
|
+
}), [position, refs, context, setReference]);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function mergeProps(userProps, propsList, elementKey) {
|
|
180
|
+
const map = new Map();
|
|
181
|
+
return { ...(elementKey === 'floating' && {
|
|
182
|
+
tabIndex: -1
|
|
183
|
+
}),
|
|
184
|
+
...userProps,
|
|
185
|
+
...propsList.map(value => value ? value[elementKey] : null).concat(userProps).reduce((acc, props) => {
|
|
186
|
+
if (!props) {
|
|
187
|
+
return acc;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
Object.entries(props).forEach(_ref => {
|
|
191
|
+
let [key, value] = _ref;
|
|
192
|
+
|
|
193
|
+
if (key.indexOf('on') === 0) {
|
|
194
|
+
if (!map.has(key)) {
|
|
195
|
+
map.set(key, []);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (typeof value === 'function') {
|
|
199
|
+
var _map$get;
|
|
200
|
+
|
|
201
|
+
(_map$get = map.get(key)) == null ? void 0 : _map$get.push(value);
|
|
202
|
+
|
|
203
|
+
acc[key] = function () {
|
|
204
|
+
var _map$get2;
|
|
205
|
+
|
|
206
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
207
|
+
args[_key] = arguments[_key];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
(_map$get2 = map.get(key)) == null ? void 0 : _map$get2.forEach(fn => fn(...args));
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
acc[key] = value;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return acc;
|
|
218
|
+
}, {})
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const useInteractions = function (propsList) {
|
|
223
|
+
if (propsList === void 0) {
|
|
224
|
+
propsList = [];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// The dependencies are a dynamic array, so we can't use the linter's
|
|
228
|
+
// suggestion to add it to the deps array.
|
|
229
|
+
const deps = propsList;
|
|
230
|
+
const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'), // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
231
|
+
deps);
|
|
232
|
+
const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'), // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
233
|
+
deps);
|
|
234
|
+
const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'), // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
235
|
+
deps);
|
|
236
|
+
return React.useMemo(() => ({
|
|
237
|
+
getReferenceProps,
|
|
238
|
+
getFloatingProps,
|
|
239
|
+
getItemProps
|
|
240
|
+
}), [getReferenceProps, getFloatingProps, getItemProps]);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
function getChildren(nodes, id) {
|
|
244
|
+
var _nodes$filter;
|
|
245
|
+
|
|
246
|
+
let allChildren = (_nodes$filter = nodes.filter(node => {
|
|
247
|
+
var _node$context;
|
|
248
|
+
|
|
249
|
+
return node.parentId === id && ((_node$context = node.context) == null ? void 0 : _node$context.open);
|
|
250
|
+
})) != null ? _nodes$filter : [];
|
|
251
|
+
let currentChildren = allChildren;
|
|
252
|
+
|
|
253
|
+
while (currentChildren.length) {
|
|
254
|
+
var _nodes$filter2;
|
|
255
|
+
|
|
256
|
+
currentChildren = (_nodes$filter2 = nodes.filter(node => {
|
|
257
|
+
var _currentChildren;
|
|
258
|
+
|
|
259
|
+
return (_currentChildren = currentChildren) == null ? void 0 : _currentChildren.some(n => {
|
|
260
|
+
var _node$context2;
|
|
261
|
+
|
|
262
|
+
return node.parentId === n.id && ((_node$context2 = node.context) == null ? void 0 : _node$context2.open);
|
|
263
|
+
});
|
|
264
|
+
})) != null ? _nodes$filter2 : [];
|
|
265
|
+
allChildren = allChildren.concat(currentChildren);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return allChildren;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const DEFAULT_ID = 'floating-ui-root';
|
|
272
|
+
const useFloatingPortalNode = function (_temp) {
|
|
273
|
+
let {
|
|
274
|
+
id = DEFAULT_ID,
|
|
275
|
+
enabled = true
|
|
276
|
+
} = _temp === void 0 ? {} : _temp;
|
|
277
|
+
const [portalEl, setPortalEl] = React.useState(null);
|
|
278
|
+
index(() => {
|
|
279
|
+
if (!enabled) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const rootNode = document.getElementById(id);
|
|
284
|
+
|
|
285
|
+
if (rootNode) {
|
|
286
|
+
setPortalEl(rootNode);
|
|
287
|
+
} else {
|
|
288
|
+
const newPortalEl = document.createElement('div');
|
|
289
|
+
newPortalEl.id = id;
|
|
290
|
+
setPortalEl(newPortalEl);
|
|
291
|
+
|
|
292
|
+
if (!document.body.contains(newPortalEl)) {
|
|
293
|
+
document.body.appendChild(newPortalEl);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}, [id, enabled]);
|
|
297
|
+
return portalEl;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Portals your floating element outside of the main app node.
|
|
301
|
+
* @see https://floating-ui.com/docs/FloatingPortal
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
const FloatingPortal = _ref => {
|
|
305
|
+
let {
|
|
306
|
+
children,
|
|
307
|
+
id = DEFAULT_ID,
|
|
308
|
+
root = null
|
|
309
|
+
} = _ref;
|
|
310
|
+
const portalNode = useFloatingPortalNode({
|
|
311
|
+
id,
|
|
312
|
+
enabled: !root
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
if (root) {
|
|
316
|
+
return /*#__PURE__*/createPortal(children, root);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (portalNode) {
|
|
320
|
+
return /*#__PURE__*/createPortal(children, portalNode);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return null;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
function _extends() {
|
|
327
|
+
_extends = Object.assign || function (target) {
|
|
328
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
329
|
+
var source = arguments[i];
|
|
330
|
+
|
|
331
|
+
for (var key in source) {
|
|
332
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
333
|
+
target[key] = source[key];
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return target;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
return _extends.apply(this, arguments);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Avoid Chrome DevTools blue warning
|
|
345
|
+
function getPlatform() {
|
|
346
|
+
const uaData = navigator.userAgentData;
|
|
347
|
+
|
|
348
|
+
if (uaData != null && uaData.platform) {
|
|
349
|
+
return uaData.platform;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return navigator.platform;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const identifier = 'data-floating-ui-scroll-lock';
|
|
356
|
+
/**
|
|
357
|
+
* Provides base styling for a fixed overlay element to dim content or block
|
|
358
|
+
* pointer events behind a floating element.
|
|
359
|
+
* It's a regular `<div>`, so it can be styled via any CSS solution you prefer.
|
|
360
|
+
* @see https://floating-ui.com/docs/FloatingOverlay
|
|
361
|
+
*/
|
|
362
|
+
|
|
363
|
+
const FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(_ref, ref) {
|
|
364
|
+
let {
|
|
365
|
+
lockScroll = false,
|
|
366
|
+
...rest
|
|
367
|
+
} = _ref;
|
|
368
|
+
index(() => {
|
|
369
|
+
var _window$visualViewpor, _window$visualViewpor2, _window$visualViewpor3, _window$visualViewpor4;
|
|
370
|
+
|
|
371
|
+
if (!lockScroll) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const alreadyLocked = document.body.hasAttribute(identifier);
|
|
376
|
+
|
|
377
|
+
if (alreadyLocked) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
document.body.setAttribute(identifier, ''); // RTL <body> scrollbar
|
|
382
|
+
|
|
383
|
+
const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;
|
|
384
|
+
const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';
|
|
385
|
+
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; // Only iOS doesn't respect `overflow: hidden` on document.body, and this
|
|
386
|
+
// technique has fewer side effects.
|
|
387
|
+
|
|
388
|
+
if (!/iP(hone|ad|od)|iOS/.test(getPlatform())) {
|
|
389
|
+
Object.assign(document.body.style, {
|
|
390
|
+
overflow: 'hidden',
|
|
391
|
+
[paddingProp]: scrollbarWidth + "px"
|
|
392
|
+
});
|
|
393
|
+
return () => {
|
|
394
|
+
document.body.removeAttribute(identifier);
|
|
395
|
+
Object.assign(document.body.style, {
|
|
396
|
+
overflow: '',
|
|
397
|
+
[paddingProp]: ''
|
|
398
|
+
});
|
|
399
|
+
};
|
|
400
|
+
} // iOS 12 does not support `visuaViewport`.
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
const offsetLeft = (_window$visualViewpor = (_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetLeft) != null ? _window$visualViewpor : 0;
|
|
404
|
+
const offsetTop = (_window$visualViewpor3 = (_window$visualViewpor4 = window.visualViewport) == null ? void 0 : _window$visualViewpor4.offsetTop) != null ? _window$visualViewpor3 : 0;
|
|
405
|
+
const scrollX = window.pageXOffset;
|
|
406
|
+
const scrollY = window.pageYOffset;
|
|
407
|
+
Object.assign(document.body.style, {
|
|
408
|
+
position: 'fixed',
|
|
409
|
+
overflow: 'hidden',
|
|
410
|
+
top: -(scrollY - Math.floor(offsetTop)) + "px",
|
|
411
|
+
left: -(scrollX - Math.floor(offsetLeft)) + "px",
|
|
412
|
+
right: '0',
|
|
413
|
+
[paddingProp]: scrollbarWidth + "px"
|
|
414
|
+
});
|
|
415
|
+
return () => {
|
|
416
|
+
Object.assign(document.body.style, {
|
|
417
|
+
position: '',
|
|
418
|
+
overflow: '',
|
|
419
|
+
top: '',
|
|
420
|
+
left: '',
|
|
421
|
+
right: '',
|
|
422
|
+
[paddingProp]: ''
|
|
423
|
+
});
|
|
424
|
+
document.body.removeAttribute(identifier);
|
|
425
|
+
window.scrollTo(scrollX, scrollY);
|
|
426
|
+
};
|
|
427
|
+
}, [lockScroll]);
|
|
428
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
429
|
+
ref: ref
|
|
430
|
+
}, rest, {
|
|
431
|
+
style: {
|
|
432
|
+
position: 'fixed',
|
|
433
|
+
overflow: 'auto',
|
|
434
|
+
top: 0,
|
|
435
|
+
right: 0,
|
|
436
|
+
bottom: 0,
|
|
437
|
+
left: 0,
|
|
438
|
+
...rest.style
|
|
439
|
+
}
|
|
440
|
+
}));
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Find the real active element. Traverses into shadowRoots.
|
|
445
|
+
*/
|
|
446
|
+
function activeElement(doc) {
|
|
447
|
+
let activeElement = doc.activeElement;
|
|
448
|
+
|
|
449
|
+
while (((_activeElement = activeElement) == null ? void 0 : (_activeElement$shadow = _activeElement.shadowRoot) == null ? void 0 : _activeElement$shadow.activeElement) != null) {
|
|
450
|
+
var _activeElement, _activeElement$shadow;
|
|
451
|
+
|
|
452
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
return activeElement;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function getAncestors(nodes, id) {
|
|
459
|
+
var _nodes$find;
|
|
460
|
+
|
|
461
|
+
let allAncestors = [];
|
|
462
|
+
let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;
|
|
463
|
+
|
|
464
|
+
while (currentParentId) {
|
|
465
|
+
const currentNode = nodes.find(node => node.id === currentParentId);
|
|
466
|
+
currentParentId = currentNode == null ? void 0 : currentNode.parentId;
|
|
467
|
+
|
|
468
|
+
if (currentNode) {
|
|
469
|
+
allAncestors = allAncestors.concat(currentNode);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return allAncestors;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function getTarget(event) {
|
|
477
|
+
if ('composedPath' in event) {
|
|
478
|
+
return event.composedPath()[0];
|
|
479
|
+
} // TS thinks `event` is of type never as it assumes all browsers support
|
|
480
|
+
// `composedPath()`, but browsers without shadow DOM don't.
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
return event.target;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled])," + "[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
487
|
+
function isTypeableElement(element) {
|
|
488
|
+
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function stopEvent(event) {
|
|
492
|
+
event.preventDefault();
|
|
493
|
+
event.stopPropagation();
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function useLatestRef(value) {
|
|
497
|
+
const ref = useRef(value);
|
|
498
|
+
index(() => {
|
|
499
|
+
ref.current = value;
|
|
500
|
+
});
|
|
501
|
+
return ref;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function focus(el, preventScroll) {
|
|
505
|
+
if (preventScroll === void 0) {
|
|
506
|
+
preventScroll = false;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// `mousedown` clicks occur before `focus`, so the button will steal the
|
|
510
|
+
// focus unless we wait a frame.
|
|
511
|
+
requestAnimationFrame(() => {
|
|
512
|
+
el == null ? void 0 : el.focus({
|
|
513
|
+
preventScroll
|
|
514
|
+
});
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const SELECTOR = 'select:not([disabled]),a[href],button:not([disabled]),[tabindex],' + 'iframe,object,embed,area[href],audio[controls],video[controls],' + TYPEABLE_SELECTOR;
|
|
519
|
+
const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {
|
|
520
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
521
|
+
ref: ref,
|
|
522
|
+
tabIndex: 0,
|
|
523
|
+
style: {
|
|
524
|
+
position: 'fixed',
|
|
525
|
+
opacity: '0',
|
|
526
|
+
pointerEvents: 'none',
|
|
527
|
+
outline: '0'
|
|
528
|
+
}
|
|
529
|
+
}));
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Provides focus management for the floating element.
|
|
534
|
+
* @see https://floating-ui.com/docs/FloatingFocusManager
|
|
535
|
+
*/
|
|
536
|
+
function FloatingFocusManager(_ref) {
|
|
537
|
+
let {
|
|
538
|
+
context: {
|
|
539
|
+
refs,
|
|
540
|
+
nodeId,
|
|
541
|
+
onOpenChange,
|
|
542
|
+
dataRef,
|
|
543
|
+
events
|
|
544
|
+
},
|
|
545
|
+
children,
|
|
546
|
+
order = ['content'],
|
|
547
|
+
endGuard = true,
|
|
548
|
+
initialFocus = 0,
|
|
549
|
+
returnFocus = true,
|
|
550
|
+
modal = true
|
|
551
|
+
} = _ref;
|
|
552
|
+
const orderRef = useLatestRef(order);
|
|
553
|
+
const tree = useFloatingTree();
|
|
554
|
+
const getTabbableElements = React.useCallback(() => {
|
|
555
|
+
return orderRef.current.map(type => {
|
|
556
|
+
if (type === 'reference') {
|
|
557
|
+
return refs.domReference.current;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (refs.floating.current && type === 'floating') {
|
|
561
|
+
return refs.floating.current;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
if (type === 'content') {
|
|
565
|
+
var _refs$floating$curren, _refs$floating$curren2;
|
|
566
|
+
|
|
567
|
+
return Array.from((_refs$floating$curren = (_refs$floating$curren2 = refs.floating.current) == null ? void 0 : _refs$floating$curren2.querySelectorAll(SELECTOR)) != null ? _refs$floating$curren : []);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
return null;
|
|
571
|
+
}).flat().filter(el => {
|
|
572
|
+
if (el === refs.floating.current || el === refs.domReference.current) {
|
|
573
|
+
return true;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
if (isHTMLElement(el)) {
|
|
577
|
+
var _el$getAttribute;
|
|
578
|
+
|
|
579
|
+
const tabIndex = (_el$getAttribute = el.getAttribute('tabindex')) != null ? _el$getAttribute : '0';
|
|
580
|
+
return tabIndex[0].trim() !== '-';
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
}, [orderRef, refs]);
|
|
584
|
+
React.useEffect(() => {
|
|
585
|
+
if (!modal) {
|
|
586
|
+
return;
|
|
587
|
+
} // If the floating element has no focusable elements inside it, fallback
|
|
588
|
+
// to focusing the floating element and preventing tab navigation
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
const noTabbableContentElements = getTabbableElements().filter(el => el !== refs.floating.current && el !== refs.domReference.current).length === 0;
|
|
592
|
+
|
|
593
|
+
function onKeyDown(event) {
|
|
594
|
+
if (event.key === 'Tab') {
|
|
595
|
+
if (noTabbableContentElements) {
|
|
596
|
+
stopEvent(event);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
const els = getTabbableElements();
|
|
600
|
+
const target = getTarget(event);
|
|
601
|
+
|
|
602
|
+
if (orderRef.current[0] === 'reference' && target === refs.domReference.current) {
|
|
603
|
+
stopEvent(event);
|
|
604
|
+
|
|
605
|
+
if (event.shiftKey) {
|
|
606
|
+
focus(els[els.length - 1]);
|
|
607
|
+
} else {
|
|
608
|
+
focus(els[1]);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
if (orderRef.current[1] === 'floating' && target === refs.floating.current && event.shiftKey) {
|
|
613
|
+
stopEvent(event);
|
|
614
|
+
focus(els[0]);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
const doc = getDocument(refs.floating.current);
|
|
620
|
+
doc.addEventListener('keydown', onKeyDown);
|
|
621
|
+
return () => {
|
|
622
|
+
doc.removeEventListener('keydown', onKeyDown);
|
|
623
|
+
};
|
|
624
|
+
}, [modal, getTabbableElements, orderRef, refs]);
|
|
625
|
+
React.useEffect(() => {
|
|
626
|
+
let isPointerDown = false;
|
|
627
|
+
|
|
628
|
+
function onFocusOut(event) {
|
|
629
|
+
var _refs$floating$curren3, _getAncestors;
|
|
630
|
+
|
|
631
|
+
const relatedTarget = event.relatedTarget;
|
|
632
|
+
const focusMovedOutsideFloating = !((_refs$floating$curren3 = refs.floating.current) != null && _refs$floating$curren3.contains(relatedTarget));
|
|
633
|
+
const focusMovedOutsideReference = isElement(refs.domReference.current) && !refs.domReference.current.contains(relatedTarget);
|
|
634
|
+
const isChildOpen = tree && getChildren(tree.nodesRef.current, nodeId).length > 0;
|
|
635
|
+
const isParentRelated = tree && event.currentTarget === refs.domReference.current && ((_getAncestors = getAncestors(tree.nodesRef.current, nodeId)) == null ? void 0 : _getAncestors.some(node => {
|
|
636
|
+
var _node$context, _node$context$refs$fl;
|
|
637
|
+
|
|
638
|
+
return (_node$context = node.context) == null ? void 0 : (_node$context$refs$fl = _node$context.refs.floating.current) == null ? void 0 : _node$context$refs$fl.contains(relatedTarget);
|
|
639
|
+
}));
|
|
640
|
+
|
|
641
|
+
if (focusMovedOutsideFloating && focusMovedOutsideReference && !isChildOpen && !isParentRelated && !isPointerDown) {
|
|
642
|
+
onOpenChange(false);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
function onPointerDown() {
|
|
647
|
+
// In Safari, buttons *lose* focus when pressing them. This causes the
|
|
648
|
+
// reference `focusout` to fire, which closes the floating element.
|
|
649
|
+
isPointerDown = true;
|
|
650
|
+
setTimeout(() => {
|
|
651
|
+
isPointerDown = false;
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
const floating = refs.floating.current;
|
|
656
|
+
const reference = refs.domReference.current;
|
|
657
|
+
|
|
658
|
+
if (floating && isHTMLElement(reference)) {
|
|
659
|
+
if (!modal) {
|
|
660
|
+
floating.addEventListener('focusout', onFocusOut);
|
|
661
|
+
reference.addEventListener('focusout', onFocusOut);
|
|
662
|
+
reference.addEventListener('pointerdown', onPointerDown);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
let cleanup;
|
|
666
|
+
|
|
667
|
+
if (modal) {
|
|
668
|
+
if (orderRef.current.includes('reference')) {
|
|
669
|
+
cleanup = hideOthers([reference, floating]);
|
|
670
|
+
} else {
|
|
671
|
+
cleanup = hideOthers(floating);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
return () => {
|
|
676
|
+
if (!modal) {
|
|
677
|
+
floating.removeEventListener('focusout', onFocusOut);
|
|
678
|
+
reference.removeEventListener('focusout', onFocusOut);
|
|
679
|
+
reference.removeEventListener('pointerdown', onPointerDown);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
cleanup == null ? void 0 : cleanup();
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
}, [nodeId, tree, modal, onOpenChange, orderRef, dataRef, getTabbableElements, refs]);
|
|
686
|
+
React.useEffect(() => {
|
|
687
|
+
const floating = refs.floating.current;
|
|
688
|
+
const doc = getDocument(floating);
|
|
689
|
+
let returnFocusValue = returnFocus;
|
|
690
|
+
let preventReturnFocusScroll = false;
|
|
691
|
+
let previouslyFocusedElement = activeElement(doc);
|
|
692
|
+
|
|
693
|
+
if (previouslyFocusedElement === doc.body && refs.domReference.current) {
|
|
694
|
+
previouslyFocusedElement = refs.domReference.current;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
if (typeof initialFocus === 'number') {
|
|
698
|
+
var _getTabbableElements$;
|
|
699
|
+
|
|
700
|
+
const el = (_getTabbableElements$ = getTabbableElements()[initialFocus]) != null ? _getTabbableElements$ : floating;
|
|
701
|
+
focus(el, el === floating);
|
|
702
|
+
} else if (isHTMLElement(initialFocus.current)) {
|
|
703
|
+
var _initialFocus$current;
|
|
704
|
+
|
|
705
|
+
const el = (_initialFocus$current = initialFocus.current) != null ? _initialFocus$current : floating;
|
|
706
|
+
focus(el, el === floating);
|
|
707
|
+
} // Dismissing via outside press should always ignore `returnFocus` to
|
|
708
|
+
// prevent unwanted scrolling.
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
function onDismiss(allowReturnFocus) {
|
|
712
|
+
if (allowReturnFocus === void 0) {
|
|
713
|
+
allowReturnFocus = false;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (typeof allowReturnFocus === 'object') {
|
|
717
|
+
returnFocusValue = true;
|
|
718
|
+
preventReturnFocusScroll = allowReturnFocus.preventScroll;
|
|
719
|
+
} else {
|
|
720
|
+
returnFocusValue = allowReturnFocus;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
events.on('dismiss', onDismiss);
|
|
725
|
+
return () => {
|
|
726
|
+
events.off('dismiss', onDismiss);
|
|
727
|
+
|
|
728
|
+
if (returnFocusValue && isHTMLElement(previouslyFocusedElement)) {
|
|
729
|
+
focus(previouslyFocusedElement, preventReturnFocusScroll);
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
}, [getTabbableElements, initialFocus, returnFocus, refs, events]);
|
|
733
|
+
|
|
734
|
+
const isTypeableCombobox = () => {
|
|
735
|
+
var _refs$domReference$cu;
|
|
736
|
+
|
|
737
|
+
return ((_refs$domReference$cu = refs.domReference.current) == null ? void 0 : _refs$domReference$cu.getAttribute('role')) === 'combobox' && isTypeableElement(refs.domReference.current);
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, modal && /*#__PURE__*/React.createElement(FocusGuard, {
|
|
741
|
+
onFocus: event => {
|
|
742
|
+
if (isTypeableCombobox()) {
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
stopEvent(event);
|
|
747
|
+
const els = getTabbableElements();
|
|
748
|
+
|
|
749
|
+
if (order[0] === 'reference') {
|
|
750
|
+
focus(els[0]);
|
|
751
|
+
} else {
|
|
752
|
+
focus(els[els.length - 1]);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}), /*#__PURE__*/React.cloneElement(children, order.includes('floating') ? {
|
|
756
|
+
tabIndex: 0
|
|
757
|
+
} : {}), modal && endGuard && /*#__PURE__*/React.createElement(FocusGuard, {
|
|
758
|
+
onFocus: event => {
|
|
759
|
+
if (isTypeableCombobox()) {
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
stopEvent(event);
|
|
764
|
+
focus(getTabbableElements()[0]);
|
|
765
|
+
}
|
|
766
|
+
}));
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function usePrevious(value) {
|
|
770
|
+
const ref = useRef();
|
|
771
|
+
index(() => {
|
|
772
|
+
ref.current = value;
|
|
773
|
+
}, [value]);
|
|
774
|
+
return ref.current;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
function getDelay(value, prop, pointerType) {
|
|
778
|
+
if (pointerType && pointerType !== 'mouse') {
|
|
779
|
+
return 0;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
if (typeof value === 'number') {
|
|
783
|
+
return value;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
return value == null ? void 0 : value[prop];
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Adds hover event listeners that change the open state, like CSS :hover.
|
|
791
|
+
* @see https://floating-ui.com/docs/useHover
|
|
792
|
+
*/
|
|
793
|
+
const useHover = function (context, _temp) {
|
|
794
|
+
let {
|
|
795
|
+
enabled = true,
|
|
796
|
+
delay = 0,
|
|
797
|
+
handleClose = null,
|
|
798
|
+
mouseOnly = false,
|
|
799
|
+
restMs = 0,
|
|
800
|
+
move = true
|
|
801
|
+
} = _temp === void 0 ? {} : _temp;
|
|
802
|
+
const {
|
|
803
|
+
open,
|
|
804
|
+
onOpenChange,
|
|
805
|
+
dataRef,
|
|
806
|
+
events,
|
|
807
|
+
refs,
|
|
808
|
+
_
|
|
809
|
+
} = context;
|
|
810
|
+
const tree = useFloatingTree();
|
|
811
|
+
const parentId = useFloatingParentNodeId();
|
|
812
|
+
const handleCloseRef = useLatestRef(handleClose);
|
|
813
|
+
const delayRef = useLatestRef(delay);
|
|
814
|
+
const previousOpen = usePrevious(open);
|
|
815
|
+
const pointerTypeRef = React.useRef();
|
|
816
|
+
const timeoutRef = React.useRef();
|
|
817
|
+
const handlerRef = React.useRef();
|
|
818
|
+
const restTimeoutRef = React.useRef();
|
|
819
|
+
const blockMouseMoveRef = React.useRef(true);
|
|
820
|
+
const performedPointerEventsMutationRef = React.useRef(false);
|
|
821
|
+
const isHoverOpen = React.useCallback(() => {
|
|
822
|
+
var _dataRef$current$open;
|
|
823
|
+
|
|
824
|
+
const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;
|
|
825
|
+
return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';
|
|
826
|
+
}, [dataRef]);
|
|
827
|
+
React.useEffect(() => {
|
|
828
|
+
if (!enabled) {
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
function onDismiss() {
|
|
833
|
+
clearTimeout(timeoutRef.current);
|
|
834
|
+
clearTimeout(restTimeoutRef.current);
|
|
835
|
+
blockMouseMoveRef.current = true;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
events.on('dismiss', onDismiss);
|
|
839
|
+
return () => {
|
|
840
|
+
events.off('dismiss', onDismiss);
|
|
841
|
+
};
|
|
842
|
+
}, [enabled, events, refs]);
|
|
843
|
+
React.useEffect(() => {
|
|
844
|
+
if (!enabled || !handleCloseRef.current) {
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
function onLeave() {
|
|
849
|
+
if (isHoverOpen()) {
|
|
850
|
+
onOpenChange(false);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
const html = getDocument(refs.floating.current).documentElement;
|
|
855
|
+
html.addEventListener('mouseleave', onLeave);
|
|
856
|
+
return () => {
|
|
857
|
+
html.removeEventListener('mouseleave', onLeave);
|
|
858
|
+
};
|
|
859
|
+
}, [refs, onOpenChange, enabled, handleCloseRef, dataRef, isHoverOpen]);
|
|
860
|
+
const closeWithDelay = React.useCallback(function (runElseBranch) {
|
|
861
|
+
if (runElseBranch === void 0) {
|
|
862
|
+
runElseBranch = true;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);
|
|
866
|
+
|
|
867
|
+
if (closeDelay && !handlerRef.current) {
|
|
868
|
+
clearTimeout(timeoutRef.current);
|
|
869
|
+
timeoutRef.current = setTimeout(() => onOpenChange(false), closeDelay);
|
|
870
|
+
} else if (runElseBranch) {
|
|
871
|
+
clearTimeout(timeoutRef.current);
|
|
872
|
+
onOpenChange(false);
|
|
873
|
+
}
|
|
874
|
+
}, [delayRef, onOpenChange]);
|
|
875
|
+
const cleanupPointerMoveHandler = React.useCallback(() => {
|
|
876
|
+
if (handlerRef.current) {
|
|
877
|
+
getDocument(refs.floating.current).removeEventListener('pointermove', handlerRef.current);
|
|
878
|
+
handlerRef.current = undefined;
|
|
879
|
+
}
|
|
880
|
+
}, [refs]);
|
|
881
|
+
const clearPointerEvents = React.useCallback(() => {
|
|
882
|
+
getDocument(refs.floating.current).body.style.pointerEvents = '';
|
|
883
|
+
performedPointerEventsMutationRef.current = false;
|
|
884
|
+
}, [refs]); // Registering the mouse events on the reference directly to bypass React's
|
|
885
|
+
// delegation system. If the cursor was on a disabled element and then entered
|
|
886
|
+
// the reference (no gap), `mouseenter` doesn't fire in the delegation system.
|
|
887
|
+
|
|
888
|
+
React.useEffect(() => {
|
|
889
|
+
if (!enabled) {
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
function isClickLikeOpenEvent() {
|
|
894
|
+
return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
function onMouseEnter(event) {
|
|
898
|
+
clearTimeout(timeoutRef.current);
|
|
899
|
+
blockMouseMoveRef.current = false;
|
|
900
|
+
|
|
901
|
+
if (mouseOnly && pointerTypeRef.current !== 'mouse' || restMs > 0 && getDelay(delayRef.current, 'open') === 0) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
dataRef.current.openEvent = event;
|
|
906
|
+
const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);
|
|
907
|
+
|
|
908
|
+
if (openDelay) {
|
|
909
|
+
timeoutRef.current = setTimeout(() => {
|
|
910
|
+
onOpenChange(true);
|
|
911
|
+
}, openDelay);
|
|
912
|
+
} else {
|
|
913
|
+
onOpenChange(true);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
function onMouseLeave(event) {
|
|
918
|
+
if (isClickLikeOpenEvent()) {
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
const doc = getDocument(refs.floating.current);
|
|
923
|
+
clearTimeout(restTimeoutRef.current);
|
|
924
|
+
|
|
925
|
+
if (handleCloseRef.current) {
|
|
926
|
+
clearTimeout(timeoutRef.current);
|
|
927
|
+
handlerRef.current && doc.removeEventListener('pointermove', handlerRef.current);
|
|
928
|
+
handlerRef.current = handleCloseRef.current({ ...context,
|
|
929
|
+
tree,
|
|
930
|
+
x: event.clientX,
|
|
931
|
+
y: event.clientY,
|
|
932
|
+
|
|
933
|
+
onClose() {
|
|
934
|
+
clearPointerEvents();
|
|
935
|
+
cleanupPointerMoveHandler();
|
|
936
|
+
closeWithDelay();
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
});
|
|
940
|
+
doc.addEventListener('pointermove', handlerRef.current);
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
closeWithDelay();
|
|
945
|
+
} // Ensure the floating element closes after scrolling even if the pointer
|
|
946
|
+
// did not move.
|
|
947
|
+
// https://github.com/floating-ui/floating-ui/discussions/1692
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
function onScrollMouseLeave(event) {
|
|
951
|
+
if (isClickLikeOpenEvent()) {
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
handleCloseRef.current == null ? void 0 : handleCloseRef.current({ ...context,
|
|
956
|
+
tree,
|
|
957
|
+
x: event.clientX,
|
|
958
|
+
y: event.clientY,
|
|
959
|
+
leave: true,
|
|
960
|
+
|
|
961
|
+
onClose() {
|
|
962
|
+
clearPointerEvents();
|
|
963
|
+
cleanupPointerMoveHandler();
|
|
964
|
+
closeWithDelay();
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
})(event);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
const floating = refs.floating.current;
|
|
971
|
+
const reference = refs.domReference.current;
|
|
972
|
+
|
|
973
|
+
if (isElement(reference)) {
|
|
974
|
+
open && reference.addEventListener('mouseleave', onScrollMouseLeave);
|
|
975
|
+
floating == null ? void 0 : floating.addEventListener('mouseleave', onScrollMouseLeave);
|
|
976
|
+
move && reference.addEventListener('mousemove', onMouseEnter, {
|
|
977
|
+
once: true
|
|
978
|
+
});
|
|
979
|
+
reference.addEventListener('mouseenter', onMouseEnter);
|
|
980
|
+
reference.addEventListener('mouseleave', onMouseLeave);
|
|
981
|
+
return () => {
|
|
982
|
+
open && reference.removeEventListener('mouseleave', onScrollMouseLeave);
|
|
983
|
+
floating == null ? void 0 : floating.removeEventListener('mouseleave', onScrollMouseLeave);
|
|
984
|
+
move && reference.removeEventListener('mousemove', onMouseEnter);
|
|
985
|
+
reference.removeEventListener('mouseenter', onMouseEnter);
|
|
986
|
+
reference.removeEventListener('mouseleave', onMouseLeave);
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
}, [// Ensure the effect is re-run when the reference changes.
|
|
990
|
+
// https://github.com/floating-ui/floating-ui/issues/1833
|
|
991
|
+
_.domReference, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupPointerMoveHandler, clearPointerEvents, onOpenChange, open, tree, refs, delayRef, handleCloseRef, dataRef]); // Block pointer-events of every element other than the reference and floating
|
|
992
|
+
// while the floating element is open and has a `handleClose` handler. Also
|
|
993
|
+
// handles nested floating elements.
|
|
994
|
+
// https://github.com/floating-ui/floating-ui/issues/1722
|
|
995
|
+
|
|
996
|
+
index(() => {
|
|
997
|
+
if (!enabled) {
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
if (open && handleCloseRef.current && handleCloseRef.current.__options.blockPointerEvents && isHoverOpen()) {
|
|
1002
|
+
getDocument(refs.floating.current).body.style.pointerEvents = 'none';
|
|
1003
|
+
performedPointerEventsMutationRef.current = true;
|
|
1004
|
+
const reference = refs.domReference.current;
|
|
1005
|
+
const floating = refs.floating.current;
|
|
1006
|
+
|
|
1007
|
+
if (isElement(reference) && floating) {
|
|
1008
|
+
var _tree$nodesRef$curren, _tree$nodesRef$curren2;
|
|
1009
|
+
|
|
1010
|
+
const parentFloating = tree == null ? void 0 : (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null ? void 0 : (_tree$nodesRef$curren2 = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren2.refs.floating.current;
|
|
1011
|
+
|
|
1012
|
+
if (parentFloating) {
|
|
1013
|
+
parentFloating.style.pointerEvents = '';
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
reference.style.pointerEvents = 'auto';
|
|
1017
|
+
floating.style.pointerEvents = 'auto';
|
|
1018
|
+
return () => {
|
|
1019
|
+
reference.style.pointerEvents = '';
|
|
1020
|
+
floating.style.pointerEvents = '';
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}, [enabled, open, parentId, refs, tree, handleCloseRef, dataRef, isHoverOpen]);
|
|
1025
|
+
index(() => {
|
|
1026
|
+
if (previousOpen && !open) {
|
|
1027
|
+
pointerTypeRef.current = undefined;
|
|
1028
|
+
cleanupPointerMoveHandler();
|
|
1029
|
+
clearPointerEvents();
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
React.useEffect(() => {
|
|
1033
|
+
return () => {
|
|
1034
|
+
cleanupPointerMoveHandler();
|
|
1035
|
+
clearTimeout(timeoutRef.current);
|
|
1036
|
+
clearTimeout(restTimeoutRef.current);
|
|
1037
|
+
|
|
1038
|
+
if (performedPointerEventsMutationRef.current) {
|
|
1039
|
+
clearPointerEvents();
|
|
1040
|
+
}
|
|
1041
|
+
};
|
|
1042
|
+
}, [enabled, cleanupPointerMoveHandler, clearPointerEvents]);
|
|
1043
|
+
return React.useMemo(() => {
|
|
1044
|
+
if (!enabled) {
|
|
1045
|
+
return {};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
function setPointerRef(event) {
|
|
1049
|
+
pointerTypeRef.current = event.pointerType;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
return {
|
|
1053
|
+
reference: {
|
|
1054
|
+
onPointerDown: setPointerRef,
|
|
1055
|
+
onPointerEnter: setPointerRef,
|
|
1056
|
+
|
|
1057
|
+
onMouseMove() {
|
|
1058
|
+
if (open || restMs === 0) {
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
clearTimeout(restTimeoutRef.current);
|
|
1063
|
+
restTimeoutRef.current = setTimeout(() => {
|
|
1064
|
+
if (!blockMouseMoveRef.current) {
|
|
1065
|
+
onOpenChange(true);
|
|
1066
|
+
}
|
|
1067
|
+
}, restMs);
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
},
|
|
1071
|
+
floating: {
|
|
1072
|
+
onMouseEnter() {
|
|
1073
|
+
clearTimeout(timeoutRef.current);
|
|
1074
|
+
},
|
|
1075
|
+
|
|
1076
|
+
onMouseLeave() {
|
|
1077
|
+
closeWithDelay(false);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
}, [enabled, restMs, open, onOpenChange, closeWithDelay]);
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* Adds relevant screen reader props for a given element `role`.
|
|
1087
|
+
* @see https://floating-ui.com/docs/useRole
|
|
1088
|
+
*/
|
|
1089
|
+
const useRole = function (_ref, _temp) {
|
|
1090
|
+
let {
|
|
1091
|
+
open
|
|
1092
|
+
} = _ref;
|
|
1093
|
+
let {
|
|
1094
|
+
enabled = true,
|
|
1095
|
+
role = 'dialog'
|
|
1096
|
+
} = _temp === void 0 ? {} : _temp;
|
|
1097
|
+
const rootId = useId();
|
|
1098
|
+
const referenceId = useId();
|
|
1099
|
+
return React.useMemo(() => {
|
|
1100
|
+
const floatingProps = {
|
|
1101
|
+
id: rootId,
|
|
1102
|
+
role
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
if (!enabled) {
|
|
1106
|
+
return {};
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
if (role === 'tooltip') {
|
|
1110
|
+
return {
|
|
1111
|
+
reference: {
|
|
1112
|
+
'aria-describedby': open ? rootId : undefined
|
|
1113
|
+
},
|
|
1114
|
+
floating: floatingProps
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
return {
|
|
1119
|
+
reference: {
|
|
1120
|
+
'aria-expanded': open ? 'true' : 'false',
|
|
1121
|
+
'aria-haspopup': role === 'alertdialog' ? 'dialog' : role,
|
|
1122
|
+
'aria-controls': open ? rootId : undefined,
|
|
1123
|
+
...(role === 'listbox' && {
|
|
1124
|
+
role: 'combobox'
|
|
1125
|
+
}),
|
|
1126
|
+
...(role === 'menu' && {
|
|
1127
|
+
id: referenceId
|
|
1128
|
+
})
|
|
1129
|
+
},
|
|
1130
|
+
floating: { ...floatingProps,
|
|
1131
|
+
...(role === 'menu' && {
|
|
1132
|
+
'aria-labelledby': referenceId
|
|
1133
|
+
})
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
}, [enabled, role, open, rootId, referenceId]);
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
function isButtonTarget(event) {
|
|
1140
|
+
return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
function isSpaceIgnored(element) {
|
|
1144
|
+
return isTypeableElement(element);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Adds click event listeners that change the open state.
|
|
1149
|
+
* @see https://floating-ui.com/docs/useClick
|
|
1150
|
+
*/
|
|
1151
|
+
const useClick = function (_ref, _temp) {
|
|
1152
|
+
let {
|
|
1153
|
+
open,
|
|
1154
|
+
onOpenChange,
|
|
1155
|
+
dataRef,
|
|
1156
|
+
refs
|
|
1157
|
+
} = _ref;
|
|
1158
|
+
let {
|
|
1159
|
+
enabled = true,
|
|
1160
|
+
event: eventOption = 'click',
|
|
1161
|
+
toggle = true,
|
|
1162
|
+
ignoreMouse = false,
|
|
1163
|
+
keyboardHandlers = true
|
|
1164
|
+
} = _temp === void 0 ? {} : _temp;
|
|
1165
|
+
const pointerTypeRef = React.useRef();
|
|
1166
|
+
return React.useMemo(() => {
|
|
1167
|
+
if (!enabled) {
|
|
1168
|
+
return {};
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
return {
|
|
1172
|
+
reference: {
|
|
1173
|
+
onPointerDown(event) {
|
|
1174
|
+
pointerTypeRef.current = event.pointerType;
|
|
1175
|
+
},
|
|
1176
|
+
|
|
1177
|
+
onMouseDown(event) {
|
|
1178
|
+
// Ignore all buttons except for the "main" button.
|
|
1179
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
1180
|
+
if (event.button !== 0) {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
if (pointerTypeRef.current === 'mouse' && ignoreMouse) {
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
if (eventOption === 'click') {
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
if (open) {
|
|
1193
|
+
if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'mousedown' : true)) {
|
|
1194
|
+
onOpenChange(false);
|
|
1195
|
+
}
|
|
1196
|
+
} else {
|
|
1197
|
+
onOpenChange(true);
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
dataRef.current.openEvent = event.nativeEvent;
|
|
1201
|
+
},
|
|
1202
|
+
|
|
1203
|
+
onClick(event) {
|
|
1204
|
+
if (eventOption === 'mousedown' && pointerTypeRef.current) {
|
|
1205
|
+
pointerTypeRef.current = undefined;
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
if (pointerTypeRef.current === 'mouse' && ignoreMouse) {
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
if (open) {
|
|
1214
|
+
if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'click' : true)) {
|
|
1215
|
+
onOpenChange(false);
|
|
1216
|
+
}
|
|
1217
|
+
} else {
|
|
1218
|
+
onOpenChange(true);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
dataRef.current.openEvent = event.nativeEvent;
|
|
1222
|
+
},
|
|
1223
|
+
|
|
1224
|
+
onKeyDown(event) {
|
|
1225
|
+
pointerTypeRef.current = undefined;
|
|
1226
|
+
|
|
1227
|
+
if (!keyboardHandlers) {
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
if (isButtonTarget(event)) {
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
if (event.key === ' ' && !isSpaceIgnored(refs.domReference.current)) {
|
|
1236
|
+
// Prvent scrolling
|
|
1237
|
+
event.preventDefault();
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
if (event.key === 'Enter') {
|
|
1241
|
+
if (open) {
|
|
1242
|
+
if (toggle) {
|
|
1243
|
+
onOpenChange(false);
|
|
1244
|
+
}
|
|
1245
|
+
} else {
|
|
1246
|
+
onOpenChange(true);
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
},
|
|
1250
|
+
|
|
1251
|
+
onKeyUp(event) {
|
|
1252
|
+
if (!keyboardHandlers) {
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
if (isButtonTarget(event) || isSpaceIgnored(refs.domReference.current)) {
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
if (event.key === ' ') {
|
|
1261
|
+
if (open) {
|
|
1262
|
+
if (toggle) {
|
|
1263
|
+
onOpenChange(false);
|
|
1264
|
+
}
|
|
1265
|
+
} else {
|
|
1266
|
+
onOpenChange(true);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
}, [enabled, dataRef, eventOption, ignoreMouse, keyboardHandlers, refs, toggle, open, onOpenChange]);
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* Check whether the event.target is within the provided node. Uses event.composedPath if available for custom element support.
|
|
1278
|
+
*
|
|
1279
|
+
* @param event The event whose target/composedPath to check
|
|
1280
|
+
* @param node The node to check against
|
|
1281
|
+
* @returns Whether the event.target/composedPath is within the node.
|
|
1282
|
+
*/
|
|
1283
|
+
function isEventTargetWithin(event, node) {
|
|
1284
|
+
if (node == null) {
|
|
1285
|
+
return false;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
if ('composedPath' in event) {
|
|
1289
|
+
return event.composedPath().includes(node);
|
|
1290
|
+
} // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
const e = event;
|
|
1294
|
+
return e.target != null && node.contains(e.target);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
const bubbleHandlerKeys = {
|
|
1298
|
+
pointerdown: 'onPointerDown',
|
|
1299
|
+
mousedown: 'onMouseDown',
|
|
1300
|
+
click: 'onClick'
|
|
1301
|
+
};
|
|
1302
|
+
const captureHandlerKeys = {
|
|
1303
|
+
pointerdown: 'onPointerDownCapture',
|
|
1304
|
+
mousedown: 'onMouseDownCapture',
|
|
1305
|
+
click: 'onClickCapture'
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Adds listeners that dismiss (close) the floating element.
|
|
1310
|
+
* @see https://floating-ui.com/docs/useDismiss
|
|
1311
|
+
*/
|
|
1312
|
+
const useDismiss = function (_ref, _temp) {
|
|
1313
|
+
let {
|
|
1314
|
+
open,
|
|
1315
|
+
onOpenChange,
|
|
1316
|
+
refs,
|
|
1317
|
+
events,
|
|
1318
|
+
nodeId
|
|
1319
|
+
} = _ref;
|
|
1320
|
+
let {
|
|
1321
|
+
enabled = true,
|
|
1322
|
+
escapeKey = true,
|
|
1323
|
+
outsidePress = true,
|
|
1324
|
+
outsidePressEvent = 'pointerdown',
|
|
1325
|
+
referencePress = false,
|
|
1326
|
+
referencePressEvent = 'pointerdown',
|
|
1327
|
+
ancestorScroll = false,
|
|
1328
|
+
bubbles = true
|
|
1329
|
+
} = _temp === void 0 ? {} : _temp;
|
|
1330
|
+
const tree = useFloatingTree();
|
|
1331
|
+
const nested = useFloatingParentNodeId() != null;
|
|
1332
|
+
const insideReactTreeRef = React.useRef(false);
|
|
1333
|
+
React.useEffect(() => {
|
|
1334
|
+
if (!open || !enabled) {
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
function onKeyDown(event) {
|
|
1339
|
+
if (event.key === 'Escape') {
|
|
1340
|
+
if (!bubbles && tree && getChildren(tree.nodesRef.current, nodeId).length > 0) {
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
events.emit('dismiss', {
|
|
1345
|
+
preventScroll: false
|
|
1346
|
+
});
|
|
1347
|
+
onOpenChange(false);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
function onOutsidePress(event) {
|
|
1352
|
+
// Given developers can stop the propagation of the synthetic event,
|
|
1353
|
+
// we can only be confident with a positive value.
|
|
1354
|
+
const insideReactTree = insideReactTreeRef.current;
|
|
1355
|
+
insideReactTreeRef.current = false;
|
|
1356
|
+
|
|
1357
|
+
if (insideReactTree) {
|
|
1358
|
+
return;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
const target = getTarget(event); // Check if the click occurred on the scrollbar
|
|
1362
|
+
|
|
1363
|
+
if (isElement(target) && refs.floating.current) {
|
|
1364
|
+
var _refs$floating$curren;
|
|
1365
|
+
|
|
1366
|
+
const win = (_refs$floating$curren = refs.floating.current.ownerDocument.defaultView) != null ? _refs$floating$curren : window;
|
|
1367
|
+
const canScrollX = target.scrollWidth > target.clientWidth;
|
|
1368
|
+
const canScrollY = target.scrollHeight > target.clientHeight;
|
|
1369
|
+
let xCond = canScrollY && event.offsetX > target.clientWidth; // In some browsers it is possible to change the <body> (or window)
|
|
1370
|
+
// scrollbar to the left side, but is very rare and is difficult to
|
|
1371
|
+
// check for. Plus, for modal dialogs with backdrops, it is more
|
|
1372
|
+
// important that the backdrop is checked but not so much the window.
|
|
1373
|
+
|
|
1374
|
+
if (canScrollY) {
|
|
1375
|
+
const isRTL = win.getComputedStyle(target).direction === 'rtl';
|
|
1376
|
+
|
|
1377
|
+
if (isRTL) {
|
|
1378
|
+
xCond = event.offsetX <= target.offsetWidth - target.clientWidth;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
if (xCond || canScrollX && event.offsetY > target.clientHeight) {
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {
|
|
1388
|
+
var _node$context;
|
|
1389
|
+
|
|
1390
|
+
return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.refs.floating.current);
|
|
1391
|
+
});
|
|
1392
|
+
|
|
1393
|
+
if (isEventTargetWithin(event, refs.floating.current) || isEventTargetWithin(event, refs.domReference.current) || targetIsInsideChildren) {
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
if (!bubbles && tree && getChildren(tree.nodesRef.current, nodeId).length > 0) {
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
events.emit('dismiss', nested ? {
|
|
1402
|
+
preventScroll: true
|
|
1403
|
+
} : false);
|
|
1404
|
+
onOpenChange(false);
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
function onScroll() {
|
|
1408
|
+
onOpenChange(false);
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
const doc = getDocument(refs.floating.current);
|
|
1412
|
+
escapeKey && doc.addEventListener('keydown', onKeyDown);
|
|
1413
|
+
outsidePress && doc.addEventListener(outsidePressEvent, onOutsidePress);
|
|
1414
|
+
let ancestors = [];
|
|
1415
|
+
|
|
1416
|
+
if (ancestorScroll) {
|
|
1417
|
+
if (isElement(refs.domReference.current)) {
|
|
1418
|
+
ancestors = getOverflowAncestors(refs.domReference.current);
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
if (isElement(refs.floating.current)) {
|
|
1422
|
+
ancestors = ancestors.concat(getOverflowAncestors(refs.floating.current));
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
if (!isElement(refs.reference.current) && refs.reference.current && // @ts-expect-error is VirtualElement
|
|
1426
|
+
refs.reference.current.contextElement) {
|
|
1427
|
+
ancestors = ancestors.concat( // @ts-expect-error is VirtualElement
|
|
1428
|
+
getOverflowAncestors(refs.reference.current.contextElement));
|
|
1429
|
+
}
|
|
1430
|
+
} // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
ancestors = ancestors.filter(ancestor => {
|
|
1434
|
+
var _doc$defaultView;
|
|
1435
|
+
|
|
1436
|
+
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
|
|
1437
|
+
});
|
|
1438
|
+
ancestors.forEach(ancestor => {
|
|
1439
|
+
ancestor.addEventListener('scroll', onScroll, {
|
|
1440
|
+
passive: true
|
|
1441
|
+
});
|
|
1442
|
+
});
|
|
1443
|
+
return () => {
|
|
1444
|
+
escapeKey && doc.removeEventListener('keydown', onKeyDown);
|
|
1445
|
+
outsidePress && doc.removeEventListener(outsidePressEvent, onOutsidePress);
|
|
1446
|
+
ancestors.forEach(ancestor => {
|
|
1447
|
+
ancestor.removeEventListener('scroll', onScroll);
|
|
1448
|
+
});
|
|
1449
|
+
};
|
|
1450
|
+
}, [escapeKey, outsidePress, outsidePressEvent, events, tree, nodeId, open, onOpenChange, ancestorScroll, enabled, bubbles, refs, nested]);
|
|
1451
|
+
React.useEffect(() => {
|
|
1452
|
+
insideReactTreeRef.current = false;
|
|
1453
|
+
}, [outsidePress, outsidePressEvent]);
|
|
1454
|
+
return React.useMemo(() => {
|
|
1455
|
+
if (!enabled) {
|
|
1456
|
+
return {};
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
return {
|
|
1460
|
+
reference: {
|
|
1461
|
+
[bubbleHandlerKeys[referencePressEvent]]: () => {
|
|
1462
|
+
if (referencePress) {
|
|
1463
|
+
events.emit('dismiss');
|
|
1464
|
+
onOpenChange(false);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
floating: {
|
|
1469
|
+
[captureHandlerKeys[outsidePressEvent]]: () => {
|
|
1470
|
+
insideReactTreeRef.current = true;
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
};
|
|
1474
|
+
}, [enabled, events, referencePress, outsidePressEvent, referencePressEvent, onOpenChange]);
|
|
1475
|
+
};
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* Adds focus event listeners that change the open state, like CSS :focus.
|
|
1479
|
+
* @see https://floating-ui.com/docs/useFocus
|
|
1480
|
+
*/
|
|
1481
|
+
const useFocus = function (_ref, _temp) {
|
|
1482
|
+
let {
|
|
1483
|
+
open,
|
|
1484
|
+
onOpenChange,
|
|
1485
|
+
dataRef,
|
|
1486
|
+
refs,
|
|
1487
|
+
events
|
|
1488
|
+
} = _ref;
|
|
1489
|
+
let {
|
|
1490
|
+
enabled = true,
|
|
1491
|
+
keyboardOnly = true
|
|
1492
|
+
} = _temp === void 0 ? {} : _temp;
|
|
1493
|
+
const pointerTypeRef = React.useRef('');
|
|
1494
|
+
const blockFocusRef = React.useRef(false);
|
|
1495
|
+
const timeoutRef = React.useRef();
|
|
1496
|
+
React.useEffect(() => {
|
|
1497
|
+
var _doc$defaultView;
|
|
1498
|
+
|
|
1499
|
+
if (!enabled) {
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
const doc = getDocument(refs.floating.current);
|
|
1504
|
+
const win = (_doc$defaultView = doc.defaultView) != null ? _doc$defaultView : window;
|
|
1505
|
+
|
|
1506
|
+
function onBlur() {
|
|
1507
|
+
if (!open && isHTMLElement(refs.domReference.current)) {
|
|
1508
|
+
refs.domReference.current.blur();
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
win.addEventListener('blur', onBlur);
|
|
1513
|
+
return () => {
|
|
1514
|
+
win.removeEventListener('blur', onBlur);
|
|
1515
|
+
};
|
|
1516
|
+
}, [refs, open, enabled]);
|
|
1517
|
+
React.useEffect(() => {
|
|
1518
|
+
if (!enabled) {
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
function onDismiss() {
|
|
1523
|
+
blockFocusRef.current = true;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
events.on('dismiss', onDismiss);
|
|
1527
|
+
return () => {
|
|
1528
|
+
events.off('dismiss', onDismiss);
|
|
1529
|
+
};
|
|
1530
|
+
}, [events, enabled]);
|
|
1531
|
+
React.useEffect(() => {
|
|
1532
|
+
return () => {
|
|
1533
|
+
clearTimeout(timeoutRef.current);
|
|
1534
|
+
};
|
|
1535
|
+
}, []);
|
|
1536
|
+
return React.useMemo(() => {
|
|
1537
|
+
if (!enabled) {
|
|
1538
|
+
return {};
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
return {
|
|
1542
|
+
reference: {
|
|
1543
|
+
onPointerDown(_ref2) {
|
|
1544
|
+
let {
|
|
1545
|
+
pointerType
|
|
1546
|
+
} = _ref2;
|
|
1547
|
+
pointerTypeRef.current = pointerType;
|
|
1548
|
+
blockFocusRef.current = !!(pointerType && keyboardOnly);
|
|
1549
|
+
},
|
|
1550
|
+
|
|
1551
|
+
onPointerLeave() {
|
|
1552
|
+
blockFocusRef.current = false;
|
|
1553
|
+
},
|
|
1554
|
+
|
|
1555
|
+
onFocus(event) {
|
|
1556
|
+
var _dataRef$current$open, _refs$domReference$cu, _dataRef$current$open2;
|
|
1557
|
+
|
|
1558
|
+
if (blockFocusRef.current) {
|
|
1559
|
+
return;
|
|
1560
|
+
} // Dismiss with click should ignore the subsequent `focus` trigger, but
|
|
1561
|
+
// only if the click originated inside the reference element.
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
if (event.type === 'focus' && ((_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type) === 'mousedown' && (_refs$domReference$cu = refs.domReference.current) != null && _refs$domReference$cu.contains((_dataRef$current$open2 = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open2.target)) {
|
|
1565
|
+
return;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
dataRef.current.openEvent = event.nativeEvent;
|
|
1569
|
+
onOpenChange(true);
|
|
1570
|
+
},
|
|
1571
|
+
|
|
1572
|
+
onBlur(event) {
|
|
1573
|
+
const target = event.relatedTarget; // Wait for the window blur listener to fire.
|
|
1574
|
+
|
|
1575
|
+
timeoutRef.current = setTimeout(() => {
|
|
1576
|
+
var _refs$floating$curren, _refs$domReference$cu2;
|
|
1577
|
+
|
|
1578
|
+
// When focusing the reference element (e.g. regular click), then
|
|
1579
|
+
// clicking into the floating element, prevent it from hiding.
|
|
1580
|
+
// Note: it must be focusable, e.g. `tabindex="-1"`.
|
|
1581
|
+
if ((_refs$floating$curren = refs.floating.current) != null && _refs$floating$curren.contains(target) || (_refs$domReference$cu2 = refs.domReference.current) != null && _refs$domReference$cu2.contains(target)) {
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
blockFocusRef.current = false;
|
|
1586
|
+
onOpenChange(false);
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
}
|
|
1591
|
+
};
|
|
1592
|
+
}, [enabled, keyboardOnly, refs, dataRef, onOpenChange]);
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
const ARROW_UP = 'ArrowUp';
|
|
1596
|
+
const ARROW_DOWN = 'ArrowDown';
|
|
1597
|
+
const ARROW_LEFT = 'ArrowLeft';
|
|
1598
|
+
const ARROW_RIGHT = 'ArrowRight';
|
|
1599
|
+
|
|
1600
|
+
function isDifferentRow(index, cols, prevRow) {
|
|
1601
|
+
return Math.floor(index / cols) !== prevRow;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
function isIndexOutOfBounds(listRef, index) {
|
|
1605
|
+
return index < 0 || index >= listRef.current.length;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
function findNonDisabledIndex(listRef, _temp) {
|
|
1609
|
+
let {
|
|
1610
|
+
startingIndex = -1,
|
|
1611
|
+
decrement = false,
|
|
1612
|
+
disabledIndices,
|
|
1613
|
+
amount = 1
|
|
1614
|
+
} = _temp === void 0 ? {} : _temp;
|
|
1615
|
+
const list = listRef.current;
|
|
1616
|
+
let index = startingIndex;
|
|
1617
|
+
|
|
1618
|
+
do {
|
|
1619
|
+
var _list$index, _list$index2;
|
|
1620
|
+
|
|
1621
|
+
index = index + (decrement ? -amount : amount);
|
|
1622
|
+
} while (index >= 0 && index <= list.length - 1 && (disabledIndices ? disabledIndices.includes(index) : list[index] == null || ((_list$index = list[index]) == null ? void 0 : _list$index.hasAttribute('disabled')) || ((_list$index2 = list[index]) == null ? void 0 : _list$index2.getAttribute('aria-disabled')) === 'true'));
|
|
1623
|
+
|
|
1624
|
+
return index;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
function doSwitch(orientation, vertical, horizontal) {
|
|
1628
|
+
switch (orientation) {
|
|
1629
|
+
case 'vertical':
|
|
1630
|
+
return vertical;
|
|
1631
|
+
|
|
1632
|
+
case 'horizontal':
|
|
1633
|
+
return horizontal;
|
|
1634
|
+
|
|
1635
|
+
default:
|
|
1636
|
+
return vertical || horizontal;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
function isMainOrientationKey(key, orientation) {
|
|
1641
|
+
const vertical = key === ARROW_UP || key === ARROW_DOWN;
|
|
1642
|
+
const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;
|
|
1643
|
+
return doSwitch(orientation, vertical, horizontal);
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
function isMainOrientationToEndKey(key, orientation, rtl) {
|
|
1647
|
+
const vertical = key === ARROW_DOWN;
|
|
1648
|
+
const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;
|
|
1649
|
+
return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key == ' ' || key === '';
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
function isCrossOrientationOpenKey(key, orientation, rtl) {
|
|
1653
|
+
const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;
|
|
1654
|
+
const horizontal = key === ARROW_DOWN;
|
|
1655
|
+
return doSwitch(orientation, vertical, horizontal);
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
function isCrossOrientationCloseKey(key, orientation, rtl) {
|
|
1659
|
+
const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;
|
|
1660
|
+
const horizontal = key === ARROW_UP;
|
|
1661
|
+
return doSwitch(orientation, vertical, horizontal);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
function getMinIndex(listRef, disabledIndices) {
|
|
1665
|
+
return findNonDisabledIndex(listRef, {
|
|
1666
|
+
disabledIndices
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
function getMaxIndex(listRef, disabledIndices) {
|
|
1671
|
+
return findNonDisabledIndex(listRef, {
|
|
1672
|
+
decrement: true,
|
|
1673
|
+
startingIndex: listRef.current.length,
|
|
1674
|
+
disabledIndices
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Adds focus-managed indexed navigation via arrow keys to a list of items
|
|
1680
|
+
* within the floating element.
|
|
1681
|
+
* @see https://floating-ui.com/docs/useListNavigation
|
|
1682
|
+
*/
|
|
1683
|
+
const useListNavigation = function (_ref, _temp2) {
|
|
1684
|
+
let {
|
|
1685
|
+
open,
|
|
1686
|
+
onOpenChange,
|
|
1687
|
+
refs
|
|
1688
|
+
} = _ref;
|
|
1689
|
+
let {
|
|
1690
|
+
listRef,
|
|
1691
|
+
activeIndex,
|
|
1692
|
+
onNavigate: unstable_onNavigate = () => {},
|
|
1693
|
+
enabled = true,
|
|
1694
|
+
selectedIndex = null,
|
|
1695
|
+
allowEscape = false,
|
|
1696
|
+
loop = false,
|
|
1697
|
+
nested = false,
|
|
1698
|
+
rtl = false,
|
|
1699
|
+
virtual = false,
|
|
1700
|
+
focusItemOnOpen = 'auto',
|
|
1701
|
+
focusItemOnHover = true,
|
|
1702
|
+
openOnArrowKeyDown = true,
|
|
1703
|
+
disabledIndices = undefined,
|
|
1704
|
+
orientation = 'vertical',
|
|
1705
|
+
cols = 1
|
|
1706
|
+
} = _temp2 === void 0 ? {
|
|
1707
|
+
listRef: {
|
|
1708
|
+
current: []
|
|
1709
|
+
},
|
|
1710
|
+
activeIndex: null,
|
|
1711
|
+
onNavigate: () => {}
|
|
1712
|
+
} : _temp2;
|
|
1713
|
+
|
|
1714
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1715
|
+
if (allowEscape) {
|
|
1716
|
+
if (!loop) {
|
|
1717
|
+
console.warn(['Floating UI: `useListNavigation` looping must be enabled to allow', 'escaping.'].join(' '));
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
if (!virtual) {
|
|
1721
|
+
console.warn(['Floating UI: `useListNavigation` must be virtual to allow', 'escaping.'].join(' '));
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
if (orientation === 'vertical' && cols > 1) {
|
|
1726
|
+
console.warn(['Floating UI: In grid list navigation mode (`cols` > 1), the', '`orientation` should be either "horizontal" or "both".'].join(' '));
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
const parentId = useFloatingParentNodeId();
|
|
1731
|
+
const tree = useFloatingTree();
|
|
1732
|
+
const previousOpen = usePrevious(open);
|
|
1733
|
+
const onNavigate = useEvent(unstable_onNavigate);
|
|
1734
|
+
const previousOnNavigate = useEvent(usePrevious(unstable_onNavigate));
|
|
1735
|
+
const focusItemOnOpenRef = React.useRef(focusItemOnOpen);
|
|
1736
|
+
const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);
|
|
1737
|
+
const keyRef = React.useRef(null);
|
|
1738
|
+
const disabledIndicesRef = useLatestRef(disabledIndices);
|
|
1739
|
+
const blockPointerLeaveRef = React.useRef(false);
|
|
1740
|
+
const frameRef = React.useRef(-1);
|
|
1741
|
+
const [activeId, setActiveId] = React.useState();
|
|
1742
|
+
const focusItem = React.useCallback((listRef, indexRef) => {
|
|
1743
|
+
// `mousedown` clicks occur before `focus`, so the button will steal the
|
|
1744
|
+
// focus unless we wait a frame.
|
|
1745
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
1746
|
+
if (virtual) {
|
|
1747
|
+
var _listRef$current$inde;
|
|
1748
|
+
|
|
1749
|
+
setActiveId((_listRef$current$inde = listRef.current[indexRef.current]) == null ? void 0 : _listRef$current$inde.id);
|
|
1750
|
+
} else {
|
|
1751
|
+
var _listRef$current$inde2;
|
|
1752
|
+
|
|
1753
|
+
(_listRef$current$inde2 = listRef.current[indexRef.current]) == null ? void 0 : _listRef$current$inde2.focus({
|
|
1754
|
+
preventScroll: true
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
}, [virtual]); // Sync `selectedIndex` to be the `activeIndex` upon opening the floating
|
|
1759
|
+
// element. Also, reset `activeIndex` upon closing the floating element.
|
|
1760
|
+
|
|
1761
|
+
index(() => {
|
|
1762
|
+
if (!enabled) {
|
|
1763
|
+
return;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
if (!previousOpen && open && focusItemOnOpenRef.current && selectedIndex != null) {
|
|
1767
|
+
onNavigate(selectedIndex);
|
|
1768
|
+
} // Unset `activeIndex`. Since the user can specify `onNavigate`
|
|
1769
|
+
// conditionally (onNavigate: open ? setActiveIndex : setSelectedIndex)
|
|
1770
|
+
// we store and call the previous function
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
if (previousOpen && !open) {
|
|
1774
|
+
cancelAnimationFrame(frameRef.current);
|
|
1775
|
+
indexRef.current = -1;
|
|
1776
|
+
previousOnNavigate(null);
|
|
1777
|
+
}
|
|
1778
|
+
}, [open, previousOpen, selectedIndex, listRef, focusItem, enabled, onNavigate, previousOnNavigate]); // Sync `activeIndex` to be the focused item while the floating element is
|
|
1779
|
+
// open.
|
|
1780
|
+
|
|
1781
|
+
index(() => {
|
|
1782
|
+
if (!enabled) {
|
|
1783
|
+
return;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
if (open) {
|
|
1787
|
+
if (activeIndex == null) {
|
|
1788
|
+
if (selectedIndex != null) {
|
|
1789
|
+
return;
|
|
1790
|
+
} // Reset while the floating element was open (e.g. the list changed).
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
if (previousOpen) {
|
|
1794
|
+
indexRef.current = -1;
|
|
1795
|
+
focusItem(listRef, indexRef);
|
|
1796
|
+
} // Initial sync
|
|
1797
|
+
|
|
1798
|
+
|
|
1799
|
+
if (!previousOpen && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {
|
|
1800
|
+
indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinIndex(listRef, disabledIndicesRef.current) : getMaxIndex(listRef, disabledIndicesRef.current);
|
|
1801
|
+
onNavigate(indexRef.current);
|
|
1802
|
+
focusItem(listRef, indexRef);
|
|
1803
|
+
}
|
|
1804
|
+
} else if (!isIndexOutOfBounds(listRef, activeIndex)) {
|
|
1805
|
+
indexRef.current = activeIndex;
|
|
1806
|
+
focusItem(listRef, indexRef);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
}, [open, previousOpen, activeIndex, selectedIndex, nested, listRef, onNavigate, focusItem, enabled, allowEscape, orientation, rtl, virtual, disabledIndicesRef]); // Ensure the parent floating element has focus when a nested child closes
|
|
1810
|
+
// to allow arrow key navigation to work after the pointer leaves the child.
|
|
1811
|
+
|
|
1812
|
+
index(() => {
|
|
1813
|
+
if (!enabled) {
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
if (!open && previousOpen) {
|
|
1818
|
+
var _tree$nodesRef$curren, _tree$nodesRef$curren2;
|
|
1819
|
+
|
|
1820
|
+
const parentFloating = tree == null ? void 0 : (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null ? void 0 : (_tree$nodesRef$curren2 = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren2.refs.floating.current;
|
|
1821
|
+
|
|
1822
|
+
if (parentFloating && !parentFloating.contains(activeElement(getDocument(parentFloating)))) {
|
|
1823
|
+
parentFloating.focus({
|
|
1824
|
+
preventScroll: true
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}, [enabled, open, previousOpen, tree, parentId]);
|
|
1829
|
+
index(() => {
|
|
1830
|
+
keyRef.current = null;
|
|
1831
|
+
});
|
|
1832
|
+
return React.useMemo(() => {
|
|
1833
|
+
if (!enabled) {
|
|
1834
|
+
return {};
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
const disabledIndices = disabledIndicesRef.current;
|
|
1838
|
+
|
|
1839
|
+
function onKeyDown(event) {
|
|
1840
|
+
blockPointerLeaveRef.current = true;
|
|
1841
|
+
|
|
1842
|
+
if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl)) {
|
|
1843
|
+
stopEvent(event);
|
|
1844
|
+
onOpenChange(false);
|
|
1845
|
+
|
|
1846
|
+
if (isHTMLElement(refs.domReference.current)) {
|
|
1847
|
+
refs.domReference.current.focus();
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
return;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
const currentIndex = indexRef.current;
|
|
1854
|
+
const minIndex = getMinIndex(listRef, disabledIndices);
|
|
1855
|
+
const maxIndex = getMaxIndex(listRef, disabledIndices);
|
|
1856
|
+
|
|
1857
|
+
if (event.key === 'Home') {
|
|
1858
|
+
indexRef.current = minIndex;
|
|
1859
|
+
onNavigate(indexRef.current);
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
if (event.key === 'End') {
|
|
1863
|
+
indexRef.current = maxIndex;
|
|
1864
|
+
onNavigate(indexRef.current);
|
|
1865
|
+
} // Grid navigation
|
|
1866
|
+
|
|
1867
|
+
|
|
1868
|
+
if (cols > 1) {
|
|
1869
|
+
const prevIndex = indexRef.current;
|
|
1870
|
+
|
|
1871
|
+
if (event.key === ARROW_UP) {
|
|
1872
|
+
stopEvent(event);
|
|
1873
|
+
|
|
1874
|
+
if (prevIndex === -1) {
|
|
1875
|
+
indexRef.current = maxIndex;
|
|
1876
|
+
} else {
|
|
1877
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1878
|
+
startingIndex: prevIndex,
|
|
1879
|
+
amount: cols,
|
|
1880
|
+
decrement: true,
|
|
1881
|
+
disabledIndices
|
|
1882
|
+
});
|
|
1883
|
+
|
|
1884
|
+
if (loop && (prevIndex - cols < minIndex || indexRef.current < 0)) {
|
|
1885
|
+
const col = prevIndex % cols;
|
|
1886
|
+
const maxCol = maxIndex % cols;
|
|
1887
|
+
const offset = maxIndex - (maxCol - col);
|
|
1888
|
+
|
|
1889
|
+
if (maxCol === col) {
|
|
1890
|
+
indexRef.current = maxIndex;
|
|
1891
|
+
} else {
|
|
1892
|
+
indexRef.current = maxCol > col ? offset : offset - cols;
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
if (isIndexOutOfBounds(listRef, indexRef.current)) {
|
|
1898
|
+
indexRef.current = prevIndex;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
onNavigate(indexRef.current);
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
if (event.key === ARROW_DOWN) {
|
|
1905
|
+
stopEvent(event);
|
|
1906
|
+
|
|
1907
|
+
if (prevIndex === -1) {
|
|
1908
|
+
indexRef.current = minIndex;
|
|
1909
|
+
} else {
|
|
1910
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1911
|
+
startingIndex: prevIndex,
|
|
1912
|
+
amount: cols,
|
|
1913
|
+
disabledIndices
|
|
1914
|
+
});
|
|
1915
|
+
|
|
1916
|
+
if (loop && prevIndex + cols > maxIndex) {
|
|
1917
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1918
|
+
startingIndex: prevIndex % cols - cols,
|
|
1919
|
+
amount: cols,
|
|
1920
|
+
disabledIndices
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
if (isIndexOutOfBounds(listRef, indexRef.current)) {
|
|
1926
|
+
indexRef.current = prevIndex;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
onNavigate(indexRef.current);
|
|
1930
|
+
} // Remains on the same row/column
|
|
1931
|
+
|
|
1932
|
+
|
|
1933
|
+
if (orientation === 'both') {
|
|
1934
|
+
const prevRow = Math.floor(prevIndex / cols);
|
|
1935
|
+
|
|
1936
|
+
if (event.key === ARROW_RIGHT) {
|
|
1937
|
+
stopEvent(event);
|
|
1938
|
+
|
|
1939
|
+
if (prevIndex % cols !== cols - 1) {
|
|
1940
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1941
|
+
startingIndex: prevIndex,
|
|
1942
|
+
disabledIndices
|
|
1943
|
+
});
|
|
1944
|
+
|
|
1945
|
+
if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {
|
|
1946
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1947
|
+
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
1948
|
+
disabledIndices
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
} else if (loop) {
|
|
1952
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1953
|
+
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
1954
|
+
disabledIndices
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
if (isDifferentRow(indexRef.current, cols, prevRow)) {
|
|
1959
|
+
indexRef.current = prevIndex;
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
if (event.key === ARROW_LEFT) {
|
|
1964
|
+
stopEvent(event);
|
|
1965
|
+
|
|
1966
|
+
if (prevIndex % cols !== 0) {
|
|
1967
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1968
|
+
startingIndex: prevIndex,
|
|
1969
|
+
disabledIndices,
|
|
1970
|
+
decrement: true
|
|
1971
|
+
});
|
|
1972
|
+
|
|
1973
|
+
if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {
|
|
1974
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1975
|
+
startingIndex: prevIndex + (cols - prevIndex % cols),
|
|
1976
|
+
decrement: true,
|
|
1977
|
+
disabledIndices
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
} else if (loop) {
|
|
1981
|
+
indexRef.current = findNonDisabledIndex(listRef, {
|
|
1982
|
+
startingIndex: prevIndex + (cols - prevIndex % cols),
|
|
1983
|
+
decrement: true,
|
|
1984
|
+
disabledIndices
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
if (isDifferentRow(indexRef.current, cols, prevRow)) {
|
|
1989
|
+
indexRef.current = prevIndex;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
const lastRow = Math.floor(maxIndex / cols) === prevRow;
|
|
1994
|
+
|
|
1995
|
+
if (isIndexOutOfBounds(listRef, indexRef.current)) {
|
|
1996
|
+
if (loop && lastRow) {
|
|
1997
|
+
indexRef.current = event.key === ARROW_LEFT ? maxIndex : findNonDisabledIndex(listRef, {
|
|
1998
|
+
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
1999
|
+
disabledIndices
|
|
2000
|
+
});
|
|
2001
|
+
} else {
|
|
2002
|
+
indexRef.current = prevIndex;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
onNavigate(indexRef.current);
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
if (isMainOrientationKey(event.key, orientation)) {
|
|
2012
|
+
stopEvent(event); // Reset the index if no item is focused.
|
|
2013
|
+
|
|
2014
|
+
if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {
|
|
2015
|
+
indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;
|
|
2016
|
+
onNavigate(indexRef.current);
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
if (isMainOrientationToEndKey(event.key, orientation, rtl)) {
|
|
2021
|
+
if (loop) {
|
|
2022
|
+
indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledIndex(listRef, {
|
|
2023
|
+
startingIndex: currentIndex,
|
|
2024
|
+
disabledIndices
|
|
2025
|
+
});
|
|
2026
|
+
} else {
|
|
2027
|
+
indexRef.current = Math.min(maxIndex, findNonDisabledIndex(listRef, {
|
|
2028
|
+
startingIndex: currentIndex,
|
|
2029
|
+
disabledIndices
|
|
2030
|
+
}));
|
|
2031
|
+
}
|
|
2032
|
+
} else {
|
|
2033
|
+
if (loop) {
|
|
2034
|
+
indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledIndex(listRef, {
|
|
2035
|
+
startingIndex: currentIndex,
|
|
2036
|
+
decrement: true,
|
|
2037
|
+
disabledIndices
|
|
2038
|
+
});
|
|
2039
|
+
} else {
|
|
2040
|
+
indexRef.current = Math.max(minIndex, findNonDisabledIndex(listRef, {
|
|
2041
|
+
startingIndex: currentIndex,
|
|
2042
|
+
decrement: true,
|
|
2043
|
+
disabledIndices
|
|
2044
|
+
}));
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
if (isIndexOutOfBounds(listRef, indexRef.current)) {
|
|
2049
|
+
onNavigate(null);
|
|
2050
|
+
} else {
|
|
2051
|
+
onNavigate(indexRef.current);
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
return {
|
|
2057
|
+
reference: { ...(virtual && open && activeIndex != null && {
|
|
2058
|
+
'aria-activedescendant': activeId
|
|
2059
|
+
}),
|
|
2060
|
+
|
|
2061
|
+
onKeyDown(event) {
|
|
2062
|
+
blockPointerLeaveRef.current = true;
|
|
2063
|
+
|
|
2064
|
+
if (virtual && open) {
|
|
2065
|
+
return onKeyDown(event);
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
const isNavigationKey = event.key.indexOf('Arrow') === 0 || event.key === 'Enter' || event.key === ' ' || event.key === '';
|
|
2069
|
+
|
|
2070
|
+
if (isNavigationKey) {
|
|
2071
|
+
keyRef.current = event.key;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
if (nested) {
|
|
2075
|
+
if (isCrossOrientationOpenKey(event.key, orientation, rtl)) {
|
|
2076
|
+
stopEvent(event);
|
|
2077
|
+
|
|
2078
|
+
if (open) {
|
|
2079
|
+
indexRef.current = getMinIndex(listRef, disabledIndices);
|
|
2080
|
+
onNavigate(indexRef.current);
|
|
2081
|
+
} else {
|
|
2082
|
+
onOpenChange(true);
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
return;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
if (isMainOrientationKey(event.key, orientation)) {
|
|
2090
|
+
if (selectedIndex != null) {
|
|
2091
|
+
indexRef.current = selectedIndex;
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
stopEvent(event);
|
|
2095
|
+
|
|
2096
|
+
if (!open && openOnArrowKeyDown) {
|
|
2097
|
+
onOpenChange(true);
|
|
2098
|
+
} else {
|
|
2099
|
+
onKeyDown(event);
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
if (open) {
|
|
2103
|
+
onNavigate(indexRef.current);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
},
|
|
2109
|
+
floating: {
|
|
2110
|
+
'aria-orientation': orientation === 'both' ? undefined : orientation,
|
|
2111
|
+
...(virtual && activeIndex != null && {
|
|
2112
|
+
'aria-activedescendant': activeId
|
|
2113
|
+
}),
|
|
2114
|
+
onKeyDown,
|
|
2115
|
+
|
|
2116
|
+
onPointerMove() {
|
|
2117
|
+
blockPointerLeaveRef.current = false;
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
},
|
|
2121
|
+
item: {
|
|
2122
|
+
onFocus(_ref2) {
|
|
2123
|
+
let {
|
|
2124
|
+
currentTarget
|
|
2125
|
+
} = _ref2;
|
|
2126
|
+
const index = listRef.current.indexOf(currentTarget);
|
|
2127
|
+
|
|
2128
|
+
if (index !== -1) {
|
|
2129
|
+
onNavigate(index);
|
|
2130
|
+
}
|
|
2131
|
+
},
|
|
2132
|
+
|
|
2133
|
+
onClick: _ref3 => {
|
|
2134
|
+
let {
|
|
2135
|
+
currentTarget
|
|
2136
|
+
} = _ref3;
|
|
2137
|
+
return currentTarget.focus({
|
|
2138
|
+
preventScroll: true
|
|
2139
|
+
});
|
|
2140
|
+
},
|
|
2141
|
+
// Safari
|
|
2142
|
+
...(focusItemOnHover && {
|
|
2143
|
+
onMouseMove(_ref4) {
|
|
2144
|
+
let {
|
|
2145
|
+
currentTarget
|
|
2146
|
+
} = _ref4;
|
|
2147
|
+
const target = currentTarget;
|
|
2148
|
+
|
|
2149
|
+
if (target) {
|
|
2150
|
+
const index = listRef.current.indexOf(target);
|
|
2151
|
+
|
|
2152
|
+
if (index !== -1) {
|
|
2153
|
+
onNavigate(index);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
},
|
|
2157
|
+
|
|
2158
|
+
onPointerLeave() {
|
|
2159
|
+
if (!blockPointerLeaveRef.current) {
|
|
2160
|
+
indexRef.current = -1;
|
|
2161
|
+
focusItem(listRef, indexRef);
|
|
2162
|
+
onNavigate(null);
|
|
2163
|
+
|
|
2164
|
+
if (!virtual) {
|
|
2165
|
+
requestAnimationFrame(() => {
|
|
2166
|
+
var _refs$floating$curren;
|
|
2167
|
+
|
|
2168
|
+
(_refs$floating$curren = refs.floating.current) == null ? void 0 : _refs$floating$curren.focus({
|
|
2169
|
+
preventScroll: true
|
|
2170
|
+
});
|
|
2171
|
+
});
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
})
|
|
2177
|
+
}
|
|
2178
|
+
};
|
|
2179
|
+
}, [activeId, disabledIndicesRef, listRef, enabled, orientation, rtl, virtual, open, activeIndex, nested, selectedIndex, openOnArrowKeyDown, focusItemOnHover, allowEscape, cols, loop, refs, focusItem, onNavigate, onOpenChange]);
|
|
2180
|
+
};
|
|
2181
|
+
|
|
2182
|
+
export { FloatingFocusManager, FloatingOverlay, FloatingPortal, getOverflowAncestors, useClick, useDismiss, useFloating, useFloatingParentNodeId, useFloatingPortalNode, useFloatingTree, useFocus, useHover, useId, useInteractions, useListNavigation, useRole };
|
|
2183
|
+
//# sourceMappingURL=floating-ui.react-dom-interactions.esm.js.map
|