change tagged-input-field component, allow to paste multiple values (#365)

This commit is contained in:
Christoph
2025-04-19 17:43:51 +02:00
parent 6681dfa96f
commit 1d94f6baaf
7 changed files with 304 additions and 117 deletions

View File

@@ -1,14 +1,26 @@
import isCidr from "is-cidr";
import {isIP} from 'is-ip';
export function validateCIDR(value) {
return isCidr(value) !== 0
export function validateCIDR() {
return [{
classes: 'invalid-cidr',
rule: ({ text }) => isCidr(text) === 0,
disableAdd: true,
}]
}
export function validateIP(value) {
return isIP(value)
export function validateIP() {
return [{
classes: 'invalid-ip',
rule: ({ text }) => !isIP(text),
disableAdd: true,
}]
}
export function validateDomain(value) {
return true
export function validateDomain() {
return [{
classes: 'invalid-domain',
rule: tag => tag.text.length < 3,
disableAdd: true,
}]
}