Socket
Socket
Sign inDemoInstall

@react-stately/collections

Package Overview
Dependencies
Maintainers
2
Versions
784
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-stately/collections - npm Package Compare versions

Comparing version 3.10.6 to 3.10.7

14

dist/CollectionBuilder.main.js

@@ -31,4 +31,4 @@ var $ioO2y$react = require("react");

let { children: children, items: items } = props;
if (typeof children === "function") {
if (!items) throw new Error("props.children was a function but props.items is missing");
if (typeof children === 'function') {
if (!items) throw new Error('props.children was a function but props.items is missing');
for (let item of props.items)yield* this.getFullNode({

@@ -59,3 +59,3 @@ value: item

if (item.key != null) return item.key;
if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
if (partialNode.type === 'cell' && partialNode.key != null) return `${parentKey}${partialNode.key}`;
let v = partialNode.value;

@@ -65,3 +65,3 @@ if (v != null) {

let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
if (key == null) throw new Error("No key found for item");
if (key == null) throw new Error('No key found for item');
return key;

@@ -94,4 +94,4 @@ }

let type = element.type;
if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
let name = typeof element.type === "function" ? element.type.name : element.type;
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
let name = typeof element.type === 'function' ? element.type.name : element.type;
throw new Error(`Unknown element <${name}> in collection.`);

@@ -144,3 +144,3 @@ }

textValue: partialNode.textValue,
"aria-label": partialNode["aria-label"],
'aria-label': partialNode['aria-label'],
wrapper: partialNode.wrapper,

@@ -147,0 +147,0 @@ shouldInvalidate: partialNode.shouldInvalidate,

@@ -21,4 +21,4 @@ import $fzaAv$react from "react";

let { children: children, items: items } = props;
if (typeof children === "function") {
if (!items) throw new Error("props.children was a function but props.items is missing");
if (typeof children === 'function') {
if (!items) throw new Error('props.children was a function but props.items is missing');
for (let item of props.items)yield* this.getFullNode({

@@ -49,3 +49,3 @@ value: item

if (item.key != null) return item.key;
if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
if (partialNode.type === 'cell' && partialNode.key != null) return `${parentKey}${partialNode.key}`;
let v = partialNode.value;

@@ -55,3 +55,3 @@ if (v != null) {

let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
if (key == null) throw new Error("No key found for item");
if (key == null) throw new Error('No key found for item');
return key;

@@ -84,4 +84,4 @@ }

let type = element.type;
if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
let name = typeof element.type === "function" ? element.type.name : element.type;
if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
let name = typeof element.type === 'function' ? element.type.name : element.type;
throw new Error(`Unknown element <${name}> in collection.`);

@@ -134,3 +134,3 @@ }

textValue: partialNode.textValue,
"aria-label": partialNode["aria-label"],
'aria-label': partialNode['aria-label'],
wrapper: partialNode.wrapper,

@@ -137,0 +137,0 @@ shouldInvalidate: partialNode.shouldInvalidate,

@@ -23,3 +23,3 @@

// New API: call collection.getChildren with the node key.
if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
if (typeof collection.getChildren === 'function') return collection.getChildren(node.key);
// Old API: access childNodes directly.

@@ -26,0 +26,0 @@ return node.childNodes;

@@ -13,3 +13,3 @@ /*

// New API: call collection.getChildren with the node key.
if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
if (typeof collection.getChildren === 'function') return collection.getChildren(node.key);
// Old API: access childNodes directly.

@@ -16,0 +16,0 @@ return node.childNodes;

@@ -26,3 +26,3 @@ var $7a155683b0d79a6a$exports = require("./getChildNodes.main.js");

let countItems = (items)=>{
for (let item of items)if (item.type === "section") countItems((0, $7a155683b0d79a6a$exports.getChildNodes)(item, collection));
for (let item of items)if (item.type === 'section') countItems((0, $7a155683b0d79a6a$exports.getChildNodes)(item, collection));
else count++;

@@ -29,0 +29,0 @@ };

@@ -20,3 +20,3 @@ import {getChildNodes as $c5a24bc478652b5f$export$1005530eda016c13} from "./getChildNodes.module.js";

let countItems = (items)=>{
for (let item of items)if (item.type === "section") countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
for (let item of items)if (item.type === 'section') countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
else count++;

@@ -23,0 +23,0 @@ };

@@ -30,15 +30,15 @@ var $5Zch8$react = require("react");

let rendered = props.title || props.children;
let textValue = props.textValue || (typeof rendered === "string" ? rendered : "") || props["aria-label"] || "";
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
// suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
yield {
type: "item",
type: 'item',
props: props,
rendered: rendered,
textValue: textValue,
"aria-label": props["aria-label"],
'aria-label': props['aria-label'],
hasChildNodes: $c870f3b549c61b6b$var$hasChildItems(props),
*childNodes () {
if (childItems) for (let child of childItems)yield {
type: "item",
type: 'item',
value: child

@@ -50,3 +50,3 @@ };

items.push({
type: "item",
type: 'item',
element: child

@@ -53,0 +53,0 @@ });

@@ -20,15 +20,15 @@ import $6Fm0V$react from "react";

let rendered = props.title || props.children;
let textValue = props.textValue || (typeof rendered === "string" ? rendered : "") || props["aria-label"] || "";
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
// suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
yield {
type: "item",
type: 'item',
props: props,
rendered: rendered,
textValue: textValue,
"aria-label": props["aria-label"],
'aria-label': props['aria-label'],
hasChildNodes: $c1d7fb2ec91bae71$var$hasChildItems(props),
*childNodes () {
if (childItems) for (let child of childItems)yield {
type: "item",
type: 'item',
value: child

@@ -40,3 +40,3 @@ };

items.push({
type: "item",
type: 'item',
element: child

@@ -43,0 +43,0 @@ });

@@ -30,12 +30,12 @@ var $98hxh$react = require("react");

yield {
type: "section",
type: 'section',
props: props,
hasChildNodes: true,
rendered: title,
"aria-label": props["aria-label"],
'aria-label': props['aria-label'],
*childNodes () {
if (typeof children === "function") {
if (!items) throw new Error("props.children was a function but props.items is missing");
if (typeof children === 'function') {
if (!items) throw new Error('props.children was a function but props.items is missing');
for (let item of items)yield {
type: "item",
type: 'item',
value: item,

@@ -48,3 +48,3 @@ renderer: children

items.push({
type: "item",
type: 'item',
element: child

@@ -51,0 +51,0 @@ });

@@ -20,12 +20,12 @@ import $gtysd$react from "react";

yield {
type: "section",
type: 'section',
props: props,
hasChildNodes: true,
rendered: title,
"aria-label": props["aria-label"],
'aria-label': props['aria-label'],
*childNodes () {
if (typeof children === "function") {
if (!items) throw new Error("props.children was a function but props.items is missing");
if (typeof children === 'function') {
if (!items) throw new Error('props.children was a function but props.items is missing');
for (let item of items)yield {
type: "item",
type: 'item',
value: item,

@@ -38,3 +38,3 @@ renderer: children

items.push({
type: "item",
type: 'item',
element: child

@@ -41,0 +41,0 @@ });

{
"name": "@react-stately/collections",
"version": "3.10.6",
"version": "3.10.7",
"description": "Spectrum UI components in React",

@@ -25,3 +25,3 @@ "license": "Apache-2.0",

"dependencies": {
"@react-types/shared": "^3.23.0",
"@react-types/shared": "^3.23.1",
"@swc/helpers": "^0.5.0"

@@ -35,3 +35,3 @@ },

},
"gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd"
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
}

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

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