FormView.field# function · packages/mixins-form/src/index.ts:673
field<
Key extends string,
Model,
Message extends {
readonly _tag: string
},
> (
form: FormLike< Key, Model, Message> ,
options?: {
readonly renderers?: Renderers< Message>
readonly attrs?: {
readonly [K in Key]?: FieldAttrs
}
},
): FieldView< Key, Message> Show all 15 lines The view of one field, to style or extend before handing it to FormView.define.
FormView.define# function · packages/mixins-form/src/index.ts:852
define<
Key extends string,
Model,
Message extends {
readonly _tag: string
},
ControlKey extends string = never,
PickerKey extends string = never,
> (
form: FormLike< Key, Model, Message, ControlKey, PickerKey> & {
readonly bundle: {
readonly name: string
}
},
options?: {
readonly field?: FieldView< Key, Message>
readonly renderers?: Renderers< Message>
},
): SlotView. SlotView<
typeof FormSlots,
FormInput< Model, Key, ControlKey, PickerKey> ,
Message
> Show all 23 lines The view of the whole form: each control through field, in the input's
order, a hidden key left out. Pass a styled field to change how fields
look; attach Style and Behavior to the result to change the form around them.
FormView.fields# function · packages/mixins-form/src/index.ts:1133
fields<
Key extends string,
Model,
FormMessage extends {
readonly _tag: string
},
ControlKey extends string = never,
PickerKey extends string = never,
> (
form: FormLike< Key, Model, FormMessage, ControlKey, PickerKey> & {
readonly bundle: {
readonly name: string
}
},
options?: {
readonly field?: FieldView< Key, FormMessage>
readonly renderers?: Renderers< FormMessage>
} & FieldsOptions< Key, FormMessage> ,
): {
readonly view: SlotView. SlotView<
typeof FormSlots,
FormInput<Model, Key, ControlKey, PickerKey>,
FormMessage
>
readonly field: FieldsField< Key, Model, FormMessage>
} Show all 26 lines The whole form, as define draws it, with per-key overrides; and one flat
key's control, for a layout the caller owns. Keys with no override render
through the base field view (a new key of a known kind needs nothing new),
each through its style when one is given and with its element attrs. field
draws through the base view with a form-universe h, or through the
override it is given, with any h. Nested keys and Bundle-backed keys draw
only through view (or an override); field without one refuses them,
naming the key.
FormView.submodel# function · packages/mixins-form/src/index.ts:1255
submodel<
Key extends string,
Model extends {
readonly errors: ReadonlyArray< string>
readonly submitPending: boolean
},
Message extends {
readonly _tag: string
},
ControlKey extends string = never,
PickerKey extends string = never,
> (
form: FormLike< Key, Model, Message, ControlKey, PickerKey> ,
view: SlotView. SlotView<
typeof FormSlots,
FormInput< Model, Key, ControlKey, PickerKey> ,
Message
> ,
options?: {
readonly canSubmit?: ( model: Model ) => boolean
},
): Submodel. View< Model, Message, FormViewInputs< Key, ControlKey, PickerKey>> Show all 22 lines For Bundle.withView : the Submodel view that draws view, so a placement
renders the form with placed.view(model, h, { options }).
ts Copy
const Drawn = EditPost. bundle. pipe (Bundle. withView (FormView. submodel (EditPost, View)))