@nixweb/nixloc-ui 0.0.125 → 0.0.128

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.
Files changed (111) hide show
  1. package/docs/src/component/template/ViewTemplateReportPreview.drawio +210 -0
  2. package/package.json +79 -77
  3. package/src/App.vue +13 -13
  4. package/src/component/forms/Button.vue +170 -169
  5. package/src/component/forms/CheckboxGroup.vue +72 -63
  6. package/src/component/forms/CheckboxSimple.vue +46 -27
  7. package/src/component/forms/Color.vue +38 -38
  8. package/src/component/forms/DateTime.vue +167 -177
  9. package/src/component/forms/Dropdown.vue +218 -224
  10. package/src/component/forms/EditorHtml.vue +126 -123
  11. package/src/component/forms/FileUpload.vue +185 -189
  12. package/src/component/forms/ImageUpload.vue +230 -0
  13. package/src/component/forms/IncrementDecrement.vue +101 -0
  14. package/src/component/forms/InputDecimal.vue +142 -137
  15. package/src/component/forms/InputNumber.vue +154 -149
  16. package/src/component/forms/InputPassword.vue +135 -135
  17. package/src/component/forms/InputText.vue +162 -157
  18. package/src/component/forms/Modal.vue +65 -60
  19. package/src/component/forms/RadioGroup.vue +50 -50
  20. package/src/component/forms/Select.vue +349 -337
  21. package/src/component/forms/SelectStatic.vue +127 -120
  22. package/src/component/forms/Slider.vue +18 -18
  23. package/src/component/forms/TextArea.vue +126 -126
  24. package/src/component/layout/Alert.vue +92 -92
  25. package/src/component/layout/Badge.vue +103 -103
  26. package/src/component/layout/FixedBar.vue +100 -68
  27. package/src/component/layout/Header.vue +38 -35
  28. package/src/component/layout/LoadingFullPage.vue +27 -27
  29. package/src/component/layout/Menu.vue +210 -214
  30. package/src/component/layout/Molded.vue +28 -27
  31. package/src/component/layout/Panel.vue +140 -142
  32. package/src/component/layout/Popover.vue +126 -126
  33. package/src/component/layout/ScrollBar.vue +42 -43
  34. package/src/component/layout/Tab.vue +135 -0
  35. package/src/component/layout/Tag.vue +3 -3
  36. package/src/component/layout/Wizard.vue +211 -213
  37. package/src/component/rental/DisplayPeriodRent.vue +81 -0
  38. package/src/component/rental/DisplayTotalization.vue +47 -0
  39. package/src/component/shared/Collapse.vue +131 -131
  40. package/src/component/shared/Confirmation.vue +2 -2
  41. package/src/component/shared/DocumentEditor.vue +1 -1
  42. package/src/component/shared/DocumentPreview.vue +1 -1
  43. package/src/component/shared/DocumentPublic.vue +34 -0
  44. package/src/component/shared/ExportExcel.vue +1 -8
  45. package/src/component/shared/ExportPDF.vue +116 -116
  46. package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +4 -4
  47. package/src/component/shared/HorizontalFilter.vue +59 -59
  48. package/src/component/shared/Loading.vue +107 -107
  49. package/src/component/shared/LoadingMoreButton.vue +23 -23
  50. package/src/component/shared/Messages.vue +81 -83
  51. package/src/component/shared/PDFViewer.vue +22 -22
  52. package/src/component/shared/Pagination.vue +52 -53
  53. package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +22 -26
  54. package/src/component/shared/ProgressBar.vue +22 -21
  55. package/src/component/shared/QueryButton.vue +66 -66
  56. package/src/component/shared/Report.vue +187 -0
  57. package/src/component/shared/SaveCancel.vue +26 -5
  58. package/src/component/shared/Search.vue +154 -154
  59. package/src/component/shared/SelectOption.vue +146 -0
  60. package/src/component/shared/Table.vue +163 -243
  61. package/src/component/shared/TableButton.vue +36 -36
  62. package/src/component/shared/TableDraggable.vue +127 -0
  63. package/src/component/shared/TableItem.vue +177 -0
  64. package/src/component/shared/TableTotalRecords.vue +9 -10
  65. package/src/component/shared/TableTotalization.vue +47 -47
  66. package/src/component/shared/Tip.vue +42 -42
  67. package/src/component/shared/Toast.vue +54 -54
  68. package/src/component/shared/TotalizationReport.vue +59 -0
  69. package/src/component/shared/VerticalFilter.vue +97 -145
  70. package/src/component/shared/query-builder/AddRule.vue +181 -187
  71. package/src/component/shared/query-builder/ConvertToOdata.js +34 -43
  72. package/src/component/shared/query-builder/DynamicComponent.vue +21 -16
  73. package/src/component/shared/query-builder/DynamicComponentList.vue +73 -0
  74. package/src/component/shared/query-builder/Fields.vue +29 -63
  75. package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
  76. package/src/component/shared/query-builder/Rules.vue +2 -14
  77. package/src/component/shared/query-builder/SelectRule.vue +15 -15
  78. package/src/component/shared/query-builder/Tags.vue +24 -8
  79. package/src/component/shared/query-builder/utilities.js +21 -21
  80. package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +260 -231
  81. package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +40 -22
  82. package/src/component/template/ViewTemplateConfiguration.vue +64 -69
  83. package/src/component/template/ViewTemplateDocumentView.vue +22 -25
  84. package/src/component/template/ViewTemplateReportList.vue +39 -57
  85. package/src/component/template/ViewTemplateReportPreview.vue +270 -341
  86. package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
  87. package/src/component/template/ViewTemplateSelectOption.vue +60 -0
  88. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
  89. package/src/component/template/ViewTemplateWithTable.vue +56 -49
  90. package/src/component/template/model/Report.js +2 -2
  91. package/src/component/value-objects/Address.js +11 -0
  92. package/src/component/value-objects/{Endereco.vue → Address.vue} +39 -40
  93. package/src/component/value-objects/{DadosContato.js → Contact.js} +2 -2
  94. package/src/component/value-objects/{DadosContato.vue → Contact.vue} +24 -17
  95. package/src/component/value-objects/Person.js +10 -0
  96. package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +50 -35
  97. package/src/config/axios.js +9 -9
  98. package/src/config/dicas.js +14 -14
  99. package/src/config/router.js +13 -13
  100. package/src/config/token.js +14 -14
  101. package/src/main.js +23 -23
  102. package/src/store/modules/generic.js +512 -488
  103. package/src/store/modules/report.js +156 -127
  104. package/src/store/modules/user.js +6 -0
  105. package/src/store/modules/validation.js +38 -38
  106. package/src/store/store.js +13 -13
  107. package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
  108. package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
  109. package/src/component/shared/query-builder/Totalization.vue +0 -38
  110. package/src/component/value-objects/DadosPessoa.js +0 -10
  111. package/src/component/value-objects/Endereco.js +0 -11
@@ -1,337 +1,349 @@
1
- <template>
2
- <div>
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
9
- class="select"
10
- :class="{
11
- 'select-invalid': notifications.length > 0 && formDirty,
12
- border: showBorder,
13
- }"
14
- >
15
- <multiselect
16
- @open="onOpen"
17
- @select="onSelected"
18
- @search-change="onSearch"
19
- :options="data"
20
- v-model.trim="currentValue"
21
- :custom-label="label"
22
- placeholder
23
- :disabled="disabled"
24
- :showLabels="true"
25
- :noResult="false"
26
- :maxHeight="250"
27
- ref="multiselect"
28
- selectLabel
29
- deselectLabel
30
- selectedLabel
31
- >
32
- <div slot="beforeList">
33
- <vue-loading
34
- v-if="loading"
35
- type="bubbles"
36
- color="#577696"
37
- :size="{ width: '40px', height: '40px' }"
38
- ></vue-loading>
39
- <div class="before-list" v-if="!loading">
40
- <Button
41
- v-if="nameNewRegister"
42
- key="addNewRegister"
43
- type="primary"
44
- title="Novo"
45
- size="small"
46
- :clicked="addNewRegister"
47
- />
48
- <Button
49
- key="cleanSelect"
50
- type="warning"
51
- classIcon="fas fa-broom"
52
- size="small"
53
- :clicked="cleanSelect"
54
- />
55
- </div>
56
- </div>
57
- <div slot="afterList" v-if="totalRecords > 20 && data.length < totalRecords">
58
- <div class="after-list text-center">
59
- <Button
60
- key="loadingMore"
61
- type="info"
62
- title="Carregar mais..."
63
- classIcon="fas fa-redo-alt"
64
- size="small"
65
- :clicked="loadingMore"
66
- />
67
- </div>
68
- </div>
69
- <div slot="noOptions">Lista está vazia</div>
70
- <div slot="noResult">Nenhum registro encontrado</div>
71
- </multiselect>
72
- <div v-if="formDirty">
73
- <div v-for="message in notifications" :key="message">
74
- <span class="invalid">{{ message }}</span>
75
- </div>
76
- </div>
77
- </div>
78
-
79
- <vodal
80
- v-if="nameNewRegister"
81
- :show="showVodal(nameNewRegister)"
82
- @hide="hideVodal()"
83
- :width="widthNewRegister"
84
- :height="heightNewRegister"
85
- :closeOnEsc="true"
86
- :closeButton="true"
87
- >
88
- <Messages v-if="vodal.open" />
89
- <div class="title-new-form">{{ titleNewRegister }}</div>
90
- <hr />
91
- <slot></slot>
92
- </vodal>
93
- </div>
94
- </template>
95
- <script>
96
- import Tip from "../shared/Tip.vue";
97
- import Messages from "../shared/Messages.vue";
98
- import Multiselect from "vue-multiselect";
99
-
100
- import Button from "./Button.vue";
101
- import Vodal from "vodal";
102
-
103
- import { mapState, mapActions, mapMutations, mapGetters } from "vuex";
104
-
105
- export default {
106
- name: "Select",
107
- props: {
108
- title: String,
109
- field: String,
110
- formName: String,
111
- required: Boolean,
112
- url: String,
113
- disabled: Boolean,
114
- fieldTarget: String,
115
- propsParams: Object,
116
- value: Object,
117
- changed: Function,
118
- nameNewRegister: String,
119
- titleNewRegister: String,
120
- widthNewRegister: Number,
121
- heightNewRegister: Number,
122
- markFormDirty: {
123
- type: Boolean,
124
- default: true,
125
- },
126
- showBorder: {
127
- type: Boolean,
128
- default: true,
129
- },
130
- },
131
- components: {
132
- Multiselect,
133
- Button,
134
- Vodal,
135
- Messages,
136
- Tip,
137
- },
138
- data() {
139
- return {
140
- currentValue: {},
141
- data: [],
142
- totalRecords: 0,
143
- baseParams: {
144
- search: "",
145
- currentPage: 1,
146
- totalPerPage: 20,
147
- },
148
-
149
- registerNew: false,
150
- loading: true,
151
- notifications: [],
152
- formDirty: false,
153
- };
154
- },
155
- created() {
156
- this.validate();
157
- if (this.value)
158
- this.currentValue = { id: this.value.id, conteudo: this.value.content };
159
- },
160
- mounted() {
161
- let el = this.$el.getElementsByClassName("multiselect")[0];
162
- if (el) {
163
- el.tabIndex = 0;
164
- }
165
- },
166
- computed: {
167
- ...mapState("validation", ["resetForm", "vodal"]),
168
- ...mapState("generic", ["vodal"]),
169
- ...mapGetters("generic", ["showVodal"]),
170
- },
171
- methods: {
172
- ...mapActions("generic", ["getApi"]),
173
- ...mapMutations("generic", [
174
- "removeLoading",
175
- "showVodal",
176
- "hideVodal",
177
- "removeNotificarions",
178
- "addFilter",
179
- ]),
180
- ...mapMutations("validation", [
181
- "addValidation",
182
- "removeValidation",
183
- "resetValidation",
184
- "updateFormDirty",
185
- ]),
186
- onOpen() {
187
- this.getAll();
188
- },
189
- onSelected(value) {
190
- this.$emit("input", value);
191
- if (this.changed) this.changed();
192
- if (this.fieldTarget) {
193
- let obj = { fieldTarget: this.fieldTarget, value: value.id };
194
- this.addFilter(obj);
195
- }
196
- },
197
- onSearch(value) {
198
- this.baseParams.search = value;
199
- this.getAll();
200
- },
201
- label(value) {
202
- if (value.conteudo) return `${value.conteudo}`;
203
- },
204
- getAll() {
205
- let obj = { ...this.baseParams, ...this.propsParams };
206
- let params = { url: this.url, obj: obj };
207
- this.loading = true;
208
- this.getApi(params).then((response) => {
209
- this.totalRecords = response.content.totalRecords;
210
- let self = this;
211
- if (this.baseParams.currentPage == 1) {
212
- this.data = [];
213
- }
214
- response.conteudo.data.map(function (value, key) {
215
- self.data.push(value);
216
- });
217
- this.loading = false;
218
- this.removeLoading(["loadingMore"]);
219
- });
220
- },
221
- addNewRegister() {
222
- this.showVodal(this.nameNewRegister);
223
- this.resetValidation(this.nameNewRegister);
224
- this.removeNotificarions();
225
- this.$refs.multiselect.deactivate();
226
- this.removeLoading(["addNewRegister"]);
227
- },
228
- hideVodal() {
229
- this.hideVodal();
230
- },
231
- cleanSelect() {
232
- let obj = { id: "", conteudo: "" };
233
- this.currentValue = obj;
234
- this.$emit("input", obj);
235
- this.$refs.multiselect.deactivate();
236
- this.removeLoading(["cleanSelect"]);
237
-
238
- if (this.fieldTarget) {
239
- let obj = { fieldTarget: this.fieldTarget, value: "" };
240
- this.addFilter(obj);
241
- }
242
- },
243
- loadingMore() {
244
- this.baseParams.currentPage++;
245
- this.getAll();
246
- },
247
- validate() {
248
- this.notifications = [];
249
- if (this.required && !this.value.id) {
250
- var message = `${this.title} não pode ser vazio!`;
251
- this.notifications.push(message);
252
- }
253
- },
254
- },
255
- watch: {
256
- "value.id": function () {
257
- this.validate();
258
- this.formDirty = true;
259
- if (this.markFormDirty) this.updateFormDirty(true);
260
- this.currentValue = { id: this.value.id, conteudo: this.value.conteudo };
261
- },
262
- notifications() {
263
- let self = this;
264
- this.notifications.forEach(function (notification) {
265
- let obj = {
266
- key: self.field + "&" + self.formName,
267
- formName: self.formName,
268
- notification: notification,
269
- };
270
- self.addValidation(obj);
271
- });
272
-
273
- if (this.notifications.length == 0) {
274
- let obj = {
275
- key: self.field + "&" + self.formName,
276
- formName: self.formName,
277
- };
278
- self.removeValidation(obj);
279
- }
280
- },
281
- resetForm: {
282
- handler(form) {
283
- if (form.nome == this.formName) {
284
- let obj = { id: "", conteudo: "" };
285
- this.currentValue = obj;
286
- this.$emit("input", obj);
287
- this.formDirty = false;
288
- }
289
- },
290
- deep: true,
291
- },
292
- "vodal.open": function (value) {
293
- if (!value) this.registerNew = false;
294
- },
295
- },
296
- };
297
- </script>
298
-
299
- <style scoped>
300
- div.before-list {
301
- padding: 8px;
302
- }
303
-
304
- div.after-list {
305
- padding: 8px;
306
- }
307
-
308
- .invalid {
309
- color: #f0134d;
310
- font-size: 14px;
311
- }
312
-
313
- .select {
314
- height: 36px;
315
- border-bottom: 1px solid #d6dadf;
316
- border-radius: 0px !important;
317
- }
318
-
319
- .select-invalid {
320
- border-bottom: 1px solid #ff5454;
321
- }
322
-
323
- .select-valid {
324
- border-bottom: 1px solid #94aa2a;
325
- }
326
-
327
- .title-new-form {
328
- font-size: 18px;
329
- margin-bottom: 5px;
330
- }
331
-
332
- .border {
333
- border: 1px solid #dbdee0 !important;
334
- border-radius: 5px !important;
335
- height: 38px !important;
336
- }
337
- </style>
1
+ <template>
2
+ <div class="margin">
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
9
+ class="select"
10
+ :class="{
11
+ 'select-invalid': notifications.length > 0 && formDirty,
12
+ border: showBorder,
13
+ }"
14
+ >
15
+ <multiselect
16
+ @open="onOpen"
17
+ @select="onSelected"
18
+ @search-change="onSearch"
19
+ :options="data"
20
+ v-model.trim="currentValue"
21
+ :custom-label="label"
22
+ placeholder
23
+ :disabled="disabled"
24
+ :showLabels="true"
25
+ :noResult="false"
26
+ :maxHeight="250"
27
+ ref="multiselect"
28
+ selectLabel
29
+ deselectLabel
30
+ selectedLabel
31
+ >
32
+ <div slot="beforeList">
33
+ <vue-loading
34
+ v-if="loading"
35
+ type="bubbles"
36
+ color="#577696"
37
+ :size="{ width: '40px', height: '40px' }"
38
+ ></vue-loading>
39
+ <div class="before-list" v-if="!loading">
40
+ <Button
41
+ v-if="showNewRegister"
42
+ key="addNewRegister"
43
+ type="primary"
44
+ title="Novo"
45
+ size="small"
46
+ :clicked="addNewRegister"
47
+ />
48
+ <Button
49
+ key="cleanSelect"
50
+ type="warning"
51
+ classIcon="fas fa-broom"
52
+ size="small"
53
+ :clicked="cleanSelect"
54
+ />
55
+ </div>
56
+ </div>
57
+ <div slot="afterList" v-if="totalRecords > 20 && data.length < totalRecords">
58
+ <div class="after-list text-center">
59
+ <Button
60
+ key="loadingMore"
61
+ type="info"
62
+ title="Carregar mais..."
63
+ classIcon="fas fa-redo-alt"
64
+ size="small"
65
+ :clicked="loadingMore"
66
+ />
67
+ </div>
68
+ </div>
69
+ <div slot="noOptions">Lista está vazia</div>
70
+ <div slot="noResult">Nenhum registro encontrado</div>
71
+ </multiselect>
72
+ <div v-if="formDirty">
73
+ <div v-for="message in notifications" :key="message">
74
+ <span class="invalid">{{ message }}</span>
75
+ </div>
76
+ </div>
77
+ </div>
78
+
79
+ <vodal
80
+ v-if="nameNewRegister"
81
+ :duration="50"
82
+ :show="showVodal(nameNewRegister)"
83
+ @hide="hide()"
84
+ :width="widthNewRegister"
85
+ :height="heightNewRegister"
86
+ :closeOnEsc="true"
87
+ :closeButton="true"
88
+ >
89
+ <Messages v-if="vodal.open" />
90
+ <div class="title-new-form">{{ titleNewRegister }}</div>
91
+ <hr class="hr" />
92
+ <slot></slot>
93
+ </vodal>
94
+ </div>
95
+ </template>
96
+ <script>
97
+ import Tip from "../shared/Tip.vue";
98
+ import Messages from "../shared/Messages.vue";
99
+ import Multiselect from "vue-multiselect";
100
+
101
+ import Button from "./Button.vue";
102
+ import Vodal from "vodal";
103
+
104
+ import { mapState, mapActions, mapMutations, mapGetters } from "vuex";
105
+
106
+ export default {
107
+ name: "Select",
108
+ props: {
109
+ title: String,
110
+ field: String,
111
+ formName: String,
112
+ required: Boolean,
113
+ url: String,
114
+ disabled: Boolean,
115
+ fieldTarget: String,
116
+ propsParams: Object,
117
+ value: Object,
118
+ changed: Function,
119
+ nameNewRegister: String,
120
+ showNewRegister: {
121
+ type: Boolean,
122
+ default: true,
123
+ },
124
+ titleNewRegister: String,
125
+ widthNewRegister: Number,
126
+ heightNewRegister: Number,
127
+ markFormDirty: {
128
+ type: Boolean,
129
+ default: true,
130
+ },
131
+ showBorder: {
132
+ type: Boolean,
133
+ default: true,
134
+ },
135
+ },
136
+ components: {
137
+ Multiselect,
138
+ Button,
139
+ Vodal,
140
+ Messages,
141
+ Tip,
142
+ },
143
+ data() {
144
+ return {
145
+ currentValue: {},
146
+ data: [],
147
+ totalRecords: 0,
148
+ baseParams: {
149
+ search: "",
150
+ currentPage: 1,
151
+ totalPerPage: 20,
152
+ },
153
+
154
+ registerNew: false,
155
+ loading: true,
156
+ notifications: [],
157
+ formDirty: false,
158
+ };
159
+ },
160
+ created() {
161
+ this.validate();
162
+ if (this.value)
163
+ this.currentValue = { id: this.value.id, content: this.value.content };
164
+ },
165
+ mounted() {
166
+ let el = this.$el.getElementsByClassName("multiselect")[0];
167
+ if (el) {
168
+ el.tabIndex = 0;
169
+ }
170
+ },
171
+ computed: {
172
+ ...mapState("validation", ["resetForm", "vodal"]),
173
+ ...mapState("generic", ["vodal"]),
174
+ ...mapGetters("generic", ["showVodal"]),
175
+ },
176
+ methods: {
177
+ ...mapActions("generic", ["getApi"]),
178
+ ...mapMutations("generic", [
179
+ "removeLoading",
180
+ "openVodal",
181
+ "hideVodal",
182
+ "removeNotificarions",
183
+ "addFilter",
184
+ ]),
185
+ ...mapMutations("validation", [
186
+ "addValidation",
187
+ "removeValidation",
188
+ "resetValidation",
189
+ "updateFormDirty",
190
+ ]),
191
+ onOpen() {
192
+ this.getAll();
193
+ },
194
+ onSelected(value) {
195
+ this.$emit("input", value);
196
+ if (this.changed) this.changed();
197
+ if (this.fieldTarget) {
198
+ let obj = { fieldTarget: this.fieldTarget, value: value.id };
199
+ this.addFilter(obj);
200
+ }
201
+ },
202
+ onSearch(value) {
203
+ this.baseParams.search = value;
204
+ this.getAll();
205
+ },
206
+ label(value) {
207
+ if (value.content) return `${value.content}`;
208
+ },
209
+ getAll() {
210
+ let obj = { ...this.baseParams, ...this.propsParams };
211
+ let params = { url: this.url, obj: obj };
212
+ this.loading = true;
213
+ this.getApi(params).then((response) => {
214
+ this.totalRecords = response.content.totalRecords;
215
+ let self = this;
216
+ if (this.baseParams.currentPage == 1) {
217
+ this.data = [];
218
+ }
219
+ response.content.data.map(function (value, key) {
220
+ self.data.push(value);
221
+ });
222
+ this.loading = false;
223
+ this.removeLoading(["loadingMore"]);
224
+ });
225
+ },
226
+ addNewRegister() {
227
+ this.openVodal(this.nameNewRegister);
228
+ this.resetValidation(this.nameNewRegister);
229
+ this.removeNotificarions();
230
+ this.$refs.multiselect.deactivate();
231
+ this.removeLoading(["addNewRegister"]);
232
+ },
233
+ hide() {
234
+ this.hideVodal();
235
+ },
236
+ cleanSelect() {
237
+ let obj = { id: "", conteudo: "" };
238
+ this.currentValue = obj;
239
+ this.$emit("input", obj);
240
+ this.$refs.multiselect.deactivate();
241
+ this.removeLoading(["cleanSelect"]);
242
+
243
+ if (this.fieldTarget) {
244
+ let obj = { fieldTarget: this.fieldTarget, value: "" };
245
+ this.addFilter(obj);
246
+ }
247
+ },
248
+ loadingMore() {
249
+ this.baseParams.currentPage++;
250
+ this.getAll();
251
+ },
252
+ validate() {
253
+ this.notifications = [];
254
+ if (this.required && !this.value.id) {
255
+ var message = `${this.title} não pode ser vazio!`;
256
+ this.notifications.push(message);
257
+ }
258
+ },
259
+ },
260
+ watch: {
261
+ "value.id": function () {
262
+ this.validate();
263
+ this.formDirty = true;
264
+ if (this.markFormDirty) this.updateFormDirty(true);
265
+ this.currentValue = { id: this.value.id, content: this.value.content };
266
+ },
267
+ notifications() {
268
+ let self = this;
269
+ this.notifications.forEach(function (notification) {
270
+ let obj = {
271
+ key: self.field + "&" + self.formName,
272
+ formName: self.formName,
273
+ notification: notification,
274
+ };
275
+ self.addValidation(obj);
276
+ });
277
+
278
+ if (this.notifications.length == 0) {
279
+ let obj = {
280
+ key: self.field + "&" + self.formName,
281
+ formName: self.formName,
282
+ };
283
+ self.removeValidation(obj);
284
+ }
285
+ },
286
+ resetForm: {
287
+ handler(form) {
288
+ if (form.nome == this.formName) {
289
+ let obj = { id: "", conteudo: "" };
290
+ this.currentValue = obj;
291
+ this.$emit("input", obj);
292
+ this.formDirty = false;
293
+ }
294
+ },
295
+ deep: true,
296
+ },
297
+ "vodal.open": function (value) {
298
+ if (!value) this.registerNew = false;
299
+ },
300
+ },
301
+ };
302
+ </script>
303
+
304
+ <style scoped>
305
+ .margin{
306
+ margin-bottom: 10px;
307
+ }
308
+
309
+
310
+ div.before-list {
311
+ padding: 8px;
312
+ }
313
+
314
+ div.after-list {
315
+ padding: 8px;
316
+ }
317
+
318
+ .invalid {
319
+ color: #f0134d;
320
+ font-size: 14px;
321
+ }
322
+
323
+ .select {
324
+ min-width: 300px;
325
+ height: 36px;
326
+ border-bottom: 1px solid #d6dadf;
327
+ border-radius: 0px !important;
328
+ z-index: 100;
329
+ }
330
+
331
+ .select-invalid {
332
+ border-bottom: 1px solid #ff5454;
333
+ }
334
+
335
+ .select-valid {
336
+ border-bottom: 1px solid #94aa2a;
337
+ }
338
+
339
+ .title-new-form {
340
+ font-size: 18px;
341
+ margin-bottom: 5px;
342
+ }
343
+
344
+ .border {
345
+ border: 1px solid #dbdee0 !important;
346
+ border-radius: 5px !important;
347
+ height: 38px !important;
348
+ }
349
+ </style>