@felte/common
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -165,3 +165,3 @@ import { isFormControl, isFieldSetElement, isInputElement, isSelectElement } from './typeGuards.js'; | ||
for (const option of el.options) { | ||
if (option.value === fieldValue) { | ||
if (option.value === String(fieldValue)) { | ||
option.selected = true; | ||
@@ -176,4 +176,5 @@ } | ||
el.value = String((_a = fieldValue[0]) !== null && _a !== void 0 ? _a : ''); | ||
const stringValues = fieldValue.map((v) => String(v)); | ||
for (const option of el.options) { | ||
if (fieldValue.includes(option.value)) { | ||
if (stringValues.includes(option.value)) { | ||
option.selected = true; | ||
@@ -180,0 +181,0 @@ } |
@@ -1,2 +0,11 @@ | ||
import { Readable, Writable } from "svelte/store"; | ||
type Subscriber<T> = (value: T) => void; | ||
type Unsubscriber = () => void; | ||
type Updater<T> = (value: T) => T; | ||
type Readable<T> = { | ||
subscribe(this: void, run: Subscriber<T>): Unsubscriber; | ||
}; | ||
type Writable<T> = Readable<T> & { | ||
set(this: void, value: T): void; | ||
update(this: void, updater: Updater<T>): void; | ||
}; | ||
type RecursivePartial<T extends Record<string, any>> = { | ||
@@ -393,3 +402,3 @@ [P in keyof T]?: T[P] extends Record<string, any> | Array<any> ? RecursivePartial<T[P]> : T[P]; | ||
declare function setForm<Data extends Obj>(node: HTMLFormElement, data: Data): void; | ||
export { _some, _mapValues, isFieldValue, _cloneDeep, _isPlainObject, _mergeWith, _defaultsDeep, _merge, _get, _set, _unset, _update, deepSet, deepSome, getPath, shouldIgnore, getValue, mergeErrors, runValidations, executeTransforms, createId, isEqual, debounce, isInputElement, isTextAreaElement, isSelectElement, isFieldSetElement, isFormControl, isElement, getFormControls, addAttrsFromFieldset, getInputTextOrNumber, getFormDefaultValues, setControlValue, setForm, RecursivePartial, RecursiveRequired, ObjectSetter, UnknownObjectSetter, PartialErrorsSetter, PrimitiveSetter, FieldsSetter, UnknownFieldsSetter, Setter, DeepSetResult, CreateSubmitHandlerConfig, KnownHelpers, UnknownHelpers, Helpers, ValidatorOptions, AddValidatorFn, SetupCurrentForm, MountedCurrentForm, CurrentForm, OnSubmitErrorState, ExtenderHandler, Extender, Obj, FieldValue, FormControl, ValidationFunction, TransformFunction, SubmitContext, FormConfigWithoutTransformFn, FormConfigWithTransformFn, FormConfig, Errors, Keyed, AssignableErrors, Touched, FormAction, TransWritable, UnknownStores, KnownStores, PartialWritableErrors, KeyedWritable, Stores, Form, StoreFactory, Paths, Traverse }; | ||
export { _some, _mapValues, isFieldValue, _cloneDeep, _isPlainObject, _mergeWith, _defaultsDeep, _merge, _get, _set, _unset, _update, deepSet, deepSome, getPath, shouldIgnore, getValue, mergeErrors, runValidations, executeTransforms, createId, isEqual, debounce, isInputElement, isTextAreaElement, isSelectElement, isFieldSetElement, isFormControl, isElement, getFormControls, addAttrsFromFieldset, getInputTextOrNumber, getFormDefaultValues, setControlValue, setForm, Subscriber, Unsubscriber, Updater, Readable, Writable, RecursivePartial, RecursiveRequired, ObjectSetter, UnknownObjectSetter, PartialErrorsSetter, PrimitiveSetter, FieldsSetter, UnknownFieldsSetter, Setter, DeepSetResult, CreateSubmitHandlerConfig, KnownHelpers, UnknownHelpers, Helpers, ValidatorOptions, AddValidatorFn, SetupCurrentForm, MountedCurrentForm, CurrentForm, OnSubmitErrorState, ExtenderHandler, Extender, Obj, FieldValue, FormControl, ValidationFunction, TransformFunction, SubmitContext, FormConfigWithoutTransformFn, FormConfigWithTransformFn, FormConfig, Errors, Keyed, AssignableErrors, Touched, FormAction, TransWritable, UnknownStores, KnownStores, PartialWritableErrors, KeyedWritable, Stores, Form, StoreFactory, Paths, Traverse }; | ||
//# sourceMappingURL=index.cjs.d.ts.map |
@@ -25,3 +25,3 @@ export { _some } from "./utils/some"; | ||
export * from "./utils/domUtils"; | ||
export * from "./types-27598f9f"; | ||
export * from "./types-1a02b559"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _cloneDeep<T extends Obj>(obj: T): T; | ||
export { _cloneDeep }; |
@@ -1,2 +0,2 @@ | ||
import { Obj, DeepSetResult } from "../types-27598f9f"; | ||
import { Obj, DeepSetResult } from "../types-1a02b559"; | ||
/** | ||
@@ -3,0 +3,0 @@ * @category Helper |
@@ -1,2 +0,2 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** | ||
@@ -3,0 +3,0 @@ * @category Helper |
@@ -1,4 +0,4 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _defaultsDeep<T extends Obj>(...args: any[]): T; | ||
export { _defaultsDeep }; |
@@ -1,2 +0,2 @@ | ||
import { FormControl, Obj, FieldValue, Touched } from "../types-27598f9f"; | ||
import { FormControl, Obj, FieldValue, Touched } from "../types-1a02b559"; | ||
/** | ||
@@ -3,0 +3,0 @@ * @ignore |
@@ -1,3 +0,3 @@ | ||
import { Obj, TransformFunction } from "../types-27598f9f"; | ||
import { Obj, TransformFunction } from "../types-1a02b559"; | ||
declare function executeTransforms<Data extends Obj>(values: Obj, transforms?: TransformFunction<Data>[] | TransformFunction<Data>): ReturnType<TransformFunction<Data>>; | ||
export { executeTransforms }; |
@@ -1,4 +0,4 @@ | ||
import { Obj, ValidationFunction, RecursivePartial } from "../types-27598f9f"; | ||
import { Obj, ValidationFunction, RecursivePartial } from "../types-1a02b559"; | ||
declare function mergeErrors<Data extends Obj>(errors: (RecursivePartial<Data> | undefined)[]): Data; | ||
declare function runValidations<Data extends Obj>(values: Data, validationOrValidations?: ValidationFunction<Data>[] | ValidationFunction<Data>): ReturnType<ValidationFunction<Data>>[]; | ||
export { mergeErrors, runValidations }; |
@@ -1,4 +0,4 @@ | ||
import { Obj, FieldValue } from "../types-27598f9f"; | ||
import { Obj, FieldValue } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _get<Data extends Obj, Default = undefined>(obj: Data, path: string, defaultValue?: Default): Default | FieldValue | FieldValue[]; | ||
export { _get }; |
@@ -1,2 +0,2 @@ | ||
import { FormControl } from "../types-27598f9f"; | ||
import { FormControl } from "../types-1a02b559"; | ||
/** | ||
@@ -3,0 +3,0 @@ * @category Helper |
@@ -1,2 +0,2 @@ | ||
import { Paths, Traverse, Obj } from "../types-27598f9f"; | ||
import { Paths, Traverse, Obj } from "../types-1a02b559"; | ||
declare function getValue<T>(storeValue: T): T; | ||
@@ -3,0 +3,0 @@ declare function getValue<T extends Obj, R>(storeValue: T, selector: (value: T) => R): R; |
@@ -1,4 +0,4 @@ | ||
import { FieldValue } from "../types-27598f9f"; | ||
import { FieldValue } from "../types-1a02b559"; | ||
/** @category Helper */ | ||
declare function isFieldValue(value: unknown): value is FieldValue; | ||
export { isFieldValue }; |
@@ -1,4 +0,4 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _mapValues(obj: Obj, updater: (value: unknown) => unknown): Obj; | ||
export { _mapValues }; |
@@ -1,4 +0,4 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _merge<T extends Obj>(...args: any[]): T; | ||
export { _merge }; |
@@ -1,4 +0,4 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _set<Data extends Obj>(obj: Data | undefined, path: string | string[], value: any): Data; | ||
export { _set }; |
@@ -1,4 +0,4 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _some(obj: Obj, pred: (value: unknown) => boolean): boolean; | ||
export { _some }; |
@@ -1,2 +0,2 @@ | ||
import { FormControl } from "../types-27598f9f"; | ||
import { FormControl } from "../types-1a02b559"; | ||
/** | ||
@@ -3,0 +3,0 @@ * @category Helper |
@@ -1,2 +0,2 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
@@ -3,0 +3,0 @@ declare function _unset(obj: undefined, path: string | string[]): undefined; |
@@ -1,4 +0,4 @@ | ||
import { Obj } from "../types-27598f9f"; | ||
import { Obj } from "../types-1a02b559"; | ||
/** @ignore */ | ||
declare function _update<Data extends Obj>(obj: Data | undefined, path: string | string[], updater: (value: any) => any): Data; | ||
export { _update }; |
{ | ||
"name": "@felte/common", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Common utilities for Felte packages", | ||
@@ -5,0 +5,0 @@ "author": { |
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
207262
2156