@weni/unnnic-system 3.4.1-alpha.2 → 3.5.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/CHANGELOG.md +6 -1
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
- package/dist/components/Alert/Alert.vue.d.ts +119 -18
- package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
- package/dist/components/Alert/Version1dot1.vue.d.ts +38 -2
- package/dist/components/Alert/Version1dot1.vue.d.ts.map +1 -1
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +2 -2
- package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +5 -5
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +2 -2
- package/dist/components/Banner/Banner.vue.d.ts +1 -1
- package/dist/components/Banner/InfoBanner.vue.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +2 -2
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/ButtonIcon.vue.d.ts +1 -1
- package/dist/components/Button/types.d.ts +1 -1
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/AccountCard.vue.d.ts +3 -3
- package/dist/components/Card/BlankCard.vue.d.ts +1 -1
- package/dist/components/Card/Card.vue.d.ts +21 -21
- package/dist/components/Card/CardCompany.vue.d.ts +8 -8
- package/dist/components/Card/CardData.vue.d.ts +1 -1
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +4 -4
- package/dist/components/Card/ContentCard.vue.d.ts +2 -2
- package/dist/components/Card/DashCard.vue.d.ts +4 -4
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +2 -2
- package/dist/components/Card/SimpleCard.vue.d.ts +3 -3
- package/dist/components/Card/StatusCard.vue.d.ts +2 -2
- package/dist/components/Card/TitleCard.vue.d.ts +2 -2
- package/dist/components/CardImage/CardImage.vue.d.ts +33 -24
- package/dist/components/CardInformation/CardInformation.vue.d.ts +4 -4
- package/dist/components/CardProject/CardProject.vue.d.ts +3 -3
- package/dist/components/Carousel/Carousel.vue.d.ts +11 -11
- package/dist/components/Carousel/TagCarousel.vue.d.ts +9 -9
- package/dist/components/ChartBar/ChartBar.vue.d.ts +8 -8
- package/dist/components/ChartLine/ChartLine.vue.d.ts +1 -1
- package/dist/components/ChatText/ChatText.vue.d.ts +2 -2
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +40 -31
- package/dist/components/ChatsDashboardTagLive/ChatsDashboardTagLive.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts.map +1 -1
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +5 -5
- package/dist/components/ChatsMessage/ChatsMessageStatusBackdrop.vue.d.ts +2 -2
- package/dist/components/ChatsNavbar/ChatsNavbar.vue.d.ts +1 -1
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.vue.d.ts +28 -19
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/Comment/Comment.vue.d.ts +1 -1
- package/dist/components/DataArea/DataArea.vue.d.ts +2 -2
- package/dist/components/DataTable/index.vue.d.ts +1 -1
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +29 -176
- package/dist/components/DatePicker/DatePicker.vue.d.ts +6 -6
- package/dist/components/Drawer/Drawer.vue.d.ts +7 -7
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/components/Dropdown/LanguageSelect.vue.d.ts +3 -3
- package/dist/components/Flag.vue.d.ts +2 -2
- package/dist/components/FormElement/FormElement.vue.d.ts +32 -38
- package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
- package/dist/components/Icon.vue.d.ts +1 -1
- package/dist/components/IconLoading/IconLoading.vue.d.ts +1 -1
- package/dist/components/ImportCard/ImportCard.vue.d.ts +7 -7
- package/dist/components/Input/BaseInput.vue.d.ts +1 -32
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +29 -176
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +14 -83
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +36 -183
- package/dist/components/InputNext/InputNext.vue.d.ts +4 -4
- package/dist/components/Label/Label.vue.d.ts +15 -9
- package/dist/components/Label/Label.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +2 -2
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +9 -9
- package/dist/components/ModalNext/ModalNext.vue.d.ts +37 -184
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +14 -14
- package/dist/components/MoodRating/MoodRating.vue.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +14 -20
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +6 -8
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +53 -113
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +8 -8
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +29 -20
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts.map +1 -1
- package/dist/components/SelectTime/index.vue.d.ts +14 -83
- package/dist/components/SkeletonLoading/skeletonTheme.vue.d.ts +1 -1
- package/dist/components/Slider/Slider.vue.d.ts +2 -2
- package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +25 -24
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +2 -13
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
- package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
- package/dist/components/Tag/BrandTag.vue.d.ts +2 -2
- package/dist/components/Tag/DefaultTag.vue.d.ts +2 -2
- package/dist/components/Tag/IndicatorTag.vue.d.ts +2 -2
- package/dist/components/Tag/Tag.vue.d.ts +8 -8
- package/dist/components/TextArea/TextArea.vue.d.ts +32 -38
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- package/dist/components/ToolTip/ToolTip.vue.d.ts +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +6 -6
- package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
- package/dist/components/UploadArea/UploadArea.vue.d.ts +7 -7
- package/dist/components/index.d.ts +1242 -2570
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-eca523be.mjs → es-df2d978e.mjs} +1 -1
- package/dist/{index-c84d6c3d.mjs → index-0a11875e.mjs} +11921 -18138
- package/dist/locales/en.json.d.ts +1 -2
- package/dist/locales/es.json.d.ts +1 -2
- package/dist/locales/pt_br.json.d.ts +1 -2
- package/dist/{pt-br-dd7ba97f.mjs → pt-br-01d866ab.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +162 -172
- package/dist/unnnic.umd.js +51 -53
- package/dist/utils/call.d.ts +1 -2
- package/dist/utils/call.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/assets/scss/scheme-colors.scss +238 -115
- package/src/components/Alert/Alert.vue +135 -26
- package/src/components/Alert/AlertBanner.vue +182 -0
- package/src/components/Alert/AlertCaller.vue +49 -0
- package/src/components/Alert/Version1dot1.vue +36 -0
- package/src/components/Alert/__tests__/AlertBanner.spec.js +89 -0
- package/src/components/Alert/__tests__/AlertCaller.spec.js +98 -0
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +7 -11
- package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +2 -2
- package/src/components/Button/Button.vue +108 -60
- package/src/components/Button/types.ts +1 -0
- package/src/components/Checkbox/Checkbox.vue +65 -88
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +21 -6
- package/src/components/FormElement/FormElement.vue +91 -51
- package/src/components/Input/BaseInput.vue +14 -31
- package/src/components/Input/Input.scss +21 -19
- package/src/components/Input/Input.vue +30 -94
- package/src/components/Input/TextInput.vue +58 -82
- package/src/components/Input/__test__/TextInput.spec.js +5 -5
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +3 -16
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -7
- package/src/components/Label/Label.vue +21 -52
- package/src/components/Label/__tests__/Label.spec.js +1 -1
- package/src/components/Label/__tests__/__snapshots__/Label.spec.js.snap +1 -1
- package/src/components/Radio/Radio.vue +67 -80
- package/src/components/Radio/__test__/Radio.spec.js +20 -14
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +3 -3
- package/src/components/Switch/Switch.vue +99 -91
- package/src/components/Switch/__tests__/Switch.spec.js +74 -8
- package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +5 -3
- package/src/components/Tab/Tab.vue +23 -37
- package/src/components/Tab/__test__/__snapshots__/Tab.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 +2 -2
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +1 -1
- package/src/components/TextArea/TextArea.vue +9 -13
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +2 -7
- package/src/components/index.ts +8 -30
- package/src/locales/en.json +1 -2
- package/src/locales/es.json +1 -2
- package/src/locales/pt_br.json +1 -2
- package/src/stories/Alert.stories.js +67 -6
- package/src/stories/Button.stories.js +17 -2
- package/src/stories/Checkbox.stories.js +10 -9
- package/src/stories/Input.stories.js +3 -16
- package/src/stories/Label.stories.js +0 -7
- package/src/stories/Switch.stories.js +5 -4
- package/src/stories/Tab.stories.js +4 -11
- package/src/types/scheme-colors.d.ts +0 -1
- package/src/utils/call.js +18 -46
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +0 -28
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +0 -1
- package/dist/components/Toast/Toast.vue.d.ts +0 -16
- package/dist/components/Toast/Toast.vue.d.ts.map +0 -1
- package/dist/components/Toast/ToastManager.d.ts +0 -14
- package/dist/components/Toast/ToastManager.d.ts.map +0 -1
- package/dist/components/Toast/types.d.ts +0 -35
- package/dist/components/Toast/types.d.ts.map +0 -1
- package/dist/components/ui/popover/Popover.vue.d.ts +0 -23
- package/dist/components/ui/popover/Popover.vue.d.ts.map +0 -1
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +0 -43
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +0 -1
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +0 -19
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/popover/index.d.ts +0 -5
- package/dist/components/ui/popover/index.d.ts.map +0 -1
- package/src/assets/icons/checkbox-checked-disabled.svg +0 -3
- package/src/assets/icons/checkbox-checked.svg +0 -3
- package/src/assets/icons/radio-checked.svg +0 -3
- package/src/assets/icons/switch-checked-disabled.svg +0 -3
- package/src/assets/icons/switch-checked.svg +0 -3
- package/src/components/CheckboxGroup/CheckboxGroup.vue +0 -96
- package/src/components/Popover/__tests__/Popover.spec.js +0 -147
- package/src/components/Popover/__tests__/__snapshots__/Popover.spec.js.snap +0 -8
- package/src/components/Popover/index.vue +0 -146
- package/src/components/RadioGroup/RadioGroup.vue +0 -110
- package/src/components/Select/SelectOption.vue +0 -65
- package/src/components/Select/__tests__/Select.spec.js +0 -412
- package/src/components/Select/__tests__/SelectItem.spec.js +0 -330
- package/src/components/Select/__tests__/SelectOption.spec.js +0 -174
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +0 -97
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +0 -15
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +0 -25
- package/src/components/Select/index.vue +0 -245
- package/src/components/Toast/Toast.vue +0 -236
- package/src/components/Toast/ToastManager.ts +0 -110
- package/src/components/Toast/types.ts +0 -57
- package/src/components/ui/popover/Popover.vue +0 -15
- package/src/components/ui/popover/PopoverContent.vue +0 -98
- package/src/components/ui/popover/PopoverTrigger.vue +0 -12
- package/src/components/ui/popover/index.ts +0 -4
- package/src/stories/CheckboxGroup.stories.js +0 -104
- package/src/stories/Popover.stories.js +0 -306
- package/src/stories/RadioGroup.stories.js +0 -139
- package/src/stories/Select.stories.js +0 -158
- package/src/stories/Toast.mdx +0 -123
- package/src/stories/Toast.stories.js +0 -126
|
@@ -1,43 +1,49 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="unnnic-switch
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/>
|
|
12
|
-
|
|
13
|
-
<p
|
|
14
|
-
v-if="label || textLeft || textRight"
|
|
15
|
-
:class="[
|
|
16
|
-
'unnnic-switch__label',
|
|
17
|
-
{ 'unnnic-switch__label--disabled': disabled },
|
|
18
|
-
]"
|
|
19
|
-
data-testid="switch-label"
|
|
20
|
-
>
|
|
21
|
-
{{ label }}
|
|
22
|
-
{{ textLeft }}
|
|
23
|
-
{{ textRight }}
|
|
24
|
-
</p>
|
|
25
|
-
</label>
|
|
26
|
-
|
|
27
|
-
<p
|
|
28
|
-
v-if="helper"
|
|
29
|
-
class="unnnic-switch__helper"
|
|
2
|
+
<div class="unnnic-switch">
|
|
3
|
+
<div
|
|
4
|
+
v-if="textLeft"
|
|
5
|
+
data-test-id="switch-text-left"
|
|
6
|
+
:class="[
|
|
7
|
+
'unnnic-switch__label',
|
|
8
|
+
'unnnic-switch__label__left',
|
|
9
|
+
`unnnic-switch__label__${size}`,
|
|
10
|
+
]"
|
|
30
11
|
>
|
|
31
|
-
{{
|
|
32
|
-
</
|
|
12
|
+
{{ textLeft }}
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<UnnnicIcon
|
|
16
|
+
:class="{ 'unnnic-switch__icon': true, active: isActive }"
|
|
17
|
+
:icon="currentIcon"
|
|
18
|
+
:size="iconSize"
|
|
19
|
+
:scheme="iconScheme"
|
|
20
|
+
:lineHeight="iconLineHeight"
|
|
21
|
+
:disabled="disabled"
|
|
22
|
+
:clickable="!disabled"
|
|
23
|
+
data-test-id="switch-icon"
|
|
24
|
+
@click="toggleState"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
v-if="textRight"
|
|
29
|
+
data-test-id="switch-text-right"
|
|
30
|
+
:class="[
|
|
31
|
+
'unnnic-switch__label',
|
|
32
|
+
'unnnic-switch__label__right',
|
|
33
|
+
`unnnic-switch__label__${size}`,
|
|
34
|
+
]"
|
|
35
|
+
>
|
|
36
|
+
{{ textRight }}
|
|
37
|
+
</div>
|
|
33
38
|
</div>
|
|
34
39
|
</template>
|
|
35
40
|
|
|
36
41
|
<script>
|
|
37
|
-
import
|
|
42
|
+
import UnnnicIcon from '../Icon.vue';
|
|
38
43
|
|
|
39
44
|
export default {
|
|
40
45
|
name: 'UnnnicSwitch',
|
|
46
|
+
components: { UnnnicIcon },
|
|
41
47
|
props: {
|
|
42
48
|
size: {
|
|
43
49
|
type: String,
|
|
@@ -46,17 +52,6 @@ export default {
|
|
|
46
52
|
return ['small', 'medium'].indexOf(value) !== -1;
|
|
47
53
|
},
|
|
48
54
|
},
|
|
49
|
-
|
|
50
|
-
label: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: '',
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
helper: {
|
|
56
|
-
type: String,
|
|
57
|
-
default: '',
|
|
58
|
-
},
|
|
59
|
-
|
|
60
55
|
textLeft: {
|
|
61
56
|
type: String,
|
|
62
57
|
default: '',
|
|
@@ -83,6 +78,33 @@ export default {
|
|
|
83
78
|
isActive: false,
|
|
84
79
|
};
|
|
85
80
|
},
|
|
81
|
+
computed: {
|
|
82
|
+
currentIcon() {
|
|
83
|
+
if (this.disabled) {
|
|
84
|
+
return this.isActive
|
|
85
|
+
? 'switch-selected-disabled'
|
|
86
|
+
: 'switch-default-disabled';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return 'switch-default';
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
iconSize() {
|
|
93
|
+
return this.size === 'small' ? 'sm' : 'md';
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
iconScheme() {
|
|
97
|
+
if (this.disabled) {
|
|
98
|
+
return 'neutral-soft';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return this.isActive === false ? 'neutral-soft' : 'brand-weni';
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
iconLineHeight() {
|
|
105
|
+
return this.size === 'small' ? 'sm' : '';
|
|
106
|
+
},
|
|
107
|
+
},
|
|
86
108
|
|
|
87
109
|
watch: {
|
|
88
110
|
modelValue: {
|
|
@@ -94,8 +116,6 @@ export default {
|
|
|
94
116
|
},
|
|
95
117
|
|
|
96
118
|
methods: {
|
|
97
|
-
pick,
|
|
98
|
-
|
|
99
119
|
toggleState() {
|
|
100
120
|
if (!this.disabled) {
|
|
101
121
|
if (this.useVModel) {
|
|
@@ -113,63 +133,51 @@ export default {
|
|
|
113
133
|
<style lang="scss" scoped>
|
|
114
134
|
@use '@/assets/scss/unnnic' as *;
|
|
115
135
|
|
|
116
|
-
|
|
117
|
-
$switch-height: 21px;
|
|
118
|
-
|
|
119
|
-
.unnnic-switch-wrapper {
|
|
136
|
+
.unnnic-switch {
|
|
120
137
|
display: flex;
|
|
121
|
-
flex-direction:
|
|
138
|
+
flex-direction: row;
|
|
122
139
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
}
|
|
140
|
+
&__label {
|
|
141
|
+
font-family: $unnnic-font-family-secondary;
|
|
142
|
+
font-weight: $unnnic-font-weight-regular;
|
|
143
|
+
color: $unnnic-color-neutral-dark;
|
|
129
144
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
width: $switch-width;
|
|
133
|
-
height: $switch-height;
|
|
134
|
-
margin: 0;
|
|
135
|
-
background-color: $unnnic-color-bg-muted;
|
|
136
|
-
border-radius: $unnnic-radius-3;
|
|
137
|
-
box-sizing: border-box;
|
|
138
|
-
outline: none;
|
|
139
|
-
|
|
140
|
-
background-image: url('@/assets/icons/switch-checked.svg');
|
|
141
|
-
background-repeat: no-repeat;
|
|
142
|
-
background-position: 2px center;
|
|
143
|
-
|
|
144
|
-
transition:
|
|
145
|
-
200ms linear background-position,
|
|
146
|
-
200ms linear background-color;
|
|
147
|
-
|
|
148
|
-
&:checked {
|
|
149
|
-
background-color: $unnnic-color-bg-active;
|
|
150
|
-
background-position: 20px center;
|
|
151
|
-
}
|
|
145
|
+
margin: $unnnic-spacing-stack-nano 0;
|
|
146
|
+
margin-right: $unnnic-inline-nano;
|
|
152
147
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
&__small {
|
|
149
|
+
font-size: $unnnic-font-size-body-md;
|
|
150
|
+
line-height: $unnnic-font-size-body-md + $unnnic-line-height-md;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&__medium {
|
|
154
|
+
font-size: $unnnic-font-size-body-gt;
|
|
155
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
|
|
156
|
+
}
|
|
156
157
|
}
|
|
157
158
|
|
|
158
|
-
&
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
color: $unnnic-color-fg-emphasized;
|
|
159
|
+
&__icon {
|
|
160
|
+
align-self: center;
|
|
161
|
+
margin: $unnnic-spacing-stack-nano $unnnic-inline-nano;
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
:deep(#default-circle) {
|
|
164
|
+
transition: 0.2s linear transform;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&.active {
|
|
168
|
+
:deep(#default-circle) {
|
|
169
|
+
transform: translateX(45%);
|
|
170
|
+
}
|
|
165
171
|
}
|
|
166
172
|
}
|
|
173
|
+
}
|
|
167
174
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
.unnnic-icon__size {
|
|
176
|
+
&--md {
|
|
177
|
+
width: 3 * $unnnic-font-size;
|
|
178
|
+
}
|
|
179
|
+
&--sm {
|
|
180
|
+
width: 2 * $unnnic-font-size;
|
|
173
181
|
}
|
|
174
182
|
}
|
|
175
183
|
</style>
|
|
@@ -12,27 +12,93 @@ describe('Switch', () => {
|
|
|
12
12
|
beforeEach(() => {
|
|
13
13
|
wrapper = createWrapper({ modelValue: false });
|
|
14
14
|
});
|
|
15
|
+
it('should render the component correctly with default props', () => {
|
|
16
|
+
expect(wrapper.exists()).toBe(true);
|
|
17
|
+
expect(wrapper.findComponent({ name: 'UnnnicIcon' }).exists()).toBe(true);
|
|
18
|
+
expect(wrapper.text()).toBe('');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should render the left text (textLeft) when provided', async () => {
|
|
22
|
+
await wrapper.setProps({ textLeft: 'Left Text' });
|
|
23
|
+
|
|
24
|
+
// This check ensures that the icon is placed before the switch text
|
|
25
|
+
const switchChildren = wrapper.findComponent(Switch).element.children;
|
|
26
|
+
expect(switchChildren[0].getAttribute('data-test-id')).toBe(
|
|
27
|
+
'switch-text-left',
|
|
28
|
+
);
|
|
29
|
+
expect(switchChildren[1].getAttribute('data-test-id')).toBe('switch-icon');
|
|
30
|
+
});
|
|
15
31
|
|
|
16
|
-
it('should render the
|
|
17
|
-
await wrapper.setProps({
|
|
32
|
+
it('should render the right text (textRight) when provided', async () => {
|
|
33
|
+
await wrapper.setProps({ textRight: 'Right Text' });
|
|
18
34
|
|
|
19
35
|
// This check ensures that the icon is placed after the switch text
|
|
20
|
-
const
|
|
21
|
-
expect(
|
|
36
|
+
const switchChildren = wrapper.findComponent(Switch).element.children;
|
|
37
|
+
expect(switchChildren[0].getAttribute('data-test-id')).toBe('switch-icon');
|
|
38
|
+
expect(switchChildren[1].getAttribute('data-test-id')).toBe(
|
|
39
|
+
'switch-text-right',
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should render the correct icon when the switch is disabled/enabled', async () => {
|
|
44
|
+
await wrapper.setProps({ disabled: true });
|
|
45
|
+
const disabledIconComponent = wrapper.findComponent({ name: 'UnnnicIcon' });
|
|
46
|
+
expect(disabledIconComponent.props('icon')).toBe('switch-default-disabled');
|
|
47
|
+
|
|
48
|
+
await wrapper.setProps({ modelValue: true });
|
|
49
|
+
const enabledIconComponent = wrapper.findComponent({ name: 'UnnnicIcon' });
|
|
50
|
+
expect(enabledIconComponent.props('icon')).toBe('switch-selected-disabled');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should render the correct icon based on the isActive state', async () => {
|
|
54
|
+
expect(wrapper.vm.isActive).toBe(false);
|
|
55
|
+
await wrapper.setProps({ modelValue: true });
|
|
56
|
+
expect(wrapper.vm.isActive).toBe(true);
|
|
57
|
+
expect(wrapper.findComponent({ name: 'UnnnicIcon' }).props('icon')).toBe(
|
|
58
|
+
'switch-default',
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should render the correct icon size based on the size prop', async () => {
|
|
63
|
+
await wrapper.setProps({ size: 'small' });
|
|
64
|
+
expect(wrapper.findComponent({ name: 'UnnnicIcon' }).props('size')).toBe(
|
|
65
|
+
'sm',
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
await wrapper.setProps({ size: 'medium' });
|
|
69
|
+
expect(wrapper.findComponent({ name: 'UnnnicIcon' }).props('size')).toBe(
|
|
70
|
+
'md',
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should change the icon color based on the state', async () => {
|
|
75
|
+
expect(wrapper.findComponent({ name: 'UnnnicIcon' }).props('scheme')).toBe(
|
|
76
|
+
'neutral-soft',
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
await wrapper.setProps({ modelValue: true });
|
|
80
|
+
expect(wrapper.findComponent({ name: 'UnnnicIcon' }).props('scheme')).toBe(
|
|
81
|
+
'brand-weni',
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
await wrapper.setProps({ disabled: true });
|
|
85
|
+
expect(wrapper.findComponent({ name: 'UnnnicIcon' }).props('scheme')).toBe(
|
|
86
|
+
'neutral-soft',
|
|
87
|
+
);
|
|
22
88
|
});
|
|
23
89
|
|
|
24
90
|
it('should toggle isActive state and emit the correct event when toggleState is called', async () => {
|
|
25
91
|
const initialIsActive = wrapper.vm.isActive;
|
|
26
|
-
const
|
|
27
|
-
await
|
|
92
|
+
const switchIcon = wrapper.findComponent('[ data-test-id="switch-icon"]');
|
|
93
|
+
await switchIcon.trigger('click');
|
|
28
94
|
expect(wrapper.emitted('update:model-value')).toBeTruthy();
|
|
29
95
|
expect(wrapper.vm.isActive).toBe(!initialIsActive);
|
|
30
96
|
});
|
|
31
97
|
|
|
32
98
|
it('should not change state when disabled is true', async () => {
|
|
33
99
|
await wrapper.setProps({ disabled: true });
|
|
34
|
-
const
|
|
35
|
-
await
|
|
100
|
+
const switchIcon = wrapper.findComponent('[ data-test-id="switch-icon"]');
|
|
101
|
+
await switchIcon.trigger('click');
|
|
36
102
|
expect(wrapper.emitted('update:model-value')).toBeFalsy();
|
|
37
103
|
expect(wrapper.vm.isActive).toBe(false);
|
|
38
104
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Switch > should match the snapshot 1`] = `
|
|
4
|
-
"<div data-v-e4356c9d="" class="unnnic-switch
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
"<div data-v-e4356c9d="" class="unnnic-switch">
|
|
5
|
+
<!--v-if--><svg data-v-3d58a7dd="" data-v-26446d8e="" data-v-e4356c9d="" id="default" width="80" height="40" viewBox="0 0 80 40" xmlns="http://www.w3.org/2000/svg" class="unnnic-icon unnnic-icon__size--md unnnic--clickable unnnic-icon-scheme--neutral-soft unnnic-switch__icon" data-testid="old-map-icons" disabled="false" data-test-id="switch-icon">
|
|
6
|
+
<rect data-v-3d58a7dd="" x="4.20013" y="2.10046" width="71.6" height="35.8" rx="17.9" class="primary"></rect>
|
|
7
|
+
<circle data-v-3d58a7dd="" id="default-circle" cx="22.5" cy="20.0005" r="12.5" fill="white"></circle>
|
|
8
|
+
</svg>
|
|
7
9
|
<!--v-if-->
|
|
8
10
|
</div>"
|
|
9
11
|
`;
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
class="tab-head"
|
|
10
10
|
:class="{
|
|
11
11
|
'tab-head--active': localValue === tab,
|
|
12
|
-
'tab-head--disabled': disabledTabs?.includes(tab),
|
|
13
12
|
}"
|
|
14
13
|
@click="change(tab)"
|
|
15
14
|
>
|
|
@@ -21,9 +20,10 @@
|
|
|
21
20
|
side="bottom"
|
|
22
21
|
>
|
|
23
22
|
<UnnnicIcon
|
|
24
|
-
icon="
|
|
23
|
+
icon="info"
|
|
25
24
|
:size="size === 'sm' ? 'xs' : 'sm'"
|
|
26
|
-
|
|
25
|
+
filled
|
|
26
|
+
scheme="neutral-cleanest"
|
|
27
27
|
/>
|
|
28
28
|
</UnnnicToolTip>
|
|
29
29
|
</li>
|
|
@@ -65,13 +65,6 @@ export default {
|
|
|
65
65
|
tabs: {
|
|
66
66
|
type: Array,
|
|
67
67
|
default: null,
|
|
68
|
-
validator: (tabs) => {
|
|
69
|
-
return tabs.every((tab) => typeof tab === 'string') && tabs.length <= 5;
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
disabledTabs: {
|
|
73
|
-
type: Array,
|
|
74
|
-
default: null,
|
|
75
68
|
},
|
|
76
69
|
},
|
|
77
70
|
emits: ['change'],
|
|
@@ -112,10 +105,6 @@ export default {
|
|
|
112
105
|
return '';
|
|
113
106
|
},
|
|
114
107
|
change(value) {
|
|
115
|
-
if (this.disabledTabs?.includes(value)) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
108
|
this.localValue = value;
|
|
120
109
|
this.$emit('change', this.localValue);
|
|
121
110
|
},
|
|
@@ -130,15 +119,18 @@ export default {
|
|
|
130
119
|
display: flex;
|
|
131
120
|
align-items: flex-start;
|
|
132
121
|
justify-content: space-between;
|
|
133
|
-
color: $unnnic-color-
|
|
134
|
-
font: $unnnic-font-
|
|
135
|
-
|
|
136
|
-
|
|
122
|
+
color: $unnnic-color-neutral-cloudy;
|
|
123
|
+
font-family: $unnnic-font-family-secondary;
|
|
124
|
+
font-weight: $unnnic-font-weight-bold;
|
|
125
|
+
font-size: $unnnic-font-size-body-lg;
|
|
126
|
+
line-height: ($unnnic-font-size-body-lg + $unnnic-line-height-medium);
|
|
127
|
+
margin-bottom: $unnnic-inset-sm;
|
|
128
|
+
border-bottom: $unnnic-border-width-thinner solid $unnnic-color-neutral-soft;
|
|
137
129
|
}
|
|
138
130
|
|
|
139
131
|
.tab-content {
|
|
140
132
|
display: flex;
|
|
141
|
-
gap: $unnnic-
|
|
133
|
+
gap: $unnnic-spacing-sm;
|
|
142
134
|
|
|
143
135
|
margin: 0;
|
|
144
136
|
padding: 0;
|
|
@@ -147,24 +139,27 @@ export default {
|
|
|
147
139
|
|
|
148
140
|
.tab-head {
|
|
149
141
|
display: flex;
|
|
150
|
-
gap: $unnnic-
|
|
142
|
+
gap: $unnnic-spacing-xs;
|
|
151
143
|
align-items: center;
|
|
152
144
|
|
|
153
145
|
cursor: pointer;
|
|
154
|
-
|
|
146
|
+
margin: $unnnic-spacing-xs $unnnic-spacing-sm;
|
|
155
147
|
|
|
156
148
|
.unnnic-tooltip {
|
|
157
149
|
display: flex;
|
|
158
150
|
}
|
|
159
151
|
|
|
160
152
|
&:hover {
|
|
161
|
-
color: $unnnic-color-
|
|
153
|
+
color: $unnnic-color-neutral-black;
|
|
162
154
|
}
|
|
163
155
|
}
|
|
164
156
|
|
|
165
157
|
.tab-head--active {
|
|
166
|
-
|
|
167
|
-
font: $unnnic-font-
|
|
158
|
+
font-family: $unnnic-font-family-secondary;
|
|
159
|
+
font-weight: $unnnic-font-weight-bold;
|
|
160
|
+
color: $unnnic-color-neutral-black;
|
|
161
|
+
font-size: $unnnic-font-size-body-lg;
|
|
162
|
+
line-height: ($unnnic-font-size-body-lg + $unnnic-line-height-medium);
|
|
168
163
|
transition: 0.4s;
|
|
169
164
|
|
|
170
165
|
position: relative;
|
|
@@ -173,23 +168,14 @@ export default {
|
|
|
173
168
|
content: '';
|
|
174
169
|
|
|
175
170
|
position: absolute;
|
|
176
|
-
bottom:
|
|
177
|
-
left:
|
|
171
|
+
bottom: -$unnnic-spacing-xs;
|
|
172
|
+
left: -$unnnic-spacing-sm;
|
|
178
173
|
|
|
179
174
|
display: block;
|
|
180
175
|
|
|
181
|
-
width: 100
|
|
176
|
+
width: calc(100% + (#{$unnnic-spacing-sm} * 2));
|
|
182
177
|
|
|
183
|
-
border-bottom: $unnnic-border-width-thin solid $unnnic-color-
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.tab-head--disabled {
|
|
188
|
-
color: $unnnic-color-fg-muted;
|
|
189
|
-
cursor: default;
|
|
190
|
-
|
|
191
|
-
&:hover {
|
|
192
|
-
color: $unnnic-color-fg-muted;
|
|
178
|
+
border-bottom: $unnnic-border-width-thin solid $unnnic-color-weni-600;
|
|
193
179
|
}
|
|
194
180
|
}
|
|
195
181
|
|
|
@@ -4,7 +4,7 @@ exports[`Tab.vue > matches the snapshot 1`] = `
|
|
|
4
4
|
"<div data-v-b4e39fac="" class="tab size-md">
|
|
5
5
|
<header data-v-b4e39fac="" class="tab-header">
|
|
6
6
|
<ul data-v-b4e39fac="" class="tab-content">
|
|
7
|
-
<li data-v-b4e39fac="" class="tab-head">tab1<div data-v-bf0cf546="" data-v-b4e39fac="" class="unnnic-tooltip"><span data-v-26446d8e="" data-v-b4e39fac="" class="material-symbols-rounded unnnic-icon-scheme--
|
|
7
|
+
<li data-v-b4e39fac="" class="tab-head">tab1<div data-v-bf0cf546="" data-v-b4e39fac="" class="unnnic-tooltip"><span data-v-26446d8e="" data-v-b4e39fac="" class="material-symbols-rounded unnnic-icon-scheme--neutral-cleanest unnnic-icon-size--sm material-symbols-rounded--filled" data-testid="material-icon" translate="no">info</span><span data-v-bf0cf546="" class="unnnic-tooltip-label unnnic-tooltip-label-bottom" data-testid="tooltip-label" style="left: 0px; top: 8px;">Tooltip text <br data-v-bf0cf546=""><!--v-if--></span></div>
|
|
8
8
|
</li>
|
|
9
9
|
<li data-v-b4e39fac="" class="tab-head tab-head--active">tab2
|
|
10
10
|
<!--v-if-->
|
|
@@ -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--sm 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--sm 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--sm 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--sm 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-->
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
}`"
|
|
14
14
|
>
|
|
15
15
|
<img
|
|
16
|
+
class="unnnic-template-preview__header__media__preview"
|
|
16
17
|
v-if="
|
|
17
18
|
template?.header.type === 'MEDIA' &&
|
|
18
19
|
template?.header.mediaType === 'IMAGE'
|
|
19
20
|
"
|
|
20
|
-
class="unnnic-template-preview__header__media__preview"
|
|
21
21
|
:src="template.header.src || imagePreview"
|
|
22
22
|
/>
|
|
23
23
|
<template
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
/>
|
|
51
51
|
</template>
|
|
52
52
|
<h1
|
|
53
|
-
v-else-if="template?.header.type === 'TEXT'"
|
|
54
53
|
class="unnnic-template-preview__header__text__preview"
|
|
54
|
+
v-else-if="template?.header.type === 'TEXT'"
|
|
55
55
|
>
|
|
56
56
|
{{ template.header.text }}
|
|
57
57
|
</h1>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<UnnnicModalDialog
|
|
3
3
|
:modelValue="modelValue"
|
|
4
|
+
@update:modelValue="$event === false && $emit('close')"
|
|
4
5
|
:title="defaultTranslations.title[props.locale]"
|
|
5
6
|
:showCloseIcon="true"
|
|
6
7
|
class="unnnic-template-preview-modal"
|
|
7
|
-
@update:model-value="$event === false && $emit('close')"
|
|
8
8
|
>
|
|
9
9
|
<UnnnicTemplatePreview :template="template" />
|
|
10
10
|
</UnnnicModalDialog>
|
|
@@ -18,14 +18,13 @@
|
|
|
18
18
|
:disabled="disabled"
|
|
19
19
|
:value="modelValue"
|
|
20
20
|
@input="$emit('update:modelValue', fullySanitize($event.target.value))"
|
|
21
|
-
|
|
21
|
+
></textarea>
|
|
22
22
|
|
|
23
23
|
<template
|
|
24
24
|
v-if="maxLength"
|
|
25
25
|
#rightMessage
|
|
26
|
+
>{{ modelValue.length }}/{{ maxLength }}</template
|
|
26
27
|
>
|
|
27
|
-
{{ modelValue.length }}/{{ maxLength }}
|
|
28
|
-
</template>
|
|
29
28
|
</UnnnicFormElement>
|
|
30
29
|
</template>
|
|
31
30
|
|
|
@@ -97,12 +96,6 @@ export default {
|
|
|
97
96
|
@use '@/assets/scss/unnnic' as *;
|
|
98
97
|
@use '@/components/Input/Input' as *;
|
|
99
98
|
|
|
100
|
-
* {
|
|
101
|
-
margin: 0;
|
|
102
|
-
padding: 0;
|
|
103
|
-
box-sizing: border-box;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
99
|
.unnnic-text-area {
|
|
107
100
|
&__textarea {
|
|
108
101
|
@include input-base;
|
|
@@ -110,21 +103,24 @@ export default {
|
|
|
110
103
|
display: block;
|
|
111
104
|
width: 100%;
|
|
112
105
|
resize: vertical;
|
|
106
|
+
box-sizing: border-box;
|
|
113
107
|
|
|
114
108
|
scrollbar-width: thin;
|
|
115
109
|
|
|
116
|
-
padding: $unnnic-space-3 $unnnic-space-4;
|
|
117
|
-
|
|
118
110
|
&--size-md {
|
|
119
111
|
@include input-md-font;
|
|
120
112
|
|
|
121
|
-
min-height:
|
|
113
|
+
min-height: 6.25 * $unnnic-font-size;
|
|
114
|
+
padding: ($unnnic-spacing-ant - $unnnic-border-width-thinner)
|
|
115
|
+
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
122
116
|
}
|
|
123
117
|
|
|
124
118
|
&--size-sm {
|
|
125
119
|
@include input-sm-font;
|
|
126
120
|
|
|
127
|
-
min-height: $unnnic-
|
|
121
|
+
min-height: 5 * $unnnic-font-size;
|
|
122
|
+
padding: ($unnnic-spacing-xs)
|
|
123
|
+
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
128
124
|
}
|
|
129
125
|
|
|
130
126
|
&.unnnic-text-area__textarea--type-error {
|
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
exports[`TextArea.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<section data-v-9f8d6c86="" data-v-735b3c51="" class="unnnic-form-element">
|
|
5
5
|
<p data-v-9f8d6c86="" class="unnnic-form-element__label">Description</p><textarea data-v-735b3c51="" class="unnnic-text-area__textarea unnnic-text-area__textarea--size-md unnnic-text-area__textarea--type-normal" placeholder="Enter text" maxlength="200" value=""></textarea>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<!--v-if-->
|
|
9
|
-
<!--v-if-->
|
|
10
|
-
</section>
|
|
11
|
-
<p data-v-9f8d6c86="">0/200</p>
|
|
12
|
-
</section>
|
|
6
|
+
<!--v-if-->
|
|
7
|
+
<p data-v-9f8d6c86="" class="unnnic-form-element__message"> <span data-v-9f8d6c86="" class="unnnic-form-element__right-message">0/200</span></p>
|
|
13
8
|
</section>"
|
|
14
9
|
`;
|