bfg-common 1.2.56 → 1.2.58
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.
|
@@ -1,247 +1,260 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="props.show" id="feedbackId" class="modal">
|
|
3
|
-
<div
|
|
4
|
-
id="feedback-modal-dialog-Id"
|
|
5
|
-
:class="['modal-dialog', { imageDrawn: isFeedbackImageDrawn }]"
|
|
6
|
-
:style="{
|
|
7
|
-
width: computeWidth,
|
|
8
|
-
height: computeHeight,
|
|
9
|
-
}"
|
|
10
|
-
>
|
|
11
|
-
<div class="modal-content">
|
|
12
|
-
<div class="modal-header">
|
|
13
|
-
<div class="flex-align-center">
|
|
14
|
-
<h3 class="modal-title">
|
|
15
|
-
{{ props.title }}
|
|
16
|
-
</h3>
|
|
17
|
-
</div>
|
|
18
|
-
<button
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
v-
|
|
32
|
-
:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class="btn btn-outline"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="props.show" id="feedbackId" class="modal">
|
|
3
|
+
<div
|
|
4
|
+
id="feedback-modal-dialog-Id"
|
|
5
|
+
:class="['modal-dialog', { imageDrawn: isFeedbackImageDrawn }]"
|
|
6
|
+
:style="{
|
|
7
|
+
width: computeWidth,
|
|
8
|
+
height: computeHeight,
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
11
|
+
<div class="modal-content">
|
|
12
|
+
<div class="modal-header">
|
|
13
|
+
<div class="flex-align-center">
|
|
14
|
+
<h3 class="modal-title">
|
|
15
|
+
{{ props.title }}
|
|
16
|
+
</h3>
|
|
17
|
+
</div>
|
|
18
|
+
<button
|
|
19
|
+
v-if="!props.isHideCloseIcon"
|
|
20
|
+
id="feedback-modal-close-icon"
|
|
21
|
+
class="close"
|
|
22
|
+
@click="hide"
|
|
23
|
+
>
|
|
24
|
+
<atoms-the-icon class="close-icon" name="close" />
|
|
25
|
+
</button>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<common-feedback-buttons v-model:select="type" :items="tabsItems" />
|
|
29
|
+
<div class="modal-body">
|
|
30
|
+
<common-feedback-message
|
|
31
|
+
v-show="type !== 2"
|
|
32
|
+
v-model:description="description"
|
|
33
|
+
v-model:email="email"
|
|
34
|
+
:selected-tab="type"
|
|
35
|
+
@screen-shot="onScreenShot"
|
|
36
|
+
/>
|
|
37
|
+
<common-feedback-visit-portal v-show="type === 2" />
|
|
38
|
+
</div>
|
|
39
|
+
<div
|
|
40
|
+
:class="{
|
|
41
|
+
'modal-footer': type !== 2,
|
|
42
|
+
'modal-no-footer': type === 2,
|
|
43
|
+
}"
|
|
44
|
+
>
|
|
45
|
+
<button
|
|
46
|
+
id="feedback-modal-cancel-button"
|
|
47
|
+
class="btn btn-outline"
|
|
48
|
+
@click="hide"
|
|
49
|
+
>
|
|
50
|
+
{{ localization.cancel }}
|
|
51
|
+
</button>
|
|
52
|
+
<button
|
|
53
|
+
class="btn btn-outline"
|
|
54
|
+
:class="props.loading && 'modal-dialog__loader'"
|
|
55
|
+
:disabled="!description"
|
|
56
|
+
@click="submit"
|
|
57
|
+
>
|
|
58
|
+
<atoms-loader-pre-loader
|
|
59
|
+
v-if="props.loading"
|
|
60
|
+
id="loader"
|
|
61
|
+
class="absolute-center button__loading"
|
|
62
|
+
:show="props.loading"
|
|
63
|
+
/>
|
|
64
|
+
<span v-else>
|
|
65
|
+
{{ localization.send }}
|
|
66
|
+
</span>
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="modal-backdrop" />
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { UI_I_Localization } from '~/models/interfaces'
|
|
77
|
+
import {
|
|
78
|
+
UI_I_FeedbackButtonsItem,
|
|
79
|
+
UI_I_FeedbackForm,
|
|
80
|
+
UI_I_MessageImg,
|
|
81
|
+
} from '~/components/common/feedback/models/interfaces'
|
|
82
|
+
import { UI_T_FeedbackType } from '~/components/common/feedback/models/types'
|
|
83
|
+
import { feedbackTabs } from '~/components/common/feedback/config/feedbackTabs'
|
|
84
|
+
|
|
85
|
+
const props = defineProps<{
|
|
86
|
+
show: boolean
|
|
87
|
+
title: string
|
|
88
|
+
width?: string
|
|
89
|
+
height?: string
|
|
90
|
+
submitText?: string
|
|
91
|
+
loading?: boolean
|
|
92
|
+
isHideCloseIcon?: boolean
|
|
93
|
+
}>()
|
|
94
|
+
const emits = defineEmits<{
|
|
95
|
+
(event: 'submit', value: UI_I_FeedbackForm): void
|
|
96
|
+
(event: 'hide'): void
|
|
97
|
+
}>()
|
|
98
|
+
|
|
99
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
100
|
+
|
|
101
|
+
const tabsItems = computed<UI_I_FeedbackButtonsItem[]>(() =>
|
|
102
|
+
feedbackTabs(localization.value)
|
|
103
|
+
)
|
|
104
|
+
const reset = (): void => {
|
|
105
|
+
email.value = ''
|
|
106
|
+
description.value = ''
|
|
107
|
+
type.value = undefined
|
|
108
|
+
}
|
|
109
|
+
const hide = (): void => {
|
|
110
|
+
emits('hide')
|
|
111
|
+
|
|
112
|
+
reset()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const submit = (): void => {
|
|
116
|
+
if (type.value !== 0 && type.value !== 1) return
|
|
117
|
+
|
|
118
|
+
const canvas = document.getElementById('feedbackImg') as HTMLCanvasElement
|
|
119
|
+
|
|
120
|
+
const image = canvas?.toDataURL().match(/base64,(.+)/)?.[1] || ''
|
|
121
|
+
emits('submit', {
|
|
122
|
+
image,
|
|
123
|
+
type: type.value,
|
|
124
|
+
description: description.value,
|
|
125
|
+
email: email.value,
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
reset()
|
|
129
|
+
}
|
|
130
|
+
const computeWidth = computed<string | undefined>(() =>
|
|
131
|
+
isFeedbackImageDrawn.value && type.value !== 2
|
|
132
|
+
? feedbackImageDrawnWidth.value
|
|
133
|
+
: props.width
|
|
134
|
+
)
|
|
135
|
+
const computeHeight = computed<string>(() =>
|
|
136
|
+
!isFeedbackImageDrawn.value && type.value !== 2
|
|
137
|
+
? ''
|
|
138
|
+
: type.value !== 2
|
|
139
|
+
? '100%'
|
|
140
|
+
: '420px'
|
|
141
|
+
)
|
|
142
|
+
const isFeedbackImageDrawn = ref<boolean>(false)
|
|
143
|
+
const feedbackImageDrawnWidth = ref<string>('')
|
|
144
|
+
const type = ref<UI_T_FeedbackType>(undefined)
|
|
145
|
+
const description = ref<string>('')
|
|
146
|
+
const email = ref<string>('')
|
|
147
|
+
|
|
148
|
+
const onScreenShot = (value: UI_I_MessageImg): void => {
|
|
149
|
+
isFeedbackImageDrawn.value = value.hasTakeScreenshot
|
|
150
|
+
feedbackImageDrawnWidth.value = value.width
|
|
151
|
+
}
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<style scoped lang="scss">
|
|
155
|
+
.modal {
|
|
156
|
+
position: fixed;
|
|
157
|
+
top: 0;
|
|
158
|
+
bottom: 0;
|
|
159
|
+
right: 0;
|
|
160
|
+
left: 0;
|
|
161
|
+
z-index: 1050;
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
align-items: center;
|
|
166
|
+
padding: 48px;
|
|
167
|
+
overflow-y: auto;
|
|
168
|
+
overflow-x: auto;
|
|
169
|
+
|
|
170
|
+
.modal-dialog {
|
|
171
|
+
.modal-content {
|
|
172
|
+
position: relative;
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-direction: column;
|
|
175
|
+
background-color: var(--modal-bg-color);
|
|
176
|
+
box-shadow: 0 5px 15px rgb(0 0 0 / 50%);
|
|
177
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
178
|
+
border-radius: 3px;
|
|
179
|
+
background-clip: padding-box;
|
|
180
|
+
padding: 24px;
|
|
181
|
+
height: 100%;
|
|
182
|
+
-webkit-animation-name: animateTop;
|
|
183
|
+
-webkit-animation-duration: 0.4s;
|
|
184
|
+
animation-name: animateTop;
|
|
185
|
+
animation-duration: 0.4s;
|
|
186
|
+
overflow-x: auto;
|
|
187
|
+
|
|
188
|
+
.modal-header {
|
|
189
|
+
display: flex;
|
|
190
|
+
justify-content: space-between;
|
|
191
|
+
align-items: flex-start;
|
|
192
|
+
|
|
193
|
+
.modal-title {
|
|
194
|
+
color: var(--main-color-mode);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.close-icon {
|
|
198
|
+
fill: var(--close-icon);
|
|
199
|
+
width: 24px;
|
|
200
|
+
height: 24px;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
.modal-info {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: row;
|
|
206
|
+
align-items: center;
|
|
207
|
+
margin-bottom: 20px;
|
|
208
|
+
|
|
209
|
+
:deep(.icon-info-standart) {
|
|
210
|
+
width: 20px !important;
|
|
211
|
+
min-width: 20px !important;
|
|
212
|
+
height: 20px;
|
|
213
|
+
min-height: 20px;
|
|
214
|
+
}
|
|
215
|
+
.info-icon {
|
|
216
|
+
height: 24px;
|
|
217
|
+
}
|
|
218
|
+
.info-text {
|
|
219
|
+
margin-left: 5px;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
.modal-footer {
|
|
223
|
+
align-items: flex-end;
|
|
224
|
+
margin-top: auto;
|
|
225
|
+
.btn:last-child {
|
|
226
|
+
margin-left: 5px;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
.modal-no-footer {
|
|
230
|
+
opacity: 0;
|
|
231
|
+
width: 200px;
|
|
232
|
+
height: 60px;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
&__loader {
|
|
236
|
+
position: relative;
|
|
237
|
+
pointer-events: none;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.modal-backdrop {
|
|
242
|
+
opacity: 1;
|
|
243
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
244
|
+
}
|
|
245
|
+
.button {
|
|
246
|
+
&__loading {
|
|
247
|
+
display: flex;
|
|
248
|
+
:deep(.spinner) {
|
|
249
|
+
width: 25px;
|
|
250
|
+
height: 25px;
|
|
251
|
+
min-width: 25px;
|
|
252
|
+
min-height: 25px;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
.imageDrawn {
|
|
258
|
+
width: auto;
|
|
259
|
+
}
|
|
260
|
+
</style>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<textarea
|
|
6
6
|
id="feedback-message-textarea"
|
|
7
7
|
v-model="descriptionLocal"
|
|
8
|
-
:disabled="
|
|
8
|
+
:disabled="props.type === null"
|
|
9
9
|
class="clr-textarea ng-pristine ng-invalid ng-touched textarea"
|
|
10
10
|
:placeholder="descriptionTextPlaceholder"
|
|
11
11
|
></textarea>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<span class="text">{{ localization.emailAddress }} </span>
|
|
15
15
|
<input
|
|
16
16
|
id="feedback-email-input"
|
|
17
|
-
v-model="
|
|
17
|
+
v-model="emailLocal"
|
|
18
18
|
type="email"
|
|
19
19
|
class="email"
|
|
20
20
|
:placeholder="localization.optionalInCaseWeNeed"
|
|
@@ -136,7 +136,7 @@ import { UI_I_Localization } from '~/models/interfaces'
|
|
|
136
136
|
import { UI_I_MessageImg } from '~/components/common/feedback/models/interfaces'
|
|
137
137
|
|
|
138
138
|
const props = defineProps<{
|
|
139
|
-
|
|
139
|
+
type: 0 | 1 | 2 | null
|
|
140
140
|
description: string
|
|
141
141
|
email: string
|
|
142
142
|
}>()
|
|
@@ -154,7 +154,7 @@ const descriptionLocal = computed<string>({
|
|
|
154
154
|
emits('update:description', value)
|
|
155
155
|
},
|
|
156
156
|
})
|
|
157
|
-
const
|
|
157
|
+
const emailLocal = computed<string>({
|
|
158
158
|
get() {
|
|
159
159
|
return props.email
|
|
160
160
|
},
|
|
@@ -166,8 +166,8 @@ const localization = computed<UI_I_Localization>(() => useLocal())
|
|
|
166
166
|
// const drawingPanel = computed(() => drawingPanelFunc(localization.value))
|
|
167
167
|
|
|
168
168
|
const descriptionTextPlaceholder = computed<string>(() => {
|
|
169
|
-
if (props.
|
|
170
|
-
if (props.
|
|
169
|
+
if (props.type === 0) return localization.value.whatIsTheProblemHowCan
|
|
170
|
+
if (props.type === 1) return localization.value.tellUsWhatYouEnjoyedSo
|
|
171
171
|
return localization.value.selectFeedbackType
|
|
172
172
|
})
|
|
173
173
|
const hasTakeScreenshot = ref<boolean>(false)
|
|
@@ -8,8 +8,12 @@ export interface UI_I_MessageImg {
|
|
|
8
8
|
width: string
|
|
9
9
|
}
|
|
10
10
|
export interface UI_I_DrawingItem {
|
|
11
|
-
|
|
12
11
|
function: string
|
|
13
12
|
text: string
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
export interface UI_I_FeedbackForm {
|
|
15
|
+
type: 0 | 1 // 0 problem, 1 complement
|
|
16
|
+
description: string
|
|
17
|
+
email: string
|
|
18
|
+
image: string // base64
|
|
15
19
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UI_T_FeedbackType = 0 | 1 | 2 | undefined // 0 problem, 1 complement, 2 idea
|