@nixweb/nixloc-ui 0.0.300 → 0.0.301
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 +1 -1
- package/src/App.vue +13 -0
- package/src/component/forms/Button.vue +163 -0
- package/src/component/forms/ButtonFilter.vue +75 -0
- package/src/component/forms/ButtonGroup.vue +67 -0
- package/src/component/forms/ButtonSub.vue +98 -0
- package/src/component/forms/ButtonToggle.vue +77 -0
- package/src/component/forms/CheckboxGroup.vue +69 -0
- package/src/component/forms/CheckboxServer.vue +192 -0
- package/src/component/forms/CheckboxSimple.vue +60 -0
- package/src/component/forms/Color.vue +38 -0
- package/src/component/forms/DateTime.vue +170 -0
- package/src/component/forms/DateYearMonth.vue +193 -0
- package/src/component/forms/Dropdown.vue +236 -0
- package/src/component/forms/EditorHtml.vue +132 -0
- package/src/component/forms/FileUpload.vue +170 -0
- package/src/component/forms/ImageUpload.vue +214 -0
- package/src/component/forms/IncrementDecrement.vue +148 -0
- package/src/component/forms/InputAddressGoogle.vue +171 -0
- package/src/component/forms/InputCallToAction.vue +135 -0
- package/src/component/forms/InputDecimal.vue +153 -0
- package/src/component/forms/InputDecimalDiscount.vue +78 -0
- package/src/component/forms/InputNumber.vue +160 -0
- package/src/component/forms/InputPassword.vue +148 -0
- package/src/component/forms/InputTag.vue +125 -0
- package/src/component/forms/InputText.vue +174 -0
- package/src/component/forms/InputTextEdit.vue +69 -0
- package/src/component/forms/InputWhatsApp.vue +48 -0
- package/src/component/forms/Modal.vue +57 -0
- package/src/component/forms/RadioGroup.vue +91 -0
- package/src/component/forms/Select.vue +378 -0
- package/src/component/forms/SelectStatic.vue +198 -0
- package/src/component/forms/SideBar.vue +100 -0
- package/src/component/forms/Slider.vue +18 -0
- package/src/component/forms/TextArea.vue +138 -0
- package/src/component/forms/Toggle.vue +72 -0
- package/src/component/layout/Account.vue +131 -0
- package/src/component/layout/Alert.vue +88 -0
- package/src/component/layout/Badge.vue +111 -0
- package/src/component/layout/BarFloating.vue +68 -0
- package/src/component/layout/FixedBar.vue +103 -0
- package/src/component/layout/Gantt.vue +128 -0
- package/src/component/layout/Header.vue +56 -0
- package/src/component/layout/HideShow.vue +62 -0
- package/src/component/layout/IconMolded.vue +59 -0
- package/src/component/layout/LoadingFullPage.vue +27 -0
- package/src/component/layout/Menu.vue +287 -0
- package/src/component/layout/Molded.vue +30 -0
- package/src/component/layout/NewAccount.vue +136 -0
- package/src/component/layout/NewHeader.vue +60 -0
- package/src/component/layout/NewIconMolded.vue +71 -0
- package/src/component/layout/NewMenu.vue +456 -0
- package/src/component/layout/Panel.vue +185 -0
- package/src/component/layout/Popover.vue +126 -0
- package/src/component/layout/ScrollBar.vue +57 -0
- package/src/component/layout/Tab.vue +135 -0
- package/src/component/layout/Tag.vue +97 -0
- package/src/component/layout/Wizard.vue +211 -0
- package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
- package/src/component/rental/DisplayPeriodRent.vue +55 -0
- package/src/component/rental/DisplayTotalization.vue +86 -0
- package/src/component/report/Fields.vue +109 -0
- package/src/component/report/Report.vue +314 -0
- package/src/component/report/ReportTable.vue +112 -0
- package/src/component/report/Totalization.vue +34 -0
- package/src/component/shared/CodeEditor.vue +128 -0
- package/src/component/shared/Collapse.vue +131 -0
- package/src/component/shared/Confirmation.vue +74 -0
- package/src/component/shared/DocumentEditor.vue +99 -0
- package/src/component/shared/DocumentPreview.vue +81 -0
- package/src/component/shared/DocumentPublic.vue +33 -0
- package/src/component/shared/ExportExcel.vue +56 -0
- package/src/component/shared/ExportPDF.vue +116 -0
- package/src/component/shared/FullCalendar.vue +174 -0
- package/src/component/shared/HeaderReport.vue +47 -0
- package/src/component/shared/HorizontalFilter.vue +64 -0
- package/src/component/shared/ListNotifications.vue +70 -0
- package/src/component/shared/Loading.vue +107 -0
- package/src/component/shared/LoadingCard.vue +65 -0
- package/src/component/shared/LoadingMoreButton.vue +23 -0
- package/src/component/shared/Messages.vue +109 -0
- package/src/component/shared/PDFViewer.vue +24 -0
- package/src/component/shared/Pagination.vue +108 -0
- package/src/component/shared/ParameterLegend.vue +169 -0
- package/src/component/shared/ProgressBar.vue +25 -0
- package/src/component/shared/QueryButton.vue +66 -0
- package/src/component/shared/Report.vue +200 -0
- package/src/component/shared/SaveCancel.vue +99 -0
- package/src/component/shared/Search.vue +174 -0
- package/src/component/shared/SelectOption.vue +162 -0
- package/src/component/shared/Table.vue +174 -0
- package/src/component/shared/TableButton.vue +36 -0
- package/src/component/shared/TableDraggable.vue +117 -0
- package/src/component/shared/TableImport.vue +93 -0
- package/src/component/shared/TableItem.vue +214 -0
- package/src/component/shared/TableTotalPerPage.vue +78 -0
- package/src/component/shared/TableTotalRecords.vue +44 -0
- package/src/component/shared/TableTotalization.vue +47 -0
- package/src/component/shared/TimeLine.vue +42 -0
- package/src/component/shared/Timer.vue +78 -0
- package/src/component/shared/Tip.vue +42 -0
- package/src/component/shared/Toast.vue +69 -0
- package/src/component/shared/ToggleTheme.vue +128 -0
- package/src/component/shared/TotalizationReport.vue +86 -0
- package/src/component/shared/VerticalFilter.vue +97 -0
- package/src/component/shared/automation/ActivitiesList.vue +44 -0
- package/src/component/shared/automation/AddRule.vue +61 -0
- package/src/component/shared/automation/AutomationBuilder.vue +27 -0
- package/src/component/shared/automation/DynamicComponentList.vue +86 -0
- package/src/component/shared/automation/SelectRule.vue +98 -0
- package/src/component/shared/automation/components/BillingByRent.vue +98 -0
- package/src/component/shared/automation/components/SendEmail.vue +94 -0
- package/src/component/shared/file-manager/FileManager.vue +391 -0
- package/src/component/shared/filter-builder/FilterBuilder.vue +221 -0
- package/src/component/shared/filter-builder/FilterQuery.vue +94 -0
- package/src/component/shared/query-builder/AddRule.vue +203 -0
- package/src/component/shared/query-builder/ConvertToOdata.js +86 -0
- package/src/component/shared/query-builder/DynamicComponent.vue +161 -0
- package/src/component/shared/query-builder/DynamicComponentList.vue +70 -0
- package/src/component/shared/query-builder/Fields.vue +93 -0
- package/src/component/shared/query-builder/QueryBuilder.vue +69 -0
- package/src/component/shared/query-builder/Rules.vue +68 -0
- package/src/component/shared/query-builder/SelectRule.vue +97 -0
- package/src/component/shared/query-builder/Tags.vue +59 -0
- package/src/component/shared/query-builder/utilities.js +22 -0
- package/src/component/signature/Payment.vue +161 -0
- package/src/component/signature/Warning.vue +76 -0
- package/src/component/template/ListViewWithDataHandler.vue +429 -0
- package/src/component/template/ReportCreateUpdate.vue +110 -0
- package/src/component/template/ViewTemplateConfiguration.vue +64 -0
- package/src/component/template/ViewTemplateDocumentView.vue +213 -0
- package/src/component/template/ViewTemplateImportFile.vue +347 -0
- package/src/component/template/ViewTemplateReportList.vue +217 -0
- package/src/component/template/ViewTemplateReportPreview.vue +432 -0
- package/src/component/template/ViewTemplateSelectOption.vue +46 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
- package/src/component/template/ViewTemplateWithTable.vue +62 -0
- package/src/component/template/model/Report.js +6 -0
- package/src/component/training/Course.vue +344 -0
- package/src/component/training/CourseView.vue +190 -0
- package/src/component/value-objects/Address.js +11 -0
- package/src/component/value-objects/Address.vue +157 -0
- package/src/component/value-objects/Contact.js +7 -0
- package/src/component/value-objects/Contact.vue +106 -0
- package/src/component/value-objects/Person.js +10 -0
- package/src/component/value-objects/Person.vue +129 -0
- package/src/config/axios.js +9 -0
- package/src/config/dicas.js +15 -0
- package/src/config/router.js +14 -0
- package/src/config/token.js +15 -0
- package/src/main.js +23 -0
- package/src/store/modules/automation.js +31 -0
- package/src/store/modules/generic.js +816 -0
- package/src/store/modules/report.js +278 -0
- package/src/store/modules/user.js +67 -0
- package/src/store/modules/util.js +26 -0
- package/src/store/modules/validation.js +39 -0
- package/src/store/store.js +14 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div>
|
|
4
|
+
<div class="div-btn side-by-side">
|
|
5
|
+
<Button _key="btnShow" color="black" backGroundColor="#F0F0F0"
|
|
6
|
+
:title="' ' + quantitySelected + ' ' + title + ' selecionado(s)'"
|
|
7
|
+
classIcon="fa-sharp fa-solid fa-ballot-check" size="small" :clicked="showHide" />
|
|
8
|
+
</div>
|
|
9
|
+
<div v-show="show" class="side-by-side">
|
|
10
|
+
<div class="input-container">
|
|
11
|
+
<input type="text" v-model="baseParams.search" placeholder="Pesquisar..." />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
<div v-show="show">
|
|
17
|
+
<div class="div-loading">
|
|
18
|
+
<Loading type="line" :center="false" v-show="loading" />
|
|
19
|
+
</div>
|
|
20
|
+
<ScrollBar :minHeight="0" :maxHeight="200">
|
|
21
|
+
<div class="div-check">
|
|
22
|
+
<div class="div-items" v-for="item in data" :key="item.id">
|
|
23
|
+
<b-form-checkbox v-model="item.selected" @change="add(item)">
|
|
24
|
+
<span class="title">{{ item.content }}</span>
|
|
25
|
+
</b-form-checkbox>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div v-if="totalRecords > 20 && data.length < totalRecords">
|
|
29
|
+
<div class="after-list text-center">
|
|
30
|
+
<Button key="loadingMore" type="info" title="Carregar mais..." classIcon="fas fa-redo-alt" size="small"
|
|
31
|
+
:clicked="loadingMore" />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</ScrollBar>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
|
|
41
|
+
import ScrollBar from "@nixweb/nixloc-ui/src/component/layout/ScrollBar.vue";
|
|
42
|
+
import Loading from "@nixweb/nixloc-ui/src/component/shared/Loading.vue";
|
|
43
|
+
import InputText from "@nixweb/nixloc-ui/src/component/forms/InputText";
|
|
44
|
+
|
|
45
|
+
import { mapGetters, mapMutations, mapActions } from "vuex";
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
name: "CheckboxServer",
|
|
49
|
+
components: {
|
|
50
|
+
Button, ScrollBar, Loading, InputText
|
|
51
|
+
},
|
|
52
|
+
props: {
|
|
53
|
+
title: String,
|
|
54
|
+
url: String,
|
|
55
|
+
propsParams: Object,
|
|
56
|
+
value: Array,
|
|
57
|
+
},
|
|
58
|
+
data() {
|
|
59
|
+
return {
|
|
60
|
+
show: false,
|
|
61
|
+
loading: true,
|
|
62
|
+
data: [],
|
|
63
|
+
selected: [],
|
|
64
|
+
totalRecords: 0,
|
|
65
|
+
baseParams: {
|
|
66
|
+
search: "",
|
|
67
|
+
currentPage: 1,
|
|
68
|
+
totalPerPage: 20,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
mounted() {
|
|
73
|
+
this.getAll();
|
|
74
|
+
|
|
75
|
+
if (this.value.length > 0) {
|
|
76
|
+
this.selected = this.value;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
...mapGetters("generic", ["showModal", "event"]),
|
|
82
|
+
quantitySelected() {
|
|
83
|
+
return this.selected.length > 0 ? this.selected.length : 0;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
...mapMutations("generic", ["removeLoading"]),
|
|
88
|
+
...mapActions("generic", ["getApi"]),
|
|
89
|
+
getAll() {
|
|
90
|
+
let obj = { ...this.baseParams, ...this.propsParams };
|
|
91
|
+
let params = { url: this.url, obj: obj };
|
|
92
|
+
this.loading = true;
|
|
93
|
+
this.getApi(params).then((response) => {
|
|
94
|
+
this.totalRecords = response.content.totalRecords;
|
|
95
|
+
if (this.baseParams.currentPage == 1) {
|
|
96
|
+
this.data = [];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let self = this;
|
|
100
|
+
response.content.data.forEach(item => {
|
|
101
|
+
self.data.push(item);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
this.markSelected();
|
|
105
|
+
|
|
106
|
+
this.loading = false;
|
|
107
|
+
this.removeLoading(["loadingMore"]);
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
loadingMore() {
|
|
111
|
+
this.baseParams.currentPage++;
|
|
112
|
+
this.getAll();
|
|
113
|
+
},
|
|
114
|
+
add(item) {
|
|
115
|
+
const index = this.selected.indexOf(item.content);
|
|
116
|
+
if (index > -1) {
|
|
117
|
+
this.selected.splice(index, 1);
|
|
118
|
+
} else {
|
|
119
|
+
this.selected.push(item.content);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
showHide() {
|
|
123
|
+
this.show = this.show == true ? false : true;
|
|
124
|
+
this.removeLoading(["btnShow"]);
|
|
125
|
+
},
|
|
126
|
+
markSelected() {
|
|
127
|
+
this.data.forEach(item => {
|
|
128
|
+
if (this.selected.includes(item.content)) {
|
|
129
|
+
item.selected = true;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
watch: {
|
|
135
|
+
selected: {
|
|
136
|
+
handler(value) {
|
|
137
|
+
this.$emit("input", value);
|
|
138
|
+
},
|
|
139
|
+
deep: true,
|
|
140
|
+
},
|
|
141
|
+
'baseParams.search': {
|
|
142
|
+
handler(value) {
|
|
143
|
+
this.getAll();
|
|
144
|
+
},
|
|
145
|
+
deep: true,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<style scoped>
|
|
152
|
+
.div-check {
|
|
153
|
+
margin: 10px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.div-items {
|
|
157
|
+
margin-left: 10px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.div-loading {
|
|
161
|
+
margin-top: 3px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.div-btn {
|
|
165
|
+
padding-bottom: 5px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.div-icon {
|
|
169
|
+
margin-left: 10px;
|
|
170
|
+
font-size: 16px;
|
|
171
|
+
color: green;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.input-container {
|
|
176
|
+
display: flex;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
margin: 20px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
input {
|
|
182
|
+
padding-left: 10px;
|
|
183
|
+
padding-right: 10px;
|
|
184
|
+
padding-top: 4px;
|
|
185
|
+
padding-bottom: 4px;
|
|
186
|
+
border: 1px solid #E5E4E8;
|
|
187
|
+
border-radius: 20px;
|
|
188
|
+
outline: none;
|
|
189
|
+
font-size: 13px;
|
|
190
|
+
width: 300px;
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<b-form-checkbox v-model="valueLocal" :value="true" :unchecked-value="false">
|
|
4
|
+
<span class="title">{{ title }}</span>
|
|
5
|
+
<Tip :field="field" :formName="formName" />
|
|
6
|
+
</b-form-checkbox>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import Tip from "../shared/Tip.vue";
|
|
12
|
+
|
|
13
|
+
import { mapMutations } from "vuex";
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
components: { Tip },
|
|
17
|
+
name: "CheckboxSimple",
|
|
18
|
+
props: {
|
|
19
|
+
title: String,
|
|
20
|
+
formName: String,
|
|
21
|
+
fieldTarget: String,
|
|
22
|
+
field: String,
|
|
23
|
+
value: Boolean,
|
|
24
|
+
changed: Function,
|
|
25
|
+
params: Object,
|
|
26
|
+
markFormDirty: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
valueLocal: false,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
...mapMutations("validation", ["updateFormDirty"]),
|
|
38
|
+
...mapMutations("generic", ["addFilter"]),
|
|
39
|
+
},
|
|
40
|
+
mounted() {
|
|
41
|
+
this.valueLocal = this.value;
|
|
42
|
+
},
|
|
43
|
+
watch: {
|
|
44
|
+
value() {
|
|
45
|
+
this.valueLocal = this.value;
|
|
46
|
+
},
|
|
47
|
+
valueLocal() {
|
|
48
|
+
this.$emit("input", this.valueLocal);
|
|
49
|
+
if (this.markFormDirty) this.updateFormDirty(true);
|
|
50
|
+
if (this.changed) this.changed(this.params);
|
|
51
|
+
|
|
52
|
+
if (this.fieldTarget) {
|
|
53
|
+
let obj = { fieldTarget: this.fieldTarget, value: this.valueLocal ? "true" : "false" };
|
|
54
|
+
this.addFilter(obj);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="form-group">
|
|
3
|
+
<div>
|
|
4
|
+
<span class="title">{{ title }} </span>
|
|
5
|
+
<compact-picker v-model.trim="color.hex" />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { Chrome } from "vue-color";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: "Color",
|
|
15
|
+
components: {
|
|
16
|
+
"compact-picker": Chrome,
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
title: String,
|
|
20
|
+
field: String,
|
|
21
|
+
formName: String,
|
|
22
|
+
value: String,
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
color: { hex: "#40BF84" },
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
watch: {
|
|
30
|
+
value() {
|
|
31
|
+
this.color.hex = this.value;
|
|
32
|
+
},
|
|
33
|
+
"color.hex": function (value) {
|
|
34
|
+
if (value.hex) this.$emit("input", value.hex);
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,170 @@
|
|
|
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 v-if="notifications.length > 0 && formDirty" class="required glyphicon fas fa-exclamation-triangle"></i>
|
|
10
|
+
<date-picker lang="pt-br" :disabled="disabled" :range="range" @confirm="executeConfirm" @change="executeConfirm"
|
|
11
|
+
@clear="close" :confirm="confirm" :confirm-text="confirmText" :format="format" value-type="format"
|
|
12
|
+
:time-picker-options="{
|
|
13
|
+
start: '07:00',
|
|
14
|
+
step: '00:30',
|
|
15
|
+
end: '23:30',
|
|
16
|
+
format: 'HH:mm',
|
|
17
|
+
}" width="100%" :placeholder="placeholder" :type="type" v-model="valueLocal"
|
|
18
|
+
:class="{ 'is-invalid': notifications.length > 0 && formDirty }"></date-picker>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div v-if="formDirty">
|
|
22
|
+
<div v-for="message in notifications" :key="message">
|
|
23
|
+
<span class="invalid">{{ message }}</span>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
import Tip from "../shared/Tip";
|
|
31
|
+
import DatePicker from "vue2-datepicker";
|
|
32
|
+
|
|
33
|
+
import { mapState, mapMutations, mapGetters } from "vuex";
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
components: { Tip, DatePicker },
|
|
37
|
+
name: "Data",
|
|
38
|
+
mixins: [],
|
|
39
|
+
props: [
|
|
40
|
+
"title",
|
|
41
|
+
"field",
|
|
42
|
+
"fieldTarget",
|
|
43
|
+
"placeholder",
|
|
44
|
+
"formName",
|
|
45
|
+
"required",
|
|
46
|
+
"disabled",
|
|
47
|
+
"format",
|
|
48
|
+
"type",
|
|
49
|
+
"value",
|
|
50
|
+
"range",
|
|
51
|
+
"confirm",
|
|
52
|
+
"confirmText",
|
|
53
|
+
"markFormDirty",
|
|
54
|
+
],
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
notifications: [],
|
|
58
|
+
formDirty: false,
|
|
59
|
+
valueLocal: "",
|
|
60
|
+
markFormDirtyLocal: false,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
created() {
|
|
64
|
+
this.validate();
|
|
65
|
+
this.valueLocal = this.value;
|
|
66
|
+
|
|
67
|
+
if (this.markFormDirty == undefined) this.markFormDirtyLocal = true;
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
...mapMutations("validation", [
|
|
71
|
+
"addValidation",
|
|
72
|
+
"removeValidation",
|
|
73
|
+
"updateFormDirty",
|
|
74
|
+
]),
|
|
75
|
+
...mapMutations("generic", ["addFilter", "removeTag", "addEvent"]),
|
|
76
|
+
validate() {
|
|
77
|
+
this.notifications = [];
|
|
78
|
+
|
|
79
|
+
if (this.required && this.valueLocal.length == 0) {
|
|
80
|
+
var message = `${this.title} não pode ser vazio!`;
|
|
81
|
+
this.notifications.push(message);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
executeConfirm() {
|
|
85
|
+
if (this.range) {
|
|
86
|
+
if (this.fieldTarget) {
|
|
87
|
+
let obj = {
|
|
88
|
+
fieldTarget: this.fieldTarget,
|
|
89
|
+
value: { start: this.valueLocal[0], end: this.valueLocal[1] },
|
|
90
|
+
};
|
|
91
|
+
this.addFilter(obj);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
close() {
|
|
96
|
+
this.removeTag("period");
|
|
97
|
+
this.addEvent({ name: "tagRemoved", data: "period" });
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
computed: {
|
|
101
|
+
...mapState("validation", ["resetForm", "validations"]),
|
|
102
|
+
...mapGetters("generic", ["event"]),
|
|
103
|
+
},
|
|
104
|
+
watch: {
|
|
105
|
+
valueLocal() {
|
|
106
|
+
this.validate();
|
|
107
|
+
this.formDirty = true;
|
|
108
|
+
if (this.markFormDirtyLocal) this.updateFormDirty(true);
|
|
109
|
+
this.$emit("input", this.valueLocal);
|
|
110
|
+
},
|
|
111
|
+
value() {
|
|
112
|
+
this.valueLocal = this.value;
|
|
113
|
+
if (this.markFormDirty) this.updateFormDirty(true);
|
|
114
|
+
},
|
|
115
|
+
notifications() {
|
|
116
|
+
let self = this;
|
|
117
|
+
this.notifications.forEach(function (notification) {
|
|
118
|
+
let obj = {
|
|
119
|
+
key: self.field + "&" + self.formName,
|
|
120
|
+
formName: self.formName,
|
|
121
|
+
notification: notification,
|
|
122
|
+
};
|
|
123
|
+
self.addValidation(obj);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
if (this.notifications.length == 0) {
|
|
127
|
+
let obj = {
|
|
128
|
+
key: self.field + "&" + self.formName,
|
|
129
|
+
formName: self.formName,
|
|
130
|
+
};
|
|
131
|
+
self.removeValidation(obj);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
resetForm: {
|
|
135
|
+
handler(form) {
|
|
136
|
+
if (form.name == this.formName) this.formDirty = false;
|
|
137
|
+
},
|
|
138
|
+
deep: true,
|
|
139
|
+
},
|
|
140
|
+
event: {
|
|
141
|
+
handler(event) {
|
|
142
|
+
if (event.name == "tagRemoved") {
|
|
143
|
+
this.valueLocal = [];
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
deep: true,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<style scoped>
|
|
154
|
+
.title {
|
|
155
|
+
font-size: 14px !important;
|
|
156
|
+
font-weight: 400 !important;
|
|
157
|
+
color: #0a0a0a;
|
|
158
|
+
letter-spacing: 0.5px !important;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.success {
|
|
162
|
+
color: #94aa2a;
|
|
163
|
+
font-size: 14px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.invalid {
|
|
167
|
+
color: #f0134d;
|
|
168
|
+
font-size: 14px;
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="date-filter">
|
|
3
|
+
<button @click="previous" class="navigation-button" :class="[buttonClass, { 'disabled': disabled }]"
|
|
4
|
+
:disabled="disabled">
|
|
5
|
+
<i class="fa-solid fa-chevron-left"></i>
|
|
6
|
+
</button>
|
|
7
|
+
<span class="date-display" :class="{ 'title-disabled': disabled }">{{ displayValue }} </span>
|
|
8
|
+
<span class="date-icon" @click="resetSelection()" :class="{ 'disabled': disabled }">
|
|
9
|
+
<i class="fa-solid fa-calendar-week"></i>
|
|
10
|
+
</span>
|
|
11
|
+
<button @click="next" class="navigation-button" :class="[buttonClass, { 'disabled': disabled }]"
|
|
12
|
+
:disabled="disabled">
|
|
13
|
+
<i class="fa-solid fa-chevron-right"></i>
|
|
14
|
+
</button>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { mapMutations } from "vuex";
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
props: {
|
|
23
|
+
mode: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
validator(value) {
|
|
27
|
+
return ['month', 'year'].includes(value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
value: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
currentMonth: new Date().getMonth(),
|
|
42
|
+
currentYear: new Date().getFullYear()
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
created() {
|
|
46
|
+
this.resetSelection();
|
|
47
|
+
},
|
|
48
|
+
mounted() {
|
|
49
|
+
this.sendEvent();
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
displayValue() {
|
|
53
|
+
if (this.mode === 'month') {
|
|
54
|
+
return this.monthNames[this.currentMonth];
|
|
55
|
+
} else {
|
|
56
|
+
return this.currentYear;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
monthNames() {
|
|
60
|
+
return ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];
|
|
61
|
+
},
|
|
62
|
+
buttonClass() {
|
|
63
|
+
return this.mode === 'month' ? 'month-mode' : 'year-mode';
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
methods: {
|
|
67
|
+
...mapMutations("generic", ["addEvent"]),
|
|
68
|
+
previous() {
|
|
69
|
+
if (this.disabled) return;
|
|
70
|
+
if (this.mode === 'month') {
|
|
71
|
+
this.currentMonth = (this.currentMonth + 11) % 12;
|
|
72
|
+
if (this.currentMonth === 11) {
|
|
73
|
+
this.currentYear--;
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
this.currentYear--;
|
|
77
|
+
}
|
|
78
|
+
this.$emit('input', this.getValue());
|
|
79
|
+
this.sendEvent();
|
|
80
|
+
},
|
|
81
|
+
next() {
|
|
82
|
+
if (this.disabled) return;
|
|
83
|
+
if (this.mode === 'month') {
|
|
84
|
+
this.currentMonth = (this.currentMonth + 1) % 12;
|
|
85
|
+
if (this.currentMonth === 0) {
|
|
86
|
+
this.currentYear++;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
this.currentYear++;
|
|
90
|
+
}
|
|
91
|
+
this.$emit('input', this.getValue());
|
|
92
|
+
this.sendEvent();
|
|
93
|
+
},
|
|
94
|
+
resetSelection() {
|
|
95
|
+
const now = new Date();
|
|
96
|
+
if (this.mode === 'month') {
|
|
97
|
+
this.currentMonth = now.getMonth();
|
|
98
|
+
this.currentYear = now.getFullYear();
|
|
99
|
+
} else {
|
|
100
|
+
this.currentYear = now.getFullYear();
|
|
101
|
+
}
|
|
102
|
+
this.sendEvent();
|
|
103
|
+
},
|
|
104
|
+
getValue() {
|
|
105
|
+
if (this.mode === 'month') {
|
|
106
|
+
return (this.currentMonth + 1).toString();
|
|
107
|
+
} else {
|
|
108
|
+
return this.currentYear.toString();
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
sendEvent() {
|
|
112
|
+
this.addEvent({ name: "dateYearMonth", data: { mode: this.mode, value: this.getValue() } });
|
|
113
|
+
this.$emit('input', this.getValue());
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
watch: {
|
|
117
|
+
mode(newMode) {
|
|
118
|
+
this.resetSelection();
|
|
119
|
+
},
|
|
120
|
+
value(newValue) {
|
|
121
|
+
if (this.mode === 'month') {
|
|
122
|
+
this.currentMonth = newValue - 1;
|
|
123
|
+
} else {
|
|
124
|
+
this.currentYear = newValue;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
</script>
|
|
130
|
+
|
|
131
|
+
<style scoped>
|
|
132
|
+
.date-filter {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
gap: 20px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.navigation-button {
|
|
140
|
+
color: white;
|
|
141
|
+
border: none;
|
|
142
|
+
border-radius: 50%;
|
|
143
|
+
width: 30px;
|
|
144
|
+
height: 30px;
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
font-size: 1.2em;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
transition: background-color 0.3s, transform 0.2s;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.navigation-button:hover {
|
|
154
|
+
opacity: 0.8;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.navigation-button:active {
|
|
158
|
+
transform: scale(0.95);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.navigation-button.disabled {
|
|
162
|
+
background-color: #b0b0b0;
|
|
163
|
+
opacity: 0.5;
|
|
164
|
+
cursor: not-allowed;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.date-display {
|
|
168
|
+
font-size: 1.5em;
|
|
169
|
+
font-weight: bold;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.month-mode {
|
|
173
|
+
background-color: #ffa500;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.year-mode {
|
|
177
|
+
background-color: #007bff;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.date-icon {
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
color: rgb(73, 72, 72);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.title-disabled {
|
|
186
|
+
color: #b0b0b0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.date-icon.disabled {
|
|
190
|
+
color: #b0b0b0;
|
|
191
|
+
cursor: not-allowed;
|
|
192
|
+
}
|
|
193
|
+
</style>
|