bfg-common 1.4.417 → 1.4.418

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.
@@ -197,9 +197,9 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
197
197
  import type { UI_I_FeedbackCanvasOptions } from '~/components/common/layout/theHeader/feedback/new/lib/models/interfaces'
198
198
 
199
199
  const optionsModel = defineModel<UI_I_FeedbackCanvasOptions>({ required: true })
200
- const emits = defineEmits<{
201
- (event: 'screen-shot', value: any): void
202
- }>()
200
+ // const emits = defineEmits<{
201
+ // (event: 'screen-shot', value: any): void
202
+ // }>()
203
203
 
204
204
  const localization = computed<UI_I_Localization>(() => useLocal())
205
205
 
@@ -221,11 +221,11 @@ const isDisabledButton = computed<boolean>(() => indexArray.value === 0)
221
221
 
222
222
  const onTakeScreenshot = (): void => {
223
223
  optionsModel.value.hasTakeScreenshot = true
224
- const value = {
225
- width: window.outerWidth + 'px',
226
- }
224
+ // const value = {
225
+ // width: window.outerWidth + 'px',
226
+ // }
227
227
 
228
- emits('screen-shot', value)
228
+ // emits('screen-shot', value)
229
229
  const parentMain = document.getElementById('feedbackId')
230
230
  const parentModalDialog = document.getElementById('feedback-modal-dialog-Id')
231
231
  if (!parentMain || !parentModalDialog) return
@@ -278,6 +278,10 @@ const onUploadFile = (): void => {
278
278
  img.onload = (): void => {
279
279
  feedbackImg.value.width = img.width
280
280
  feedbackImg.value.height = img.height
281
+
282
+ feedbackImg.value.style.width = '500px'
283
+ feedbackImg.value.style.height = img.height / (img.width / 500) + 'px'
284
+
281
285
  context.drawImage(img, 0, 0, img.width, img.height)
282
286
  drawingArray.length = 0
283
287
  indexArray.value = 0
@@ -289,10 +293,10 @@ const onUploadFile = (): void => {
289
293
  feedbackImg.value.height
290
294
  )
291
295
  )
292
- const value = {
293
- width: window.outerWidth + 'px',
294
- }
295
- emits('screen-shot', value)
296
+ // const value = {
297
+ // width: window.outerWidth + 'px',
298
+ // }
299
+ // emits('screen-shot', value)
296
300
  const parentMain = document.getElementById('feedbackId')
297
301
  const parentModalDialog = document.getElementById(
298
302
  'feedback-modal-dialog-Id'
@@ -379,10 +383,10 @@ const onRemoveScreenshot = (): void => {
379
383
  feedbackImg.value.height = 0
380
384
  feedbackImgWrap.value.style.width = 0 + 'px'
381
385
  feedbackImgWrap.value.style.height = 0 + 'px'
382
- const value = {
383
- width: memoryParentModalDialog.value,
384
- }
385
- emits('screen-shot', value)
386
+ // const value = {
387
+ // width: memoryParentModalDialog.value,
388
+ // }
389
+ // emits('screen-shot', value)
386
390
  clearAll()
387
391
  }
388
392
 
@@ -439,8 +443,22 @@ onBeforeUnmount(() => {
439
443
  feedbackImg.value.removeEventListener('mouseout', stop, false)
440
444
  })
441
445
  const onAnnotateImage = (): void => {
446
+ feedbackImg.value.style.width = feedbackImg.value.width + 'px'
447
+ feedbackImg.value.style.height = feedbackImg.value.height + 'px'
448
+
442
449
  optionsModel.value.isAnnotateImage = true
443
450
  }
451
+ watch(
452
+ optionsModel,
453
+ (newValue: UI_I_FeedbackCanvasOptions) => {
454
+ if (!newValue.isAnnotateImage && feedbackImg.value) {
455
+ feedbackImg.value.style.width = '500px'
456
+ feedbackImg.value.style.height =
457
+ feedbackImg.value.height / (feedbackImg.value.width / 500) + 'px'
458
+ }
459
+ },
460
+ { deep: true, immediate: true }
461
+ )
444
462
  </script>
445
463
 
446
464
  <style lang="scss" scoped>
@@ -494,6 +512,7 @@ const onAnnotateImage = (): void => {
494
512
  &.annotate {
495
513
  width: 100%;
496
514
  height: 460px;
515
+ overflow: auto;
497
516
  }
498
517
  &.disabled {
499
518
  display: none;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.417",
4
+ "version": "1.4.418",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",