Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zag-js/collection

Package Overview
Dependencies
Maintainers
0
Versions
495
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/collection - npm Package Compare versions

Comparing version 0.70.0 to 0.71.0

2

dist/index.d.ts

@@ -130,3 +130,3 @@ interface CollectionSearchState {

reorder(fromIndex: number, toIndex: number): void;
toJSON(): {
json(): {
size: number;

@@ -133,0 +133,0 @@ first: string | null;

@@ -1,39 +0,12 @@

"use strict";
'use strict';
var utils = require('@zag-js/utils');
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
// src/index.ts
var src_exports = {};
__export(src_exports, {
GridCollection: () => GridCollection,
ListCollection: () => ListCollection
});
module.exports = __toCommonJS(src_exports);
// src/grid-collection.ts
var import_utils2 = require("@zag-js/utils");
// src/list-collection.ts
var import_utils = require("@zag-js/utils");
var fallback = {
itemToValue(item) {
if (typeof item === "string") return item;
if ((0, import_utils.isObject)(item) && (0, import_utils.hasProp)(item, "value")) return item.value;
if (utils.isObject(item) && utils.hasProp(item, "value")) return item.value;
return "";

@@ -43,7 +16,7 @@ },

if (typeof item === "string") return item;
if ((0, import_utils.isObject)(item) && (0, import_utils.hasProp)(item, "label")) return item.label;
if (utils.isObject(item) && utils.hasProp(item, "label")) return item.label;
return fallback.itemToValue(item);
},
isItemDisabled(item) {
if ((0, import_utils.isObject)(item) && (0, import_utils.hasProp)(item, "disabled")) return !!item.disabled;
if (utils.isObject(item) && utils.hasProp(item, "disabled")) return !!item.disabled;
return false;

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

isEqual(other) {
return (0, import_utils.isEqual)(this.items, other.items);
return utils.isEqual(this.items, other.items);
}

@@ -262,3 +235,3 @@ /**

}
toJSON() {
json() {
return {

@@ -290,3 +263,3 @@ size: this.size,

getRows() {
return (0, import_utils2.chunk)([...this.items], this.columnCount);
return utils.chunk([...this.items], this.columnCount);
}

@@ -324,7 +297,4 @@ /**

};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
GridCollection,
ListCollection
});
//# sourceMappingURL=index.js.map
exports.GridCollection = GridCollection;
exports.ListCollection = ListCollection;
{
"name": "@zag-js/collection",
"version": "0.70.0",
"version": "0.71.0",
"description": "Utilities to manage a collection of items.",

@@ -26,3 +26,3 @@ "keywords": [

"dependencies": {
"@zag-js/utils": "0.70.0"
"@zag-js/utils": "0.71.0"
},

@@ -29,0 +29,0 @@ "clean-package": "../../../clean-package.config.json",

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