ubuilder / cms

Main Repo for project
2 stars 0 forks source link

List of supported Components #4

Closed TheHadiAhmadi closed 1 year ago

TheHadiAhmadi commented 1 year ago
TheHadiAhmadi commented 1 year ago

AutoComplete features:

(check Tom Select)

TheHadiAhmadi commented 1 year ago

Alert features:

TheHadiAhmadi commented 1 year ago

Avatar features:

TheHadiAhmadi commented 1 year ago

Button features:

TheHadiAhmadi commented 1 year ago

Badge features

TheHadiAhmadi commented 1 year ago

Breadcrumb features

TheHadiAhmadi commented 1 year ago

ButtonGroup features:

TheHadiAhmadi commented 1 year ago

all Form components should be inside Form component

function SignupForm ({slot, ...restProps}) {
    return Form({
        slot: [
            Form.Input({name: 'username', label: 'Username'}),
            Form.Select({name: 'gender', label: 'Gender'}),
            Form.Checkboxes({
                name: 'languages', 
                label: 'Spoken Languages', 
                items: ["FA", "PS", "EN"]
            }),
            ...slot
        ],
        ...restProps
    })
}
TheHadiAhmadi commented 1 year ago

@JawadAzizi Which form example is better? (above is easier to implement and below will be easier to use) above form or this?

is it possible to support below form?

import { Form } from '@ulibs/ui'

export function SignupForm ({slot, ...restProps}) {
    return Form({
        fields: {
            username: Form.Input({ label: 'Username' }),
            gender: Form.Select({ label: 'Gender' }),
            languages: Form.Checkboxes({
                label: 'Spoken Languages', 
                items: ["FA", "PS", "EN"]
            })
        },
        onSubmit: (data) {
            // this will run in backend...
            const user = await UserModel.insert(data)
            return {
                redirect: '/users/edit?id=' + user.id
            }
        },
        ...restProps
    })
}