Skip to content

Commit

Permalink
Option for category added
Browse files Browse the repository at this point in the history
  • Loading branch information
OnekO committed Nov 8, 2018
1 parent 2bd41db commit 6257ed6
Show file tree
Hide file tree
Showing 7 changed files with 5,201 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dist/grapesjs-plugin-forms.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/grapesjs-plugin-forms.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grapesjs-plugin-forms",
"version": "1.0.1",
"version": "1.0.2",
"description": "Set of forms components and blocks for GrapesJS editor",
"main": "dist/grapesjs-plugin-forms.min.js",
"sideEffects": false,
Expand Down
16 changes: 8 additions & 8 deletions src/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function (editor, opt = {}) {
<rect class="gjs-block-svg-path" x="2" y="15" width="10" height="3" rx="0.5"></rect>
</svg>
<div class="gjs-block-label">${c.labelForm}</div>`,
category: 'Forms',
category: c.category,
content: `
<form class="form">
<div class="form-group">
Expand Down Expand Up @@ -49,7 +49,7 @@ export default function (editor, opt = {}) {
<polygon class="gjs-block-svg-path" points="4 10 5 10 5 14 4 14"></polygon>
</svg>
<div class="gjs-block-label">${c.labelInputName}</div>`,
category: 'Forms',
category: c.category,
content: '<input class="input"/>',
});
}
Expand All @@ -65,7 +65,7 @@ export default function (editor, opt = {}) {
<polygon class="gjs-block-svg-path" points="20 15 21 15 21 16 20 16"></polygon>
</svg>
<div class="gjs-block-label">${c.labelTextareaName}</div>`,
category: 'Forms',
category: c.category,
content: '<textarea class="textarea"></textarea>',
});
}
Expand All @@ -79,7 +79,7 @@ export default function (editor, opt = {}) {
<rect class="gjs-block-svg-path" x="4" y="11.5" width="11" height="1"></rect>
</svg>
<div class="gjs-block-label">${c.labelSelectName}</div>`,
category: 'Forms',
category: c.category,
content: `<select class="select">
${c.labelSelectOption ? `<option value="">${c.labelSelectOption}</option>` : ''}
<option value="1">${c.labelOption} 1</option>
Expand All @@ -95,7 +95,7 @@ export default function (editor, opt = {}) {
<rect class="gjs-block-svg-path" x="4" y="11.5" width="16" height="1"></rect>
</svg>
<div class="gjs-block-label">${c.labelButtonName}</div>`,
category: 'Forms',
category: c.category,
content: '<button class="button">Send</button>',
});
}
Expand All @@ -109,7 +109,7 @@ export default function (editor, opt = {}) {
<polygon class="gjs-block-svg-path" fill-rule="nonzero" points="4 13 5 13 5 16 4 16"></polygon>
</svg>
<div class="gjs-block-label">${c.labelNameLabel}</div>`,
category: 'Forms',
category: c.category,
content: '<label class="label">Label</label>',
});
}
Expand All @@ -118,7 +118,7 @@ export default function (editor, opt = {}) {
bm.add('checkbox', {
label: c.labelCheckboxName,
attributes: {class:'fa fa-check-square'},
category: 'Forms',
category: c.category,
content: '<input type="checkbox" class="checkbox"/>',
});
}
Expand All @@ -127,7 +127,7 @@ export default function (editor, opt = {}) {
bm.add('radio', {
label: c.labelRadioName,
attributes: {class:'fa fa-dot-circle-o'},
category: 'Forms',
category: c.category,
content: '<input type="radio" class="radio"/>',
});
}
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default (editor, opts = {}) => {
labelStateNormal: 'Normal',
labelStateSuccess: 'Success',
labelStateError: 'Error',
category: 'Forms',
...opts
};

Expand Down
Loading

0 comments on commit 6257ed6

Please sign in to comment.