2 |
3 |
4 |
5 |
frappe.ui
6 |
7 | A "batteries included" front-end framework for ones with deadlines.
8 |
9 |
10 |
11 | ### Table of Contents
12 | * [License](#license)
13 |
14 | #### License
15 | This repository has been released under the [MIT License](LICENSE).
--------------------------------------------------------------------------------
/build/config.js:
--------------------------------------------------------------------------------
1 | const config =
2 | {
3 | rollup:
4 | {
5 | input: config.path.source.js.main,
6 | output:
7 | {
8 | file: path.join(config.path.distribution.js, `${config.name}.js`),
9 | format: 'iife',
10 | name: 'frappe'
11 | },
12 | plugins:
13 | [
14 | resolve()
15 | ]
16 | }
17 | }
18 |
19 | export default config
--------------------------------------------------------------------------------
/build/rollup.config.js:
--------------------------------------------------------------------------------
1 | import path from 'path'
2 | import resolve from 'rollup-plugin-node-resolve'
3 |
4 | import config from '../config'
5 |
6 | export default {
7 | input: config.path.source.js.main,
8 | output:
9 | {
10 | file: path.join(config.path.base, 'docs', `${config.name}.js`),
11 | format: 'iife',
12 | name: 'FrappeUI'
13 | },
14 | plugins:
15 | [
16 | resolve()
17 | ]
18 | }
--------------------------------------------------------------------------------
/config.js:
--------------------------------------------------------------------------------
1 | import path from 'path'
2 |
3 | const config = { }
4 |
5 | config.name = 'frappe-ui'
6 | config.version = '0.1.0'
7 |
8 | config.path = { }
9 | config.path.base = path.resolve('.');
10 | config.path.source = { }
11 | config.path.source.base = path.join(config.path.base, 'src')
12 | config.path.distribution = { }
13 | config.path.distribution.base = path.join(config.path.base, 'dist')
14 |
15 | config.path.source.js = { }
16 | config.path.source.js.base = path.join(config.path.source.base, 'js')
17 | config.path.source.js.main = path.join(config.path.source.js.base, 'index.js')
18 |
19 | config.path.distribution.js = path.join(config.path.distribution.base, 'js')
20 |
21 |
22 | export default config
--------------------------------------------------------------------------------
/dist/js/frappe-ui.js:
--------------------------------------------------------------------------------
1 | var FrappeUI = (function () {
2 | 'use strict';
3 |
4 | class FrappeError extends Error { }
5 | class ImportError extends FrappeError { }
6 |
7 | class Element {
8 | constructor (...options) {
9 | this.options = Object.assign({ }, Element.OPTIONS, ...options);
10 |
11 | this.$element = $(Element.TEMPLATE);
12 |
13 | this.init();
14 | }
15 |
16 | init ( ) {
17 | this.mount();
18 | }
19 |
20 | mount (selector = null) {
21 | this.$parent = selector ? $(selector) : $(this.options.parent);
22 | this.$parent.append(this.$element);
23 | }
24 | }
25 | Element.OPTIONS =
26 | {
27 |
28 | };
29 | Element.TEMPLATE =
30 | `
31 |