Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brown-meals-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect-app/vue-components": patch
---

restore Leaves typing for omegaform input
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export type Leaves<T, Path extends string = ""> = T extends ReadonlyArray<infer
}[keyof T]

// Helper type to make array indices flexible - accepts both [number] and numeric literals [0], [1], etc.
export type FlexibleArrayPath<T extends string> = T extends `${infer Before}[number]${infer After}`
? T | `${Before}[${number}]${FlexibleArrayPath<After>}`
: T
// Simplified: if there's a [] in the path, just use TName to avoid excessive type complexity
export type FlexibleArrayPath<T extends string> = T extends `${string}[${string}]${string}` ? T
: never

export type BaseProps<From, TName extends DeepKeys<From> = DeepKeys<From>> = {
/** Will fallback to i18n when not specified */
label?: string
validators?: FieldValidators<From>
// disabled FlexibleArrayPath as it causes excessive complexity in type resolution inside user projects
name: TName // & FlexibleArrayPath<Leaves<From>>
// Use FlexibleArrayPath: if name contains [], just use TName; otherwise intersect with Leaves<From>
name: FlexibleArrayPath<TName> extends never ? Leaves<From> : TName
}

export type TypesWithOptions = "radio" | "select" | "multiple" | "autocomplete" | "autocompletemultiple"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useStore } from "@tanstack/vue-form"
import { defineSlots } from "vue"
import { usePreventClose } from "./blockDialog"
import { getOmegaStore } from "./getOmegaStore"
import { type DefaultTypeProps, type OmegaFormApi, type OmegaFormState } from "./OmegaFormStuff"
Expand Down