@felte/core
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -15,3 +15,3 @@ import { isFormControl, isElement } from './packages/common/dist/esm/utils/typeGuards.js'; | ||
let control; | ||
let onReset; | ||
let onFormReset; | ||
if (typeof nameOrConfig === 'string') { | ||
@@ -21,3 +21,3 @@ name = nameOrConfig; | ||
touchOnChange = (_a = config === null || config === void 0 ? void 0 : config.touchOnChange) !== null && _a !== void 0 ? _a : false; | ||
onReset = config === null || config === void 0 ? void 0 : config.onReset; | ||
onFormReset = config === null || config === void 0 ? void 0 : config.onFormReset; | ||
} | ||
@@ -28,3 +28,3 @@ else { | ||
touchOnChange = (_b = nameOrConfig.touchOnChange) !== null && _b !== void 0 ? _b : false; | ||
onReset = nameOrConfig === null || nameOrConfig === void 0 ? void 0 : nameOrConfig.onReset; | ||
onFormReset = nameOrConfig === null || nameOrConfig === void 0 ? void 0 : nameOrConfig.onFormReset; | ||
} | ||
@@ -56,6 +56,6 @@ function dispatchEvent(eventType, value) { | ||
function handleReset(e) { | ||
if (!onReset) | ||
if (!onFormReset) | ||
return; | ||
setControlValue(control, defaultValue); | ||
onReset(e); | ||
onFormReset(e); | ||
} | ||
@@ -62,0 +62,0 @@ function field(node) { |
@@ -6,3 +6,3 @@ import { FieldValue } from '@felte/common'; | ||
defaultValue?: FieldValue; | ||
onReset?(e: ResetEvent): void; | ||
onFormReset?(e: ResetEvent): void; | ||
}; | ||
@@ -9,0 +9,0 @@ type Field = { |
@@ -20,3 +20,3 @@ import { Readable } from "svelte/store"; | ||
defaultValue?: FieldValue; | ||
onReset?(e: ResetEvent): void; | ||
onFormReset?(e: ResetEvent): void; | ||
}; | ||
@@ -23,0 +23,0 @@ type Field = { |
{ | ||
"name": "@felte/core", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Core utility for Felte's integration with front-end frameworks", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.cjs", |
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
450228