@weni/unnnic-system 3.2.9-alpha.7 → 3.2.9
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 +2 -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 +8 -8
- 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 +15 -15
- 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 +3 -3
- 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 +27 -149
- package/dist/components/DatePicker/DatePicker.vue.d.ts +8 -8
- 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 -28
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +27 -149
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +13 -67
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +37 -159
- 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/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +35 -157
- 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 +7 -7
- 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 +2 -2
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +27 -81
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +8 -8
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +4 -4
- package/dist/components/SelectTime/index.vue.d.ts +13 -67
- 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 +2 -2
- 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 +1079 -1889
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-1bd57600.js → es-1ca6f2cf.mjs} +1 -1
- package/dist/{index-4cd729ce.js → index-ca7d12b1.mjs} +8247 -8577
- 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-59f06c05.js → pt-br-2d5000b1.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +182 -0
- package/dist/{unnnic.umd.cjs → unnnic.umd.js} +41 -42
- package/dist/utils/call.d.ts +1 -2
- package/dist/utils/call.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/assets/scss/scheme-colors.scss +4 -131
- package/src/assets/tokens/colors.json +2 -2
- 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/Button/Button.vue +108 -60
- package/src/components/Button/types.ts +1 -0
- package/src/components/FormElement/FormElement.vue +91 -51
- package/src/components/Input/BaseInput.vue +14 -22
- package/src/components/Input/Input.scss +21 -19
- package/src/components/Input/Input.vue +29 -85
- package/src/components/Input/TextInput.vue +42 -39
- package/src/components/Input/__test__/TextInput.spec.js +5 -5
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +3 -12
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
- 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/ModalDialog/ModalDialog.vue +0 -1
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
- 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/TextArea/TextArea.vue +9 -13
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +2 -7
- package/src/components/index.ts +4 -18
- 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/Input.stories.js +3 -16
- package/src/stories/Label.stories.js +0 -7
- package/src/stories/Tab.stories.js +4 -11
- package/src/types/scheme-colors.d.ts +14 -120
- package/src/utils/call.js +18 -46
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +0 -9
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +0 -1
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +0 -15
- package/dist/components/TemplatePreview/TemplatePreviewModal.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/unnnic.js +0 -188
- 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/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/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 -93
- 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 -243
- package/src/components/TemplatePreview/TemplatePreview.vue +0 -252
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +0 -51
- package/src/components/TemplatePreview/types.d.ts +0 -16
- 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/stories/Popover.stories.js +0 -39
- package/src/stories/Select.stories.js +0 -91
- package/src/stories/TemplatePreview.stories.js +0 -94
- package/src/stories/TemplatePreviewModal.stories.js +0 -110
- package/src/stories/Toast.mdx +0 -123
- package/src/stories/Toast.stories.js +0 -126
|
@@ -17,31 +17,52 @@
|
|
|
17
17
|
|
|
18
18
|
<slot></slot>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
<p
|
|
21
|
+
v-if="shouldShowErrorSection"
|
|
22
|
+
class="unnnic-form-element__error"
|
|
23
|
+
>
|
|
24
|
+
<template v-if="error !== true">
|
|
25
|
+
<UnnnicIcon
|
|
26
|
+
size="sm"
|
|
27
|
+
icon="warning"
|
|
28
|
+
scheme="aux-red-500"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
{{ fullySanitize(error) }}
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<span
|
|
35
|
+
v-if="!!$slots.rightMessage"
|
|
36
|
+
class="unnnic-form-element__right-message"
|
|
37
|
+
>
|
|
38
|
+
<slot name="rightMessage"></slot>
|
|
39
|
+
</span>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p
|
|
43
|
+
v-if="message || !!$slots.rightMessage"
|
|
44
|
+
class="unnnic-form-element__message"
|
|
45
|
+
>
|
|
46
|
+
{{ fullySanitize(message) }}
|
|
47
|
+
|
|
48
|
+
<span
|
|
49
|
+
v-if="!shouldShowErrorSection && !!$slots.rightMessage"
|
|
50
|
+
class="unnnic-form-element__right-message"
|
|
51
|
+
>
|
|
36
52
|
<slot name="rightMessage"></slot>
|
|
37
|
-
</
|
|
38
|
-
</
|
|
53
|
+
</span>
|
|
54
|
+
</p>
|
|
39
55
|
</section>
|
|
40
56
|
</template>
|
|
41
57
|
|
|
42
58
|
<script>
|
|
59
|
+
import UnnnicIcon from '../../components/Icon.vue';
|
|
43
60
|
import { fullySanitize } from '../../utils/sanitize';
|
|
44
61
|
export default {
|
|
62
|
+
components: {
|
|
63
|
+
UnnnicIcon,
|
|
64
|
+
},
|
|
65
|
+
|
|
45
66
|
props: {
|
|
46
67
|
size: {
|
|
47
68
|
type: String,
|
|
@@ -49,18 +70,28 @@ export default {
|
|
|
49
70
|
validator: (size) => ['md', 'sm'].includes(size),
|
|
50
71
|
},
|
|
51
72
|
|
|
52
|
-
label:
|
|
73
|
+
label: String,
|
|
53
74
|
|
|
54
|
-
fixedLabel:
|
|
75
|
+
fixedLabel: Boolean,
|
|
55
76
|
|
|
56
77
|
error: {
|
|
57
78
|
type: [Boolean, String],
|
|
58
79
|
default: false,
|
|
59
80
|
},
|
|
60
81
|
|
|
61
|
-
message:
|
|
82
|
+
message: String,
|
|
83
|
+
|
|
84
|
+
disabled: Boolean,
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
data() {
|
|
88
|
+
return {};
|
|
89
|
+
},
|
|
62
90
|
|
|
63
|
-
|
|
91
|
+
computed: {
|
|
92
|
+
shouldShowErrorSection() {
|
|
93
|
+
return this.error && (this.error !== true || !!this.$slots.rightMessage);
|
|
94
|
+
},
|
|
64
95
|
},
|
|
65
96
|
methods: {
|
|
66
97
|
fullySanitize,
|
|
@@ -71,66 +102,75 @@ export default {
|
|
|
71
102
|
<style lang="scss" scoped>
|
|
72
103
|
@use '@/assets/scss/unnnic' as *;
|
|
73
104
|
|
|
74
|
-
* {
|
|
75
|
-
margin: $unnnic-space-0;
|
|
76
|
-
padding: $unnnic-space-0;
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
105
|
.unnnic-form-element {
|
|
81
106
|
&__label {
|
|
82
|
-
|
|
107
|
+
margin: 0;
|
|
108
|
+
margin-bottom: $unnnic-spacing-nano;
|
|
109
|
+
|
|
83
110
|
color: $unnnic-color-neutral-cloudy;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
111
|
+
font-family: $unnnic-font-family-secondary;
|
|
112
|
+
font-weight: $unnnic-font-weight-regular;
|
|
113
|
+
font-size: $unnnic-font-size-body-gt;
|
|
114
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
|
|
115
|
+
|
|
116
|
+
$label-bottom-spacing: 3px;
|
|
88
117
|
|
|
89
118
|
&--fixed {
|
|
90
|
-
margin-top: -$unnnic-font-size-body-gt - $unnnic-
|
|
119
|
+
margin-top: -$unnnic-font-size-body-gt - $unnnic-line-height-md +
|
|
120
|
+
$label-bottom-spacing;
|
|
91
121
|
}
|
|
92
122
|
|
|
93
123
|
&--fixed {
|
|
94
|
-
margin-bottom:
|
|
124
|
+
margin-bottom: 0;
|
|
95
125
|
position: absolute;
|
|
96
|
-
padding:
|
|
97
|
-
margin-left: $unnnic-
|
|
126
|
+
padding: 0 $unnnic-spacing-nano;
|
|
127
|
+
margin-left: $unnnic-spacing-xs;
|
|
98
128
|
|
|
99
129
|
&:after {
|
|
100
130
|
content: ' ';
|
|
101
131
|
position: absolute;
|
|
102
|
-
left:
|
|
103
|
-
bottom: $
|
|
132
|
+
left: 0;
|
|
133
|
+
bottom: $label-bottom-spacing - $unnnic-border-width-thinner;
|
|
104
134
|
width: 100%;
|
|
105
135
|
height: $unnnic-border-width-thinner;
|
|
106
|
-
background-color: $unnnic-color-white;
|
|
136
|
+
background-color: $unnnic-color-neutral-white;
|
|
107
137
|
}
|
|
108
138
|
}
|
|
109
139
|
}
|
|
110
140
|
|
|
141
|
+
&__error,
|
|
111
142
|
&__message {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
143
|
+
margin: 0;
|
|
144
|
+
margin-top: $unnnic-spacing-stack-nano;
|
|
145
|
+
|
|
146
|
+
color: $unnnic-color-neutral-cloudy;
|
|
147
|
+
font-family: $unnnic-font-family-secondary;
|
|
148
|
+
font-weight: $unnnic-font-weight-regular;
|
|
149
|
+
font-size: $unnnic-font-size-body-md;
|
|
150
|
+
line-height: $unnnic-font-size-body-md + $unnnic-line-height-md;
|
|
115
151
|
}
|
|
116
152
|
|
|
117
|
-
&
|
|
153
|
+
&__message {
|
|
118
154
|
display: flex;
|
|
119
|
-
|
|
120
|
-
margin-top: $unnnic-space-1;
|
|
121
|
-
font: $unnnic-font-caption-2;
|
|
122
|
-
color: $unnnic-color-fg-base;
|
|
155
|
+
column-gap: $unnnic-spacing-nano;
|
|
123
156
|
}
|
|
124
157
|
|
|
125
|
-
&
|
|
158
|
+
&__right-message {
|
|
159
|
+
margin-left: auto;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&__error {
|
|
126
163
|
display: flex;
|
|
127
|
-
|
|
128
|
-
|
|
164
|
+
column-gap: $unnnic-spacing-nano;
|
|
165
|
+
align-items: center;
|
|
166
|
+
|
|
167
|
+
color: $unnnic-color-aux-red-500;
|
|
129
168
|
}
|
|
130
169
|
|
|
131
170
|
&--disabled .unnnic-form-element__label,
|
|
132
171
|
&--disabled .unnnic-form-element__message {
|
|
133
172
|
user-select: none;
|
|
173
|
+
color: $unnnic-color-neutral-cleanest;
|
|
134
174
|
}
|
|
135
175
|
}
|
|
136
176
|
</style>
|
|
@@ -4,18 +4,16 @@
|
|
|
4
4
|
v-mask="mask"
|
|
5
5
|
v-bind="attributes"
|
|
6
6
|
:value="fullySanitize(modelValue)"
|
|
7
|
-
:class="
|
|
7
|
+
:class="classes"
|
|
8
8
|
:type="nativeType"
|
|
9
|
-
:readonly="readonly"
|
|
10
9
|
/>
|
|
10
|
+
|
|
11
11
|
<input
|
|
12
12
|
v-else
|
|
13
13
|
v-bind="attributes"
|
|
14
14
|
:value="fullySanitize(modelValue)"
|
|
15
|
-
:class="
|
|
15
|
+
:class="classes"
|
|
16
16
|
:type="nativeType"
|
|
17
|
-
:maxlength="maxlength"
|
|
18
|
-
:readonly="readonly"
|
|
19
17
|
/>
|
|
20
18
|
</template>
|
|
21
19
|
|
|
@@ -51,18 +49,6 @@ export default {
|
|
|
51
49
|
},
|
|
52
50
|
hasIconLeft: Boolean,
|
|
53
51
|
hasIconRight: Boolean,
|
|
54
|
-
maxlength: {
|
|
55
|
-
type: Number,
|
|
56
|
-
default: null,
|
|
57
|
-
},
|
|
58
|
-
readonly: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false,
|
|
61
|
-
},
|
|
62
|
-
forceActiveStatus: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: false,
|
|
65
|
-
},
|
|
66
52
|
},
|
|
67
53
|
emits: ['update:modelValue'],
|
|
68
54
|
data() {
|
|
@@ -110,21 +96,27 @@ export default {
|
|
|
110
96
|
&.size {
|
|
111
97
|
&-md {
|
|
112
98
|
@include input-md-font;
|
|
113
|
-
|
|
99
|
+
|
|
100
|
+
padding: ($unnnic-spacing-ant - $unnnic-border-width-thinner)
|
|
101
|
+
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
114
102
|
}
|
|
115
103
|
|
|
116
104
|
&-sm {
|
|
117
105
|
@include input-sm-font;
|
|
118
|
-
|
|
106
|
+
|
|
107
|
+
padding: $unnnic-spacing-xs
|
|
108
|
+
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
119
109
|
}
|
|
120
110
|
}
|
|
121
111
|
|
|
122
112
|
&.input--has-icon-left {
|
|
123
|
-
padding-left: $unnnic-
|
|
113
|
+
padding-left: $unnnic-spacing-sm + $unnnic-icon-size-sm +
|
|
114
|
+
$unnnic-spacing-xs - $unnnic-border-width-thinner;
|
|
124
115
|
}
|
|
125
116
|
|
|
126
117
|
&.input--has-icon-right {
|
|
127
|
-
padding-right: $unnnic-
|
|
118
|
+
padding-right: $unnnic-spacing-sm + $unnnic-icon-size-sm +
|
|
119
|
+
$unnnic-spacing-xs - $unnnic-border-width-thinner;
|
|
128
120
|
}
|
|
129
121
|
|
|
130
122
|
&.error {
|
|
@@ -134,7 +126,7 @@ export default {
|
|
|
134
126
|
&:-ms-input-placeholder,
|
|
135
127
|
&::-ms-input-placeholder {
|
|
136
128
|
/* Internet Explorer 10-11 */
|
|
137
|
-
color: $unnnic-color-
|
|
129
|
+
color: $unnnic-color-brand-sec;
|
|
138
130
|
}
|
|
139
131
|
}
|
|
140
132
|
</style>
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
@use '@/assets/scss/unnnic' as *;
|
|
2
2
|
|
|
3
3
|
@mixin input-base {
|
|
4
|
-
background: $unnnic-color-white;
|
|
5
|
-
border: $unnnic-border-width-thinner solid $unnnic-color-
|
|
4
|
+
background: $unnnic-color-neutral-white;
|
|
5
|
+
border: $unnnic-border-width-thinner solid $unnnic-color-neutral-clean;
|
|
6
6
|
outline: none;
|
|
7
|
-
border-radius: $unnnic-radius-
|
|
8
|
-
color: $unnnic-color-
|
|
9
|
-
caret-color: $unnnic-color-
|
|
10
|
-
font: $unnnic-font-
|
|
7
|
+
border-radius: $unnnic-border-radius-sm;
|
|
8
|
+
color: $unnnic-color-neutral-darkest;
|
|
9
|
+
caret-color: $unnnic-color-neutral-clean;
|
|
10
|
+
font-weight: $unnnic-font-weight-regular;
|
|
11
|
+
font-family: $unnnic-font-family-secondary;
|
|
11
12
|
|
|
12
|
-
&:focus
|
|
13
|
-
|
|
14
|
-
border-color: $unnnic-color-border-active;
|
|
13
|
+
&:focus {
|
|
14
|
+
border-color: $unnnic-color-weni-600;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&::placeholder {
|
|
18
|
-
color: $unnnic-color-
|
|
19
|
-
opacity: 1;
|
|
20
|
-
/* Firefox */
|
|
18
|
+
color: $unnnic-color-neutral-cleanest;
|
|
19
|
+
opacity: 1; /* Firefox */
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
&:disabled {
|
|
24
|
-
border-color: $unnnic-color-
|
|
25
|
-
background-color: $unnnic-color-
|
|
23
|
+
border-color: $unnnic-color-neutral-cleanest;
|
|
24
|
+
background-color: $unnnic-color-neutral-lightest;
|
|
26
25
|
cursor: not-allowed;
|
|
27
|
-
color: $unnnic-color-
|
|
26
|
+
color: $unnnic-color-neutral-cleanest;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
@mixin input-sm-font {
|
|
32
|
-
font: $unnnic-font-body;
|
|
31
|
+
font-size: $unnnic-font-size-body-md;
|
|
32
|
+
line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@mixin input-md-font {
|
|
36
|
-
font: $unnnic-font-body;
|
|
36
|
+
font-size: $unnnic-font-size-body-gt;
|
|
37
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
@mixin input-error {
|
|
40
|
-
border-color: $unnnic-color-
|
|
41
|
-
|
|
41
|
+
border-color: $unnnic-color-aux-red-500;
|
|
42
|
+
color: $unnnic-color-aux-red-500;
|
|
43
|
+
}
|
|
@@ -7,18 +7,17 @@
|
|
|
7
7
|
<slot name="label" />
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
<
|
|
10
|
+
<p
|
|
11
11
|
v-else-if="label"
|
|
12
12
|
class="unnnic-form__label"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
>
|
|
14
|
+
{{ fullySanitize(label) }}
|
|
15
|
+
</p>
|
|
16
16
|
|
|
17
17
|
<TextInput
|
|
18
18
|
v-bind="$attrs"
|
|
19
19
|
v-model="val"
|
|
20
20
|
class="unnnic-form-input"
|
|
21
|
-
:forceActiveStatus="forceActiveStatus"
|
|
22
21
|
:placeholder="placeholder"
|
|
23
22
|
:iconLeft="iconLeft"
|
|
24
23
|
:iconRight="iconRight"
|
|
@@ -29,41 +28,24 @@
|
|
|
29
28
|
:size="size"
|
|
30
29
|
:mask="mask"
|
|
31
30
|
:nativeType="nativeType"
|
|
32
|
-
:maxlength="maxlength"
|
|
33
|
-
:disabled="disabled"
|
|
34
|
-
:readonly="readonly"
|
|
35
31
|
/>
|
|
36
32
|
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{{ fullySanitize(message) }}
|
|
44
|
-
</p>
|
|
45
|
-
<p
|
|
46
|
-
v-if="!!errors.length"
|
|
47
|
-
class="unnnic-form__message error"
|
|
48
|
-
>
|
|
49
|
-
{{ Array.isArray(errors) ? errors.join(', ') : errors }}
|
|
50
|
-
</p>
|
|
51
|
-
</section>
|
|
52
|
-
<p v-if="maxlength && showMaxlengthCounter">
|
|
53
|
-
{{ (val || '').length }} / {{ maxlength }}
|
|
54
|
-
</p>
|
|
55
|
-
</section>
|
|
33
|
+
<p
|
|
34
|
+
v-if="message"
|
|
35
|
+
class="unnnic-form__message"
|
|
36
|
+
>
|
|
37
|
+
{{ fullySanitize(message) }}
|
|
38
|
+
</p>
|
|
56
39
|
</div>
|
|
57
40
|
</template>
|
|
58
41
|
|
|
59
42
|
<script>
|
|
60
43
|
import { fullySanitize } from '../../utils/sanitize';
|
|
61
44
|
import TextInput from './TextInput.vue';
|
|
62
|
-
import UnnnicLabel from '../Label/Label.vue';
|
|
63
45
|
|
|
64
46
|
export default {
|
|
65
47
|
name: 'UnnnicInput',
|
|
66
|
-
components: { TextInput
|
|
48
|
+
components: { TextInput },
|
|
67
49
|
props: {
|
|
68
50
|
placeholder: {
|
|
69
51
|
type: String,
|
|
@@ -86,23 +68,19 @@ export default {
|
|
|
86
68
|
},
|
|
87
69
|
message: {
|
|
88
70
|
type: String,
|
|
89
|
-
default:
|
|
90
|
-
},
|
|
91
|
-
errors: {
|
|
92
|
-
type: [String, Array],
|
|
93
|
-
default: '',
|
|
71
|
+
default: null,
|
|
94
72
|
},
|
|
95
73
|
label: {
|
|
96
74
|
type: String,
|
|
97
|
-
default:
|
|
75
|
+
default: null,
|
|
98
76
|
},
|
|
99
77
|
iconLeft: {
|
|
100
78
|
type: String,
|
|
101
|
-
default:
|
|
79
|
+
default: null,
|
|
102
80
|
},
|
|
103
81
|
iconRight: {
|
|
104
82
|
type: String,
|
|
105
|
-
default:
|
|
83
|
+
default: null,
|
|
106
84
|
},
|
|
107
85
|
allowTogglePassword: {
|
|
108
86
|
type: Boolean,
|
|
@@ -110,11 +88,11 @@ export default {
|
|
|
110
88
|
},
|
|
111
89
|
iconLeftClickable: {
|
|
112
90
|
type: Boolean,
|
|
113
|
-
default:
|
|
91
|
+
default: null,
|
|
114
92
|
},
|
|
115
93
|
iconRightClickable: {
|
|
116
94
|
type: Boolean,
|
|
117
|
-
default:
|
|
95
|
+
default: null,
|
|
118
96
|
},
|
|
119
97
|
hasCloudyColor: {
|
|
120
98
|
type: Boolean,
|
|
@@ -128,30 +106,6 @@ export default {
|
|
|
128
106
|
type: [String, Array],
|
|
129
107
|
default: '',
|
|
130
108
|
},
|
|
131
|
-
tooltip: {
|
|
132
|
-
type: String,
|
|
133
|
-
default: '',
|
|
134
|
-
},
|
|
135
|
-
maxlength: {
|
|
136
|
-
type: [Number, null],
|
|
137
|
-
default: null,
|
|
138
|
-
},
|
|
139
|
-
showMaxlengthCounter: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: false,
|
|
142
|
-
},
|
|
143
|
-
disabled: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: false,
|
|
146
|
-
},
|
|
147
|
-
readonly: {
|
|
148
|
-
type: Boolean,
|
|
149
|
-
default: false,
|
|
150
|
-
},
|
|
151
|
-
forceActiveStatus: {
|
|
152
|
-
type: Boolean,
|
|
153
|
-
default: false,
|
|
154
|
-
},
|
|
155
109
|
},
|
|
156
110
|
emits: ['update:modelValue'],
|
|
157
111
|
data() {
|
|
@@ -184,37 +138,27 @@ export default {
|
|
|
184
138
|
<style lang="scss" scoped>
|
|
185
139
|
@use '@/assets/scss/unnnic' as *;
|
|
186
140
|
|
|
187
|
-
* {
|
|
188
|
-
margin: 0;
|
|
189
|
-
padding: 0;
|
|
190
|
-
box-sizing: border-box;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
141
|
.unnnic-form {
|
|
142
|
+
font-family: $unnnic-font-family-secondary;
|
|
194
143
|
position: relative;
|
|
195
144
|
|
|
196
145
|
&__message {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
146
|
+
font-size: $unnnic-font-size-body-md;
|
|
147
|
+
margin: $unnnic-spacing-stack-nano 0;
|
|
148
|
+
color: $unnnic-color-feedback-red;
|
|
200
149
|
}
|
|
201
150
|
|
|
202
151
|
&__label {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
justify-content: space-between;
|
|
209
|
-
margin-top: $unnnic-space-1;
|
|
210
|
-
font: $unnnic-font-caption-2;
|
|
211
|
-
color: $unnnic-color-fg-base;
|
|
152
|
+
font-weight: $unnnic-font-weight-regular;
|
|
153
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
154
|
+
font-size: $unnnic-font-size-body-gt;
|
|
155
|
+
color: $unnnic-color-neutral-cloudy;
|
|
156
|
+
margin: $unnnic-spacing-stack-xs 0;
|
|
212
157
|
}
|
|
213
158
|
|
|
214
|
-
&
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
gap: $unnnic-space-1;
|
|
159
|
+
&.sm &__label {
|
|
160
|
+
font-size: $unnnic-font-size-body-md;
|
|
161
|
+
line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
|
|
218
162
|
}
|
|
219
163
|
}
|
|
220
164
|
</style>
|