@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,153 @@
1
+ <template>
2
+ <div class="form-group">
3
+ <label v-if="title">
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
+ <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
+ <vue-numeric :style="_style" class="form-control" v-on:keyup.enter.native="pressedEnter"
14
+ :class="{ 'is-invalid': notifications.length > 0 && formDirty }" :placeholder="placeholder" :disabled="disabled"
15
+ currency="R$" separator="." :minus="allowNegative" v-bind:precision="precision" v-model="valueLocal">
16
+ </vue-numeric>
17
+
18
+ </div>
19
+ <div v-if="formDirty">
20
+ <div v-for="message in notifications" :key="message">
21
+ <span class="invalid">{{ message }}</span>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+ import Tip from "../shared/Tip.vue";
29
+ import VueNumeric from "vue-numeric";
30
+
31
+ import { mapState, mapMutations } from "vuex";
32
+
33
+ export default {
34
+ name: "InputDecimal",
35
+ mixins: [],
36
+ props: {
37
+ title: String,
38
+ field: String,
39
+ disabled: Boolean,
40
+ placeholder: String,
41
+ formName: String,
42
+ _style: String,
43
+ precision: {
44
+ type: Number,
45
+ default: 2,
46
+ },
47
+ markFormDirty: {
48
+ type: Boolean,
49
+ default: true,
50
+ },
51
+ allowNegative: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ required: Boolean,
56
+ value: Number,
57
+ enter: Function,
58
+ },
59
+ components: {
60
+ VueNumeric,
61
+ Tip,
62
+ },
63
+ data() {
64
+ return {
65
+ notifications: [],
66
+ formDirty: false,
67
+ _value: 0,
68
+ valueLocal: 20,
69
+ isPrecision: false
70
+ };
71
+ },
72
+ created() {
73
+ // não carregar as validações iniciais para number
74
+ this.valueLocal = this.value;
75
+ },
76
+ methods: {
77
+ ...mapMutations("validation", [
78
+ "addValidation",
79
+ "removeValidation",
80
+ "updateFormDirty",
81
+ ]),
82
+ validate() {
83
+ this.notifications = [];
84
+ if (this.valueLocal == 0) return;
85
+ if (this.required && !this.valueLocal) {
86
+ var message = `${this.title} não pode ser vazio!`;
87
+ this.notifications.push(message);
88
+ }
89
+ },
90
+ pressedEnter() {
91
+ if (this.enter) this.enter();
92
+ },
93
+ },
94
+ computed: {
95
+ ...mapState("validation", ["resetForm"]),
96
+ },
97
+ watch: {
98
+ value() {
99
+ this.valueLocal = this.value;
100
+ },
101
+ valueLocal() {
102
+ this.validate();
103
+ this.$emit("input", this.valueLocal);
104
+ this.formDirty = true;
105
+ if (this.markFormDirty) this.updateFormDirty(true);
106
+ },
107
+ notifications() {
108
+ let self = this;
109
+ this.notifications.forEach(function (notification) {
110
+ let obj = {
111
+ key: self.field + "&" + self.formName,
112
+ formName: self.formName,
113
+ notification: notification,
114
+ };
115
+ self.addValidation(obj);
116
+ });
117
+
118
+ if (this.notifications.length == 0) {
119
+ let obj = {
120
+ key: self.field + "&" + self.formName,
121
+ formName: self.formName,
122
+ };
123
+ self.removeValidation(obj);
124
+ }
125
+ },
126
+ resetForm: {
127
+ handler(form) {
128
+ if (form.name == this.formName) this.formDirty = false;
129
+ },
130
+ deep: true,
131
+ },
132
+ },
133
+ };
134
+ </script>
135
+
136
+ <style scoped>
137
+ .title {
138
+ font-size: 14px !important;
139
+ font-weight: 400 !important;
140
+ color: #0a0a0a;
141
+ letter-spacing: 0.5px !important;
142
+ }
143
+
144
+ .success {
145
+ color: #94aa2a;
146
+ font-size: 14px;
147
+ }
148
+
149
+ .invalid {
150
+ color: #f0134d;
151
+ font-size: 14px;
152
+ }
153
+ </style>
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <div>
3
+ <InputDecimal v-if="!discount.discountByPercentage" :markFormDirty="markFormDirty" :title="title"
4
+ :precision="precision" field="discount" :required="required" :formName="formName" _style="color:red;"
5
+ :disabled="disabled" v-model="discount.discount">
6
+ <div class="glyphicon margin-button">
7
+ <Button _key="btnDiscount" type="danger" classIcon="fa-solid fa-brazilian-real-sign" size="small"
8
+ :disabled="disabled" :clicked="change" />
9
+ </div>
10
+ </InputDecimal>
11
+ <InputNumber v-if="discount.discountByPercentage" :markFormDirty="markFormDirty" :title="title" field="discount"
12
+ :formName="formName" :required="false" :disabled="disabled" _style="color:red;" :maxLength="5" type="float"
13
+ v-model="discount.discount">
14
+ <div class="glyphicon margin-button">
15
+ <Button _key="btnDiscount" type="danger" :disabled="disabled" classIcon="fa-solid fa-percent" size="small"
16
+ :clicked="change" />
17
+ </div>
18
+ </InputNumber>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import InputNumber from "@nixweb/nixloc-ui/src/component/forms/InputNumber";
24
+ import InputDecimal from "@nixweb/nixloc-ui/src/component/forms/InputDecimal";
25
+ import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
26
+
27
+ import { mapMutations } from "vuex";
28
+
29
+ export default {
30
+ name: "InputDecimalDiscount",
31
+ components: {
32
+ InputNumber,
33
+ InputDecimal,
34
+ Button,
35
+ },
36
+ props: ["formName", "disabled", "_style", "required", "precision", "markFormDirty", "value"],
37
+ data() {
38
+ return {
39
+ title: "Desconto em R$",
40
+ discount: { discountByPercentage: false, discount: 0 },
41
+ };
42
+ },
43
+ mounted() {
44
+ let self = this;
45
+ setTimeout(function () {
46
+ self.discount = self.value;
47
+ }, 100);
48
+ },
49
+ methods: {
50
+ ...mapMutations("generic", ["removeLoading"]),
51
+ change() {
52
+ this.discount.discountByPercentage =
53
+ this.discount.discountByPercentage != true;
54
+ this.titleName();
55
+ this.removeLoading(["btnDiscount"]);
56
+ },
57
+ titleName() {
58
+ if (this.discount.discountByPercentage) this.title = "Desconto em %";
59
+ if (!this.discount.discountByPercentage) this.title = "Desconto em R$";
60
+ }
61
+ },
62
+ watch: {
63
+ discount: {
64
+ handler(discount) {
65
+ this.$emit("input", discount);
66
+ },
67
+ deep: true,
68
+ },
69
+ value: {
70
+ handler(value) {
71
+ this.discount = value;
72
+ this.titleName();
73
+ },
74
+ deep: true,
75
+ },
76
+ },
77
+ };
78
+ </script>
@@ -0,0 +1,160 @@
1
+ <template>
2
+ <div class="form-group">
3
+ <label v-if="title">
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
+ <slot v-else></slot>
11
+ <input :style="_style" class="form-control" type="number" :disabled="disabled" v-model="valueLocal"
12
+ @keyup.enter.prevent="pressedEnter" />
13
+ </div>
14
+
15
+ <div v-if="formDirty">
16
+ <div v-for="message in notifications" :key="message">
17
+ <span class="invalid">{{ message }}</span>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ import Tip from "../shared/Tip.vue";
25
+
26
+ import { mapState, mapMutations } from "vuex";
27
+
28
+ export default {
29
+ name: "InputNumber",
30
+ components: { Tip },
31
+ props: {
32
+ title: String,
33
+ field: String,
34
+ _style: String,
35
+ placeholder: String,
36
+ disabled: Boolean,
37
+ formName: String,
38
+ required: Boolean,
39
+ maxLength: Number,
40
+ type: {
41
+ type: String,
42
+ default: "float",
43
+ },
44
+ markFormDirty: {
45
+ type: Boolean,
46
+ default: true,
47
+ },
48
+ params: Object,
49
+ value: Number,
50
+ changed: Function,
51
+ enter: Function,
52
+ },
53
+ data() {
54
+ return {
55
+ notifications: [],
56
+ formDirty: false,
57
+ valueLocal: 0,
58
+ precision: 1,
59
+ };
60
+ },
61
+ created() {
62
+ // não carregar as validações iniciais para number
63
+ this.valueLocal = this.value;
64
+ },
65
+
66
+ methods: {
67
+ ...mapMutations("validation", [
68
+ "addValidation",
69
+ "removeValidation",
70
+ "updateFormDirty",
71
+ ]),
72
+ validate() {
73
+ this.notifications = [];
74
+ if (this.value == 0) return;
75
+ if (this.required && !this.value) {
76
+ var message = `${this.title} não pode ser vazio!`;
77
+ this.notifications.push(message);
78
+ }
79
+
80
+ if (this.valueLocal.toString().length > this.maxLength) {
81
+ var message = `Valor inválido!`;
82
+ this.notifications.push(message);
83
+ }
84
+ },
85
+ pressedEnter() {
86
+ if (this.enter) this.enter(this.params);
87
+ },
88
+ },
89
+ computed: {
90
+ ...mapState("validation", ["resetForm"]),
91
+ },
92
+ watch: {
93
+ value() {
94
+ this.valueLocal = this.value;
95
+ if (this.changed) this.changed();
96
+ },
97
+ valueLocal() {
98
+ this.validate();
99
+
100
+ let valueLocal;
101
+ if (this.type === "int") valueLocal = parseInt(this.valueLocal);
102
+ if (this.type === "float") valueLocal = parseFloat(this.valueLocal);
103
+
104
+ this.$emit("input", valueLocal);
105
+ this.formDirty = true;
106
+ if (this.markFormDirty) this.updateFormDirty(true);
107
+
108
+ this.valueLocal = valueLocal;
109
+ },
110
+ notifications() {
111
+ let self = this;
112
+ this.notifications.forEach(function (notification) {
113
+ let obj = {
114
+ key: self.field + "&" + self.formName,
115
+ formName: self.formName,
116
+ notification: notification,
117
+ };
118
+ self.addValidation(obj);
119
+ });
120
+
121
+ if (this.notifications.length == 0) {
122
+ let obj = {
123
+ key: self.field + "&" + self.formName,
124
+ formName: self.formName,
125
+ };
126
+ self.removeValidation(obj);
127
+ }
128
+ },
129
+ resetForm: {
130
+ handler(form) {
131
+ if (form.name == this.formName) this.formDirty = false;
132
+ },
133
+ deep: true,
134
+ },
135
+ },
136
+ };
137
+ </script>
138
+
139
+ <style scoped>
140
+ .title {
141
+ font-size: 14px !important;
142
+ font-weight: 400 !important;
143
+ color: #0a0a0a;
144
+ letter-spacing: 0.5px !important;
145
+ }
146
+
147
+ .success {
148
+ color: #94aa2a;
149
+ font-size: 14px;
150
+ }
151
+
152
+ .invalid {
153
+ color: #f0134d;
154
+ font-size: 14px;
155
+ }
156
+
157
+ .margin-button {
158
+ margin-top: -2px;
159
+ }
160
+ </style>
@@ -0,0 +1,148 @@
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 v-if="notifications.length > 0 && formDirty" class="required glyphicon fas fa-exclamation-triangle"></i>
10
+ <slot v-else></slot>
11
+ <input type="password" :disabled="disabled" :placeholder="titlePlaceholder" v-mask="mask || withoutMask"
12
+ v-bind:value="value" v-on:input="$emit('input', $event.target.value)" class="form-control"
13
+ :class="{ required: notifications.length > 0 && formDirty }" />
14
+ </div>
15
+ <div v-if="formDirty">
16
+ <div v-for="message in notifications" :key="message">
17
+ <span class="invalid">{{ message }}</span>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ import Tip from "../shared/Tip.vue";
25
+ import { mapState, mapMutations } from "vuex";
26
+
27
+ export default {
28
+ components: { Tip },
29
+ name: "InputPassword",
30
+ mixins: [],
31
+ props: [
32
+ "title",
33
+ "field",
34
+ "titleColor",
35
+ "placeholder",
36
+ "disabled",
37
+ "mask",
38
+ "formName",
39
+ "required",
40
+ "maxLength",
41
+ "value",
42
+ ],
43
+ data() {
44
+ return {
45
+ notifications: [],
46
+ formDirty: false,
47
+ withoutMask: {
48
+ mask: "*".repeat(255),
49
+ tokens: {
50
+ "*": { pattern: /./ },
51
+ },
52
+ },
53
+ };
54
+ },
55
+ created() {
56
+ this.validate();
57
+ },
58
+ methods: {
59
+ ...mapMutations("validation", [
60
+ "addValidation",
61
+ "removeValidation",
62
+ "updateFormDirty",
63
+ ]),
64
+ validate() {
65
+ this.notifications = [];
66
+
67
+ if (this.required && this.value.length == 0) {
68
+ var message = `${this.title} não pode ser vazio!`;
69
+ this.notifications.push(message);
70
+ }
71
+
72
+ if (this.maxLength > 0) {
73
+ if (this.value.length > this.maxLength) {
74
+ var message = `Máximo de ${this.maxLength} caracteres!`;
75
+ this.notifications.push(message);
76
+ }
77
+ }
78
+ },
79
+ },
80
+ computed: {
81
+ ...mapState("validation", ["resetForm", "validations"]),
82
+ titlePlaceholder() {
83
+ return "Digite a " + this.title;
84
+ },
85
+ },
86
+ watch: {
87
+ value() {
88
+ this.validate();
89
+ this.formDirty = true;
90
+ this.updateFormDirty(true);
91
+ },
92
+ notifications() {
93
+ let self = this;
94
+ this.notifications.forEach(function (notification) {
95
+ let obj = {
96
+ key: self.field + "&" + self.formName,
97
+ formName: self.formName,
98
+ notification: notification,
99
+ };
100
+ self.addValidation(obj);
101
+ });
102
+
103
+ if (this.notifications.length == 0) {
104
+ let obj = {
105
+ key: self.field + "&" + self.formName,
106
+ formName: self.formName,
107
+ };
108
+ self.removeValidation(obj);
109
+ }
110
+ },
111
+ resetForm: {
112
+ handler(form) {
113
+ if (form.name == this.formName) this.formDirty = false;
114
+ },
115
+ deep: true,
116
+ },
117
+ },
118
+ };
119
+ </script>
120
+
121
+ <style scoped>
122
+ .title {
123
+ font-size: 14px !important;
124
+ font-weight: 400 !important;
125
+ color: #0a0a0a;
126
+ letter-spacing: 0.5px !important;
127
+ }
128
+
129
+ input::placeholder {
130
+ font-weight: 300 !important;
131
+ opacity: 0.5;
132
+ color: #969595;
133
+ }
134
+
135
+ .success {
136
+ color: #94aa2a;
137
+ font-size: 14px;
138
+ }
139
+
140
+ .invalid {
141
+ color: #f0134d;
142
+ font-size: 14px;
143
+ }
144
+
145
+ .margin-button {
146
+ margin-top: -10px;
147
+ }
148
+ </style>
@@ -0,0 +1,125 @@
1
+ <template>
2
+ <div>
3
+ <div><span class="title">{{ title }}</span>
4
+ <span class="required" v-if="required">*</span>
5
+ </div>
6
+ <div class="email-input-container">
7
+ <div class="email-tag" v-for="(email, index) in tos" :key="index">
8
+ {{ email }}
9
+ <button class="remove-button" @click="removeEmail(index)">
10
+ <i class="fa-solid fa-circle-xmark"></i>
11
+ </button>
12
+ </div>
13
+ <input v-model="newItem" @keyup.enter="addItem" :placeholder="placeholder" class="email-input" />
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ export default {
20
+ name: "InputTag",
21
+ props: {
22
+ title: String,
23
+ placeholder: String,
24
+ required: Boolean,
25
+ initialValue: Array,
26
+ value: Array,
27
+ change: Function
28
+ },
29
+ data() {
30
+ return {
31
+ tos: [],
32
+ newItem: ""
33
+ };
34
+ },
35
+ mounted() {
36
+ this.tos = this.initialValue;
37
+ },
38
+ methods: {
39
+ addItem() {
40
+ if (this.newItem) {
41
+ this.tos.push(this.newItem);
42
+ this.newItem = "";
43
+ this.change();
44
+ }
45
+ },
46
+ removeEmail(index) {
47
+ this.tos.splice(index, 1);
48
+ this.change();
49
+ }
50
+ },
51
+ watch: {
52
+ tos: {
53
+ handler(tos) {
54
+ this.$emit("input", tos);
55
+ },
56
+ deep: true,
57
+ },
58
+ initialValue: {
59
+ handler(initialValue) {
60
+ this.tos = initialValue;
61
+ },
62
+ deep: true,
63
+ },
64
+ },
65
+
66
+ };
67
+ </script>
68
+
69
+ <style>
70
+ .email-input-container {
71
+ display: flex;
72
+ flex-wrap: wrap;
73
+ align-items: center;
74
+ border: 1px solid #E5E4E8;
75
+ border-radius: 6px;
76
+ padding-left: 5px;
77
+ }
78
+
79
+ .email-tag {
80
+ display: flex;
81
+ align-items: center;
82
+ background-color: #f0f0f0;
83
+ padding: 4px 8px;
84
+ border-radius: 16px;
85
+ margin-top: 6px;
86
+ margin-right: 8px;
87
+ margin-bottom: 8px;
88
+ }
89
+
90
+ .remove-button {
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ background-color: transparent;
95
+ border: none;
96
+ cursor: pointer;
97
+ margin-left: 4px;
98
+ outline: none;
99
+ }
100
+
101
+ .remove-button {
102
+ color: #ff0000;
103
+ }
104
+
105
+ .remove-button:hover {
106
+ color: #ff0000;
107
+ }
108
+
109
+ .email-input {
110
+ flex: 1;
111
+ border: none;
112
+ outline: none;
113
+ font-size: 14px;
114
+ padding: 4px;
115
+ font-weight: 400 !important;
116
+ margin: 2px 5px 2px 5px;
117
+ background-color: transparent;
118
+ }
119
+
120
+ .email-input::placeholder {
121
+ font-weight: 300 !important;
122
+ opacity: 0.5;
123
+ color: #969595;
124
+ }
125
+ </style>