0.1.2 • Published 4 years ago

ahadisoft-dynamic-form v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Custom Form Component For Ahadisoft Projects

Guide

  1. Npm install --save ahadisoft-dynamic-form.

    1. Use as follows
    	<DynamicForm 
            schema={[
                {
                    "name": "order",
                    "type": "number",
                    "placeholder": "Order",
                    "required" : true,
                    "initialvalue": this.state.overviewData.order,
                    "label": "Order"
                },
                {
                    "name": "slug",
                    "type": "text",
                    "placeholder": "Slug",
                    "required" : true,
                    "initialvalue": this.state.overviewData.slug,
                    "label": "Slug for package"
                },
                {
                    "name": "name",
                    "type": "text",
                    "placeholder": "Your Package Name",
                    "required" : true,
                    "initialvalue": this.state.overviewData.name,
                    "label": "Package Name"
                },
                {
                    "name": "description",
                    "type": "textArea",
                    "placeholder": "Your Package Description",
                    "required" : false,
                    "initialvalue": this.state.overviewData.description,
                    "label": "Description"
                },
                {
                    "name": "tags",
                    "type": "textArea",
                    "placeholder": "Tags: Enter your tags separated by comma",
                    "required" : false,
                    "initialvalue": this.state.overviewData.tags,
                    "label": "Tags: Enter your tags separated by comma"
                },
                {
                    "name": "displayPrice",
                    "type": "number",
                    "placeholder": "Display Price",
                    "required" : true,
                    "label": "Display Price",
                    "initialvalue": this.state.overviewData.displayPrice
                },
                {
                    "name": "maximumSeats",
                    "type": "number",
                    "placeholder": "Maximum Seats",
                    "required" : false,
                    "label": "Maximum Seats",
                    "initialvalue": this.state.overviewData.maximumSeats
                },
                {
                    "name": "isVisible",
                    "type": "checkbox",
                    "required" : false,
                    "initialvalue": this.state.overviewData.isVisible,
                    "nameTag": "Should this package be visible on the front-end?"
                },
                {
                    "name": "isAvailable",
                    "type": "checkbox",
                    "required" : false,
                    "initialvalue": this.state.overviewData.isAvailable,
                    "nameTag": "Is this package available?"
                },
                {
                    "name": "specialOffer",
                    "type": "checkbox",
                    "required" : false,
                    "initialvalue": this.state.overviewData.specialOffer,
                    "nameTag": "Is this package a special offer?"
                }
    
                
            ]}
            
            url= {apiUrl + "/api/update-package/" + this.props.package._id}
            method="post"
            user={this.props.auth}
            buttonlabel="Update Overview"
            resetdata={false}
            />