@nixweb/nixloc-ui 0.0.121 → 0.0.124

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 (135) hide show
  1. package/docs/src/component/template/ModeloRelatorioView.drawio +2 -2
  2. package/docs/src/store/modulos/relatorio.drawio +2 -2
  3. package/package.json +77 -77
  4. package/public/styles/app.css +1 -1
  5. package/src/component/forms/{Botao.vue → Button.vue} +53 -57
  6. package/src/component/forms/CheckboxGroup.vue +63 -0
  7. package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +8 -8
  8. package/src/component/forms/{Cor.vue → Color.vue} +9 -9
  9. package/src/component/forms/DateTime.vue +55 -55
  10. package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +58 -58
  11. package/src/component/forms/EditorHtml.vue +123 -0
  12. package/src/component/forms/FileUpload.vue +189 -0
  13. package/src/component/forms/InputDecimal.vue +137 -0
  14. package/src/component/forms/InputNumber.vue +149 -0
  15. package/src/component/forms/InputPassword.vue +135 -0
  16. package/src/component/forms/InputText.vue +157 -0
  17. package/src/component/forms/Modal.vue +15 -15
  18. package/src/component/forms/RadioGroup.vue +50 -0
  19. package/src/component/forms/Select.vue +337 -0
  20. package/src/component/forms/SelectStatic.vue +120 -0
  21. package/src/component/forms/TextArea.vue +126 -0
  22. package/src/component/forms/Toggle.vue +13 -13
  23. package/src/component/layout/{Conta.vue → Account.vue} +28 -28
  24. package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
  25. package/src/component/layout/Badge.vue +23 -23
  26. package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
  27. package/src/component/layout/{Topo.vue → Header.vue} +5 -5
  28. package/src/component/layout/{CarregandoTelaInteira.vue → LoadingFullPage.vue} +3 -3
  29. package/src/component/layout/Menu.vue +66 -66
  30. package/src/component/layout/{Moldura.vue → Molded.vue} +4 -4
  31. package/src/component/layout/Panel.vue +142 -0
  32. package/src/component/layout/Popover.vue +1 -1
  33. package/src/component/layout/{BarraRolagem.vue → Scrollbar.vue} +9 -11
  34. package/src/component/layout/Tag.vue +15 -15
  35. package/src/component/layout/Wizard.vue +3 -3
  36. package/src/component/shared/{CodigoEditor.vue → CodeEditor.vue} +25 -25
  37. package/src/component/shared/Collapse.vue +131 -0
  38. package/src/component/shared/Confirmation.vue +80 -0
  39. package/src/component/shared/{DocumentoEditor.vue → DocumentEditor.vue} +10 -16
  40. package/src/component/shared/{DocumentoPreview.vue → DocumentPreview.vue} +2 -2
  41. package/src/component/shared/ExportExcel.vue +67 -0
  42. package/src/component/shared/{ExportarPDF.vue → ExportPDF.vue} +18 -18
  43. package/src/component/shared/HeaderPrint.vue +36 -0
  44. package/src/component/shared/HorizontalFilter.vue +59 -0
  45. package/src/component/shared/LegendaParametro.vue +22 -22
  46. package/src/component/shared/{Carregando.vue → Loading.vue} +16 -16
  47. package/src/component/shared/LoadingMoreButton.vue +23 -0
  48. package/src/component/shared/Messages.vue +83 -0
  49. package/src/component/shared/{Paginacao.vue → Pagination.vue} +12 -12
  50. package/src/component/shared/ProgressBar.vue +21 -0
  51. package/src/component/shared/{BotaoConsulta.vue → QueryButton.vue} +16 -16
  52. package/src/component/shared/SaveCancel.vue +56 -0
  53. package/src/component/shared/{Pesquisa.vue → Search.vue} +46 -46
  54. package/src/component/shared/Table.vue +243 -0
  55. package/src/component/shared/TableButton.vue +36 -0
  56. package/src/component/shared/{Registro.vue → TableTotalRecords.vue} +7 -7
  57. package/src/component/shared/{ResumoTabela.vue → TableTotalization.vue} +12 -8
  58. package/src/component/shared/Tip.vue +42 -0
  59. package/src/component/shared/Toast.vue +7 -7
  60. package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +24 -24
  61. package/src/component/shared/query-builder/AddRule.vue +187 -0
  62. package/src/component/shared/query-builder/ConvertToOdata.js +80 -0
  63. package/src/component/shared/query-builder/DynamicComponent.vue +107 -0
  64. package/src/component/shared/query-builder/Fields.vue +127 -0
  65. package/src/component/shared/query-builder/ListDynamicComponent.vue +42 -0
  66. package/src/component/shared/query-builder/QueryBuilder.vue +25 -120
  67. package/src/component/shared/query-builder/{Filtro.vue → Rules.vue} +13 -18
  68. package/src/component/shared/query-builder/SelectRule.vue +96 -0
  69. package/src/component/shared/query-builder/Tags.vue +14 -14
  70. package/src/component/shared/query-builder/{Rodape.vue → Totalization.vue} +10 -10
  71. package/src/component/template/AddEditReport.vue +106 -0
  72. package/src/component/template/ListViewWithHandlerData.vue +231 -0
  73. package/src/component/template/ViewTemplateConfiguration.vue +69 -0
  74. package/src/component/template/ViewTemplateDocumentView.vue +227 -0
  75. package/src/component/template/ViewTemplateReportList.vue +230 -0
  76. package/src/component/template/ViewTemplateReportPreview.vue +500 -0
  77. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
  78. package/src/component/template/ViewTemplateWithTable.vue +49 -0
  79. package/src/component/template/model/Report.js +6 -0
  80. package/src/component/value-objects/DadosContato.vue +34 -35
  81. package/src/component/value-objects/DadosPessoa.vue +58 -58
  82. package/src/component/value-objects/Endereco.vue +96 -97
  83. package/src/config/dicas.js +1 -1
  84. package/src/config/token.js +2 -2
  85. package/src/store/modules/generic.js +489 -0
  86. package/src/store/modules/report.js +246 -0
  87. package/src/store/modules/user.js +38 -0
  88. package/src/store/modules/validation.js +39 -0
  89. package/src/store/store.js +4 -4
  90. package/src/component/forms/ArquivoUpload.vue +0 -199
  91. package/src/component/forms/CheckboxMultiplo.vue +0 -63
  92. package/src/component/forms/Decimal.vue +0 -137
  93. package/src/component/forms/Escolher.vue +0 -335
  94. package/src/component/forms/EscolherEstatico.vue +0 -139
  95. package/src/component/forms/Numero.vue +0 -153
  96. package/src/component/forms/Opcoes.vue +0 -51
  97. package/src/component/forms/Senha.vue +0 -139
  98. package/src/component/forms/Texto.vue +0 -161
  99. package/src/component/forms/TextoArea.vue +0 -126
  100. package/src/component/forms/TextoEditor.vue +0 -123
  101. package/src/component/layout/Painel.vue +0 -142
  102. package/src/component/shared/BotaoCarregarMais.vue +0 -23
  103. package/src/component/shared/CabecalhoImpressao.vue +0 -36
  104. package/src/component/shared/Confirmacao.vue +0 -80
  105. package/src/component/shared/Dica.vue +0 -42
  106. package/src/component/shared/EsconderMostrar.vue +0 -131
  107. package/src/component/shared/ExportarExcel.vue +0 -67
  108. package/src/component/shared/FiltroHorizontal.vue +0 -59
  109. package/src/component/shared/Mensagem.vue +0 -86
  110. package/src/component/shared/Progresso.vue +0 -21
  111. package/src/component/shared/SalvarCancelar.vue +0 -56
  112. package/src/component/shared/Tabela.vue +0 -275
  113. package/src/component/shared/TabelaBotao.vue +0 -36
  114. package/src/component/shared/query-builder/Campo.vue +0 -116
  115. package/src/component/shared/query-builder/ConverteParaOdata.js +0 -77
  116. package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
  117. package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
  118. package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
  119. package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
  120. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
  121. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -187
  122. package/src/component/shared/query-builder/main.js +0 -81
  123. package/src/component/template/ModeloAdicionarModificarView.vue +0 -32
  124. package/src/component/template/ModeloDocumentoView.vue +0 -227
  125. package/src/component/template/ModeloLista.vue +0 -231
  126. package/src/component/template/ModeloRelatorioListaView.vue +0 -227
  127. package/src/component/template/ModeloRelatorioView.vue +0 -489
  128. package/src/component/template/ModeloSubView.vue +0 -69
  129. package/src/component/template/ModeloView.vue +0 -49
  130. package/src/component/template/Relatorio.js +0 -10
  131. package/src/component/template/RelatorioAdicionarModificar.vue +0 -106
  132. package/src/store/modulos/generic.js +0 -494
  133. package/src/store/modulos/relatorio.js +0 -204
  134. package/src/store/modulos/usuario.js +0 -38
  135. package/src/store/modulos/validation.js +0 -39
@@ -0,0 +1,149 @@
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
+ <slot v-else></slot>
14
+ <input
15
+ class="form-control"
16
+ type="number"
17
+ v-model="_value"
18
+ @keyup.enter.prevent="pressedEnter"
19
+ />
20
+ </div>
21
+
22
+ <div v-if="formDirty">
23
+ <div v-for="message in notifications" :key="message">
24
+ <span class="invalid">{{ message }}</span>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import Tip from "../shared/Tip.vue";
32
+
33
+ import { mapState, mapMutations } from "vuex";
34
+
35
+ export default {
36
+ name: "InputNumber",
37
+ components: { Tip },
38
+ props: {
39
+ title: String,
40
+ field: String,
41
+ placeholder: String,
42
+ disabled: Boolean,
43
+ formName: String,
44
+ required: Boolean,
45
+ maxLength: Number,
46
+ type: {
47
+ type: String,
48
+ default: "float",
49
+ },
50
+ markFormDirty: {
51
+ type: Boolean,
52
+ default: true,
53
+ },
54
+ value: Number,
55
+ changed: Function,
56
+ enter: Function,
57
+ },
58
+ data() {
59
+ return {
60
+ notifications: [],
61
+ formDirty: false,
62
+ _value: 0,
63
+ precision: 1,
64
+ };
65
+ },
66
+ created() {
67
+ // não carregar as validações iniciais para number
68
+ this._value = this.value;
69
+ },
70
+
71
+ methods: {
72
+ ...mapMutations("validation", ["addValidation", "removeValidation", "updateFormDirty"]),
73
+ validate() {
74
+ this.notifications = [];
75
+ if (this.value == 0) return;
76
+ if (this.required && !this.value) {
77
+ var message = `${this.title} não pode ser vazio!`;
78
+ this.notifications.push(message);
79
+ }
80
+
81
+ if (this._value.toString().length > this.maxLength) {
82
+ var message = `Valor inválido!`;
83
+ this.notifications.push(message);
84
+ }
85
+ },
86
+ pressedEnter() {
87
+ if (this.enter) this.enter();
88
+ },
89
+ },
90
+ computed: {
91
+ ...mapState("validation", ["resetForm"]),
92
+ },
93
+ watch: {
94
+ value() {
95
+ this._value = this.value;
96
+ if (this.changed) this.changed();
97
+ },
98
+ _value() {
99
+ this.validate();
100
+
101
+ let _value;
102
+ if (this.type === "int") _value = parseInt(this._value);
103
+ if (this.type === "float") _value = parseFloat(this._value);
104
+
105
+ this.$emit("input", _value);
106
+ this.formDirty = true;
107
+ if (this.markFormDirty) this.updateFormDirty(true);
108
+
109
+ this._value = _value;
110
+ },
111
+ notifications() {
112
+ let self = this;
113
+ this.notifications.forEach(function (notification) {
114
+ let obj = {
115
+ key: self.field + "&" + self.formName,
116
+ formName: self.formName,
117
+ notification: notification,
118
+ };
119
+ self.addValidation(obj);
120
+ });
121
+
122
+ if (this.notifications.length == 0) {
123
+ let obj = {
124
+ key: self.field + "&" + self.formName,
125
+ formName: self.formName,
126
+ };
127
+ self.removeValidation(obj);
128
+ }
129
+ },
130
+ resetForm: {
131
+ handler(form) {
132
+ if (form.nome == this.formName) this.formDirty = false;
133
+ },
134
+ deep: true,
135
+ },
136
+ },
137
+ };
138
+ </script>
139
+
140
+ <style scoped>
141
+ .success {
142
+ color: #94aa2a;
143
+ font-size: 14px;
144
+ }
145
+ .invalid {
146
+ color: #f0134d;
147
+ font-size: 14px;
148
+ }
149
+ </style>
@@ -0,0 +1,135 @@
1
+ <template>
2
+ <div class="form-group">
3
+ <label>
4
+ <span class="title" :style="'color: ' + titleColor">{{ 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
+ <slot v-else></slot>
14
+ <input
15
+ type="password"
16
+ :placeholder="placeholder"
17
+ v-mask="mask || withoutMask"
18
+ v-bind:value="value"
19
+ v-on:input="$emit('input', $event.target.value)"
20
+ class="form-control"
21
+ :class="{ required: notifications.length > 0 && formDirty }"
22
+ />
23
+ </div>
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: "InputPassword",
39
+ mixins: [],
40
+ props: [
41
+ "title",
42
+ "field",
43
+ "titleColor",
44
+ "placeholder",
45
+ "mask",
46
+ "formName",
47
+ "required",
48
+ "maxLength",
49
+ "value",
50
+ ],
51
+ data() {
52
+ return {
53
+ notifications: [],
54
+ formDirty: false,
55
+ withoutMask: {
56
+ mask: "*".repeat(255),
57
+ tokens: {
58
+ "*": { pattern: /./ },
59
+ },
60
+ },
61
+ };
62
+ },
63
+ created() {
64
+ this.validate();
65
+ },
66
+ methods: {
67
+ ...mapMutations("validation", ["addValidation", "removeValidation", "updateFormDirty"]),
68
+ validate() {
69
+ this.notifications = [];
70
+
71
+ if (this.required && this.value.length == 0) {
72
+ var message = `${this.title} não pode ser vazio!`;
73
+ this.notifications.push(message);
74
+ }
75
+
76
+ if (this.maxLength > 0) {
77
+ if (this.value.length > this.maxLength) {
78
+ var message = `Máximo de ${this.maxLength} caracteres!`;
79
+ this.notifications.push(message);
80
+ }
81
+ }
82
+ },
83
+ },
84
+ computed: {
85
+ ...mapState("validation", ["resetForm", "validations"]),
86
+ },
87
+ watch: {
88
+ value() {
89
+ this.validate();
90
+ this.formDirty = true;
91
+ this.updateFormDirty(true);
92
+ },
93
+ notifications() {
94
+ let self = this;
95
+ this.notifications.forEach(function (notification) {
96
+ let obj = {
97
+ key: self.field + "&" + self.formName,
98
+ formName: self.formName,
99
+ notification: notification,
100
+ };
101
+ self.addValidation(obj);
102
+ });
103
+
104
+ if (this.notifications.length == 0) {
105
+ let obj = {
106
+ key: self.field + "&" + self.formName,
107
+ formName: self.formName,
108
+ };
109
+ self.removeValidation(obj);
110
+ }
111
+ },
112
+ resetForm: {
113
+ handler(form) {
114
+ if (form.nome == this.formName) this.formDirty = false;
115
+ },
116
+ deep: true,
117
+ },
118
+ },
119
+ };
120
+ </script>
121
+
122
+ <style scoped>
123
+ .success {
124
+ color: #94aa2a;
125
+ font-size: 14px;
126
+ }
127
+ .invalid {
128
+ color: #f0134d;
129
+ font-size: 14px;
130
+ }
131
+
132
+ .margin-button {
133
+ margin-top: -10px;
134
+ }
135
+ </style>
@@ -0,0 +1,157 @@
1
+ <template>
2
+ <div class="form-group">
3
+ <label>
4
+ <span class="title" :style="'color: ' + titleColor">{{ 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
+ <div class="required glyphicon" v-if="notifications.length > 0 && formDirty">
10
+ <i class="fas fa-exclamation-triangle"></i>
11
+ </div>
12
+ <slot v-else></slot>
13
+ <input
14
+ type="text"
15
+ :style="style"
16
+ :placeholder="placeholder"
17
+ :disabled="disabled"
18
+ @keyup.enter.prevent="pressedEnter"
19
+ @keyup="cleanedField"
20
+ @blur="outField"
21
+ v-mask="mask || withoutMask"
22
+ v-bind:value="value"
23
+ v-on:input="$emit('input', $event.target.value)"
24
+ class="form-control"
25
+ :class="{ required: notifications.length > 0 && formDirty }"
26
+ />
27
+ </div>
28
+ <div v-if="formDirty">
29
+ <div v-for="message in notifications" :key="message">
30
+ <span class="invalid">{{ message }}</span>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </template>
35
+
36
+ <script>
37
+ import Tip from "../shared/Tip.vue";
38
+ import { mapState, mapMutations } from "vuex";
39
+
40
+ export default {
41
+ components: { Tip },
42
+ name: "InputText",
43
+ props: [
44
+ "title",
45
+ "field",
46
+ "placeholder",
47
+ "disabled",
48
+ "titleColor",
49
+ "mask",
50
+ "style",
51
+ "formName",
52
+ "required",
53
+ "maxLength",
54
+ "value",
55
+ "enter",
56
+ "cleaned",
57
+ "exited",
58
+ "markFormDirty",
59
+ ],
60
+ data() {
61
+ return {
62
+ notifications: [],
63
+ formDirty: false,
64
+ withoutMask: {
65
+ mask: "*".repeat(255),
66
+ tokens: {
67
+ "*": { pattern: /./ },
68
+ },
69
+ },
70
+ };
71
+ },
72
+ created() {
73
+ this.validate();
74
+ },
75
+ methods: {
76
+ ...mapMutations("validation", ["addValidation", "removeValidation", "updateFormDirty"]),
77
+ validate() {
78
+ this.notifications = [];
79
+
80
+ if (this.required && this.value.length == 0) {
81
+ var message = `${this.title} não pode ser vazio!`;
82
+ this.notifications.push(message);
83
+ }
84
+
85
+ if (this.maxLength > 0) {
86
+ if (this.value.length > this.maxLength) {
87
+ var message = `Máximo de ${this.maxLength} caracteres!`;
88
+ this.notifications.push(message);
89
+ }
90
+ }
91
+ },
92
+ pressedEnter() {
93
+ if (this.enter) this.enter();
94
+ },
95
+ outField() {
96
+ if (this.exited) this.exited();
97
+ },
98
+ cleanedField() {
99
+ if (this.value.length == 0) {
100
+ if (this.cleaned) this.cleaned();
101
+ }
102
+ },
103
+ },
104
+ computed: {
105
+ ...mapState("validation", ["resetForm", "validations"]),
106
+ },
107
+ watch: {
108
+ value() {
109
+ this.validate();
110
+ this.formDirty = true;
111
+ // inverti a validação devido não colocar o default como true no props
112
+ var _value = this.markFormDirty == undefined ? true : this.markFormDirty;
113
+ if (_value) 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.nome == this.formName) this.formDirty = false;
137
+ },
138
+ deep: true,
139
+ },
140
+ },
141
+ };
142
+ </script>
143
+
144
+ <style scoped>
145
+ .success {
146
+ color: #94aa2a;
147
+ font-size: 14px;
148
+ }
149
+ .invalid {
150
+ color: #f0134d;
151
+ font-size: 14px;
152
+ }
153
+
154
+ .margin-button {
155
+ margin-top: -3px;
156
+ }
157
+ </style>
@@ -2,17 +2,17 @@
2
2
  <div>
3
3
  <vodal
4
4
  :duration="50"
5
- :show="modal.abrir"
6
- @hide="fecharModal()"
7
- :width="largura"
8
- :height="altura"
5
+ :show="modal.open"
6
+ @hide="hideModal()"
7
+ :width="width"
8
+ :height="height"
9
9
  :closeOnEsc="fecharBotao"
10
10
  :closeButton="fecharBotao"
11
11
  :closeOnClickMask="false"
12
12
  >
13
13
  <div class="d-block text-left">
14
- <Mensagem v-if="!vodal.abrir" />
15
- <div class="titulo">{{ titulo }}</div>
14
+ <Messages v-if="!vodal.open" />
15
+ <div class="title">{{ title }}</div>
16
16
  <hr class="hr" />
17
17
  <slot></slot>
18
18
  </div>
@@ -22,7 +22,7 @@
22
22
  </template>
23
23
 
24
24
  <script>
25
- import Mensagem from "@nixweb/nixloc-ui/src/component/shared/Mensagem";
25
+ import Messages from "@nixweb/nixloc-ui/src/component/shared/Messages";
26
26
  import Vodal from "vodal";
27
27
 
28
28
  import { mapState, mapMutations } from "vuex";
@@ -30,30 +30,30 @@ import { mapState, mapMutations } from "vuex";
30
30
  export default {
31
31
  name: "Modal",
32
32
  props: {
33
- titulo: String,
34
- largura: Number,
35
- altura: Number,
36
- fecharEsc: {
33
+ title: String,
34
+ width: Number,
35
+ height: Number,
36
+ closeOnEsc: {
37
37
  type: Boolean,
38
38
  default: true,
39
39
  },
40
- fecharBotao: {
40
+ closeButton: {
41
41
  type: Boolean,
42
42
  default: true,
43
43
  },
44
44
  },
45
- components: { Mensagem, Vodal },
45
+ components: { Messages, Vodal },
46
46
  computed: {
47
47
  ...mapState("generic", ["modal", "vodal"]),
48
48
  },
49
49
  methods: {
50
- ...mapMutations("generic", ["fecharModal"]),
50
+ ...mapMutations("generic", ["hideModal"]),
51
51
  },
52
52
  };
53
53
  </script>
54
54
 
55
55
  <style scoped>
56
- .titulo {
56
+ .title {
57
57
  font-size: 18px;
58
58
  margin-bottom: 5px;
59
59
  }
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div>
3
+ <span class="title">{{ title }}</span>
4
+ <Tip :field="field" :formName="formName" />
5
+ <div class="options">
6
+ <b-form-group>
7
+ <b-form-radio-group
8
+ v-model="selected"
9
+ :options="options"
10
+ :disabled="disabled"
11
+ ></b-form-radio-group>
12
+ </b-form-group>
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import Tip from "../shared/Tip.vue";
19
+
20
+ import { mapMutations } from "vuex";
21
+
22
+ export default {
23
+ components: { Tip },
24
+ name: "options",
25
+ props: ["title", "options", "value", "changed", "field", "formName", "disabled"],
26
+ data() {
27
+ return {
28
+ selected: this.value,
29
+ };
30
+ },
31
+ methods: {
32
+ ...mapMutations("validation", ["updateFormDirty"]),
33
+ },
34
+ watch: {
35
+ value() {
36
+ this.selected = this.value;
37
+ },
38
+ selected() {
39
+ this.$emit("input", this.selected);
40
+ this.updateFormDirty(true);
41
+ if (this.changed) this.changed();
42
+ },
43
+ },
44
+ };
45
+ </script>
46
+ <style scoped>
47
+ .options {
48
+ margin-top: 5px;
49
+ }
50
+ </style>