@burh/nuxt-core 1.0.376 → 1.0.378

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.
@@ -14,6 +14,7 @@ body {
14
14
  }
15
15
  .no-scroll {
16
16
  overflow: hidden;
17
+ padding-right: 17px;
17
18
 
18
19
  &--y {
19
20
  overflow-y: auto;
@@ -1,221 +1,241 @@
1
- <template>
2
- <div class="form-group">
3
- <slot name="label">
4
- <label
5
- v-if="label"
6
- :class="[
7
- { 'is-invalid': error },
8
- { 'label-required': required },
9
- labelClasses
10
- ]"
11
- >
12
- {{ label }}
13
- <span v-if="required" class="label-required-text"
14
- >Obrigatório</span
15
- >
16
- </label>
17
- </slot>
18
- <div
19
- :class="[
20
- { 'input-group': hasIcon },
21
- { focused: focused },
22
- { 'input-group-alternative': alternative },
23
- { 'has-label': label || $slots.label },
24
- inputGroupClasses
25
- ]"
26
- >
27
- <div
28
- v-if="prependIcon || $slots.prepend"
29
- class="input-group-prepend"
30
- >
31
- <span class="input-group-text">
32
- <slot name="prepend">
33
- <i :class="prependIcon"></i>
34
- </slot>
35
- </span>
36
- </div>
37
- <slot v-bind="slotData">
38
- <input
39
- v-if="!mask.length"
40
- :value="value"
41
- :type="type"
42
- v-on="listeners"
43
- v-bind="$attrs"
44
- :valid="!error"
45
- :required="required"
46
- class="form-control"
47
- :class="[
48
- { 'is-valid': valid === true },
49
- { 'is-invalid': error },
50
- inputClasses
51
- ]"
52
- />
53
- <the-mask
54
- v-else
55
- class="form-control"
56
- v-on="listeners"
57
- v-bind="$attrs"
58
- type="text"
59
- :required="required"
60
- :mask="mask"
61
- :class="[
62
- { 'is-valid': valid === true },
63
- { 'is-invalid': error },
64
- inputClasses
65
- ]"
66
- />
67
- </slot>
68
- <div v-if="appendIcon || $slots.append" class="input-group-append">
69
- <span class="input-group-text">
70
- <slot name="append">
71
- <i :class="appendIcon"></i>
72
- </slot>
73
- </span>
74
- </div>
75
- <slot name="infoBlock"></slot>
76
- <slot name="error">
77
- <div
78
- v-if="error"
79
- class="invalid-feedback"
80
- style="display: block;"
81
- >
82
- {{ error }}
83
- </div>
84
- </slot>
85
- <slot name="success">
86
- <div class="valid-feedback" v-if="!error && valid">
87
- {{ successMessage }}
88
- </div>
89
- </slot>
90
- </div>
91
- </div>
92
- </template>
93
- <script>
94
- import { TheMask } from 'vue-the-mask';
95
-
96
- export default {
97
- inheritAttrs: false,
98
- name: 'base-input',
99
- props: {
100
- required: {
101
- type: Boolean,
102
- description: 'Whether input is required (adds an asterix *)'
103
- },
104
- group: {
105
- type: Boolean,
106
- description:
107
- 'Whether input is an input group (manual override in special cases)'
108
- },
109
- valid: {
110
- type: Boolean,
111
- description: 'Whether is valid',
112
- default: undefined
113
- },
114
- alternative: {
115
- type: Boolean,
116
- description: 'Whether input is of alternative layout'
117
- },
118
- label: {
119
- type: String,
120
- description: 'Input label (text before input)'
121
- },
122
- error: {
123
- type: String,
124
- description: 'Input error (below input)'
125
- },
126
- successMessage: {
127
- type: String,
128
- description: 'Input success message',
129
- default: 'Looks good!'
130
- },
131
- labelClasses: {
132
- type: String,
133
- description: 'Input label css classes',
134
- default: 'form-control-label'
135
- },
136
- inputClasses: {
137
- type: String,
138
- description: 'Input css classes'
139
- },
140
- inputGroupClasses: {
141
- type: String,
142
- description: 'Input group css classes'
143
- },
144
- value: {
145
- type: [String, Number],
146
- description: 'Input value'
147
- },
148
- type: {
149
- type: String,
150
- description: 'Input type',
151
- default: 'text'
152
- },
153
- appendIcon: {
154
- type: String,
155
- description: 'Append icon (right)'
156
- },
157
- prependIcon: {
158
- type: String,
159
- description: 'Prepend icon (left)'
160
- },
161
- mask: {
162
- type: Array,
163
- default: () => {
164
- return [];
165
- },
166
- description: 'Masks Array'
167
- }
168
- },
169
- components: {
170
- TheMask
171
- },
172
- data() {
173
- return {
174
- focused: false
175
- };
176
- },
177
- computed: {
178
- listeners() {
179
- return {
180
- ...this.$listeners,
181
- input: this.updateValue,
182
- focus: this.onFocus,
183
- blur: this.onBlur
184
- };
185
- },
186
- slotData() {
187
- return {
188
- focused: this.focused,
189
- error: this.error,
190
- ...this.listeners
191
- };
192
- },
193
- hasIcon() {
194
- const { append, prepend } = this.$slots;
195
- return (
196
- append !== undefined ||
197
- prepend !== undefined ||
198
- this.appendIcon !== undefined ||
199
- this.prependIcon !== undefined ||
200
- this.group
201
- );
202
- }
203
- },
204
- methods: {
205
- updateValue(evt) {
206
- let value = this.mask.length ? evt : evt.target.value;
207
-
208
- this.$emit('input', value);
209
- },
210
- onFocus(evt) {
211
- this.focused = true;
212
- this.$emit('focus', evt);
213
- },
214
- onBlur(evt) {
215
- this.focused = false;
216
- this.$emit('blur', evt);
217
- }
218
- }
219
- };
220
- </script>
221
- <style></style>
1
+ <template>
2
+ <div class="form-group">
3
+ <slot name="label">
4
+ <label
5
+ v-if="label"
6
+ :class="[
7
+ { 'is-invalid': error },
8
+ { 'label-required': required },
9
+ labelClasses
10
+ ]"
11
+ >
12
+ {{ label }}
13
+ <span v-if="required" class="label-required-text"
14
+ >Obrigatório</span
15
+ >
16
+ </label>
17
+ </slot>
18
+ <div
19
+ :class="[
20
+ { 'input-group': hasIcon },
21
+ { focused: focused },
22
+ { 'input-group-alternative': alternative },
23
+ { 'has-label': label || $slots.label },
24
+ inputGroupClasses
25
+ ]"
26
+ >
27
+ <div
28
+ v-if="prependIcon || $slots.prepend"
29
+ class="input-group-prepend"
30
+ >
31
+ <span class="input-group-text">
32
+ <slot name="prepend">
33
+ <i :class="prependIcon"></i>
34
+ </slot>
35
+ </span>
36
+ </div>
37
+ <slot v-bind="slotData" v-if="type !== 'textarea'">
38
+ <input
39
+ v-if="!mask.length"
40
+ :value="value"
41
+ :type="type"
42
+ v-on="listeners"
43
+ v-bind="$attrs"
44
+ :valid="!error"
45
+ :required="required"
46
+ class="form-control"
47
+ :class="[
48
+ { 'is-valid': valid === true },
49
+ { 'is-invalid': error },
50
+ inputClasses
51
+ ]"
52
+ />
53
+ <the-mask
54
+ v-else
55
+ class="form-control"
56
+ v-on="listeners"
57
+ v-bind="$attrs"
58
+ type="text"
59
+ :required="required"
60
+ :mask="mask"
61
+ :class="[
62
+ { 'is-valid': valid === true },
63
+ { 'is-invalid': error },
64
+ inputClasses
65
+ ]"
66
+ />
67
+ </slot>
68
+ <slot v-bind="slotData" v-else>
69
+ <textarea
70
+ :value="value"
71
+ v-on="listeners"
72
+ v-bind="$attrs"
73
+ :required="required"
74
+ class="form-control form-control-textarea"
75
+ :valid="!error"
76
+ :class="[
77
+ { 'is-valid': valid === true },
78
+ { 'is-invalid': error },
79
+ inputClasses
80
+ ]"
81
+ />
82
+ </slot>
83
+ <div v-if="appendIcon || $slots.append" class="input-group-append">
84
+ <span class="input-group-text">
85
+ <slot name="append">
86
+ <i :class="appendIcon"></i>
87
+ </slot>
88
+ </span>
89
+ </div>
90
+ <slot name="infoBlock"></slot>
91
+ <slot name="error">
92
+ <div
93
+ v-if="error"
94
+ class="invalid-feedback"
95
+ style="display: block;"
96
+ >
97
+ {{ error }}
98
+ </div>
99
+ </slot>
100
+ <slot name="success">
101
+ <div class="valid-feedback" v-if="!error && valid">
102
+ {{ successMessage }}
103
+ </div>
104
+ </slot>
105
+ </div>
106
+ </div>
107
+ </template>
108
+ <script>
109
+ import { TheMask } from 'vue-the-mask';
110
+
111
+ export default {
112
+ inheritAttrs: false,
113
+ name: 'base-input',
114
+ props: {
115
+ required: {
116
+ type: Boolean,
117
+ description: 'Whether input is required (adds an asterix *)'
118
+ },
119
+ group: {
120
+ type: Boolean,
121
+ description:
122
+ 'Whether input is an input group (manual override in special cases)'
123
+ },
124
+ valid: {
125
+ type: Boolean,
126
+ description: 'Whether is valid',
127
+ default: undefined
128
+ },
129
+ alternative: {
130
+ type: Boolean,
131
+ description: 'Whether input is of alternative layout'
132
+ },
133
+ label: {
134
+ type: String,
135
+ description: 'Input label (text before input)'
136
+ },
137
+ error: {
138
+ type: String,
139
+ description: 'Input error (below input)'
140
+ },
141
+ successMessage: {
142
+ type: String,
143
+ description: 'Input success message',
144
+ default: 'Looks good!'
145
+ },
146
+ labelClasses: {
147
+ type: String,
148
+ description: 'Input label css classes',
149
+ default: 'form-control-label'
150
+ },
151
+ inputClasses: {
152
+ type: String,
153
+ description: 'Input css classes'
154
+ },
155
+ inputGroupClasses: {
156
+ type: String,
157
+ description: 'Input group css classes'
158
+ },
159
+ value: {
160
+ type: [String, Number],
161
+ description: 'Input value'
162
+ },
163
+ type: {
164
+ type: String,
165
+ description: 'Input type',
166
+ default: 'text'
167
+ },
168
+ appendIcon: {
169
+ type: String,
170
+ description: 'Append icon (right)'
171
+ },
172
+ prependIcon: {
173
+ type: String,
174
+ description: 'Prepend icon (left)'
175
+ },
176
+ mask: {
177
+ type: Array,
178
+ default: () => {
179
+ return [];
180
+ },
181
+ description: 'Masks Array'
182
+ }
183
+ },
184
+ components: {
185
+ TheMask
186
+ },
187
+ data() {
188
+ return {
189
+ focused: false
190
+ };
191
+ },
192
+ computed: {
193
+ listeners() {
194
+ return {
195
+ ...this.$listeners,
196
+ input: this.updateValue,
197
+ focus: this.onFocus,
198
+ blur: this.onBlur
199
+ };
200
+ },
201
+ slotData() {
202
+ return {
203
+ focused: this.focused,
204
+ error: this.error,
205
+ ...this.listeners
206
+ };
207
+ },
208
+ hasIcon() {
209
+ const { append, prepend } = this.$slots;
210
+ return (
211
+ append !== undefined ||
212
+ prepend !== undefined ||
213
+ this.appendIcon !== undefined ||
214
+ this.prependIcon !== undefined ||
215
+ this.group
216
+ );
217
+ }
218
+ },
219
+ methods: {
220
+ updateValue(evt) {
221
+ let value = this.mask.length ? evt : evt.target.value;
222
+
223
+ this.$emit('input', value);
224
+ },
225
+ onFocus(evt) {
226
+ this.focused = true;
227
+ this.$emit('focus', evt);
228
+ },
229
+ onBlur(evt) {
230
+ this.focused = false;
231
+ this.$emit('blur', evt);
232
+ }
233
+ }
234
+ };
235
+ </script>
236
+ <style lang="scss" scoped>
237
+ .form-control-textarea {
238
+ height: 180px;
239
+ resize: none;
240
+ }
241
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.376",
3
+ "version": "1.0.378",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {