@konfuzio/document-validation-ui 0.1.34 → 0.1.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -269,6 +269,7 @@
269
269
  width: 60%;
270
270
  display: flex;
271
271
  align-items: center;
272
+ padding-right: 12px;
272
273
 
273
274
  .notification {
274
275
  background-color: transparent;
@@ -130,6 +130,7 @@ export default {
130
130
  this.selection.start,
131
131
  this.selection.end
132
132
  );
133
+ this.$emit("selectEntities", this.entitiesOnSelection(box, this.page));
133
134
  this.$store.dispatch("selection/getTextFromBboxes", {
134
135
  box,
135
136
  entities: false,
@@ -152,6 +152,7 @@
152
152
  <box-selection
153
153
  :page="page"
154
154
  @createAnnotations="handleCreateAnnotationsFromSelection"
155
+ @selectEntities="handleEntitiesFromSelection"
155
156
  />
156
157
  </v-layer>
157
158
  <v-layer v-if="isMultiSelection">
@@ -465,7 +466,6 @@ export default {
465
466
  )
466
467
  return;
467
468
  this.newAnnotation = [];
468
- // this.endSelection();
469
469
 
470
470
  const normalizedEntities = this.scaledEntities(entities, this.page);
471
471
  if (normalizedEntities) {
@@ -482,6 +482,25 @@ export default {
482
482
  }
483
483
  },
484
484
 
485
+ handleEntitiesFromSelection(entities) {
486
+ if (
487
+ this.categorizeModalIsActive ||
488
+ this.publicView ||
489
+ this.isDocumentReviewed
490
+ )
491
+ return;
492
+
493
+ const normalizedEntities = this.scaledEntities(entities, this.page);
494
+ if (normalizedEntities.length > 0) {
495
+ this.$store.dispatch(
496
+ "selection/setSelectedEntities",
497
+ normalizedEntities
498
+ );
499
+ } else {
500
+ this.$store.dispatch("selection/setSelectedEntities", null);
501
+ }
502
+ },
503
+
485
504
  handleClickedEntity(entity) {
486
505
  if (
487
506
  !entity ||
@@ -603,8 +622,8 @@ export default {
603
622
  */
604
623
  entityRect(entity) {
605
624
  let entityIsSelected = false;
606
- if (this.newAnnotation && this.newAnnotation.length > 0) {
607
- entityIsSelected = this.newAnnotation.find((selectedEntity) => {
625
+ if (this.selectedEntities && this.selectedEntities.length > 0) {
626
+ entityIsSelected = this.selectedEntities.find((selectedEntity) => {
608
627
  return (
609
628
  selectedEntity.original &&
610
629
  selectedEntity.original.offset_string ===