diff --git a/.gitignore b/.gitignore index 5ec4ea2..188c14b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ coverage *.sublime-workspace *.dev.tale.vue *.dev.stories.js +storybook-static \ No newline at end of file diff --git a/src/form/registry.ts b/src/form/registry.ts index 1cddf71..8319922 100644 --- a/src/form/registry.ts +++ b/src/form/registry.ts @@ -72,7 +72,14 @@ export default class Registry { const result = new Map() for (const i of this.registry.keys()) { - if (i === key || i.includes(key + '.')) { + const objectKey = key + '.' + const arrayKey = key + '[' + + if ( + i === key || + i.substring(0, objectKey.length) === objectKey || + i.substring(0, arrayKey.length) === arrayKey + ) { result.set(i, this.registry.get(i)) } } diff --git a/src/utils/index.ts b/src/utils/index.ts index 0c36005..f300cad 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -52,6 +52,9 @@ export function setNested (obj: Record, field: string, value: any): subProxy = subProxy[matches[2]] } } else { + if (subProxy === undefined) { + break + } if (i === fieldParts.length - 1) { subProxy[fieldPart] = value break diff --git a/storybook/stories/FormularioGrouping.tale.vue b/storybook/stories/FormularioGrouping.tale.vue index 30eaae0..03dd074 100644 --- a/storybook/stories/FormularioGrouping.tale.vue +++ b/storybook/stories/FormularioGrouping.tale.vue @@ -1,55 +1,22 @@