@zag-js/tags-input
Advanced tools
Comparing version 0.0.0-dev-20240712125036 to 0.0.0-dev-20240712143332
@@ -865,3 +865,4 @@ "use strict"; | ||
if (guard) { | ||
set.value(ctx2, ctx2.value.concat(value)); | ||
const nextValue = (0, import_utils.uniq)(ctx2.value.concat(value)); | ||
set.value(ctx2, nextValue); | ||
ctx2.log.prev = ctx2.log.current; | ||
@@ -879,3 +880,4 @@ ctx2.log.current = { type: "add", value }; | ||
const trimmedValue = ctx2.delimiter ? value.split(ctx2.delimiter).map((v) => v.trim()) : [value]; | ||
set.value(ctx2, ctx2.value.concat(...trimmedValue)); | ||
const nextValue = (0, import_utils.uniq)(ctx2.value.concat(...trimmedValue)); | ||
set.value(ctx2, nextValue); | ||
ctx2.log.prev = ctx2.log.current; | ||
@@ -882,0 +884,0 @@ ctx2.log.current = { type: "paste", values: trimmedValue }; |
{ | ||
"name": "@zag-js/tags-input", | ||
"version": "0.0.0-dev-20240712125036", | ||
"version": "0.0.0-dev-20240712143332", | ||
"description": "Core logic for the tags-input widget implemented as a state machine", | ||
@@ -30,12 +30,12 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.0.0-dev-20240712125036", | ||
"@zag-js/auto-resize": "0.0.0-dev-20240712125036", | ||
"@zag-js/core": "0.0.0-dev-20240712125036", | ||
"@zag-js/interact-outside": "0.0.0-dev-20240712125036", | ||
"@zag-js/live-region": "0.0.0-dev-20240712125036", | ||
"@zag-js/dom-query": "0.0.0-dev-20240712125036", | ||
"@zag-js/dom-event": "0.0.0-dev-20240712125036", | ||
"@zag-js/form-utils": "0.0.0-dev-20240712125036", | ||
"@zag-js/utils": "0.0.0-dev-20240712125036", | ||
"@zag-js/types": "0.0.0-dev-20240712125036" | ||
"@zag-js/anatomy": "0.0.0-dev-20240712143332", | ||
"@zag-js/auto-resize": "0.0.0-dev-20240712143332", | ||
"@zag-js/core": "0.0.0-dev-20240712143332", | ||
"@zag-js/interact-outside": "0.0.0-dev-20240712143332", | ||
"@zag-js/live-region": "0.0.0-dev-20240712143332", | ||
"@zag-js/dom-query": "0.0.0-dev-20240712143332", | ||
"@zag-js/dom-event": "0.0.0-dev-20240712143332", | ||
"@zag-js/form-utils": "0.0.0-dev-20240712143332", | ||
"@zag-js/utils": "0.0.0-dev-20240712143332", | ||
"@zag-js/types": "0.0.0-dev-20240712143332" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
@@ -7,3 +7,3 @@ import { autoResizeInput } from "@zag-js/auto-resize" | ||
import { createLiveRegion } from "@zag-js/live-region" | ||
import { compact, isEqual, removeAt, warn } from "@zag-js/utils" | ||
import { compact, isEqual, removeAt, uniq, warn } from "@zag-js/utils" | ||
import { dom } from "./tags-input.dom" | ||
@@ -479,3 +479,4 @@ import type { MachineContext, MachineState, UserDefinedContext } from "./tags-input.types" | ||
if (guard) { | ||
set.value(ctx, ctx.value.concat(value)) | ||
const nextValue = uniq(ctx.value.concat(value)) | ||
set.value(ctx, nextValue) | ||
// log | ||
@@ -494,3 +495,4 @@ ctx.log.prev = ctx.log.current | ||
const trimmedValue = ctx.delimiter ? value.split(ctx.delimiter).map((v) => v.trim()) : [value] | ||
set.value(ctx, ctx.value.concat(...trimmedValue)) | ||
const nextValue = uniq(ctx.value.concat(...trimmedValue)) | ||
set.value(ctx, nextValue) | ||
// log | ||
@@ -497,0 +499,0 @@ ctx.log.prev = ctx.log.current |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
257265
3664
+ Added@zag-js/anatomy@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/auto-resize@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/core@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/dom-event@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/dom-query@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/form-utils@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/interact-outside@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/live-region@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/store@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/text-selection@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/types@0.0.0-dev-20240712143332(transitive)
+ Added@zag-js/utils@0.0.0-dev-20240712143332(transitive)
- Removed@zag-js/anatomy@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/auto-resize@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/core@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/dom-event@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/dom-query@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/form-utils@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/interact-outside@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/live-region@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/store@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/text-selection@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/types@0.0.0-dev-20240712125036(transitive)
- Removed@zag-js/utils@0.0.0-dev-20240712125036(transitive)