Skip to content

Commit 0b954cb

Browse files
fix(*): make editorContainer optional, fix imports (#176)
* fix(*): make editorContainer optional, fix imports update documentation, remove mkdocs, remove bower.json add commitlint add .npmignore, dont need to include src files in npm dist Update readme fix: typo in readme BREAKING CHANGE: window.Formeo is now window.FormeoEditor
1 parent 0d8ce41 commit 0b954cb

File tree

31 files changed

+567
-275
lines changed

31 files changed

+567
-275
lines changed

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/
2+
tools/

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
* **i18n:** embed english in editor config ([#158](https://github.com/Draggable/formeo/issues/158)) ([ba5bd1e](https://github.com/Draggable/formeo/commit/ba5bd1e))
1111
* **travis:** config needs to run on pro because its not a personal repo- this should really be documented somewhere ([85b1260](https://github.com/Draggable/formeo/commit/85b1260))
1212

13-
# Changelog
13+
### Old changelog
1414

1515
- v0.7.17 - Update Tag script [#83](http://github.com/draggable/formeo/pulls/83)
16-
* Update tag script
17-
16+
* Update tag script
17+
1818
* Improve semver regex, Add full PR gitlog to release description and changelog
1919
- v0.7.16 - Add release script shortcuts
2020
- v0.7.15 - Reduce bundle [#80](http://github.com/draggable/formeo/pulls/80)

README.md

Lines changed: 14 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,29 @@
1-
Formeo
2-
===========
1+
# Formeo
32

43
A zero dependency JavaScript module for drag and drop form creation.
54

5+
## [Demo](https://draggable.github.io/formeo/)
6+
[![formeo-demo](https://user-images.githubusercontent.com/1457540/54792239-84986d80-4bfa-11e9-8924-20a83c2694ab.gif)](https://draggable.github.io/formeo/)
7+
68
## Features
9+
10+
- Drag & drop editing
711
- Extensible builder with plethora of options
8-
- Simple drag & drop interface
9-
- Column layouts
12+
- Column/inline fields
1013
- Custom fields
1114
- Preview mode
1215
- i18n support
1316

14-
## Usage
15-
To start building forms with this module include formeo.min.js and formeo.min.css in your project and call:
16-
```
17-
new Formeo({ container: '.build-form' });
18-
```
17+
## [Docs](https://github.com/Draggable/formeo/blob/master/docs/index.md)
1918

20-
## Options
21-
### General
22-
| Option | Type | Value(s) | Default | Description |
23-
| ------------- | ------------- | ------------- | ------------- | ------------- |
24-
| [allowEdit](#) | {Bool} | `true` \| `false` | `false` | When set to false, formData can only be rendered. |
25-
| [debug](#) | {Bool} | `true` \| `false` | `false` | debug mode |
26-
| [container](#) | {String\|Node} | '.editor-wrap' | '.formeo-wrap' | Define where this instance of Formeo will be added. |
27-
| [svgSprite](#) | {String} | 'path/to/svsprite' | `null` | loads an svg sprite, leave blank if your sprite is already included in page.
28-
| [style](#) | {String} | 'path/to/stylesheet' | `null` | loads a stylesheet to the page |
29-
| [sessionStorage](#) | {Bool} | `true` \| `false` | `null` | loads a stylesheet to the page |
30-
| [iconFontFallback](#) | {String} | 'glyphicons' | `null` | uses an existing font-icon when svg icon is not available |
31-
| [config](#) | {Object} | {...} | {...} | disable, add, reorder and modify row, column and field action buttons |
19+
## Usage
3220

33-
### Events
21+
To start building forms with this module include formeo.min.js and formeo.min.css in your project and call:
3422

35-
| Option | Type | Value(s) | Default | Description |
36-
| ------------- | ------------- | ------------- | ------------- | ------------- |
37-
| [onAdd](#) | {Function} | `Event` | evt => {} | Fires when element is added to another element, returns evt details |
38-
| [onSave](#) | {Function} | `Event` | evt => {} | Fires on full form save, returns full formData |
39-
| [onUpdate](#) | {Function} | `Event` | evt => {} | Fires on individual updates, returns updated data |
40-
| [confirmClearAll](#) | {Function} | `Event` | evt => {} | Fires when form clear button is clicked, returns evt details and `clearAllAction()` |
23+
```javascript
24+
import { FormeoEditor } from 'formeo'
4125

42-
### Actions
43-
unlike events, action usually take place before an event has fired allowing you to modify how an action will complete. For example the default callback for adding an attribute is:
44-
```
45-
evt => {
46-
let attr = window.prompt(evt.message.attr);
47-
let val;
48-
if (attr) {
49-
val = String(window.prompt(evt.message.value, ''));
50-
evt.addAction(attr, val);
51-
}
52-
}
26+
const editor = new FormeoEditor()
5327
```
54-
By replacing the default callback you could use your own modal or prompt dialog and do some additional validation before calling `evt.addAction()`.
55-
56-
| Option | Type | Value(s) | Default | Description |
57-
| ------------- | ------------- | ------------- | ------------- | ------------- |
58-
| [add.attr](#) | {Function} | `Event` | evt => {} | Fires when adding an attribute to an element, returns evt details and `addAction()` |
59-
| [add.option](#) | {Function} | `Event` | evt => {} | Fires when adding nd option to a field, returns evt details and `addAction()` |
60-
| [click.button](#) | {Function} | `Event` | evt => {} | Called when clicking a form action button |
61-
| [save](#) | {Function} | `Event` | evt => {} | Fires on individual updates, returns updated data |
62-
63-
### i18N
64-
| Option | Type | Value(s) | Default |
65-
| ------------- | ------------- |------------- | ------------- |
66-
| [extension](#) | {String} | '' | '.lang' |
67-
| [locale](#) | {String} | 'de-DE' | 'en-US' |
68-
| [location](#) | {String} | 'path/to/language/files' | 'assets/lang/' |
69-
| [langs](#) | {Array} | array of available locales | ['en-US'] |
70-
| [preloaded](#) | {Object} | key/value pairs of strings | {en-US: {...}} |
71-
72-
73-
## [Demo](https://Draggable.github.io/formeo) ##
74-
[![formeo](https://cloud.githubusercontent.com/assets/1457540/15781593/c054681e-299e-11e6-823c-d5ec4b2c03dd.png)](https://draggable.github.io/formeo/)
7528

76-
## [Changelog](https://github.com/Draggable/formeo/blob/master/CHANGELOG.md) ##
29+
## [Changelog](https://github.com/Draggable/formeo/blob/master/CHANGELOG.md)

bower.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/css/site.css

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/demos/basic.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/index.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
# Formeo
2-
A highly configurable drag & drop form building module written in pure JavaScript.
32

4-
<p data-height="550" data-theme-id="0" data-slug-hash="NAXoRw" data-default-tab="result" data-user="kevinchappell" class="codepen"></p>
3+
A highly configurable drag & drop form building module.
4+
5+
<div class="formeo-editor"></div>
56

67
## Introduction
7-
Formeo is the much hyped version 2.0 of the popular jQuery form building plug-in aptly titled "[jQuery formBuilder](https://formbuilder.online)". More than just a re-branding, Formeo is a 100% rewrite with focus on configuration extensibility.
8+
Formeo is an extensible form editor written in vanilla Javascript. It builds on years of experience in creating [formBuilder](https://formbuilder.online/) and implements many of the feature requests received for that plug-in. A great deal a focus went into API development for Formeo to make almost every part of it pluggable.
89

910
### Features
10-
* coming soon
1111

12-
## Project layout
13-
```bash
14-
demo/ # Website for http://formbuilder.online
15-
dist/ # Compiled files for distribution
16-
docs/
17-
index.md # The documentation homepage.
18-
... # Other markdown pages, images and other files.
19-
src/ # Source files for editing the plugin
20-
.gitignore
21-
.jsbeautifyrc # Config file for jsbeautify
22-
.jscsrc # Code quality and style
23-
CHANGELOG.md
24-
CONTRIBUTING.md # Contributor guidelines
25-
LICENSE
26-
README.md
27-
bower.json
28-
build-icons.sh # SVG icon build script
29-
jquery-formeo.js # jQuery wrapper for Formeo module.
30-
package.json # Module config. Files in build process are stored in the `"config"` property.
31-
webpack.config.babel.js # config for webpack
32-
```
12+
- Column/inline field support
13+
- generate layouts for your form's fields
14+
- numerous presets for common layouts and resizable for custom layouts
15+
- Conditional fields
16+
- programmatically hide/show or change row, column or field values
17+
- works with external data
18+
- Controls API
19+
- create forms with signature pads, interactive maps and more
20+
- extend or clone the built-in controls
21+
- External Data
22+
- User session information in your forms such as name
23+
- Dynamic data like remotely loaded select options
24+
- Rendering
25+
- render your form template using the same renderer used to generate the Formeo UI
26+
- or BYOR (Bring Your Own Renderer) to render form template data using third-party libraries.
27+
28+

docs/js/scripts.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/license.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/options.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)