npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sb-form

v0.2.26

Published

SB Form is a dynamic form build with vue3 for laravel and vue application

Downloads

50

Readme

SB Form

Designed for Laravel + Vue Appliction

This form is design to build from a json, it will help us to develop application so rapidly that we don't need to worry about form validation from design and file management

Uses

To use Sb form you need to register the Index.vue to your main.js. or You can import Index.vue from the sb-form directory and use this component

I register the SB Form alias to sb-form sp we can use it entire the application using <sb-form/> tag

Supported Props

{
    props: {
        title: String,
        fields: Object,
        url: String,
        resetForm: {
            type: Boolean,
            default: true
        },
        callBack: {
            type: String,
            required: false
        }
    }
}

Currently, SB Form is support the listed props above. title, fields and url is required callBack will only execute on axios success resetForm we can revoke from reset on edit/update The base (with all required props) db-form will look like this


<sb-form title="Create User" :fields="fields" url="/create-user"/>

Supported Fields

Scroll down more to get more information about the fields listed above

Field Basic

Checkout the basic schema of json to generate a html field

{
    role: {
        label: 'Role',
        col: 6,
        type: 'select_field',
        value: 1,
        options: [
            {
                id: 1,
                name: 'Super Admin'
            },
            {
                id: 2,
                name: 'Role Two'
            }
        ],
        config: {
            value: 'id',
            display: 'name'
        }
    }
}

Name of the json attribute role will be considered as v-model so you will see the same name in request payload.

label will be consider as your html label of the field

col bootstrap column. by default, it's col-12 so you can skip it if you don't want to change the column

type You need to define the filed type here. by default, it will take string

value It will need in edit form when you like to preset data in v-model

options Only need in Select and Multiselect

config Currently it's also using in Select Field Only

Input Field

{
    name: {
        label: "Full Name",
        placeholder: "Enter Full Name",
        col: 6,
        required: true
    }
}

Text Field

{
    address: {
        label: "Address",
        col: 12,
        type: 'text_field'
    }
}

Password Field

 {
    password: {
        label: "Password",
        col: 6,
        type: 'password',
        required: true
    }
}

Single Select Field

{
    role: {
        label: 'Role',
        col: 6,
        type: 'select_field',
        value: 1,
        options: [
            {
                id: 1,
                name: 'Super Admin'
            },
            {
                id: 2,
                name: 'Role Two'
            }
        ],
        config: {
            value: 'id',
            display: 'name'
        }
    }
}

Multiple Select Field

{
    permissions: {
        label: 'Permissions',
        type: 'multiselect_field',
        options: [
            {id:  1, name:  'Create User'}
        ],
        config: {
            value: (value) => value.id,
            display: (value) => value.name,
        },
        ajax: '/ajax-url'
    }
}

File Field

{
    image: {
        label: 'User Image',
        type: 'file_field'
    }
}