Skip to content

Commit 38bbf42

Browse files
Merge pull request #507 from lionel-bijaoui/lb_remove_pug
Remove Pug
2 parents f7e9ea1 + 8d82279 commit 38bbf42

40 files changed

+770
-703
lines changed

.eslintignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
dist/*.js
2-
build/*.js
3-
config/*.js
42
!.eslintrc.js

dev/app.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
<div class="container">
33
<h1>Dev Project</h1>
44
<ul>
5-
<li v-for="link in devProject" :key="link" >
6-
<a :href="'/' + link" v-text="link"></a>
5+
<li v-for="link in devProject"
6+
:key="link" >
7+
<a :href="'/' + link"
8+
v-text="link"></a>
79
</li>
810
</ul>
911
</div>

dev/projects/basic/app.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
<h1>Basic</h1>
44
<div class="row">
55
<div class="col-sm-12">
6-
<vue-form-generator :schema="schema" :model="model" :options="formOptions" ref="form" :is-new-model="isNewModel" @model-updated="modelUpdated" @validated="onValidated"></vue-form-generator>
6+
<vue-form-generator :schema="schema"
7+
:model="model"
8+
:options="formOptions"
9+
ref="form"
10+
:is-new-model="isNewModel"
11+
@model-updated="modelUpdated"
12+
@validated="onValidated"></vue-form-generator>
713
</div>
814
</div>
915
<div class="row">

dev/projects/checklist/app.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<h1>Checklist</h1>
44
<div class="row">
55
<div class="col-sm-12">
6-
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
6+
<vue-form-generator :schema="schema"
7+
:model="model"
8+
:options="formOptions"></vue-form-generator>
79
</div>
810
</div>
911
<div class="row">

dev/projects/custom/app.vue

+21-11
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,50 @@
33
<h1>Custom label, help, hint and errors (with grouping)</h1>
44
<div class="row">
55
<div class="col-sm-12">
6-
<vue-form-generator :schema="schema" :model="model" :options="formOptions" tag="section">
6+
<vue-form-generator :schema="schema"
7+
:model="model"
8+
:options="formOptions"
9+
tag="section">
710

8-
<template slot="label" slot-scope="{ field, getValueFromOption }">
11+
<template slot="label"
12+
slot-scope="{ field, getValueFromOption }">
913
<h3><i :class="`fa fa-${getIcon(field, getValueFromOption)}`"></i> {{ field.label }}</h3>
1014
</template>
1115

12-
<template slot="help" slot-scope="{ field }">
13-
<span v-if='field.help' class="help">
16+
<template slot="help"
17+
slot-scope="{ field }">
18+
<span v-if='field.help'
19+
class="help">
1420
<span @click.prevent="testClick(field.help, $event)">Need help</span>
1521
<i class="fa fa-question"></i>
16-
<vue-markdown class="helpText" :source="field.help"></vue-markdown>
22+
<vue-markdown class="helpText"
23+
:source="field.help"></vue-markdown>
1724
</span>
1825
</template>
1926

20-
<template slot="hint" slot-scope="{ field, getValueFromOption }">
27+
<template slot="hint"
28+
slot-scope="{ field, getValueFromOption }">
2129
<div class="hint hint--info">
2230
<i class="fa fa-info-circle"></i>
2331
<span v-html="getValueFromOption(field, 'hint', undefined)"></span>
2432
</div>
2533
</template>
2634

27-
<template slot="errors" slot-scope="{ errors, field, getValueFromOption }">
35+
<template slot="errors"
36+
slot-scope="{ errors, field, getValueFromOption }">
2837
<span>Custom errors</span>
2938
<table class="errors help-block">
3039
<tbody>
3140
<thead>
3241
<tr>
33-
<th scope="col" id="">Index</th>
34-
<th scope="col" id="">Error</th>
42+
<th scope="col">Index</th>
43+
<th scope="col">Error</th>
3544
</tr>
3645
</thead>
3746
<tbody>
38-
<tr v-for="(error, index) in errors" :key="index">
39-
<td>{{index}}</td>
47+
<tr v-for="(error, index) in errors"
48+
:key="index">
49+
<td>{{ index }}</td>
4050
<td v-html="error"></td>
4151
</tr>
4252
</tbody>

dev/projects/full/app.vue

+28-10
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,45 @@
22
<div class="container">
33
<div class="row">
44
<div class="col-md-10 col-md-offset-1">
5-
<data-table :rows="rows" :selected="selected" :select="selectRow"></data-table>
5+
<data-table :rows="rows"
6+
:selected="selected"
7+
:select="selectRow"></data-table>
68
</div>
79
</div>
8-
<div v-show="model" class="row">
10+
<div v-show="model"
11+
class="row">
912
<div class="col-md-5 col-md-offset-1">
1013
<div class="control-buttons text-center">
11-
<button @click="newModel" class="btn btn-default new">
12-
<i class="fa fa-plus"></i>New</button>
13-
<button @click="saveModel" class="btn btn-primary save">
14+
<button @click="newModel"
15+
class="btn btn-default new">
16+
<i class="fa fa-plus"></i>New
17+
</button>
18+
<button @click="saveModel"
19+
class="btn btn-primary save">
1420
<i class="fa fa-floppy-o"></i>Save
15-
<i v-if="showWarning()" class="fa fa-warning"></i>
21+
<i v-if="showWarning()"
22+
class="fa fa-warning"></i>
23+
</button>
24+
<button @click="deleteModel"
25+
class="btn btn-danger delete">
26+
<i class="fa fa-trash"></i>Delete
1627
</button>
17-
<button @click="deleteModel" class="btn btn-danger delete">
18-
<i class="fa fa-trash"></i>Delete</button>
1928
</div>
2029
<div class="errors text-center">
21-
<div v-for="(item, index) in validationErrors" :key="index" class="alert alert-danger">{{ item.field.label}}:
30+
<div v-for="(item, index) in validationErrors"
31+
:key="index"
32+
class="alert alert-danger">{{ item.field.label }}:
2233
<strong>{{ item.error }}</strong>
2334
</div>
2435
</div>
25-
<vue-form-generator :schema="schema" :model="model" :options="formOptions" :multiple="selected.length > 1" ref="form" :is-new-model="isNewModel" @model-updated="modelUpdated" @validated="onValidated">
36+
<vue-form-generator :schema="schema"
37+
:model="model"
38+
:options="formOptions"
39+
:multiple="selected.length > 1"
40+
ref="form"
41+
:is-new-model="isNewModel"
42+
@model-updated="modelUpdated"
43+
@validated="onValidated">
2644

2745
</vue-form-generator>
2846
</div>

dev/projects/full/dataTable.vue

+54-23
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,65 @@
1-
<template lang="pug">
2-
table.table.table-hover.table-bordered
3-
thead
4-
tr
5-
th ID
6-
th Name
7-
th E-mail
8-
th Country
9-
th Role
10-
th Status
1+
<template>
2+
<table class="table table-hover table-bordered">
3+
<thead>
4+
<tr>
5+
<th>ID</th>
6+
<th>Name</th>
7+
<th>Password </th>
8+
<th>Language</th>
9+
<th>Role</th>
10+
<th>Status</th>
11+
</tr>
12+
</thead>
1113

12-
tbody
13-
tr(v-for="row in rows", @click="select($event, row)", :class="{ active: isSelected(row) }")
14-
td {{ row.id }}
15-
td
16-
img(:src="row.avatar")
17-
| {{ row.firstName + " " + row.lastName }} ({{row.userName}})
18-
.label.label-warning(v-if="!row.status") Inactive
19-
td {{ row.email }}
20-
td(v-if="row.address") {{ row.address.country }}
21-
td {{ getRoleName(row) }}
22-
td
23-
i.fa(:class=" row.status? 'fa-check' : 'fa-ban' ")
14+
<tbody>
15+
<tr v-for="(row, index) in rows"
16+
:key="index"
17+
@click="select($event, row)"
18+
:class="{ active: isSelected(row) }">
19+
<td>{{ row.id }}</td>
20+
<td>
21+
<img :src="row.avatar">
22+
{{ row.firstName + " " + row.lastName }} ({{ row.userName }})
23+
<div class="label label-warning"
24+
v-if="!row.status"> Inactive</div>
25+
</td>
26+
<td>{{ row.password }}</td>
27+
<td>{{ row.language }}</td>
28+
<td>{{ getRoleName(row) }}</td>
29+
<td>
30+
<i class="fa"
31+
:class="row.status? 'fa-check' : 'fa-ban'"></i>
32+
</td>
33+
</tr>
34+
</tbody>
35+
</table>
2436
</template>
2537

2638
<script>
2739
import { find } from "lodash";
2840
import { roles } from "./data";
2941
3042
export default {
31-
props: ["rows", "selected", "select"],
43+
props: {
44+
rows: {
45+
type: Array,
46+
default() {
47+
return [];
48+
}
49+
},
50+
selected: {
51+
type: Array,
52+
default() {
53+
return [];
54+
}
55+
},
56+
select: {
57+
type: Function,
58+
default() {
59+
return [];
60+
}
61+
}
62+
},
3263
3364
methods: {
3465
isSelected(row) {

dev/projects/full/fieldAwesome.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
<template lang="pug">
2-
input.form-control(type="text", v-model="value", :maxlength="schema.max", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
1+
<template>
2+
<input class="form-control"
3+
type="text"
4+
v-model="value"
5+
:maxlength="schema.max"
6+
:readonly="schema.readonly"
7+
:disabled="disabled"
8+
:placeholder="schema.placeholder">
39
</template>
410

511
<script>

dev/projects/grouping/app.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<h1>Grouping</h1>
44
<div class="row">
55
<div class="col-sm-12">
6-
<vue-form-generator :schema="schema" :model="model" :options="formOptions" tag="section"></vue-form-generator>
6+
<vue-form-generator :schema="schema"
7+
:model="model"
8+
:options="formOptions"
9+
tag="section"></vue-form-generator>
710
</div>
811
</div>
912
<div class="row">

dev/projects/multi/app.vue

+14-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@
33
<h1>Multi</h1>
44
<div class="row">
55
<div class="col-sm-12">
6-
<vue-form-generator :schema="schema" :model="model" :options="formOptions" ref="form1" :is-new-model="isNewModel" @model-updated="modelUpdated1" @validated="onValidated1"></vue-form-generator>
6+
<vue-form-generator :schema="schema"
7+
:model="model"
8+
:options="formOptions"
9+
ref="form1"
10+
:is-new-model="isNewModel"
11+
@model-updated="modelUpdated1"
12+
@validated="onValidated1"></vue-form-generator>
713
</div>
814
</div>
915
<div class="row">
1016
<div class="col-sm-12">
11-
<vue-form-generator :schema="schema2" :model="model" :options="formOptions" ref="form2" :is-new-model="isNewModel" @model-updated="modelUpdated2" @validated="onValidated2"></vue-form-generator>
17+
<vue-form-generator :schema="schema2"
18+
:model="model"
19+
:options="formOptions"
20+
ref="form2"
21+
:is-new-model="isNewModel"
22+
@model-updated="modelUpdated2"
23+
@validated="onValidated2"></vue-form-generator>
1224
</div>
1325
</div>
1426
<div class="row">

dev/projects/multiselect/app.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<h1>Multiselect</h1>
44
<div class="row">
55
<div class="col-sm-12">
6-
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
6+
<vue-form-generator :schema="schema"
7+
:model="model"
8+
:options="formOptions"></vue-form-generator>
79
</div>
810
</div>
911
<div class="row">

dev/projects/picker/app.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<h1>Picker</h1>
44
<div class="row">
55
<div class="col-sm-12">
6-
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
6+
<vue-form-generator :schema="schema"
7+
:model="model"
8+
:options="formOptions"></vue-form-generator>
79
</div>
810
</div>
911
<div class="row">

0 commit comments

Comments
 (0)