@nixweb/nixloc-ui 0.0.128 → 0.0.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +87 -79
- package/src/App.vue +13 -13
- package/src/component/forms/Button.vue +171 -170
- package/src/component/forms/ButtonGroup.vue +57 -0
- package/src/component/forms/ButtonSub.vue +98 -0
- package/src/component/forms/CheckboxGroup.vue +73 -72
- package/src/component/forms/CheckboxSimple.vue +46 -46
- package/src/component/forms/Color.vue +38 -38
- package/src/component/forms/DateTime.vue +167 -167
- package/src/component/forms/Dropdown.vue +242 -218
- package/src/component/forms/EditorHtml.vue +126 -126
- package/src/component/forms/FileUpload.vue +185 -185
- package/src/component/forms/IncrementDecrement.vue +7 -2
- package/src/component/forms/InputDecimal.vue +150 -142
- package/src/component/forms/InputDecimalDiscount.vue +92 -0
- package/src/component/forms/InputNumber.vue +160 -154
- package/src/component/forms/InputPassword.vue +135 -135
- package/src/component/forms/InputText.vue +174 -162
- package/src/component/forms/InputTextEdit.vue +68 -0
- package/src/component/forms/Modal.vue +65 -65
- package/src/component/forms/RadioGroup.vue +50 -50
- package/src/component/forms/Select.vue +351 -349
- package/src/component/forms/SelectStatic.vue +127 -127
- package/src/component/forms/Slider.vue +18 -18
- package/src/component/forms/TextArea.vue +126 -126
- package/src/component/forms/Toggle.vue +3 -1
- package/src/component/layout/Account.vue +3 -3
- package/src/component/layout/Alert.vue +92 -92
- package/src/component/layout/Badge.vue +104 -103
- package/src/component/layout/FixedBar.vue +100 -100
- package/src/component/layout/Gantt.vue +130 -0
- package/src/component/layout/Header.vue +38 -38
- package/src/component/layout/IconMolded.vue +48 -0
- package/src/component/layout/LoadingFullPage.vue +27 -27
- package/src/component/layout/Menu.vue +213 -210
- package/src/component/layout/Molded.vue +28 -28
- package/src/component/layout/Panel.vue +140 -140
- package/src/component/layout/Popover.vue +126 -126
- package/src/component/layout/ScrollBar.vue +42 -42
- package/src/component/layout/Wizard.vue +211 -211
- package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
- package/src/component/rental/DisplayPeriodRent.vue +19 -44
- package/src/component/rental/DisplayTotalization.vue +11 -2
- package/src/component/shared/Collapse.vue +131 -131
- package/src/component/shared/Confirmation.vue +21 -2
- package/src/component/shared/DocumentPreview.vue +2 -1
- package/src/component/shared/ExportPDF.vue +116 -116
- package/src/component/shared/FullCalendar.vue +159 -0
- package/src/component/shared/HorizontalFilter.vue +59 -59
- package/src/component/shared/Loading.vue +107 -107
- package/src/component/shared/LoadingMoreButton.vue +23 -23
- package/src/component/shared/Messages.vue +81 -81
- package/src/component/shared/PDFViewer.vue +22 -22
- package/src/component/shared/Pagination.vue +52 -52
- package/src/component/shared/ProgressBar.vue +22 -22
- package/src/component/shared/QueryButton.vue +66 -66
- package/src/component/shared/SaveCancel.vue +3 -2
- package/src/component/shared/Search.vue +154 -154
- package/src/component/shared/Table.vue +163 -163
- package/src/component/shared/TableButton.vue +36 -36
- package/src/component/shared/TableTotalization.vue +47 -47
- package/src/component/shared/TimeLine.vue +47 -0
- package/src/component/shared/Tip.vue +42 -42
- package/src/component/shared/Toast.vue +54 -54
- package/src/component/shared/VerticalFilter.vue +97 -97
- package/src/component/shared/query-builder/AddRule.vue +181 -181
- package/src/component/shared/query-builder/DynamicComponentList.vue +73 -73
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
- package/src/component/shared/query-builder/utilities.js +21 -21
- package/src/component/template/ListViewWithDataHandler.vue +260 -260
- package/src/component/template/ViewTemplateConfiguration.vue +64 -64
- package/src/component/template/ViewTemplateReportList.vue +1 -1
- package/src/component/template/ViewTemplateReportPreview.vue +0 -1
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
- package/src/component/template/ViewTemplateWithTable.vue +56 -56
- package/src/config/axios.js +9 -9
- package/src/config/dicas.js +14 -14
- package/src/config/router.js +13 -13
- package/src/config/token.js +14 -14
- package/src/main.js +23 -23
- package/src/store/modules/generic.js +543 -512
- package/src/store/modules/user.js +3 -0
- package/src/store/modules/validation.js +38 -38
- package/src/store/store.js +13 -13
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<label>
|
|
4
|
-
<span class="title">{{ title }}</span>
|
|
5
|
-
</label>
|
|
6
|
-
<div class="select" :class="{ border: showBorder }">
|
|
7
|
-
<multiselect
|
|
8
|
-
@open="onOpen"
|
|
9
|
-
@select="onSelected"
|
|
10
|
-
@search-change="onSearch"
|
|
11
|
-
:options="data"
|
|
12
|
-
v-model.trim="currentValue"
|
|
13
|
-
:custom-label="label"
|
|
14
|
-
:disabled="disabled"
|
|
15
|
-
placeholder
|
|
16
|
-
:showLabels="true"
|
|
17
|
-
:noResult="false"
|
|
18
|
-
ref="multiselect"
|
|
19
|
-
selectLabel
|
|
20
|
-
deselectLabel
|
|
21
|
-
selectedLabel
|
|
22
|
-
>
|
|
23
|
-
</multiselect>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
<script>
|
|
28
|
-
import Multiselect from "vue-multiselect";
|
|
29
|
-
import Button from "./Button";
|
|
30
|
-
|
|
31
|
-
import { mapMutations } from "vuex";
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
name: "SelectStatic",
|
|
35
|
-
props: {
|
|
36
|
-
title: String,
|
|
37
|
-
formName: String,
|
|
38
|
-
fieldTarget: String,
|
|
39
|
-
initialValue: Object,
|
|
40
|
-
disabled: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false,
|
|
43
|
-
},
|
|
44
|
-
onlyQuery: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false,
|
|
47
|
-
},
|
|
48
|
-
showBorder: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: true,
|
|
51
|
-
},
|
|
52
|
-
markFormDirty: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
|
-
},
|
|
56
|
-
data: Array,
|
|
57
|
-
value: Object,
|
|
58
|
-
},
|
|
59
|
-
components: {
|
|
60
|
-
Multiselect,
|
|
61
|
-
Button,
|
|
62
|
-
},
|
|
63
|
-
data() {
|
|
64
|
-
return {
|
|
65
|
-
currentValue: this.initialValue,
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
mounted() {
|
|
69
|
-
let el = this.$el.getElementsByClassName("multiselect")[0];
|
|
70
|
-
if (el) {
|
|
71
|
-
el.tabIndex = 0;
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
...mapMutations("generic", ["addFilter", "removeLoading"]),
|
|
76
|
-
...mapMutations("validation", ["updateFormDirty"]),
|
|
77
|
-
onOpen() {},
|
|
78
|
-
onSelected(value) {
|
|
79
|
-
this.$emit("input", value);
|
|
80
|
-
let obj = { fieldTarget: this.fieldTarget, value: value.id };
|
|
81
|
-
if (!this.onlyQuery) this.addFilter(obj);
|
|
82
|
-
|
|
83
|
-
if (this.markFormDirty) this.updateFormDirty(true);
|
|
84
|
-
},
|
|
85
|
-
onSearch(value) {},
|
|
86
|
-
label(value) {
|
|
87
|
-
return `${value.content}`;
|
|
88
|
-
},
|
|
89
|
-
cleanSelectStatic() {
|
|
90
|
-
let obj = { content: "", id: "" };
|
|
91
|
-
this.currentValue = obj;
|
|
92
|
-
this.$emit("input", obj);
|
|
93
|
-
this.$refs.multiselect.deactivate();
|
|
94
|
-
this.removeLoading(["cleanSelectStatic"]);
|
|
95
|
-
|
|
96
|
-
if (this.fieldTarget) {
|
|
97
|
-
let obj = { fieldTarget: this.fieldTarget, valor: "" };
|
|
98
|
-
this.addFilter(obj);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
watch: {
|
|
103
|
-
"value.id": function () {
|
|
104
|
-
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
105
|
-
},
|
|
106
|
-
"initialValue.id": function () {
|
|
107
|
-
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
</script>
|
|
112
|
-
|
|
113
|
-
<style scoped>
|
|
114
|
-
div.before-list {
|
|
115
|
-
padding: 8px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.select {
|
|
119
|
-
height: 38px;
|
|
120
|
-
border-radius: 5px !important;
|
|
121
|
-
margin-bottom: 20px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.border {
|
|
125
|
-
border: 1px solid #dbdee0 !important;
|
|
126
|
-
}
|
|
127
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<label>
|
|
4
|
+
<span class="title">{{ title }}</span>
|
|
5
|
+
</label>
|
|
6
|
+
<div class="select" :class="{ border: showBorder }">
|
|
7
|
+
<multiselect
|
|
8
|
+
@open="onOpen"
|
|
9
|
+
@select="onSelected"
|
|
10
|
+
@search-change="onSearch"
|
|
11
|
+
:options="data"
|
|
12
|
+
v-model.trim="currentValue"
|
|
13
|
+
:custom-label="label"
|
|
14
|
+
:disabled="disabled"
|
|
15
|
+
placeholder
|
|
16
|
+
:showLabels="true"
|
|
17
|
+
:noResult="false"
|
|
18
|
+
ref="multiselect"
|
|
19
|
+
selectLabel
|
|
20
|
+
deselectLabel
|
|
21
|
+
selectedLabel
|
|
22
|
+
>
|
|
23
|
+
</multiselect>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
import Multiselect from "vue-multiselect";
|
|
29
|
+
import Button from "./Button";
|
|
30
|
+
|
|
31
|
+
import { mapMutations } from "vuex";
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: "SelectStatic",
|
|
35
|
+
props: {
|
|
36
|
+
title: String,
|
|
37
|
+
formName: String,
|
|
38
|
+
fieldTarget: String,
|
|
39
|
+
initialValue: Object,
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
onlyQuery: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
showBorder: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true,
|
|
51
|
+
},
|
|
52
|
+
markFormDirty: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
data: Array,
|
|
57
|
+
value: Object,
|
|
58
|
+
},
|
|
59
|
+
components: {
|
|
60
|
+
Multiselect,
|
|
61
|
+
Button,
|
|
62
|
+
},
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
currentValue: this.initialValue,
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
mounted() {
|
|
69
|
+
let el = this.$el.getElementsByClassName("multiselect")[0];
|
|
70
|
+
if (el) {
|
|
71
|
+
el.tabIndex = 0;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
...mapMutations("generic", ["addFilter", "removeLoading"]),
|
|
76
|
+
...mapMutations("validation", ["updateFormDirty"]),
|
|
77
|
+
onOpen() {},
|
|
78
|
+
onSelected(value) {
|
|
79
|
+
this.$emit("input", value);
|
|
80
|
+
let obj = { fieldTarget: this.fieldTarget, value: value.id };
|
|
81
|
+
if (!this.onlyQuery) this.addFilter(obj);
|
|
82
|
+
|
|
83
|
+
if (this.markFormDirty) this.updateFormDirty(true);
|
|
84
|
+
},
|
|
85
|
+
onSearch(value) {},
|
|
86
|
+
label(value) {
|
|
87
|
+
return `${value.content}`;
|
|
88
|
+
},
|
|
89
|
+
cleanSelectStatic() {
|
|
90
|
+
let obj = { content: "", id: "" };
|
|
91
|
+
this.currentValue = obj;
|
|
92
|
+
this.$emit("input", obj);
|
|
93
|
+
this.$refs.multiselect.deactivate();
|
|
94
|
+
this.removeLoading(["cleanSelectStatic"]);
|
|
95
|
+
|
|
96
|
+
if (this.fieldTarget) {
|
|
97
|
+
let obj = { fieldTarget: this.fieldTarget, valor: "" };
|
|
98
|
+
this.addFilter(obj);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
watch: {
|
|
103
|
+
"value.id": function () {
|
|
104
|
+
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
105
|
+
},
|
|
106
|
+
"initialValue.id": function () {
|
|
107
|
+
this.currentValue = { id: this.value.id, content: this.value.content };
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style scoped>
|
|
114
|
+
div.before-list {
|
|
115
|
+
padding: 8px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.select {
|
|
119
|
+
height: 38px;
|
|
120
|
+
border-radius: 5px !important;
|
|
121
|
+
margin-bottom: 20px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.border {
|
|
125
|
+
border: 1px solid #dbdee0 !important;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<vue-slider :data="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"></vue-slider>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
<script>
|
|
7
|
-
import VueSlider from "vue-slider-component";
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
name: "Slider",
|
|
11
|
-
components: {
|
|
12
|
-
VueSlider,
|
|
13
|
-
},
|
|
14
|
-
data() {
|
|
15
|
-
return {};
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<vue-slider :data="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"></vue-slider>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
import VueSlider from "vue-slider-component";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: "Slider",
|
|
11
|
+
components: {
|
|
12
|
+
VueSlider,
|
|
13
|
+
},
|
|
14
|
+
data() {
|
|
15
|
+
return {};
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-group">
|
|
3
|
-
<label>
|
|
4
|
-
<span class="title">{{ title }}</span>
|
|
5
|
-
<span class="required" v-if="required">*</span>
|
|
6
|
-
<Tip :field="field" :formName="formName" />
|
|
7
|
-
</label>
|
|
8
|
-
<div class="inner-addon right-addon">
|
|
9
|
-
<i
|
|
10
|
-
v-if="notifications.length > 0 && formDirty"
|
|
11
|
-
class="required glyphicon fas fa-exclamation-triangle"
|
|
12
|
-
></i>
|
|
13
|
-
|
|
14
|
-
<textarea
|
|
15
|
-
type="text"
|
|
16
|
-
:placeholder="placeholder"
|
|
17
|
-
v-bind:value="value"
|
|
18
|
-
v-on:input="$emit('input', $event.target.value)"
|
|
19
|
-
class="form-control"
|
|
20
|
-
:class="{ 'is-invalid': notifications.length > 0 && formDirty }"
|
|
21
|
-
></textarea>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div v-if="formDirty">
|
|
25
|
-
<div v-for="message in notifications" :key="message">
|
|
26
|
-
<span class="invalid">{{ message }}</span>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
import Tip from "../shared/Tip.vue";
|
|
34
|
-
import { mapState, mapMutations } from "vuex";
|
|
35
|
-
|
|
36
|
-
export default {
|
|
37
|
-
components: { Tip },
|
|
38
|
-
name: "TextArea",
|
|
39
|
-
props: {
|
|
40
|
-
title: String,
|
|
41
|
-
field: String,
|
|
42
|
-
placeholder: String,
|
|
43
|
-
formName: String,
|
|
44
|
-
required: Boolean,
|
|
45
|
-
maxLength: Number,
|
|
46
|
-
value: String,
|
|
47
|
-
},
|
|
48
|
-
data() {
|
|
49
|
-
return {
|
|
50
|
-
notifications: [],
|
|
51
|
-
formDirty: false,
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
created() {
|
|
55
|
-
this.validate();
|
|
56
|
-
},
|
|
57
|
-
methods: {
|
|
58
|
-
...mapMutations("validation", [
|
|
59
|
-
"addValidation",
|
|
60
|
-
"removeValidation",
|
|
61
|
-
"updateFormDirty",
|
|
62
|
-
]),
|
|
63
|
-
validate() {
|
|
64
|
-
this.notifications = [];
|
|
65
|
-
|
|
66
|
-
if (this.required && this.value.length == 0) {
|
|
67
|
-
var message = `${this.title} não pode ser vazio!`;
|
|
68
|
-
this.notifications.push(message);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (this.maxLength > 0) {
|
|
72
|
-
if (this.value.length > this.maxLength) {
|
|
73
|
-
var message = `Máximo de ${this.maxLength} caracteres!`;
|
|
74
|
-
this.notifications.push(message);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
computed: {
|
|
80
|
-
...mapState("validation", ["resetForm", "validations"]),
|
|
81
|
-
},
|
|
82
|
-
watch: {
|
|
83
|
-
value() {
|
|
84
|
-
this.validate();
|
|
85
|
-
this.formDirty = true;
|
|
86
|
-
this.updateFormDirty(true);
|
|
87
|
-
},
|
|
88
|
-
notifications() {
|
|
89
|
-
let self = this;
|
|
90
|
-
this.notifications.forEach(function (notification) {
|
|
91
|
-
let obj = {
|
|
92
|
-
key: self.field + "&" + self.formName,
|
|
93
|
-
formName: self.formName,
|
|
94
|
-
notification: notification,
|
|
95
|
-
};
|
|
96
|
-
self.addValidation(obj);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
if (this.notifications.length == 0) {
|
|
100
|
-
let obj = {
|
|
101
|
-
key: self.field + "&" + self.formName,
|
|
102
|
-
formName: self.formName,
|
|
103
|
-
};
|
|
104
|
-
self.removeValidation(obj);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
resetForm: {
|
|
108
|
-
handler(form) {
|
|
109
|
-
if (form.nome == this.formName) this.formDirty = false;
|
|
110
|
-
},
|
|
111
|
-
deep: true,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
</script>
|
|
116
|
-
|
|
117
|
-
<style scoped>
|
|
118
|
-
.success {
|
|
119
|
-
color: #94aa2a;
|
|
120
|
-
font-size: 14px;
|
|
121
|
-
}
|
|
122
|
-
.invalid {
|
|
123
|
-
color: #f0134d;
|
|
124
|
-
font-size: 14px;
|
|
125
|
-
}
|
|
126
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="form-group">
|
|
3
|
+
<label>
|
|
4
|
+
<span class="title">{{ title }}</span>
|
|
5
|
+
<span class="required" v-if="required">*</span>
|
|
6
|
+
<Tip :field="field" :formName="formName" />
|
|
7
|
+
</label>
|
|
8
|
+
<div class="inner-addon right-addon">
|
|
9
|
+
<i
|
|
10
|
+
v-if="notifications.length > 0 && formDirty"
|
|
11
|
+
class="required glyphicon fas fa-exclamation-triangle"
|
|
12
|
+
></i>
|
|
13
|
+
|
|
14
|
+
<textarea
|
|
15
|
+
type="text"
|
|
16
|
+
:placeholder="placeholder"
|
|
17
|
+
v-bind:value="value"
|
|
18
|
+
v-on:input="$emit('input', $event.target.value)"
|
|
19
|
+
class="form-control"
|
|
20
|
+
:class="{ 'is-invalid': notifications.length > 0 && formDirty }"
|
|
21
|
+
></textarea>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div v-if="formDirty">
|
|
25
|
+
<div v-for="message in notifications" :key="message">
|
|
26
|
+
<span class="invalid">{{ message }}</span>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import Tip from "../shared/Tip.vue";
|
|
34
|
+
import { mapState, mapMutations } from "vuex";
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
components: { Tip },
|
|
38
|
+
name: "TextArea",
|
|
39
|
+
props: {
|
|
40
|
+
title: String,
|
|
41
|
+
field: String,
|
|
42
|
+
placeholder: String,
|
|
43
|
+
formName: String,
|
|
44
|
+
required: Boolean,
|
|
45
|
+
maxLength: Number,
|
|
46
|
+
value: String,
|
|
47
|
+
},
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
notifications: [],
|
|
51
|
+
formDirty: false,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
created() {
|
|
55
|
+
this.validate();
|
|
56
|
+
},
|
|
57
|
+
methods: {
|
|
58
|
+
...mapMutations("validation", [
|
|
59
|
+
"addValidation",
|
|
60
|
+
"removeValidation",
|
|
61
|
+
"updateFormDirty",
|
|
62
|
+
]),
|
|
63
|
+
validate() {
|
|
64
|
+
this.notifications = [];
|
|
65
|
+
|
|
66
|
+
if (this.required && this.value.length == 0) {
|
|
67
|
+
var message = `${this.title} não pode ser vazio!`;
|
|
68
|
+
this.notifications.push(message);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (this.maxLength > 0) {
|
|
72
|
+
if (this.value.length > this.maxLength) {
|
|
73
|
+
var message = `Máximo de ${this.maxLength} caracteres!`;
|
|
74
|
+
this.notifications.push(message);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
...mapState("validation", ["resetForm", "validations"]),
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
value() {
|
|
84
|
+
this.validate();
|
|
85
|
+
this.formDirty = true;
|
|
86
|
+
this.updateFormDirty(true);
|
|
87
|
+
},
|
|
88
|
+
notifications() {
|
|
89
|
+
let self = this;
|
|
90
|
+
this.notifications.forEach(function (notification) {
|
|
91
|
+
let obj = {
|
|
92
|
+
key: self.field + "&" + self.formName,
|
|
93
|
+
formName: self.formName,
|
|
94
|
+
notification: notification,
|
|
95
|
+
};
|
|
96
|
+
self.addValidation(obj);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
if (this.notifications.length == 0) {
|
|
100
|
+
let obj = {
|
|
101
|
+
key: self.field + "&" + self.formName,
|
|
102
|
+
formName: self.formName,
|
|
103
|
+
};
|
|
104
|
+
self.removeValidation(obj);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
resetForm: {
|
|
108
|
+
handler(form) {
|
|
109
|
+
if (form.nome == this.formName) this.formDirty = false;
|
|
110
|
+
},
|
|
111
|
+
deep: true,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<style scoped>
|
|
118
|
+
.success {
|
|
119
|
+
color: #94aa2a;
|
|
120
|
+
font-size: 14px;
|
|
121
|
+
}
|
|
122
|
+
.invalid {
|
|
123
|
+
color: #f0134d;
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
<div class="main">
|
|
3
3
|
<b-row>
|
|
4
4
|
<b-col xs="6" sm="6" md="6" lg="6" xl="6">
|
|
5
|
-
<
|
|
5
|
+
<span class="title">{{ title }}</span>
|
|
6
|
+
<br />
|
|
6
7
|
</b-col>
|
|
7
8
|
<b-col xs="6" sm="6" md="6" lg="4" xl="4">
|
|
8
9
|
<VueToggles
|
|
@@ -65,5 +66,6 @@ export default {
|
|
|
65
66
|
|
|
66
67
|
.title {
|
|
67
68
|
padding-right: 35px;
|
|
69
|
+
margin-bottom: 50px !important;
|
|
68
70
|
}
|
|
69
71
|
</style>
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
</script>
|
|
59
59
|
<style scoped>
|
|
60
60
|
.photo-container {
|
|
61
|
-
margin-top: -
|
|
61
|
+
margin-top: -37px;
|
|
62
62
|
padding-right: 10px;
|
|
63
63
|
cursor: pointer;
|
|
64
64
|
position: fixed;
|
|
@@ -69,8 +69,8 @@ export default {
|
|
|
69
69
|
|
|
70
70
|
img {
|
|
71
71
|
border-radius: 50%;
|
|
72
|
-
height:
|
|
73
|
-
width:
|
|
72
|
+
height: 40px;
|
|
73
|
+
width: 40px;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.profile-container {
|