@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.
Files changed (158) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +13 -0
  3. package/src/component/forms/Button.vue +163 -0
  4. package/src/component/forms/ButtonFilter.vue +75 -0
  5. package/src/component/forms/ButtonGroup.vue +67 -0
  6. package/src/component/forms/ButtonSub.vue +98 -0
  7. package/src/component/forms/ButtonToggle.vue +77 -0
  8. package/src/component/forms/CheckboxGroup.vue +69 -0
  9. package/src/component/forms/CheckboxServer.vue +192 -0
  10. package/src/component/forms/CheckboxSimple.vue +60 -0
  11. package/src/component/forms/Color.vue +38 -0
  12. package/src/component/forms/DateTime.vue +170 -0
  13. package/src/component/forms/DateYearMonth.vue +193 -0
  14. package/src/component/forms/Dropdown.vue +236 -0
  15. package/src/component/forms/EditorHtml.vue +132 -0
  16. package/src/component/forms/FileUpload.vue +170 -0
  17. package/src/component/forms/ImageUpload.vue +214 -0
  18. package/src/component/forms/IncrementDecrement.vue +148 -0
  19. package/src/component/forms/InputAddressGoogle.vue +171 -0
  20. package/src/component/forms/InputCallToAction.vue +135 -0
  21. package/src/component/forms/InputDecimal.vue +153 -0
  22. package/src/component/forms/InputDecimalDiscount.vue +78 -0
  23. package/src/component/forms/InputNumber.vue +160 -0
  24. package/src/component/forms/InputPassword.vue +148 -0
  25. package/src/component/forms/InputTag.vue +125 -0
  26. package/src/component/forms/InputText.vue +174 -0
  27. package/src/component/forms/InputTextEdit.vue +69 -0
  28. package/src/component/forms/InputWhatsApp.vue +48 -0
  29. package/src/component/forms/Modal.vue +57 -0
  30. package/src/component/forms/RadioGroup.vue +91 -0
  31. package/src/component/forms/Select.vue +378 -0
  32. package/src/component/forms/SelectStatic.vue +198 -0
  33. package/src/component/forms/SideBar.vue +100 -0
  34. package/src/component/forms/Slider.vue +18 -0
  35. package/src/component/forms/TextArea.vue +138 -0
  36. package/src/component/forms/Toggle.vue +72 -0
  37. package/src/component/layout/Account.vue +131 -0
  38. package/src/component/layout/Alert.vue +88 -0
  39. package/src/component/layout/Badge.vue +111 -0
  40. package/src/component/layout/BarFloating.vue +68 -0
  41. package/src/component/layout/FixedBar.vue +103 -0
  42. package/src/component/layout/Gantt.vue +128 -0
  43. package/src/component/layout/Header.vue +56 -0
  44. package/src/component/layout/HideShow.vue +62 -0
  45. package/src/component/layout/IconMolded.vue +59 -0
  46. package/src/component/layout/LoadingFullPage.vue +27 -0
  47. package/src/component/layout/Menu.vue +287 -0
  48. package/src/component/layout/Molded.vue +30 -0
  49. package/src/component/layout/NewAccount.vue +136 -0
  50. package/src/component/layout/NewHeader.vue +60 -0
  51. package/src/component/layout/NewIconMolded.vue +71 -0
  52. package/src/component/layout/NewMenu.vue +456 -0
  53. package/src/component/layout/Panel.vue +185 -0
  54. package/src/component/layout/Popover.vue +126 -0
  55. package/src/component/layout/ScrollBar.vue +57 -0
  56. package/src/component/layout/Tab.vue +135 -0
  57. package/src/component/layout/Tag.vue +97 -0
  58. package/src/component/layout/Wizard.vue +211 -0
  59. package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
  60. package/src/component/rental/DisplayPeriodRent.vue +55 -0
  61. package/src/component/rental/DisplayTotalization.vue +86 -0
  62. package/src/component/report/Fields.vue +109 -0
  63. package/src/component/report/Report.vue +314 -0
  64. package/src/component/report/ReportTable.vue +112 -0
  65. package/src/component/report/Totalization.vue +34 -0
  66. package/src/component/shared/CodeEditor.vue +128 -0
  67. package/src/component/shared/Collapse.vue +131 -0
  68. package/src/component/shared/Confirmation.vue +74 -0
  69. package/src/component/shared/DocumentEditor.vue +99 -0
  70. package/src/component/shared/DocumentPreview.vue +81 -0
  71. package/src/component/shared/DocumentPublic.vue +33 -0
  72. package/src/component/shared/ExportExcel.vue +56 -0
  73. package/src/component/shared/ExportPDF.vue +116 -0
  74. package/src/component/shared/FullCalendar.vue +174 -0
  75. package/src/component/shared/HeaderReport.vue +47 -0
  76. package/src/component/shared/HorizontalFilter.vue +64 -0
  77. package/src/component/shared/ListNotifications.vue +70 -0
  78. package/src/component/shared/Loading.vue +107 -0
  79. package/src/component/shared/LoadingCard.vue +65 -0
  80. package/src/component/shared/LoadingMoreButton.vue +23 -0
  81. package/src/component/shared/Messages.vue +109 -0
  82. package/src/component/shared/PDFViewer.vue +24 -0
  83. package/src/component/shared/Pagination.vue +108 -0
  84. package/src/component/shared/ParameterLegend.vue +169 -0
  85. package/src/component/shared/ProgressBar.vue +25 -0
  86. package/src/component/shared/QueryButton.vue +66 -0
  87. package/src/component/shared/Report.vue +200 -0
  88. package/src/component/shared/SaveCancel.vue +99 -0
  89. package/src/component/shared/Search.vue +174 -0
  90. package/src/component/shared/SelectOption.vue +162 -0
  91. package/src/component/shared/Table.vue +174 -0
  92. package/src/component/shared/TableButton.vue +36 -0
  93. package/src/component/shared/TableDraggable.vue +117 -0
  94. package/src/component/shared/TableImport.vue +93 -0
  95. package/src/component/shared/TableItem.vue +214 -0
  96. package/src/component/shared/TableTotalPerPage.vue +78 -0
  97. package/src/component/shared/TableTotalRecords.vue +44 -0
  98. package/src/component/shared/TableTotalization.vue +47 -0
  99. package/src/component/shared/TimeLine.vue +42 -0
  100. package/src/component/shared/Timer.vue +78 -0
  101. package/src/component/shared/Tip.vue +42 -0
  102. package/src/component/shared/Toast.vue +69 -0
  103. package/src/component/shared/ToggleTheme.vue +128 -0
  104. package/src/component/shared/TotalizationReport.vue +86 -0
  105. package/src/component/shared/VerticalFilter.vue +97 -0
  106. package/src/component/shared/automation/ActivitiesList.vue +44 -0
  107. package/src/component/shared/automation/AddRule.vue +61 -0
  108. package/src/component/shared/automation/AutomationBuilder.vue +27 -0
  109. package/src/component/shared/automation/DynamicComponentList.vue +86 -0
  110. package/src/component/shared/automation/SelectRule.vue +98 -0
  111. package/src/component/shared/automation/components/BillingByRent.vue +98 -0
  112. package/src/component/shared/automation/components/SendEmail.vue +94 -0
  113. package/src/component/shared/file-manager/FileManager.vue +391 -0
  114. package/src/component/shared/filter-builder/FilterBuilder.vue +221 -0
  115. package/src/component/shared/filter-builder/FilterQuery.vue +94 -0
  116. package/src/component/shared/query-builder/AddRule.vue +203 -0
  117. package/src/component/shared/query-builder/ConvertToOdata.js +86 -0
  118. package/src/component/shared/query-builder/DynamicComponent.vue +161 -0
  119. package/src/component/shared/query-builder/DynamicComponentList.vue +70 -0
  120. package/src/component/shared/query-builder/Fields.vue +93 -0
  121. package/src/component/shared/query-builder/QueryBuilder.vue +69 -0
  122. package/src/component/shared/query-builder/Rules.vue +68 -0
  123. package/src/component/shared/query-builder/SelectRule.vue +97 -0
  124. package/src/component/shared/query-builder/Tags.vue +59 -0
  125. package/src/component/shared/query-builder/utilities.js +22 -0
  126. package/src/component/signature/Payment.vue +161 -0
  127. package/src/component/signature/Warning.vue +76 -0
  128. package/src/component/template/ListViewWithDataHandler.vue +429 -0
  129. package/src/component/template/ReportCreateUpdate.vue +110 -0
  130. package/src/component/template/ViewTemplateConfiguration.vue +64 -0
  131. package/src/component/template/ViewTemplateDocumentView.vue +213 -0
  132. package/src/component/template/ViewTemplateImportFile.vue +347 -0
  133. package/src/component/template/ViewTemplateReportList.vue +217 -0
  134. package/src/component/template/ViewTemplateReportPreview.vue +432 -0
  135. package/src/component/template/ViewTemplateSelectOption.vue +46 -0
  136. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
  137. package/src/component/template/ViewTemplateWithTable.vue +62 -0
  138. package/src/component/template/model/Report.js +6 -0
  139. package/src/component/training/Course.vue +344 -0
  140. package/src/component/training/CourseView.vue +190 -0
  141. package/src/component/value-objects/Address.js +11 -0
  142. package/src/component/value-objects/Address.vue +157 -0
  143. package/src/component/value-objects/Contact.js +7 -0
  144. package/src/component/value-objects/Contact.vue +106 -0
  145. package/src/component/value-objects/Person.js +10 -0
  146. package/src/component/value-objects/Person.vue +129 -0
  147. package/src/config/axios.js +9 -0
  148. package/src/config/dicas.js +15 -0
  149. package/src/config/router.js +14 -0
  150. package/src/config/token.js +15 -0
  151. package/src/main.js +23 -0
  152. package/src/store/modules/automation.js +31 -0
  153. package/src/store/modules/generic.js +816 -0
  154. package/src/store/modules/report.js +278 -0
  155. package/src/store/modules/user.js +67 -0
  156. package/src/store/modules/util.js +26 -0
  157. package/src/store/modules/validation.js +39 -0
  158. package/src/store/store.js +14 -0
@@ -0,0 +1,214 @@
1
+ <template>
2
+ <div>
3
+ <b-row v-show="loadingAdd || loadingRemove">
4
+ <b-col sm="2">
5
+ <vue-loading v-if="true" type="bubbles" color="#D98621" :size="{ width: '50px', height: '50px' }"></vue-loading>
6
+ </b-col>
7
+ </b-row>
8
+ <b-row v-show="!loadingAdd && !loadingRemove">
9
+ <b-col sm="12">
10
+ <div class="div-preview">
11
+ <img :class="classCss" :style="'width:' + width + 'px;height:' + height + 'px'" :src="'https://espaco.blob.core.windows.net/' +
12
+ container +
13
+ '/' +
14
+ urlImage
15
+ " />
16
+ </div>
17
+ <div>
18
+ <div v-if="!value">
19
+ <div class="div-button">
20
+ <button class="button small primary" @click="show = !show">
21
+ <span v-if="!loadingAdd">
22
+ <span><i class="fas fa-camera"></i> {{ title }}</span>
23
+ </span>
24
+ </button>
25
+ </div>
26
+ </div>
27
+ <div v-else>
28
+ <div class="div-button">
29
+ <button class="button small danger" v-if="!loadingAdd" @click="remove()">
30
+ <span v-if="!loadingRemove"><i class="fas fa-camera"></i> Remover Foto</span>
31
+ <vue-loading v-if="loadingRemove" type="bubbles" color="#fff"
32
+ :size="{ width: '20px', height: '20px' }"></vue-loading>
33
+ </button>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </b-col>
38
+ </b-row>
39
+ <my-upload field="img" @crop-success="cropSuccess" langType="pt-br" v-model="show" :width="width" :height="height"
40
+ :noCircle="true" img-format="png">
41
+ </my-upload>
42
+ </div>
43
+ </template>
44
+ <script>
45
+ import myUpload from "vue-image-crop-upload/upload-2.vue";
46
+
47
+ import { mapActions } from "vuex";
48
+
49
+ export default {
50
+ name: "ImageUpload",
51
+ components: {
52
+ "my-upload": myUpload,
53
+ },
54
+ props: {
55
+ title: String,
56
+ container: String,
57
+ accepted: String,
58
+ width: Number,
59
+ height: Number,
60
+ classCss: String,
61
+ urlPost: String,
62
+ urlRemove: String,
63
+ onLoad: Function,
64
+ value: String,
65
+ },
66
+ data() {
67
+ return {
68
+ file: "",
69
+ imgBase64: "",
70
+ show: false,
71
+ loadingAdd: false,
72
+ loadingRemove: false,
73
+ urlAzure: "https://espaco.blob.core.windows.net",
74
+ };
75
+ },
76
+ computed: {
77
+ urlImage() {
78
+ if (this.value) return this.value;
79
+ return "noImage.png";
80
+ },
81
+ },
82
+ methods: {
83
+ ...mapActions("generic", ["postFileApi", "deleteFileApi"]),
84
+ cropSuccess(imgBase64) {
85
+ this.file = this.dataBase64ToFile(imgBase64, "image.png");
86
+ this.upload();
87
+ },
88
+ upload() {
89
+ let params = {
90
+ url: this.urlPost,
91
+ file: this.file,
92
+ container: this.container,
93
+ accepted: this.accepted,
94
+ };
95
+ this.loadingAdd = true;
96
+ this.postFileApi(params).then((response) => {
97
+ if (response.success) {
98
+ this.$emit("input", response.content);
99
+ if (this.onLoad) this.onLoad();
100
+ }
101
+ this.loadingAdd = false;
102
+ });
103
+ },
104
+ remove() {
105
+ let props = {
106
+ url: this.urlRemove,
107
+ container: this.container,
108
+ name: this.value,
109
+ };
110
+ this.loadingRemove = true;
111
+ let params = { url: this.urlRemove, obj: props };
112
+ this.deleteFileApi(params).then((response) => {
113
+ if (response.success) {
114
+ this.$emit("input", "");
115
+ if (this.onLoad) this.onLoad();
116
+ }
117
+ this.loadingRemove = false;
118
+ });
119
+ },
120
+ download() {
121
+ const url = `${this.urlAzure}/${this.container}/${this.value}`;
122
+ window.location.href = url;
123
+ },
124
+ dataBase64ToFile(dataurl, filename) {
125
+ var arr = dataurl.split(","),
126
+ mime = arr[0].match(/:(.*?);/)[1],
127
+ bstr = atob(arr[1]),
128
+ n = bstr.length,
129
+ u8arr = new Uint8Array(n);
130
+
131
+ while (n--) {
132
+ u8arr[n] = bstr.charCodeAt(n);
133
+ }
134
+
135
+ return new File([u8arr], filename, { type: mime });
136
+ },
137
+ },
138
+ };
139
+ </script>
140
+ <style scoped>
141
+ .div-preview {
142
+ margin-bottom: 15px;
143
+ margin-left: 15px;
144
+ }
145
+
146
+ .button {
147
+ padding: 8px 12px;
148
+ cursor: pointer;
149
+ border: none;
150
+ border-radius: 40px !important;
151
+ font-size: 14px;
152
+ font-weight: 400;
153
+ }
154
+
155
+ .primary {
156
+ background: #577696;
157
+ border-color: #577696;
158
+ color: #fff;
159
+ }
160
+
161
+ .primary:hover {
162
+ background: #355472;
163
+ }
164
+
165
+ .success {
166
+ color: #fff;
167
+ background: #94aa2a;
168
+ border-color: #94aa2a;
169
+ }
170
+
171
+ .success:hover {
172
+ background: #6d7e1c;
173
+ }
174
+
175
+ .danger {
176
+ color: #fff;
177
+ border-color: #f0134d;
178
+ background: #f0134d;
179
+ margin-left: 5px;
180
+ }
181
+
182
+ .danger:hover {
183
+ background: #c70f40;
184
+ }
185
+
186
+ .small {
187
+ padding: 3px 7px;
188
+ font-size: 13px;
189
+ }
190
+
191
+ .file input[type="file"] {
192
+ font-size: 100px;
193
+ position: absolute;
194
+ left: 0;
195
+ top: 0;
196
+ opacity: 0;
197
+ }
198
+
199
+ .div-alert {
200
+ margin-top: 15px;
201
+ }
202
+
203
+ .div-image {
204
+ margin-bottom: 10px;
205
+ }
206
+
207
+ .img-round {
208
+ border-radius: 100px;
209
+ }
210
+
211
+ .div-button {
212
+ margin-left: 10px;
213
+ }
214
+ </style>
@@ -0,0 +1,148 @@
1
+ <template>
2
+ <div>
3
+ <label v-if="title">
4
+ <span class="title">{{ title }} </span>
5
+ </label>
6
+ <div class="wrapper">
7
+ <span :class="{ disabled: disabled }" class="minus" @click="decrement">-</span>
8
+ <span :class="{ disabled: disabled }" class="num" @click="showEdit = true" v-if="!showEdit">{{ number }}</span>
9
+ <input v-if="showEdit" class="input" type="number" @keyup.enter.prevent="enter" :disabled="disabled"
10
+ v-model="number" />
11
+ <span v-if="showEdit" :class="{ disabled: disabled }" @click="showEdit = false">
12
+ <i class="fa-solid fa-check"></i>
13
+ </span>
14
+ <span :class="{ disabled: disabled }" class="plus" @click="increment">+</span>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ import { mapMutations } from "vuex";
21
+
22
+ export default {
23
+ name: "IncrementDecrement",
24
+ props: [
25
+ "name",
26
+ "title",
27
+ "initialValue",
28
+ "value",
29
+ "disabled",
30
+ "fieldTarget",
31
+ "triggerEvent",
32
+ "min",
33
+ "max",
34
+ "changed"
35
+ ],
36
+ data() {
37
+ return {
38
+ number: 1,
39
+ showEdit: false,
40
+ };
41
+ },
42
+ mounted() {
43
+ this.number = this.value;
44
+ },
45
+ methods: {
46
+ ...mapMutations("generic", ["addFilter", "addEvent"]),
47
+ increment() {
48
+ if (!this.disabled) {
49
+ this.number++;
50
+ this.executeFilter();
51
+ }
52
+ },
53
+ decrement() {
54
+ if (!this.disabled) {
55
+ this.number--;
56
+ if (this.number < 0) this.number = 0;
57
+ this.executeFilter();
58
+ }
59
+ },
60
+ enter(){
61
+ this.showEdit = false;
62
+ if (this.changed) this.changed();
63
+ },
64
+ executeFilter() {
65
+ if (this.fieldTarget) {
66
+ let obj = { fieldTarget: this.fieldTarget, value: this.number };
67
+ this.addFilter(obj);
68
+ }
69
+
70
+ if (this.changed) this.changed();
71
+ },
72
+ },
73
+ watch: {
74
+ number: {
75
+ handler(number) {
76
+ if (this.min)
77
+ if (this.number < this.min) {
78
+ this.number = this.min;
79
+ return;
80
+ }
81
+ if (this.max)
82
+ if (this.number > this.max) {
83
+ this.number = this.max;
84
+ return;
85
+ }
86
+ this.$emit("input", this.number);
87
+
88
+ if (this.triggerEvent)
89
+ this.addEvent({
90
+ name: "updateIncrementDecrement",
91
+ data: { name: this.name, value: this.number },
92
+ });
93
+ },
94
+ deep: true,
95
+ },
96
+ },
97
+ };
98
+ </script>
99
+
100
+ <style scoped>
101
+ .input {
102
+ width: 40px;
103
+ border: none;
104
+ text-align: center;
105
+ }
106
+
107
+ .wrapper {
108
+ height: 37px;
109
+ width: 100%;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ background: #fff;
114
+ border-radius: 8px;
115
+ border: 1px solid #eaedf3;
116
+ box-shadow: 0px 10px 20px -6px rgb(0 0 0 / 3%);
117
+ }
118
+
119
+ .wrapper span {
120
+ width: 100%;
121
+ text-align: center;
122
+ font-size: 15px;
123
+ font-weight: 600;
124
+ cursor: pointer;
125
+ user-select: none;
126
+ }
127
+
128
+ .wrapper span.num {
129
+ font-size: 17px;
130
+ border-right: 1px solid #eaedf3;
131
+ border-left: 1px solid #eaedf3;
132
+ cursor: pointer;
133
+ color: #3f529b;
134
+ font-size: 14px;
135
+ font-weight: 400;
136
+ cursor: pointer;
137
+ }
138
+
139
+ .wrapper span.num:hover {
140
+ text-decoration: underline;
141
+ transition: 0.1s;
142
+ }
143
+
144
+ .disabled {
145
+ color: grey;
146
+ opacity: 0.5;
147
+ }
148
+ </style>
@@ -0,0 +1,171 @@
1
+ <template>
2
+ <div class="form-group">
3
+ <label>
4
+ <i class="title class-icon-title" :class="classIconTitle"></i>
5
+ <i class="fa-sharp fa-solid fa-location-dot icon-location"></i>
6
+ <span class="title" :style="'color: ' + titleColor"> {{ title }} </span>
7
+ <span class="required" v-if="required">*</span>
8
+ <Tip :field="field" :formName="formName" />
9
+ </label>
10
+ <div class="inner-addon right-addon">
11
+ <div class="required glyphicon" v-if="notifications.length > 0 && formDirty">
12
+ <i class="fas fa-exclamation-triangle"></i>
13
+ </div>
14
+ <slot v-else></slot>
15
+ <gmap-autocomplete @place_changed="setPlace" class="form-control teste" v-bind:value="value">
16
+ </gmap-autocomplete>
17
+ </div>
18
+ <div v-if="formDirty">
19
+ <div v-for="message in notifications" :key="message">
20
+ <span class="invalid">{{ message }}</span>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import Tip from "../shared/Tip.vue";
28
+ import { mapState, mapMutations } from "vuex";
29
+
30
+ export default {
31
+ components: { Tip },
32
+ name: "InputText",
33
+ props: [
34
+ "title",
35
+ "classIconTitle",
36
+ "field",
37
+ "placeholder",
38
+ "disabled",
39
+ "titleColor",
40
+ "mask",
41
+ "_style",
42
+ "formName",
43
+ "required",
44
+ "maxLength",
45
+ "value",
46
+ "enter",
47
+ "cleaned",
48
+ "exited",
49
+ "markFormDirty",
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", [
68
+ "addValidation",
69
+ "removeValidation",
70
+ "updateFormDirty",
71
+ ]),
72
+ validate() {
73
+ this.notifications = [];
74
+
75
+ if (this.required && this.value.length == 0) {
76
+ var message = `${this.title} não pode ser vazio!`;
77
+ this.notifications.push(message);
78
+ }
79
+
80
+ if (this.maxLength > 0) {
81
+ if (this.value.length > this.maxLength) {
82
+ var message = `Máximo de ${this.maxLength} caracteres!`;
83
+ this.notifications.push(message);
84
+ }
85
+ }
86
+ },
87
+ pressedEnter() {
88
+ if (this.enter) this.enter();
89
+ },
90
+ outField() {
91
+ if (this.exited) this.exited();
92
+ },
93
+ cleanedField() {
94
+ if (this.value.length == 0) {
95
+ if (this.cleaned) this.cleaned();
96
+ }
97
+ },
98
+ setPlace(place) {
99
+ this.currentPlace = place;
100
+ this.$emit("input", this.currentPlace.formatted_address);
101
+ },
102
+ },
103
+ computed: {
104
+ ...mapState("validation", ["resetForm", "validations"]),
105
+ },
106
+ watch: {
107
+ value() {
108
+ this.validate();
109
+ this.formDirty = true;
110
+ // inverti a validação devido não colocar o default como true no props
111
+ var _value = this.markFormDirty == undefined ? true : this.markFormDirty;
112
+ if (_value) this.updateFormDirty(true);
113
+ },
114
+ notifications() {
115
+ let self = this;
116
+ this.notifications.forEach(function (notification) {
117
+ let obj = {
118
+ key: self.field + "&" + self.formName,
119
+ formName: self.formName,
120
+ notification: notification,
121
+ };
122
+ self.addValidation(obj);
123
+ });
124
+
125
+ if (this.notifications.length == 0) {
126
+ let obj = {
127
+ key: self.field + "&" + self.formName,
128
+ formName: self.formName,
129
+ };
130
+ self.removeValidation(obj);
131
+ }
132
+ },
133
+ resetForm: {
134
+ handler(form) {
135
+ if (form.name == this.formName) this.formDirty = false;
136
+ },
137
+ deep: true,
138
+ },
139
+ },
140
+ };
141
+ </script>
142
+
143
+ <style scoped>
144
+ .title {
145
+ font-size: 14px !important;
146
+ }
147
+
148
+ .icon-location {
149
+ color: #0251a0;
150
+ }
151
+
152
+ .class-icon-title {
153
+ margin-right: 5px;
154
+ }
155
+
156
+ .success {
157
+ color: #94aa2a;
158
+ font-size: 14px;
159
+ }
160
+
161
+ .invalid {
162
+ color: #f0134d;
163
+ font-size: 14px;
164
+ }
165
+
166
+ .margin-button {
167
+ margin-top: -3px;
168
+ }
169
+
170
+
171
+ </style>
@@ -0,0 +1,135 @@
1
+ <template>
2
+ <div>
3
+ <div class="wrapper">
4
+ <span class="num" @click="showEdit = true" v-if="!showEdit">
5
+ <span v-if="text">{{ text }}</span>
6
+ <span class="placeholder" :style="'color:' + placeholderColor" v-else>
7
+ {{ placeholder }}
8
+ </span>
9
+ </span>
10
+ <input
11
+ class="input"
12
+ type="text"
13
+ @keyup.enter.prevent="execute()"
14
+ v-model="text"
15
+ v-if="showEdit"
16
+ />
17
+ <span @click="execute()" v-if="showEdit && loading == false">
18
+ <i class="fa-solid fa-check"></i>
19
+ </span>
20
+ <div class="div-loading">
21
+ <vue-loading
22
+ v-if="loading"
23
+ type="bubbles"
24
+ color="#D98621"
25
+ :size="{ width: '30px', height: '30px' }"
26
+ >
27
+ </vue-loading>
28
+ </div>
29
+ </div>
30
+ <div v-if="error" class="danger msg-error">
31
+ {{ messageError }}
32
+ </div>
33
+ </div>
34
+ </template>
35
+
36
+ <script>
37
+ import { mapMutations, mapActions } from "vuex";
38
+
39
+ export default {
40
+ name: "InputCallToAction",
41
+ props: [
42
+ "_key",
43
+ "placeholder",
44
+ "placeholderColor",
45
+ "messageError",
46
+ "urlCallToAction",
47
+ "params",
48
+ "value",
49
+ ],
50
+ data() {
51
+ return {
52
+ text: "",
53
+ error: false,
54
+ _keySelected: "",
55
+ showEdit: false,
56
+ loading: false,
57
+ };
58
+ },
59
+ mounted() {
60
+ this.text = this.value;
61
+ },
62
+ methods: {
63
+ ...mapActions("generic", ["postApi"]),
64
+ execute() {
65
+ let paramsWithValue = { ...this.params, ...{ value: this.text } };
66
+ let params = { url: this.urlCallToAction, obj: paramsWithValue };
67
+ this.loading = true;
68
+ this.postApi(params).then((response) => {
69
+ if (response.success) {
70
+ if (!response.content) {
71
+ this.error = true;
72
+ this.text = "";
73
+ this.$emit("input", "");
74
+ } else {
75
+ this.error = false;
76
+ this.$emit("input", this.text);
77
+ }
78
+
79
+ this.showEdit = false;
80
+ this.loading = false;
81
+ }
82
+ });
83
+ },
84
+ },
85
+ };
86
+ </script>
87
+
88
+ <style scoped>
89
+ .input {
90
+ width: 80%;
91
+ border: none;
92
+ text-align: center;
93
+ }
94
+
95
+ .placeholder {
96
+ font-size: 13px !important;
97
+ }
98
+
99
+ .div-loading {
100
+ margin-bottom: 4px;
101
+ }
102
+
103
+ .msg-error {
104
+ font-size: 13px;
105
+ }
106
+
107
+ .wrapper {
108
+ height: 37px;
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: center;
112
+ background: #fff;
113
+ border-radius: 8px;
114
+ border: 1px solid #eaedf3;
115
+ box-shadow: 0px 10px 20px -6px rgb(0 0 0 / 3%);
116
+ }
117
+ .wrapper span {
118
+ text-align: center;
119
+ font-size: 15px;
120
+ cursor: pointer;
121
+ user-select: none;
122
+ }
123
+ .wrapper span.num {
124
+ font-size: 17px;
125
+ cursor: pointer;
126
+ color: #3f529b;
127
+ font-size: 13px;
128
+ cursor: pointer;
129
+ }
130
+
131
+ .wrapper span.num:hover {
132
+ text-decoration: underline;
133
+ transition: 0.1s;
134
+ }
135
+ </style>