1.0.0 • Published 6 years ago

angular-schema-form-panel v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Angular Schema Form Bootstrap Panel Decorator v1.0.0

Adds support for Bootstrap's custom panel component in Angular Schema Form

View the Live Demo on CodePen for examples.


Build status Dependencies status NPM version Bower version

Installation

Install angular-schema-form-panel via npm or bower.

NPM

npm install angular-schema-form-panel

Bower

bower install angular-schema-form-panel

Usage

Include angular-schema-form-panel.min.js (or the un-minified angular-schema-form-panel.js) file in your HTML document(s):

<script src="node_modules/angular-schema-form-panel/dist/angular-schema-form-panel.min.js"></script>

Add schemaFormPanel as an Angular dependency in your application module:

var app = angular.module('myApp', [..., 'schemaForm', 'schemaFormPanel']);

Then use panel as the type in your form's JSON definition:

$scope.form = [
    ...,
    {
        type: "panel",
        items: [...],
        ...options
    }
]

You can also make an accordion of panels by using panel-group as the type (make sure the items of your panel-group are panel objects) in your form's JSON definition:

$scope.form = [
    ...,
    {
        type: "panel-group",
        items: [
            {
                type: "panel",
                items: [...],
                ...options
            },
            {
                type: "panel",
                items: [...],
                ...options
            },
            {
                type: "panel",
                items: [...],
                ...options
            }
        ]
    }
]

Options

You can use the following options on each panel object. All options are optional unless specified.

Option NameTypeDescription
itemsarraySpecifies all items to include in the panel body. Technically optional but without it your panel will be empty.
stylestringSpecifies the panel's contextual style (e.g. success, info, danger, etc.). Defaults to default.
titlestringSpecifies the title displayed in the header of the panel. This is required for collapsible panels.
footerstringSpecifies the HTML content added to the panel's footer.
collapsibleboolSpecifies if the panel can be collapsed. Remember to specify a title for collapsible panels. Defaults to false.
collapsedboolSpecifies if the panel should be collapsed initially. This only applies to collapsible panels. Defaults to false.
panelClassstringSpecifies additional class(es) to add to the main panel element.
headingClassstringSpecifies additional class(es) to add to the panel's heading element.
bodyClassstringSpecifies additional class(es) to add to the panel's body element.
footerClassstringSpecifies additional class(es) to add to the panel's footer element.
listboolSpecifies if the items should be rendered as elements of a list group. Defaults to false.