@vizejs/composable 0.808.0 → 0.810.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{use-form-C2JXZ0i7.mjs → use-form-A4j_h14D.mjs} +168 -27
- package/dist/use-form.d.mts +123 -18
- package/dist/use-form.mjs +1 -1
- package/package.json +2 -2
- package/registry/files/form-control-types.ts +260 -0
- package/registry/files/form-dirty.ts +131 -0
- package/registry/files/form-options.ts +156 -0
- package/registry/files/form-path-types.ts +135 -0
- package/registry/files/use-form.ts +102 -449
- package/registry/registry.json +28 -4
package/dist/index.d.mts
CHANGED
|
@@ -107,7 +107,7 @@ import { FetchAfterResponseContext, FetchBeforeRequestContext, FetchControls, Fe
|
|
|
107
107
|
import { FieldControls, FieldRule, FieldRuleContext, FieldRuleResult, FieldRuleSource, FieldValidationTrigger, UseFieldOptions, useField } from "./use-field.mjs";
|
|
108
108
|
import { FileDialogCapture, FileDialogControls, FileDialogHost, FileDialogSettings, FileInputLike, UseFileDialogOptions, useFileDialog } from "./use-file-dialog.mjs";
|
|
109
109
|
import { FilePickerAcceptTypeLike, FileSystemAccessControls, FileSystemAccessDataMap, FileSystemAccessDataType, FileSystemAccessHost, FileSystemAccessResult, FileSystemFileHandleLike, FileSystemWritableLike, OpenFilePickerOptionsLike, SaveFilePickerOptionsLike, UseFileSystemAccessOptions, useFileSystemAccess } from "./use-file-system-access.mjs";
|
|
110
|
-
import { FieldValidator, FieldValidatorContext, FormArrayEntry, FormArrayItem, FormArrayPath, FormControls, FormErrorRecord, FormErrors, FormFieldArrayControls, FormFieldControls, FormFieldValidators, FormLeaf, FormPath, FormPathValue, FormResult, FormValidationTrigger, FormValidator, SetFieldValueOptions, UseFormOptions, ValidatorResult, useForm } from "./use-form.mjs";
|
|
110
|
+
import { DirtyFields, DirtyNode, FieldValidator, FieldValidatorContext, FormArrayEntry, FormArrayItem, FormArrayPath, FormControls, FormCriteriaMode, FormErrorRecord, FormErrors, FormFieldArrayControls, FormFieldControls, FormFieldValidators, FormLeaf, FormPath, FormPathValue, FormResetOptions, FormResult, FormValidationTrigger, FormValidator, SetFieldValueOptions, UseFormOptions, ValidatorResult, useForm } from "./use-form.mjs";
|
|
111
111
|
import { FormErrorSummaryItem, FormFieldControlProps, FormFieldErrorEntry, FormFieldErrorVisibility, FormFieldLabelProps, FormFieldModelProps, FormFieldPropsControls, FormFieldTextProps, UseFormErrorSummaryFieldsOptions, UseFormFieldPropsOptions, formFieldId, toFormFieldErrors, useFormErrorSummaryFields, useFormFieldProps } from "./use-form-field-props.mjs";
|
|
112
112
|
import { FullscreenControls, FullscreenElementLike, FullscreenHost, FullscreenNavigationUI, UseFullscreenOptions, useFullscreen } from "./use-fullscreen.mjs";
|
|
113
113
|
import { ConnectedGamepad, GamepadAxisBinding, GamepadButtonBinding, GamepadButtonLike, GamepadButtonState, GamepadControls, GamepadHost, GamepadLike, GamepadMapping, GamepadSnapshot, GamepadVibrationActuatorLike, GamepadVibrationParams, MappedGamepad, UseGamepadOptions, mapGamepad, snapshotGamepad, standardGamepadAxes, standardGamepadButtons, useGamepad } from "./use-gamepad.mjs";
|
|
@@ -183,4 +183,4 @@ import { WatchThrottledOptions, watchThrottled } from "./watch-throttled.mjs";
|
|
|
183
183
|
import { Falsy, WheneverOptions, whenever } from "./whenever.mjs";
|
|
184
184
|
import { UseWindowSizeOptions, WindowSizeControls, WindowSizeHost, WindowSizeKind, useWindowSize } from "./window-size.mjs";
|
|
185
185
|
import { UseVisualViewportOptions, VirtualKeyboardHost, VisualViewportControls, VisualViewportHost, VisualViewportWindowHost, useVisualViewport } from "./use-visual-viewport.mjs";
|
|
186
|
-
export { ActiveElementHost, AnimatableCssProperty, AnimateControls, AnimateFrameHost, AnimationFrameHost, AnimationKeyframes, ArrayCallback, AsyncQueue, AsyncQueueContext, AsyncQueuePrevious, AsyncQueueTask, AsyncQueueTaskResult, AsyncQueueTaskState, AsyncQueueTasks, AsyncResource, AsyncResourceContext, AsyncResourceExecution, AsyncResourceStatus, AsyncState, AuthenticationCredentialLike, AuthenticationResponseJSON, AvailableCapability, BarcodeBoundingBox, BarcodeDetectorControls, BarcodeDetectorHost, BarcodeDetectorLike, BarcodeFormat, BarcodePoint, BasicColorMode, BatteryControls, BatteryHost, BatteryManagerLike, BluetoothCharacteristicLike, BluetoothControls, BluetoothDeviceFilter, BluetoothDeviceLike, BluetoothGATTServerLike, BluetoothHost, BluetoothNotificationStop, BluetoothRequestOptions, BluetoothServiceLike, BluetoothUUIDLike, BreakpointValue, Breakpoints, BreakpointsControls, BroadcastChannelConstructor, BroadcastChannelControls, BroadcastChannelErrorCode, BroadcastChannelFailure, BroadcastChannelHost, BroadcastChannelLike, BuiltinAiAvailability, BuiltinAiCreateMonitorOptions, BuiltinAiDownloadProgressEvent, BuiltinAiMonitorLike, BuiltinAiSessionControls, BuiltinAiStatus, BuiltinAiTextStream, COMPOSABLE_CATALOG, COOKIE_ADAPTER_KEY, CapabilityResult, CapabilitySource, CapabilityTarget, CapabilityUnavailableReason, CleanupRegistration, ClickOutsideHost, ClickOutsideIgnore, ClipboardControls, ClipboardFailure, ClipboardFailureReason, ClipboardHost, ClipboardItemLike, ClipboardLike, ClipboardResult, ClipboardSuccess, ColorModeControls, ColorModeStorage, ColorModeValue, ColorSchemePreference, type ComposableCatalog, type ComposableCategory, type ComposableCleanupOwner, type ComposableEntryMetadata, type ComposableHydrationBehavior, type ComposableInstallationAvailability, type ComposableRootEntryMetadata, type ComposableSsrBehavior, type ComposableStability, type ComposableUtilityMetadata, CompressOptions, CompressionFormatName, CompressionInput, CompressionStreamConstructor, CompressionStreamControls, CompressionTransformLike, ComputedAsyncCancel, ComputedAsyncContext, ComputedAsyncOptions, ComputedWithControl, ComputedWithControlOptions, ComputedWithControlSource, ConfirmDialog, ConfirmDialogPayload, ConfirmDialogResult, ConfirmDialogState, ConnectedGamepad, ContactAddressLike, ContactInfo, ContactPickerControls, ContactPickerResult, ContactProperty, ContactSelectOptions, ContactsManagerLike, ContrastPreference, CookieAdapter, CookieAttributes, CookieControls, CookieErrorCode, CookieFailure, CookieSameSite, CookieSerializer, CountdownControls, CounterControls, CreateDisposalScopeOptions, CreateEventHookOptions, CreateGlobalStateOptions, CreateI18nOptions, CreateInjectionStateOptions, CreateSharedComposableOptions, CssVarControls, CssVarHost, CssVarObserver, CssVarStyle, CssVarTarget, CubicBezierPoints, CustomSearchParam, CycleList, DEFAULT_IDLE_EVENTS, DEFAULT_KEY_ALIASES, DISPOSAL_ERROR_CODE, DataTransferItemLike, DataTransferLike, DateFormatInput, DateFormatToken, DateTimeFormatControls, DeadlineAbortSignalOptions, DebouncedControls, DecompressOptions, DefineI18nOptions, DetectedBarcode, DetectedBarcodeLike, DeviceMotionControls, DeviceMotionHost, DeviceOrientationControls, DeviceOrientationHost, DevicePixelRatioControls, DevicePixelRatioHost, DisplayMediaHost, DisplayNamesControls, DisplayNamesKind, DisposalError, DisposalScope, DocumentTitleControls, DocumentTitleHost, DocumentTitleRestore, DocumentTitleTemplate, DocumentVisibilityControls, DocumentVisibilityHost, DragAxis, DragBounds, DraggableControls, DropZoneAccept, DropZoneControls, DropZoneFileInfo, ElementBoundingControls, ElementBoundingHost, ElementBoundingRect, ElementByPointControls, ElementByPointFrameHost, ElementByPointHost, ElementRefControls, ElementRefSetter, ElementSize, ElementSizeControls, ElementTargetValue, ElementTimingEntryLike, ElementVisibilityControls, EventHook, EventHookListener, EventHookSubscription, EventListenerControls, EventSourceConstructorLike, EventSourceControls, EventSourceEventMap, EventSourceFailure, EventSourceLike, EventSourceMessage, EventSourceParseRequirement, EventSourceParsers, EventSourceReconnectOptions, EventSourceStatus, EventTimingEntryLike, EventTimingFieldsLike, EyeDropperColor, EyeDropperControls, EyeDropperHost, EyeDropperLike, EyeDropperResult, Falsy, FaviconControls, FaviconHost, FaviconLink, FetchAfterResponseContext, FetchBeforeRequestContext, FetchControls, FetchFailure, FetchImplementation, FetchRequest, FetchResponseType, FetchResponseTypeMap, FetchResult, FetchRetryOptions, FetchStatus, FieldControls, FieldRule, FieldRuleContext, FieldRuleResult, FieldRuleSource, FieldValidationTrigger, FieldValidator, FieldValidatorContext, FileDialogCapture, FileDialogControls, FileDialogHost, FileDialogSettings, FileInputLike, FilePickerAcceptTypeLike, FileSystemAccessControls, FileSystemAccessDataMap, FileSystemAccessDataType, FileSystemAccessHost, FileSystemAccessResult, FileSystemFileHandleLike, FileSystemWritableLike, FirstInputEntryLike, FocusControls, FocusWithinControls, FocusableElement, FormArrayEntry, FormArrayItem, FormArrayPath, FormControls, FormErrorRecord, FormErrorSummaryItem, FormErrors, FormFieldArrayControls, FormFieldControlProps, FormFieldControls, FormFieldErrorEntry, FormFieldErrorVisibility, FormFieldLabelProps, FormFieldModelProps, FormFieldPropsControls, FormFieldTextProps, FormFieldValidators, FormLeaf, FormPath, FormPathValue, FormResult, FormValidationTrigger, FormValidator, FormatDateOptions, FormatMessageOptions, FormatTimeAgoOptions, FormattableDate, FormattableNumber, FpsControls, FrameScheduler, FullscreenControls, FullscreenElementLike, FullscreenHost, FullscreenNavigationUI, GamepadAxisBinding, GamepadButtonBinding, GamepadButtonLike, GamepadButtonState, GamepadControls, GamepadHost, GamepadLike, GamepadMapping, GamepadSnapshot, GamepadVibrationActuatorLike, GamepadVibrationParams, GeolocationControls, GeolocationCoordinatesSnapshot, GeolocationHost, GeolocationUnavailableReason, HIDControls, HIDDeviceFilter, HIDDeviceInfo, HIDDeviceLike, HIDHost, HIDInputReport, HasNoParams, HistoryControls, I18n, I18nDefinition, IdGenerator, IdleCallbackHost, IdleControls, IdleDeadlineLike, IdleHost, IdleOptions, IdleSchedulingOptions, IgnorableWatchHandle, ImageControls, ImageHost, ImageLike, ImageLoadResult, ImageSource, ImageStatus, IndexedDBControls, IndexedDBDatabaseLike, IndexedDBErrorCode, IndexedDBFactoryLike, IndexedDBFailure, IndexedDBKeyval, IndexedDBKeyvalOptions, IndexedDBObjectStoreLike, IndexedDBRequestLike, IndexedDBTransactionLike, IndexedKeyframeValue, InferSearchParams, InferStandardSchemaInput, InferStandardSchemaOutput, InfiniteScrollControls, InfiniteScrollDirection, InjectionState, IntersectionObserverControls, IntersectionObserverHost, IntersectionRoot, IntervalControls, IntervalScheduler, KeyCombo, KeyFilter, KeyStrokeEventName, LanguageDetectionResult, LanguageDetectorControls, LanguageDetectorCreateOptions, LanguageDetectorHost, LanguageDetectorLike, LargestContentfulPaintEntryLike, LayoutShiftEntryLike, ListFormatControls, LocaleControls, LocaleLoader, LocaleMessages, LockManagerLike, LongAnimationFrameEntryLike, LongPressModifiers, LongPressRelease, LongTaskEntryLike, MIDIAccessLike, MIDIAccessStatus, MIDIHost, MIDIInputMessage, MIDIOutputLike, MIDIPortInfo, MIDIPortLike, MIDIRequestFlags, Machine, MachineConfig, MachineStateNode, MachineTransition, MagicKeys, MapControls, MappedGamepad, MarkEntryLike, MaybeElementTarget, MaybeElementTargets, MeasureEntryLike, MediaControls, MediaDeviceInfoLike, MediaElementLike, MediaQueryHost, MediaSourceCandidate, MediaStreamControls, MediaStreamErrorCode, MediaStreamFailure, MediaStreamLike, MediaStreamSource, MediaStreamStatus, MediaStreamTrackLike, MediaTextTrack, MemoizeCache, Memoized, MessageArgument, MessageArguments, MessageAt, MessageCatalogs, MessageFormatter, MessageKey, MessageKeysOf, MessageNode, MessageParams, MessageParamsFor, MessageShape, MessageSyntaxError, MessageSyntaxErrorCode, MessageTree, ModifierKeyName, MotionPermissionConstructor, MotionPermissionState, MotionPreference, MotionRotationRate, MotionVector, MouseControls, MouseCoordinateExtractor, MouseCoordinateType, MouseInElementControls, MouseSourceType, MutationObserverControls, MutationObserverHost, NaturallyOrdered, NavigateEventLike, NavigationApiControls, NavigationDestinationLike, NavigationEntryChange, NavigationEntrySnapshot, NavigationEventName, NavigationHistoryEntryLike, NavigationHistoryMode, NavigationHost, NavigationInterceptInit, NavigationInterceptOptions, NavigationNavigateOptions, NavigationOutcome, NavigationResultLike, NavigationTimingEntryLike, NavigationTransitionSnapshot, NavigationTypeName, NetworkConnectionType, NetworkControls, NetworkEffectiveType, NetworkHost, NetworkInformationLike, NormalizedSchemaIssue, NormalizedSchemaResult, NotificationHost, NotificationLike, NotificationOptionsLike, NotificationPermissionState, NowControls, NumberFormatControls, ObjectUrlHost, ObjectUrlSource, OffsetPagination, OffsetPaginationInfo, OnClickOutsideOptions, OnKeyStrokeOptions, OnLongPressOptions, OnStartTypingOptions, OpenFilePickerOptionsLike, OpenOnScreenOptions, PageVisibilityState, PaintEntryLike, PausableControls, PausableWatchHandle, PaymentAmount, PaymentCompletion, PaymentDetails, PaymentDetailsUpdate, PaymentLineItem, PaymentMethod, PaymentRequestControls, PaymentRequestHost, PaymentRequestLike, PaymentRequestOptionsInit, PaymentRequestState, PaymentResponseLike, PaymentShippingChange, PaymentShippingChangeHook, PaymentShippingOption, PaymentShippingType, PaymentShowResult, PerformanceEntryLike, PerformanceEntryType, PerformanceEntryTypeMap, PerformanceObserveInit, PerformanceObserverCallback, PerformanceObserverControls, PerformanceObserverEntryListLike, PerformanceObserverHost, PerformanceObserverLike, PermissionControls, PermissionDescriptorLike, PermissionQueryState, PermissionStatusLike, PermissionsHost, PersistentStorageControls, PictureInPictureDocumentLike, PinchControls, PinchSnapshot, PluralCategory, PluralMessage, PluralMessages, PluralRulesControls, Point, PointerControls, PointerKind, PointerLockControls, PointerLockError, PointerLockErrorCode, PointerLockHost, PointerState, PostTaskCallOptions, PreferredLanguagesHost, ProjectionDomain, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialDescriptorJSON, PublicKeyCredentialLike, PublicKeyCredentialRequestOptionsJSON, PublicKeyCredentialStatics, PushManagerLike, PushManagerSubscribeOptions, PushPermissionState, PushRegistrationLike, PushSubscribeOptions, PushSubscriptionControls, PushSubscriptionJsonLike, PushSubscriptionLike, PushSubscriptionSnapshot, QueryParser, QuerySerializer, QueueControls, QueueOverflowPolicy, RafFrame, RawQueryValue, Reactified, ReactifiedArguments, RefAutoResetOptions, RegistrationCredentialLike, RegistrationResponseJSON, RelativeTimeFormatControls, RelativeTimeFromOptions, RelativeTimeUnitSelection, RelativeTimeValue, RequestIdleCallbackControls, ReservedBreakpointName, ResizeObserverControls, ResizeObserverHost, ResolveMessageArguments, ResourceTimingEntryLike, ResourceTimingFieldsLike, RetryAsyncOptions, RetryAttemptContext, RetryDelayOptions, RetryFailureContext, RetryScheduledContext, RoundingMethod, RouteLocationLike, RouteParamsOf, RouteQueryRecord, SaveFilePickerOptionsLike, SchedulerHost, SchedulerPostTaskControls, SchedulerPostTaskInit, SchedulerTaskPriority, ScreenArea, ScreenDetailedLike, ScreenDetailsControls, ScreenDetailsHost, ScreenDetailsLike, ScreenDetailsResult, ScreenOrientationControls, ScreenOrientationHost, ScreenOrientationLike, ScreenOrientationLockType, ScreenSnapshot, ScriptTagControls, ScriptTagElement, ScriptTagHost, ScriptTagResult, ScriptTagStatus, ScrollControls, ScrollEdges, ScrollMetrics, ScrollOffset, ScrollTargetValue, ScrollWindowHost, SearchParamCodec, SearchParamSchema, SegmenterControls, SegmenterGranularity, SelectedContact, Selection, SerialChunk, SerialControls, SerialDecoding, SerialHost, SerialOpenOptions, SerialPortFilter, SerialPortLike, SerializeSearchParamsOptions, ServiceWorkerContainerLike, ServiceWorkerControls, ServiceWorkerLike, ServiceWorkerRegisterOptions, ServiceWorkerRegistrationLike, ServiceWorkerStateName, ServiceWorkerStates, SetControls, SetFieldValueOptions, ShareControls, ShareDataLike, ShareHost, ShareResult, SortComparator, SortedLocaleControls, SpeechRecognitionAlternativeLike, SpeechRecognitionControls, SpeechRecognitionErrorCode, SpeechRecognitionFailure, SpeechRecognitionHost, SpeechRecognitionLike, SpeechRecognitionResultLike, SpeechRecognitionResultListLike, SpeechSynthesisControls, SpeechSynthesisErrorCode, SpeechSynthesisHost, SpeechSynthesisLike, SpeechSynthesisStatus, SpeechSynthesisUtteranceLike, SpeechSynthesisVoiceLike, StackControls, StackOverflowPolicy, StandardSchemaFailure, StandardSchemaIssue, StandardSchemaPathSegment, StandardSchemaProps, StandardSchemaResult, StandardSchemaSuccess, StandardSchemaV1, StartTypingHost, StartViewTransitionArgument, StepValues, Stepper, StorageControls, StorageErrorCode, StorageEstimateControls, StorageEstimateLike, StorageFailure, StorageLike, StorageManagerLike, StorageSerializer, StorageSerializerKind, StorageValidator, StringQueryOptions, StyleTagControls, StyleTagElement, StyleTagHost, SummarizeCallOptions, SummarizerControls, SummarizerCreateOptions, SummarizerFormat, SummarizerHost, SummarizerLength, SummarizerLike, SummarizerType, SwipeCallbacks, SwipeControls, SwipeDirection, SyncRefBaseOptions, SyncRefDirection, SyncRefOptions, SyncRefTransform, TaskControllerHost, TaskControllerLike, TextDirection, TextSegment, TextSelectionControls, TextSelectionHost, TextTrackLike, TextTrackListLike, TextareaAutosizeControls, TextareaAutosizeStyleProperty, ThrottledControls, TimeAgoControls, TimeAgoInput, TimeAgoUnit, TimeRangesLike, TimedWatchHandle, TimeoutAbortSignalOptions, TimeoutControls, TimeoutFnControls, TimeoutScheduler, TimestampControls, ToggleControls, TransitionEasing, TransitionFrameHost, TransitionPresetName, TransitionPresets, TransitionTupleOutput, TransitionValue, TranslateArguments, TranslatorControls, TranslatorHost, TranslatorLanguages, TranslatorLike, TypedKeyframe, TypedPropertyIndexedKeyframes, USBControlTransferSetup, USBControls, USBDeviceFilter, USBDeviceInfo, USBDeviceLike, USBHost, USBInTransferResultLike, USBOutTransferResultLike, USBTransferStatus, UnavailableCapability, UntilChain, UntilMatchers, UntilNegatedMatchers, UntilOptions, UntilTimeoutCode, UntilTimeoutError, UrlHashControls, UrlHashHost, UrlHistoryMode, UrlSearchParamsControls, UrlSearchParamsHost, UseActiveElementOptions, UseAnimateOptions, UseAsyncQueueOptions, UseAsyncResourceOptions, UseAsyncStateOptions, UseBarcodeDetectorOptions, UseBatteryOptions, UseBluetoothOptions, UseBreakpointsOptions, UseBroadcastChannelOptions, UseClipboardOptions, UseColorModeOptions, UseCompressionStreamOptions, UseContactPickerOptions, UseCookieOptions, UseCountdownOptions, UseCounterOptions, UseCssVarOptions, UseCycleListOptions, UseDarkOptions, UseDateFormatOptions, UseDateTimeFormatOptions, UseDebouncedOptions, UseDeviceMotionOptions, UseDeviceOrientationOptions, UseDevicePixelRatioOptions, UseDisplayMediaOptions, UseDisplayNamesOptions, UseDocumentTitleOptions, UseDocumentVisibilityOptions, UseDraggableOptions, UseDropZoneOptions, UseElementBoundingOptions, UseElementByPointOptions, UseElementHoverOptions, UseElementSizeOptions, UseElementVisibilityOptions, UseEventListenerOptions, UseEventSourceOptions, UseEyeDropperOptions, UseFaviconOptions, UseFetchOptions, UseFieldOptions, UseFileDialogOptions, UseFileSystemAccessOptions, UseFocusOptions, UseFormErrorSummaryFieldsOptions, UseFormFieldPropsOptions, UseFormOptions, UseFpsOptions, UseFullscreenOptions, UseGamepadOptions, UseGeolocationOptions, UseHIDOptions, UseHistoryOptions, UseIdGeneratorOptions, UseIdleOptions, UseImageOptions, UseIndexedDBOptions, UseInfiniteScrollOptions, UseIntersectionObserverOptions, UseIntervalFnOptions, UseIntervalOptions, UseKeyboardTargetOptions, UseLanguageDetectorOptions, UseListFormatOptions, UseLocaleOptions, UseMagicKeysOptions, UseMediaControlsOptions, UseMediaQueryOptions, UseMediaStreamOptions, UseMemoizeOptions, UseMouseInElementOptions, UseMouseOptions, UseMutationObserverOptions, UseNavigationApiOptions, UseNetworkOptions, UseNowOptions, UseNumberFormatOptions, UseObjectUrlOptions, UseOffsetPaginationOptions, UsePageLeaveOptions, UsePaymentRequestOptions, UsePerformanceObserverOptions, UsePermissionOptions, UsePersistentStorageOptions, UsePinchOptions, UsePluralRulesOptions, UsePointerLockOptions, UsePointerOptions, UsePointerSwipeOptions, UsePreferenceOptions, UsePreferredLanguagesOptions, UseProjectionOptions, UsePushSubscriptionOptions, UseQueueOptions, UseRafFnOptions, UseRelativeTimeFormatOptions, UseRequestIdleCallbackOptions, UseResizeObserverOptions, UseRoundOptions, UseRouteQueryOptions, UseSchedulerPostTaskOptions, UseScreenDetailsOptions, UseScreenOrientationOptions, UseScriptTagOptions, UseScrollLockOptions, UseScrollOptions, UseSegmenterOptions, UseSelectionOptions, UseSerialOptions, UseServiceWorkerOptions, UseShareOptions, UseSortedLocaleOptions, UseSpeechRecognitionOptions, UseSpeechSynthesisOptions, UseStackOptions, UseStorageEstimateOptions, UseStorageOptions, UseStyleTagOptions, UseSummarizerOptions, UseSwipeOptions, UseTextSelectionOptions, UseTextareaAutosizeOptions, UseThrottledOptions, UseTimeAgoOptions, UseTimeoutFnOptions, UseTimeoutOptions, UseTimestampOptions, UseTransitionOptions, UseTranslatorOptions, UseTypedUrlHashOptions, UseUSBOptions, UseUrlHashOptions, UseUrlSearchParamsOptions, UseUserActivationOptions, UseUserMediaOptions, UseVModelOptions, UseVModelsOptions, UseVibrateOptions, UseViewTransitionOptions, UseVirtualListOptions, UseVisualViewportOptions, UseWakeLockOptions, UseWebAuthnOptions, UseWebLocksOptions, UseWebMIDIOptions, UseWebNotificationOptions, UseWebSocketOptions, UseWebVitalsOptions, UseWindowScrollOptions, UseWindowSizeOptions, UseWorkerFnOptions, UserActivationControls, UserActivationLike, UserMediaControls, UserMediaHost, VModelEmit, VModelValue, VModelsEmit, ValidateCatalogs, ValidatorResult, VibrateControls, VibrationHost, VibrationPattern, ViewTransitionControls, ViewTransitionDocumentHost, ViewTransitionLike, ViewTransitionStartOptions, VirtualContainerStyle, VirtualItemSize, VirtualKeyboardHost, VirtualListControls, VirtualListItem, VirtualListOrientation, VirtualWrapperStyle, VisualViewportControls, VisualViewportHost, VisualViewportWindowHost, WEB_VITALS_THRESHOLDS, WakeLockControls, WakeLockHost, WakeLockKind, WakeLockSentinelLike, WatchCleanupRegistrar, WatchDebouncedOptions, WatchHelperCallback, WatchOldValue, WatchOnceOptions, WatchPausableOptions, WatchSourceInput, WatchSourceValue, WatchSources, WatchThrottledOptions, WatchValue, WebAuthnAttestation, WebAuthnAuthenticatorAttachment, WebAuthnAuthenticatorSelection, WebAuthnCeremonyOptions, WebAuthnControls, WebAuthnCreationInit, WebAuthnCredentialDescriptor, WebAuthnCredentialParameter, WebAuthnCredentialsHost, WebAuthnHint, WebAuthnMediation, WebAuthnRelyingParty, WebAuthnRequestInit, WebAuthnResidentKey, WebAuthnResult, WebAuthnTransport, WebAuthnUserVerification, WebLockAttempt, WebLockInfo, WebLockLike, WebLockManagerRequestOptions, WebLockMode, WebLockRequest, WebLockRequestOptions, WebLocksControls, WebLocksSnapshot, WebMIDIControls, WebNotificationControls, WebNotificationDefaults, WebNotificationEvent, WebNotificationResult, WebSocketCodecRequirements, WebSocketConstructorLike, WebSocketControls, WebSocketFailure, WebSocketHeartbeatOptions, WebSocketLike, WebSocketRawData, WebSocketReconnectOptions, WebSocketSendData, WebSocketStatus, WebVitalMetric, WebVitalName, WebVitalRating, WebVitalsControls, WebVitalsDocumentEvent, WebVitalsDocumentHost, WebVitalsRecord, WellKnownPermissionName, WheneverOptions, WindowPlacement, WindowPlacementOptions, WindowSizeControls, WindowSizeHost, WindowSizeKind, WorkerConstructorLike, WorkerFnControls, WorkerFnErrorCode, WorkerFnHost, WorkerFnStatus, WorkerLike, anyAbortSignal, availableCapability, breakpointsBootstrapV5, breakpointsTailwind, calculateRetryDelay, compress, computedAsync, computedWithControl, createDisposalScope, createEventHook, createGlobalState, createIndexedDBKeyval, createInjectionState, createMessageFormatter, createSharedComposable, createWorkerFnScript, cubicBezier, deadlineAbortSignal, decodeBase64Url, decompress, decompressText, defineI18n, defineLocale, defineMessages, encodeBase64Url, formFieldId, formatDate, formatMessage, formatSchemaPath, formatTimeAgo, idle, inferStorageSerializerKind, isCapabilityAvailable, isCapabilityUnavailable, isElementNode, isStandardSchema, isTypingKeystroke, mapGamepad, matchesAccept, normalizeKeyName, onClickOutside, onKeyDown, onKeyStroke, onKeyUp, onLongPress, onStartTyping, oneOf, parseCookieHeader, parseCreationOptionsFromJSON, parseMessage, parseRequestOptionsFromJSON, parseSearchParams, placeWindow, provideCookieAdapter, queryParsers, rateMetric, reactify, refAutoReset, refDebounced, refDefault, requestMotionPermission, resolveElement, resolveElements, retryAsync, searchParam, selectRelativeTimeUnit, serializeAuthenticationCredential, serializeCookie, serializeRegistrationCredential, serializeSearchParams, snapshotGamepad, snapshotScreen, standardGamepadAxes, standardGamepadButtons, storageSerializers, swipeDirection, syncRef, timeoutAbortSignal, toFormFieldErrors, toPixels, toPointerKind, toReactive, tryOnScopeDispose, unavailableCapability, until, useActiveElement, useAnimate, useArrayEvery, useArrayFilter, useArrayFind, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useAsyncQueue, useAsyncResource, useAsyncState, useBarcodeDetector, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useClamp, useClipboard, useColorMode, useCompressionStream, useConfirmDialog, useContactPicker, useCookie, useCountdown, useCounter, useCssVar, useCycleList, useDark, useDateFormat, useDateTimeFormat, useDebounced, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDisplayMedia, useDisplayNames, useDocumentTitle, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementRef, useElementSize, useElementVisibility, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useField, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useForm, useFormErrorSummaryFields, useFormFieldProps, useFps, useFullscreen, useGamepad, useGeolocation, useHID, useHistory, useI18n, useIdGenerator, useIdle, useImage, useIndexedDB, useInfiniteScroll, useIntersectionObserver, useInterval, useIntervalFn, useKeyPressed, useLanguageDetector, useListFormat, useLocalStorage, useLocale, useMachine, useMagicKeys, useMap, useMediaControls, useMediaQuery, useMediaStream, useMemoize, useMounted, useMouse, useMouseInElement, useMutationObserver, useNavigationApi, useNetwork, useNow, useNumberFormat, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParentElement, usePaymentRequest, usePerformanceObserver, usePermission, usePersistentStorage, usePinch, usePluralRules, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedTransparency, usePrevious, useProjection, usePushSubscription, useQueue, useRafFn, useReducedMotion, useRelativeTimeFormat, useRequestIdleCallback, useResizeObserver, useRound, useRouteParams, useRouteQuery, useSchedulerPostTask, useScreenDetails, useScreenOrientation, useScriptTag, useScroll, useScrollLock, useSegmenter, useSelection, useSerial, useServiceWorker, useSessionStorage, useSet, useShare, useSorted, useSortedLocale, useSpeechRecognition, useSpeechSynthesis, useStack, useStepper, useStorage, useStorageEstimate, useStyleTag, useSummarizer, useSupported, useSwipe, useTextSelection, useTextareaAutosize, useThrottled, useTimeAgo, useTimeout, useTimeoutFn, useTimestamp, useToggle, useTransition, useTranslator, useUSB, useUrlHash, useUrlSearchParams, useUserActivation, useUserMedia, useVModel, useVModels, useVibrate, useViewTransition, useVirtualList, useVisualViewport, useWakeLock, useWebAuthn, useWebLocks, useWebMIDI, useWebNotification, useWebSocket, useWebVitals, useWindowScroll, useWindowSize, useWorkerFn, validateStandardSchema, watchDebounced, watchIgnorable, watchOnce, watchPausable, watchThrottled, whenever };
|
|
186
|
+
export { ActiveElementHost, AnimatableCssProperty, AnimateControls, AnimateFrameHost, AnimationFrameHost, AnimationKeyframes, ArrayCallback, AsyncQueue, AsyncQueueContext, AsyncQueuePrevious, AsyncQueueTask, AsyncQueueTaskResult, AsyncQueueTaskState, AsyncQueueTasks, AsyncResource, AsyncResourceContext, AsyncResourceExecution, AsyncResourceStatus, AsyncState, AuthenticationCredentialLike, AuthenticationResponseJSON, AvailableCapability, BarcodeBoundingBox, BarcodeDetectorControls, BarcodeDetectorHost, BarcodeDetectorLike, BarcodeFormat, BarcodePoint, BasicColorMode, BatteryControls, BatteryHost, BatteryManagerLike, BluetoothCharacteristicLike, BluetoothControls, BluetoothDeviceFilter, BluetoothDeviceLike, BluetoothGATTServerLike, BluetoothHost, BluetoothNotificationStop, BluetoothRequestOptions, BluetoothServiceLike, BluetoothUUIDLike, BreakpointValue, Breakpoints, BreakpointsControls, BroadcastChannelConstructor, BroadcastChannelControls, BroadcastChannelErrorCode, BroadcastChannelFailure, BroadcastChannelHost, BroadcastChannelLike, BuiltinAiAvailability, BuiltinAiCreateMonitorOptions, BuiltinAiDownloadProgressEvent, BuiltinAiMonitorLike, BuiltinAiSessionControls, BuiltinAiStatus, BuiltinAiTextStream, COMPOSABLE_CATALOG, COOKIE_ADAPTER_KEY, CapabilityResult, CapabilitySource, CapabilityTarget, CapabilityUnavailableReason, CleanupRegistration, ClickOutsideHost, ClickOutsideIgnore, ClipboardControls, ClipboardFailure, ClipboardFailureReason, ClipboardHost, ClipboardItemLike, ClipboardLike, ClipboardResult, ClipboardSuccess, ColorModeControls, ColorModeStorage, ColorModeValue, ColorSchemePreference, type ComposableCatalog, type ComposableCategory, type ComposableCleanupOwner, type ComposableEntryMetadata, type ComposableHydrationBehavior, type ComposableInstallationAvailability, type ComposableRootEntryMetadata, type ComposableSsrBehavior, type ComposableStability, type ComposableUtilityMetadata, CompressOptions, CompressionFormatName, CompressionInput, CompressionStreamConstructor, CompressionStreamControls, CompressionTransformLike, ComputedAsyncCancel, ComputedAsyncContext, ComputedAsyncOptions, ComputedWithControl, ComputedWithControlOptions, ComputedWithControlSource, ConfirmDialog, ConfirmDialogPayload, ConfirmDialogResult, ConfirmDialogState, ConnectedGamepad, ContactAddressLike, ContactInfo, ContactPickerControls, ContactPickerResult, ContactProperty, ContactSelectOptions, ContactsManagerLike, ContrastPreference, CookieAdapter, CookieAttributes, CookieControls, CookieErrorCode, CookieFailure, CookieSameSite, CookieSerializer, CountdownControls, CounterControls, CreateDisposalScopeOptions, CreateEventHookOptions, CreateGlobalStateOptions, CreateI18nOptions, CreateInjectionStateOptions, CreateSharedComposableOptions, CssVarControls, CssVarHost, CssVarObserver, CssVarStyle, CssVarTarget, CubicBezierPoints, CustomSearchParam, CycleList, DEFAULT_IDLE_EVENTS, DEFAULT_KEY_ALIASES, DISPOSAL_ERROR_CODE, DataTransferItemLike, DataTransferLike, DateFormatInput, DateFormatToken, DateTimeFormatControls, DeadlineAbortSignalOptions, DebouncedControls, DecompressOptions, DefineI18nOptions, DetectedBarcode, DetectedBarcodeLike, DeviceMotionControls, DeviceMotionHost, DeviceOrientationControls, DeviceOrientationHost, DevicePixelRatioControls, DevicePixelRatioHost, type DirtyFields, type DirtyNode, DisplayMediaHost, DisplayNamesControls, DisplayNamesKind, DisposalError, DisposalScope, DocumentTitleControls, DocumentTitleHost, DocumentTitleRestore, DocumentTitleTemplate, DocumentVisibilityControls, DocumentVisibilityHost, DragAxis, DragBounds, DraggableControls, DropZoneAccept, DropZoneControls, DropZoneFileInfo, ElementBoundingControls, ElementBoundingHost, ElementBoundingRect, ElementByPointControls, ElementByPointFrameHost, ElementByPointHost, ElementRefControls, ElementRefSetter, ElementSize, ElementSizeControls, ElementTargetValue, ElementTimingEntryLike, ElementVisibilityControls, EventHook, EventHookListener, EventHookSubscription, EventListenerControls, EventSourceConstructorLike, EventSourceControls, EventSourceEventMap, EventSourceFailure, EventSourceLike, EventSourceMessage, EventSourceParseRequirement, EventSourceParsers, EventSourceReconnectOptions, EventSourceStatus, EventTimingEntryLike, EventTimingFieldsLike, EyeDropperColor, EyeDropperControls, EyeDropperHost, EyeDropperLike, EyeDropperResult, Falsy, FaviconControls, FaviconHost, FaviconLink, FetchAfterResponseContext, FetchBeforeRequestContext, FetchControls, FetchFailure, FetchImplementation, FetchRequest, FetchResponseType, FetchResponseTypeMap, FetchResult, FetchRetryOptions, FetchStatus, FieldControls, FieldRule, FieldRuleContext, FieldRuleResult, FieldRuleSource, FieldValidationTrigger, type FieldValidator, type FieldValidatorContext, FileDialogCapture, FileDialogControls, FileDialogHost, FileDialogSettings, FileInputLike, FilePickerAcceptTypeLike, FileSystemAccessControls, FileSystemAccessDataMap, FileSystemAccessDataType, FileSystemAccessHost, FileSystemAccessResult, FileSystemFileHandleLike, FileSystemWritableLike, FirstInputEntryLike, FocusControls, FocusWithinControls, FocusableElement, type FormArrayEntry, type FormArrayItem, type FormArrayPath, type FormControls, type FormCriteriaMode, type FormErrorRecord, FormErrorSummaryItem, type FormErrors, type FormFieldArrayControls, FormFieldControlProps, type FormFieldControls, FormFieldErrorEntry, FormFieldErrorVisibility, FormFieldLabelProps, FormFieldModelProps, FormFieldPropsControls, FormFieldTextProps, type FormFieldValidators, type FormLeaf, type FormPath, type FormPathValue, type FormResetOptions, type FormResult, type FormValidationTrigger, type FormValidator, FormatDateOptions, FormatMessageOptions, FormatTimeAgoOptions, FormattableDate, FormattableNumber, FpsControls, FrameScheduler, FullscreenControls, FullscreenElementLike, FullscreenHost, FullscreenNavigationUI, GamepadAxisBinding, GamepadButtonBinding, GamepadButtonLike, GamepadButtonState, GamepadControls, GamepadHost, GamepadLike, GamepadMapping, GamepadSnapshot, GamepadVibrationActuatorLike, GamepadVibrationParams, GeolocationControls, GeolocationCoordinatesSnapshot, GeolocationHost, GeolocationUnavailableReason, HIDControls, HIDDeviceFilter, HIDDeviceInfo, HIDDeviceLike, HIDHost, HIDInputReport, HasNoParams, HistoryControls, I18n, I18nDefinition, IdGenerator, IdleCallbackHost, IdleControls, IdleDeadlineLike, IdleHost, IdleOptions, IdleSchedulingOptions, IgnorableWatchHandle, ImageControls, ImageHost, ImageLike, ImageLoadResult, ImageSource, ImageStatus, IndexedDBControls, IndexedDBDatabaseLike, IndexedDBErrorCode, IndexedDBFactoryLike, IndexedDBFailure, IndexedDBKeyval, IndexedDBKeyvalOptions, IndexedDBObjectStoreLike, IndexedDBRequestLike, IndexedDBTransactionLike, IndexedKeyframeValue, InferSearchParams, InferStandardSchemaInput, InferStandardSchemaOutput, InfiniteScrollControls, InfiniteScrollDirection, InjectionState, IntersectionObserverControls, IntersectionObserverHost, IntersectionRoot, IntervalControls, IntervalScheduler, KeyCombo, KeyFilter, KeyStrokeEventName, LanguageDetectionResult, LanguageDetectorControls, LanguageDetectorCreateOptions, LanguageDetectorHost, LanguageDetectorLike, LargestContentfulPaintEntryLike, LayoutShiftEntryLike, ListFormatControls, LocaleControls, LocaleLoader, LocaleMessages, LockManagerLike, LongAnimationFrameEntryLike, LongPressModifiers, LongPressRelease, LongTaskEntryLike, MIDIAccessLike, MIDIAccessStatus, MIDIHost, MIDIInputMessage, MIDIOutputLike, MIDIPortInfo, MIDIPortLike, MIDIRequestFlags, Machine, MachineConfig, MachineStateNode, MachineTransition, MagicKeys, MapControls, MappedGamepad, MarkEntryLike, MaybeElementTarget, MaybeElementTargets, MeasureEntryLike, MediaControls, MediaDeviceInfoLike, MediaElementLike, MediaQueryHost, MediaSourceCandidate, MediaStreamControls, MediaStreamErrorCode, MediaStreamFailure, MediaStreamLike, MediaStreamSource, MediaStreamStatus, MediaStreamTrackLike, MediaTextTrack, MemoizeCache, Memoized, MessageArgument, MessageArguments, MessageAt, MessageCatalogs, MessageFormatter, MessageKey, MessageKeysOf, MessageNode, MessageParams, MessageParamsFor, MessageShape, MessageSyntaxError, MessageSyntaxErrorCode, MessageTree, ModifierKeyName, MotionPermissionConstructor, MotionPermissionState, MotionPreference, MotionRotationRate, MotionVector, MouseControls, MouseCoordinateExtractor, MouseCoordinateType, MouseInElementControls, MouseSourceType, MutationObserverControls, MutationObserverHost, NaturallyOrdered, NavigateEventLike, NavigationApiControls, NavigationDestinationLike, NavigationEntryChange, NavigationEntrySnapshot, NavigationEventName, NavigationHistoryEntryLike, NavigationHistoryMode, NavigationHost, NavigationInterceptInit, NavigationInterceptOptions, NavigationNavigateOptions, NavigationOutcome, NavigationResultLike, NavigationTimingEntryLike, NavigationTransitionSnapshot, NavigationTypeName, NetworkConnectionType, NetworkControls, NetworkEffectiveType, NetworkHost, NetworkInformationLike, NormalizedSchemaIssue, NormalizedSchemaResult, NotificationHost, NotificationLike, NotificationOptionsLike, NotificationPermissionState, NowControls, NumberFormatControls, ObjectUrlHost, ObjectUrlSource, OffsetPagination, OffsetPaginationInfo, OnClickOutsideOptions, OnKeyStrokeOptions, OnLongPressOptions, OnStartTypingOptions, OpenFilePickerOptionsLike, OpenOnScreenOptions, PageVisibilityState, PaintEntryLike, PausableControls, PausableWatchHandle, PaymentAmount, PaymentCompletion, PaymentDetails, PaymentDetailsUpdate, PaymentLineItem, PaymentMethod, PaymentRequestControls, PaymentRequestHost, PaymentRequestLike, PaymentRequestOptionsInit, PaymentRequestState, PaymentResponseLike, PaymentShippingChange, PaymentShippingChangeHook, PaymentShippingOption, PaymentShippingType, PaymentShowResult, PerformanceEntryLike, PerformanceEntryType, PerformanceEntryTypeMap, PerformanceObserveInit, PerformanceObserverCallback, PerformanceObserverControls, PerformanceObserverEntryListLike, PerformanceObserverHost, PerformanceObserverLike, PermissionControls, PermissionDescriptorLike, PermissionQueryState, PermissionStatusLike, PermissionsHost, PersistentStorageControls, PictureInPictureDocumentLike, PinchControls, PinchSnapshot, PluralCategory, PluralMessage, PluralMessages, PluralRulesControls, Point, PointerControls, PointerKind, PointerLockControls, PointerLockError, PointerLockErrorCode, PointerLockHost, PointerState, PostTaskCallOptions, PreferredLanguagesHost, ProjectionDomain, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialDescriptorJSON, PublicKeyCredentialLike, PublicKeyCredentialRequestOptionsJSON, PublicKeyCredentialStatics, PushManagerLike, PushManagerSubscribeOptions, PushPermissionState, PushRegistrationLike, PushSubscribeOptions, PushSubscriptionControls, PushSubscriptionJsonLike, PushSubscriptionLike, PushSubscriptionSnapshot, QueryParser, QuerySerializer, QueueControls, QueueOverflowPolicy, RafFrame, RawQueryValue, Reactified, ReactifiedArguments, RefAutoResetOptions, RegistrationCredentialLike, RegistrationResponseJSON, RelativeTimeFormatControls, RelativeTimeFromOptions, RelativeTimeUnitSelection, RelativeTimeValue, RequestIdleCallbackControls, ReservedBreakpointName, ResizeObserverControls, ResizeObserverHost, ResolveMessageArguments, ResourceTimingEntryLike, ResourceTimingFieldsLike, RetryAsyncOptions, RetryAttemptContext, RetryDelayOptions, RetryFailureContext, RetryScheduledContext, RoundingMethod, RouteLocationLike, RouteParamsOf, RouteQueryRecord, SaveFilePickerOptionsLike, SchedulerHost, SchedulerPostTaskControls, SchedulerPostTaskInit, SchedulerTaskPriority, ScreenArea, ScreenDetailedLike, ScreenDetailsControls, ScreenDetailsHost, ScreenDetailsLike, ScreenDetailsResult, ScreenOrientationControls, ScreenOrientationHost, ScreenOrientationLike, ScreenOrientationLockType, ScreenSnapshot, ScriptTagControls, ScriptTagElement, ScriptTagHost, ScriptTagResult, ScriptTagStatus, ScrollControls, ScrollEdges, ScrollMetrics, ScrollOffset, ScrollTargetValue, ScrollWindowHost, SearchParamCodec, SearchParamSchema, SegmenterControls, SegmenterGranularity, SelectedContact, Selection, SerialChunk, SerialControls, SerialDecoding, SerialHost, SerialOpenOptions, SerialPortFilter, SerialPortLike, SerializeSearchParamsOptions, ServiceWorkerContainerLike, ServiceWorkerControls, ServiceWorkerLike, ServiceWorkerRegisterOptions, ServiceWorkerRegistrationLike, ServiceWorkerStateName, ServiceWorkerStates, SetControls, type SetFieldValueOptions, ShareControls, ShareDataLike, ShareHost, ShareResult, SortComparator, SortedLocaleControls, SpeechRecognitionAlternativeLike, SpeechRecognitionControls, SpeechRecognitionErrorCode, SpeechRecognitionFailure, SpeechRecognitionHost, SpeechRecognitionLike, SpeechRecognitionResultLike, SpeechRecognitionResultListLike, SpeechSynthesisControls, SpeechSynthesisErrorCode, SpeechSynthesisHost, SpeechSynthesisLike, SpeechSynthesisStatus, SpeechSynthesisUtteranceLike, SpeechSynthesisVoiceLike, StackControls, StackOverflowPolicy, StandardSchemaFailure, StandardSchemaIssue, StandardSchemaPathSegment, StandardSchemaProps, StandardSchemaResult, StandardSchemaSuccess, StandardSchemaV1, StartTypingHost, StartViewTransitionArgument, StepValues, Stepper, StorageControls, StorageErrorCode, StorageEstimateControls, StorageEstimateLike, StorageFailure, StorageLike, StorageManagerLike, StorageSerializer, StorageSerializerKind, StorageValidator, StringQueryOptions, StyleTagControls, StyleTagElement, StyleTagHost, SummarizeCallOptions, SummarizerControls, SummarizerCreateOptions, SummarizerFormat, SummarizerHost, SummarizerLength, SummarizerLike, SummarizerType, SwipeCallbacks, SwipeControls, SwipeDirection, SyncRefBaseOptions, SyncRefDirection, SyncRefOptions, SyncRefTransform, TaskControllerHost, TaskControllerLike, TextDirection, TextSegment, TextSelectionControls, TextSelectionHost, TextTrackLike, TextTrackListLike, TextareaAutosizeControls, TextareaAutosizeStyleProperty, ThrottledControls, TimeAgoControls, TimeAgoInput, TimeAgoUnit, TimeRangesLike, TimedWatchHandle, TimeoutAbortSignalOptions, TimeoutControls, TimeoutFnControls, TimeoutScheduler, TimestampControls, ToggleControls, TransitionEasing, TransitionFrameHost, TransitionPresetName, TransitionPresets, TransitionTupleOutput, TransitionValue, TranslateArguments, TranslatorControls, TranslatorHost, TranslatorLanguages, TranslatorLike, TypedKeyframe, TypedPropertyIndexedKeyframes, USBControlTransferSetup, USBControls, USBDeviceFilter, USBDeviceInfo, USBDeviceLike, USBHost, USBInTransferResultLike, USBOutTransferResultLike, USBTransferStatus, UnavailableCapability, UntilChain, UntilMatchers, UntilNegatedMatchers, UntilOptions, UntilTimeoutCode, UntilTimeoutError, UrlHashControls, UrlHashHost, UrlHistoryMode, UrlSearchParamsControls, UrlSearchParamsHost, UseActiveElementOptions, UseAnimateOptions, UseAsyncQueueOptions, UseAsyncResourceOptions, UseAsyncStateOptions, UseBarcodeDetectorOptions, UseBatteryOptions, UseBluetoothOptions, UseBreakpointsOptions, UseBroadcastChannelOptions, UseClipboardOptions, UseColorModeOptions, UseCompressionStreamOptions, UseContactPickerOptions, UseCookieOptions, UseCountdownOptions, UseCounterOptions, UseCssVarOptions, UseCycleListOptions, UseDarkOptions, UseDateFormatOptions, UseDateTimeFormatOptions, UseDebouncedOptions, UseDeviceMotionOptions, UseDeviceOrientationOptions, UseDevicePixelRatioOptions, UseDisplayMediaOptions, UseDisplayNamesOptions, UseDocumentTitleOptions, UseDocumentVisibilityOptions, UseDraggableOptions, UseDropZoneOptions, UseElementBoundingOptions, UseElementByPointOptions, UseElementHoverOptions, UseElementSizeOptions, UseElementVisibilityOptions, UseEventListenerOptions, UseEventSourceOptions, UseEyeDropperOptions, UseFaviconOptions, UseFetchOptions, UseFieldOptions, UseFileDialogOptions, UseFileSystemAccessOptions, UseFocusOptions, UseFormErrorSummaryFieldsOptions, UseFormFieldPropsOptions, type UseFormOptions, UseFpsOptions, UseFullscreenOptions, UseGamepadOptions, UseGeolocationOptions, UseHIDOptions, UseHistoryOptions, UseIdGeneratorOptions, UseIdleOptions, UseImageOptions, UseIndexedDBOptions, UseInfiniteScrollOptions, UseIntersectionObserverOptions, UseIntervalFnOptions, UseIntervalOptions, UseKeyboardTargetOptions, UseLanguageDetectorOptions, UseListFormatOptions, UseLocaleOptions, UseMagicKeysOptions, UseMediaControlsOptions, UseMediaQueryOptions, UseMediaStreamOptions, UseMemoizeOptions, UseMouseInElementOptions, UseMouseOptions, UseMutationObserverOptions, UseNavigationApiOptions, UseNetworkOptions, UseNowOptions, UseNumberFormatOptions, UseObjectUrlOptions, UseOffsetPaginationOptions, UsePageLeaveOptions, UsePaymentRequestOptions, UsePerformanceObserverOptions, UsePermissionOptions, UsePersistentStorageOptions, UsePinchOptions, UsePluralRulesOptions, UsePointerLockOptions, UsePointerOptions, UsePointerSwipeOptions, UsePreferenceOptions, UsePreferredLanguagesOptions, UseProjectionOptions, UsePushSubscriptionOptions, UseQueueOptions, UseRafFnOptions, UseRelativeTimeFormatOptions, UseRequestIdleCallbackOptions, UseResizeObserverOptions, UseRoundOptions, UseRouteQueryOptions, UseSchedulerPostTaskOptions, UseScreenDetailsOptions, UseScreenOrientationOptions, UseScriptTagOptions, UseScrollLockOptions, UseScrollOptions, UseSegmenterOptions, UseSelectionOptions, UseSerialOptions, UseServiceWorkerOptions, UseShareOptions, UseSortedLocaleOptions, UseSpeechRecognitionOptions, UseSpeechSynthesisOptions, UseStackOptions, UseStorageEstimateOptions, UseStorageOptions, UseStyleTagOptions, UseSummarizerOptions, UseSwipeOptions, UseTextSelectionOptions, UseTextareaAutosizeOptions, UseThrottledOptions, UseTimeAgoOptions, UseTimeoutFnOptions, UseTimeoutOptions, UseTimestampOptions, UseTransitionOptions, UseTranslatorOptions, UseTypedUrlHashOptions, UseUSBOptions, UseUrlHashOptions, UseUrlSearchParamsOptions, UseUserActivationOptions, UseUserMediaOptions, UseVModelOptions, UseVModelsOptions, UseVibrateOptions, UseViewTransitionOptions, UseVirtualListOptions, UseVisualViewportOptions, UseWakeLockOptions, UseWebAuthnOptions, UseWebLocksOptions, UseWebMIDIOptions, UseWebNotificationOptions, UseWebSocketOptions, UseWebVitalsOptions, UseWindowScrollOptions, UseWindowSizeOptions, UseWorkerFnOptions, UserActivationControls, UserActivationLike, UserMediaControls, UserMediaHost, VModelEmit, VModelValue, VModelsEmit, ValidateCatalogs, type ValidatorResult, VibrateControls, VibrationHost, VibrationPattern, ViewTransitionControls, ViewTransitionDocumentHost, ViewTransitionLike, ViewTransitionStartOptions, VirtualContainerStyle, VirtualItemSize, VirtualKeyboardHost, VirtualListControls, VirtualListItem, VirtualListOrientation, VirtualWrapperStyle, VisualViewportControls, VisualViewportHost, VisualViewportWindowHost, WEB_VITALS_THRESHOLDS, WakeLockControls, WakeLockHost, WakeLockKind, WakeLockSentinelLike, WatchCleanupRegistrar, WatchDebouncedOptions, WatchHelperCallback, WatchOldValue, WatchOnceOptions, WatchPausableOptions, WatchSourceInput, WatchSourceValue, WatchSources, WatchThrottledOptions, WatchValue, WebAuthnAttestation, WebAuthnAuthenticatorAttachment, WebAuthnAuthenticatorSelection, WebAuthnCeremonyOptions, WebAuthnControls, WebAuthnCreationInit, WebAuthnCredentialDescriptor, WebAuthnCredentialParameter, WebAuthnCredentialsHost, WebAuthnHint, WebAuthnMediation, WebAuthnRelyingParty, WebAuthnRequestInit, WebAuthnResidentKey, WebAuthnResult, WebAuthnTransport, WebAuthnUserVerification, WebLockAttempt, WebLockInfo, WebLockLike, WebLockManagerRequestOptions, WebLockMode, WebLockRequest, WebLockRequestOptions, WebLocksControls, WebLocksSnapshot, WebMIDIControls, WebNotificationControls, WebNotificationDefaults, WebNotificationEvent, WebNotificationResult, WebSocketCodecRequirements, WebSocketConstructorLike, WebSocketControls, WebSocketFailure, WebSocketHeartbeatOptions, WebSocketLike, WebSocketRawData, WebSocketReconnectOptions, WebSocketSendData, WebSocketStatus, WebVitalMetric, WebVitalName, WebVitalRating, WebVitalsControls, WebVitalsDocumentEvent, WebVitalsDocumentHost, WebVitalsRecord, WellKnownPermissionName, WheneverOptions, WindowPlacement, WindowPlacementOptions, WindowSizeControls, WindowSizeHost, WindowSizeKind, WorkerConstructorLike, WorkerFnControls, WorkerFnErrorCode, WorkerFnHost, WorkerFnStatus, WorkerLike, anyAbortSignal, availableCapability, breakpointsBootstrapV5, breakpointsTailwind, calculateRetryDelay, compress, computedAsync, computedWithControl, createDisposalScope, createEventHook, createGlobalState, createIndexedDBKeyval, createInjectionState, createMessageFormatter, createSharedComposable, createWorkerFnScript, cubicBezier, deadlineAbortSignal, decodeBase64Url, decompress, decompressText, defineI18n, defineLocale, defineMessages, encodeBase64Url, formFieldId, formatDate, formatMessage, formatSchemaPath, formatTimeAgo, idle, inferStorageSerializerKind, isCapabilityAvailable, isCapabilityUnavailable, isElementNode, isStandardSchema, isTypingKeystroke, mapGamepad, matchesAccept, normalizeKeyName, onClickOutside, onKeyDown, onKeyStroke, onKeyUp, onLongPress, onStartTyping, oneOf, parseCookieHeader, parseCreationOptionsFromJSON, parseMessage, parseRequestOptionsFromJSON, parseSearchParams, placeWindow, provideCookieAdapter, queryParsers, rateMetric, reactify, refAutoReset, refDebounced, refDefault, requestMotionPermission, resolveElement, resolveElements, retryAsync, searchParam, selectRelativeTimeUnit, serializeAuthenticationCredential, serializeCookie, serializeRegistrationCredential, serializeSearchParams, snapshotGamepad, snapshotScreen, standardGamepadAxes, standardGamepadButtons, storageSerializers, swipeDirection, syncRef, timeoutAbortSignal, toFormFieldErrors, toPixels, toPointerKind, toReactive, tryOnScopeDispose, unavailableCapability, until, useActiveElement, useAnimate, useArrayEvery, useArrayFilter, useArrayFind, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useAsyncQueue, useAsyncResource, useAsyncState, useBarcodeDetector, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useClamp, useClipboard, useColorMode, useCompressionStream, useConfirmDialog, useContactPicker, useCookie, useCountdown, useCounter, useCssVar, useCycleList, useDark, useDateFormat, useDateTimeFormat, useDebounced, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDisplayMedia, useDisplayNames, useDocumentTitle, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementRef, useElementSize, useElementVisibility, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useField, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useForm, useFormErrorSummaryFields, useFormFieldProps, useFps, useFullscreen, useGamepad, useGeolocation, useHID, useHistory, useI18n, useIdGenerator, useIdle, useImage, useIndexedDB, useInfiniteScroll, useIntersectionObserver, useInterval, useIntervalFn, useKeyPressed, useLanguageDetector, useListFormat, useLocalStorage, useLocale, useMachine, useMagicKeys, useMap, useMediaControls, useMediaQuery, useMediaStream, useMemoize, useMounted, useMouse, useMouseInElement, useMutationObserver, useNavigationApi, useNetwork, useNow, useNumberFormat, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParentElement, usePaymentRequest, usePerformanceObserver, usePermission, usePersistentStorage, usePinch, usePluralRules, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedTransparency, usePrevious, useProjection, usePushSubscription, useQueue, useRafFn, useReducedMotion, useRelativeTimeFormat, useRequestIdleCallback, useResizeObserver, useRound, useRouteParams, useRouteQuery, useSchedulerPostTask, useScreenDetails, useScreenOrientation, useScriptTag, useScroll, useScrollLock, useSegmenter, useSelection, useSerial, useServiceWorker, useSessionStorage, useSet, useShare, useSorted, useSortedLocale, useSpeechRecognition, useSpeechSynthesis, useStack, useStepper, useStorage, useStorageEstimate, useStyleTag, useSummarizer, useSupported, useSwipe, useTextSelection, useTextareaAutosize, useThrottled, useTimeAgo, useTimeout, useTimeoutFn, useTimestamp, useToggle, useTransition, useTranslator, useUSB, useUrlHash, useUrlSearchParams, useUserActivation, useUserMedia, useVModel, useVModels, useVibrate, useViewTransition, useVirtualList, useVisualViewport, useWakeLock, useWebAuthn, useWebLocks, useWebMIDI, useWebNotification, useWebSocket, useWebVitals, useWindowScroll, useWindowSize, useWorkerFn, validateStandardSchema, watchDebounced, watchIgnorable, watchOnce, watchPausable, watchThrottled, whenever };
|
package/dist/index.mjs
CHANGED
|
@@ -107,7 +107,7 @@ import { useFetch } from "./use-fetch.mjs";
|
|
|
107
107
|
import { useField } from "./use-field.mjs";
|
|
108
108
|
import { useFileDialog } from "./use-file-dialog.mjs";
|
|
109
109
|
import { useFileSystemAccess } from "./use-file-system-access.mjs";
|
|
110
|
-
import { t as useForm } from "./use-form-
|
|
110
|
+
import { t as useForm } from "./use-form-A4j_h14D.mjs";
|
|
111
111
|
import { formFieldId, toFormFieldErrors, useFormErrorSummaryFields, useFormFieldProps } from "./use-form-field-props.mjs";
|
|
112
112
|
import { useFullscreen } from "./use-fullscreen.mjs";
|
|
113
113
|
import { mapGamepad, snapshotGamepad, standardGamepadAxes, standardGamepadButtons, useGamepad } from "./use-gamepad.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tryOnScopeDispose } from "./scope.mjs";
|
|
2
2
|
import { validateStandardSchema } from "./standard-schema.mjs";
|
|
3
|
-
import { computed, ref, shallowRef, toRaw, triggerRef } from "vue";
|
|
3
|
+
import { computed, ref, shallowRef, toRaw, toValue, triggerRef } from "vue";
|
|
4
4
|
//#region src/form-value-paths.ts
|
|
5
5
|
/** Whether a value is a plain object or an array that a path may descend into. */
|
|
6
6
|
function isContainer(value) {
|
|
@@ -60,21 +60,115 @@ function writePath(root, path, value) {
|
|
|
60
60
|
writeChild(current, last, value);
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
|
-
//#region src/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
//#region src/form-dirty.ts
|
|
64
|
+
/**
|
|
65
|
+
* Dirty-field comparison for `useForm`.
|
|
66
|
+
*
|
|
67
|
+
* Equality matches the form's own deep compare (dates by instant, arrays by
|
|
68
|
+
* item, plain objects by own keys). Prototype-bearing values are leaves.
|
|
69
|
+
*/
|
|
70
|
+
/** Whether two form values are the same, ignoring object identity. */
|
|
71
|
+
function valuesEqual(left, right) {
|
|
68
72
|
if (Object.is(left, right)) return true;
|
|
69
73
|
if (left instanceof Date && right instanceof Date) return left.getTime() === right.getTime();
|
|
70
|
-
if (Array.isArray(left) && Array.isArray(right)) return left.length === right.length && left.every((item, index) =>
|
|
74
|
+
if (Array.isArray(left) && Array.isArray(right)) return left.length === right.length && left.every((item, index) => valuesEqual(item, right[index]));
|
|
71
75
|
if (isContainer(left) && isContainer(right) && !Array.isArray(left) && !Array.isArray(right)) {
|
|
72
76
|
const keys = new Set([...Object.keys(left), ...Object.keys(right)]);
|
|
73
|
-
for (const key of keys) if (!
|
|
77
|
+
for (const key of keys) if (!valuesEqual(left[key], right[key])) return false;
|
|
74
78
|
return true;
|
|
75
79
|
}
|
|
76
80
|
return false;
|
|
77
81
|
}
|
|
82
|
+
function blankDirty(value) {
|
|
83
|
+
if (value === void 0) return true;
|
|
84
|
+
if (Array.isArray(value)) return value.every((item) => blankDirty(item));
|
|
85
|
+
if (isContainer(value)) return Object.keys(value).length === 0;
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Nested dirty flags of `current` against `previous`.
|
|
90
|
+
*
|
|
91
|
+
* Equal objects become `{}`, equal arrays become `[]`, and equal leaves
|
|
92
|
+
* become `undefined` so callers can omit them.
|
|
93
|
+
*/
|
|
94
|
+
function dirtyFieldsOf(current, previous) {
|
|
95
|
+
if (valuesEqual(current, previous)) {
|
|
96
|
+
if (Array.isArray(current)) return [];
|
|
97
|
+
if (isContainer(current)) return {};
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (Array.isArray(current) || Array.isArray(previous)) {
|
|
101
|
+
const left = Array.isArray(current) ? current : [];
|
|
102
|
+
const right = Array.isArray(previous) ? previous : [];
|
|
103
|
+
const length = Math.max(left.length, right.length);
|
|
104
|
+
return Array.from({ length }, (_, index) => {
|
|
105
|
+
if (index >= left.length || index >= right.length) return true;
|
|
106
|
+
const child = dirtyFieldsOf(left[index], right[index]);
|
|
107
|
+
return blankDirty(child) ? void 0 : child;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (isContainer(current) && isContainer(previous) && !Array.isArray(current) && !Array.isArray(previous)) {
|
|
111
|
+
const result = {};
|
|
112
|
+
const keys = new Set([...Object.keys(current), ...Object.keys(previous)]);
|
|
113
|
+
for (const key of keys) {
|
|
114
|
+
const child = dirtyFieldsOf(Object.hasOwn(current, key) ? current[key] : void 0, Object.hasOwn(previous, key) ? previous[key] : void 0);
|
|
115
|
+
if (blankDirty(child)) continue;
|
|
116
|
+
result[key] = child;
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
function own(record, key) {
|
|
123
|
+
if (!isContainer(record) || Array.isArray(record)) return void 0;
|
|
124
|
+
return Object.hasOwn(record, key) ? record[key] : void 0;
|
|
125
|
+
}
|
|
126
|
+
function mergeKept(base, current, previous) {
|
|
127
|
+
if (valuesEqual(current, previous)) return base;
|
|
128
|
+
if (Array.isArray(current) && Array.isArray(previous)) return current.map((item, index) => {
|
|
129
|
+
if (index >= previous.length) return item;
|
|
130
|
+
return mergeKept(Array.isArray(base) ? base[index] : void 0, item, previous[index]);
|
|
131
|
+
});
|
|
132
|
+
if (isContainer(current) && isContainer(previous) && !Array.isArray(current) && !Array.isArray(previous)) {
|
|
133
|
+
const baseObject = isContainer(base) && !Array.isArray(base) ? base : {};
|
|
134
|
+
const keys = new Set([
|
|
135
|
+
...Object.keys(baseObject),
|
|
136
|
+
...Object.keys(current),
|
|
137
|
+
...Object.keys(previous)
|
|
138
|
+
]);
|
|
139
|
+
const result = {};
|
|
140
|
+
for (const key of keys) {
|
|
141
|
+
const inCurrent = Object.hasOwn(current, key);
|
|
142
|
+
const inPrevious = Object.hasOwn(previous, key);
|
|
143
|
+
if (!inCurrent && inPrevious) continue;
|
|
144
|
+
if (inCurrent && !inPrevious) {
|
|
145
|
+
result[key] = current[key];
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (!inCurrent) {
|
|
149
|
+
if (Object.hasOwn(baseObject, key)) result[key] = baseObject[key];
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
result[key] = mergeKept(own(baseObject, key), current[key], previous[key]);
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
return current;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Reset values that keep user edits.
|
|
160
|
+
*
|
|
161
|
+
* Fields equal to `previous` take `base`. Dirty leaves, added keys, and
|
|
162
|
+
* array-length edits keep `current`. A removed key stays removed.
|
|
163
|
+
*/
|
|
164
|
+
function valuesKeepingDirty(base, current, previous) {
|
|
165
|
+
return mergeKept(base, current, previous);
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/use-form.ts
|
|
169
|
+
function cloneValue(value) {
|
|
170
|
+
return structuredClone(toRaw(value));
|
|
171
|
+
}
|
|
78
172
|
function toMessages(result) {
|
|
79
173
|
if (result === void 0 || result === null || result === "") return [];
|
|
80
174
|
return typeof result === "string" ? [result] : result.filter((message) => message !== "");
|
|
@@ -116,7 +210,12 @@ function remapKeys(entries, arrayPath, mapIndex) {
|
|
|
116
210
|
* … via the `~standard` protocol), a whole-form validator, and per-field
|
|
117
211
|
* validators; all may be asynchronous. A newer validation aborts older ones
|
|
118
212
|
* through their `signal` and their results are discarded, so a slow check
|
|
119
|
-
* can never overwrite fresher errors.
|
|
213
|
+
* can never overwrite fresher errors. `criteriaMode: "first"` keeps one
|
|
214
|
+
* message per path, in source order: schema, form validator, field validator.
|
|
215
|
+
* `dirtyFields` mirrors edited branches, `watch` reads one path, and
|
|
216
|
+
* `setError` updates a single path. `disabled` ignores writes and submission.
|
|
217
|
+
* `reset` can keep dirty values, errors, touched fields, the submit count,
|
|
218
|
+
* or the success flag.
|
|
120
219
|
*
|
|
121
220
|
* This composable owns the *values*. `@vizejs/ui/form` owns accessible
|
|
122
221
|
* error presentation (error summaries, focus management, native constraint
|
|
@@ -152,6 +251,8 @@ function useForm(options) {
|
|
|
152
251
|
const pending = ref(/* @__PURE__ */ new Map());
|
|
153
252
|
const submitting = ref(false);
|
|
154
253
|
const submitCount = ref(0);
|
|
254
|
+
const isSubmitSuccessful = ref(false);
|
|
255
|
+
const disabled = computed(() => toValue(options.disabled) === true);
|
|
155
256
|
const arrayKeys = /* @__PURE__ */ new Map();
|
|
156
257
|
let nextKey = 0;
|
|
157
258
|
let formController;
|
|
@@ -185,10 +286,12 @@ function useForm(options) {
|
|
|
185
286
|
/** Collect every error source; resolves to errors keyed by path. */
|
|
186
287
|
const collectErrors = async (signal) => {
|
|
187
288
|
const snapshot = values.value;
|
|
188
|
-
const
|
|
189
|
-
const
|
|
289
|
+
const schemaMessages = Object.create(null);
|
|
290
|
+
const formMessages = Object.create(null);
|
|
291
|
+
const fieldMessages = Object.create(null);
|
|
292
|
+
const add = (bucket, path, messages) => {
|
|
190
293
|
if (messages.length === 0) return;
|
|
191
|
-
(
|
|
294
|
+
(bucket[path] ??= []).push(...messages);
|
|
192
295
|
};
|
|
193
296
|
let output = snapshot;
|
|
194
297
|
const tasks = [];
|
|
@@ -196,18 +299,29 @@ function useForm(options) {
|
|
|
196
299
|
const schema = options.schema;
|
|
197
300
|
tasks.push(validateStandardSchema(schema, cloneValue(snapshot)).then((result) => {
|
|
198
301
|
if (result.status === "valid") output = result.value;
|
|
199
|
-
else for (const issue of result.issues) add(issue.path, [issue.message]);
|
|
302
|
+
else for (const issue of result.issues) add(schemaMessages, issue.path, [issue.message]);
|
|
200
303
|
}));
|
|
201
304
|
}
|
|
202
305
|
if (options.validate) {
|
|
203
306
|
const validate = options.validate;
|
|
204
307
|
tasks.push(Promise.resolve(validate(snapshot, { signal })).then((result) => {
|
|
205
308
|
if (!result) return;
|
|
206
|
-
for (const [path, messages] of Object.entries(result)) if (messages !== void 0) add(path, toMessages(messages));
|
|
309
|
+
for (const [path, messages] of Object.entries(result)) if (messages !== void 0) add(formMessages, path, toMessages(messages));
|
|
207
310
|
}));
|
|
208
311
|
}
|
|
209
|
-
for (const [path, validator] of validators) tasks.push(runValidator(validator, path, snapshot, signal).then((messages) => add(path, messages)));
|
|
312
|
+
for (const [path, validator] of validators) tasks.push(runValidator(validator, path, snapshot, signal).then((messages) => add(fieldMessages, path, messages)));
|
|
210
313
|
await Promise.all(tasks);
|
|
314
|
+
const collected = Object.create(null);
|
|
315
|
+
const firstOnly = options.criteriaMode === "first";
|
|
316
|
+
for (const bucket of [
|
|
317
|
+
schemaMessages,
|
|
318
|
+
formMessages,
|
|
319
|
+
fieldMessages
|
|
320
|
+
]) for (const [path, messages] of Object.entries(bucket)) {
|
|
321
|
+
const target = collected[path] ??= [];
|
|
322
|
+
if (firstOnly && target.length > 0) continue;
|
|
323
|
+
target.push(...firstOnly ? messages.slice(0, 1) : messages);
|
|
324
|
+
}
|
|
211
325
|
return {
|
|
212
326
|
errors: { ...collected },
|
|
213
327
|
output
|
|
@@ -260,11 +374,12 @@ function useForm(options) {
|
|
|
260
374
|
}) : Promise.resolve([])
|
|
261
375
|
]);
|
|
262
376
|
if (controller.signal.aborted) return false;
|
|
263
|
-
const
|
|
377
|
+
const combined = [
|
|
264
378
|
...fromSchema,
|
|
265
379
|
...fromForm,
|
|
266
380
|
...own
|
|
267
381
|
];
|
|
382
|
+
const messages = options.criteriaMode === "first" ? combined.slice(0, 1) : combined;
|
|
268
383
|
setErrorsFor(path, messages);
|
|
269
384
|
return messages.length === 0;
|
|
270
385
|
} finally {
|
|
@@ -279,6 +394,7 @@ function useForm(options) {
|
|
|
279
394
|
touched.value = next;
|
|
280
395
|
};
|
|
281
396
|
const setValueAt = (path, value, setOptions = {}) => {
|
|
397
|
+
if (disabled.value) return;
|
|
282
398
|
writePath(values.value, path, value);
|
|
283
399
|
if (setOptions.touch) touch(path);
|
|
284
400
|
if (setOptions.validate ?? trigger() === "change") validateField(path);
|
|
@@ -320,7 +436,7 @@ function useForm(options) {
|
|
|
320
436
|
}),
|
|
321
437
|
errors: computed(() => errors.value[key] ?? []),
|
|
322
438
|
error: computed(() => errors.value[key]?.[0]),
|
|
323
|
-
dirty: computed(() => !
|
|
439
|
+
dirty: computed(() => !valuesEqual(readPath(values.value, key), readPath(initial, key))),
|
|
324
440
|
touched: computed(() => touched.value.has(key)),
|
|
325
441
|
validating: computed(() => pending.value.has(key) || pending.value.has("")),
|
|
326
442
|
onBlur: () => {
|
|
@@ -329,6 +445,7 @@ function useForm(options) {
|
|
|
329
445
|
},
|
|
330
446
|
validate: () => validateField(key),
|
|
331
447
|
reset: () => {
|
|
448
|
+
if (disabled.value) return;
|
|
332
449
|
writePath(values.value, key, cloneValue(readPath(initial, key)));
|
|
333
450
|
setErrorsFor(key, []);
|
|
334
451
|
const next = new Set(touched.value);
|
|
@@ -344,6 +461,7 @@ function useForm(options) {
|
|
|
344
461
|
if (trigger() === "change") validateField(key);
|
|
345
462
|
};
|
|
346
463
|
const insertAt = (index, items) => {
|
|
464
|
+
if (disabled.value) return;
|
|
347
465
|
const array = readArray(key);
|
|
348
466
|
const keys = syncKeys(key, array.length);
|
|
349
467
|
const at = Math.max(0, Math.min(index, array.length));
|
|
@@ -369,6 +487,7 @@ function useForm(options) {
|
|
|
369
487
|
prepend: (...items) => insertAt(0, items),
|
|
370
488
|
insert: (index, item) => insertAt(index, [item]),
|
|
371
489
|
remove: (index) => {
|
|
490
|
+
if (disabled.value) return;
|
|
372
491
|
const array = readArray(key);
|
|
373
492
|
if (index < 0 || index >= array.length) return;
|
|
374
493
|
const keys = syncKeys(key, array.length);
|
|
@@ -378,6 +497,7 @@ function useForm(options) {
|
|
|
378
497
|
afterChange();
|
|
379
498
|
},
|
|
380
499
|
move: (from, to) => {
|
|
500
|
+
if (disabled.value) return;
|
|
381
501
|
const array = readArray(key);
|
|
382
502
|
if (from < 0 || from >= array.length || to < 0 || to >= array.length || from === to) return;
|
|
383
503
|
const keys = syncKeys(key, array.length);
|
|
@@ -394,6 +514,7 @@ function useForm(options) {
|
|
|
394
514
|
afterChange();
|
|
395
515
|
},
|
|
396
516
|
swap: (first, second) => {
|
|
517
|
+
if (disabled.value) return;
|
|
397
518
|
const array = readArray(key);
|
|
398
519
|
if (first < 0 || second < 0 || first >= array.length || second >= array.length) return;
|
|
399
520
|
const keys = syncKeys(key, array.length);
|
|
@@ -407,6 +528,7 @@ function useForm(options) {
|
|
|
407
528
|
afterChange();
|
|
408
529
|
},
|
|
409
530
|
replace: (items) => {
|
|
531
|
+
if (disabled.value) return;
|
|
410
532
|
remapState(key, () => void 0);
|
|
411
533
|
writePath(values.value, key, [...items]);
|
|
412
534
|
arrayKeys.delete(key);
|
|
@@ -419,15 +541,25 @@ function useForm(options) {
|
|
|
419
541
|
else setErrorsFor(path, []);
|
|
420
542
|
};
|
|
421
543
|
const submitWith = async (handler) => {
|
|
544
|
+
if (disabled.value) return {
|
|
545
|
+
status: "invalid",
|
|
546
|
+
errors: {}
|
|
547
|
+
};
|
|
422
548
|
submitCount.value += 1;
|
|
423
549
|
submitting.value = true;
|
|
424
550
|
try {
|
|
425
551
|
const result = await validate();
|
|
426
552
|
const signal = formController?.signal ?? new AbortController().signal;
|
|
427
|
-
if (result.status === "valid") {
|
|
553
|
+
if (result.status === "valid") try {
|
|
428
554
|
const onSubmit = handler ?? options.onSubmit;
|
|
429
555
|
if (onSubmit) await onSubmit(result.value, { signal });
|
|
430
|
-
|
|
556
|
+
isSubmitSuccessful.value = true;
|
|
557
|
+
} catch (error) {
|
|
558
|
+
isSubmitSuccessful.value = false;
|
|
559
|
+
throw error;
|
|
560
|
+
}
|
|
561
|
+
else if (result.status === "invalid") {
|
|
562
|
+
isSubmitSuccessful.value = false;
|
|
431
563
|
const next = new Set(touched.value);
|
|
432
564
|
for (const path of Object.keys(result.errors)) if (path !== "") next.add(path);
|
|
433
565
|
touched.value = next;
|
|
@@ -437,17 +569,20 @@ function useForm(options) {
|
|
|
437
569
|
submitting.value = false;
|
|
438
570
|
}
|
|
439
571
|
};
|
|
440
|
-
const reset = (next) => {
|
|
572
|
+
const reset = (next, keep = {}) => {
|
|
441
573
|
formController?.abort();
|
|
442
574
|
for (const controller of fieldControllers.values()) controller.abort();
|
|
443
575
|
fieldControllers.clear();
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
576
|
+
const previousInitial = initial;
|
|
577
|
+
const base = next === void 0 ? createInitial() : cloneValue(next);
|
|
578
|
+
initial = cloneValue(base);
|
|
579
|
+
values.value = keep.keepDirtyValues ? cloneValue(valuesKeepingDirty(base, cloneValue(values.value), previousInitial)) : cloneValue(initial);
|
|
580
|
+
if (!keep.keepErrors) errors.value = {};
|
|
581
|
+
if (!keep.keepTouched) touched.value = /* @__PURE__ */ new Set();
|
|
448
582
|
pending.value.clear();
|
|
449
|
-
submitCount.value = 0;
|
|
450
|
-
|
|
583
|
+
if (!keep.keepSubmitCount) submitCount.value = 0;
|
|
584
|
+
if (!keep.keepIsSubmitSuccessful) isSubmitSuccessful.value = false;
|
|
585
|
+
if (!keep.keepDirtyValues) arrayKeys.clear();
|
|
451
586
|
bumpKeys();
|
|
452
587
|
};
|
|
453
588
|
tryOnScopeDispose(() => {
|
|
@@ -458,15 +593,20 @@ function useForm(options) {
|
|
|
458
593
|
values,
|
|
459
594
|
errors,
|
|
460
595
|
valid: computed(() => Object.keys(errors.value).length === 0),
|
|
461
|
-
dirty: computed(() => !
|
|
596
|
+
dirty: computed(() => !valuesEqual(values.value, initial)),
|
|
597
|
+
dirtyFields: computed(() => dirtyFieldsOf(values.value, initial)),
|
|
462
598
|
validating: computed(() => pending.value.size > 0),
|
|
463
599
|
submitting,
|
|
464
600
|
submitCount,
|
|
601
|
+
isSubmitSuccessful,
|
|
602
|
+
disabled,
|
|
465
603
|
field,
|
|
466
604
|
fieldArray,
|
|
467
605
|
getValue: (path) => readPath(values.value, path),
|
|
606
|
+
watch: (path) => computed(() => readPath(values.value, path)),
|
|
468
607
|
setValue: (path, value, setOptions) => setValueAt(path, value, setOptions),
|
|
469
608
|
setValues: (next, setOptions = {}) => {
|
|
609
|
+
if (disabled.value) return;
|
|
470
610
|
if (setOptions.merge) values.value = {
|
|
471
611
|
...values.value,
|
|
472
612
|
...cloneValue(next)
|
|
@@ -484,6 +624,7 @@ function useForm(options) {
|
|
|
484
624
|
for (const [path, messages] of Object.entries(next)) if (messages !== void 0 && messages.length > 0) normalized[path] = messages;
|
|
485
625
|
errors.value = normalized;
|
|
486
626
|
},
|
|
627
|
+
setError: (path, message) => setErrorsFor(path, toMessages(message)),
|
|
487
628
|
clearErrors,
|
|
488
629
|
validate,
|
|
489
630
|
submit: submitWith,
|