@weni/unnnic-system 3.3.1-alpha.3 → 3.3.2
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 +9 -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 +29 -176
- 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 -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 +39 -186
- 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 +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 +28 -97
- 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 +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 +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 +1110 -2132
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-94ab560e.mjs → es-54ddaf5a.mjs} +1 -1
- package/dist/{index-5caf403e.mjs → index-a34da30f.mjs} +8094 -8447
- 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-3002df05.mjs → pt-br-ff00f945.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +120 -126
- package/dist/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 +2 -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/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/ModalDialog/ModalDialog.vue +0 -1
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.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/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 -22
- package/src/stories/Label.stories.js +0 -7
- 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/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/src/assets/icons/radio-checked.svg +0 -3
- 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/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/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/RadioGroup.stories.js +0 -139
- package/src/stories/Select.stories.js +0 -158
- 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
|
@@ -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,43 +28,24 @@
|
|
|
29
28
|
:size="size"
|
|
30
29
|
:mask="mask"
|
|
31
30
|
:nativeType="nativeType"
|
|
32
|
-
:maxlength="maxlength"
|
|
33
|
-
:disabled="disabled"
|
|
34
|
-
:readonly="readonly"
|
|
35
|
-
:showClear="showClear"
|
|
36
|
-
@clear="$emit('clear')"
|
|
37
31
|
/>
|
|
38
32
|
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{{ fullySanitize(message) }}
|
|
46
|
-
</p>
|
|
47
|
-
<p
|
|
48
|
-
v-if="!!errors.length"
|
|
49
|
-
class="unnnic-form__message error"
|
|
50
|
-
>
|
|
51
|
-
{{ Array.isArray(errors) ? errors.join(', ') : errors }}
|
|
52
|
-
</p>
|
|
53
|
-
</section>
|
|
54
|
-
<p v-if="maxlength && showMaxlengthCounter">
|
|
55
|
-
{{ (val || '').length }} / {{ maxlength }}
|
|
56
|
-
</p>
|
|
57
|
-
</section>
|
|
33
|
+
<p
|
|
34
|
+
v-if="message"
|
|
35
|
+
class="unnnic-form__message"
|
|
36
|
+
>
|
|
37
|
+
{{ fullySanitize(message) }}
|
|
38
|
+
</p>
|
|
58
39
|
</div>
|
|
59
40
|
</template>
|
|
60
41
|
|
|
61
42
|
<script>
|
|
62
43
|
import { fullySanitize } from '../../utils/sanitize';
|
|
63
44
|
import TextInput from './TextInput.vue';
|
|
64
|
-
import UnnnicLabel from '../Label/Label.vue';
|
|
65
45
|
|
|
66
46
|
export default {
|
|
67
47
|
name: 'UnnnicInput',
|
|
68
|
-
components: { TextInput
|
|
48
|
+
components: { TextInput },
|
|
69
49
|
props: {
|
|
70
50
|
placeholder: {
|
|
71
51
|
type: String,
|
|
@@ -88,23 +68,19 @@ export default {
|
|
|
88
68
|
},
|
|
89
69
|
message: {
|
|
90
70
|
type: String,
|
|
91
|
-
default:
|
|
92
|
-
},
|
|
93
|
-
errors: {
|
|
94
|
-
type: [String, Array],
|
|
95
|
-
default: '',
|
|
71
|
+
default: null,
|
|
96
72
|
},
|
|
97
73
|
label: {
|
|
98
74
|
type: String,
|
|
99
|
-
default:
|
|
75
|
+
default: null,
|
|
100
76
|
},
|
|
101
77
|
iconLeft: {
|
|
102
78
|
type: String,
|
|
103
|
-
default:
|
|
79
|
+
default: null,
|
|
104
80
|
},
|
|
105
81
|
iconRight: {
|
|
106
82
|
type: String,
|
|
107
|
-
default:
|
|
83
|
+
default: null,
|
|
108
84
|
},
|
|
109
85
|
allowTogglePassword: {
|
|
110
86
|
type: Boolean,
|
|
@@ -112,11 +88,11 @@ export default {
|
|
|
112
88
|
},
|
|
113
89
|
iconLeftClickable: {
|
|
114
90
|
type: Boolean,
|
|
115
|
-
default:
|
|
91
|
+
default: null,
|
|
116
92
|
},
|
|
117
93
|
iconRightClickable: {
|
|
118
94
|
type: Boolean,
|
|
119
|
-
default:
|
|
95
|
+
default: null,
|
|
120
96
|
},
|
|
121
97
|
hasCloudyColor: {
|
|
122
98
|
type: Boolean,
|
|
@@ -130,38 +106,8 @@ export default {
|
|
|
130
106
|
type: [String, Array],
|
|
131
107
|
default: '',
|
|
132
108
|
},
|
|
133
|
-
tooltip: {
|
|
134
|
-
type: String,
|
|
135
|
-
default: '',
|
|
136
|
-
},
|
|
137
|
-
maxlength: {
|
|
138
|
-
type: [Number, null],
|
|
139
|
-
default: null,
|
|
140
|
-
},
|
|
141
|
-
showMaxlengthCounter: {
|
|
142
|
-
type: Boolean,
|
|
143
|
-
default: false,
|
|
144
|
-
},
|
|
145
|
-
disabled: {
|
|
146
|
-
type: Boolean,
|
|
147
|
-
default: false,
|
|
148
|
-
},
|
|
149
|
-
readonly: {
|
|
150
|
-
type: Boolean,
|
|
151
|
-
default: false,
|
|
152
|
-
},
|
|
153
|
-
forceActiveStatus: {
|
|
154
|
-
type: Boolean,
|
|
155
|
-
default: false,
|
|
156
|
-
},
|
|
157
|
-
showClear: {
|
|
158
|
-
type: Boolean,
|
|
159
|
-
default: false,
|
|
160
|
-
},
|
|
161
109
|
},
|
|
162
|
-
|
|
163
|
-
emits: ['update:modelValue', 'clear'],
|
|
164
|
-
|
|
110
|
+
emits: ['update:modelValue'],
|
|
165
111
|
data() {
|
|
166
112
|
return {
|
|
167
113
|
val: this.modelValue,
|
|
@@ -192,37 +138,27 @@ export default {
|
|
|
192
138
|
<style lang="scss" scoped>
|
|
193
139
|
@use '@/assets/scss/unnnic' as *;
|
|
194
140
|
|
|
195
|
-
* {
|
|
196
|
-
margin: 0;
|
|
197
|
-
padding: 0;
|
|
198
|
-
box-sizing: border-box;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
141
|
.unnnic-form {
|
|
142
|
+
font-family: $unnnic-font-family-secondary;
|
|
202
143
|
position: relative;
|
|
203
144
|
|
|
204
145
|
&__message {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
146
|
+
font-size: $unnnic-font-size-body-md;
|
|
147
|
+
margin: $unnnic-spacing-stack-nano 0;
|
|
148
|
+
color: $unnnic-color-feedback-red;
|
|
208
149
|
}
|
|
209
150
|
|
|
210
151
|
&__label {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
justify-content: space-between;
|
|
217
|
-
margin-top: $unnnic-space-1;
|
|
218
|
-
font: $unnnic-font-caption-2;
|
|
219
|
-
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;
|
|
220
157
|
}
|
|
221
158
|
|
|
222
|
-
&
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
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;
|
|
226
162
|
}
|
|
227
163
|
}
|
|
228
164
|
</style>
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
'text-input',
|
|
5
|
+
`size--${size}`,
|
|
6
|
+
`text-input--icon-right-size-${iconRightSize}`,
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
3
9
|
<BaseInput
|
|
4
10
|
v-bind="attributes"
|
|
5
11
|
ref="base-input"
|
|
@@ -12,10 +18,6 @@
|
|
|
12
18
|
class="input-itself"
|
|
13
19
|
:hasIconLeft="!!iconLeft"
|
|
14
20
|
:hasIconRight="!!iconRight || allowTogglePassword"
|
|
15
|
-
:hasClearIcon="showClear"
|
|
16
|
-
:maxlength="maxlength"
|
|
17
|
-
:readonly="readonly"
|
|
18
|
-
:forceActiveStatus="forceActiveStatus"
|
|
19
21
|
@focus="onFocus"
|
|
20
22
|
@blur="onBlur"
|
|
21
23
|
/>
|
|
@@ -24,34 +26,24 @@
|
|
|
24
26
|
v-if="iconLeft"
|
|
25
27
|
:scheme="iconScheme"
|
|
26
28
|
:icon="iconLeft"
|
|
27
|
-
size="
|
|
29
|
+
size="sm"
|
|
28
30
|
:clickable="iconLeftClickable"
|
|
29
31
|
:class="['icon-left', { clickable: iconLeftClickable }]"
|
|
30
32
|
@click="onIconLeftClick"
|
|
31
33
|
/>
|
|
32
34
|
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
v-if="iconRightSvg"
|
|
46
|
-
:scheme="iconScheme"
|
|
47
|
-
:icon="iconRightSvg"
|
|
48
|
-
size="ant"
|
|
49
|
-
:clickable="iconRightClickable || allowTogglePassword"
|
|
50
|
-
class="icon-right"
|
|
51
|
-
:class="{ clickable: iconRightClickable || allowTogglePassword }"
|
|
52
|
-
@click="onIconRightClick"
|
|
53
|
-
/>
|
|
54
|
-
</section>
|
|
35
|
+
<UnnnicIcon
|
|
36
|
+
v-if="iconRightSvg"
|
|
37
|
+
:scheme="iconScheme"
|
|
38
|
+
:icon="iconRightSvg"
|
|
39
|
+
:size="iconRightSize"
|
|
40
|
+
:clickable="iconRightClickable || allowTogglePassword"
|
|
41
|
+
:class="[
|
|
42
|
+
'icon-right',
|
|
43
|
+
{ clickable: iconRightClickable || allowTogglePassword },
|
|
44
|
+
]"
|
|
45
|
+
@click="onIconRightClick"
|
|
46
|
+
/>
|
|
55
47
|
</div>
|
|
56
48
|
</template>
|
|
57
49
|
|
|
@@ -100,6 +92,10 @@ export default {
|
|
|
100
92
|
type: Boolean,
|
|
101
93
|
default: null,
|
|
102
94
|
},
|
|
95
|
+
iconRightSize: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'sm',
|
|
98
|
+
},
|
|
103
99
|
allowTogglePassword: {
|
|
104
100
|
type: Boolean,
|
|
105
101
|
default: null,
|
|
@@ -112,28 +108,8 @@ export default {
|
|
|
112
108
|
type: String,
|
|
113
109
|
default: 'md',
|
|
114
110
|
},
|
|
115
|
-
maxlength: {
|
|
116
|
-
type: Number,
|
|
117
|
-
default: null,
|
|
118
|
-
},
|
|
119
|
-
disabled: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
default: false,
|
|
122
|
-
},
|
|
123
|
-
readonly: {
|
|
124
|
-
type: Boolean,
|
|
125
|
-
default: false,
|
|
126
|
-
},
|
|
127
|
-
forceActiveStatus: {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
default: false,
|
|
130
|
-
},
|
|
131
|
-
showClear: {
|
|
132
|
-
type: Boolean,
|
|
133
|
-
default: false,
|
|
134
|
-
},
|
|
135
111
|
},
|
|
136
|
-
emits: ['icon-left-click', 'icon-right-click'
|
|
112
|
+
emits: ['icon-left-click', 'icon-right-click'],
|
|
137
113
|
data() {
|
|
138
114
|
return {
|
|
139
115
|
isFocused: false,
|
|
@@ -142,7 +118,7 @@ export default {
|
|
|
142
118
|
},
|
|
143
119
|
computed: {
|
|
144
120
|
isDisabled() {
|
|
145
|
-
return this.$attrs.disabled
|
|
121
|
+
return this.$attrs.disabled;
|
|
146
122
|
},
|
|
147
123
|
|
|
148
124
|
iconRightSvg() {
|
|
@@ -155,22 +131,22 @@ export default {
|
|
|
155
131
|
|
|
156
132
|
iconScheme() {
|
|
157
133
|
if (this.type === 'error') {
|
|
158
|
-
return '
|
|
134
|
+
return 'aux-red-500';
|
|
159
135
|
}
|
|
160
136
|
|
|
161
137
|
if (this.isDisabled) {
|
|
162
|
-
return '
|
|
138
|
+
return 'neutral-cleanest';
|
|
163
139
|
}
|
|
164
140
|
|
|
165
|
-
if (this.modelValue || this.isFocused
|
|
166
|
-
return '
|
|
141
|
+
if (this.modelValue || this.isFocused) {
|
|
142
|
+
return 'neutral-dark';
|
|
167
143
|
}
|
|
168
144
|
|
|
169
145
|
if (this.hasCloudyColor) {
|
|
170
|
-
return '
|
|
146
|
+
return 'neutral-cloudy';
|
|
171
147
|
}
|
|
172
148
|
|
|
173
|
-
return '
|
|
149
|
+
return 'neutral-cloudy';
|
|
174
150
|
},
|
|
175
151
|
|
|
176
152
|
attributes() {
|
|
@@ -195,10 +171,6 @@ export default {
|
|
|
195
171
|
if (this.iconLeftClickable) this.$emit('icon-left-click');
|
|
196
172
|
},
|
|
197
173
|
|
|
198
|
-
onClearClick() {
|
|
199
|
-
this.$emit('clear');
|
|
200
|
-
},
|
|
201
|
-
|
|
202
174
|
onIconRightClick() {
|
|
203
175
|
if (this.attributes.disabled) return;
|
|
204
176
|
if (this.allowTogglePassword) this.showPassword = !this.showPassword;
|
|
@@ -211,38 +183,42 @@ export default {
|
|
|
211
183
|
<style lang="scss" scoped>
|
|
212
184
|
@use '@/assets/scss/unnnic' as *;
|
|
213
185
|
|
|
214
|
-
.text-input {
|
|
215
|
-
position: relative;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
186
|
.icon {
|
|
219
|
-
&-left
|
|
220
|
-
|
|
221
|
-
top: 50%;
|
|
222
|
-
transform: translateY(-50%);
|
|
223
|
-
left: $unnnic-space-4;
|
|
224
|
-
|
|
187
|
+
&-left,
|
|
188
|
+
&-right {
|
|
225
189
|
&:not(.clickable) {
|
|
226
190
|
pointer-events: none;
|
|
227
191
|
}
|
|
228
192
|
}
|
|
229
193
|
|
|
230
|
-
&-
|
|
194
|
+
&-left {
|
|
231
195
|
position: absolute;
|
|
232
|
-
top:
|
|
233
|
-
|
|
234
|
-
|
|
196
|
+
top: $unnnic-spacing-ant + 0.1875 * $unnnic-font-size;
|
|
197
|
+
left: $unnnic-inline-sm - $unnnic-border-width-thinner;
|
|
198
|
+
}
|
|
235
199
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
200
|
+
&-right {
|
|
201
|
+
position: absolute;
|
|
202
|
+
top: $unnnic-spacing-ant + 0.1875 * $unnnic-font-size;
|
|
203
|
+
right: $unnnic-inline-sm - $unnnic-border-width-thinner;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
.text-input {
|
|
207
|
+
position: relative;
|
|
239
208
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
pointer-events: none;
|
|
209
|
+
&.size--sm {
|
|
210
|
+
.icon-left,
|
|
211
|
+
.icon-right {
|
|
212
|
+
top: $unnnic-spacing-xs + 0.125 * $unnnic-font-size;
|
|
245
213
|
}
|
|
246
214
|
}
|
|
215
|
+
|
|
216
|
+
&.size--sm.text-input--icon-right-size-ant .icon-right {
|
|
217
|
+
top: 0.5625 * $unnnic-font-size;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&.size--md.text-input--icon-right-size-ant .icon-right {
|
|
221
|
+
top: 0.8125 * $unnnic-font-size;
|
|
222
|
+
}
|
|
247
223
|
}
|
|
248
224
|
</style>
|
|
@@ -74,22 +74,22 @@ describe('TextInput.vue', () => {
|
|
|
74
74
|
|
|
75
75
|
test('computes the correct iconScheme based on various states', async () => {
|
|
76
76
|
await wrapper.setProps({ type: 'error' });
|
|
77
|
-
expect(wrapper.vm.iconScheme).toBe('
|
|
77
|
+
expect(wrapper.vm.iconScheme).toBe('aux-red-500');
|
|
78
78
|
|
|
79
79
|
await wrapper.setProps({ type: 'normal' });
|
|
80
80
|
await wrapper.setData({ isDisabled: true });
|
|
81
|
-
expect(wrapper.vm.iconScheme).toBe('
|
|
81
|
+
expect(wrapper.vm.iconScheme).toBe('neutral-cloudy');
|
|
82
82
|
|
|
83
83
|
await wrapper.setData({ isDisabled: false });
|
|
84
84
|
await wrapper.setProps({ modelValue: 'text' });
|
|
85
|
-
expect(wrapper.vm.iconScheme).toBe('
|
|
85
|
+
expect(wrapper.vm.iconScheme).toBe('neutral-dark');
|
|
86
86
|
|
|
87
87
|
await wrapper.setData({ isFocused: true });
|
|
88
|
-
expect(wrapper.vm.iconScheme).toBe('
|
|
88
|
+
expect(wrapper.vm.iconScheme).toBe('neutral-dark');
|
|
89
89
|
|
|
90
90
|
await wrapper.setProps({ hasCloudyColor: true, modelValue: '' });
|
|
91
91
|
await wrapper.setData({ isFocused: false });
|
|
92
|
-
expect(wrapper.vm.iconScheme).toBe('
|
|
92
|
+
expect(wrapper.vm.iconScheme).toBe('neutral-cloudy');
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
test('attributes computed property returns combined attributes and props', () => {
|
|
@@ -2,21 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Input.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<div data-v-d890ad85="" class="unnnic-form md">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</section>
|
|
9
|
-
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md unnnic-form-input" mask="####-####"><input data-v-86533b41="" data-v-a0d36167="" class="unnnic-form-input input-itself input size-md normal input--has-icon-left input--has-icon-right unnnic-form-input input-itself" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" hascloudycolor="false" showclear="false" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span>
|
|
10
|
-
<section data-v-a0d36167="" class="icon-right-container">
|
|
11
|
-
<!--v-if--><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
12
|
-
</section>
|
|
13
|
-
</div>
|
|
14
|
-
<section data-v-d890ad85="" class="unnnic-form__hints-container">
|
|
15
|
-
<section data-v-d890ad85="" class="unnnic-form__message-container">
|
|
16
|
-
<p data-v-d890ad85="" class="unnnic-form__message">Error message</p>
|
|
17
|
-
<!--v-if-->
|
|
18
|
-
</section>
|
|
19
|
-
<!--v-if-->
|
|
20
|
-
</section>
|
|
5
|
+
<p data-v-d890ad85="" class="unnnic-form__label">Sample Label</p>
|
|
6
|
+
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md text-input--icon-right-size-sm unnnic-form-input" mask="####-####"><input data-v-86533b41="" data-v-a0d36167="" class="unnnic-form-input input-itself input size-md normal input--has-icon-left input--has-icon-right unnnic-form-input input-itself" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" iconrightsize="sm" hascloudycolor="false" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--neutral-cloudy unnnic-icon-size--sm unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--neutral-cloudy unnnic-icon-size--sm unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span></div>
|
|
7
|
+
<p data-v-d890ad85="" class="unnnic-form__message">Error message</p>
|
|
21
8
|
</div>"
|
|
22
9
|
`;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`TextInput.vue > matches the snapshot 1`] = `
|
|
4
|
-
"<div data-v-a0d36167="" class="text-input size--md"><input data-v-86533b41="" data-v-a0d36167="" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" allowtogglepassword="false" hascloudycolor="false" showclear="false" class="input-itself input size-md normal input--has-icon-left input--has-icon-right input-itself" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span>
|
|
5
|
-
<section data-v-a0d36167="" class="icon-right-container">
|
|
6
|
-
<!--v-if--><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span>
|
|
7
|
-
</section>
|
|
8
|
-
</div>"
|
|
9
|
-
`;
|
|
3
|
+
exports[`TextInput.vue > matches the snapshot 1`] = `"<div data-v-a0d36167="" class="text-input size--md text-input--icon-right-size-sm"><input data-v-86533b41="" data-v-a0d36167="" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" iconrightsize="sm" allowtogglepassword="false" hascloudycolor="false" class="input-itself input size-md normal input--has-icon-left input--has-icon-right input-itself" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--neutral-cloudy unnnic-icon-size--sm unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span><span data-v-26446d8e="" data-v-a0d36167="" class="material-symbols-rounded unnnic-icon-scheme--neutral-cloudy unnnic-icon-size--sm unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span></div>"`;
|
|
@@ -1,65 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<p class="unnnic-label__label">{{ fullySanitize(props.label) }}</p>
|
|
4
|
-
<UnnnicToolTip
|
|
5
|
-
v-if="tooltip"
|
|
6
|
-
enabled
|
|
7
|
-
:text="tooltip"
|
|
8
|
-
:enableHtml="props.useHtmlTooltip"
|
|
9
|
-
>
|
|
10
|
-
<UnnnicIcon
|
|
11
|
-
icon="help"
|
|
12
|
-
size="sm"
|
|
13
|
-
scheme="fg-base"
|
|
14
|
-
/>
|
|
15
|
-
</UnnnicToolTip>
|
|
16
|
-
</section>
|
|
2
|
+
<p class="unnnic-label__label">{{ fullySanitize(label) }}</p>
|
|
17
3
|
</template>
|
|
18
4
|
|
|
19
|
-
<script
|
|
20
|
-
import { fullySanitize } from '
|
|
21
|
-
|
|
22
|
-
import UnnnicToolTip from '../ToolTip/ToolTip.vue';
|
|
23
|
-
import UnnnicIcon from '../Icon.vue';
|
|
24
|
-
|
|
25
|
-
defineOptions({
|
|
5
|
+
<script>
|
|
6
|
+
import { fullySanitize } from '../../utils/sanitize';
|
|
7
|
+
export default {
|
|
26
8
|
name: 'UnnnicLabel',
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
tooltip: '',
|
|
38
|
-
useHtmlTooltip: false,
|
|
39
|
-
});
|
|
9
|
+
props: {
|
|
10
|
+
label: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: null,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
fullySanitize,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
40
19
|
</script>
|
|
41
20
|
|
|
42
|
-
<style lang="scss"
|
|
21
|
+
<style lang="scss">
|
|
43
22
|
@use '@/assets/scss/unnnic' as *;
|
|
44
23
|
|
|
45
|
-
* {
|
|
46
|
-
box-sizing: border-box;
|
|
47
|
-
padding: $unnnic-space-0;
|
|
48
|
-
margin: $unnnic-space-0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
24
|
.unnnic-label {
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
gap: $unnnic-space-2;
|
|
55
|
-
color: $unnnic-color-fg-base;
|
|
56
|
-
|
|
57
25
|
&__label {
|
|
58
|
-
font: $unnnic-font-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
26
|
+
font-family: $unnnic-font-family-secondary;
|
|
27
|
+
font-weight: $unnnic-font-weight-regular;
|
|
28
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
29
|
+
font-size: $unnnic-font-size-body-gt;
|
|
30
|
+
color: $unnnic-color-neutral-cloudy;
|
|
31
|
+
margin: $unnnic-spacing-stack-xs 0;
|
|
63
32
|
}
|
|
64
33
|
}
|
|
65
34
|
</style>
|
|
@@ -24,7 +24,7 @@ describe('Label', () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
it('applies the correct classes and styles', () => {
|
|
27
|
-
const label = wrapper.
|
|
27
|
+
const label = wrapper.findComponent('.unnnic-label__label');
|
|
28
28
|
expect(label.html()).toMatchSnapshot();
|
|
29
29
|
});
|
|
30
30
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`Label > applies the correct classes and styles 1`] = `"<p
|
|
3
|
+
exports[`Label > applies the correct classes and styles 1`] = `"<p class="unnnic-label__label">Label Test</p>"`;
|
|
@@ -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-darkest" 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">
|