@weni/unnnic-system 3.4.0 → 3.4.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
- package/dist/components/Alert/Alert.vue.d.ts +18 -119
- package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
- package/dist/components/Alert/Version1dot1.vue.d.ts +2 -38
- 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 +176 -29
- 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 +38 -32
- 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 +32 -1
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +176 -29
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +83 -14
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +186 -39
- package/dist/components/InputNext/InputNext.vue.d.ts +4 -4
- package/dist/components/Label/Label.vue.d.ts +9 -15
- 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 +184 -37
- 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 +20 -14
- 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 +8 -6
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +97 -28
- 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 +83 -14
- 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 +24 -25
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +13 -2
- 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/TemplatePreview/TemplatePreview.vue.d.ts +9 -0
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -0
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +15 -0
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.vue.d.ts +38 -32
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +16 -0
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -0
- package/dist/components/Toast/ToastManager.d.ts +14 -0
- package/dist/components/Toast/ToastManager.d.ts.map +1 -0
- package/dist/components/Toast/types.d.ts +35 -0
- package/dist/components/Toast/types.d.ts.map +1 -0
- 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 +2402 -1146
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/ui/popover/Popover.vue.d.ts +23 -0
- package/dist/components/ui/popover/Popover.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +43 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +19 -0
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/index.d.ts +5 -0
- package/dist/components/ui/popover/index.d.ts.map +1 -0
- package/dist/{es-8265192e.mjs → es-479daf92.mjs} +1 -1
- package/dist/{index-832905fc.mjs → index-a8aa7094.mjs} +18065 -11737
- package/dist/index.d.ts.map +1 -1
- package/dist/locales/en.json.d.ts +2 -1
- package/dist/locales/es.json.d.ts +2 -1
- package/dist/locales/pt_br.json.d.ts +2 -1
- package/dist/{pt-br-9ced3d4b.mjs → pt-br-32c84cc8.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +141 -129
- package/dist/unnnic.umd.js +53 -50
- package/dist/utils/call.d.ts +2 -1
- package/dist/utils/call.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/assets/icons/radio-checked.svg +3 -0
- package/src/assets/icons/switch-checked-disabled.svg +3 -0
- package/src/assets/icons/switch-checked.svg +3 -0
- 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/assets/scss/scheme-colors.scss +115 -238
- package/src/assets/scss/tailwind.scss +15 -15
- package/src/components/Alert/Alert.vue +26 -135
- package/src/components/Alert/Version1dot1.vue +0 -36
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +11 -7
- package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +2 -2
- package/src/components/Button/Button.vue +60 -108
- package/src/components/Button/types.ts +0 -1
- package/src/components/FormElement/FormElement.vue +51 -91
- package/src/components/Input/BaseInput.vue +31 -14
- package/src/components/Input/Input.scss +19 -21
- package/src/components/Input/Input.vue +94 -30
- package/src/components/Input/TextInput.vue +82 -58
- package/src/components/Input/__test__/TextInput.spec.js +5 -5
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +16 -3
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +7 -1
- package/src/components/Label/Label.vue +52 -21
- 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 +1 -0
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
- package/src/components/Popover/__tests__/Popover.spec.js +147 -0
- package/src/components/Popover/__tests__/__snapshots__/Popover.spec.js.snap +8 -0
- package/src/components/Popover/index.vue +146 -0
- package/src/components/Radio/Radio.vue +80 -67
- package/src/components/Radio/__test__/Radio.spec.js +14 -20
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +3 -3
- package/src/components/RadioGroup/RadioGroup.vue +110 -0
- package/src/components/Select/SelectOption.vue +65 -0
- package/src/components/Select/__tests__/Select.spec.js +412 -0
- package/src/components/Select/__tests__/SelectItem.spec.js +330 -0
- package/src/components/Select/__tests__/SelectOption.spec.js +174 -0
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +97 -0
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +15 -0
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +25 -0
- package/src/components/Select/index.vue +245 -0
- package/src/components/Switch/Switch.vue +91 -99
- package/src/components/Switch/__tests__/Switch.spec.js +8 -74
- package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +3 -5
- package/src/components/Tab/Tab.vue +37 -23
- 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 +252 -0
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +51 -0
- package/src/components/TemplatePreview/types.d.ts +16 -0
- package/src/components/TextArea/TextArea.vue +13 -9
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +7 -2
- package/src/components/Toast/Toast.vue +236 -0
- package/src/components/Toast/ToastManager.ts +110 -0
- package/src/components/Toast/types.ts +57 -0
- package/src/components/index.ts +30 -4
- package/src/components/ui/popover/Popover.vue +15 -0
- package/src/components/ui/popover/PopoverContent.vue +98 -0
- package/src/components/ui/popover/PopoverTrigger.vue +12 -0
- package/src/components/ui/popover/index.ts +4 -0
- package/src/index.ts +1 -0
- package/src/locales/en.json +2 -1
- package/src/locales/es.json +2 -1
- package/src/locales/pt_br.json +2 -1
- package/src/stories/Alert.stories.js +6 -67
- package/src/stories/Button.stories.js +2 -17
- package/src/stories/Input.stories.js +22 -3
- package/src/stories/Label.stories.js +7 -0
- package/src/stories/Popover.stories.js +306 -0
- package/src/stories/RadioGroup.stories.js +139 -0
- package/src/stories/Select.stories.js +158 -0
- package/src/stories/Switch.stories.js +4 -5
- package/src/stories/Tab.stories.js +11 -4
- package/src/stories/TemplatePreview.stories.js +94 -0
- package/src/stories/TemplatePreviewModal.stories.js +110 -0
- package/src/stories/Toast.mdx +123 -0
- package/src/stories/Toast.stories.js +126 -0
- package/src/types/scheme-colors.d.ts +1 -0
- package/src/utils/call.js +46 -18
- package/src/components/Alert/AlertBanner.vue +0 -182
- package/src/components/Alert/AlertCaller.vue +0 -49
- package/src/components/Alert/__tests__/AlertBanner.spec.js +0 -89
- package/src/components/Alert/__tests__/AlertCaller.spec.js +0 -98
|
@@ -17,52 +17,31 @@
|
|
|
17
17
|
|
|
18
18
|
<slot></slot>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
>
|
|
20
|
+
<section class="unnnic-form-element__hints-container">
|
|
21
|
+
<section class="unnnic-form-element__message-container">
|
|
22
|
+
<p
|
|
23
|
+
v-if="message"
|
|
24
|
+
class="unnnic-form-element__message"
|
|
25
|
+
>
|
|
26
|
+
{{ fullySanitize(message) }}
|
|
27
|
+
</p>
|
|
28
|
+
<p
|
|
29
|
+
v-if="!!error.length"
|
|
30
|
+
class="unnnic-form-element__message error"
|
|
31
|
+
>
|
|
32
|
+
{{ Array.isArray(error) ? error.join(', ') : error }}
|
|
33
|
+
</p>
|
|
34
|
+
</section>
|
|
35
|
+
<p v-if="!!$slots.rightMessage">
|
|
52
36
|
<slot name="rightMessage"></slot>
|
|
53
|
-
</
|
|
54
|
-
</
|
|
37
|
+
</p>
|
|
38
|
+
</section>
|
|
55
39
|
</section>
|
|
56
40
|
</template>
|
|
57
41
|
|
|
58
42
|
<script>
|
|
59
|
-
import UnnnicIcon from '../../components/Icon.vue';
|
|
60
43
|
import { fullySanitize } from '../../utils/sanitize';
|
|
61
44
|
export default {
|
|
62
|
-
components: {
|
|
63
|
-
UnnnicIcon,
|
|
64
|
-
},
|
|
65
|
-
|
|
66
45
|
props: {
|
|
67
46
|
size: {
|
|
68
47
|
type: String,
|
|
@@ -70,28 +49,18 @@ export default {
|
|
|
70
49
|
validator: (size) => ['md', 'sm'].includes(size),
|
|
71
50
|
},
|
|
72
51
|
|
|
73
|
-
label: String,
|
|
52
|
+
label: { type: String, default: '' },
|
|
74
53
|
|
|
75
|
-
fixedLabel: Boolean,
|
|
54
|
+
fixedLabel: { type: Boolean, default: false },
|
|
76
55
|
|
|
77
56
|
error: {
|
|
78
57
|
type: [Boolean, String],
|
|
79
58
|
default: false,
|
|
80
59
|
},
|
|
81
60
|
|
|
82
|
-
message: String,
|
|
83
|
-
|
|
84
|
-
disabled: Boolean,
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
data() {
|
|
88
|
-
return {};
|
|
89
|
-
},
|
|
61
|
+
message: { type: String, default: '' },
|
|
90
62
|
|
|
91
|
-
|
|
92
|
-
shouldShowErrorSection() {
|
|
93
|
-
return this.error && (this.error !== true || !!this.$slots.rightMessage);
|
|
94
|
-
},
|
|
63
|
+
disabled: { type: Boolean, default: false },
|
|
95
64
|
},
|
|
96
65
|
methods: {
|
|
97
66
|
fullySanitize,
|
|
@@ -102,75 +71,66 @@ export default {
|
|
|
102
71
|
<style lang="scss" scoped>
|
|
103
72
|
@use '@/assets/scss/unnnic' as *;
|
|
104
73
|
|
|
74
|
+
* {
|
|
75
|
+
margin: $unnnic-space-0;
|
|
76
|
+
padding: $unnnic-space-0;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
}
|
|
79
|
+
|
|
105
80
|
.unnnic-form-element {
|
|
106
81
|
&__label {
|
|
107
|
-
|
|
108
|
-
margin-bottom: $unnnic-spacing-nano;
|
|
109
|
-
|
|
82
|
+
font: $unnnic-font-body;
|
|
110
83
|
color: $unnnic-color-neutral-cloudy;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
$label-bottom-spacing: 3px;
|
|
84
|
+
margin-bottom: $unnnic-space-1;
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: $unnnic-space-2;
|
|
117
88
|
|
|
118
89
|
&--fixed {
|
|
119
|
-
margin-top: -$unnnic-font-size-body-gt - $unnnic-
|
|
120
|
-
$label-bottom-spacing;
|
|
90
|
+
margin-top: -$unnnic-font-size-body-gt - $unnnic-space-2 + $unnnic-space-1;
|
|
121
91
|
}
|
|
122
92
|
|
|
123
93
|
&--fixed {
|
|
124
|
-
margin-bottom: 0;
|
|
94
|
+
margin-bottom: $unnnic-space-0;
|
|
125
95
|
position: absolute;
|
|
126
|
-
padding: 0 $unnnic-
|
|
127
|
-
margin-left: $unnnic-
|
|
96
|
+
padding: $unnnic-space-0 $unnnic-space-1;
|
|
97
|
+
margin-left: $unnnic-space-2;
|
|
128
98
|
|
|
129
99
|
&:after {
|
|
130
100
|
content: ' ';
|
|
131
101
|
position: absolute;
|
|
132
|
-
left: 0;
|
|
133
|
-
bottom: $
|
|
102
|
+
left: $unnnic-space-0;
|
|
103
|
+
bottom: $unnnic-space-1 - $unnnic-border-width-thinner;
|
|
134
104
|
width: 100%;
|
|
135
105
|
height: $unnnic-border-width-thinner;
|
|
136
|
-
background-color: $unnnic-color-
|
|
106
|
+
background-color: $unnnic-color-white;
|
|
137
107
|
}
|
|
138
108
|
}
|
|
139
109
|
}
|
|
140
110
|
|
|
141
|
-
&__error,
|
|
142
111
|
&__message {
|
|
143
|
-
|
|
144
|
-
|
|
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;
|
|
112
|
+
&.error {
|
|
113
|
+
color: $unnnic-color-fg-critical;
|
|
114
|
+
}
|
|
151
115
|
}
|
|
152
116
|
|
|
153
|
-
&
|
|
117
|
+
&__hints-container {
|
|
154
118
|
display: flex;
|
|
155
|
-
|
|
119
|
+
justify-content: space-between;
|
|
120
|
+
margin-top: $unnnic-space-1;
|
|
121
|
+
font: $unnnic-font-caption-2;
|
|
122
|
+
color: $unnnic-color-fg-base;
|
|
156
123
|
}
|
|
157
124
|
|
|
158
|
-
&
|
|
159
|
-
margin-left: auto;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
&__error {
|
|
125
|
+
&__message-container {
|
|
163
126
|
display: flex;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
color: $unnnic-color-aux-red-500;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
gap: $unnnic-space-1;
|
|
168
129
|
}
|
|
169
130
|
|
|
170
131
|
&--disabled .unnnic-form-element__label,
|
|
171
132
|
&--disabled .unnnic-form-element__message {
|
|
172
133
|
user-select: none;
|
|
173
|
-
color: $unnnic-color-neutral-cleanest;
|
|
174
134
|
}
|
|
175
135
|
}
|
|
176
136
|
</style>
|
|
@@ -4,16 +4,18 @@
|
|
|
4
4
|
v-mask="mask"
|
|
5
5
|
v-bind="attributes"
|
|
6
6
|
:value="fullySanitize(modelValue)"
|
|
7
|
-
:class="classes"
|
|
7
|
+
:class="[classes, { focus: forceActiveStatus }]"
|
|
8
8
|
:type="nativeType"
|
|
9
|
+
:readonly="readonly"
|
|
9
10
|
/>
|
|
10
|
-
|
|
11
11
|
<input
|
|
12
12
|
v-else
|
|
13
13
|
v-bind="attributes"
|
|
14
14
|
:value="fullySanitize(modelValue)"
|
|
15
|
-
:class="classes"
|
|
15
|
+
:class="[classes, { focus: forceActiveStatus }]"
|
|
16
16
|
:type="nativeType"
|
|
17
|
+
:maxlength="maxlength"
|
|
18
|
+
:readonly="readonly"
|
|
17
19
|
/>
|
|
18
20
|
</template>
|
|
19
21
|
|
|
@@ -49,6 +51,19 @@ export default {
|
|
|
49
51
|
},
|
|
50
52
|
hasIconLeft: Boolean,
|
|
51
53
|
hasIconRight: Boolean,
|
|
54
|
+
hasClearIcon: Boolean,
|
|
55
|
+
maxlength: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: null,
|
|
58
|
+
},
|
|
59
|
+
readonly: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
forceActiveStatus: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false,
|
|
66
|
+
},
|
|
52
67
|
},
|
|
53
68
|
emits: ['update:modelValue'],
|
|
54
69
|
data() {
|
|
@@ -73,6 +88,7 @@ export default {
|
|
|
73
88
|
{
|
|
74
89
|
'input--has-icon-left': this.hasIconLeft,
|
|
75
90
|
'input--has-icon-right': this.hasIconRight,
|
|
91
|
+
'input--has-clear-icon': this.hasClearIcon,
|
|
76
92
|
},
|
|
77
93
|
];
|
|
78
94
|
},
|
|
@@ -96,27 +112,28 @@ export default {
|
|
|
96
112
|
&.size {
|
|
97
113
|
&-md {
|
|
98
114
|
@include input-md-font;
|
|
99
|
-
|
|
100
|
-
padding: ($unnnic-spacing-ant - $unnnic-border-width-thinner)
|
|
101
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
115
|
+
padding: $unnnic-space-3 $unnnic-space-4;
|
|
102
116
|
}
|
|
103
117
|
|
|
104
118
|
&-sm {
|
|
105
119
|
@include input-sm-font;
|
|
106
|
-
|
|
107
|
-
padding: $unnnic-spacing-xs
|
|
108
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
120
|
+
padding: $unnnic-space-2 $unnnic-space-4;
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
123
|
|
|
112
124
|
&.input--has-icon-left {
|
|
113
|
-
padding-left: $unnnic-
|
|
114
|
-
$unnnic-spacing-xs - $unnnic-border-width-thinner;
|
|
125
|
+
padding-left: $unnnic-space-10;
|
|
115
126
|
}
|
|
116
127
|
|
|
117
128
|
&.input--has-icon-right {
|
|
118
|
-
padding-right: $unnnic-
|
|
119
|
-
|
|
129
|
+
padding-right: $unnnic-space-10;
|
|
130
|
+
&.input--has-clear-icon {
|
|
131
|
+
padding-right: $unnnic-space-10 + $unnnic-space-6;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&.input--has-clear-icon {
|
|
136
|
+
padding-right: $unnnic-space-10;
|
|
120
137
|
}
|
|
121
138
|
|
|
122
139
|
&.error {
|
|
@@ -126,7 +143,7 @@ export default {
|
|
|
126
143
|
&:-ms-input-placeholder,
|
|
127
144
|
&::-ms-input-placeholder {
|
|
128
145
|
/* Internet Explorer 10-11 */
|
|
129
|
-
color: $unnnic-color-
|
|
146
|
+
color: $unnnic-color-fg-muted;
|
|
130
147
|
}
|
|
131
148
|
}
|
|
132
149
|
</style>
|
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
@use '@/assets/scss/unnnic' as *;
|
|
2
2
|
|
|
3
3
|
@mixin input-base {
|
|
4
|
-
background: $unnnic-color-
|
|
5
|
-
border: $unnnic-border-width-thinner solid $unnnic-color-
|
|
4
|
+
background: $unnnic-color-white;
|
|
5
|
+
border: $unnnic-border-width-thinner solid $unnnic-color-border-base;
|
|
6
6
|
outline: none;
|
|
7
|
-
border-radius: $unnnic-
|
|
8
|
-
color: $unnnic-color-
|
|
9
|
-
caret-color: $unnnic-color-
|
|
10
|
-
font
|
|
11
|
-
font-family: $unnnic-font-family-secondary;
|
|
7
|
+
border-radius: $unnnic-radius-2;
|
|
8
|
+
color: $unnnic-color-fg-emphasized;
|
|
9
|
+
caret-color: $unnnic-color-fg-muted;
|
|
10
|
+
font: $unnnic-font-body;
|
|
12
11
|
|
|
13
|
-
&:focus
|
|
14
|
-
|
|
12
|
+
&:focus,
|
|
13
|
+
&.focus {
|
|
14
|
+
border-color: $unnnic-color-border-active;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&::placeholder {
|
|
18
|
-
color: $unnnic-color-
|
|
19
|
-
opacity: 1;
|
|
18
|
+
color: $unnnic-color-fg-muted;
|
|
19
|
+
opacity: 1;
|
|
20
|
+
/* Firefox */
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
&:disabled {
|
|
23
|
-
border-color: $unnnic-color-
|
|
24
|
-
background-color: $unnnic-color-
|
|
24
|
+
border-color: $unnnic-color-border-muted;
|
|
25
|
+
background-color: $unnnic-color-bg-muted;
|
|
25
26
|
cursor: not-allowed;
|
|
26
|
-
color: $unnnic-color-
|
|
27
|
+
color: $unnnic-color-fg-muted;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
@mixin input-sm-font {
|
|
31
|
-
font
|
|
32
|
-
line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
|
|
32
|
+
font: $unnnic-font-body;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@mixin input-md-font {
|
|
36
|
-
font
|
|
37
|
-
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
36
|
+
font: $unnnic-font-body;
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
@mixin input-error {
|
|
41
|
-
border-color: $unnnic-color-
|
|
42
|
-
|
|
43
|
-
}
|
|
40
|
+
border-color: $unnnic-color-border-critical;
|
|
41
|
+
}
|
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
<slot name="label" />
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
<
|
|
10
|
+
<UnnnicLabel
|
|
11
11
|
v-else-if="label"
|
|
12
12
|
class="unnnic-form__label"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
:label="label"
|
|
14
|
+
:tooltip="tooltip"
|
|
15
|
+
/>
|
|
16
16
|
|
|
17
17
|
<TextInput
|
|
18
18
|
v-bind="$attrs"
|
|
19
19
|
v-model="val"
|
|
20
20
|
class="unnnic-form-input"
|
|
21
|
+
:forceActiveStatus="forceActiveStatus"
|
|
21
22
|
:placeholder="placeholder"
|
|
22
23
|
:iconLeft="iconLeft"
|
|
23
24
|
:iconRight="iconRight"
|
|
@@ -28,24 +29,43 @@
|
|
|
28
29
|
:size="size"
|
|
29
30
|
:mask="mask"
|
|
30
31
|
:nativeType="nativeType"
|
|
32
|
+
:maxlength="maxlength"
|
|
33
|
+
:disabled="disabled"
|
|
34
|
+
:readonly="readonly"
|
|
35
|
+
:showClear="showClear"
|
|
36
|
+
@clear="$emit('clear')"
|
|
31
37
|
/>
|
|
32
38
|
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
<section class="unnnic-form__hints-container">
|
|
40
|
+
<section class="unnnic-form__message-container">
|
|
41
|
+
<p
|
|
42
|
+
v-if="message"
|
|
43
|
+
class="unnnic-form__message"
|
|
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>
|
|
39
58
|
</div>
|
|
40
59
|
</template>
|
|
41
60
|
|
|
42
61
|
<script>
|
|
43
62
|
import { fullySanitize } from '../../utils/sanitize';
|
|
44
63
|
import TextInput from './TextInput.vue';
|
|
64
|
+
import UnnnicLabel from '../Label/Label.vue';
|
|
45
65
|
|
|
46
66
|
export default {
|
|
47
67
|
name: 'UnnnicInput',
|
|
48
|
-
components: { TextInput },
|
|
68
|
+
components: { TextInput, UnnnicLabel },
|
|
49
69
|
props: {
|
|
50
70
|
placeholder: {
|
|
51
71
|
type: String,
|
|
@@ -68,19 +88,23 @@ export default {
|
|
|
68
88
|
},
|
|
69
89
|
message: {
|
|
70
90
|
type: String,
|
|
71
|
-
default:
|
|
91
|
+
default: '',
|
|
92
|
+
},
|
|
93
|
+
errors: {
|
|
94
|
+
type: [String, Array],
|
|
95
|
+
default: '',
|
|
72
96
|
},
|
|
73
97
|
label: {
|
|
74
98
|
type: String,
|
|
75
|
-
default:
|
|
99
|
+
default: '',
|
|
76
100
|
},
|
|
77
101
|
iconLeft: {
|
|
78
102
|
type: String,
|
|
79
|
-
default:
|
|
103
|
+
default: '',
|
|
80
104
|
},
|
|
81
105
|
iconRight: {
|
|
82
106
|
type: String,
|
|
83
|
-
default:
|
|
107
|
+
default: '',
|
|
84
108
|
},
|
|
85
109
|
allowTogglePassword: {
|
|
86
110
|
type: Boolean,
|
|
@@ -88,11 +112,11 @@ export default {
|
|
|
88
112
|
},
|
|
89
113
|
iconLeftClickable: {
|
|
90
114
|
type: Boolean,
|
|
91
|
-
default:
|
|
115
|
+
default: false,
|
|
92
116
|
},
|
|
93
117
|
iconRightClickable: {
|
|
94
118
|
type: Boolean,
|
|
95
|
-
default:
|
|
119
|
+
default: false,
|
|
96
120
|
},
|
|
97
121
|
hasCloudyColor: {
|
|
98
122
|
type: Boolean,
|
|
@@ -106,8 +130,38 @@ export default {
|
|
|
106
130
|
type: [String, Array],
|
|
107
131
|
default: '',
|
|
108
132
|
},
|
|
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
|
+
},
|
|
109
161
|
},
|
|
110
|
-
|
|
162
|
+
|
|
163
|
+
emits: ['update:modelValue', 'clear'],
|
|
164
|
+
|
|
111
165
|
data() {
|
|
112
166
|
return {
|
|
113
167
|
val: this.modelValue,
|
|
@@ -138,27 +192,37 @@ export default {
|
|
|
138
192
|
<style lang="scss" scoped>
|
|
139
193
|
@use '@/assets/scss/unnnic' as *;
|
|
140
194
|
|
|
195
|
+
* {
|
|
196
|
+
margin: 0;
|
|
197
|
+
padding: 0;
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
}
|
|
200
|
+
|
|
141
201
|
.unnnic-form {
|
|
142
|
-
font-family: $unnnic-font-family-secondary;
|
|
143
202
|
position: relative;
|
|
144
203
|
|
|
145
204
|
&__message {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
205
|
+
&.error {
|
|
206
|
+
color: $unnnic-color-fg-critical;
|
|
207
|
+
}
|
|
149
208
|
}
|
|
150
209
|
|
|
151
210
|
&__label {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
211
|
+
margin-bottom: $unnnic-space-1;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&__hints-container {
|
|
215
|
+
display: flex;
|
|
216
|
+
justify-content: space-between;
|
|
217
|
+
margin-top: $unnnic-space-1;
|
|
218
|
+
font: $unnnic-font-caption-2;
|
|
219
|
+
color: $unnnic-color-fg-base;
|
|
157
220
|
}
|
|
158
221
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
222
|
+
&__message-container {
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-direction: column;
|
|
225
|
+
gap: $unnnic-space-1;
|
|
162
226
|
}
|
|
163
227
|
}
|
|
164
228
|
</style>
|