@weni/unnnic-system 1.3.2 → 1.4.1
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/README.md +2 -2
- package/dist/scss/colors.scss +97 -97
- package/dist/scss/fonts.scss +33 -33
- package/dist/scss/grid.scss +51 -51
- package/dist/scss/spacing.scss +92 -92
- package/dist/scss/unnnic.scss +10 -10
- package/dist/unnnic.common.js +1177 -934
- package/dist/unnnic.common.js.map +1 -1
- package/dist/unnnic.css +1 -1
- package/dist/unnnic.umd.js +1177 -934
- package/dist/unnnic.umd.js.map +1 -1
- package/dist/unnnic.umd.min.js +70 -70
- package/dist/unnnic.umd.min.js.map +1 -1
- package/package-lock.json +27271 -27271
- package/package.json +63 -63
- package/public/index.html +17 -17
- package/src/assets/fonts/fonts/icomoon.svg +163 -163
- package/src/assets/fonts/icons.css +582 -582
- package/src/assets/icons/Brazil.svg +21 -21
- package/src/assets/icons/Spain.svg +498 -498
- package/src/assets/icons/USA.svg +28 -28
- package/src/assets/icons/add-1.svg +3 -3
- package/src/assets/icons/add-circle-1.svg +4 -4
- package/src/assets/icons/alarm-bell-2.svg +4 -4
- package/src/assets/icons/alarm-bell-3.svg +4 -4
- package/src/assets/icons/alert-circle-1-1.svg +3 -3
- package/src/assets/icons/alert-circle-1.svg +5 -5
- package/src/assets/icons/american-express.svg +4 -4
- package/src/assets/icons/app-window-edit-1.svg +4 -4
- package/src/assets/icons/app-window-edit-2.svg +9 -9
- package/src/assets/icons/arrow-button-down-1.svg +3 -3
- package/src/assets/icons/arrow-button-right-1.svg +3 -3
- package/src/assets/icons/arrow-button-up-1.svg +3 -3
- package/src/assets/icons/arrow-down-1-1.svg +3 -3
- package/src/assets/icons/arrow-left-1-1.svg +3 -3
- package/src/assets/icons/arrow-redo.svg +3 -0
- package/src/assets/icons/arrow-right-1-1.svg +3 -3
- package/src/assets/icons/arrow-undo.svg +3 -0
- package/src/assets/icons/bin-1-1.svg +5 -5
- package/src/assets/icons/book-address-1-2.svg +4 -4
- package/src/assets/icons/book-address-2.svg +3 -3
- package/src/assets/icons/book-library-1.svg +9 -9
- package/src/assets/icons/book-library-2.svg +3 -3
- package/src/assets/icons/building-2-1.svg +13 -13
- package/src/assets/icons/button-play-1.svg +4 -4
- package/src/assets/icons/button-refresh-arrow-1.svg +3 -3
- package/src/assets/icons/button-refresh-arrows-1.svg +4 -4
- package/src/assets/icons/charger-1.svg +4 -4
- package/src/assets/icons/chat-translate-1.svg +6 -6
- package/src/assets/icons/check-2.svg +3 -3
- package/src/assets/icons/check-circle-1-1-1.svg +3 -3
- package/src/assets/icons/check-circle-1-1.svg +4 -4
- package/src/assets/icons/check-square-1.svg +4 -4
- package/src/assets/icons/check-square-2.svg +4 -4
- package/src/assets/icons/checkbox-default.svg +3 -3
- package/src/assets/icons/checkbox-disable.svg +3 -3
- package/src/assets/icons/checkbox-less.svg +4 -4
- package/src/assets/icons/checkbox-select.svg +4 -4
- package/src/assets/icons/close-1.svg +3 -3
- package/src/assets/icons/cog-1.svg +4 -4
- package/src/assets/icons/cog-2.svg +3 -3
- package/src/assets/icons/copy-paste-1.svg +7 -7
- package/src/assets/icons/currency-dollar-circle-1.svg +4 -4
- package/src/assets/icons/default-avatar.svg +5 -5
- package/src/assets/icons/delete-1-1.svg +4 -4
- package/src/assets/icons/delete-1.svg +3 -3
- package/src/assets/icons/developer-community-github-1-1.svg +3 -3
- package/src/assets/icons/diners-club.svg +6 -6
- package/src/assets/icons/discover.svg +11 -11
- package/src/assets/icons/download-bottom-1.svg +4 -4
- package/src/assets/icons/download-thick-bottom-1.svg +4 -4
- package/src/assets/icons/drag-1.svg +10 -10
- package/src/assets/icons/email-action-unread-1-1.svg +4 -4
- package/src/assets/icons/email-action-unread-1.svg +10 -10
- package/src/assets/icons/expand-8-1.svg +6 -6
- package/src/assets/icons/expand-full-1.svg +7 -7
- package/src/assets/icons/export-1.svg +5 -5
- package/src/assets/icons/filter.svg +3 -3
- package/src/assets/icons/fitness-biceps-1.svg +3 -3
- package/src/assets/icons/flash-1-3.svg +3 -3
- package/src/assets/icons/flash-1-4.svg +3 -3
- package/src/assets/icons/floppy-disk-1.svg +6 -6
- package/src/assets/icons/folder-1.svg +3 -3
- package/src/assets/icons/folder-2.svg +3 -3
- package/src/assets/icons/gauge-dashboard-1.svg +4 -4
- package/src/assets/icons/gauge-dashboard-2.svg +8 -8
- package/src/assets/icons/generic-card.svg +4 -4
- package/src/assets/icons/graph-stats-1.svg +3 -3
- package/src/assets/icons/graph-stats-ascend-2.svg +3 -3
- package/src/assets/icons/graph-stats-circle-1-1.svg +4 -4
- package/src/assets/icons/graph-stats-circle-1.svg +4 -4
- package/src/assets/icons/headphones-customer-support-1.svg +3 -3
- package/src/assets/icons/headphones-customer-support-2.svg +3 -3
- package/src/assets/icons/headphones-customer-support-human-1-1.svg +4 -4
- package/src/assets/icons/hierarchy-3-2.svg +3 -3
- package/src/assets/icons/hierarchy-3-3.svg +3 -3
- package/src/assets/icons/house-1-1.svg +4 -4
- package/src/assets/icons/house-2-2.svg +3 -3
- package/src/assets/icons/icon-script.py +27 -27
- package/src/assets/icons/indicator.svg +3 -3
- package/src/assets/icons/information-circle-4.svg +3 -3
- package/src/assets/icons/jcb.svg +21 -21
- package/src/assets/icons/keyboard-arrow-down-1.svg +3 -3
- package/src/assets/icons/keyboard-arrow-left-1.svg +3 -3
- package/src/assets/icons/keyboard-arrow-right-1.svg +3 -3
- package/src/assets/icons/keyboard-return-1-1.svg +3 -3
- package/src/assets/icons/keyboard-return-1.svg +4 -4
- package/src/assets/icons/layout-dashboard-1.svg +6 -6
- package/src/assets/icons/layout-dashboard-2.svg +6 -6
- package/src/assets/icons/layout-module-1-2.svg +6 -6
- package/src/assets/icons/loading-circle-1.svg +19 -19
- package/src/assets/icons/lock-2-1.svg +4 -4
- package/src/assets/icons/lock-unlock-1-1.svg +4 -4
- package/src/assets/icons/logout-1-1.svg +4 -4
- package/src/assets/icons/mastercard.svg +6 -6
- package/src/assets/icons/messages-bubble-1.svg +3 -3
- package/src/assets/icons/messages-bubble-3.svg +3 -3
- package/src/assets/icons/messages-bubble-4.svg +3 -3
- package/src/assets/icons/messaging-we-chat-2.svg +4 -4
- package/src/assets/icons/messaging-we-chat-3.svg +8 -8
- package/src/assets/icons/messaging-whatsapp-1.svg +4 -4
- package/src/assets/icons/navigation-menu-vertical-1.svg +5 -5
- package/src/assets/icons/notes-1.svg +7 -7
- package/src/assets/icons/office-file-pdf-1-1.svg +6 -6
- package/src/assets/icons/paginate-filter-text-1.svg +7 -7
- package/src/assets/icons/pencil-write-1.svg +4 -4
- package/src/assets/icons/phone-3.svg +3 -3
- package/src/assets/icons/phone-4.svg +3 -3
- package/src/assets/icons/phone-charger-1.svg +3 -3
- package/src/assets/icons/photography-equipment-bag-1.svg +5 -5
- package/src/assets/icons/question-circle-1.svg +5 -5
- package/src/assets/icons/question-circle-2.svg +3 -3
- package/src/assets/icons/radio-default.svg +3 -3
- package/src/assets/icons/radio-disable.svg +3 -3
- package/src/assets/icons/radio-selected.svg +4 -4
- package/src/assets/icons/rating-star-1.svg +3 -3
- package/src/assets/icons/read-email-at-1.svg +10 -10
- package/src/assets/icons/science-fiction-robot-1.svg +8 -8
- package/src/assets/icons/science-fiction-robot-2.svg +5 -5
- package/src/assets/icons/search-1.svg +3 -3
- package/src/assets/icons/send-email-3-1.svg +3 -3
- package/src/assets/icons/single-neutral-2.svg +4 -4
- package/src/assets/icons/single-neutral-actions-1.svg +4 -4
- package/src/assets/icons/social-media-google-1.svg +6 -6
- package/src/assets/icons/sort-asc.svg +4 -4
- package/src/assets/icons/sort-default.svg +4 -4
- package/src/assets/icons/sort-desc.svg +4 -4
- package/src/assets/icons/study-light-idea-1.svg +10 -10
- package/src/assets/icons/subtract-1.svg +3 -3
- package/src/assets/icons/subtract-circle-1.svg +4 -4
- package/src/assets/icons/switch-default-disabled.svg +4 -4
- package/src/assets/icons/switch-default.svg +11 -11
- package/src/assets/icons/switch-selected-disabled.svg +4 -4
- package/src/assets/icons/switch-selected.svg +11 -11
- package/src/assets/icons/synchronize-arrow-clock-4.svg +4 -4
- package/src/assets/icons/synchronize-arrow-clock-5.svg +4 -4
- package/src/assets/icons/task-list-clock-1.svg +9 -9
- package/src/assets/icons/text-bold.svg +3 -0
- package/src/assets/icons/text-center.svg +7 -0
- package/src/assets/icons/text-italic.svg +3 -0
- package/src/assets/icons/text-justified.svg +7 -0
- package/src/assets/icons/text-left.svg +7 -0
- package/src/assets/icons/text-right.svg +7 -0
- package/src/assets/icons/text-underline.svg +4 -0
- package/src/assets/icons/ticket-1.svg +9 -9
- package/src/assets/icons/ticket-2.svg +4 -4
- package/src/assets/icons/time-clock-circle-1.svg +4 -4
- package/src/assets/icons/translate-1.svg +8 -8
- package/src/assets/icons/translate-2.svg +8 -8
- package/src/assets/icons/typing-1.svg +4 -4
- package/src/assets/icons/unionpay.svg +7 -7
- package/src/assets/icons/unordered-list.svg +8 -0
- package/src/assets/icons/upload-bottom-1.svg +4 -4
- package/src/assets/icons/video-file-mp4-1.svg +6 -6
- package/src/assets/icons/view-1-1.svg +4 -4
- package/src/assets/icons/view-off-1.svg +7 -7
- package/src/assets/icons/vip-crown-queen-2.svg +4 -4
- package/src/assets/icons/visa.svg +8 -8
- package/src/assets/img/flag/en.svg +28 -28
- package/src/assets/img/flag/pt-br.svg +21 -21
- package/src/assets/scss/colors.scss +97 -97
- package/src/assets/scss/fonts.scss +33 -33
- package/src/assets/scss/grid.scss +51 -51
- package/src/assets/scss/spacing.scss +92 -92
- package/src/assets/scss/unnnic.scss +10 -10
- package/src/components/Accordion/Accordion.vue +1 -1
- package/src/components/Alert/Alert.vue +1 -1
- package/src/components/Alert/Version1dot1.vue +1 -1
- package/src/components/AvatarIcon/AvatarIcon.vue +1 -1
- package/src/components/Banner/InfoBanner.vue +1 -1
- package/src/components/Breadcrumb/Breadcrumb.vue +1 -1
- package/src/components/Button/Button.vue +1 -1
- package/src/components/Button/ButtonIcon.vue +47 -21
- package/src/components/Card/BlankCard.vue +1 -1
- package/src/components/Card/CardCompany.vue +1 -1
- package/src/components/Card/CardData.vue +1 -1
- package/src/components/Card/ContentCard.vue +1 -1
- package/src/components/Card/DashCard.vue +1 -1
- package/src/components/Card/MarketplaceCard.vue +1 -1
- package/src/components/Card/StatusCard.vue +1 -1
- package/src/components/Card/TitleCard.vue +1 -1
- package/src/components/CardProject/CardProject.vue +1 -1
- package/src/components/Carousel/TagCarousel.vue +1 -1
- package/src/components/ChatText/ChatText.vue +1 -1
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/DatePicker/DatePicker.vue +6 -6
- package/src/components/Dropdown/LanguageSelect.vue +1 -1
- package/src/components/Flag.vue +1 -1
- package/src/components/Icon.vue +92 -61
- package/src/components/Input/TextInput.vue +1 -1
- package/src/components/Modal/Modal.vue +1 -1
- package/src/components/ModalUpload/ModalUpload.vue +1 -1
- package/src/components/MultiSelect/MultiSelect.vue +1 -1
- package/src/components/Radio/Radio.vue +1 -1
- package/src/components/Sidebar/SidebarItem.vue +1 -1
- package/src/components/Sidebar/SidebarPrimary.vue +1 -1
- package/src/components/Switch/Switch.vue +1 -1
- package/src/components/Tag/BrandTag.vue +1 -1
- package/src/components/Tag/DefaultTag.vue +1 -1
- package/src/components/Tag/IndicatorTag.vue +1 -1
- package/src/components/TextEditor/TextEditor.vue +203 -0
- package/src/components/UploadArea/UploadArea.vue +1 -1
- package/src/components/index.js +5 -3
- package/src/locales/en.json +15 -15
- package/src/locales/es.json +15 -15
- package/src/locales/pt_br.json +15 -15
- package/src/stories/CardProject.stories.js +1 -1
- package/src/stories/Comment.stories.js +2 -2
- package/src/stories/Icon.stories.js +37 -12
- package/src/stories/Introduction.stories.mdx +207 -207
- package/src/stories/TextEditor.stories.js +33 -0
- package/src/utils/icons.js +20 -0
- package/dist/fonts/icomoon.0357f645.eot +0 -0
- package/dist/fonts/icomoon.a58994c5.ttf +0 -0
- package/dist/fonts/icomoon.ba966620.woff +0 -0
- package/dist/img/icomoon.fcc6d2c8.svg +0 -164
- package/src/components/Icon-svg.vue +0 -147
- package/src/stories/IconSvg.stories.js +0 -48
|
@@ -162,12 +162,12 @@ export default {
|
|
|
162
162
|
|
|
163
163
|
data() {
|
|
164
164
|
const today = new Date();
|
|
165
|
-
const referenceDate = `${today.getMonth() + 1}
|
|
165
|
+
const referenceDate = `${today.getMonth() + 1} 1 ${today.getFullYear()}`;
|
|
166
166
|
|
|
167
167
|
return {
|
|
168
168
|
referenceDate,
|
|
169
|
-
startDate: this.initialStartDate || '',
|
|
170
|
-
endDate: this.initialEndDate || '',
|
|
169
|
+
startDate: this.initialStartDate.replace(/-/g, ' ') || '',
|
|
170
|
+
endDate: this.initialEndDate.replace(/-/g, ' ') || '',
|
|
171
171
|
optionSelected: '',
|
|
172
172
|
};
|
|
173
173
|
},
|
|
@@ -198,7 +198,7 @@ export default {
|
|
|
198
198
|
|
|
199
199
|
methods: {
|
|
200
200
|
dateToString(date) {
|
|
201
|
-
return `${date.getMonth() + 1}
|
|
201
|
+
return `${date.getMonth() + 1} ${date.getDate()} ${date.getFullYear()}`;
|
|
202
202
|
},
|
|
203
203
|
|
|
204
204
|
stringToTime(date) {
|
|
@@ -206,7 +206,7 @@ export default {
|
|
|
206
206
|
},
|
|
207
207
|
|
|
208
208
|
getDate(date) {
|
|
209
|
-
return new Date(date).getDate();
|
|
209
|
+
return new Date(date.toString()).getDate();
|
|
210
210
|
},
|
|
211
211
|
|
|
212
212
|
getMonth(date) {
|
|
@@ -353,7 +353,7 @@ export default {
|
|
|
353
353
|
|
|
354
354
|
if (this.endDate) {
|
|
355
355
|
const secondMonth = this.addMonth(this.referenceDate, 1);
|
|
356
|
-
const firstDateOfEndDate = `${this.getMonth(this.endDate) + 1}
|
|
356
|
+
const firstDateOfEndDate = `${this.getMonth(this.endDate) + 1} 1 ${this.getFullYear(this.endDate)}`;
|
|
357
357
|
|
|
358
358
|
if (![this.referenceDate, secondMonth].includes(firstDateOfEndDate)) {
|
|
359
359
|
this.referenceDate = firstDateOfEndDate;
|
package/src/components/Flag.vue
CHANGED
package/src/components/Icon.vue
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<span
|
|
3
|
+
@click="onClick"
|
|
4
|
+
:class="[
|
|
5
|
+
'unnnic-icon',
|
|
6
|
+
`unnnic-icon__size--${size}`,
|
|
7
|
+
clickable ? 'unnnic--clickable' : '',
|
|
8
|
+
lineHeight ? `unnnic-icon__line-height--${lineHeight}` : '',
|
|
9
|
+
scheme ? `unnnic-icon-scheme--${scheme}` : '',
|
|
10
|
+
]"
|
|
11
|
+
v-html="svg" />
|
|
9
12
|
</template>
|
|
10
13
|
|
|
11
14
|
<script>
|
|
15
|
+
import icons from '../utils/icons';
|
|
16
|
+
|
|
12
17
|
export default {
|
|
13
18
|
name: 'uIcon',
|
|
14
19
|
props: {
|
|
@@ -24,17 +29,25 @@ export default {
|
|
|
24
29
|
type: String,
|
|
25
30
|
default: 'md',
|
|
26
31
|
validator(value) {
|
|
27
|
-
if (!value) return true;
|
|
28
32
|
return ['nano', 'xs', 'sm', 'ant', 'md', 'lg', 'xl'].indexOf(value) !== -1;
|
|
29
33
|
},
|
|
30
34
|
},
|
|
35
|
+
lineHeight: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: null,
|
|
38
|
+
validator(value) {
|
|
39
|
+
return !value || ['sm', 'md', 'lg'].indexOf(value) !== -1;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
31
42
|
scheme: {
|
|
32
43
|
type: String,
|
|
33
44
|
default: '',
|
|
34
45
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
},
|
|
47
|
+
mounted() {},
|
|
48
|
+
computed: {
|
|
49
|
+
svg() {
|
|
50
|
+
return icons[this.icon];
|
|
38
51
|
},
|
|
39
52
|
},
|
|
40
53
|
methods: {
|
|
@@ -46,71 +59,89 @@ export default {
|
|
|
46
59
|
};
|
|
47
60
|
</script>
|
|
48
61
|
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
@import "../assets/scss/unnnic.scss";
|
|
64
|
+
|
|
65
|
+
.unnnic-icon ::v-deep svg {
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
left: 0;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
71
|
+
|
|
49
72
|
<style lang="scss">
|
|
50
|
-
@import
|
|
51
|
-
@import '../assets/fonts/icons.css';
|
|
73
|
+
@import "../assets/scss/unnnic.scss";
|
|
52
74
|
|
|
53
|
-
$scheme-colors:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
$scheme-colors: "feedback-red" $unnnic-color-feedback-red,
|
|
76
|
+
"feedback-green" $unnnic-color-feedback-green, "feedback-yellow" $unnnic-color-feedback-yellow,
|
|
77
|
+
"feedback-blue" $unnnic-color-feedback-blue, "feedback-grey" $unnnic-color-feedback-grey,
|
|
78
|
+
"aux-blue" $unnnic-color-aux-blue, "aux-purple" $unnnic-color-aux-purple,
|
|
79
|
+
"aux-orange" $unnnic-color-aux-orange, "aux-lemon" $unnnic-color-aux-lemon,
|
|
80
|
+
"aux-pink" $unnnic-color-aux-pink,
|
|
81
|
+
"brand-weni" $unnnic-color-brand-weni,
|
|
82
|
+
"brand-weni-soft" $unnnic-color-brand-weni-soft,
|
|
83
|
+
"brand-weni-dark" $unnnic-color-brand-weni-dark,
|
|
84
|
+
"brand-sec" $unnnic-color-brand-sec,
|
|
85
|
+
"neutral-clean" $unnnic-color-neutral-clean,
|
|
86
|
+
"neutral-cleanest" $unnnic-color-neutral-cleanest,
|
|
87
|
+
"neutral-dark" $unnnic-color-neutral-dark,
|
|
88
|
+
"neutral-soft" $unnnic-color-neutral-soft,
|
|
89
|
+
"neutral-darkest" $unnnic-color-neutral-darkest,
|
|
90
|
+
"neutral-cloudy" $unnnic-color-neutral-cloudy,
|
|
91
|
+
"neutral-snow" $unnnic-color-neutral-snow,
|
|
92
|
+
"background-snow" $unnnic-color-background-snow;
|
|
65
93
|
|
|
66
94
|
@each $name, $color in $scheme-colors {
|
|
67
95
|
.unnnic-icon-scheme {
|
|
68
96
|
&--#{$name} {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
&--icon {
|
|
72
|
-
color: $color;
|
|
97
|
+
& .primary {
|
|
98
|
+
fill: $color;
|
|
73
99
|
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.unnnic-icon-background-scheme {
|
|
78
|
-
&--#{$name} {
|
|
79
|
-
background-color: rgba($color, $unnnic-opacity-level-extra-light);
|
|
80
|
-
border-radius: $unnnic-border-radius-sm;
|
|
81
|
-
padding: $unnnic-inset-nano;
|
|
82
|
-
}
|
|
83
100
|
|
|
84
|
-
|
|
85
|
-
|
|
101
|
+
& .primary-stroke {
|
|
102
|
+
stroke: $color;
|
|
103
|
+
}
|
|
86
104
|
}
|
|
87
105
|
}
|
|
88
106
|
}
|
|
89
107
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
108
|
+
$icon-sizes:
|
|
109
|
+
'xl' $unnnic-icon-size-xl,
|
|
110
|
+
'lg' $unnnic-icon-size-lg,
|
|
111
|
+
'md' $unnnic-icon-size-md,
|
|
112
|
+
'ant' $unnnic-icon-size-ant,
|
|
113
|
+
'sm' $unnnic-icon-size-sm,
|
|
114
|
+
'xs' $unnnic-icon-size-xs;
|
|
98
115
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
116
|
+
$line-heights:
|
|
117
|
+
'sm' $unnnic-line-height-small,
|
|
118
|
+
'md' $unnnic-line-height-medium,
|
|
119
|
+
'lg' $unnnic-line-height-large;
|
|
102
120
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
121
|
+
.unnnic-icon {
|
|
122
|
+
position: relative;
|
|
123
|
+
display: inline-block;
|
|
124
|
+
vertical-align: middle;
|
|
106
125
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
126
|
+
@each $name, $size in $icon-sizes {
|
|
127
|
+
&__size--#{$name} {
|
|
128
|
+
width: $size;
|
|
129
|
+
height: $size;
|
|
130
|
+
min-width: $size;
|
|
131
|
+
min-height: $size;
|
|
110
132
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
133
|
+
@each $line-name, $line-size in $line-heights {
|
|
134
|
+
&.unnnic-icon__line-height--#{$line-name} svg {
|
|
135
|
+
position: relative;
|
|
136
|
+
top: (($size + $line-size) - ($size*1.2))/1.2;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
115
141
|
|
|
142
|
+
svg {
|
|
143
|
+
width: 100%;
|
|
144
|
+
height: 100%;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
116
147
|
</style>
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="unnnic-text-editor">
|
|
3
|
+
<div
|
|
4
|
+
class="text-editor"
|
|
5
|
+
contenteditable="true"
|
|
6
|
+
ref="oDoc"
|
|
7
|
+
v-html="initialContent"
|
|
8
|
+
@input="onInput"
|
|
9
|
+
></div>
|
|
10
|
+
|
|
11
|
+
<div class="actions">
|
|
12
|
+
<unnnic-button-icon
|
|
13
|
+
@click="$emit('action')"
|
|
14
|
+
type="secondary"
|
|
15
|
+
size="small"
|
|
16
|
+
icon="flash-1-3"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<unnnic-button-icon
|
|
20
|
+
@click="$emit('send')"
|
|
21
|
+
type="primary"
|
|
22
|
+
size="small"
|
|
23
|
+
icon="send-email-3-1"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="format">
|
|
28
|
+
<unnnic-icon
|
|
29
|
+
icon="arrow-undo"
|
|
30
|
+
size="ant"
|
|
31
|
+
clickable
|
|
32
|
+
scheme="neutral-cleanest"
|
|
33
|
+
@click="formatDoc('undo')"
|
|
34
|
+
/>
|
|
35
|
+
<unnnic-icon
|
|
36
|
+
icon="arrow-redo"
|
|
37
|
+
size="ant"
|
|
38
|
+
clickable
|
|
39
|
+
scheme="neutral-cleanest"
|
|
40
|
+
@click="formatDoc('redo')"
|
|
41
|
+
/>
|
|
42
|
+
<!-- <unnnic-icon
|
|
43
|
+
icon="email-action-unread-1"
|
|
44
|
+
size="ant"
|
|
45
|
+
clickable
|
|
46
|
+
scheme="neutral-cleanest"
|
|
47
|
+
/> -->
|
|
48
|
+
<unnnic-icon
|
|
49
|
+
:style="{ marginLeft: '1rem', }"
|
|
50
|
+
icon="text-bold"
|
|
51
|
+
size="ant"
|
|
52
|
+
clickable
|
|
53
|
+
scheme="neutral-cleanest"
|
|
54
|
+
@click="formatDoc('bold')"
|
|
55
|
+
/>
|
|
56
|
+
<unnnic-icon
|
|
57
|
+
icon="text-italic"
|
|
58
|
+
size="ant"
|
|
59
|
+
clickable
|
|
60
|
+
scheme="neutral-cleanest"
|
|
61
|
+
@click="formatDoc('italic')"
|
|
62
|
+
/>
|
|
63
|
+
<unnnic-icon
|
|
64
|
+
icon="text-underline"
|
|
65
|
+
size="ant"
|
|
66
|
+
clickable
|
|
67
|
+
scheme="neutral-cleanest"
|
|
68
|
+
@click="formatDoc('underline')"
|
|
69
|
+
/>
|
|
70
|
+
<unnnic-icon
|
|
71
|
+
icon="unordered-list"
|
|
72
|
+
size="ant"
|
|
73
|
+
clickable
|
|
74
|
+
scheme="neutral-cleanest"
|
|
75
|
+
@click="formatDoc('insertunorderedlist')"
|
|
76
|
+
/>
|
|
77
|
+
<unnnic-icon
|
|
78
|
+
icon="text-left"
|
|
79
|
+
size="ant"
|
|
80
|
+
clickable
|
|
81
|
+
scheme="neutral-cleanest"
|
|
82
|
+
@click="formatDoc('justifyleft')"
|
|
83
|
+
/>
|
|
84
|
+
<unnnic-icon
|
|
85
|
+
icon="text-center"
|
|
86
|
+
size="ant"
|
|
87
|
+
clickable
|
|
88
|
+
scheme="neutral-cleanest"
|
|
89
|
+
@click="formatDoc('justifycenter')"
|
|
90
|
+
/>
|
|
91
|
+
<unnnic-icon
|
|
92
|
+
icon="text-right"
|
|
93
|
+
size="ant"
|
|
94
|
+
clickable
|
|
95
|
+
scheme="neutral-cleanest"
|
|
96
|
+
@click="formatDoc('justifyright')"
|
|
97
|
+
/>
|
|
98
|
+
<unnnic-icon
|
|
99
|
+
icon="text-justified"
|
|
100
|
+
size="ant"
|
|
101
|
+
clickable
|
|
102
|
+
scheme="neutral-cleanest"
|
|
103
|
+
@click="formatDoc('justifyFull')"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
|
|
109
|
+
<script>
|
|
110
|
+
import UnnnicButtonIcon from '../Button/ButtonIcon.vue';
|
|
111
|
+
import UnnnicIcon from '../Icon.vue';
|
|
112
|
+
|
|
113
|
+
export default {
|
|
114
|
+
components: {
|
|
115
|
+
UnnnicButtonIcon,
|
|
116
|
+
UnnnicIcon,
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
props: {
|
|
120
|
+
value: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: '',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
data() {
|
|
127
|
+
return {
|
|
128
|
+
initialContent: '',
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
created() {
|
|
133
|
+
this.initialContent = this.value;
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
methods: {
|
|
137
|
+
formatDoc(sCmd, sValue) {
|
|
138
|
+
this.$refs.oDoc.focus();
|
|
139
|
+
document.execCommand(sCmd, false, sValue);
|
|
140
|
+
this.$refs.oDoc.focus();
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
validateMode() {
|
|
144
|
+
return this.$refs.oDoc.focus();
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
onInput(event) {
|
|
148
|
+
this.$emit('input', event.srcElement.innerHTML);
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<style lang="scss" scoped>
|
|
155
|
+
@import "../../assets/scss/unnnic.scss";
|
|
156
|
+
|
|
157
|
+
.unnnic-text-editor {
|
|
158
|
+
display: grid;
|
|
159
|
+
grid-template-areas:
|
|
160
|
+
"text-editor actions"
|
|
161
|
+
"format empty";
|
|
162
|
+
grid-template-columns: 1fr auto;
|
|
163
|
+
grid-column-gap: $unnnic-spacing-inline-xs;
|
|
164
|
+
|
|
165
|
+
.text-editor {
|
|
166
|
+
grid-area: text-editor;
|
|
167
|
+
height: 7.25rem;
|
|
168
|
+
box-sizing: border-box;
|
|
169
|
+
overflow: auto;
|
|
170
|
+
background-color: $unnnic-color-neutral-snow;
|
|
171
|
+
border-radius: $unnnic-border-radius-sm;
|
|
172
|
+
padding: $unnnic-spacing-inset-sm;
|
|
173
|
+
border: $unnnic-border-width-thinner solid $unnnic-color-neutral-clean;
|
|
174
|
+
outline: none;
|
|
175
|
+
color: $unnnic-color-neutral-cloudy;
|
|
176
|
+
font-family: $unnnic-font-family-secondary;
|
|
177
|
+
font-size: $unnnic-font-size-body-gt;
|
|
178
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
|
|
179
|
+
font-weight: $unnnic-font-weight-regular;
|
|
180
|
+
|
|
181
|
+
p {
|
|
182
|
+
margin: 0;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.actions {
|
|
187
|
+
grid-area: actions;
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
gap: $unnnic-spacing-stack-xs;
|
|
191
|
+
place-self: center;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.format {
|
|
195
|
+
grid-area: format;
|
|
196
|
+
place-self: center;
|
|
197
|
+
padding: $unnnic-spacing-inset-nano;
|
|
198
|
+
user-select: none;
|
|
199
|
+
display: flex;
|
|
200
|
+
gap: $unnnic-spacing-inline-xs;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
</style>
|
package/src/components/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import dropdown from './Dropdown/Dropdown.vue';
|
|
|
12
12
|
import dropdownItem from './Dropdown/DropdownItem.vue';
|
|
13
13
|
import avatarIcon from './AvatarIcon/AvatarIcon.vue';
|
|
14
14
|
import icon from './Icon.vue';
|
|
15
|
-
import iconSvg from './Icon-svg.vue';
|
|
16
15
|
import toolTip from './ToolTip/ToolTip.vue';
|
|
17
16
|
import card from './Card/Card.vue';
|
|
18
17
|
import cardCompany from './Card/CardCompany.vue';
|
|
@@ -51,6 +50,7 @@ import ChatText from './ChatText/ChatText.vue';
|
|
|
51
50
|
import TextArea from './TextArea/TextArea.vue';
|
|
52
51
|
import CardNumber from './CardNumber/CardNumber.vue';
|
|
53
52
|
import chartRainbow from './ChartRainbow/ChartRainbow.vue';
|
|
53
|
+
import textEditor from './TextEditor/TextEditor.vue';
|
|
54
54
|
|
|
55
55
|
const components = {
|
|
56
56
|
unnnicInput: input,
|
|
@@ -64,7 +64,7 @@ const components = {
|
|
|
64
64
|
unnnicTableRow: tableRow,
|
|
65
65
|
unnnicAvatarIcon: avatarIcon,
|
|
66
66
|
unnnicIcon: icon,
|
|
67
|
-
unnnicIconSvg:
|
|
67
|
+
unnnicIconSvg: icon,
|
|
68
68
|
unnnicDropdown: dropdown,
|
|
69
69
|
unnnicDropdownItem: dropdownItem,
|
|
70
70
|
unnnicToolTip: toolTip,
|
|
@@ -104,6 +104,7 @@ const components = {
|
|
|
104
104
|
unnnicTextArea: TextArea,
|
|
105
105
|
unnnicCardNumber: CardNumber,
|
|
106
106
|
unnnicChartRainbow: chartRainbow,
|
|
107
|
+
unnnicTextEditor: textEditor,
|
|
107
108
|
};
|
|
108
109
|
|
|
109
110
|
Object.keys(components).forEach((name) => {
|
|
@@ -123,7 +124,7 @@ export const unnnicDropdown = dropdown;
|
|
|
123
124
|
export const unnnicDropdownItem = dropdownItem;
|
|
124
125
|
export const unnnicAvatarIcon = avatarIcon;
|
|
125
126
|
export const unnnicIcon = icon;
|
|
126
|
-
export const unnnicIconSvg =
|
|
127
|
+
export const unnnicIconSvg = icon;
|
|
127
128
|
export const unnnicToolTip = toolTip;
|
|
128
129
|
export const unnnicCard = card;
|
|
129
130
|
export const unnnicCardCompany = cardCompany;
|
|
@@ -163,3 +164,4 @@ export const unnnicChatText = ChatText;
|
|
|
163
164
|
export const unnnicTextArea = TextArea;
|
|
164
165
|
export const unnnicCardNumber = CardNumber;
|
|
165
166
|
export const unnnicChartRainbow = chartRainbow;
|
|
167
|
+
export const unnnicTextEditor = textEditor;
|
package/src/locales/en.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"upload_area": {
|
|
3
|
-
"title": {
|
|
4
|
-
"text": "Drag your file here or",
|
|
5
|
-
"highlight": "search it"
|
|
6
|
-
},
|
|
7
|
-
"invalid": {
|
|
8
|
-
"subtitle": "File not supported, select supported formats:"
|
|
9
|
-
},
|
|
10
|
-
"subtitle": "Supported formats:"
|
|
11
|
-
},
|
|
12
|
-
"import_card": {
|
|
13
|
-
"importing": "Importing"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"upload_area": {
|
|
3
|
+
"title": {
|
|
4
|
+
"text": "Drag your file here or",
|
|
5
|
+
"highlight": "search it"
|
|
6
|
+
},
|
|
7
|
+
"invalid": {
|
|
8
|
+
"subtitle": "File not supported, select supported formats:"
|
|
9
|
+
},
|
|
10
|
+
"subtitle": "Supported formats:"
|
|
11
|
+
},
|
|
12
|
+
"import_card": {
|
|
13
|
+
"importing": "Importing"
|
|
14
|
+
}
|
|
15
|
+
}
|