@primereact/headless 11.0.0-alpha.7 → 11.0.0-alpha.9

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.
Files changed (114) hide show
  1. package/breadcrumb/index.d.ts +2 -0
  2. package/breadcrumb/index.mjs +2 -0
  3. package/breadcrumb/index.mjs.map +1 -0
  4. package/breadcrumb/useBreadcrumb.d.ts +3 -0
  5. package/breadcrumb/useBreadcrumb.props.d.ts +2 -0
  6. package/breadcrumb/useBreadcrumb.test.d.ts +0 -0
  7. package/carousel/index.mjs +1 -1
  8. package/carousel/index.mjs.map +1 -1
  9. package/carousel/useCarousel.d.ts +18 -18
  10. package/colorpicker/colorManager.d.ts +101 -0
  11. package/colorpicker/index.d.ts +3 -0
  12. package/colorpicker/index.mjs +2 -0
  13. package/colorpicker/index.mjs.map +1 -0
  14. package/colorpicker/input/index.d.ts +2 -0
  15. package/colorpicker/input/index.mjs +2 -0
  16. package/colorpicker/input/index.mjs.map +1 -0
  17. package/colorpicker/input/useColorPickerInput.d.ts +11 -0
  18. package/colorpicker/input/useColorPickerInput.props.d.ts +2 -0
  19. package/colorpicker/input/useColorPickerInput.test.d.ts +0 -0
  20. package/colorpicker/slider/index.d.ts +2 -0
  21. package/colorpicker/slider/index.mjs +2 -0
  22. package/colorpicker/slider/index.mjs.map +1 -0
  23. package/colorpicker/slider/useColorPickerSlider.d.ts +13 -0
  24. package/colorpicker/slider/useColorPickerSlider.props.d.ts +2 -0
  25. package/colorpicker/slider/useColorPickerSlider.test.d.ts +0 -0
  26. package/colorpicker/useColorPicker.d.ts +26 -0
  27. package/colorpicker/useColorPicker.props.d.ts +2 -0
  28. package/colorpicker/useColorPicker.test.d.ts +0 -0
  29. package/commandmenu/index.d.ts +2 -0
  30. package/commandmenu/index.mjs +2 -0
  31. package/commandmenu/index.mjs.map +1 -0
  32. package/commandmenu/useCommandMenu.d.ts +11 -0
  33. package/commandmenu/useCommandMenu.props.d.ts +2 -0
  34. package/commandmenu/useCommandMenu.test.d.ts +0 -0
  35. package/contextmenu/index.d.ts +2 -0
  36. package/contextmenu/index.mjs +2 -0
  37. package/contextmenu/index.mjs.map +1 -0
  38. package/contextmenu/useContextMenu.d.ts +1 -0
  39. package/contextmenu/useContextMenu.props.d.ts +2 -0
  40. package/contextmenu/useContextMenu.test.d.ts +0 -0
  41. package/datepicker/index.d.ts +2 -0
  42. package/datepicker/index.mjs +2 -0
  43. package/datepicker/index.mjs.map +1 -0
  44. package/datepicker/useDatePicker.d.ts +114 -0
  45. package/datepicker/useDatePicker.props.d.ts +2 -0
  46. package/datepicker/useDatePicker.test.d.ts +0 -0
  47. package/gallery/index.mjs +1 -1
  48. package/gallery/index.mjs.map +1 -1
  49. package/gallery/item/index.mjs +1 -1
  50. package/gallery/item/index.mjs.map +1 -1
  51. package/gallery/useGallery.d.ts +2 -8
  52. package/inputtags/index.d.ts +2 -0
  53. package/inputtags/index.mjs +2 -0
  54. package/inputtags/index.mjs.map +1 -0
  55. package/inputtags/useInputTags.d.ts +20 -0
  56. package/inputtags/useInputTags.props.d.ts +2 -0
  57. package/inputtags/useInputTags.test.d.ts +0 -0
  58. package/listbox/index.d.ts +2 -0
  59. package/listbox/index.mjs +2 -0
  60. package/listbox/index.mjs.map +1 -0
  61. package/listbox/useListbox.d.ts +45 -0
  62. package/listbox/useListbox.props.d.ts +2 -0
  63. package/listbox/useListbox.test.d.ts +0 -0
  64. package/menu/index.d.ts +2 -0
  65. package/menu/index.mjs +2 -0
  66. package/menu/index.mjs.map +1 -0
  67. package/menu/sub/index.d.ts +2 -0
  68. package/menu/sub/index.mjs +2 -0
  69. package/menu/sub/index.mjs.map +1 -0
  70. package/menu/sub/useMenuSub.d.ts +19 -0
  71. package/menu/sub/useMenuSub.props.d.ts +2 -0
  72. package/menu/useMenu.d.ts +34 -0
  73. package/menu/useMenu.props.d.ts +2 -0
  74. package/menu/useMenu.test.d.ts +0 -0
  75. package/orgchart/index.d.ts +2 -0
  76. package/orgchart/index.mjs +2 -0
  77. package/orgchart/index.mjs.map +1 -0
  78. package/orgchart/useOrgChart.d.ts +20 -0
  79. package/orgchart/useOrgChart.props.d.ts +2 -0
  80. package/orgchart/useOrgChart.test.d.ts +0 -0
  81. package/overlay/index.d.ts +2 -0
  82. package/overlay/index.mjs +2 -0
  83. package/overlay/index.mjs.map +1 -0
  84. package/overlay/useOverlay.d.ts +16 -0
  85. package/overlay/useOverlay.props.d.ts +2 -0
  86. package/overlay/useOverlay.test.d.ts +0 -0
  87. package/package.json +4 -4
  88. package/password/index.d.ts +2 -0
  89. package/password/index.mjs +2 -0
  90. package/password/index.mjs.map +1 -0
  91. package/password/usePassword.d.ts +35 -0
  92. package/password/usePassword.props.d.ts +2 -0
  93. package/password/usePassword.test.d.ts +0 -0
  94. package/placer/index.mjs +1 -1
  95. package/placer/index.mjs.map +1 -1
  96. package/toast/index.d.ts +1 -0
  97. package/toast/index.mjs +1 -1
  98. package/toast/index.mjs.map +1 -1
  99. package/toast/item/index.css +1 -1
  100. package/toast/item/index.css.map +1 -1
  101. package/toast/item/index.mjs +1 -1
  102. package/toast/item/index.mjs.map +1 -1
  103. package/toast/item/useToastItem.d.ts +12 -8
  104. package/toast/toastStore.d.ts +40 -0
  105. package/toast/useToast.d.ts +12 -4
  106. package/tree/TreeDragDropService.d.ts +24 -0
  107. package/tree/index.d.ts +3 -0
  108. package/tree/index.mjs +2 -0
  109. package/tree/index.mjs.map +1 -0
  110. package/tree/useTree.d.ts +27 -0
  111. package/tree/useTree.props.d.ts +2 -0
  112. package/tree/useTree.test.d.ts +0 -0
  113. package/toast/index.css +0 -2
  114. package/toast/index.css.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/gallery/item/useGalleryItem.tsx","../../../../primereact/src/gallery/Gallery.tsx","../../../../primereact/src/base/index.ts","../../../../primereact/src/gallery/Gallery.context.ts","../../../../primereact/src/gallery/Gallery.props.ts","../../../../primereact/src/gallery/backdrop/GalleryBackdrop.tsx","../../../../primereact/src/gallery/backdrop/GalleryBackdrop.props.ts","../../../../primereact/src/gallery/content/GalleryContent.tsx","../../../../primereact/src/gallery/content/GalleryContent.props.ts","../../../../primereact/src/gallery/item/GalleryItem.tsx","../../../../primereact/src/gallery/item/GalleryItem.context.ts","../../../../primereact/src/gallery/item/GalleryItem.props.ts","../../../../primereact/src/gallery/next/GalleryNext.tsx","../../../../primereact/src/gallery/next/GalleryNext.props.ts","../../../../primereact/src/gallery/prev/GalleryPrev.tsx","../../../../primereact/src/gallery/prev/GalleryPrev.props.ts","../../../../primereact/src/gallery/thumbnail/GalleryThumbnail.tsx","../../../../primereact/src/carousel/Carousel.tsx","../../../../primereact/src/carousel/Carousel.context.ts","../../../../primereact/src/carousel/Carousel.props.ts","../../../../primereact/src/carousel/content/CarouselContent.tsx","../../../../primereact/src/carousel/content/CarouselContent.props.ts","../../../../primereact/src/carousel/indicator/CarouselIndicator.tsx","../../../../primereact/src/carousel/indicator/CarouselIndicator.props.ts","../../../../primereact/src/carousel/indicators/CarouselIndicators.tsx","../../../../primereact/src/carousel/indicators/CarouselIndicators.props.ts","../../../../primereact/src/carousel/item/CarouselItem.tsx","../../../../primereact/src/carousel/item/CarouselItem.props.ts","../../../../primereact/src/carousel/next/CarouselNext.tsx","../../../../primereact/src/carousel/next/CarouselNext.props.ts","../../../../primereact/src/carousel/prev/CarouselPrev.tsx","../../../../primereact/src/carousel/prev/CarouselPrev.props.ts","../../../../primereact/src/gallery/thumbnail/GalleryThumbnail.props.ts","../../../../primereact/src/gallery/thumbnailcontent/GalleryThumbnailContent.tsx","../../../../primereact/src/gallery/thumbnailcontent/GalleryThumbnailContent.props.ts","../../../../primereact/src/gallery/thumbnailitem/GalleryThumbnailItem.tsx","../../../../primereact/src/gallery/thumbnailitem/GalleryThumbnailItem.props.ts","../../../../primereact/src/gallery/toolbar/GalleryToolbar.tsx","../../../../primereact/src/gallery/toolbar/GalleryToolbar.props.ts","../../../../primereact/src/gallery/toolbaritem/GalleryToolbarItem.tsx","../../../../primereact/src/gallery/toolbaritem/GalleryToolbarItem.props.ts","../../../src/gallery/item/useGalleryItem.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport { useGalleryContext } from 'primereact/gallery';\nimport * as React from 'react';\nimport { defaultItemProps } from './useGalleryItem.props';\n\nexport const useGalleryItem = withHeadless({\n name: 'useGalleryItem',\n defaultProps: defaultItemProps,\n setup: ({ props, elementRef }) => {\n const { normalScale = 1, zoomedScale = 3 } = props;\n\n const gallery = useGalleryContext();\n const [index, setIndex] = React.useState(-1);\n const [isActive, setIsActive] = React.useState(false);\n const [position, setPosition] = React.useState({ x: 0, y: 0 });\n const [scale, setScale] = React.useState(1);\n const [rotation, setRotation] = React.useState(0);\n const [flip, setFlip] = React.useState({ x: 1, y: 1 });\n\n const [isDragging, setIsDragging] = React.useState(false);\n const [dragStart, setDragStart] = React.useState({ x: 0, y: 0 });\n const [hasDragged, setHasDragged] = React.useState(false);\n\n const pointerDataRef = React.useRef<Map<number, { x: number; y: number }>>(new Map());\n const lastDistanceRef = React.useRef(0);\n\n const calculateItemSize = React.useCallback(() => {\n if (!gallery?.contentRef.current || !elementRef.current) return;\n\n const contentRect = gallery?.contentRef.current.getBoundingClientRect();\n\n const imageElement = elementRef.current.firstElementChild as HTMLImageElement;\n\n if (!imageElement) return;\n\n let naturalWidth = imageElement.naturalWidth || imageElement.offsetWidth;\n let naturalHeight = imageElement.naturalHeight || imageElement.offsetHeight;\n\n if (naturalWidth === 0 || naturalHeight === 0) return;\n\n const isRotated = Math.abs(rotation) % 180 === 90;\n\n if (isRotated) {\n [naturalWidth, naturalHeight] = [naturalHeight, naturalWidth];\n }\n\n const naturalAspectRatio = naturalWidth / naturalHeight;\n const contentAspectRatio = contentRect.width / contentRect.height;\n\n let targetWidth, targetHeight;\n\n if (naturalAspectRatio > contentAspectRatio) {\n targetWidth = Math.min(contentRect.width * 0.99, naturalWidth);\n targetHeight = targetWidth / naturalAspectRatio;\n } else {\n targetHeight = Math.min(contentRect.height * 0.99, naturalHeight);\n targetWidth = targetHeight * naturalAspectRatio;\n }\n\n if (isRotated) {\n imageElement.style.width = `${targetHeight}px`;\n imageElement.style.height = `${targetWidth}px`;\n elementRef.current.style.width = `${targetHeight > 0 ? targetHeight : 'auto'}px`;\n elementRef.current.style.height = `${targetWidth > 0 ? targetWidth : 'auto'}px`;\n } else {\n imageElement.style.width = `${targetWidth}px`;\n imageElement.style.height = `${targetHeight}px`;\n elementRef.current.style.width = `${targetWidth > 0 ? targetWidth : 'auto'}px`;\n elementRef.current.style.height = `${targetHeight > 0 ? targetHeight : 'auto'}px`;\n }\n\n elementRef.current.style.aspectRatio = `${naturalWidth / naturalHeight}`;\n }, [gallery?.contentRef, rotation]);\n\n const calculateConstraints = React.useCallback(\n (targetScale?: number) => {\n if (!gallery?.contentRef.current || !elementRef.current) return { minX: 0, maxX: 0, minY: 0, maxY: 0 };\n\n const contentRect = gallery?.contentRef.current.getBoundingClientRect();\n const scaleToUse = targetScale !== undefined ? targetScale : scale;\n\n const itemElement = elementRef.current.firstElementChild as HTMLElement;\n\n if (!itemElement) return { minX: 0, maxX: 0, minY: 0, maxY: 0 };\n\n let originalWidth = itemElement.offsetWidth;\n let originalHeight = itemElement.offsetHeight;\n\n const isRotated = Math.abs(rotation) % 180 === 90;\n\n if (isRotated) {\n [originalWidth, originalHeight] = [originalHeight, originalWidth];\n }\n\n const scaledWidth = originalWidth * scaleToUse;\n const scaledHeight = originalHeight * scaleToUse;\n\n const contentCenterX = contentRect.width / 2;\n const contentCenterY = contentRect.height / 2;\n\n const halfScaledWidth = scaledWidth / 2;\n const halfScaledHeight = scaledHeight / 2;\n\n const maxX = halfScaledWidth > contentCenterX ? halfScaledWidth - contentCenterX : 0;\n const minX = halfScaledWidth > contentCenterX ? -(halfScaledWidth - contentCenterX) : 0;\n\n const maxY = halfScaledHeight > contentCenterY ? halfScaledHeight - contentCenterY : 0;\n const minY = halfScaledHeight > contentCenterY ? -(halfScaledHeight - contentCenterY) : 0;\n\n return { minX, maxX, minY, maxY };\n },\n [gallery?.contentRef, scale, rotation]\n );\n\n const zoomIn = React.useCallback(() => {\n setScale(zoomedScale);\n\n const hiddenStyles = {\n visibility: 'hidden',\n opacity: 0,\n pointerEvents: 'none',\n userSelect: 'none',\n touchAction: 'none'\n };\n\n if (gallery?.toolbarRef.current) {\n Object.assign(gallery?.toolbarRef.current.style, hiddenStyles);\n }\n\n if (gallery?.thumbnailRef.current) {\n // @ts-expect-error - thumbnailRef may not have elementRef property\n Object.assign(gallery?.thumbnailRef.current.elementRef.current.style, hiddenStyles);\n }\n\n if (gallery?.prevRef.current) {\n Object.assign(gallery.prevRef.current.style, hiddenStyles);\n }\n\n if (gallery?.nextRef.current) {\n Object.assign(gallery.nextRef.current.style, hiddenStyles);\n }\n\n if (elementRef.current) {\n elementRef.current.style.cursor = 'zoom-out';\n elementRef.current.style.pointerEvents = 'auto';\n }\n }, [zoomedScale, gallery?.toolbarRef, gallery?.thumbnailRef, gallery?.prevRef, gallery?.nextRef]);\n\n const zoomOut = React.useCallback(() => {\n setScale(normalScale);\n setPosition({ x: 0, y: 0 });\n\n const resetStyles = {\n visibility: '',\n opacity: '',\n pointerEvents: '',\n userSelect: '',\n touchAction: ''\n };\n\n if (gallery?.toolbarRef.current) {\n Object.assign(gallery.toolbarRef.current.style, resetStyles);\n }\n\n if (gallery?.thumbnailRef.current) {\n // @ts-expect-error - thumbnailRef may not have elementRef property\n Object.assign(gallery.thumbnailRef.current.elementRef.current.style, resetStyles);\n }\n\n if (gallery?.prevRef.current) {\n Object.assign(gallery.prevRef.current.style, resetStyles);\n }\n\n if (gallery?.nextRef.current) {\n Object.assign(gallery.nextRef.current.style, resetStyles);\n }\n\n if (elementRef.current) {\n elementRef.current.style.cursor = 'zoom-in';\n elementRef.current.style.pointerEvents = 'auto';\n }\n }, [normalScale, gallery?.toolbarRef, gallery?.thumbnailRef, gallery?.prevRef, gallery?.nextRef]);\n\n const rotateLeft = () => {\n if (!elementRef.current) return;\n\n elementRef.current.style.transition = 'none';\n setRotation((prev) => prev - 90);\n setTimeout(() => {\n if (elementRef.current) {\n elementRef.current.style.transition = '';\n }\n }, 0);\n };\n\n const rotateRight = () => {\n if (!elementRef.current) return;\n\n elementRef.current.style.transition = 'none';\n setRotation((prev) => prev + 90);\n setTimeout(() => {\n if (elementRef.current) {\n elementRef.current.style.transition = '';\n }\n }, 0);\n };\n\n const flipX = () => {\n setFlip((prev) => ({ ...prev, x: Math.sign(prev.x) * -1 }));\n };\n\n const flipY = () => {\n setFlip((prev) => ({ ...prev, y: Math.sign(prev.y) * -1 }));\n };\n\n const download = () => {\n if (!elementRef.current) return;\n\n const imageElement = elementRef.current.querySelector('img') as HTMLImageElement;\n\n if (!imageElement || !imageElement.src) return;\n\n const link = document.createElement('a');\n\n link.href = imageElement.src;\n\n const urlParts = imageElement.src.split('/');\n const filename = urlParts[urlParts.length - 1] || 'image.jpg';\n\n link.download = filename;\n link.target = '_blank';\n\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n\n const handleClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (hasDragged) {\n setHasDragged(false);\n\n return;\n }\n\n if (scale === normalScale) {\n if (elementRef.current) {\n const itemRect = elementRef.current.getBoundingClientRect();\n\n const itemCenterX = itemRect.width / 2;\n const itemCenterY = itemRect.height / 2;\n\n const clickX = e.clientX - itemRect.left;\n const clickY = e.clientY - itemRect.top;\n\n const offsetX = itemCenterX - clickX;\n const offsetY = itemCenterY - clickY;\n\n const zoomOffsetX = offsetX * (zoomedScale - 1);\n const zoomOffsetY = offsetY * (zoomedScale - 1);\n\n const constraints = calculateConstraints(zoomedScale);\n const constrainedX = Math.max(constraints.minX, Math.min(constraints.maxX, zoomOffsetX));\n const constrainedY = Math.max(constraints.minY, Math.min(constraints.maxY, zoomOffsetY));\n\n setPosition({ x: constrainedX, y: constrainedY });\n }\n\n zoomIn();\n } else {\n zoomOut();\n }\n },\n [hasDragged, normalScale, zoomedScale, calculateConstraints, scale, zoomIn, zoomOut]\n );\n const handleDragStart = React.useCallback((e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n }, []);\n\n const handlePointerDown = React.useCallback(\n (e: React.PointerEvent) => {\n e.currentTarget.setPointerCapture(e.pointerId);\n pointerDataRef.current.set(e.pointerId, { x: e.clientX, y: e.clientY });\n\n if (scale > 1) {\n if (e.pointerType === 'mouse') {\n setIsDragging(true);\n setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });\n setHasDragged(false);\n } else if (e.pointerType === 'touch' && pointerDataRef.current.size === 1) {\n setIsDragging(true);\n setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });\n setHasDragged(false);\n lastDistanceRef.current = 0;\n }\n }\n\n if (e.pointerType === 'touch' && pointerDataRef.current.size === 1) {\n lastDistanceRef.current = 0;\n }\n },\n [scale, position]\n );\n\n const handlePointerMove = React.useCallback(\n (e: React.PointerEvent) => {\n if (!pointerDataRef.current.has(e.pointerId) || !elementRef.current) return;\n\n elementRef.current.style.transition = 'none';\n\n // Preserve cursor during move\n const currentCursor = elementRef.current.style.cursor;\n\n if (!currentCursor) {\n elementRef.current.style.cursor = scale > normalScale ? 'zoom-out' : 'zoom-in';\n }\n\n pointerDataRef.current.set(e.pointerId, { x: e.clientX, y: e.clientY });\n\n const pointers = Array.from(pointerDataRef.current.values());\n\n if (pointers.length === 2) {\n const [p1, p2] = pointers;\n const distance = Math.hypot(p2.x - p1.x, p2.y - p1.y);\n\n if (lastDistanceRef.current > 0) {\n const delta = (distance - lastDistanceRef.current) * 0.01;\n\n if (Math.abs(delta) > 0.01) {\n const newScale = scale === normalScale ? zoomedScale : normalScale;\n\n const constraints = calculateConstraints(newScale);\n const constrainedX = Math.max(constraints.minX, Math.min(constraints.maxX, position.x));\n const constrainedY = Math.max(constraints.minY, Math.min(constraints.maxY, position.y));\n\n setPosition({ x: constrainedX, y: constrainedY });\n\n setScale(newScale);\n }\n }\n\n lastDistanceRef.current = distance;\n } else if (pointers.length === 1 && isDragging) {\n const pointer = pointers[0];\n const newX = pointer.x - dragStart.x;\n const newY = pointer.y - dragStart.y;\n const constraints = calculateConstraints();\n\n const computedX = Math.max(constraints.minX, Math.min(constraints.maxX, newX));\n const computedY = Math.max(constraints.minY, Math.min(constraints.maxY, newY));\n\n setPosition({\n x: computedX,\n y: computedY\n });\n setHasDragged(true);\n }\n },\n [isDragging, dragStart, scale, normalScale, zoomedScale, position, calculateConstraints]\n );\n\n const handlePointerUp = React.useCallback((e: React.PointerEvent) => {\n if (!elementRef.current) return;\n\n elementRef.current.style.transition = '';\n // Restore proper cursor after interaction\n elementRef.current.style.cursor = scale > normalScale ? 'zoom-out' : 'zoom-in';\n e.currentTarget.releasePointerCapture(e.pointerId);\n pointerDataRef.current.delete(e.pointerId);\n\n if (pointerDataRef.current.size < 2) lastDistanceRef.current = 0;\n\n if (pointerDataRef.current.size === 0) {\n setIsDragging(false);\n }\n }, []);\n\n React.useEffect(() => {\n if (scale <= 1) {\n setPosition({ x: 0, y: 0 });\n }\n }, [scale]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index && document.readyState === 'complete') {\n calculateItemSize();\n }\n }, [gallery?.state.activeIndex, index, calculateItemSize]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index) {\n calculateItemSize();\n }\n }, [rotation, calculateItemSize, gallery?.state.activeIndex, index]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index && gallery?.state.isFullscreen !== undefined) {\n calculateItemSize();\n }\n }, [gallery?.state.isFullscreen, calculateItemSize, gallery?.state.activeIndex, index]);\n\n React.useEffect(() => {\n const handleResize = () => {\n if (gallery?.state.activeIndex === index) {\n calculateItemSize();\n }\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, [gallery?.state.activeIndex, index, calculateItemSize]);\n\n React.useEffect(() => {\n if (gallery && elementRef.current) {\n const index = gallery.registerItem(elementRef.current as HTMLDivElement);\n\n setIndex(index);\n }\n }, [gallery]);\n\n React.useEffect(() => {\n const handleCustomEvent = (e: CustomEvent) => {\n if (e.detail?.action === 'zoom-in') {\n zoomIn();\n } else if (e.detail?.action === 'zoom-out') {\n zoomOut();\n } else if (e.detail?.action === 'rotate-left') {\n rotateLeft();\n } else if (e.detail?.action === 'rotate-right') {\n rotateRight();\n } else if (e.detail?.action === 'flip-x') {\n flipX();\n } else if (e.detail?.action === 'flip-y') {\n flipY();\n } else if (e.detail?.action === 'download') {\n download();\n }\n };\n\n const itemElement = elementRef.current;\n\n if (itemElement) {\n itemElement.addEventListener('gallery-zoom-in', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-zoom-out', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-rotate-left', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-rotate-right', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-flip-x', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-flip-y', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-download', handleCustomEvent as EventListener);\n }\n\n return () => {\n if (itemElement) {\n itemElement.removeEventListener('gallery-zoom-in', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-zoom-out', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-rotate-left', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-rotate-right', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-flip-x', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-flip-y', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-download', handleCustomEvent as EventListener);\n }\n };\n }, [normalScale, zoomedScale]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index) {\n setIsActive(true);\n } else {\n setIsActive(false);\n }\n }, [gallery?.state.activeIndex, index]);\n\n const attributes = React.useMemo(() => {\n return {\n 'data-active': isActive\n };\n }, [isActive]);\n\n const CSSVariables = React.useMemo(() => {\n return {\n '--position-x': `${position.x}px`,\n '--position-y': `${position.y}px`,\n '--scale': `${scale}`,\n '--rotation': `${rotation}deg`,\n '--flip-x': flip.x,\n '--flip-y': flip.y\n } as React.CSSProperties;\n }, [position, scale, rotation, flip]);\n\n const state = {\n index,\n position,\n scale,\n rotation,\n flip,\n isActive,\n dragStart,\n hasDragged\n };\n\n return {\n state,\n attributes,\n CSSVariables,\n handlePointerUp,\n handlePointerMove,\n handlePointerDown,\n handleClick,\n handleDragStart,\n zoomIn,\n zoomOut,\n rotateLeft,\n rotateRight,\n flipX,\n flipY,\n download,\n calculateConstraints,\n calculateItemSize\n };\n }\n});\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useGallery } from '@primereact/headless/gallery';\nimport { styles } from '@primereact/styles/gallery';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { GalleryProvider } from './Gallery.context';\nimport { defaultProps } from './Gallery.props';\nimport { GalleryBackdrop } from './backdrop/GalleryBackdrop';\nimport { GalleryContent } from './content/GalleryContent';\nimport { GalleryItem } from './item/GalleryItem';\nimport { GalleryNext } from './next/GalleryNext';\nimport { GalleryPrev } from './prev/GalleryPrev';\nimport { GalleryThumbnail } from './thumbnail/GalleryThumbnail';\nimport { GalleryThumbnailContent } from './thumbnailcontent/GalleryThumbnailContent';\nimport { GalleryThumbnailItem } from './thumbnailitem/GalleryThumbnailItem';\nimport { GalleryToolbar } from './toolbar/GalleryToolbar';\nimport { GalleryToolbarItem } from './toolbaritem/GalleryToolbarItem';\n\nexport const Gallery = withComponent({\n name: 'Gallery',\n defaultProps,\n styles,\n setup(instance) {\n const gallery = useGallery(instance.inProps);\n\n return gallery;\n },\n render(instance) {\n const { id, props, ptmi, cx } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n className: cx('root')\n },\n ptmi('root')\n );\n\n return (\n <GalleryProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </GalleryProvider>\n );\n },\n components: {\n Backdrop: GalleryBackdrop,\n Content: GalleryContent,\n Item: GalleryItem,\n Next: GalleryNext,\n Prev: GalleryPrev,\n Toolbar: GalleryToolbar,\n ToolbarItem: GalleryToolbarItem,\n Thumbnail: GalleryThumbnail,\n ThumbnailContent: GalleryThumbnailContent,\n ThumbnailItem: GalleryThumbnailItem\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { GalleryInstance } from '@primereact/types/shared/gallery';\n\nexport const [GalleryProvider, useGalleryContext] = createOptionalContext<GalleryInstance>();\n","import * as HeadlessGallery from '@primereact/headless/gallery';\nimport type { GalleryProps } from '@primereact/types/shared/gallery';\n\nexport const defaultProps: GalleryProps = {\n ...HeadlessGallery.defaultProps,\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultCloseProps } from './GalleryBackdrop.props';\n\nexport const GalleryBackdrop = withComponent({\n name: 'GalleryBackdrop',\n defaultProps: defaultCloseProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('backdrop')\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryBackdropProps } from '@primereact/types/shared/gallery';\n\nexport const defaultCloseProps: GalleryBackdropProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultContentProps } from './GalleryContent.props';\n\nexport const GalleryContent = withComponent({\n name: 'GalleryContent',\n defaultProps: defaultContentProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('content')\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.contentRef} />;\n }\n});\n","import { GalleryContentProps } from '@primereact/types/shared/gallery';\n\nexport const defaultContentProps: GalleryContentProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useGalleryItem } from '@primereact/headless/gallery/item';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { GalleryItemProvider } from './GalleryItem.context';\nimport { defaultProps } from './GalleryItem.props';\n\nexport const GalleryItem = withComponent({\n name: 'GalleryItem',\n defaultProps,\n setup(instance) {\n const gallery = useGalleryContext();\n const galleryItem = useGalleryItem(instance.inProps);\n\n return { ...galleryItem, gallery };\n },\n render(instance) {\n const { id, props, ptmi, gallery, handleClick, handlePointerDown, handlePointerMove, handlePointerUp, handleDragStart, CSSVariables, attributes } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n className: gallery?.cx('item'),\n onClick: handleClick,\n onPointerDown: handlePointerDown,\n onPointerMove: handlePointerMove,\n onPointerUp: handlePointerUp,\n onDragStart: handleDragStart,\n style: CSSVariables,\n ...attributes\n },\n ptmi('root'),\n gallery?.ptm('item')\n );\n\n return (\n <GalleryItemProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </GalleryItemProvider>\n );\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { GalleryItemInstance } from '@primereact/types/shared/gallery';\n\nexport const [GalleryItemProvider, useGalleryItemContext] = createOptionalContext<GalleryItemInstance>();\n","import * as HeadlessGallery from '@primereact/headless/gallery';\nimport type { GalleryItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultProps: GalleryItemProps = {\n ...HeadlessGallery.defaultProps,\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultNextProps } from './GalleryNext.props';\n\nexport const GalleryNext = withComponent({\n name: 'GalleryNext',\n defaultProps: defaultNextProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('next'),\n onClick: gallery?.actions?.next\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.nextRef} />;\n }\n});\n","import { GalleryNextProps } from '@primereact/types/shared/gallery';\n\nexport const defaultNextProps: GalleryNextProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultPrevProps } from './GalleryPrev.props';\n\nexport const GalleryPrev = withComponent({\n name: 'GalleryPrev',\n defaultProps: defaultPrevProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('prev'),\n onClick: gallery?.actions?.prev\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.prevRef} />;\n }\n});\n","import { GalleryPrevProps } from '@primereact/types/shared/gallery';\n\nexport const defaultPrevProps: GalleryPrevProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Carousel } from 'primereact/carousel';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultThumbnailProps } from './GalleryThumbnail.props';\n\nexport const GalleryThumbnail = withComponent({\n name: 'GalleryThumbnail',\n defaultProps: defaultThumbnailProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('thumbnail')\n },\n ptmi('root')\n );\n\n return <Component as={Carousel} instance={instance} attrs={rootProps} children={props.children} ref={gallery?.thumbnailRef} />;\n }\n});\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useCarousel } from '@primereact/headless/carousel';\nimport { styles } from '@primereact/styles/carousel';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { CarouselProvider } from './Carousel.context';\nimport { defaultProps } from './Carousel.props';\nimport { CarouselContent } from './content';\nimport { CarouselIndicator } from './indicator';\nimport { CarouselIndicators } from './indicators';\nimport { CarouselItem } from './item';\nimport { CarouselNext } from './next';\nimport { CarouselPrev } from './prev';\n\nexport const Carousel = withComponent({\n name: 'Carousel',\n defaultProps,\n styles,\n setup(instance) {\n const carousel = useCarousel(instance.inProps);\n\n return carousel;\n },\n render(instance) {\n const { id, props, ptmi, cx } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n className: cx('root')\n },\n ptmi('root')\n );\n\n return (\n <CarouselProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </CarouselProvider>\n );\n },\n components: {\n Content: CarouselContent,\n Item: CarouselItem,\n Next: CarouselNext,\n Prev: CarouselPrev,\n Indicators: CarouselIndicators,\n Indicator: CarouselIndicator\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { CarouselInstance } from '@primereact/types/shared/carousel';\n\nexport const [CarouselProvider, useCarouselContext] = createOptionalContext<CarouselInstance>();\n","import * as HeadlessCarousel from '@primereact/headless/carousel';\nimport type { CarouselProps } from '@primereact/types/shared/carousel';\n\nexport const defaultProps: CarouselProps = {\n ...HeadlessCarousel.defaultProps,\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultContentProps } from './CarouselContent.props';\n\nexport const CarouselContent = withComponent({\n name: 'CarouselContent',\n defaultProps: defaultContentProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const contentProps = mergeProps(\n {\n className: carousel?.cx('content', { orientation: carousel?.props.orientation }),\n style: {\n ...({\n '--p-swipe-amount-x': `0px`,\n '--p-swipe-amount-y': `0px`,\n '--p-spacing': `${carousel?.props.spacing}px`\n } as React.CSSProperties)\n },\n onPointerDown: carousel?.handlePointerDown,\n onPointerMove: carousel?.handlePointerMove,\n onPointerUp: carousel?.handlePointerUp,\n onClick: carousel?.handleClick,\n onClickCapture: carousel?.handleClick\n },\n carousel?.ptm('content'),\n ptmi('root')\n );\n\n const viewportProps = mergeProps(\n {\n className: carousel?.cx('viewport')\n },\n carousel?.ptm('viewport')\n );\n\n return (\n <div {...viewportProps}>\n <Component instance={instance} attrs={contentProps} children={props.children} ref={carousel?.carouselRef} />\n </div>\n );\n }\n});\n","import type { CarouselContentProps } from '@primereact/types/shared/carousel';\n\nexport const defaultContentProps: CarouselContentProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultIndicatorProps } from './CarouselIndicator.props';\n\nexport const CarouselIndicator = withComponent({\n name: 'CarouselIndicator',\n defaultProps: defaultIndicatorProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const contentProps = mergeProps(\n {\n className: carousel?.cx('indicator', { active: props.index === carousel?.state?.activeIndex }),\n onClick: () => carousel?.slideTo(undefined, props.snap)\n },\n carousel?.ptm('indicator'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={contentProps} children={props.children} />;\n }\n});\n","import type { CarouselIndicatorProps } from '@primereact/types/shared/carousel';\n\nexport const defaultIndicatorProps: CarouselIndicatorProps = {\n as: 'button',\n snap: undefined,\n index: undefined\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { CarouselIndicator } from '../indicator/CarouselIndicator';\nimport { defaultIndicatorsProps } from './CarouselIndicators.props';\n\nexport const CarouselIndicators = withComponent({\n name: 'CarouselIndicators',\n defaultProps: defaultIndicatorsProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const contentProps = mergeProps(\n {\n className: carousel?.cx('indicators')\n },\n carousel?.ptm('indicators'),\n ptmi('root')\n );\n\n return (\n <Component\n instance={instance}\n attrs={contentProps}\n children={\n props.children ?? (\n <>\n {carousel?.state?.snapPoints.map((snap, i) => (\n <CarouselIndicator key={i} snap={snap} index={i} />\n ))}\n </>\n )\n }\n />\n );\n }\n});\n","import type { CarouselIndicatorsProps } from '@primereact/types/shared/carousel';\n\nexport const defaultIndicatorsProps: CarouselIndicatorsProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultItemProps } from './CarouselItem.props';\n\nexport const CarouselItem = withComponent({\n name: 'CarouselItem',\n defaultProps: defaultItemProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const rootProps = mergeProps(\n {\n className: carousel?.cx('item'),\n style: {\n '--p-slide-size': `${props.size}%`\n }\n },\n carousel?.ptm('item'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={carousel?.addSlideRef} />;\n }\n});\n","import type { CarouselItemProps } from '@primereact/types/shared/carousel';\n\nexport const defaultItemProps: CarouselItemProps = {\n as: 'div',\n size: 100\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultNextProps } from './CarouselNext.props';\n\nexport const CarouselNext = withComponent({\n name: 'CarouselNext',\n defaultProps: defaultNextProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const disabled = carousel?.state.nextDisabled;\n const rootProps = mergeProps(\n {\n className: carousel?.cx('prev', { disabled }),\n onClick: carousel?.handleNext,\n disabled\n },\n carousel?.ptm('prev'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { CarouselNextProps } from '@primereact/types/shared/carousel';\n\nexport const defaultNextProps: CarouselNextProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultPrevProps } from './CarouselPrev.props';\n\nexport const CarouselPrev = withComponent({\n name: 'CarouselPrev',\n defaultProps: defaultPrevProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const disabled = carousel?.state.prevDisabled;\n const rootProps = mergeProps(\n {\n className: carousel?.cx('prev', { disabled }),\n onClick: carousel?.handlePrev,\n disabled\n },\n carousel?.ptm('prev'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { CarouselPrevProps } from '@primereact/types/shared/carousel';\n\nexport const defaultPrevProps: CarouselPrevProps = {\n as: 'button'\n};\n","import { GalleryThumbnailProps } from '@primereact/types/shared/gallery';\n\nexport const defaultThumbnailProps: GalleryThumbnailProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Carousel } from 'primereact/carousel';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultThumbnailContentProps } from './GalleryThumbnailContent.props';\n\nexport const GalleryThumbnailContent = withComponent({\n name: 'GalleryThumbnailContent',\n defaultProps: defaultThumbnailContentProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('thumbnailContent')\n },\n ptmi('root')\n );\n\n return <Component as={Carousel.Content} instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryThumbnailContentProps } from '@primereact/types/shared/gallery';\n\nexport const defaultThumbnailContentProps: GalleryThumbnailContentProps = {};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Carousel } from 'primereact/carousel';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultThumbnailItemProps } from './GalleryThumbnailItem.props';\n\nexport const GalleryThumbnailItem = withComponent({\n name: 'GalleryThumbnailItem',\n defaultProps: defaultThumbnailItemProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('thumbnailItem')\n },\n ptmi('root')\n );\n\n return <Component as={Carousel.Item} instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryThumbnailItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultThumbnailItemProps: GalleryThumbnailItemProps = {};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultToolbarProps } from './GalleryToolbar.props';\n\nexport const GalleryToolbar = withComponent({\n name: 'GalleryToolbar',\n defaultProps: defaultToolbarProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('toolbar')\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.toolbarRef} />;\n }\n});\n","import { GalleryToolbarProps } from '@primereact/types/shared/gallery';\n\nexport const defaultToolbarProps: GalleryToolbarProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultToolbarItemProps } from './GalleryToolbarItem.props';\n\nexport const GalleryToolbarItem = withComponent({\n name: 'GalleryToolbarItem',\n defaultProps: defaultToolbarItemProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('toolbarItem'),\n onClick: () => {\n gallery?.handleClickAction(props?.action);\n props?.onClick?.();\n }\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryToolbarItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultToolbarItemProps: GalleryToolbarItemProps = {\n as: 'div',\n action: undefined,\n onClick: undefined\n};\n","import type { useGalleryItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultItemProps: useGalleryItemProps = {\n normalScale: 1,\n zoomedScale: 3\n};\n"],"mappings":"6bAAA,OAAS,gBAAAA,OAAoB,4BCC7B,OAAS,aAAAC,OAAiB,6BAC1B,OAAS,cAAAC,OAAkB,+BAC3B,OAAS,UAAAC,OAAc,6BACvB,OAAS,cAAAC,OAAkB,kBCJ3B,OAAS,iBAAiBC,OAA2B,6BACrD,OAAS,UAAUC,OAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,IADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,GAA4D,CAC/D,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,EDjBL,UAAYE,MAAW,QENvB,OAAS,yBAAAC,OAA6B,yBAG/B,GAAM,CAACC,GAAiBC,CAAiB,EAAIF,GAAuC,ECH3F,UAAYG,OAAqB,+BAG1B,IAAMC,GAA6BC,EAAAC,EAAA,GACnB,iBADmB,CAEtC,GAAI,KACR,GCLA,OAAS,aAAAC,OAAiB,6BAC1B,OAAS,cAAAC,OAAkB,kBAE3B,UAAYC,OAAW,QCFhB,IAAMC,GAA0C,CACnD,GAAI,KACR,EDIO,IAAMC,GAAkBC,EAAc,CACzC,KAAM,kBACN,aAAcC,GACd,OAAQ,CAGJ,MAAO,CAAE,QAFOC,EAAkB,CAEjB,CACrB,EACA,OAAOC,EAAU,CACb,GAAM,CAAE,MAAAC,EAAO,KAAAC,EAAM,QAAAC,CAAQ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,WAAAE,CACJ,EAII,WAAAmF,GACA,aAAAC,GACA,gBAAAX,GACA,kBAAAZ,GACA,kBAAAD,GACA,YAAAf,GACA,gBAAAc,GACA,OAAA7B,EACA,QAAAE,EACA,WAAAE,GACA,YAAAE,GACA,MAAAC,GACA,MAAAG,GACA,SAAAC,GACA,qBAAA3B,EACA,kBAAAV,CACJ,CACJ,CACJ,CAAC","names":["withHeadless","Component","useGallery","styles","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","createOptionalContext","GalleryProvider","useGalleryContext","HeadlessGallery","defaultProps","__spreadProps","__spreadValues","Component","mergeProps","React","defaultCloseProps","GalleryBackdrop","withComponent","defaultCloseProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","React","defaultContentProps","GalleryContent","withComponent","defaultContentProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Component","useGalleryItem","mergeProps","React","createOptionalContext","GalleryItemProvider","useGalleryItemContext","HeadlessGallery","defaultProps","__spreadProps","__spreadValues","GalleryItem","withComponent","defaultProps","instance","gallery","useGalleryContext","galleryItem","useGalleryItem","__spreadProps","__spreadValues","id","props","ptmi","handleClick","handlePointerDown","handlePointerMove","handlePointerUp","handleDragStart","CSSVariables","attributes","rootProps","mergeProps","GalleryItemProvider","Component","Component","mergeProps","React","defaultNextProps","GalleryNext","withComponent","defaultNextProps","useGalleryContext","instance","_a","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","React","defaultPrevProps","GalleryPrev","withComponent","defaultPrevProps","useGalleryContext","instance","_a","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","Component","useCarousel","styles","mergeProps","React","createOptionalContext","CarouselProvider","useCarouselContext","HeadlessCarousel","defaultProps","__spreadProps","__spreadValues","Component","mergeProps","React","defaultContentProps","CarouselContent","withComponent","defaultContentProps","useCarouselContext","instance","props","ptmi","carousel","contentProps","mergeProps","viewportProps","__spreadValues","Component","Component","mergeProps","React","defaultIndicatorProps","CarouselIndicator","withComponent","defaultIndicatorProps","useCarouselContext","instance","_a","props","ptmi","carousel","contentProps","mergeProps","Component","Component","mergeProps","React","defaultIndicatorsProps","CarouselIndicators","withComponent","defaultIndicatorsProps","useCarouselContext","instance","_a","_b","props","ptmi","carousel","contentProps","mergeProps","Component","snap","i","CarouselIndicator","Component","mergeProps","React","defaultItemProps","CarouselItem","withComponent","defaultItemProps","useCarouselContext","instance","props","ptmi","carousel","rootProps","mergeProps","Component","Component","mergeProps","React","defaultNextProps","CarouselNext","withComponent","defaultNextProps","useCarouselContext","instance","props","ptmi","carousel","disabled","rootProps","mergeProps","Component","Component","mergeProps","React","defaultPrevProps","CarouselPrev","withComponent","defaultPrevProps","useCarouselContext","instance","props","ptmi","carousel","disabled","rootProps","mergeProps","Component","Carousel","withComponent","defaultProps","styles","instance","useCarousel","id","props","ptmi","cx","rootProps","mergeProps","CarouselProvider","Component","CarouselContent","CarouselItem","CarouselNext","CarouselPrev","CarouselIndicators","CarouselIndicator","React","defaultThumbnailProps","GalleryThumbnail","withComponent","defaultThumbnailProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Carousel","Component","mergeProps","React","defaultThumbnailContentProps","GalleryThumbnailContent","withComponent","defaultThumbnailContentProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Carousel","Component","mergeProps","React","defaultThumbnailItemProps","GalleryThumbnailItem","withComponent","defaultThumbnailItemProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Carousel","Component","mergeProps","React","defaultToolbarProps","GalleryToolbar","withComponent","defaultToolbarProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","React","defaultToolbarItemProps","GalleryToolbarItem","withComponent","defaultToolbarItemProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","_a","Component","Gallery","withComponent","defaultProps","styles","instance","useGallery","id","props","ptmi","cx","rootProps","mergeProps","GalleryProvider","Component","GalleryBackdrop","GalleryContent","GalleryItem","GalleryNext","GalleryPrev","GalleryToolbar","GalleryToolbarItem","GalleryThumbnail","GalleryThumbnailContent","GalleryThumbnailItem","React","defaultItemProps","useGalleryItem","withHeadless","defaultItemProps","props","elementRef","normalScale","zoomedScale","gallery","useGalleryContext","index","setIndex","isActive","setIsActive","position","setPosition","scale","setScale","rotation","setRotation","flip","setFlip","isDragging","setIsDragging","dragStart","setDragStart","hasDragged","setHasDragged","pointerDataRef","lastDistanceRef","calculateItemSize","contentRect","imageElement","naturalWidth","naturalHeight","isRotated","naturalAspectRatio","contentAspectRatio","targetWidth","targetHeight","calculateConstraints","targetScale","scaleToUse","itemElement","originalWidth","originalHeight","scaledWidth","scaledHeight","contentCenterX","contentCenterY","halfScaledWidth","halfScaledHeight","maxX","minX","maxY","minY","zoomIn","hiddenStyles","zoomOut","resetStyles","rotateLeft","prev","rotateRight","flipX","__spreadProps","__spreadValues","flipY","download","link","urlParts","filename","handleClick","e","itemRect","itemCenterX","itemCenterY","clickX","clickY","offsetX","offsetY","zoomOffsetX","zoomOffsetY","constraints","constrainedX","constrainedY","handleDragStart","handlePointerDown","handlePointerMove","pointers","p1","p2","distance","delta","newScale","pointer","newX","newY","computedX","computedY","handlePointerUp","handleResize","handleCustomEvent","_a","_b","_c","_d","_e","_f","_g","attributes","CSSVariables"]}
1
+ {"version":3,"sources":["../../../src/gallery/item/useGalleryItem.tsx","../../../../primereact/src/gallery/Gallery.tsx","../../../../primereact/src/base/index.ts","../../../../primereact/src/gallery/Gallery.context.ts","../../../../primereact/src/gallery/Gallery.props.ts","../../../../primereact/src/gallery/backdrop/GalleryBackdrop.tsx","../../../../primereact/src/gallery/backdrop/GalleryBackdrop.props.ts","../../../../primereact/src/gallery/content/GalleryContent.tsx","../../../../primereact/src/gallery/content/GalleryContent.props.ts","../../../../primereact/src/gallery/item/GalleryItem.tsx","../../../../primereact/src/gallery/item/GalleryItem.context.ts","../../../../primereact/src/gallery/item/GalleryItem.props.ts","../../../../primereact/src/gallery/next/GalleryNext.tsx","../../../../primereact/src/gallery/next/GalleryNext.props.ts","../../../../primereact/src/gallery/prev/GalleryPrev.tsx","../../../../primereact/src/gallery/prev/GalleryPrev.props.ts","../../../../primereact/src/gallery/thumbnail/GalleryThumbnail.tsx","../../../../primereact/src/carousel/Carousel.tsx","../../../../primereact/src/carousel/Carousel.context.ts","../../../../primereact/src/carousel/Carousel.props.ts","../../../../primereact/src/carousel/content/CarouselContent.tsx","../../../../primereact/src/carousel/content/CarouselContent.props.ts","../../../../primereact/src/carousel/indicator/CarouselIndicator.tsx","../../../../primereact/src/carousel/indicator/CarouselIndicator.props.ts","../../../../primereact/src/carousel/indicators/CarouselIndicators.tsx","../../../../primereact/src/carousel/indicators/CarouselIndicators.props.ts","../../../../primereact/src/carousel/item/CarouselItem.tsx","../../../../primereact/src/carousel/item/CarouselItem.props.ts","../../../../primereact/src/carousel/next/CarouselNext.tsx","../../../../primereact/src/carousel/next/CarouselNext.props.ts","../../../../primereact/src/carousel/prev/CarouselPrev.tsx","../../../../primereact/src/carousel/prev/CarouselPrev.props.ts","../../../../primereact/src/gallery/thumbnail/GalleryThumbnail.props.ts","../../../../primereact/src/gallery/thumbnailcontent/GalleryThumbnailContent.tsx","../../../../primereact/src/gallery/thumbnailcontent/GalleryThumbnailContent.props.ts","../../../../primereact/src/gallery/thumbnailitem/GalleryThumbnailItem.tsx","../../../../primereact/src/gallery/thumbnailitem/GalleryThumbnailItem.props.ts","../../../../primereact/src/gallery/toolbar/GalleryToolbar.tsx","../../../../primereact/src/gallery/toolbar/GalleryToolbar.props.ts","../../../../primereact/src/gallery/toolbaritem/GalleryToolbarItem.tsx","../../../../primereact/src/gallery/toolbaritem/GalleryToolbarItem.props.ts","../../../src/gallery/item/useGalleryItem.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport { useGalleryContext } from 'primereact/gallery';\nimport * as React from 'react';\nimport { defaultItemProps } from './useGalleryItem.props';\n\nexport const useGalleryItem = withHeadless({\n name: 'useGalleryItem',\n defaultProps: defaultItemProps,\n setup: ({ props, elementRef }) => {\n const { normalScale = 1, zoomedScale = 3 } = props;\n\n const gallery = useGalleryContext();\n const [index, setIndex] = React.useState(-1);\n const [isActive, setIsActive] = React.useState(false);\n const [position, setPosition] = React.useState({ x: 0, y: 0 });\n const [scale, setScale] = React.useState(1);\n const [rotation, setRotation] = React.useState(0);\n const [flip, setFlip] = React.useState({ x: 1, y: 1 });\n\n const [isDragging, setIsDragging] = React.useState(false);\n const [dragStart, setDragStart] = React.useState({ x: 0, y: 0 });\n const [hasDragged, setHasDragged] = React.useState(false);\n\n const pointerDataRef = React.useRef<Map<number, { x: number; y: number }>>(new Map());\n const lastDistanceRef = React.useRef(0);\n\n const calculateItemSize = React.useCallback(() => {\n if (!gallery?.contentRef.current || !elementRef.current) return;\n\n const contentRect = gallery?.contentRef.current.getBoundingClientRect();\n\n const imageElement = elementRef.current.firstElementChild as HTMLImageElement;\n\n if (!imageElement) return;\n\n let naturalWidth = imageElement.naturalWidth || imageElement.offsetWidth;\n let naturalHeight = imageElement.naturalHeight || imageElement.offsetHeight;\n\n if (naturalWidth === 0 || naturalHeight === 0) return;\n\n const isRotated = Math.abs(rotation) % 180 === 90;\n\n if (isRotated) {\n [naturalWidth, naturalHeight] = [naturalHeight, naturalWidth];\n }\n\n const naturalAspectRatio = naturalWidth / naturalHeight;\n const contentAspectRatio = contentRect.width / contentRect.height;\n\n let targetWidth, targetHeight;\n\n if (naturalAspectRatio > contentAspectRatio) {\n targetWidth = Math.min(contentRect.width * 0.99, naturalWidth);\n targetHeight = targetWidth / naturalAspectRatio;\n } else {\n targetHeight = Math.min(contentRect.height * 0.99, naturalHeight);\n targetWidth = targetHeight * naturalAspectRatio;\n }\n\n if (isRotated) {\n imageElement.style.width = `${targetHeight}px`;\n imageElement.style.height = `${targetWidth}px`;\n elementRef.current.style.width = `${targetHeight > 0 ? targetHeight : 'auto'}px`;\n elementRef.current.style.height = `${targetWidth > 0 ? targetWidth : 'auto'}px`;\n } else {\n imageElement.style.width = `${targetWidth}px`;\n imageElement.style.height = `${targetHeight}px`;\n elementRef.current.style.width = `${targetWidth > 0 ? targetWidth : 'auto'}px`;\n elementRef.current.style.height = `${targetHeight > 0 ? targetHeight : 'auto'}px`;\n }\n\n elementRef.current.style.aspectRatio = `${naturalWidth / naturalHeight}`;\n }, [gallery?.contentRef, rotation]);\n\n const calculateConstraints = React.useCallback(\n (targetScale?: number) => {\n if (!gallery?.contentRef.current || !elementRef.current) return { minX: 0, maxX: 0, minY: 0, maxY: 0 };\n\n const contentRect = gallery?.contentRef.current.getBoundingClientRect();\n const scaleToUse = targetScale !== undefined ? targetScale : scale;\n\n const itemElement = elementRef.current.firstElementChild as HTMLElement;\n\n if (!itemElement) return { minX: 0, maxX: 0, minY: 0, maxY: 0 };\n\n let originalWidth = itemElement.offsetWidth;\n let originalHeight = itemElement.offsetHeight;\n\n const isRotated = Math.abs(rotation) % 180 === 90;\n\n if (isRotated) {\n [originalWidth, originalHeight] = [originalHeight, originalWidth];\n }\n\n const scaledWidth = originalWidth * scaleToUse;\n const scaledHeight = originalHeight * scaleToUse;\n\n const contentCenterX = contentRect.width / 2;\n const contentCenterY = contentRect.height / 2;\n\n const halfScaledWidth = scaledWidth / 2;\n const halfScaledHeight = scaledHeight / 2;\n\n const maxX = halfScaledWidth > contentCenterX ? halfScaledWidth - contentCenterX : 0;\n const minX = halfScaledWidth > contentCenterX ? -(halfScaledWidth - contentCenterX) : 0;\n\n const maxY = halfScaledHeight > contentCenterY ? halfScaledHeight - contentCenterY : 0;\n const minY = halfScaledHeight > contentCenterY ? -(halfScaledHeight - contentCenterY) : 0;\n\n return { minX, maxX, minY, maxY };\n },\n [gallery?.contentRef, scale, rotation]\n );\n\n const zoomIn = React.useCallback(() => {\n setScale(zoomedScale);\n\n const hiddenStyles = {\n visibility: 'hidden',\n opacity: 0,\n pointerEvents: 'none',\n userSelect: 'none',\n touchAction: 'none'\n };\n\n if (gallery?.toolbarRef.current) {\n Object.assign(gallery?.toolbarRef.current.style, hiddenStyles);\n }\n\n if (gallery?.thumbnailRef.current) {\n // @ts-expect-error - thumbnailRef may not have elementRef property\n Object.assign(gallery?.thumbnailRef.current.elementRef.current.style, hiddenStyles);\n }\n\n if (gallery?.prevRef.current) {\n Object.assign(gallery.prevRef.current.style, hiddenStyles);\n }\n\n if (gallery?.nextRef.current) {\n Object.assign(gallery.nextRef.current.style, hiddenStyles);\n }\n\n if (elementRef.current) {\n elementRef.current.style.cursor = 'zoom-out';\n elementRef.current.style.pointerEvents = 'auto';\n }\n }, [zoomedScale, gallery?.toolbarRef, gallery?.thumbnailRef, gallery?.prevRef, gallery?.nextRef]);\n\n const zoomOut = React.useCallback(() => {\n setScale(normalScale);\n setPosition({ x: 0, y: 0 });\n\n const resetStyles = {\n visibility: '',\n opacity: '',\n pointerEvents: '',\n userSelect: '',\n touchAction: ''\n };\n\n if (gallery?.toolbarRef.current) {\n Object.assign(gallery.toolbarRef.current.style, resetStyles);\n }\n\n if (gallery?.thumbnailRef.current) {\n // @ts-expect-error - thumbnailRef may not have elementRef property\n Object.assign(gallery.thumbnailRef.current.elementRef.current.style, resetStyles);\n }\n\n if (gallery?.prevRef.current) {\n Object.assign(gallery.prevRef.current.style, resetStyles);\n }\n\n if (gallery?.nextRef.current) {\n Object.assign(gallery.nextRef.current.style, resetStyles);\n }\n\n if (elementRef.current) {\n elementRef.current.style.cursor = 'zoom-in';\n elementRef.current.style.pointerEvents = 'auto';\n }\n }, [normalScale, gallery?.toolbarRef, gallery?.thumbnailRef, gallery?.prevRef, gallery?.nextRef]);\n\n const rotateLeft = () => {\n if (!elementRef.current) return;\n\n elementRef.current.style.transition = 'none';\n setRotation((prev) => prev - 90);\n setTimeout(() => {\n if (elementRef.current) {\n elementRef.current.style.transition = '';\n }\n }, 0);\n };\n\n const rotateRight = () => {\n if (!elementRef.current) return;\n\n elementRef.current.style.transition = 'none';\n setRotation((prev) => prev + 90);\n setTimeout(() => {\n if (elementRef.current) {\n elementRef.current.style.transition = '';\n }\n }, 0);\n };\n\n const flipX = () => {\n setFlip((prev) => ({ ...prev, x: Math.sign(prev.x) * -1 }));\n };\n\n const flipY = () => {\n setFlip((prev) => ({ ...prev, y: Math.sign(prev.y) * -1 }));\n };\n\n const download = () => {\n if (!elementRef.current) return;\n\n const imageElement = elementRef.current.querySelector('img') as HTMLImageElement;\n\n if (!imageElement || !imageElement.src) return;\n\n const link = document.createElement('a');\n\n link.href = imageElement.src;\n\n const urlParts = imageElement.src.split('/');\n const filename = urlParts[urlParts.length - 1] || 'image.jpg';\n\n link.download = filename;\n link.target = '_blank';\n\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n\n const handleClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (hasDragged) {\n setHasDragged(false);\n\n return;\n }\n\n if (scale === normalScale) {\n if (elementRef.current) {\n const itemRect = elementRef.current.getBoundingClientRect();\n\n const itemCenterX = itemRect.width / 2;\n const itemCenterY = itemRect.height / 2;\n\n const clickX = e.clientX - itemRect.left;\n const clickY = e.clientY - itemRect.top;\n\n const offsetX = itemCenterX - clickX;\n const offsetY = itemCenterY - clickY;\n\n const zoomOffsetX = offsetX * (zoomedScale - 1);\n const zoomOffsetY = offsetY * (zoomedScale - 1);\n\n const constraints = calculateConstraints(zoomedScale);\n const constrainedX = Math.max(constraints.minX, Math.min(constraints.maxX, zoomOffsetX));\n const constrainedY = Math.max(constraints.minY, Math.min(constraints.maxY, zoomOffsetY));\n\n setPosition({ x: constrainedX, y: constrainedY });\n }\n\n zoomIn();\n } else {\n zoomOut();\n }\n },\n [hasDragged, normalScale, zoomedScale, calculateConstraints, scale, zoomIn, zoomOut]\n );\n const handleDragStart = React.useCallback((e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n }, []);\n\n const handlePointerDown = React.useCallback(\n (e: React.PointerEvent) => {\n e.currentTarget.setPointerCapture(e.pointerId);\n pointerDataRef.current.set(e.pointerId, { x: e.clientX, y: e.clientY });\n\n if (scale > 1) {\n if (e.pointerType === 'mouse') {\n setIsDragging(true);\n setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });\n setHasDragged(false);\n } else if (e.pointerType === 'touch' && pointerDataRef.current.size === 1) {\n setIsDragging(true);\n setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });\n setHasDragged(false);\n lastDistanceRef.current = 0;\n }\n }\n\n if (e.pointerType === 'touch' && pointerDataRef.current.size === 1) {\n lastDistanceRef.current = 0;\n }\n },\n [scale, position]\n );\n\n const handlePointerMove = React.useCallback(\n (e: React.PointerEvent) => {\n if (!pointerDataRef.current.has(e.pointerId) || !elementRef.current) return;\n\n elementRef.current.style.transition = 'none';\n\n // Preserve cursor during move\n const currentCursor = elementRef.current.style.cursor;\n\n if (!currentCursor) {\n elementRef.current.style.cursor = scale > normalScale ? 'zoom-out' : 'zoom-in';\n }\n\n pointerDataRef.current.set(e.pointerId, { x: e.clientX, y: e.clientY });\n\n const pointers = Array.from(pointerDataRef.current.values());\n\n if (pointers.length === 2) {\n const [p1, p2] = pointers;\n const distance = Math.hypot(p2.x - p1.x, p2.y - p1.y);\n\n if (lastDistanceRef.current > 0) {\n const delta = (distance - lastDistanceRef.current) * 0.01;\n\n if (Math.abs(delta) > 0.01) {\n const newScale = scale === normalScale ? zoomedScale : normalScale;\n\n const constraints = calculateConstraints(newScale);\n const constrainedX = Math.max(constraints.minX, Math.min(constraints.maxX, position.x));\n const constrainedY = Math.max(constraints.minY, Math.min(constraints.maxY, position.y));\n\n setPosition({ x: constrainedX, y: constrainedY });\n\n setScale(newScale);\n }\n }\n\n lastDistanceRef.current = distance;\n } else if (pointers.length === 1 && isDragging) {\n const pointer = pointers[0];\n const newX = pointer.x - dragStart.x;\n const newY = pointer.y - dragStart.y;\n const constraints = calculateConstraints();\n\n const computedX = Math.max(constraints.minX, Math.min(constraints.maxX, newX));\n const computedY = Math.max(constraints.minY, Math.min(constraints.maxY, newY));\n\n setPosition({\n x: computedX,\n y: computedY\n });\n setHasDragged(true);\n }\n },\n [isDragging, dragStart, scale, normalScale, zoomedScale, position, calculateConstraints]\n );\n\n const handlePointerUp = React.useCallback((e: React.PointerEvent) => {\n if (!elementRef.current) return;\n\n elementRef.current.style.transition = '';\n // Restore proper cursor after interaction\n elementRef.current.style.cursor = scale > normalScale ? 'zoom-out' : 'zoom-in';\n e.currentTarget.releasePointerCapture(e.pointerId);\n pointerDataRef.current.delete(e.pointerId);\n\n if (pointerDataRef.current.size < 2) lastDistanceRef.current = 0;\n\n if (pointerDataRef.current.size === 0) {\n setIsDragging(false);\n }\n }, []);\n\n React.useEffect(() => {\n if (scale <= 1) {\n setPosition({ x: 0, y: 0 });\n }\n }, [scale]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index && document.readyState === 'complete') {\n calculateItemSize();\n }\n }, [gallery?.state.activeIndex, index, calculateItemSize]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index) {\n calculateItemSize();\n }\n }, [rotation, calculateItemSize, gallery?.state.activeIndex, index]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index && gallery?.state.isFullscreen !== undefined) {\n calculateItemSize();\n }\n }, [gallery?.state.isFullscreen, calculateItemSize, gallery?.state.activeIndex, index]);\n\n React.useEffect(() => {\n const handleResize = () => {\n if (gallery?.state.activeIndex === index) {\n calculateItemSize();\n }\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, [gallery?.state.activeIndex, index, calculateItemSize]);\n\n React.useEffect(() => {\n if (gallery && elementRef.current) {\n const index = gallery.registerItem(elementRef.current as HTMLDivElement);\n\n setIndex(index);\n }\n }, [gallery]);\n\n React.useEffect(() => {\n const handleCustomEvent = (e: CustomEvent) => {\n if (e.detail?.action === 'zoom-in') {\n zoomIn();\n } else if (e.detail?.action === 'zoom-out') {\n zoomOut();\n } else if (e.detail?.action === 'rotate-left') {\n rotateLeft();\n } else if (e.detail?.action === 'rotate-right') {\n rotateRight();\n } else if (e.detail?.action === 'flip-x') {\n flipX();\n } else if (e.detail?.action === 'flip-y') {\n flipY();\n } else if (e.detail?.action === 'download') {\n download();\n }\n };\n\n const itemElement = elementRef.current;\n\n if (itemElement) {\n itemElement.addEventListener('gallery-zoom-in', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-zoom-out', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-rotate-left', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-rotate-right', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-flip-x', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-flip-y', handleCustomEvent as EventListener);\n itemElement.addEventListener('gallery-download', handleCustomEvent as EventListener);\n }\n\n return () => {\n if (itemElement) {\n itemElement.removeEventListener('gallery-zoom-in', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-zoom-out', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-rotate-left', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-rotate-right', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-flip-x', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-flip-y', handleCustomEvent as EventListener);\n itemElement.removeEventListener('gallery-download', handleCustomEvent as EventListener);\n }\n };\n }, [normalScale, zoomedScale]);\n\n React.useEffect(() => {\n if (gallery?.state.activeIndex === index) {\n setIsActive(true);\n } else {\n setIsActive(false);\n }\n }, [gallery?.state.activeIndex, index]);\n\n const attributes = React.useMemo(() => {\n return {\n 'data-active': isActive\n };\n }, [isActive]);\n\n const CSSVariables = React.useMemo(() => {\n return {\n '--position-x': `${position.x}px`,\n '--position-y': `${position.y}px`,\n '--scale': `${scale}`,\n '--rotation': `${rotation}deg`,\n '--flip-x': flip.x,\n '--flip-y': flip.y\n } as React.CSSProperties;\n }, [position, scale, rotation, flip]);\n\n const state = {\n index,\n position,\n scale,\n rotation,\n flip,\n isActive,\n dragStart,\n hasDragged\n };\n\n return {\n state,\n attributes,\n CSSVariables,\n handlePointerUp,\n handlePointerMove,\n handlePointerDown,\n handleClick,\n handleDragStart,\n zoomIn,\n zoomOut,\n rotateLeft,\n rotateRight,\n flipX,\n flipY,\n download,\n calculateConstraints,\n calculateItemSize\n };\n }\n});\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useGallery } from '@primereact/headless/gallery';\nimport { styles } from '@primereact/styles/gallery';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { GalleryProvider } from './Gallery.context';\nimport { defaultProps } from './Gallery.props';\nimport { GalleryBackdrop } from './backdrop/GalleryBackdrop';\nimport { GalleryContent } from './content/GalleryContent';\nimport { GalleryItem } from './item/GalleryItem';\nimport { GalleryNext } from './next/GalleryNext';\nimport { GalleryPrev } from './prev/GalleryPrev';\nimport { GalleryThumbnail } from './thumbnail/GalleryThumbnail';\nimport { GalleryThumbnailContent } from './thumbnailcontent/GalleryThumbnailContent';\nimport { GalleryThumbnailItem } from './thumbnailitem/GalleryThumbnailItem';\nimport { GalleryToolbar } from './toolbar/GalleryToolbar';\nimport { GalleryToolbarItem } from './toolbaritem/GalleryToolbarItem';\n\nexport const Gallery = withComponent({\n name: 'Gallery',\n defaultProps,\n styles,\n setup(instance) {\n const gallery = useGallery(instance.inProps);\n\n return gallery;\n },\n render(instance) {\n const { id, props, ptmi, cx } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n className: cx('root')\n },\n ptmi('root')\n );\n\n return (\n <GalleryProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </GalleryProvider>\n );\n },\n components: {\n Backdrop: GalleryBackdrop,\n Content: GalleryContent,\n Item: GalleryItem,\n Next: GalleryNext,\n Prev: GalleryPrev,\n Toolbar: GalleryToolbar,\n ToolbarItem: GalleryToolbarItem,\n Thumbnail: GalleryThumbnail,\n ThumbnailContent: GalleryThumbnailContent,\n ThumbnailItem: GalleryThumbnailItem\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { GalleryInstance } from '@primereact/types/shared/gallery';\n\nexport const [GalleryProvider, useGalleryContext] = createOptionalContext<GalleryInstance>();\n","import * as HeadlessGallery from '@primereact/headless/gallery';\nimport type { GalleryProps } from '@primereact/types/shared/gallery';\n\nexport const defaultProps: GalleryProps = {\n ...HeadlessGallery.defaultProps,\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultCloseProps } from './GalleryBackdrop.props';\n\nexport const GalleryBackdrop = withComponent({\n name: 'GalleryBackdrop',\n defaultProps: defaultCloseProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('backdrop')\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryBackdropProps } from '@primereact/types/shared/gallery';\n\nexport const defaultCloseProps: GalleryBackdropProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultContentProps } from './GalleryContent.props';\n\nexport const GalleryContent = withComponent({\n name: 'GalleryContent',\n defaultProps: defaultContentProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('content')\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.contentRef} />;\n }\n});\n","import { GalleryContentProps } from '@primereact/types/shared/gallery';\n\nexport const defaultContentProps: GalleryContentProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useGalleryItem } from '@primereact/headless/gallery/item';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { GalleryItemProvider } from './GalleryItem.context';\nimport { defaultProps } from './GalleryItem.props';\n\nexport const GalleryItem = withComponent({\n name: 'GalleryItem',\n defaultProps,\n setup(instance) {\n const gallery = useGalleryContext();\n const galleryItem = useGalleryItem(instance.inProps);\n\n return { ...galleryItem, gallery };\n },\n render(instance) {\n const { id, props, ptmi, gallery, handleClick, handlePointerDown, handlePointerMove, handlePointerUp, handleDragStart, CSSVariables, attributes } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n className: gallery?.cx('item'),\n onClick: handleClick,\n onPointerDown: handlePointerDown,\n onPointerMove: handlePointerMove,\n onPointerUp: handlePointerUp,\n onDragStart: handleDragStart,\n style: CSSVariables,\n ...attributes\n },\n ptmi('root'),\n gallery?.ptm('item')\n );\n\n return (\n <GalleryItemProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </GalleryItemProvider>\n );\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { GalleryItemInstance } from '@primereact/types/shared/gallery';\n\nexport const [GalleryItemProvider, useGalleryItemContext] = createOptionalContext<GalleryItemInstance>();\n","import * as HeadlessGallery from '@primereact/headless/gallery';\nimport type { GalleryItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultProps: GalleryItemProps = {\n ...HeadlessGallery.defaultProps,\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultNextProps } from './GalleryNext.props';\n\nexport const GalleryNext = withComponent({\n name: 'GalleryNext',\n defaultProps: defaultNextProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('next'),\n onClick: gallery?.actions?.next\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.nextRef} />;\n }\n});\n","import { GalleryNextProps } from '@primereact/types/shared/gallery';\n\nexport const defaultNextProps: GalleryNextProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultPrevProps } from './GalleryPrev.props';\n\nexport const GalleryPrev = withComponent({\n name: 'GalleryPrev',\n defaultProps: defaultPrevProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('prev'),\n onClick: gallery?.actions?.prev\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.prevRef} />;\n }\n});\n","import { GalleryPrevProps } from '@primereact/types/shared/gallery';\n\nexport const defaultPrevProps: GalleryPrevProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Carousel } from 'primereact/carousel';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultThumbnailProps } from './GalleryThumbnail.props';\n\nexport const GalleryThumbnail = withComponent({\n name: 'GalleryThumbnail',\n defaultProps: defaultThumbnailProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('thumbnail')\n },\n ptmi('root')\n );\n\n return <Component as={Carousel} instance={instance} attrs={rootProps} children={props.children} ref={gallery?.thumbnailRef} />;\n }\n});\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useCarousel } from '@primereact/headless/carousel';\nimport { styles } from '@primereact/styles/carousel';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { CarouselProvider } from './Carousel.context';\nimport { defaultProps } from './Carousel.props';\nimport { CarouselContent } from './content';\nimport { CarouselIndicator } from './indicator';\nimport { CarouselIndicators } from './indicators';\nimport { CarouselItem } from './item';\nimport { CarouselNext } from './next';\nimport { CarouselPrev } from './prev';\n\nexport const Carousel = withComponent({\n name: 'Carousel',\n defaultProps,\n styles,\n setup(instance) {\n const carousel = useCarousel(instance.inProps);\n\n return carousel;\n },\n render(instance) {\n const { id, props, state, ptmi, cx } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n className: cx('root'),\n 'data-swiping': state.swiping\n },\n ptmi('root')\n );\n\n return (\n <CarouselProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </CarouselProvider>\n );\n },\n components: {\n Content: CarouselContent,\n Item: CarouselItem,\n Next: CarouselNext,\n Prev: CarouselPrev,\n Indicators: CarouselIndicators,\n Indicator: CarouselIndicator\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { CarouselInstance } from '@primereact/types/shared/carousel';\n\nexport const [CarouselProvider, useCarouselContext] = createOptionalContext<CarouselInstance>();\n","import * as HeadlessCarousel from '@primereact/headless/carousel';\nimport type { CarouselProps } from '@primereact/types/shared/carousel';\n\nexport const defaultProps: CarouselProps = {\n ...HeadlessCarousel.defaultProps,\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultContentProps } from './CarouselContent.props';\n\nexport const CarouselContent = withComponent({\n name: 'CarouselContent',\n defaultProps: defaultContentProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const contentProps = mergeProps(\n {\n className: carousel?.cx('content'),\n style: { ...carousel?.contentStyles, ...carousel?.sx('content') },\n onPointerDown: carousel?.onContentPointerDown,\n onPointerMove: carousel?.onContentPointerMove,\n onPointerUp: carousel?.onContentPointerUp,\n onWheel: carousel?.onContentWheel\n },\n carousel?.ptm('content'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={contentProps} children={props.children} ref={carousel?.contentRef} />;\n }\n});\n","import type { CarouselContentProps } from '@primereact/types/shared/carousel';\n\nexport const defaultContentProps: CarouselContentProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultIndicatorProps } from './CarouselIndicator.props';\n\nexport const CarouselIndicator = withComponent({\n name: 'CarouselIndicator',\n defaultProps: defaultIndicatorProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const isActive = carousel?.state.page === props.page;\n\n const contentProps = mergeProps(\n {\n className: carousel?.cx('indicator', { active: isActive }),\n onClick: () => carousel?.scrollToPage(props.page),\n 'data-active': isActive\n },\n carousel?.ptm('indicator'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={contentProps} children={props.children} />;\n }\n});\n","import type { CarouselIndicatorProps } from '@primereact/types/shared/carousel';\n\nexport const defaultIndicatorProps: CarouselIndicatorProps = {\n as: 'button',\n page: undefined\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { CarouselIndicator } from '../indicator/CarouselIndicator';\nimport { defaultIndicatorsProps } from './CarouselIndicators.props';\n\nexport const CarouselIndicators = withComponent({\n name: 'CarouselIndicators',\n defaultProps: defaultIndicatorsProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const contentProps = mergeProps(\n {\n className: carousel?.cx('indicators')\n },\n carousel?.ptm('indicators'),\n ptmi('root')\n );\n\n return (\n <Component\n instance={instance}\n attrs={contentProps}\n children={\n props.children ?? (\n <>\n {Array.from(carousel?.state.snapPoints ?? []).map((_, i) => (\n <CarouselIndicator key={i} page={i} />\n ))}\n </>\n )\n }\n />\n );\n }\n});\n","import type { CarouselIndicatorsProps } from '@primereact/types/shared/carousel';\n\nexport const defaultIndicatorsProps: CarouselIndicatorsProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultItemProps } from './CarouselItem.props';\n\nexport const CarouselItem = withComponent({\n name: 'CarouselItem',\n defaultProps: defaultItemProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { id, props, ptmi, carousel } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n className: carousel?.cx('item'),\n style: {\n ...(carousel?.itemStyles || {}),\n ...(carousel?.sx('item') || {})\n },\n 'data-value': props.value,\n 'data-item': '',\n 'data-inview': 'false'\n },\n carousel?.ptm('item'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { CarouselItemProps } from '@primereact/types/shared/carousel';\n\nexport const defaultItemProps: CarouselItemProps = {\n as: 'div',\n value: undefined\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultNextProps } from './CarouselNext.props';\n\nexport const CarouselNext = withComponent({\n name: 'CarouselNext',\n defaultProps: defaultNextProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const disabled = carousel?.state.isNextDisabled || props.disabled;\n const rootProps = mergeProps(\n {\n className: carousel?.cx('next', { disabled }),\n onClick: carousel?.next,\n disabled\n },\n carousel?.ptm('prev'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { CarouselNextProps } from '@primereact/types/shared/carousel';\n\nexport const defaultNextProps: CarouselNextProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useCarouselContext } from '../Carousel.context';\nimport { defaultPrevProps } from './CarouselPrev.props';\n\nexport const CarouselPrev = withComponent({\n name: 'CarouselPrev',\n defaultProps: defaultPrevProps,\n setup() {\n const carousel = useCarouselContext();\n\n return { carousel };\n },\n render(instance) {\n const { props, ptmi, carousel } = instance;\n\n const disabled = carousel?.state.isPrevDisabled || props.disabled;\n const rootProps = mergeProps(\n {\n className: carousel?.cx('prev', { disabled }),\n onClick: carousel?.prev,\n disabled\n },\n carousel?.ptm('prev'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { CarouselPrevProps } from '@primereact/types/shared/carousel';\n\nexport const defaultPrevProps: CarouselPrevProps = {\n as: 'button'\n};\n","import { GalleryThumbnailProps } from '@primereact/types/shared/gallery';\n\nexport const defaultThumbnailProps: GalleryThumbnailProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Carousel } from 'primereact/carousel';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultThumbnailContentProps } from './GalleryThumbnailContent.props';\n\nexport const GalleryThumbnailContent = withComponent({\n name: 'GalleryThumbnailContent',\n defaultProps: defaultThumbnailContentProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('thumbnailContent')\n },\n ptmi('root')\n );\n\n return <Component as={Carousel.Content} instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryThumbnailContentProps } from '@primereact/types/shared/gallery';\n\nexport const defaultThumbnailContentProps: GalleryThumbnailContentProps = {};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Carousel } from 'primereact/carousel';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultThumbnailItemProps } from './GalleryThumbnailItem.props';\n\nexport const GalleryThumbnailItem = withComponent({\n name: 'GalleryThumbnailItem',\n defaultProps: defaultThumbnailItemProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('thumbnailItem')\n },\n ptmi('root')\n );\n\n return <Component as={Carousel.Item} instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryThumbnailItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultThumbnailItemProps: GalleryThumbnailItemProps = {};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultToolbarProps } from './GalleryToolbar.props';\n\nexport const GalleryToolbar = withComponent({\n name: 'GalleryToolbar',\n defaultProps: defaultToolbarProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('toolbar')\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} ref={gallery?.toolbarRef} />;\n }\n});\n","import { GalleryToolbarProps } from '@primereact/types/shared/gallery';\n\nexport const defaultToolbarProps: GalleryToolbarProps = {\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useGalleryContext } from '../Gallery.context';\nimport { defaultToolbarItemProps } from './GalleryToolbarItem.props';\n\nexport const GalleryToolbarItem = withComponent({\n name: 'GalleryToolbarItem',\n defaultProps: defaultToolbarItemProps,\n setup() {\n const gallery = useGalleryContext();\n\n return { gallery };\n },\n render(instance) {\n const { props, ptmi, gallery } = instance;\n\n const rootProps = mergeProps(\n {\n className: gallery?.cx('toolbarItem'),\n onClick: () => {\n gallery?.handleClickAction(props?.action);\n props?.onClick?.();\n }\n },\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { GalleryToolbarItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultToolbarItemProps: GalleryToolbarItemProps = {\n as: 'div',\n action: undefined,\n onClick: undefined\n};\n","import type { useGalleryItemProps } from '@primereact/types/shared/gallery';\n\nexport const defaultItemProps: useGalleryItemProps = {\n normalScale: 1,\n zoomedScale: 3\n};\n"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AoB,mBAAoB0D,CAAkC,EACtF1D,EAAY,oBAAoB,sBAAuB0D,CAAkC,EACzF1D,EAAY,oBAAoB,uBAAwB0D,CAAkC,EAC1F1D,EAAY,oBAAoB,iBAAkB0D,CAAkC,EACpF1D,EAAY,oBAAoB,iBAAkB0D,CAAkC,EACpF1D,EAAY,oBAAoB,mBAAoB0D,CAAkC,EAE9F,CACJ,EAAG,CAAC/F,EAAaC,CAAW,CAAC,EAEvB,YAAU,IAAM,EACdC,GAAA,YAAAA,EAAS,MAAM,eAAgBE,EAC/BG,EAAY,EAAI,EAEhBA,EAAY,EAAK,CAEzB,EAAG,CAACL,GAAA,YAAAA,EAAS,MAAM,YAAaE,CAAK,CAAC,EAEtC,IAAMmG,GAAmB,UAAQ,KACtB,CACH,cAAejG,CACnB,GACD,CAACA,CAAQ,CAAC,EAEPkG,GAAqB,UAAQ,KACxB,CACH,eAAgB,GAAGhG,EAAS,CAAC,KAC7B,eAAgB,GAAGA,EAAS,CAAC,KAC7B,UAAW,GAAGE,CAAK,GACnB,aAAc,GAAGE,CAAQ,MACzB,WAAYE,EAAK,EACjB,WAAYA,EAAK,CACrB,GACD,CAACN,EAAUE,EAAOE,EAAUE,CAAI,CAAC,EAapC,MAAO,CACH,MAZU,CACV,MAAAV,EACA,SAAAI,EACA,MAAAE,EACA,SAAAE,EACA,KAAAE,EACA,SAAAR,EACA,UAAAY,EACA,WAAAE,CACJ,EAII,WAAAmF,GACA,aAAAC,GACA,gBAAAX,GACA,kBAAAZ,GACA,kBAAAD,GACA,YAAAf,GACA,gBAAAc,GACA,OAAA7B,EACA,QAAAE,EACA,WAAAE,GACA,YAAAE,GACA,MAAAC,GACA,MAAAG,GACA,SAAAC,GACA,qBAAA3B,EACA,kBAAAV,CACJ,CACJ,CACJ,CAAC","names":["withHeadless","Component","useGallery","styles","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","createOptionalContext","GalleryProvider","useGalleryContext","HeadlessGallery","defaultProps","__spreadProps","__spreadValues","Component","mergeProps","React","defaultCloseProps","GalleryBackdrop","withComponent","defaultCloseProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","React","defaultContentProps","GalleryContent","withComponent","defaultContentProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Component","useGalleryItem","mergeProps","React","createOptionalContext","GalleryItemProvider","useGalleryItemContext","HeadlessGallery","defaultProps","__spreadProps","__spreadValues","GalleryItem","withComponent","defaultProps","instance","gallery","useGalleryContext","galleryItem","useGalleryItem","__spreadProps","__spreadValues","id","props","ptmi","handleClick","handlePointerDown","handlePointerMove","handlePointerUp","handleDragStart","CSSVariables","attributes","rootProps","mergeProps","GalleryItemProvider","Component","Component","mergeProps","React","defaultNextProps","GalleryNext","withComponent","defaultNextProps","useGalleryContext","instance","_a","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","React","defaultPrevProps","GalleryPrev","withComponent","defaultPrevProps","useGalleryContext","instance","_a","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","Component","useCarousel","styles","mergeProps","React","createOptionalContext","CarouselProvider","useCarouselContext","HeadlessCarousel","defaultProps","__spreadProps","__spreadValues","Component","mergeProps","React","defaultContentProps","CarouselContent","withComponent","defaultContentProps","useCarouselContext","instance","props","ptmi","carousel","contentProps","mergeProps","__spreadValues","Component","Component","mergeProps","React","defaultIndicatorProps","CarouselIndicator","withComponent","defaultIndicatorProps","useCarouselContext","instance","props","ptmi","carousel","isActive","contentProps","mergeProps","Component","Component","mergeProps","React","defaultIndicatorsProps","CarouselIndicators","withComponent","defaultIndicatorsProps","useCarouselContext","instance","_a","_b","props","ptmi","carousel","contentProps","mergeProps","Component","_","i","CarouselIndicator","Component","mergeProps","React","defaultItemProps","CarouselItem","withComponent","defaultItemProps","useCarouselContext","instance","id","props","ptmi","carousel","rootProps","mergeProps","__spreadValues","Component","Component","mergeProps","React","defaultNextProps","CarouselNext","withComponent","defaultNextProps","useCarouselContext","instance","props","ptmi","carousel","disabled","rootProps","mergeProps","Component","Component","mergeProps","React","defaultPrevProps","CarouselPrev","withComponent","defaultPrevProps","useCarouselContext","instance","props","ptmi","carousel","disabled","rootProps","mergeProps","Component","Carousel","withComponent","defaultProps","styles","instance","useCarousel","id","props","state","ptmi","cx","rootProps","mergeProps","CarouselProvider","Component","CarouselContent","CarouselItem","CarouselNext","CarouselPrev","CarouselIndicators","CarouselIndicator","React","defaultThumbnailProps","GalleryThumbnail","withComponent","defaultThumbnailProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Carousel","Component","mergeProps","React","defaultThumbnailContentProps","GalleryThumbnailContent","withComponent","defaultThumbnailContentProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Carousel","Component","mergeProps","React","defaultThumbnailItemProps","GalleryThumbnailItem","withComponent","defaultThumbnailItemProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Carousel","Component","mergeProps","React","defaultToolbarProps","GalleryToolbar","withComponent","defaultToolbarProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","Component","Component","mergeProps","React","defaultToolbarItemProps","GalleryToolbarItem","withComponent","defaultToolbarItemProps","useGalleryContext","instance","props","ptmi","gallery","rootProps","mergeProps","_a","Component","Gallery","withComponent","defaultProps","styles","instance","useGallery","id","props","ptmi","cx","rootProps","mergeProps","GalleryProvider","Component","GalleryBackdrop","GalleryContent","GalleryItem","GalleryNext","GalleryPrev","GalleryToolbar","GalleryToolbarItem","GalleryThumbnail","GalleryThumbnailContent","GalleryThumbnailItem","React","defaultItemProps","useGalleryItem","withHeadless","defaultItemProps","props","elementRef","normalScale","zoomedScale","gallery","useGalleryContext","index","setIndex","isActive","setIsActive","position","setPosition","scale","setScale","rotation","setRotation","flip","setFlip","isDragging","setIsDragging","dragStart","setDragStart","hasDragged","setHasDragged","pointerDataRef","lastDistanceRef","calculateItemSize","contentRect","imageElement","naturalWidth","naturalHeight","isRotated","naturalAspectRatio","contentAspectRatio","targetWidth","targetHeight","calculateConstraints","targetScale","scaleToUse","itemElement","originalWidth","originalHeight","scaledWidth","scaledHeight","contentCenterX","contentCenterY","halfScaledWidth","halfScaledHeight","maxX","minX","maxY","minY","zoomIn","hiddenStyles","zoomOut","resetStyles","rotateLeft","prev","rotateRight","flipX","__spreadProps","__spreadValues","flipY","download","link","urlParts","filename","handleClick","e","itemRect","itemCenterX","itemCenterY","clickX","clickY","offsetX","offsetY","zoomOffsetX","zoomOffsetY","constraints","constrainedX","constrainedY","handleDragStart","handlePointerDown","handlePointerMove","pointers","p1","p2","distance","delta","newScale","pointer","newX","newY","computedX","computedY","handlePointerUp","handleResize","handleCustomEvent","_a","_b","_c","_d","_e","_f","_g","attributes","CSSVariables"]}
@@ -1,3 +1,4 @@
1
+ import type { CarouselInstance } from '@primereact/types/shared/carousel';
1
2
  import * as React from 'react';
2
3
  export declare const useGallery: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/shared/gallery").useGalleryProps, unknown, {
3
4
  state: {
@@ -24,14 +25,7 @@ export declare const useGallery: (inProps?: unknown) => import("@primereact/type
24
25
  };
25
26
  contentRef: React.RefObject<HTMLDivElement | null>;
26
27
  toolbarRef: React.RefObject<HTMLDivElement | null>;
27
- thumbnailRef: React.RefObject<React.RefObject<(<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/carousel").CarouselProps) | undefined) => React.JSX.Element | null) & {
28
- Content: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/carousel").CarouselContentProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
29
- Item: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/carousel").CarouselItemProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
30
- Next: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/carousel").CarouselNextProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
31
- Prev: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/carousel").CarouselPrevProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
32
- Indicators: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/carousel").CarouselIndicatorsProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
33
- Indicator: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/carousel").CarouselIndicatorProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
34
- } & React.FC<{}>> | null>;
28
+ thumbnailRef: React.RefObject<CarouselInstance | null>;
35
29
  prevRef: React.RefObject<HTMLButtonElement | null>;
36
30
  nextRef: React.RefObject<HTMLButtonElement | null>;
37
31
  }>;
@@ -0,0 +1,2 @@
1
+ export * from './useInputTags';
2
+ export * from './useInputTags.props';
@@ -0,0 +1,2 @@
1
+ import{withHeadless as C}from"@primereact/core/headless";import{useControlledState as y}from"@primereact/hooks/use-controlled-state";import{focus as R}from"@primeuix/utils";import*as r from"react";var I={defaultValue:void 0,value:void 0,max:void 0,delimiter:void 0,allowDuplicate:void 0,addOnBlur:void 0,addOnPaste:void 0,addOnTab:void 0,onValueChange:void 0,onAdd:void 0,onRemove:void 0};var j=C({name:"useInputTags",defaultProps:I,setup({props:t}){var h;let[l,m]=r.useState(""),[o,f]=r.useState(-1),v=r.useRef((h=t.defaultValue)!=null?h:[]),[n,s]=y({value:t.value,defaultValue:v.current,onChange:t.onValueChange}),w=r.useRef(null),d=r.useRef(null),x=r.useRef(new Map),k={value:n!=null?n:[],inputValue:l,focusedItemIndex:o},c=e=>{let a=e.trim();if(!a||t.disabled||t.max&&n&&n.length>=t.max||!t.allowDuplicate&&n&&n.includes(a))return;let u=[...n||[],a];s([u,{value:u}]),t.onAdd&&t.onAdd({value:a}),m("")},b=e=>{if(t.disabled||!n)return;let a=n.filter((u,g)=>g!==e);s([a,{value:a}]),t.onRemove&&t.onRemove({value:n[e],index:e}),f(-1)},T=()=>{let e=o;l.length===0&&n&&n.length>0&&(e=e===-1?n.length-1:e-1,e<0&&(e=0)),f(e)},E=()=>{var a;let e=o;l.length===0&&n&&n.length>0&&(e===n.length-1?(e=-1,d.current&&R((a=d.current)==null?void 0:a.elementRef.current)):e!==-1&&e++),f(e)},V=()=>{if(!l&&n&&n.length>0){let e=n.length-1;b(e)}o!==-1&&b(o)};return{state:k,controlRef:w,inputRef:d,itemRefs:x,onClick:()=>{var e;f(-1),d.current&&!t.disabled&&R((e=d.current)==null?void 0:e.elementRef.current)},onChange:e=>{let a=e.target.value;if(o!==-1&&f(-1),!t.delimiter){m(a);return}let u=typeof t.delimiter=="string"?new RegExp(t.delimiter.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")):t.delimiter;u.test(a)?a.split(u).map(i=>i.trim()).filter(i=>i.length>0).forEach(i=>c(i)):m(a)},onKeyDown:e=>{if(!t.disabled)switch(e.key){case"Tab":t.addOnTab&&l.trim()&&c(l);break;case"Enter":l.trim()&&c(l);break;case"ArrowLeft":T();break;case"ArrowRight":E();break;case"Backspace":V();break;default:l.trim()&&t.delimiter&&typeof t.delimiter=="string"&&e.key===t.delimiter&&c(l);break}},onPaste:e=>{if(!t.addOnPaste)return;let a=e.clipboardData.getData("text");if(t.delimiter){let u=typeof t.delimiter=="string"?new RegExp(t.delimiter.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")):t.delimiter;a.split(u).map(i=>i.trim()).filter(i=>i.length>0).forEach(i=>c(i))}else c(a);setTimeout(()=>{m("")},0)},onBlur:()=>{t.addOnBlur&&l.trim()&&c(l),o!==-1&&f(-1)},onItemRemoveClick:e=>{var u;if(!n)return;let a=n.filter((g,i)=>i!==e);s([a,{value:a}]),d.current&&R((u=d.current)==null?void 0:u.elementRef.current)},onRemoveAllItems:()=>{t.disabled||!n||s([[],{value:[]}])}}}});export{I as defaultProps,j as useInputTags};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/inputtags/useInputTags.ts","../../src/inputtags/useInputTags.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport { useControlledState } from '@primereact/hooks/use-controlled-state';\nimport { focus } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultProps } from './useInputTags.props';\n\nexport const useInputTags = withHeadless({\n name: 'useInputTags',\n defaultProps,\n setup({ props }) {\n const [inputValueState, setInputValueState] = React.useState('');\n const [focusedItemIndexState, setFocusedItemIndexState] = React.useState<number>(-1);\n\n const defaultValueRef = React.useRef(props.defaultValue ?? []);\n const [valueState, setValueState] = useControlledState({\n value: props.value,\n defaultValue: defaultValueRef.current,\n onChange: props.onValueChange\n });\n\n const controlRef = React.useRef<HTMLDivElement>(null);\n const inputRef = React.useRef<{ elementRef: React.RefObject<HTMLInputElement> } | null>(null);\n const itemRefs = React.useRef<Map<number, HTMLElement>>(new Map());\n\n const state = {\n value: valueState ?? [],\n inputValue: inputValueState,\n focusedItemIndex: focusedItemIndexState\n };\n\n // methods\n const addItem = (tag: string) => {\n const trimmedTag = tag.trim();\n\n if (!trimmedTag || props.disabled) return;\n\n if (props.max && valueState && valueState.length >= props.max) return;\n\n if (!props.allowDuplicate && valueState && valueState.includes(trimmedTag)) return;\n\n const newValue = [...(valueState || []), trimmedTag];\n\n setValueState([\n newValue,\n {\n value: newValue\n }\n ]);\n\n if (props.onAdd) {\n props.onAdd({\n value: trimmedTag\n });\n }\n\n setInputValueState('');\n };\n\n const removeItem = (index: number) => {\n if (props.disabled || !valueState) return;\n\n const newValue = valueState.filter((_: unknown, i: number) => i !== index);\n\n setValueState([\n newValue,\n {\n value: newValue\n }\n ]);\n\n if (props.onRemove) {\n props.onRemove({\n value: valueState[index],\n index\n });\n }\n\n setFocusedItemIndexState(-1);\n };\n\n const onArrowLeft = () => {\n let focusIndex = focusedItemIndexState;\n\n if (inputValueState.length === 0 && valueState && valueState.length > 0) {\n focusIndex = focusIndex === -1 ? valueState.length - 1 : focusIndex - 1;\n\n if (focusIndex < 0) {\n focusIndex = 0;\n }\n }\n\n setFocusedItemIndexState(focusIndex);\n };\n\n const onArrowRight = () => {\n let focusIndex = focusedItemIndexState;\n\n if (inputValueState.length === 0 && valueState && valueState.length > 0) {\n if (focusIndex === valueState.length - 1) {\n focusIndex = -1;\n\n if (inputRef.current) {\n focus(inputRef.current?.elementRef.current);\n }\n } else if (focusIndex !== -1) {\n focusIndex++;\n }\n }\n\n setFocusedItemIndexState(focusIndex);\n };\n\n const onBackspace = () => {\n if (!inputValueState && valueState && valueState.length > 0) {\n const lastIndex = valueState.length - 1;\n\n removeItem(lastIndex);\n }\n\n if (focusedItemIndexState !== -1) {\n removeItem(focusedItemIndexState);\n }\n };\n\n const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n\n if (focusedItemIndexState !== -1) {\n setFocusedItemIndexState(-1);\n }\n\n if (!props.delimiter) {\n setInputValueState(newValue);\n\n return;\n }\n\n const delimiterRegex = typeof props.delimiter === 'string' ? new RegExp(props.delimiter.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')) : props.delimiter;\n\n if (delimiterRegex.test(newValue)) {\n const tags = newValue\n .split(delimiterRegex)\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0);\n\n tags.forEach((tag) => addItem(tag));\n } else {\n setInputValueState(newValue);\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (props.disabled) return;\n\n switch (event.key) {\n case 'Tab':\n if (props.addOnTab && inputValueState.trim()) {\n addItem(inputValueState);\n }\n\n break;\n\n case 'Enter':\n if (inputValueState.trim()) {\n addItem(inputValueState);\n }\n\n break;\n\n case 'ArrowLeft':\n onArrowLeft();\n\n break;\n\n case 'ArrowRight':\n onArrowRight();\n\n break;\n\n case 'Backspace':\n onBackspace();\n\n break;\n\n default:\n if (inputValueState.trim() && props.delimiter && typeof props.delimiter === 'string' && event.key === props.delimiter) {\n addItem(inputValueState);\n }\n\n break;\n }\n };\n\n const onClick = () => {\n setFocusedItemIndexState(-1);\n\n if (inputRef.current && !props.disabled) {\n focus(inputRef.current?.elementRef.current);\n }\n };\n\n const onPaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n if (!props.addOnPaste) return;\n\n const pastedText = event.clipboardData.getData('text');\n\n if (props.delimiter) {\n const delimiterRegex = typeof props.delimiter === 'string' ? new RegExp(props.delimiter.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')) : props.delimiter;\n\n const tags = pastedText\n .split(delimiterRegex)\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0);\n\n tags.forEach((tag) => addItem(tag));\n } else {\n addItem(pastedText);\n }\n\n setTimeout(() => {\n setInputValueState('');\n }, 0);\n };\n\n const onBlur = () => {\n if (props.addOnBlur && inputValueState.trim()) {\n addItem(inputValueState);\n }\n\n if (focusedItemIndexState !== -1) {\n setFocusedItemIndexState(-1);\n }\n };\n\n const onItemRemoveClick = (index: number) => {\n if (!valueState) return;\n\n const newValue = valueState.filter((_: unknown, i: number) => i !== index);\n\n setValueState([\n newValue,\n {\n value: newValue\n }\n ]);\n\n if (inputRef.current) {\n focus(inputRef.current?.elementRef.current);\n }\n };\n\n const onRemoveAllItems = () => {\n if (props.disabled || !valueState) return;\n\n setValueState([\n [],\n {\n value: []\n }\n ]);\n };\n\n return {\n state,\n // refs\n controlRef,\n inputRef,\n itemRefs,\n // methods\n onClick,\n onChange,\n onKeyDown,\n onPaste,\n onBlur,\n onItemRemoveClick,\n onRemoveAllItems\n };\n }\n});\n","import type { useInputTagsProps } from '@primereact/types/shared/inputtags';\n\nexport const defaultProps: useInputTagsProps = {\n defaultValue: undefined,\n value: undefined,\n max: undefined,\n delimiter: undefined,\n allowDuplicate: undefined,\n addOnBlur: undefined,\n addOnPaste: undefined,\n addOnTab: undefined,\n onValueChange: undefined,\n onAdd: undefined,\n onRemove: undefined\n};\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,4BAC7B,OAAS,sBAAAC,MAA0B,yCACnC,OAAS,SAAAC,MAAa,kBACtB,UAAYC,MA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CACbH,EAAM,WAAaE,EAAgB,KAAK,GACxCY,EAAQZ,CAAe,EAGvBE,IAA0B,IAC1BC,EAAyB,EAAE,CAEnC,EA0CI,kBAxCuBc,GAAkB,CA1OrD,IAAAlB,EA2OY,GAAI,CAACM,EAAY,OAEjB,IAAMU,EAAWV,EAAW,OAAO,CAACa,EAAY,IAAc,IAAMD,CAAK,EAEzEX,EAAc,CACVS,EACA,CACI,MAAOA,CACX,CACJ,CAAC,EAEGN,EAAS,SACTc,GAAMxB,EAAAU,EAAS,UAAT,YAAAV,EAAkB,WAAW,OAAO,CAElD,EA0BI,iBAxBqB,IAAM,CACvBD,EAAM,UAAY,CAACO,GAEvBC,EAAc,CACV,CAAC,EACD,CACI,MAAO,CAAC,CACZ,CACJ,CAAC,CACL,CAgBA,CACJ,CACJ,CAAC","names":["withHeadless","useControlledState","focus","React","defaultProps","useInputTags","withHeadless","defaultProps","props","_a","inputValueState","setInputValueState","focusedItemIndexState","setFocusedItemIndexState","defaultValueRef","valueState","setValueState","useControlledState","controlRef","inputRef","itemRefs","state","addItem","tag","trimmedTag","newValue","removeItem","index","_","i","onArrowLeft","focusIndex","onArrowRight","focus","onBackspace","lastIndex","event","delimiterRegex","pastedText"]}
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ export declare const useInputTags: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/shared/inputtags").useInputTagsProps, unknown, {
3
+ state: {
4
+ value: string[];
5
+ inputValue: string;
6
+ focusedItemIndex: number;
7
+ };
8
+ controlRef: React.RefObject<HTMLDivElement | null>;
9
+ inputRef: React.RefObject<{
10
+ elementRef: React.RefObject<HTMLInputElement>;
11
+ } | null>;
12
+ itemRefs: React.RefObject<Map<number, HTMLElement>>;
13
+ onClick: () => void;
14
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
15
+ onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
16
+ onPaste: (event: React.ClipboardEvent<HTMLInputElement>) => void;
17
+ onBlur: () => void;
18
+ onItemRemoveClick: (index: number) => void;
19
+ onRemoveAllItems: () => void;
20
+ }>;
@@ -0,0 +1,2 @@
1
+ import type { useInputTagsProps } from '@primereact/types/shared/inputtags';
2
+ export declare const defaultProps: useInputTagsProps;
File without changes
@@ -0,0 +1,2 @@
1
+ export * from './useListbox';
2
+ export * from './useListbox.props';
@@ -0,0 +1,2 @@
1
+ import{withHeadless as Be}from"@primereact/core/headless";import{useControlledState as ze}from"@primereact/hooks/use-controlled-state";import{equals as Je,findLastIndex as C,findSingle as We,focus as U,getFirstFocusableElement as se,isElement as _e,isNotEmpty as q,isPrintableCharacter as je,isString as ie,resolveFieldData as x}from"@primeuix/utils";import*as s from"react";var ue={value:void 0,defaultValue:void 0,options:[],optionKey:void 0,optionLabel:void 0,optionValue:void 0,optionDisabled:void 0,optionGroupLabel:void 0,optionGroupChildren:void 0,disabled:!1,locale:void 0,multiple:!1,metaKeySelection:!1,autoOptionFocus:!0,selectOnFocus:!1,focusOnHover:!0,onValueChange:void 0};var nn=Be({name:"useListbox",defaultProps:ue,setup({id:le,props:o,elementRef:p}){var ae;let[P,$]=s.useState(!1),[a,d]=s.useState(-1),[i,de]=ze({value:o.value,defaultValue:(ae=o.defaultValue)!=null?ae:null,onChange:o.onValueChange}),fe={value:i,focused:P,focusedOptionIndex:a},L=s.useRef(null),b=s.useRef(null),k=s.useRef(null),F=s.useRef(!1),y=s.useRef(-1),K=s.useRef(null),O=s.useRef(""),c=()=>$e||[],v=e=>`${le}_${e}`,B=e=>o.optionLabel?x(e,o.optionLabel):ie(e)?e:null,l=e=>o.optionValue?x(e,o.optionValue):e,G=e=>o.optionDisabled?x(e,o.optionDisabled):!1,M=e=>!!(o.optionGroupLabel&&(e!=null&&e.optionGroup)&&(e!=null&&e.group)),me=e=>o.optionGroupLabel?x(e,o.optionGroupLabel):ie(e)?e:null,z=e=>o.optionGroupChildren?x(e,o.optionGroupChildren):null,J=()=>a!==-1?v(a):null,be=()=>c().filter(e=>!M(e)).length,ye=e=>(o.optionGroupLabel?e-(c().slice(0,e).filter(t=>M(t)).length||0):e)+1,he=()=>{U(L.current);let e=se(p.current,':not([data-p-hidden-focusable="true"])');k.current&&(k.current.tabIndex=_e(e)?0:-1),b.current&&(b.current.tabIndex=-1)},we=e=>{if(e.relatedTarget===L.current){let n=se(p.current,':not([data-p-hidden-focusable="true"])');n instanceof HTMLElement&&U(n),b.current&&(b.current.tabIndex=0)}else U(b.current);k.current&&(k.current.tabIndex=-1)},ke=e=>{!(p.current instanceof HTMLElement&&p.current.contains(e.relatedTarget))&&k.current&&b.current&&(k.current.tabIndex=0,b.current.tabIndex=0)},Ke=()=>{let e=a!==-1?a:o.autoOptionFocus?H():Ce();$(!0),d(e),N(),g(e)},Re=()=>{$(!1),d(-1),y.current=-1,O.current=""},Oe=e=>{let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":W(e);break;case"ArrowUp":_(e);break;case"Home":j(e);break;case"End":Q(e);break;case"PageDown":De(e);break;case"PageUp":Ae(e);break;case"Enter":case"NumpadEnter":case"Space":Te(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":Y();break;default:if(o.multiple&&e.code==="KeyA"&&t){let n=c().filter(r=>f(r)).map(r=>l(r));E(e,n),e.preventDefault();break}!t&&je(e.key)&&(Ne(e,e.key),e.preventDefault());break}},A=(e,t,n=-1)=>{o.disabled||G(t)||(o.multiple?xe(e,t):Se(e,t),F.current=!1,n!==-1&&d(n))},Ie=(e,t)=>{h(e,t)},ge=(e,t)=>{o.focusOnHover&&P&&h(e,t)},Ee=()=>{o.disabled||(F.current=!0)},Se=(e,t)=>{let n=V(t),r=F.current?!1:o.metaKeySelection,u=!1,m=null;if(r){let S=e&&(e.metaKey||e.ctrlKey);n?S&&(m=null,u=!0):(m=l(t),u=!0)}else m=n?null:l(t),u=!0;u&&E(e,m)},xe=(e,t)=>{let n=V(t),r=F.current?!1:o.metaKeySelection,u=null;if(r){let m=e.metaKey||e.ctrlKey;n?u=m?re(t):[l(t)]:(u=m?Array.isArray(i)?i:[]:[],u=[...u,l(t)])}else u=n?re(t):[...Array.isArray(i)?i:[],l(t)];E(e,u)},I=(e,t=-1,n=-1)=>{if(t=t===-1?oe(n,!0):t,n=n===-1?oe(t):n,t!==-1&&n!==-1){let r=Math.min(t,n),u=Math.max(t,n),m=c().slice(r,u+1).filter(S=>f(S)).map(S=>l(S));E(e,m)}},pe=()=>{d(-1),y.current=-1},Le=()=>{d(-1),y.current=-1},Fe=e=>{switch(e.code){case"ArrowDown":W(e);break;case"ArrowUp":_(e);break;case"ArrowLeft":case"ArrowRight":Me(e,!0);break;case"Home":j(e,!0);break;case"End":Q(e,!0);break;case"Enter":case"NumpadEnter":X(e);break;case"ShiftLeft":case"ShiftRight":Y();break;default:break}},W=e=>{let t=a!==-1?Ve(a):H();o.multiple&&e.shiftKey&&I(e,y.current,t),h(e,t),e.preventDefault()},_=e=>{let t=a!==-1?He(a):Ge();o.multiple&&e.shiftKey&&I(e,t,y.current),h(e,t),e.preventDefault()},Me=(e,t=!1)=>{t&&d(-1)},j=(e,t=!1)=>{if(t){let n=e.currentTarget;e.shiftKey?n==null||n.setSelectionRange(0,n.selectionStart):(n==null||n.setSelectionRange(0,0),d(-1))}else{let n=e.metaKey||e.ctrlKey,r=Z();o.multiple&&e.shiftKey&&n&&I(e,r,y.current),h(e,r)}e.preventDefault()},Q=(e,t=!1)=>{if(t){let n=e.currentTarget,r=n.value.length;e.shiftKey?n.setSelectionRange(n.selectionStart,r):(n.setSelectionRange(r,r),d(-1))}else{let n=e.metaKey||e.ctrlKey,r=ee();o.multiple&&e.shiftKey&&n&&I(e,y.current,r),h(e,r)}e.preventDefault()},Ae=e=>{g(0),e.preventDefault()},De=e=>{g(c().length-1),e.preventDefault()},X=e=>{a!==-1&&(o.multiple&&e.shiftKey?I(e,a):A(e,c()[a]))},Te=e=>{e.preventDefault(),X(e)},Y=()=>{y.current=a},D=e=>{var t,n;return f(e)&&((n=B(e))==null?void 0:n.toLocaleLowerCase(o.locale).startsWith((t=O.current)==null?void 0:t.toLocaleLowerCase(o.locale)))},f=e=>q(e)&&!G(e)&&!M(e),R=e=>f(e)&&V(e),T=(e,t)=>Je(e,t,ce),V=e=>{let t=l(e);return o.multiple?Array.isArray(i)&&i.some(n=>T(n,t)):T(i,t)},Z=()=>c().findIndex(e=>f(e)),ee=()=>C(c(),e=>f(e)),Ve=e=>{let t=e<c().length-1?c().slice(e+1).findIndex(n=>f(n)):-1;return t>-1?t+e+1:e},He=e=>{let t=e>0?C(c().slice(0,e),n=>f(n)):-1;return t>-1?t:e},Ce=()=>{if(w())if(o.multiple&&Array.isArray(i))for(let e=i.length-1;e>=0;e--){let t=i[e],n=c().findIndex(r=>R(r)&&T(t,l(r)));if(n>-1)return n}else return c().findIndex(e=>R(e));return-1},Pe=()=>w()?c().findIndex(e=>R(e)):-1,ve=()=>w()?C(c(),e=>R(e)):-1,ne=e=>{let t=w()&&e<c().length-1?c().slice(e+1).findIndex(n=>R(n)):-1;return t>-1?t+e+1:-1},te=e=>{let t=w()&&e>0?C(c().slice(0,e),n=>R(n)):-1;return t>-1?t:-1},oe=(e,t=!1)=>{let n=-1;return w()&&(t?(n=te(e),n=n===-1?ne(e):n):(n=ne(e),n=n===-1?te(e):n)),n>-1?n:e},H=()=>{let e=Pe();return e<0?Z():e},Ge=()=>{let e=ve();return e<0?ee():e},Ne=(e,t)=>{var r;O.current=(O.current||"")+t;let n=-1;q(O.current)&&(a!==-1?(n=c().slice(a).findIndex(u=>D(u)),n=n===-1?c().slice(0,a).findIndex(u=>D(u)):n+a):n=c().findIndex(u=>D(u)),n===-1&&a===-1&&(n=(r=H())!=null?r:-1),n!==-1&&h(e,n)),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{O.current="",K.current=null},500)},re=e=>Array.isArray(i)?i.filter(t=>!T(t,l(e))):[],h=(e,t=-1)=>{a!==t&&(d(t),g(),o.selectOnFocus&&!o.multiple&&A(e,c()[t]))},Ue=()=>new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})}),g=(e=-1)=>{Ue().then(()=>{var r;let t=e!==-1?v(e):J(),n=We(L.current,`[id="${t}"]`);(r=n==null?void 0:n.scrollIntoView)==null||r.call(n,{block:"nearest",inline:"nearest",behavior:"smooth"})})},N=()=>{if(o.selectOnFocus&&o.autoOptionFocus&&!w()&&!o.multiple&&P){let e=H();d(e),A(null,c()[e])}},E=(e,t)=>{de([t,{originalEvent:e,value:t}])},w=()=>q(i);s.useEffect(()=>(N(),()=>{K.current&&(clearTimeout(K.current),K.current=null)}),[]);let qe=s.useMemo(()=>{let e=[];return(o.options||[]).forEach(t=>{let n=z(t)||[];n!=null&&n.length&&e.push({optionGroup:t,group:!0},...n)}),e},[o.options]),$e=o.optionGroupLabel?qe:o.options,ce=o.optionValue?void 0:o.optionKey;return{state:fe,listRef:L,firstHiddenFocusableRef:b,lastHiddenFocusableRef:k,getOptions:c,getOptionId:v,getOptionLabel:B,getOptionValue:l,isOptionDisabled:G,isOptionGroup:M,getOptionGroupLabel:me,getOptionGroupChildren:z,getFocusedOptionId:J,getAriaSetSize:be,getAriaPosInset:ye,onFirstHiddenFocus:he,onLastHiddenFocus:we,onFocusOut:ke,onListFocus:Ke,onListBlur:Re,onListKeyDown:Oe,onOptionSelect:A,onOptionMouseDown:Ie,onOptionMouseMove:ge,onOptionTouchEnd:Ee,onFilterChange:pe,onFilterBlur:Le,onFilterKeyDown:Fe,isOptionMatched:D,isValidOption:f,isValidSelectedOption:R,isSelected:V,changeFocusedOptionIndex:h,scrollInView:g,updateModel:E,autoUpdateModel:N,equalityKey:ce,hasValue:w}}});export{ue as defaultProps,nn as useListbox};
2
+ //# sourceMappingURL=index.mjs.map