@weni/unnnic-system 3.2.4 → 3.2.5-alpha.0
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.
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/types.d.ts +1 -1
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/components/DropArea/DropArea.vue.d.ts +2 -0
- package/dist/components/DropArea/DropArea.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +3 -3
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +6 -0
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +9 -0
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -0
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +15 -0
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +1 -0
- package/dist/components/UploadArea/UploadArea.vue.d.ts +6 -0
- package/dist/components/index.d.ts +54 -14
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-d628da75.mjs → es-e4a6e990.mjs} +1 -1
- package/dist/{index-9a407ee0.mjs → index-de083a7a.mjs} +7591 -7433
- package/dist/{pt-br-d5be1f83.mjs → pt-br-229e5ab3.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +126 -122
- package/dist/unnnic.umd.js +42 -41
- package/package.json +2 -2
- package/src/assets/img/previews/doc-preview.png +0 -0
- package/src/assets/img/previews/image-preview.png +0 -0
- package/src/assets/img/previews/video-preview.png +0 -0
- package/src/components/Button/Button.vue +57 -108
- package/src/components/Button/types.ts +0 -1
- package/src/components/DropArea/DropArea.vue +26 -2
- package/src/components/ModalDialog/ModalDialog.vue +27 -29
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
- package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +2 -2
- package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +2 -2
- package/src/components/TemplatePreview/TemplatePreview.vue +249 -0
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +51 -0
- package/src/components/TemplatePreview/types.d.ts +16 -0
- package/src/components/index.ts +12 -3
- package/src/stories/Button.stories.js +1 -10
- package/src/stories/TemplatePreview.stories.js +94 -0
- package/src/stories/TemplatePreviewModal.stories.js +110 -0
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,20 +6,16 @@
|
|
|
6
6
|
:class="[
|
|
7
7
|
'unnnic-button',
|
|
8
8
|
`unnnic-button--size-${size}`,
|
|
9
|
-
`unnnic-button--${
|
|
9
|
+
`unnnic-button--${buttonType}`,
|
|
10
10
|
iconCenter ? `unnnic-button--icon-on-center` : null,
|
|
11
11
|
float ? `unnnic-button--float` : null,
|
|
12
12
|
]"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
14
|
+
<UnnnicIconLoading
|
|
15
15
|
v-if="loading"
|
|
16
|
-
icon="loading-circle-1"
|
|
17
16
|
:scheme="iconScheme"
|
|
18
17
|
:size="iconSize"
|
|
19
|
-
:filled="iconsFilled"
|
|
20
18
|
:style="{ position: 'absolute' }"
|
|
21
|
-
class="rotation"
|
|
22
|
-
:next="next"
|
|
23
19
|
data-testid="icon-loading"
|
|
24
20
|
/>
|
|
25
21
|
|
|
@@ -72,6 +68,7 @@
|
|
|
72
68
|
<script setup lang="ts">
|
|
73
69
|
import { computed, watch, useSlots } from 'vue';
|
|
74
70
|
import UnnnicIcon from '../Icon.vue';
|
|
71
|
+
import UnnnicIconLoading from '../IconLoading/IconLoading.vue';
|
|
75
72
|
import type { ButtonProps, ButtonSize, ButtonType } from './types';
|
|
76
73
|
import type { SchemeColor } from '../Icon/types';
|
|
77
74
|
|
|
@@ -102,8 +99,8 @@ const buttonDisabled = computed(() => {
|
|
|
102
99
|
});
|
|
103
100
|
|
|
104
101
|
const iconSize = computed(() => {
|
|
105
|
-
if (props.size === '
|
|
106
|
-
return '
|
|
102
|
+
if (props.size === 'extra-large') return 'lg';
|
|
103
|
+
return 'ant';
|
|
107
104
|
});
|
|
108
105
|
|
|
109
106
|
const hasText = computed(() => {
|
|
@@ -120,12 +117,11 @@ const iconScheme = computed((): SchemeColor => {
|
|
|
120
117
|
primary: 'neutral-white',
|
|
121
118
|
secondary: 'neutral-dark',
|
|
122
119
|
tertiary: 'neutral-dark',
|
|
123
|
-
alternative: 'neutral-white',
|
|
124
120
|
warning: 'neutral-white',
|
|
125
121
|
attention: 'neutral-white',
|
|
126
122
|
};
|
|
127
123
|
|
|
128
|
-
return typeToSchemeMap[
|
|
124
|
+
return typeToSchemeMap[buttonType.value] || 'neutral-white';
|
|
129
125
|
});
|
|
130
126
|
|
|
131
127
|
const isSizePropValid = computed(() => {
|
|
@@ -136,16 +132,21 @@ const isSizePropValid = computed(() => {
|
|
|
136
132
|
);
|
|
137
133
|
});
|
|
138
134
|
|
|
135
|
+
const buttonType = computed(() => {
|
|
136
|
+
return {
|
|
137
|
+
'alternative': 'tertiary',
|
|
138
|
+
}[props.type] || props.type;
|
|
139
|
+
});
|
|
140
|
+
|
|
139
141
|
const isTypePropValid = computed(() => {
|
|
140
142
|
const validTypes: ButtonType[] = [
|
|
141
143
|
'primary',
|
|
142
144
|
'secondary',
|
|
143
145
|
'tertiary',
|
|
144
|
-
'alternative',
|
|
145
146
|
'warning',
|
|
146
147
|
'attention',
|
|
147
148
|
];
|
|
148
|
-
return validTypes.includes(
|
|
149
|
+
return validTypes.includes(buttonType.value);
|
|
149
150
|
});
|
|
150
151
|
|
|
151
152
|
const validateProps = () => {
|
|
@@ -159,6 +160,7 @@ const validateProps = () => {
|
|
|
159
160
|
|
|
160
161
|
if (!isTypePropValid.value) {
|
|
161
162
|
errorMessage += ' Invalid type prop.';
|
|
163
|
+
errorMessage += ' Please provide one of the following types: primary, secondary, tertiary, warning, attention. Alternative is discontinued and it was forced renamed to tertiary.';
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
throw new Error(errorMessage);
|
|
@@ -196,13 +198,12 @@ watch(
|
|
|
196
198
|
display: inline-flex;
|
|
197
199
|
align-items: center;
|
|
198
200
|
justify-content: center;
|
|
199
|
-
border-radius: $unnnic-
|
|
201
|
+
border-radius: $unnnic-radius-2;
|
|
200
202
|
border: 0;
|
|
201
203
|
outline: none;
|
|
202
204
|
overflow: hidden;
|
|
203
205
|
white-space: nowrap;
|
|
204
|
-
font
|
|
205
|
-
font-family: $unnnic-font-family-secondary;
|
|
206
|
+
font: $unnnic-font-action;
|
|
206
207
|
cursor: pointer;
|
|
207
208
|
position: relative;
|
|
208
209
|
|
|
@@ -216,129 +217,91 @@ watch(
|
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
|
220
|
+
&--primary,
|
|
221
|
+
&--warning,
|
|
222
|
+
&--attention {
|
|
223
|
+
color: $unnnic-color-fg-inverted;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&--secondary,
|
|
227
|
+
&--tertiary {
|
|
228
|
+
color: $unnnic-color-fg-emphasized;
|
|
229
|
+
}
|
|
230
|
+
|
|
219
231
|
&--primary {
|
|
220
|
-
background-color: $unnnic-color-
|
|
221
|
-
color: $unnnic-color-neutral-white;
|
|
232
|
+
background-color: $unnnic-color-bg-active;
|
|
222
233
|
|
|
223
234
|
&:hover:enabled {
|
|
224
|
-
background-color: $unnnic-color-
|
|
235
|
+
background-color: $unnnic-color-teal-700;
|
|
225
236
|
}
|
|
226
237
|
|
|
227
238
|
&:active:enabled {
|
|
228
|
-
background-color: $unnnic-color-
|
|
239
|
+
background-color: $unnnic-color-teal-800;
|
|
229
240
|
}
|
|
230
241
|
}
|
|
231
242
|
|
|
232
243
|
&--secondary {
|
|
233
|
-
background-color: $unnnic-color-
|
|
234
|
-
color: $unnnic-color-neutral-dark;
|
|
244
|
+
background-color: $unnnic-color-bg-base;
|
|
235
245
|
box-shadow: inset 0 0 0 $unnnic-border-width-thinner
|
|
236
|
-
$unnnic-color-
|
|
246
|
+
$unnnic-color-border-base;
|
|
237
247
|
|
|
238
248
|
&:hover:enabled {
|
|
239
|
-
background-color: $unnnic-color-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
&:disabled {
|
|
243
|
-
box-shadow: none;
|
|
249
|
+
background-color: $unnnic-color-gray-50;
|
|
244
250
|
}
|
|
245
251
|
|
|
246
252
|
&:active:enabled {
|
|
247
|
-
background-color: $unnnic-color-
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
&--tertiary {
|
|
252
|
-
background-color: transparent;
|
|
253
|
-
color: $unnnic-color-neutral-dark;
|
|
254
|
-
|
|
255
|
-
&:hover:enabled {
|
|
256
|
-
background-color: $unnnic-color-neutral-light;
|
|
253
|
+
background-color: $unnnic-color-gray-100;
|
|
257
254
|
}
|
|
258
255
|
|
|
259
256
|
&:disabled {
|
|
260
|
-
|
|
261
|
-
cursor: not-allowed;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
&:active:enabled {
|
|
265
|
-
background-color: $unnnic-color-neutral-soft;
|
|
257
|
+
box-shadow: none;
|
|
266
258
|
}
|
|
267
259
|
}
|
|
268
260
|
|
|
269
|
-
&--
|
|
270
|
-
background-color:
|
|
271
|
-
color: $unnnic-color-weni-800;
|
|
272
|
-
|
|
273
|
-
:deep(svg .primary) {
|
|
274
|
-
fill: $unnnic-color-weni-800;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
:deep(svg .primary-stroke) {
|
|
278
|
-
stroke: $unnnic-color-weni-800;
|
|
279
|
-
}
|
|
261
|
+
&--tertiary {
|
|
262
|
+
background-color: transparent;
|
|
280
263
|
|
|
281
264
|
&:hover:enabled {
|
|
282
|
-
background-color: $unnnic-color-
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
&:disabled {
|
|
286
|
-
:deep(svg .primary) {
|
|
287
|
-
fill: $unnnic-color-neutral-clean;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
:deep(svg .primary-stroke) {
|
|
291
|
-
stroke: $unnnic-color-neutral-clean;
|
|
292
|
-
}
|
|
265
|
+
background-color: rgba($unnnic-color-gray-400, 0.1);
|
|
293
266
|
}
|
|
294
267
|
|
|
295
268
|
&:active:enabled {
|
|
296
|
-
background-color: $unnnic-color-
|
|
297
|
-
color: $unnnic-color-weni-900;
|
|
298
|
-
|
|
299
|
-
:deep(svg .primary) {
|
|
300
|
-
fill: $unnnic-color-weni-900;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
:deep(svg .primary-stroke) {
|
|
304
|
-
stroke: $unnnic-color-weni-900;
|
|
305
|
-
}
|
|
269
|
+
background-color: rgba($unnnic-color-gray-400, 0.2);
|
|
306
270
|
}
|
|
307
271
|
}
|
|
308
272
|
|
|
309
273
|
&--warning {
|
|
310
|
-
background-color: $unnnic-color-
|
|
274
|
+
background-color: $unnnic-color-red-500;
|
|
311
275
|
color: $unnnic-color-neutral-white;
|
|
312
276
|
|
|
313
277
|
&:hover:enabled {
|
|
314
|
-
background-color: $unnnic-color-
|
|
278
|
+
background-color: $unnnic-color-red-600;
|
|
315
279
|
}
|
|
316
280
|
|
|
317
281
|
&:active:enabled {
|
|
318
|
-
background-color: $unnnic-color-
|
|
282
|
+
background-color: $unnnic-color-red-700;
|
|
319
283
|
}
|
|
320
284
|
}
|
|
321
285
|
|
|
322
286
|
&--attention {
|
|
323
|
-
background-color: $unnnic-color-
|
|
324
|
-
color: $unnnic-color-neutral-white;
|
|
287
|
+
background-color: $unnnic-color-yellow-500;
|
|
325
288
|
|
|
326
289
|
&:hover:enabled {
|
|
327
|
-
background-color: $unnnic-color-
|
|
290
|
+
background-color: $unnnic-color-yellow-600;
|
|
328
291
|
}
|
|
329
292
|
|
|
330
293
|
&:active:enabled {
|
|
331
|
-
background-color: $unnnic-color-
|
|
294
|
+
background-color: $unnnic-color-yellow-700;
|
|
332
295
|
}
|
|
333
296
|
}
|
|
334
297
|
|
|
335
298
|
&--primary:disabled,
|
|
336
299
|
&--secondary:disabled,
|
|
337
|
-
&--
|
|
300
|
+
&--tertiary:disabled,
|
|
338
301
|
&--warning:disabled,
|
|
339
302
|
&--attention:disabled {
|
|
340
|
-
background-color: $unnnic-color-
|
|
341
|
-
color: $unnnic-color-
|
|
303
|
+
background-color: $unnnic-color-bg-muted;
|
|
304
|
+
color: $unnnic-color-fg-muted;
|
|
342
305
|
cursor: not-allowed;
|
|
343
306
|
}
|
|
344
307
|
|
|
@@ -351,26 +314,12 @@ watch(
|
|
|
351
314
|
box-shadow: $unnnic-shadow-level-near;
|
|
352
315
|
}
|
|
353
316
|
|
|
354
|
-
&--size {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
&-small {
|
|
358
|
-
padding: $unnnic-squish-xs;
|
|
359
|
-
font-size: $unnnic-font-size-body-gt;
|
|
360
|
-
line-height: ($unnnic-font-size-body-gt + $unnnic-line-height-medium);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
&-extra-large {
|
|
364
|
-
height: 58px;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
&-large {
|
|
368
|
-
height: 46px;
|
|
369
|
-
}
|
|
317
|
+
&--size-large {
|
|
318
|
+
padding: $unnnic-space-3 $unnnic-space-4;
|
|
319
|
+
}
|
|
370
320
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
321
|
+
&--size-small {
|
|
322
|
+
padding: $unnnic-space-2 $unnnic-space-4;
|
|
374
323
|
}
|
|
375
324
|
}
|
|
376
325
|
</style>
|
|
@@ -388,8 +337,8 @@ watch(
|
|
|
388
337
|
}
|
|
389
338
|
|
|
390
339
|
&-large {
|
|
391
|
-
height:
|
|
392
|
-
width:
|
|
340
|
+
height: 45px;
|
|
341
|
+
width: 45px;
|
|
393
342
|
}
|
|
394
343
|
|
|
395
344
|
&-large,
|
|
@@ -404,8 +353,8 @@ watch(
|
|
|
404
353
|
|
|
405
354
|
&-small {
|
|
406
355
|
padding: $unnnic-inset-nano;
|
|
407
|
-
height:
|
|
408
|
-
width:
|
|
356
|
+
height: 37px;
|
|
357
|
+
width: 37px;
|
|
409
358
|
|
|
410
359
|
.unnnic-icon {
|
|
411
360
|
width: $unnnic-icon-size-ant;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@dragleave.stop.prevent="dragleave"
|
|
12
12
|
@dragend.stop.prevent="dragend"
|
|
13
13
|
@drop.stop.prevent="drop"
|
|
14
|
-
@click="
|
|
14
|
+
@click="handleDropzoneClick"
|
|
15
15
|
>
|
|
16
16
|
<UnnnicIcon
|
|
17
17
|
class="unnnic-upload-area__dropzone__icon"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
</template>
|
|
65
65
|
|
|
66
66
|
<script setup>
|
|
67
|
-
import { ref, computed, getCurrentInstance } from 'vue';
|
|
67
|
+
import { ref, computed, getCurrentInstance, useTemplateRef } from 'vue';
|
|
68
68
|
import mime from 'mime';
|
|
69
69
|
|
|
70
70
|
import UnnnicIcon from '../Icon.vue';
|
|
@@ -73,6 +73,7 @@ const isDragging = ref(false);
|
|
|
73
73
|
const hasError = ref(false);
|
|
74
74
|
const dragEnterCounter = ref(0);
|
|
75
75
|
const file = ref();
|
|
76
|
+
const fileRef = useTemplateRef('file');
|
|
76
77
|
|
|
77
78
|
const props = defineProps({
|
|
78
79
|
acceptMultiple: {
|
|
@@ -111,6 +112,11 @@ const props = defineProps({
|
|
|
111
112
|
type: String,
|
|
112
113
|
default: '',
|
|
113
114
|
},
|
|
115
|
+
|
|
116
|
+
disabled: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: false,
|
|
119
|
+
}
|
|
114
120
|
});
|
|
115
121
|
|
|
116
122
|
const emit = defineEmits([
|
|
@@ -135,15 +141,21 @@ const formattedSupportedFormats = computed(() => {
|
|
|
135
141
|
});
|
|
136
142
|
|
|
137
143
|
function dragenter() {
|
|
144
|
+
if (props.disabled) return;
|
|
145
|
+
|
|
138
146
|
dragEnterCounter.value += 1;
|
|
139
147
|
isDragging.value = true;
|
|
140
148
|
}
|
|
141
149
|
|
|
142
150
|
function dragover() {
|
|
151
|
+
if (props.disabled) return;
|
|
152
|
+
|
|
143
153
|
isDragging.value = true;
|
|
144
154
|
}
|
|
145
155
|
|
|
146
156
|
function dragleave() {
|
|
157
|
+
if (props.disabled) return;
|
|
158
|
+
|
|
147
159
|
dragEnterCounter.value -= 1;
|
|
148
160
|
if (dragEnterCounter.value === 0) {
|
|
149
161
|
isDragging.value = false;
|
|
@@ -151,10 +163,14 @@ function dragleave() {
|
|
|
151
163
|
}
|
|
152
164
|
|
|
153
165
|
function dragend() {
|
|
166
|
+
if (props.disabled) return;
|
|
167
|
+
|
|
154
168
|
isDragging.value = false;
|
|
155
169
|
}
|
|
156
170
|
|
|
157
171
|
function drop(event) {
|
|
172
|
+
if (props.disabled) return;
|
|
173
|
+
|
|
158
174
|
isDragging.value = false;
|
|
159
175
|
|
|
160
176
|
const { files } = event.dataTransfer;
|
|
@@ -164,7 +180,15 @@ function drop(event) {
|
|
|
164
180
|
}
|
|
165
181
|
}
|
|
166
182
|
|
|
183
|
+
function handleDropzoneClick() {
|
|
184
|
+
if (props.disabled) return;
|
|
185
|
+
|
|
186
|
+
fileRef.value.click();
|
|
187
|
+
}
|
|
188
|
+
|
|
167
189
|
function handleFileChange(event) {
|
|
190
|
+
if (props.disabled) return;
|
|
191
|
+
|
|
168
192
|
const { files } = event.target;
|
|
169
193
|
|
|
170
194
|
if (validateFiles(files)) {
|
|
@@ -24,10 +24,7 @@
|
|
|
24
24
|
</section>
|
|
25
25
|
|
|
26
26
|
<section class="unnnic-modal-dialog__container__body">
|
|
27
|
-
<header
|
|
28
|
-
v-if="title"
|
|
29
|
-
class="unnnic-modal-dialog__container__header"
|
|
30
|
-
>
|
|
27
|
+
<header v-if="title" class="unnnic-modal-dialog__container__header">
|
|
31
28
|
<section class="unnnic-modal-dialog__container__title-container">
|
|
32
29
|
<UnnnicIcon
|
|
33
30
|
v-if="icon || type"
|
|
@@ -49,6 +46,7 @@
|
|
|
49
46
|
data-testid="close-icon"
|
|
50
47
|
icon="close"
|
|
51
48
|
clickable
|
|
49
|
+
scheme="neutral-cloudy"
|
|
52
50
|
@click="close()"
|
|
53
51
|
/>
|
|
54
52
|
</header>
|
|
@@ -98,12 +96,12 @@
|
|
|
98
96
|
</template>
|
|
99
97
|
|
|
100
98
|
<script>
|
|
101
|
-
import UnnnicIcon from
|
|
102
|
-
import UnnnicButton from
|
|
103
|
-
import UnnnicI18n from
|
|
99
|
+
import UnnnicIcon from "../Icon.vue";
|
|
100
|
+
import UnnnicButton from "../Button/Button.vue";
|
|
101
|
+
import UnnnicI18n from "../../mixins/i18n";
|
|
104
102
|
|
|
105
103
|
export default {
|
|
106
|
-
name:
|
|
104
|
+
name: "UnnnicModalDialog",
|
|
107
105
|
components: {
|
|
108
106
|
UnnnicIcon,
|
|
109
107
|
UnnnicButton,
|
|
@@ -120,29 +118,29 @@ export default {
|
|
|
120
118
|
},
|
|
121
119
|
type: {
|
|
122
120
|
type: String,
|
|
123
|
-
default:
|
|
121
|
+
default: "",
|
|
124
122
|
validate(type) {
|
|
125
|
-
return [
|
|
123
|
+
return ["success", "warning", "attention"].includes(type);
|
|
126
124
|
},
|
|
127
125
|
},
|
|
128
126
|
size: {
|
|
129
127
|
type: String,
|
|
130
|
-
default:
|
|
128
|
+
default: "md",
|
|
131
129
|
validate(size) {
|
|
132
|
-
return [
|
|
130
|
+
return ["sm", "md", "lg"].includes(size);
|
|
133
131
|
},
|
|
134
132
|
},
|
|
135
133
|
title: {
|
|
136
134
|
type: String,
|
|
137
|
-
default:
|
|
135
|
+
default: "",
|
|
138
136
|
},
|
|
139
137
|
icon: {
|
|
140
138
|
type: String,
|
|
141
|
-
default:
|
|
139
|
+
default: "",
|
|
142
140
|
},
|
|
143
141
|
iconScheme: {
|
|
144
142
|
type: String,
|
|
145
|
-
default:
|
|
143
|
+
default: "",
|
|
146
144
|
},
|
|
147
145
|
showCloseIcon: {
|
|
148
146
|
type: Boolean,
|
|
@@ -165,26 +163,26 @@ export default {
|
|
|
165
163
|
default: () => ({}),
|
|
166
164
|
},
|
|
167
165
|
},
|
|
168
|
-
emits: [
|
|
166
|
+
emits: ["primaryButtonClick", "secondaryButtonClick", "update:modelValue"],
|
|
169
167
|
|
|
170
168
|
data() {
|
|
171
169
|
return {
|
|
172
170
|
defaultTranslations: {
|
|
173
171
|
cancel: {
|
|
174
|
-
|
|
175
|
-
en:
|
|
176
|
-
es:
|
|
172
|
+
"pt-br": "Cancelar",
|
|
173
|
+
en: "Cancel",
|
|
174
|
+
es: "Cancelar",
|
|
177
175
|
},
|
|
178
176
|
},
|
|
179
177
|
iconsMapper: {
|
|
180
|
-
success: { icon:
|
|
181
|
-
warning: { icon:
|
|
182
|
-
attention: { icon:
|
|
178
|
+
success: { icon: "check_circle", scheme: "aux-green-500" },
|
|
179
|
+
warning: { icon: "warning", scheme: "aux-red-500" },
|
|
180
|
+
attention: { icon: "error", scheme: "aux-yellow-500" },
|
|
183
181
|
},
|
|
184
182
|
primaryButtonTypeMapper: {
|
|
185
|
-
success:
|
|
186
|
-
warning:
|
|
187
|
-
attention:
|
|
183
|
+
success: "primary",
|
|
184
|
+
warning: "warning",
|
|
185
|
+
attention: "attention",
|
|
188
186
|
},
|
|
189
187
|
};
|
|
190
188
|
},
|
|
@@ -195,17 +193,17 @@ export default {
|
|
|
195
193
|
},
|
|
196
194
|
methods: {
|
|
197
195
|
close() {
|
|
198
|
-
this.$emit(
|
|
196
|
+
this.$emit("update:modelValue", false);
|
|
199
197
|
},
|
|
200
198
|
updateBodyOverflow(isHidden) {
|
|
201
|
-
document.body.style.overflow = isHidden ?
|
|
199
|
+
document.body.style.overflow = isHidden ? "hidden" : "";
|
|
202
200
|
},
|
|
203
201
|
},
|
|
204
202
|
};
|
|
205
203
|
</script>
|
|
206
204
|
|
|
207
205
|
<style lang="scss" scoped>
|
|
208
|
-
@use
|
|
206
|
+
@use "@/assets/scss/unnnic" as *;
|
|
209
207
|
* {
|
|
210
208
|
margin: 0;
|
|
211
209
|
padding: 0;
|
|
@@ -312,7 +310,7 @@ export default {
|
|
|
312
310
|
&__actions {
|
|
313
311
|
display: grid;
|
|
314
312
|
grid-template-columns: 1fr 1fr;
|
|
315
|
-
grid-template-areas:
|
|
313
|
+
grid-template-areas: "secondary-button primary-button";
|
|
316
314
|
gap: $unnnic-spacing-sm;
|
|
317
315
|
padding: $unnnic-spacing-md;
|
|
318
316
|
flex-shrink: 0;
|
|
@@ -11,7 +11,7 @@ exports[`ModalDialog.vue > Elements rendering > matches the snapshot 1`] = `
|
|
|
11
11
|
<unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="test-icon" clickable="false" size="md" scheme="neutral-darkest" data-testid="title-icon" class="unnnic-modal-dialog__container__title-icon"></unnnic-icon-stub>
|
|
12
12
|
<h1 data-v-68ebadeb="" class="unnnic-modal-dialog__container__title-text" data-testid="title-text">Test Title</h1>
|
|
13
13
|
</section>
|
|
14
|
-
<unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="close" clickable="true" size="md" scheme="neutral-
|
|
14
|
+
<unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="close" clickable="true" size="md" scheme="neutral-cloudy" data-testid="close-icon"></unnnic-icon-stub>
|
|
15
15
|
</header>
|
|
16
16
|
<section data-v-68ebadeb="" class="unnnic-modal-dialog__container__content"></section>
|
|
17
17
|
<section data-v-68ebadeb="" data-testid="actions-section" class="unnnic-modal-dialog__container__actions">
|
|
@@ -42,7 +42,7 @@ exports[`TableNext.vue > matches the snapshot 1`] = `
|
|
|
42
42
|
<p data-v-e29458bb="" class="table-pagination__count" data-testid="count">1 - 1 of 1</p>
|
|
43
43
|
<div data-v-0eeff8cb="" data-v-e29458bb="" class="pagination"><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="previous-button" disabled="" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
44
44
|
<!--v-if-->
|
|
45
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
45
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--ant unnnic-icon-scheme--neutral-clean" data-testid="icon-center" style="visibility: visible;">
|
|
46
46
|
<path d="M26.8368 35.0005C26.5868 35.0005 26.3506 34.903 26.1743 34.7255L12.7743 21.3255C12.4206 20.9717 12.2256 20.5017 12.2256 20.0017C12.2256 19.5017 12.4193 19.0305 12.7731 18.6767L26.1743 5.27549C26.3506 5.09799 26.5868 5.00049 26.8368 5.00049C27.0868 5.00049 27.3231 5.09799 27.4993 5.27549C27.6768 5.45174 27.7743 5.68799 27.7743 5.93799C27.7743 6.18799 27.6768 6.42424 27.4993 6.60049L14.0993 20.0005L27.4993 33.4005C27.6768 33.578 27.7743 33.813 27.7743 34.063C27.7743 34.313 27.6768 34.5492 27.4993 34.7255C27.3218 34.9017 27.0868 35.0005 26.8368 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
47
47
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
48
48
|
<!--v-if-->
|
|
@@ -53,7 +53,7 @@ exports[`TableNext.vue > matches the snapshot 1`] = `
|
|
|
53
53
|
<!--v-if-->
|
|
54
54
|
</button><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="next-button" disabled="" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
55
55
|
<!--v-if-->
|
|
56
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
56
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--ant unnnic-icon-scheme--neutral-clean" data-testid="icon-center" style="visibility: visible;">
|
|
57
57
|
<path d="M13.1635 35.0005C12.9135 35.0005 12.6772 34.903 12.501 34.7255C12.136 34.3605 12.136 33.7655 12.501 33.3992L25.901 20.0005L12.501 6.60049C12.3235 6.42424 12.226 6.18799 12.226 5.93799C12.226 5.68799 12.3235 5.45174 12.501 5.27549C12.6772 5.09799 12.9135 5.00049 13.1635 5.00049C13.4135 5.00049 13.6497 5.09799 13.826 5.27549L27.226 18.6755C27.956 19.4055 27.9572 20.5942 27.2272 21.3242L13.826 34.7255C13.6497 34.903 13.4135 35.0005 13.1635 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
58
58
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
59
59
|
<!--v-if-->
|
|
@@ -5,7 +5,7 @@ exports[`TablePagination.vue > matches the snapshot 1`] = `
|
|
|
5
5
|
<p data-v-e29458bb="" class="table-pagination__count" data-testid="count">1 - 10 of 100</p>
|
|
6
6
|
<div data-v-0eeff8cb="" data-v-e29458bb="" class="pagination"><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="previous-button" disabled="" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
7
7
|
<!--v-if-->
|
|
8
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
8
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--ant unnnic-icon-scheme--neutral-clean" data-testid="icon-center" style="visibility: visible;">
|
|
9
9
|
<path d="M26.8368 35.0005C26.5868 35.0005 26.3506 34.903 26.1743 34.7255L12.7743 21.3255C12.4206 20.9717 12.2256 20.5017 12.2256 20.0017C12.2256 19.5017 12.4193 19.0305 12.7731 18.6767L26.1743 5.27549C26.3506 5.09799 26.5868 5.00049 26.8368 5.00049C27.0868 5.00049 27.3231 5.09799 27.4993 5.27549C27.6768 5.45174 27.7743 5.68799 27.7743 5.93799C27.7743 6.18799 27.6768 6.42424 27.4993 6.60049L14.0993 20.0005L27.4993 33.4005C27.6768 33.578 27.7743 33.813 27.7743 34.063C27.7743 34.313 27.6768 34.5492 27.4993 34.7255C27.3218 34.9017 27.0868 35.0005 26.8368 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
10
10
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
11
11
|
<!--v-if-->
|
|
@@ -36,7 +36,7 @@ exports[`TablePagination.vue > matches the snapshot 1`] = `
|
|
|
36
36
|
<!--v-if-->
|
|
37
37
|
</button><button data-v-ceff2a60="" data-v-0eeff8cb="" data-test="next-button" class="unnnic-button unnnic-button--size-small unnnic-button--tertiary unnnic-button--icon-on-center">
|
|
38
38
|
<!--v-if-->
|
|
39
|
-
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--
|
|
39
|
+
<!--v-if--><svg data-v-26446d8e="" data-v-ceff2a60="" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--ant unnnic-icon-scheme--neutral-dark" data-testid="icon-center" style="visibility: visible;">
|
|
40
40
|
<path d="M13.1635 35.0005C12.9135 35.0005 12.6772 34.903 12.501 34.7255C12.136 34.3605 12.136 33.7655 12.501 33.3992L25.901 20.0005L12.501 6.60049C12.3235 6.42424 12.226 6.18799 12.226 5.93799C12.226 5.68799 12.3235 5.45174 12.501 5.27549C12.6772 5.09799 12.9135 5.00049 13.1635 5.00049C13.4135 5.00049 13.6497 5.09799 13.826 5.27549L27.226 18.6755C27.956 19.4055 27.9572 20.5942 27.2272 21.3242L13.826 34.7255C13.6497 34.903 13.4135 35.0005 13.1635 35.0005Z" fill="#3B414D" class="primary"></path>
|
|
41
41
|
</svg><span data-v-ceff2a60="" class="unnnic-button__label" style="visibility: visible;" data-testid="button-label"> </span>
|
|
42
42
|
<!--v-if-->
|