@tanstack/form-core
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -279,3 +279,3 @@ import { defineProperty as _defineProperty, classPrivateFieldInitSpec as _classPrivateFieldInitSpec, classPrivateFieldGet as _classPrivateFieldGet } from './_virtual/_rollupPluginBabelHelpers.js'; | ||
isTouched: false, | ||
...this.options.defaultMeta | ||
..._opts.defaultMeta | ||
} | ||
@@ -282,0 +282,0 @@ }, { |
@@ -279,3 +279,3 @@ import { defineProperty as _defineProperty, classPrivateFieldInitSpec as _classPrivateFieldInitSpec, classPrivateFieldGet as _classPrivateFieldGet } from './_virtual/_rollupPluginBabelHelpers.legacy.js'; | ||
isTouched: false, | ||
...this.options.defaultMeta | ||
..._opts.defaultMeta | ||
} | ||
@@ -282,0 +282,0 @@ }, { |
{ | ||
"name": "@tanstack/form-core", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Powerful, type-safe, framework agnostic forms.", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -135,3 +135,3 @@ import type { DeepKeys, DeepValue, Updater } from './utils' | ||
isTouched: false, | ||
...this.options.defaultMeta, | ||
...opts.defaultMeta, | ||
}, | ||
@@ -138,0 +138,0 @@ }, |
@@ -22,17 +22,27 @@ import { expect } from 'vitest' | ||
it('should set a value correctly', () => { | ||
const form = new FormApi({ | ||
defaultValues: { | ||
name: 'test', | ||
}, | ||
it('should get default meta', () => { | ||
const form = new FormApi() | ||
const field = new FieldApi({ | ||
form, | ||
name: 'name', | ||
}) | ||
expect(field.getMeta()).toEqual({ | ||
isTouched: false, | ||
isValidating: false, | ||
}) | ||
}) | ||
it('should allow to set default meta', () => { | ||
const form = new FormApi() | ||
const field = new FieldApi({ | ||
form, | ||
name: 'name', | ||
defaultMeta: { isTouched: true }, | ||
}) | ||
field.setValue('other') | ||
expect(field.getValue()).toBe('other') | ||
expect(field.getMeta()).toEqual({ | ||
isTouched: true, | ||
isValidating: false, | ||
}) | ||
}) | ||
@@ -39,0 +49,0 @@ |
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
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
391367
4148