Socket
Socket
Sign inDemoInstall

@radix-ui/react-collection

Package Overview
Dependencies
Maintainers
8
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-collection - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

2

dist/index.d.ts
import React from "react";
export function createCollection<ItemElement extends HTMLElement, ItemData>(): readonly [React.ForwardRefExoticComponent<Pick<{
export function createCollection<ItemElement extends HTMLElement, ItemData>(): readonly [React.FC<{}>, React.ForwardRefExoticComponent<Pick<{
children?: React.ReactNode;

@@ -4,0 +4,0 @@ } & React.RefAttributes<HTMLElement>, "children" | "key"> & React.RefAttributes<HTMLElement>>, React.ForwardRefExoticComponent<React.PropsWithoutRef<{

@@ -1,2 +0,2 @@

var e,r=require("@radix-ui/react-slot").Slot,t=require("@radix-ui/react-compose-refs").useComposedRefs,n=(e=require("react"))&&e.__esModule?e.default:e;exports.createCollection=function(){const e=/*#__PURE__*/n.createContext({}),o=/*#__PURE__*/n.forwardRef(((o,c)=>{const{children:u}=o,l=n.useRef(null),a=t(c,l),f=n.useRef(new Map).current;/*#__PURE__*/return n.createElement(e.Provider,{value:n.useMemo((()=>({itemMap:f,collectionRef:l})),[f])},/*#__PURE__*/n.createElement(r,{ref:a},u))})),c="data-radix-collection-item",u=/*#__PURE__*/n.forwardRef(((o,u)=>{const{children:l,...a}=o,f=n.useRef(null),i=t(u,f),s=n.useContext(e);return n.useEffect((()=>(s.itemMap.set(f,{ref:f,...a}),()=>{s.itemMap.delete(f)}))),/*#__PURE__*/n.createElement(r,{[c]:"",ref:i},l)}));return[o,u,function(){const r=n.useContext(e);return{getItems(){const e=Array.from(r.collectionRef.current.querySelectorAll(`[${c}]`));return Array.from(r.itemMap.values()).sort(((r,t)=>e.indexOf(r.ref.current)-e.indexOf(t.ref.current)))}}}]};
var e,r=require("@radix-ui/react-slot").Slot,t=require("@radix-ui/react-compose-refs").useComposedRefs,n=(e=require("react"))&&e.__esModule?e.default:e;exports.createCollection=function(){const e=/*#__PURE__*/n.createContext({}),o=r=>{const{children:t}=r,o=n.useRef(null),c=n.useRef(new Map).current;/*#__PURE__*/return n.createElement(e.Provider,{value:n.useMemo((()=>({itemMap:c,collectionRef:o})),[c])},t)},c=/*#__PURE__*/n.forwardRef(((o,c)=>{const{children:u}=o,l=n.useContext(e),a=t(c,l.collectionRef);/*#__PURE__*/return n.createElement(r,{ref:a},u)})),u="data-radix-collection-item",l=/*#__PURE__*/n.forwardRef(((o,c)=>{const{children:l,...a}=o,f=n.useRef(null),i=t(c,f),s=n.useContext(e);return n.useEffect((()=>(s.itemMap.set(f,{ref:f,...a}),()=>{s.itemMap.delete(f)}))),/*#__PURE__*/n.createElement(r,{[u]:"",ref:i},l)}));return[o,c,l,function(){const r=n.useContext(e);return{getItems(){const e=Array.from(r.collectionRef.current.querySelectorAll(`[${u}]`));return Array.from(r.itemMap.values()).sort(((r,t)=>e.indexOf(r.ref.current)-e.indexOf(t.ref.current)))}}}]};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import{Slot as e}from"@radix-ui/react-slot";import{useComposedRefs as r}from"@radix-ui/react-compose-refs";import t from"react";export function createCollection(){const o=/*#__PURE__*/t.createContext({}),n=/*#__PURE__*/t.forwardRef(((n,c)=>{const{children:f}=n,u=t.useRef(null),a=r(c,u),i=t.useRef(new Map).current;/*#__PURE__*/return t.createElement(o.Provider,{value:t.useMemo((()=>({itemMap:i,collectionRef:u})),[i])},/*#__PURE__*/t.createElement(e,{ref:a},f))})),c="data-radix-collection-item",f=/*#__PURE__*/t.forwardRef(((n,f)=>{const{children:u,...a}=n,i=t.useRef(null),l=r(f,i),m=t.useContext(o);return t.useEffect((()=>(m.itemMap.set(i,{ref:i,...a}),()=>{m.itemMap.delete(i)}))),/*#__PURE__*/t.createElement(e,{[c]:"",ref:l},u)}));return[n,f,function(){const e=t.useContext(o);return{getItems(){const r=Array.from(e.collectionRef.current.querySelectorAll(`[${c}]`));return Array.from(e.itemMap.values()).sort(((e,t)=>r.indexOf(e.ref.current)-r.indexOf(t.ref.current)))}}}]}
import{Slot as e}from"@radix-ui/react-slot";import{useComposedRefs as r}from"@radix-ui/react-compose-refs";import t from"react";export function createCollection(){const n=/*#__PURE__*/t.createContext({}),o=e=>{const{children:r}=e,o=t.useRef(null),c=t.useRef(new Map).current;/*#__PURE__*/return t.createElement(n.Provider,{value:t.useMemo((()=>({itemMap:c,collectionRef:o})),[c])},r)},c=/*#__PURE__*/t.forwardRef(((o,c)=>{const{children:f}=o,l=t.useContext(n),u=r(c,l.collectionRef);/*#__PURE__*/return t.createElement(e,{ref:u},f)})),f="data-radix-collection-item",l=/*#__PURE__*/t.forwardRef(((o,c)=>{const{children:l,...u}=o,i=t.useRef(null),a=r(c,i),s=t.useContext(n);return t.useEffect((()=>(s.itemMap.set(i,{ref:i,...u}),()=>{s.itemMap.delete(i)}))),/*#__PURE__*/t.createElement(e,{[f]:"",ref:a},l)}));return[o,c,l,function(){const e=t.useContext(n);return{getItems(){const r=Array.from(e.collectionRef.current.querySelectorAll(`[${f}]`));return Array.from(e.itemMap.values()).sort(((e,t)=>r.indexOf(e.ref.current)-r.indexOf(t.ref.current)))}}}]}
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-collection",
"version": "0.0.14",
"version": "0.0.15",
"license": "MIT",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc