v2 first commit
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<div class="input-checkbox">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4" v-for="(key, item, index) in items">
|
||||
<div class="input-checkbox">
|
||||
<input type="checkbox" :name="name" :value="key[id]"> <small>{{ key[value] }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-checkbox-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
items: [],
|
||||
id: '',
|
||||
value: '',
|
||||
selected: '',
|
||||
attributes: [],
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
33
resources/assets/js/components/forms/AkauntingEmailGroup.vue
Normal file
33
resources/assets/js/components/forms/AkauntingEmailGroup.vue
Normal file
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa" :class="'fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="email" :name="name" :value="value" :id="name" class="form-control" v-bind="attributes">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-email-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
attributes: [],
|
||||
value: '',
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
34
resources/assets/js/components/forms/AkauntingFileGroup.vue
Normal file
34
resources/assets/js/components/forms/AkauntingFileGroup.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<div class="input-group input-group-merge custom-file">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa" :class="'fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="file" :name="name" :value="value" :id="name" class="form-control" v-bind="attributes">
|
||||
<label :for="name" class="custom-file-label">{{ text }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-file-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
attributes: [],
|
||||
value: '',
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="form-group" :class="col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa" :class="'fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" :name="input_name" :value="input_value" :id="input_name" class="form-control" v-bind="attributes">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-invoice-text-group',
|
||||
props: {
|
||||
name: '',
|
||||
input_name: '',
|
||||
input_value: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
attributes: [],
|
||||
values: [],
|
||||
selected: '',
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa" :class="'fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="number" :name="name" :value="value" :id="name" class="form-control" v-bind="attributes">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-number-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
attributes: [],
|
||||
value: '',
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa" :class="'fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="password" :name="name" :value="value" :id="name" class="form-control" v-bind="attributes">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-password-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
attributes: [],
|
||||
value: '',
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
87
resources/assets/js/components/forms/AkauntingRadioGroup.vue
Normal file
87
resources/assets/js/components/forms/AkauntingRadioGroup.vue
Normal file
@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div class="form-group" :class="col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
|
||||
<div class="tab-pane tab-example-result fade show active" role="tabpanel" aria-labelledby="-component-tab">
|
||||
<div class="btn-group btn-group-toggle" data-toggle="buttons" v-on:click="onClick">
|
||||
<label class="btn btn-success"
|
||||
:class="[{'active': value === 1}]">
|
||||
<input type="radio"
|
||||
:name="name"
|
||||
value="1"
|
||||
:value="real_value = 1"
|
||||
v-on="listeners"
|
||||
:id="name + '-1'"
|
||||
> {{ enable }}
|
||||
</label>
|
||||
<label class="btn btn-danger"
|
||||
:class="[{'active': value === 0}]">
|
||||
<input type="radio"
|
||||
:name="name"
|
||||
value="0"
|
||||
:value="real_value = 0"
|
||||
v-on="listeners"
|
||||
:id="name + '-0'"> {{ disable }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-radio-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
value: '',
|
||||
enable: '',
|
||||
disable: '',
|
||||
col: ''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
focused: false,
|
||||
real_value: this.value
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listeners() {
|
||||
return {
|
||||
...this.$listeners,
|
||||
change: this.onChange,
|
||||
click: this.onClick,
|
||||
input: this.updateValue,
|
||||
focus: this.onFocus,
|
||||
blur: this.onBlur
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateValue(evt) {
|
||||
let val = evt.target.value;
|
||||
this.$emit("input", val);
|
||||
},
|
||||
onChange(evt) {
|
||||
let val = evt.target.control.value;
|
||||
this.value= val;
|
||||
|
||||
this.$emit("change", val);
|
||||
},
|
||||
onClick(evt) {
|
||||
let val = evt.target.control.value;
|
||||
this.value= val;
|
||||
|
||||
this.$emit("change", val);
|
||||
},
|
||||
onFocus(evt) {
|
||||
this.focused = true;
|
||||
this.$emit("focus", evt);
|
||||
},
|
||||
onBlur(evt) {
|
||||
this.focused = false;
|
||||
this.$emit("blur", evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<div class="col-md-12">
|
||||
<a href="http://localhost/Ak-Dev/Beta/v2.0.0/common/items" class="btn btn-icon btn-outline-secondary">
|
||||
<span class="btn-inner--icon"><i class="fas fa-times"></i></span>
|
||||
<span class="btn-inner--text">Cancel</span>
|
||||
</a>
|
||||
|
||||
<loading :active.sync="isLoading"
|
||||
:can-cancel="false"
|
||||
:on-cancel="onCancel"
|
||||
:is-full-page="fullPage"
|
||||
></loading>
|
||||
|
||||
<button type="button" v-on:click="doLoading" class="btn btn-icon btn-success button-submit">
|
||||
<span class="btn-inner--icon"><i class="fas fa-save"></i></span>
|
||||
<span class="btn-inner--text"> Save</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
// Import component
|
||||
import Loading from 'vue-loading-overlay';
|
||||
// Import stylesheet
|
||||
import 'vue-loading-overlay/dist/vue-loading.css';
|
||||
|
||||
export default {
|
||||
name: 'akaunting-save-buttons',
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {
|
||||
formSubmit: Function,
|
||||
loading: false
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
isLoading: loading,
|
||||
fullPage: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doLoading() {
|
||||
this.isLoading = true;
|
||||
|
||||
this.formSubmit();
|
||||
},
|
||||
onCancel() {
|
||||
console.log('User cancelled the loader.')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa" :class="'fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select :name="name" :id="name" class="form-control" v-bind="attributes">
|
||||
<option value="" disabled>{{ attributes.placeholder }}</option>
|
||||
<option v-for="(key, value, index) in values" :value="value" :selected="selected == value">{{ key }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-select-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
values: [],
|
||||
selected: '',
|
||||
attributes: [],
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
34
resources/assets/js/components/forms/AkauntingTextGroup.vue
Normal file
34
resources/assets/js/components/forms/AkauntingTextGroup.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa" :class="'fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" :name="name" :value="value" :id="name" class="form-control" v-bind="attributes" v-on:input="onChange" v-model:input="forms.data[name]">
|
||||
<div class="text-danger invalid-feedback" v-text="" style="display: block;" v-if="errors[name]">
|
||||
{{ errors[name][0] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-text-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
attributes: [],
|
||||
value: '',
|
||||
col: ''
|
||||
},
|
||||
data: {
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="form-group" :class="(attributes.required) ? col + ' required' : col">
|
||||
<label :for="name" class="form-control-label">{{ text }}</label>
|
||||
<textarea :name="name" :id="name" class="form-control" cols="50" v-bind="attributes">{{ value }}</textarea>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'akaunting-textarea-group',
|
||||
props: {
|
||||
name: '',
|
||||
text: '',
|
||||
icon: '',
|
||||
value: '',
|
||||
attributes: [],
|
||||
col: ''
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user