Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit d9e33bc

Browse files
committed
Library setup
1 parent 9dde6fa commit d9e33bc

30 files changed

+25925
-0
lines changed

.eslintrc.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
},
7+
extends: [
8+
'plugin:vue/essential',
9+
'plugin:prettier/recommended',
10+
'prettier',
11+
'prettier/vue',
12+
],
13+
plugins: ['prettier'],
14+
rules: {
15+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
16+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
17+
'prettier/prettier': [
18+
'error',
19+
{
20+
htmlWhitespaceSensitivity: 'ignore',
21+
singleQuote: true,
22+
semi: true,
23+
trailingComma: 'all',
24+
},
25+
],
26+
},
27+
parserOptions: {
28+
parser: 'babel-eslint',
29+
},
30+
settings: {
31+
'import/resolver': {
32+
alias: [['@', './src']],
33+
},
34+
},
35+
}

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
/coverage
5+
/tests/e2e/videos/
6+
/tests/e2e/screenshots/
7+
8+
# local env files
9+
.env.local
10+
.env.*.local
11+
12+
# Log files
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
17+
# Editor directories and files
18+
.idea
19+
.vscode
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw*

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"trailingComma": "all",
5+
"disableLanguages": ["markdown"]
6+
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
![repository-banner.png](https://res.cloudinary.com/alvarosaburido/image/upload/v1564929632/as-readme-banner_tqdgrx.png)
2+
3+
## Software version
4+
5+
- `node -v` : v12.4.0
6+
- `npm -v` : v6.4.1
7+
- `yarn -v`: 1.9.4
8+
- `vue --version`:3.0.3
9+
- `webpack -v` : v4.1.1
10+
11+
---
12+
13+
# Vue Dynamic Forms

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
![repository-banner.png](https://res.cloudinary.com/alvarosaburido/image/upload/v1564929632/as-readme-banner_tqdgrx.png)
2+
3+
## Software version
4+
5+
- `node -v` : v12.4.0
6+
- `npm -v` : v6.4.1
7+
- `yarn -v`: 1.9.4
8+
- `vue --version`:3.0.3
9+
- `webpack -v` : v4.1.1
10+
11+
# vue-dynamic-forms
12+
13+
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
14+
15+
Easy way to dynamically create reactive forms in vue based on varying business object model
16+
17+
## Project setup
18+
19+
```
20+
yarn install
21+
```
22+
23+
### Compiles and hot-reloads for development
24+
25+
```
26+
yarn run serve
27+
```
28+
29+
### Compiles and minifies for production
30+
31+
```
32+
yarn run build
33+
```
34+
35+
### Run your tests
36+
37+
```
38+
yarn run test
39+
```
40+
41+
### Lints and fixes files
42+
43+
```
44+
yarn run lint
45+
```
46+
47+
### Run your unit tests
48+
49+
```
50+
yarn run test:unit
51+
```

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@vue/app'],
3+
};

dev/App.vue

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<template>
2+
<div id="app">
3+
<div class="container">
4+
<h1 class="title text-center">Dynamic Forms Example</h1>
5+
<div class="row mt-5">
6+
<div class="col-6">
7+
<dynamic-form :id="testForm.id" :fields="testForm.fields" />
8+
</div>
9+
<div class="col-6">
10+
<pre>{{ testForm.fields }}</pre>
11+
</div>
12+
</div>
13+
</div>
14+
</div>
15+
</template>
16+
17+
<script>
18+
const DynamicForm = () => import('@/components/dynamic-form/DynamicForm.vue');
19+
20+
const data = () => ({
21+
testForm: {
22+
id: 'test-form',
23+
fields: [
24+
{
25+
type: 'text',
26+
label: 'Name',
27+
name: 'name',
28+
validations: [],
29+
},
30+
],
31+
},
32+
});
33+
34+
const components = {
35+
DynamicForm,
36+
};
37+
38+
export default {
39+
name: 'app',
40+
data,
41+
components,
42+
};
43+
</script>
44+
45+
<style lang="scss"></style>

dev/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Vue from 'vue';
2+
import App from './App.vue';
3+
import './styles/main.scss';
4+
5+
Vue.config.productionTip = false;
6+
7+
new Vue({ render: h => h(App) }).$mount('#app');

dev/styles/_base.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
body {
2+
font-family: 'Avenir', Helvetica, Arial, sans-serif;
3+
-webkit-font-smoothing: antialiased;
4+
-moz-osx-font-smoothing: grayscale;
5+
color: #2c3e50;
6+
margin-top: 60px;
7+
}
8+
9+
pre {
10+
font-family: FiraCode, Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono',
11+
monospace;
12+
font-size: 12px;
13+
color: #fefefe;
14+
background: #2c3e50;
15+
border-radius: 4px;
16+
padding: 0.2rem 0.5rem;
17+
overflow: auto;
18+
}

dev/styles/_vendors.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import 'bootstrap/scss/bootstrap.scss';

0 commit comments

Comments
 (0)