Skip to content

Remove Pug #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
dist/*.js
build/*.js
config/*.js
!.eslintrc.js
6 changes: 4 additions & 2 deletions dev/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<div class="container">
<h1>Dev Project</h1>
<ul>
<li v-for="link in devProject" :key="link" >
<a :href="'/' + link" v-text="link"></a>
<li v-for="link in devProject"
:key="link" >
<a :href="'/' + link"
v-text="link"></a>
</li>
</ul>
</div>
Expand Down
8 changes: 7 additions & 1 deletion dev/projects/basic/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
<h1>Basic</h1>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema" :model="model" :options="formOptions" ref="form" :is-new-model="isNewModel" @model-updated="modelUpdated" @validated="onValidated"></vue-form-generator>
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"
ref="form"
:is-new-model="isNewModel"
@model-updated="modelUpdated"
@validated="onValidated"></vue-form-generator>
</div>
</div>
<div class="row">
Expand Down
4 changes: 3 additions & 1 deletion dev/projects/checklist/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<h1>Checklist</h1>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"></vue-form-generator>
</div>
</div>
<div class="row">
Expand Down
32 changes: 21 additions & 11 deletions dev/projects/custom/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,50 @@
<h1>Custom label, help, hint and errors (with grouping)</h1>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema" :model="model" :options="formOptions" tag="section">
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"
tag="section">

<template slot="label" slot-scope="{ field, getValueFromOption }">
<template slot="label"
slot-scope="{ field, getValueFromOption }">
<h3><i :class="`fa fa-${getIcon(field, getValueFromOption)}`"></i> {{ field.label }}</h3>
</template>

<template slot="help" slot-scope="{ field }">
<span v-if='field.help' class="help">
<template slot="help"
slot-scope="{ field }">
<span v-if='field.help'
class="help">
<span @click.prevent="testClick(field.help, $event)">Need help</span>
<i class="fa fa-question"></i>
<vue-markdown class="helpText" :source="field.help"></vue-markdown>
<vue-markdown class="helpText"
:source="field.help"></vue-markdown>
</span>
</template>

<template slot="hint" slot-scope="{ field, getValueFromOption }">
<template slot="hint"
slot-scope="{ field, getValueFromOption }">
<div class="hint hint--info">
<i class="fa fa-info-circle"></i>
<span v-html="getValueFromOption(field, 'hint', undefined)"></span>
</div>
</template>

<template slot="errors" slot-scope="{ errors, field, getValueFromOption }">
<template slot="errors"
slot-scope="{ errors, field, getValueFromOption }">
<span>Custom errors</span>
<table class="errors help-block">
<tbody>
<thead>
<tr>
<th scope="col" id="">Index</th>
<th scope="col" id="">Error</th>
<th scope="col">Index</th>
<th scope="col">Error</th>
</tr>
</thead>
<tbody>
<tr v-for="(error, index) in errors" :key="index">
<td>{{index}}</td>
<tr v-for="(error, index) in errors"
:key="index">
<td>{{ index }}</td>
<td v-html="error"></td>
</tr>
</tbody>
Expand Down
38 changes: 28 additions & 10 deletions dev/projects/full/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,45 @@
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<data-table :rows="rows" :selected="selected" :select="selectRow"></data-table>
<data-table :rows="rows"
:selected="selected"
:select="selectRow"></data-table>
</div>
</div>
<div v-show="model" class="row">
<div v-show="model"
class="row">
<div class="col-md-5 col-md-offset-1">
<div class="control-buttons text-center">
<button @click="newModel" class="btn btn-default new">
<i class="fa fa-plus"></i>New</button>
<button @click="saveModel" class="btn btn-primary save">
<button @click="newModel"
class="btn btn-default new">
<i class="fa fa-plus"></i>New
</button>
<button @click="saveModel"
class="btn btn-primary save">
<i class="fa fa-floppy-o"></i>Save
<i v-if="showWarning()" class="fa fa-warning"></i>
<i v-if="showWarning()"
class="fa fa-warning"></i>
</button>
<button @click="deleteModel"
class="btn btn-danger delete">
<i class="fa fa-trash"></i>Delete
</button>
<button @click="deleteModel" class="btn btn-danger delete">
<i class="fa fa-trash"></i>Delete</button>
</div>
<div class="errors text-center">
<div v-for="(item, index) in validationErrors" :key="index" class="alert alert-danger">{{ item.field.label}}:
<div v-for="(item, index) in validationErrors"
:key="index"
class="alert alert-danger">{{ item.field.label }}:
<strong>{{ item.error }}</strong>
</div>
</div>
<vue-form-generator :schema="schema" :model="model" :options="formOptions" :multiple="selected.length > 1" ref="form" :is-new-model="isNewModel" @model-updated="modelUpdated" @validated="onValidated">
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"
:multiple="selected.length > 1"
ref="form"
:is-new-model="isNewModel"
@model-updated="modelUpdated"
@validated="onValidated">

</vue-form-generator>
</div>
Expand Down
77 changes: 54 additions & 23 deletions dev/projects/full/dataTable.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,65 @@
<template lang="pug">
table.table.table-hover.table-bordered
thead
tr
th ID
th Name
th E-mail
th Country
th Role
th Status
<template>
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Password </th>
<th>Language</th>
<th>Role</th>
<th>Status</th>
</tr>
</thead>

tbody
tr(v-for="row in rows", @click="select($event, row)", :class="{ active: isSelected(row) }")
td {{ row.id }}
td
img(:src="row.avatar")
| {{ row.firstName + " " + row.lastName }} ({{row.userName}})
.label.label-warning(v-if="!row.status") Inactive
td {{ row.email }}
td(v-if="row.address") {{ row.address.country }}
td {{ getRoleName(row) }}
td
i.fa(:class=" row.status? 'fa-check' : 'fa-ban' ")
<tbody>
<tr v-for="(row, index) in rows"
:key="index"
@click="select($event, row)"
:class="{ active: isSelected(row) }">
<td>{{ row.id }}</td>
<td>
<img :src="row.avatar">
{{ row.firstName + " " + row.lastName }} ({{ row.userName }})
<div class="label label-warning"
v-if="!row.status"> Inactive</div>
</td>
<td>{{ row.password }}</td>
<td>{{ row.language }}</td>
<td>{{ getRoleName(row) }}</td>
<td>
<i class="fa"
:class="row.status? 'fa-check' : 'fa-ban'"></i>
</td>
</tr>
</tbody>
</table>
</template>

<script>
import { find } from "lodash";
import { roles } from "./data";

export default {
props: ["rows", "selected", "select"],
props: {
rows: {
type: Array,
default() {
return [];
}
},
selected: {
type: Array,
default() {
return [];
}
},
select: {
type: Function,
default() {
return [];
}
}
},

methods: {
isSelected(row) {
Expand Down
10 changes: 8 additions & 2 deletions dev/projects/full/fieldAwesome.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template lang="pug">
input.form-control(type="text", v-model="value", :maxlength="schema.max", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
<template>
<input class="form-control"
type="text"
v-model="value"
:maxlength="schema.max"
:readonly="schema.readonly"
:disabled="disabled"
:placeholder="schema.placeholder">
</template>

<script>
Expand Down
5 changes: 4 additions & 1 deletion dev/projects/grouping/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<h1>Grouping</h1>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema" :model="model" :options="formOptions" tag="section"></vue-form-generator>
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"
tag="section"></vue-form-generator>
</div>
</div>
<div class="row">
Expand Down
16 changes: 14 additions & 2 deletions dev/projects/multi/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@
<h1>Multi</h1>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema" :model="model" :options="formOptions" ref="form1" :is-new-model="isNewModel" @model-updated="modelUpdated1" @validated="onValidated1"></vue-form-generator>
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"
ref="form1"
:is-new-model="isNewModel"
@model-updated="modelUpdated1"
@validated="onValidated1"></vue-form-generator>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema2" :model="model" :options="formOptions" ref="form2" :is-new-model="isNewModel" @model-updated="modelUpdated2" @validated="onValidated2"></vue-form-generator>
<vue-form-generator :schema="schema2"
:model="model"
:options="formOptions"
ref="form2"
:is-new-model="isNewModel"
@model-updated="modelUpdated2"
@validated="onValidated2"></vue-form-generator>
</div>
</div>
<div class="row">
Expand Down
4 changes: 3 additions & 1 deletion dev/projects/multiselect/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<h1>Multiselect</h1>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"></vue-form-generator>
</div>
</div>
<div class="row">
Expand Down
4 changes: 3 additions & 1 deletion dev/projects/picker/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<h1>Picker</h1>
<div class="row">
<div class="col-sm-12">
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
<vue-form-generator :schema="schema"
:model="model"
:options="formOptions"></vue-form-generator>
</div>
</div>
<div class="row">
Expand Down
Loading