nit accept underscore for flow editor

This commit is contained in:
Ruben Fiszel
2024-09-10 20:27:45 +02:00
parent 9e8c9fb1cb
commit 6de024e55e
2 changed files with 3 additions and 1 deletions

View File

@@ -11,10 +11,11 @@
export let value = initialId
export let buttonText = ''
export let btnClasses = '!p-1 !w-[34px] !ml-1'
export let acceptUnderScores = false
let error = ''
const dispatch = createEventDispatcher()
const regex = /^[a-zA-Z][a-zA-Z0-9]*$/
const regex = acceptUnderScores ? /^[a-zA-Z][a-zA-Z0-9_]*$/ : /^[a-zA-Z][a-zA-Z0-9]*$/
$: validateId(value, reservedIds)

View File

@@ -77,6 +77,7 @@
btnClasses="!ml-1"
label=""
initialId={id}
acceptUnderScores
reservedIds={dfs(flowStore?.value.modules ?? [], (x) => x.id)}
bind:value={newId}
on:save={(e) => {