@intellias/menu 1.0.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.
Files changed (174) hide show
  1. package/Menu.ts +625 -0
  2. package/README.md +121 -0
  3. package/assets/icons/arrow-down.svg +13 -0
  4. package/assets/icons/arrow-left.svg +3 -0
  5. package/assets/icons/arrow-submenu.svg +8 -0
  6. package/assets/icons/close.svg +3 -0
  7. package/assets/icons/delete.svg +13 -0
  8. package/assets/icons/faq-new.svg +4 -0
  9. package/assets/icons/kudos.svg +14 -0
  10. package/assets/icons/loading-spinner.svg +40 -0
  11. package/assets/icons/notification.svg +11 -0
  12. package/assets/icons/notifications/assessment.svg +10 -0
  13. package/assets/icons/notifications/buddy_program.svg +8 -0
  14. package/assets/icons/notifications/compensation_packages.svg +10 -0
  15. package/assets/icons/notifications/dsat.svg +8 -0
  16. package/assets/icons/notifications/feedback.svg +7 -0
  17. package/assets/icons/notifications/kudos.svg +4 -0
  18. package/assets/icons/notifications/overtime_requests.svg +15 -0
  19. package/assets/icons/notifications/pdu_program.svg +4 -0
  20. package/assets/icons/notifications/profile_update.svg +6 -0
  21. package/assets/icons/notifications/recommendation_program.svg +7 -0
  22. package/assets/icons/notifications/reminders.svg +4 -0
  23. package/assets/icons/notifications/sick_leaves.svg +5 -0
  24. package/assets/icons/notifications/smarts.svg +4 -0
  25. package/assets/icons/notifications/survey.svg +8 -0
  26. package/assets/icons/notifications/unpaid_leave.svg +4 -0
  27. package/assets/icons/notifications/vacations.svg +4 -0
  28. package/assets/icons/pause.svg +13 -0
  29. package/assets/icons/play.svg +13 -0
  30. package/assets/icons/smart.svg +14 -0
  31. package/assets/icons/smarts-kudos.svg +11 -0
  32. package/assets/icons/spinner-solid.svg +1 -0
  33. package/assets/icons/vacation.svg +14 -0
  34. package/assets/icons/visibility.svg +1 -0
  35. package/assets/intems-logo.svg +3 -0
  36. package/babel.config.js +6 -0
  37. package/buses/eventBus.ts +19 -0
  38. package/buses/events/GiveKudosEvent.ts +7 -0
  39. package/components/buttons/action-button/ActionButton.scss +133 -0
  40. package/components/buttons/action-button/ActionButton.ts +57 -0
  41. package/components/buttons/action-button/ActionButton.vue +50 -0
  42. package/components/buttons/secondary-button/SecondaryButton.scss +48 -0
  43. package/components/buttons/secondary-button/SecondaryButton.ts +28 -0
  44. package/components/buttons/secondary-button/SecondaryButton.vue +27 -0
  45. package/components/confirm/Confirm.scss +44 -0
  46. package/components/confirm/Confirm.ts +82 -0
  47. package/components/confirm/Confirm.vue +64 -0
  48. package/components/give-kudos-form/GiveKudosForm.scss +114 -0
  49. package/components/give-kudos-form/GiveKudosForm.ts +159 -0
  50. package/components/give-kudos-form/GiveKudosForm.vue +131 -0
  51. package/components/give-kudos-form/mixins/UserSelectMixin.ts +57 -0
  52. package/components/give-kudos-form/models/KudosShareModel.ts +6 -0
  53. package/components/give-kudos-form/models/UserListModel.ts +5 -0
  54. package/components/give-kudos-form/validators/InEnglishValidatorRegex.ts +17 -0
  55. package/components/give-kudos-form/validators/KudosBalance.ts +10 -0
  56. package/components/modal/Modal.scss +53 -0
  57. package/components/modal/Modal.ts +70 -0
  58. package/components/modal/Modal.vue +28 -0
  59. package/components/notifications-sidebar/NotificationsSidebar.scss +665 -0
  60. package/components/notifications-sidebar/NotificationsSidebar.ts +203 -0
  61. package/components/notifications-sidebar/NotificationsSidebar.vue +171 -0
  62. package/components/notifications-sidebar/models/BroadcastNotificationPayload.ts +8 -0
  63. package/components/notifications-sidebar/models/TotalCounter.ts +50 -0
  64. package/components/notifications-sidebar/notification/Notification.ts +17 -0
  65. package/components/notifications-sidebar/notification/Notification.vue +87 -0
  66. package/components/play-pause/PlayPause.scss +33 -0
  67. package/components/play-pause/PlayPause.ts +156 -0
  68. package/components/play-pause/PlayPause.vue +36 -0
  69. package/components/play-pause/PlayPauseStatus.ts +4 -0
  70. package/components/play-pause/helpers/LatestTrackedTimeDurationHelper.ts +55 -0
  71. package/components/play-pause/helpers/PauseHelper.ts +55 -0
  72. package/components/play-pause/helpers/TrackedTimeHelper.ts +80 -0
  73. package/components/preloader/Preloader.vue +34 -0
  74. package/components/request-loader/RequestLoader.scss +20 -0
  75. package/components/request-loader/RequestLoader.ts +80 -0
  76. package/components/request-loader/RequestLoader.vue +15 -0
  77. package/components/sub-menu/SubMenu.scss +33 -0
  78. package/components/sub-menu/SubMenu.ts +38 -0
  79. package/components/sub-menu/SubMenu.vue +21 -0
  80. package/components/time-ago/TimeAgo.ts +34 -0
  81. package/components/time-ago/TimeAgo.vue +9 -0
  82. package/components/user-picture/UserPicture.scss +62 -0
  83. package/components/user-picture/UserPicture.ts +105 -0
  84. package/components/user-picture/UserPicture.vue +23 -0
  85. package/components/v-select-intems/VSelectIntems.ts +112 -0
  86. package/components/v-select-intems/VSelectIntems.vue +68 -0
  87. package/components/v-select-intems/open-indicator/OpenIndicator.vue +3 -0
  88. package/dist/css/1.css +85 -0
  89. package/dist/css/2.css +34 -0
  90. package/dist/css/3.css +34 -0
  91. package/dist/css/4.css +34 -0
  92. package/dist/css/5.css +34 -0
  93. package/dist/css/main.css +1564 -0
  94. package/dist/html/app.html +19 -0
  95. package/dist/html/styles.html +1 -0
  96. package/dist/images/intems-logo.svg +3 -0
  97. package/dist/js/0.js +315 -0
  98. package/dist/js/1.js +313 -0
  99. package/dist/js/2.js +217 -0
  100. package/dist/js/3.js +181 -0
  101. package/dist/js/4.js +181 -0
  102. package/dist/js/5.js +181 -0
  103. package/dist/js/6.js +47 -0
  104. package/dist/js/main.js +7465 -0
  105. package/dist/js/vue.js +15 -0
  106. package/helpers/GeneralHelper.ts +61 -0
  107. package/helpers/PublisherSubscriber.ts +34 -0
  108. package/helpers/QueryFilter.ts +204 -0
  109. package/helpers/TimeHelper.ts +54 -0
  110. package/helpers/Validations.ts +7 -0
  111. package/helpers/model/ModelHelper.ts +155 -0
  112. package/helpers/model/decorators/AsCollection.ts +26 -0
  113. package/helpers/model/decorators/AsModel.ts +25 -0
  114. package/helpers/model/decorators/DateTime.ts +26 -0
  115. package/helpers/model/decorators/TimeDuration.ts +33 -0
  116. package/helpers/moment/Duration.ts +64 -0
  117. package/helpers/moment/Moment.ts +17 -0
  118. package/helpers/moment/index.d.ts +20 -0
  119. package/helpers/response/AxiosProxy.ts +72 -0
  120. package/helpers/response/ErrorsToToastHelper.ts +42 -0
  121. package/helpers/response/ResponseCode.ts +16 -0
  122. package/helpers/response/ResponseHelper.ts +42 -0
  123. package/helpers/response/ResponseInterface.ts +34 -0
  124. package/helpers/response/ResponseState.ts +6 -0
  125. package/jsconfig.json +19 -0
  126. package/mixins/IntemsMath.ts +29 -0
  127. package/mixins/notifications/ActionProcessing.ts +134 -0
  128. package/mixins/notifications/confirms/AssetRejectionConfirm.vue +59 -0
  129. package/mixins/notifications/confirms/SickLeaveRejectionConfirm.vue +31 -0
  130. package/mixins/notifications/confirms/UnpaidLeaveRejectionConfirm.vue +31 -0
  131. package/mixins/notifications/confirms/VacationRejectionConfirm.vue +31 -0
  132. package/models/AssetModel.ts +80 -0
  133. package/models/AssetRequestModel.ts +25 -0
  134. package/models/ConfigModel.ts +20 -0
  135. package/models/EmployeeStartEndDateModel.ts +16 -0
  136. package/models/EmploymentTypeModel.ts +95 -0
  137. package/models/LogoutModel.ts +3 -0
  138. package/models/Model.ts +12 -0
  139. package/models/ModuleOptions.ts +24 -0
  140. package/models/PublicInfoModel.ts +38 -0
  141. package/models/PublicLocationModel.ts +36 -0
  142. package/models/StatusModel.ts +8 -0
  143. package/models/TrackedTimeModel.ts +32 -0
  144. package/models/location/PublicLocationModel.ts +36 -0
  145. package/models/timezones/LocalTimezoneHistoryModel.ts +8 -0
  146. package/models/timezones/TimezoneModel.ts +9 -0
  147. package/models/user/ExtendedInfoModel.ts +37 -0
  148. package/models/user/NotificationActionModel.ts +53 -0
  149. package/models/user/NotificationModel.ts +84 -0
  150. package/models/user/PublicInfoModel.ts +38 -0
  151. package/models/user/WelcomeProgram.ts +4 -0
  152. package/package.json +117 -0
  153. package/repositories/BaseRepository.ts +42 -0
  154. package/repositories/BaseUrl.ts +107 -0
  155. package/repositories/Repository.ts +291 -0
  156. package/repositories/ResourceRepository.ts +99 -0
  157. package/repositories/TrackedTimeRepository.ts +43 -0
  158. package/repositories/UserRepository.ts +75 -0
  159. package/repositories/subscribers/CreateSubscribers.ts +28 -0
  160. package/repositories/subscribers/DefaultSubscribers.ts +82 -0
  161. package/repositories/subscribers/DeleteSubscribers.ts +28 -0
  162. package/repositories/subscribers/DownloadSubscribers.ts +28 -0
  163. package/repositories/subscribers/Subscribers.ts +13 -0
  164. package/repositories/subscribers/UpdateSubscribers.ts +32 -0
  165. package/scss/components/_global.scss +66 -0
  166. package/scss/components/_mixins.scss +31 -0
  167. package/scss/components/_tooltip.scss +45 -0
  168. package/scss/components/_utils.scss +26 -0
  169. package/scss/components/_variables.scss +103 -0
  170. package/scss/main.scss +7 -0
  171. package/shims-vue.d.ts +9 -0
  172. package/tsconfig.json +31 -0
  173. package/webpack.config.js +126 -0
  174. package/wrapper.ts +51 -0
@@ -0,0 +1,133 @@
1
+ @use "sass:map";
2
+ @import "../../../scss/components/utils";
3
+ @import "../../../scss/components/variables";
4
+
5
+ .action-button {
6
+ position: relative;
7
+ text-overflow: ellipsis;
8
+ overflow: hidden;
9
+ white-space: nowrap;
10
+ min-width: fit-content;
11
+ color: map.get($intems-colors, "text-on-color");
12
+ background: map.get($intems-colors, "primary");
13
+ text-transform: initial;
14
+ border-radius: 4px;
15
+ font-weight: 600;
16
+
17
+ &:hover {
18
+ background: map.get($intems-colors, "primary-hover");
19
+ }
20
+
21
+ &.btn-full {
22
+ @media #{$small-and-down} {
23
+ width: 100%;
24
+ }
25
+ }
26
+
27
+ &.is-btn-link {
28
+ @extend %clear-default-button-styles !optional;
29
+ color: map.get($intems-colors, "primary-hover");
30
+ background: transparent !important;
31
+
32
+ &:hover,
33
+ &:active {
34
+ .span-text {
35
+ text-decoration: underline;
36
+ }
37
+ }
38
+
39
+ &:disabled,
40
+ &.disabled {
41
+ pointer-events: none;
42
+ color: map.get($intems-colors, "text-disable") !important;
43
+ }
44
+ }
45
+
46
+ &.is-link {
47
+ color: map.get($intems-colors, "primary-hover");
48
+ background: transparent !important;
49
+
50
+ &:hover,
51
+ &:active {
52
+ text-decoration: underline;
53
+ }
54
+
55
+ &:disabled,
56
+ &.disabled {
57
+ pointer-events: none;
58
+ color: map.get($intems-colors, "text-disable") !important;
59
+ }
60
+ }
61
+
62
+ &.btn-transparent {
63
+ background: transparent;
64
+ color: map.get($intems-colors, "primary-hover");
65
+
66
+ &:hover,
67
+ &:focus {
68
+ background: map.get($intems-colors, "hover");
69
+ }
70
+
71
+ &:disabled {
72
+ color: map.get($intems-colors, "text-disable");
73
+ background: transparent !important;
74
+ }
75
+ }
76
+
77
+ .left-icon {
78
+ margin-right: 4px;
79
+ }
80
+
81
+ .spinner-solid {
82
+ color: map.get($intems-colors, "text-on-color");
83
+ animation: spin 2s linear infinite;
84
+ vertical-align: middle;
85
+ transition: width 300ms, height 300ms;
86
+ margin-left: 8px;
87
+ }
88
+
89
+ .span-text {
90
+ vertical-align: middle;
91
+ }
92
+
93
+ span.tooltipped {
94
+ width: 100%;
95
+ height: 100%;
96
+ display: inline-block;
97
+ position: absolute;
98
+ cursor: pointer;
99
+ pointer-events: all;
100
+ }
101
+
102
+ &button {
103
+ span.tooltipped {
104
+ margin-left: -16px;
105
+ }
106
+ }
107
+
108
+ &.btn-secondary {
109
+ border: 1px solid map.get($intems-colors, "border");
110
+ background-color: map.get($intems-colors, "surface-primary");
111
+ }
112
+
113
+ &.disabled:not(a),
114
+ &:not(a, .is-btn-link):disabled,
115
+ &[disabled]:not(a, .is-btn-link) {
116
+ background-color: map.get($intems-colors, "disable") !important;
117
+ color: map.get($intems-colors, "text-disable") !important;
118
+
119
+ .spinner-solid {
120
+ color: map.get($intems-colors, "text-tertiary") !important;
121
+ }
122
+ }
123
+
124
+ i.icon {
125
+ vertical-align: middle;
126
+ }
127
+ }
128
+
129
+ @keyframes spin {
130
+ 100% {
131
+ transform: rotate(360deg);
132
+ }
133
+ }
@@ -0,0 +1,57 @@
1
+ import VueRouter from "vue-router";
2
+
3
+ export default {
4
+ name: "ActionButton",
5
+ props: {
6
+ isDisabled: {
7
+ type: Boolean,
8
+ default: false,
9
+ },
10
+ isLoading: {
11
+ type: Boolean,
12
+ default: false,
13
+ },
14
+ mini: {
15
+ type: Boolean,
16
+ default: false,
17
+ },
18
+ large: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
22
+ href: {
23
+ type: String,
24
+ default: "",
25
+ },
26
+ tooltip: {
27
+ type: String,
28
+ default: "",
29
+ },
30
+ to: undefined as VueRouter,
31
+ isLink: {
32
+ type: Boolean,
33
+ default: false,
34
+ },
35
+ iconLeft: {
36
+ type: String,
37
+ default: "",
38
+ },
39
+ iconRight: {
40
+ type: String,
41
+ default: "",
42
+ },
43
+ transparent: {
44
+ type: Boolean,
45
+ default: false,
46
+ },
47
+ btnLink: {
48
+ type: Boolean,
49
+ default: false,
50
+ },
51
+ },
52
+ computed: {
53
+ toHref(): VueRouter {
54
+ return this.href instanceof VueRouter ? this.href : null;
55
+ },
56
+ },
57
+ };
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <router-link
3
+ class="action-button"
4
+ :class="{ 'btn-mini': mini, btn: !isLink, 'is-link': isLink }"
5
+ v-if="to"
6
+ :to="to"
7
+ >
8
+ <i v-if="iconLeft" class="left-icon icon icon-small" :class="iconLeft"></i>
9
+ <slot></slot>
10
+ </router-link>
11
+ <a
12
+ v-else-if="href || isLink"
13
+ class="action-button pointer"
14
+ :class="{ 'btn-mini': mini, disabled: isDisabled, 'is-link': isLink }"
15
+ :href="!isDisabled && href !== '#' ? href : null"
16
+ >
17
+ <span v-if="tooltip" class="tooltipped" v-tooltip.bottom="tooltip"></span>
18
+ <i v-if="iconLeft" class="left-icon icon icon-small" :class="iconLeft"></i>
19
+ <slot></slot>
20
+ </a>
21
+ <button
22
+ type="button"
23
+ class="action-button"
24
+ :class="{
25
+ 'btn-mini': mini,
26
+ 'btn-large': large,
27
+ btn: !isLink,
28
+ 'btn-transparent': transparent,
29
+ 'is-btn-link': btnLink,
30
+ 'waves-effect': !btnLink,
31
+ }"
32
+ :disabled="isDisabled"
33
+ v-else
34
+ >
35
+ <i v-if="iconLeft" class="left-icon icon icon-small" :class="iconLeft"></i>
36
+ <span v-if="tooltip" class="tooltipped" v-tooltip.bottom="tooltip"></span>
37
+ <span class="span-text"><slot>Click me</slot></span>
38
+ <i v-show="isLoading" class="icon icon-small spinner-solid loading"></i>
39
+ </button>
40
+ </template>
41
+
42
+ <script>
43
+ import ActionButton from "./ActionButton";
44
+
45
+ export default ActionButton;
46
+ </script>
47
+
48
+ <style lang="scss">
49
+ @import "ActionButton.scss";
50
+ </style>
@@ -0,0 +1,48 @@
1
+ @use "sass:map";
2
+ @import "../../../scss/components/utils";
3
+ @import "../../../scss/components/variables";
4
+
5
+ .secondary-button {
6
+ position: relative;
7
+ text-overflow: ellipsis;
8
+ overflow: hidden;
9
+ white-space: nowrap;
10
+ color: map.get($intems-colors, "text-primary");
11
+ text-transform: initial;
12
+ border-radius: 4px;
13
+ font-weight: 600;
14
+ line-height: 38px;
15
+
16
+ i.icon {
17
+ vertical-align: middle;
18
+ }
19
+
20
+ .spinner-solid {
21
+ color: map.get($intems-colors, "text-primary");
22
+ animation: spin 2s linear infinite;
23
+ vertical-align: middle;
24
+ transition: width 300ms, height 300ms;
25
+ margin-left: 8px;
26
+ }
27
+
28
+ .left-icon {
29
+ margin-right: 4px;
30
+ }
31
+
32
+ &.disabled,
33
+ &.btn-secondary:disabled,
34
+ &.btn[disabled] {
35
+ background-color: map.get($intems-colors, "disable") !important;
36
+ color: map.get($intems-colors, "text-disable");
37
+
38
+ .spinner-solid {
39
+ color: map.get($intems-colors, "text-disable") !important;
40
+ }
41
+ }
42
+ }
43
+
44
+ @keyframes spin {
45
+ 100% {
46
+ transform: rotate(360deg);
47
+ }
48
+ }
@@ -0,0 +1,28 @@
1
+ import VueRouter from "vue-router";
2
+
3
+ export default {
4
+ name: "SecondaryButton",
5
+ props: {
6
+ isDisabled: {
7
+ type: Boolean,
8
+ default: false,
9
+ },
10
+ mini: {
11
+ type: Boolean,
12
+ default: false,
13
+ },
14
+ large: {
15
+ type: Boolean,
16
+ default: false,
17
+ },
18
+ isLoading: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
22
+ iconLeft: {
23
+ type: String,
24
+ default: "",
25
+ },
26
+ to: undefined as VueRouter,
27
+ },
28
+ };
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <router-link class="btn btn-secondary secondary-button waves-effect" v-if="to" :to="to">
3
+ <slot></slot>
4
+ </router-link>
5
+ <button
6
+ v-else
7
+ type="button"
8
+ class="btn btn-secondary secondary-button waves-effect"
9
+ :class="{ 'btn-mini': mini, 'btn-large': large }"
10
+ :disabled="isDisabled"
11
+ >
12
+ <i v-if="iconLeft" class="left-icon icon icon-small" :class="iconLeft"></i>
13
+ <span class="span-text">
14
+ <slot>Click me</slot>
15
+ </span>
16
+ <i v-show="isLoading" class="icon icon-small spinner-solid loading"></i>
17
+ </button>
18
+ </template>
19
+
20
+ <script lang="ts">
21
+ import SecondaryButton from './SecondaryButton.ts';
22
+
23
+ export default SecondaryButton;
24
+ </script>
25
+ <style lang="scss">
26
+ @import 'SecondaryButton';
27
+ </style>
@@ -0,0 +1,44 @@
1
+ @use "sass:map";
2
+ @import "../../scss/components/utils";
3
+ @import "../../scss/components/variables";
4
+
5
+ .modal.confirm {
6
+ box-sizing: border-box;
7
+ min-width: 280px;
8
+ min-height: 150px;
9
+ flex-direction: column;
10
+ background-color: map.get($intems-colors, "text-on-color");
11
+ position: fixed;
12
+
13
+ &.open {
14
+ display: flex !important;
15
+ }
16
+
17
+ .header {
18
+ padding-bottom: 10px;
19
+
20
+ i.modal-close {
21
+ float: right;
22
+ height: 24px;
23
+ line-height: 24px;
24
+ }
25
+
26
+ h3 {
27
+ color: map.get($intems-colors, "text-primary");
28
+ }
29
+
30
+ + .modal-footer {
31
+ padding-top: 30px;
32
+ }
33
+ }
34
+
35
+ .modal-content {
36
+ white-space: normal;
37
+ color: map.get($intems-colors, "text-primary");
38
+ overflow: initial;
39
+ font-weight: normal;
40
+ line-height: normal;
41
+ margin-right: 0;
42
+ padding-right: 0;
43
+ }
44
+ }
@@ -0,0 +1,82 @@
1
+ import Modal from "../modal/Modal.vue";
2
+ import ActionButton from "../../components/buttons/action-button/ActionButton.vue";
3
+ import SecondaryButton from "../../components/buttons/secondary-button/SecondaryButton.vue";
4
+ import { required, maxLength } from "vuelidate/lib/validators";
5
+ import { onlyLatin } from "../../helpers/Validations";
6
+
7
+ export type Comment = {
8
+ placeholder?: string;
9
+ description?: string;
10
+ required?: boolean;
11
+ };
12
+
13
+ type Form = {
14
+ comment?: string;
15
+ };
16
+
17
+ export default {
18
+ components: { Modal, SecondaryButton, ActionButton },
19
+ props: {
20
+ title: String,
21
+ description: String,
22
+ submitBtn: {
23
+ type: String,
24
+ default: "Yes",
25
+ },
26
+ rejectBtn: {
27
+ type: String,
28
+ default: "No",
29
+ },
30
+ comment: undefined as Comment,
31
+ },
32
+ validations: {
33
+ form: {
34
+ comment: { required, maxLength: maxLength(300), onlyLatin },
35
+ },
36
+ },
37
+ methods: {
38
+ open(payload?: unknown): void {
39
+ this.payload = payload;
40
+ this.$modal.show("confirm");
41
+ },
42
+ confirm(): void {
43
+ this.$emit(
44
+ "confirmed",
45
+ Object.keys(this.form).length ? this.form : this.payload
46
+ );
47
+ this.$modal.hide("confirm");
48
+ this.reset();
49
+ },
50
+ confirmWithValidation(): void {
51
+ this.$v.$touch();
52
+ if (!this.$v.$invalid) {
53
+ this.confirm();
54
+ }
55
+ },
56
+ reject(): void {
57
+ this.$modal.hide("confirm");
58
+ this.reset();
59
+
60
+ this.$emit("rejected", this.payload);
61
+ },
62
+ reset(): void {
63
+ this.$v.$reset();
64
+ this.form = {};
65
+ },
66
+ },
67
+ computed: {
68
+ hasForm(): boolean {
69
+ return this.comment;
70
+ },
71
+ hasDefaultSlot() {
72
+ return !!this.$slots.default;
73
+ },
74
+ },
75
+ data(): Record<string, unknown> {
76
+ return {
77
+ payload: undefined,
78
+ options: { dismissible: false },
79
+ form: {} as Form,
80
+ };
81
+ },
82
+ };
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div class="confirm">
3
+ <modal name="confirm" size="md">
4
+ <template slot="header">
5
+ {{ title ? title : "Confirm?" }}
6
+ </template>
7
+ <template slot="content">
8
+ <p>{{ description ? description : "" }}</p>
9
+ <form class="intems-form p-t-10" v-if="hasForm">
10
+ <div :class="{ 'form-group--error': $v.form.comment.$error }">
11
+ <div class="form-group">
12
+ <label v-if="comment.description" class="form__label">{{
13
+ comment.description
14
+ }}</label>
15
+ <textarea
16
+ ref="comment"
17
+ id="comment"
18
+ class="form__input"
19
+ spellcheck="false"
20
+ v-model="form.comment"
21
+ :placeholder="comment.placeholder"
22
+ @keydown.stop=""
23
+ ></textarea>
24
+ <div v-if="$v.form.comment.$error">
25
+ <div class="error" v-if="!$v.form.comment.required">
26
+ Comment is required
27
+ </div>
28
+ <div class="error" v-if="!$v.form.comment.maxLength">
29
+ Maximum length of this field is 300 symbols
30
+ </div>
31
+ <div class="error" v-if="!$v.form.comment.onlyLatin">
32
+ Only Latin letters allowed
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </form>
38
+ <slot name="confirm-content"></slot>
39
+ </template>
40
+ <template slot="footer">
41
+ <slot name="footer-description"></slot>
42
+
43
+ <secondary-button @click.native="reject">
44
+ {{ rejectBtn }}
45
+ </secondary-button>
46
+ <action-button
47
+ @click.native="hasForm ? confirmWithValidation() : confirm()"
48
+ >
49
+ {{ submitBtn }}
50
+ </action-button>
51
+ </template>
52
+ </modal>
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import Confirm from "./Confirm";
58
+
59
+ export default Confirm;
60
+ </script>
61
+
62
+ <style lang="scss">
63
+ @import "./Confirm";
64
+ </style>
@@ -0,0 +1,114 @@
1
+ @use "sass:map";
2
+ @import "../../scss/components/variables";
3
+
4
+ .give-kudos {
5
+ .user {
6
+ ul {
7
+ max-height: 200px;
8
+ }
9
+ }
10
+
11
+ a {
12
+ font-weight: bold;
13
+ }
14
+
15
+ .subtitle {
16
+ padding: 0px 0 30px 0;
17
+ }
18
+
19
+ .form {
20
+ .vs__selected-options {
21
+ span.vs__selected {
22
+ white-space: nowrap;
23
+ }
24
+
25
+ flex-wrap: nowrap;
26
+ }
27
+
28
+ display: grid;
29
+ grid-template-columns: auto 207px;
30
+ grid-gap: 15px;
31
+
32
+ .kudos-quantity {
33
+ height: 38px;
34
+ margin: 0;
35
+ border: solid 1px map.get($intems-colors, "border");
36
+ background-color: map.get($intems-colors, "surface-primary");
37
+ padding: 0 15px;
38
+ width: 175px;
39
+ }
40
+
41
+ input.kudos-quantity:focus {
42
+ border: solid 1px map.get($intems-colors, "primary");
43
+ box-shadow: none;
44
+ }
45
+
46
+ /* Chrome, Safari, Edge, Opera */
47
+ input::-webkit-outer-spin-button,
48
+ input::-webkit-inner-spin-button {
49
+ -webkit-appearance: none;
50
+ margin: 0;
51
+ }
52
+
53
+ /* Firefox */
54
+ input[type="number"] {
55
+ -moz-appearance: textfield;
56
+ }
57
+
58
+ .user {
59
+ grid-column: span 2;
60
+ margin-right: 1px;
61
+ }
62
+
63
+ .block-kudos-quantity {
64
+ width: 190px;
65
+ }
66
+
67
+ .block-kudos-category {
68
+ margin-right: 5px;
69
+ }
70
+
71
+ .description {
72
+ grid-column: span 2;
73
+
74
+ textarea {
75
+ resize: none;
76
+ min-height: 100px;
77
+ max-height: 300px;
78
+ min-width: 100%;
79
+ max-width: 100%;
80
+ border-radius: 2px;
81
+ border: solid 1px map.get($intems-colors, "border");
82
+ outline: none;
83
+ padding: 10px;
84
+ }
85
+
86
+ margin-right: 1px;
87
+ }
88
+
89
+ label {
90
+ display: flex;
91
+ font-size: $font-size-14;
92
+ margin-bottom: 10px;
93
+ color: map.get($intems-colors, "text-primary");
94
+ }
95
+
96
+ .error {
97
+ font-size: $font-size-12;
98
+ }
99
+
100
+ .error-field {
101
+ border: solid 1px map.get($intems-colors, "error");
102
+ }
103
+ }
104
+
105
+ button.btn-large[disabled] {
106
+ background-color: map.get($intems-colors, "primary-container-tag") !important;
107
+ }
108
+
109
+ .vs__clear {
110
+ svg {
111
+ display: none;
112
+ }
113
+ }
114
+ }